diff options
383 files changed, 6376 insertions, 20205 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 33c2e7d..26ed9dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -156,12 +156,16 @@ if (NOT EXISTS ${USCXML_PREBUILT_LIBRARY_PATH}) endif() -if (WIN32 OR CMAKE_CROSSCOMPILING) +if (CMAKE_CROSSCOMPILING) OPTION(BUILD_SHARED_LIBS "Build shared libraries" OFF) else() OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON) endif() +if (NOT BUILD_SHARED_LIBS) + add_definitions("-DUSCXML_STATIC") +endif() + # # BUILD_PREFER_PREBUILT_LIBS: # Do we want to search system paths or contrib/prebuilt first? @@ -289,8 +293,21 @@ elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") add_definitions("-D_CRT_SECURE_NO_WARNINGS") add_definitions("/bigobj") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GL") + + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LTCG") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LTCG") + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /LTCG") + set(STATIC_LIBRARY_FLAGS "${STATIC_LIBRARY_FLAGS} /LTCG") + + # set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:LIBCMT") + # set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:LIBCMT") + # set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /NODEFAULTLIB:LIBCMT") + # set(STATIC_LIBRARY_FLAGS "${STATIC_LIBRARY_FLAGS} /NODEFAULTLIB:LIBCMT") + # SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB") # SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:MSVCRTD.lib") + elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-parentheses-equality") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-string-plus-int") @@ -348,7 +365,7 @@ endif() # built shared or static libraries? if(BUILD_SHARED_LIBS) - add_definitions("-DCOMPILING_DLL") + add_definitions("-DUSCXML_EXPORT") else() add_definitions("-DUSCXML_STATIC") endif() @@ -661,8 +678,8 @@ endif() find_package(MILES) if (MILES_FOUND) # openal is only needed for miles - find_package(OpenAL REQUIRED) - find_package(JPEG REQUIRED) + find_package(OpenAL) + find_package(JPEG) list (APPEND MILES_LIBRARIES "iconv") list (APPEND MILES_LIBRARIES ${JPEG_LIBRARIES}) list (APPEND USCXML_INCLUDE_DIRS ${OPENAL_INCLUDE_DIR}) @@ -694,8 +711,8 @@ SET(USCXML_ELEMENTS) SET(USCXML_DATAMODELS) SET(USCXML_LANGUAGE_BINDINGS) -add_subdirectory(src/uscxml) include_directories(${USCXML_INCLUDE_DIRS}) +add_subdirectory(src/uscxml) if (WIN32) list(APPEND USCXML_FILES "${PROJECT_SOURCE_DIR}/contrib/src/getopt/getopt.c") endif() @@ -758,6 +775,9 @@ endif() if (BUILD_AS_PLUGINS) add_library(uscxml ${USCXML_FILES}) target_link_libraries(uscxml ${USCXML_CORE_LIBS}) + set_target_properties(uscxml PROPERTIES COMPILE_FLAGS "-DUSCXML_EXPORT") +# set_target_properties(uscxml PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + add_definitions(-DPLUMA_EXPORTS) else() add_library(uscxml ${USCXML_FILES}) target_link_libraries(uscxml ${USCXML_OPT_LIBS} ${USCXML_CORE_LIBS}) @@ -773,7 +793,7 @@ if (NOT CMAKE_CROSSCOMPILING) target_link_libraries(uscxml-browser uscxml) if (NOT CMAKE_CROSSCOMPILING) set_target_properties(uscxml-browser PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE) - cotire(uscxml-browser) +# cotire(uscxml-browser) endif() set_target_properties(uscxml-browser PROPERTIES FOLDER "Apps") diff --git a/apps/uscxml-browser.cpp b/apps/uscxml-browser.cpp index e6869c4..3cb1138 100644 --- a/apps/uscxml-browser.cpp +++ b/apps/uscxml-browser.cpp @@ -119,7 +119,7 @@ int main(int argc, char** argv) { if (!options) { InterpreterOptions::printUsageAndExit(argv[0]); } - + // setup logging google::LogToStderr(); google::InitGoogleLogging(argv[0]); @@ -131,13 +131,13 @@ int main(int argc, char** argv) { sslConf->privateKey = options.certificate; sslConf->publicKey = options.certificate; sslConf->port = options.httpsPort; - + } else if (options.privateKey.length() > 0 && options.publicKey.length() > 0) { sslConf = new HTTPServer::SSLConfig(); sslConf->privateKey = options.privateKey; sslConf->publicKey = options.publicKey; sslConf->port = options.httpsPort; - + } HTTPServer::getInstance(options.httpPort, sslConf); @@ -148,7 +148,7 @@ int main(int argc, char** argv) { InterpreterOptions* currOptions = confIter->second; std::string documentURL = confIter->first; - + LOG(INFO) << "Processing " << documentURL; Interpreter interpreter = Interpreter::fromURI(documentURL); if (interpreter) { @@ -163,7 +163,7 @@ int main(int argc, char** argv) { SCXMLDotWriter* dotWriter = new SCXMLDotWriter(); interpreter.addMonitor(dotWriter); } - + interpreters.push_back(interpreter); } else { @@ -192,6 +192,6 @@ int main(int argc, char** argv) { } } } - + return EXIT_SUCCESS; }
\ No newline at end of file diff --git a/apps/w3c-mmi/im/uscxml-interaction-manager.cpp b/apps/w3c-mmi/im/uscxml-interaction-manager.cpp index 19e9d9b..9d93a55 100644 --- a/apps/w3c-mmi/im/uscxml-interaction-manager.cpp +++ b/apps/w3c-mmi/im/uscxml-interaction-manager.cpp @@ -167,7 +167,7 @@ int main(int argc, char** argv) { } } - (void)verbose; + (void)verbose; // intialize http server on given port HTTPServer::getInstance(port); diff --git a/contrib/cmake/FindLIBICAL.cmake b/contrib/cmake/FindLIBICAL.cmake index a0cfe43..6510f96 100644 --- a/contrib/cmake/FindLIBICAL.cmake +++ b/contrib/cmake/FindLIBICAL.cmake @@ -1,5 +1,6 @@ -FIND_PATH(LIBICAL_INCLUDE_DIR libical/ical.h - PATH_SUFFIXES include src +# we cannot search for ical.h as we might find the wrong one without the libical suffix +FIND_PATH(LIBICAL_INCLUDE_DIR icalcomponent.h + PATH_SUFFIXES include/libical PATHS /usr/local /usr diff --git a/contrib/ctest/hosts/epikur-win7-64.ctest b/contrib/ctest/hosts/epikur-win7-64.ctest index ba58a6b..4f6e711 100644 --- a/contrib/ctest/hosts/epikur-win7-64.ctest +++ b/contrib/ctest/hosts/epikur-win7-64.ctest @@ -11,3 +11,8 @@ set(RETAIN_BUILD_DIR OFF) set(CTEST_BUILD_NAME "win7-x86_64 msvc") include("tests/xpath.ctest") include("common.ctest.inc") + +set(RETAIN_BUILD_DIR OFF) +set(CTEST_BUILD_NAME "win7-x86_64 msvc") +include("tests/plugins.ctest") +include("common.ctest.inc") diff --git a/contrib/ctest/hosts/epikur.local.ctest b/contrib/ctest/hosts/epikur.local.ctest index 7b2a801..f7d728d 100644 --- a/contrib/ctest/hosts/epikur.local.ctest +++ b/contrib/ctest/hosts/epikur.local.ctest @@ -2,18 +2,18 @@ set(CTEST_CMAKE_GENERATOR "Unix Makefiles") set(CTEST_SITE "epikur.local") set(CTEST_BUILD_CONFIGURATION "Debug") -set(RETAIN_BUILD_DIR ON) +set(RETAIN_BUILD_DIR OFF) set(CTEST_BUILD_NAME "darwin-x86_64 llvm") include("tests/plugins.ctest") include("common.ctest.inc") -# set(RETAIN_BUILD_DIR OFF) -# set(CTEST_BUILD_NAME "darwin-x86_64 llvm") -# include("tests/ecma.ctest") -# include("common.ctest.inc") -# -# set(RETAIN_BUILD_DIR OFF) -# set(CTEST_BUILD_NAME "darwin-x86_64 llvm") -# include("tests/xpath.ctest") -# include("common.ctest.inc") -# +set(RETAIN_BUILD_DIR OFF) +set(CTEST_BUILD_NAME "darwin-x86_64 llvm") +include("tests/ecma.ctest") +include("common.ctest.inc") + +set(RETAIN_BUILD_DIR OFF) +set(CTEST_BUILD_NAME "darwin-x86_64 llvm") +include("tests/xpath.ctest") +include("common.ctest.inc") + diff --git a/contrib/dom/scripts/CodeGeneratorArabicaJSC.pm b/contrib/dom/scripts/CodeGeneratorArabicaJSC.pm index f9a2d25..27ad7a7 100644 --- a/contrib/dom/scripts/CodeGeneratorArabicaJSC.pm +++ b/contrib/dom/scripts/CodeGeneratorArabicaJSC.pm @@ -45,26 +45,25 @@ my %implIncludes = (); my %headerIncludes = (); # Default .h template -my $headerTemplate = << "EOF"; -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +my $headerTemplate = << 'EOF'; +/** + * @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 + */ EOF # Default constructor @@ -728,6 +727,7 @@ sub GenerateImplementation $parentClass = "JSC" . $parent; last; } + push(@implContent, "namespace Arabica {\n"); push(@implContent, "namespace DOM {\n\n"); push(@implContent, "JSClassRef JSC${interfaceName}::Tmpl;\n"); @@ -767,7 +767,8 @@ sub WriteData # exit(); # Update a .cpp file if the contents are changed. - my $contents = join "", @implContentHeader; + my $contents = $headerTemplate; + $contents .= join "", @implContentHeader; my @includes = (); my %implIncludeConditions = (); diff --git a/contrib/dom/scripts/CodeGeneratorArabicaV8.pm b/contrib/dom/scripts/CodeGeneratorArabicaV8.pm index 08a5805..0095f6b 100644 --- a/contrib/dom/scripts/CodeGeneratorArabicaV8.pm +++ b/contrib/dom/scripts/CodeGeneratorArabicaV8.pm @@ -45,26 +45,26 @@ my %implIncludes = (); my %headerIncludes = (); # Default .h template -my $headerTemplate = << "EOF"; -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +my $headerTemplate = << 'EOF'; +/** + * @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 + */ + EOF # Default constructor @@ -666,6 +666,7 @@ sub GenerateImplementation $parentClass = "V8" . $parent; last; } + push(@implContent, "namespace Arabica {\n"); push(@implContent, "namespace DOM {\n\n"); push(@implContent, " v8::Persistent<v8::FunctionTemplate> V8${interfaceName}::Tmpl;\n"); @@ -710,7 +711,8 @@ sub WriteData # exit(); # Update a .cpp file if the contents are changed. - my $contents = join "", @implContentHeader; + my $contents = $headerTemplate; + $contents .= join "", @implContentHeader; my @includes = (); my %implIncludeConditions = (); diff --git a/contrib/dom/scripts/CodeGeneratorCPP.pm b/contrib/dom/scripts/CodeGeneratorCPP.pm deleted file mode 100644 index bb9f3ee..0000000 --- a/contrib/dom/scripts/CodeGeneratorCPP.pm +++ /dev/null @@ -1,986 +0,0 @@ - -# Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> -# Copyright (C) 2006 Anders Carlsson <andersca@mac.com> -# Copyright (C) 2006, 2007 Samuel Weinig <sam@webkit.org> -# Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> -# Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. -# Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> -# Copyright (C) Research In Motion Limited 2010. All rights reserved. -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library 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. See the GNU -# Library General Public License for more details. -# -# You should have received a copy of the GNU Library General Public License -# aint with this library; see the file COPYING.LIB. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# - -package CodeGeneratorCPP; - -use constant FileNamePrefix => "WebDOM"; - -# Global Variables - -my @headerContentHeader = (); -my @headerContent = (); -my %headerForwardDeclarations = (); - -my @implContentHeader = (); -my @implContent = (); -my %implIncludes = (); - -# Constants -my $exceptionInit = "WebCore::ExceptionCode ec = 0;"; -my $exceptionRaiseOnError = "webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));"; - -# Default License Templates -my $headerLicenseTemplate = << "EOF"; -/* - * Copyright (C) Research In Motion Limited 2010. All rights reserved. - * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2006 Samuel Weinig <sam.weinig\@gmail.com> - * Copyright (C) Research In Motion Limited 2010. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -EOF - -my $implementationLicenseTemplate = << "EOF"; -/* - * This file is part of the WebKit open source project. - * This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -EOF - -# Default constructor -sub new -{ - my $object = shift; - my $reference = { }; - - $codeGenerator = shift; - shift; # $useLayerOnTop - shift; # $preprocessor - shift; # $writeDependencies - - bless($reference, $object); - return $reference; -} - -sub GenerateInterface -{ - my $object = shift; - my $interface = shift; - my $defines = shift; - - my $name = $interface->name; - my $className = GetClassName($name); - my $parentClassName = "WebDOM" . GetParentImplClassName($interface); - - $object->GenerateHeader($interface); - $object->GenerateImplementation($interface); -} - -sub GetClassName -{ - my $name = shift; - - # special cases - return "WebDOMString" if $codeGenerator->IsStringType($name) or $name eq "SerializedScriptValue"; - return "WebDOMObject" if $name eq "DOMObject"; - return "bool" if $name eq "boolean"; - return $name if $codeGenerator->IsPrimitiveType($name); - - return "WebDOM$name"; -} - -sub GetImplClassName -{ - return shift; -} - -sub GetParentImplClassName -{ - my $interface = shift; - - if (@{$interface->parents} eq 0) { - return "EventTarget" if $interface->extendedAttributes->{"EventTarget"}; - return "Object"; - } - - return $interface->parents(0); -} - -sub GetParent -{ - my $interface = shift; - my $numParents = @{$interface->parents}; - - my $parent = ""; - if ($numParents eq 0) { - $parent = "WebDOMObject"; - $parent = "WebDOMEventTarget" if $interface->extendedAttributes->{"EventTarget"}; - } elsif ($numParents eq 1) { - my $parentName = $interface->parents(0); - $parent = "WebDOM" . $parentName; - } else { - my @parents = @{$interface->parents}; - my $firstParent = shift(@parents); - $parent = "WebDOM" . $firstParent; - } - - return $parent; -} - -sub SkipFunction -{ - my $function = shift; - - return 1 if $function->signature->extendedAttributes->{"Custom"}; - - # FIXME: We don't generate bindings for SVG related interfaces yet - return 1 if $function->signature->name =~ /getSVGDocument/; - - if ($codeGenerator->GetArrayType($function->signature->type)) { - return 1; - } - - if ($codeGenerator->GetSequenceType($function->signature->type)) { - return 1; - } - - foreach my $param (@{$function->parameters}) { - return 1 if $codeGenerator->GetSequenceType($param->type); - return 1 if $param->extendedAttributes->{"Clamp"}; - } - - # FIXME: This is typically used to add script execution state arguments to the method. - # These functions will not compile with the C++ bindings as is, so disable them - # to restore compilation until a proper implementation can be developed. - return 1 if $function->signature->extendedAttributes->{"CallWith"}; -} - -sub SkipAttribute -{ - my $attribute = shift; - - return 1 if $attribute->signature->extendedAttributes->{"Custom"} - or $attribute->signature->extendedAttributes->{"CustomGetter"}; - - return 1 if $attribute->signature->type =~ /Constructor$/; - - return 1 if $codeGenerator->IsTypedArrayType($attribute->signature->type); - - if ($codeGenerator->GetArrayType($attribute->signature->type)) { - return 1; - } - - if ($codeGenerator->GetSequenceType($attribute->signature->type)) { - return 1; - } - - $codeGenerator->AssertNotSequenceType($attribute->signature->type); - - # FIXME: This is typically used to add script execution state arguments to the method. - # These functions will not compile with the C++ bindings as is, so disable them - # to restore compilation until a proper implementation can be developed. - return 1 if $attribute->signature->extendedAttributes->{"CallWith"}; - - return 0; -} - -sub GetCPPType -{ - my $type = shift; - my $useConstReference = shift; - my $name = GetClassName($type); - - return "int" if $type eq "long"; - return "unsigned" if $name eq "unsigned long"; - return "unsigned short" if $type eq "CompareHow"; - return "double" if $name eq "Date"; - - if ($codeGenerator->IsStringType($type)) { - if ($useConstReference) { - return "const $name&"; - } - - return $name; - } - - return $name if $codeGenerator->IsPrimitiveType($type) or $type eq "DOMTimeStamp"; - return "const $name&" if $useConstReference; - return $name; -} - -sub ConversionNeeded -{ - my $type = shift; - return !$codeGenerator->IsNonPointerType($type) && !$codeGenerator->IsStringType($type); -} - -sub GetCPPTypeGetter -{ - my $argName = shift; - my $type = shift; - - return $argName if $codeGenerator->IsPrimitiveType($type) or $codeGenerator->IsStringType($type); - return "static_cast<WebCore::Range::CompareHow>($argName)" if $type eq "CompareHow"; - return "WebCore::SerializedScriptValue::create(WTF::String($argName))" if $type eq "SerializedScriptValue"; - return "to" . GetNamespaceForClass($argName) . "($argName)"; -} - -sub AddForwardDeclarationsForType -{ - my $type = shift; - my $public = shift; - - return if $codeGenerator->IsNonPointerType($type) or $codeGenerator->IsStringType($type); - - my $class = GetClassName($type); - $headerForwardDeclarations{$class} = 1 if $public; -} - -sub AddIncludesForType -{ - my $type = shift; - - return if $codeGenerator->GetSequenceType($type); - return if $codeGenerator->GetArrayType($type); - return if $codeGenerator->IsNonPointerType($type); - return if $type =~ /Constructor/; - - if ($codeGenerator->IsStringType($type)) { - $implIncludes{"wtf/text/AtomicString.h"} = 1; - $implIncludes{"KURL.h"} = 1; - $implIncludes{"WebDOMString.h"} = 1; - return; - } - - if ($type eq "DOMObject") { - $implIncludes{"WebDOMObject.h"} = 1; - return; - } - - if ($type eq "EventListener") { - $implIncludes{"WebNativeEventListener.h"} = 1; - return; - } - - if ($type eq "SerializedScriptValue") { - $implIncludes{"SerializedScriptValue.h"} = 1; - return; - } - - # Also include CSSImportRule so that the toWebKit methods for subclasses are found - if ($type eq "CSSRule") { - $implIncludes{"WebDOMCSSImportRule.h"} = 1; - } - - $implIncludes{"Node.h"} = 1 if $type eq "NodeList"; - $implIncludes{"StylePropertySet.h"} = 1 if $type eq "CSSStyleDeclaration"; - - # Default, include the same named file (the implementation) and the same name prefixed with "WebDOM". - $implIncludes{"$type.h"} = 1 unless $type eq "DOMObject"; - $implIncludes{"WebDOM$type.h"} = 1; -} - -sub GetNamespaceForClass -{ - my $type = shift; - return "WTF" if (($type eq "ArrayBuffer") or ($type eq "ArrayBufferView")); - return "WTF" if (($type eq "Uint8Array") or ($type eq "Uint8ClampedArray") or ($type eq "Uint16Array") or ($type eq "Uint32Array")); - return "WTF" if (($type eq "Int8Array") or ($type eq "Int16Array") or ($type eq "Int32Array")); - return "WTF" if (($type eq "Float32Array") or ($type eq "Float64Array")); - return "WebCore"; -} - -sub GenerateHeader -{ - my $object = shift; - my $interface = shift; - - my $interfaceName = $interface->name; - my $className = GetClassName($interfaceName); - my $implClassName = GetImplClassName($interfaceName); - - my $implClassNameWithNamespace = GetNamespaceForClass($implClassName) . "::" . $implClassName; - - my $parentName = ""; - $parentName = GetParent($interface); - - my $numConstants = @{$interface->constants}; - my $numAttributes = @{$interface->attributes}; - my $numFunctions = @{$interface->functions}; - - # - Add default header template - @headerContentHeader = split("\r", $headerLicenseTemplate); - push(@headerContentHeader, "\n#ifndef $className" . "_h"); - push(@headerContentHeader, "\n#define $className" . "_h\n\n"); - - my $conditionalString = $codeGenerator->GenerateConditionalString($interface); - push(@headerContentHeader, "#if ${conditionalString}\n\n") if $conditionalString; - - # - INCLUDES - - - my %headerIncludes = (); - $headerIncludes{"WebDOMString.h"} = 1; - $headerIncludes{"$parentName.h"} = 1; - foreach my $include (sort keys(%headerIncludes)) { - push(@headerContentHeader, "#include <$include>\n"); - } - - push(@headerContent, "class $className"); - push(@headerContent, " : public $parentName") if $parentName; - push(@headerContent, " {\n"); - push(@headerContent, "public:\n"); - - # Constructor - push(@headerContent, " $className();\n"); - push(@headerContent, " explicit $className($implClassNameWithNamespace*);\n"); - - # Copy constructor and assignment operator on classes which have the d-ptr - if ($parentName eq "WebDOMObject") { - push(@headerContent, " $className(const $className&);\n"); - push(@headerContent, " ${className}& operator=(const $className&);\n"); - } - - # Destructor - if ($parentName eq "WebDOMObject") { - push(@headerContent, " virtual ~$className();\n"); - } else { - push(@headerContent, " virtual ~$className() { }\n"); - } - - push(@headerContent, "\n"); - $headerForwardDeclarations{$implClassNameWithNamespace} = 1; - - # - Add constants. - if ($numConstants > 0) { - my @headerConstants = (); - my @constants = @{$interface->constants}; - my $combinedConstants = ""; - - # FIXME: we need a way to include multiple enums. - foreach my $constant (@constants) { - my $constantName = $constant->name; - my $constantValue = $constant->value; - my $conditional = $constant->extendedAttributes->{"Conditional"}; - my $notLast = $constant ne $constants[-1]; - - if ($conditional) { - my $conditionalString = $codeGenerator->GenerateConditionalStringFromAttributeValue($conditional); - $combinedConstants .= "#if ${conditionalString}\n"; - } - $combinedConstants .= " WEBDOM_$constantName = $constantValue"; - $combinedConstants .= "," if $notLast; - if ($conditional) { - $combinedConstants .= "\n#endif\n"; - } elsif ($notLast) { - $combinedConstants .= "\n"; - } - } - - push(@headerContent, " "); - push(@headerContent, "enum {\n"); - push(@headerContent, $combinedConstants); - push(@headerContent, "\n "); - push(@headerContent, "};\n\n"); - } - - my @headerAttributes = (); - - # - Add attribute getters/setters. - if ($numAttributes > 0) { - foreach my $attribute (@{$interface->attributes}) { - next if SkipAttribute($attribute); - - my $attributeConditionalString = $codeGenerator->GenerateConditionalString($attribute->signature); - my $attributeName = $attribute->signature->name; - my $attributeType = GetCPPType($attribute->signature->type, 0); - my $attributeIsReadonly = ($attribute->type =~ /^readonly/); - my $property = ""; - - $property .= "#if ${attributeConditionalString}\n" if $attributeConditionalString; - $property .= " " . $attributeType . ($attributeType =~ /\*$/ ? "" : " ") . $attributeName . "() const"; - - my $availabilityMacro = ""; - my $declarationSuffix = ";\n"; - - AddForwardDeclarationsForType($attribute->signature->type, 1); - - $attributeType = GetCPPType($attribute->signature->type, 1); - my $setterName = "set" . ucfirst($attributeName); - - $property .= $declarationSuffix; - push(@headerAttributes, $property); - if (!$attributeIsReadonly and !$attribute->signature->extendedAttributes->{"Replaceable"}) { - $property = " void $setterName($attributeType)"; - $property .= $declarationSuffix; - push(@headerAttributes, $property); - } - - push(@headerAttributes, "#endif\n") if $attributeConditionalString; - } - push(@headerContent, @headerAttributes) if @headerAttributes > 0; - } - - my @headerFunctions = (); - my @deprecatedHeaderFunctions = (); - my @interfaceFunctions = (); - - # - Add functions. - if ($numFunctions > 0) { - foreach my $function (@{$interface->functions}) { - next if SkipFunction($function); - next if ($function->signature->name eq "set" and $interface->extendedAttributes->{"TypedArray"}); - my $functionName = $function->signature->extendedAttributes->{"ImplementedAs"} || $function->signature->name; - - my $returnType = GetCPPType($function->signature->type, 0); - my $numberOfParameters = @{$function->parameters}; - my %typesToForwardDeclare = ($function->signature->type => 1); - - my $parameterIndex = 0; - my $functionSig = "$returnType $functionName("; - my $methodName = $functionName; - foreach my $param (@{$function->parameters}) { - my $paramName = $param->name; - my $paramType = GetCPPType($param->type, 1); - $typesToForwardDeclare{$param->type} = 1; - - $functionSig .= ", " if $parameterIndex >= 1; - $functionSig .= "$paramType $paramName"; - $parameterIndex++; - } - $functionSig .= ")"; - if ($interface->extendedAttributes->{"CPPPureInterface"}) { - push(@interfaceFunctions, " virtual " . $functionSig . " = 0;\n"); - } - my $functionDeclaration = $functionSig; - $functionDeclaration .= ";\n"; - - foreach my $type (keys %typesToForwardDeclare) { - # add any forward declarations to the public header if a deprecated version will be generated - AddForwardDeclarationsForType($type, 1); - } - - my $conditionalString = $codeGenerator->GenerateConditionalString($function->signature); - push(@headerFunctions, "#if ${conditionalString}\n") if $conditionalString; - push(@headerFunctions, " "); - push(@headerFunctions, $functionDeclaration); - push(@headerFunctions, "#endif\n") if $conditionalString; - } - - if (@headerFunctions > 0) { - push(@headerContent, "\n") if @headerAttributes > 0; - push(@headerContent, @headerFunctions); - } - } - - push(@headerContent, "\n"); - push(@headerContent, " $implClassNameWithNamespace* impl() const;\n"); - - if ($parentName eq "WebDOMObject") { - push(@headerContent, "\nprotected:\n"); - push(@headerContent, " struct ${className}Private;\n"); - push(@headerContent, " ${className}Private* m_impl;\n"); - } - - push(@headerContent, "};\n\n"); - - # for CPPPureInterface classes also add the interface that the client code needs to - # implement - if ($interface->extendedAttributes->{"CPPPureInterface"}) { - push(@headerContent, "class WebUser$interfaceName {\n"); - push(@headerContent, "public:\n"); - push(@headerContent, " virtual void ref() = 0;\n"); - push(@headerContent, " virtual void deref() = 0;\n\n"); - push(@headerContent, @interfaceFunctions); - push(@headerContent, "\nprotected:\n"); - push(@headerContent, " virtual ~WebUser$interfaceName() {}\n"); - push(@headerContent, "};\n\n"); - } - - my $namespace = GetNamespaceForClass($implClassName); - push(@headerContent, "$namespace" . "::$implClassName* toWebCore(const $className&);\n"); - push(@headerContent, "$className toWebKit($namespace" . "::$implClassName*);\n"); - if ($interface->extendedAttributes->{"CPPPureInterface"}) { - push(@headerContent, "$className toWebKit(WebUser$interfaceName*);\n"); - } - push(@headerContent, "\n#endif\n"); - push(@headerContent, "#endif // ${conditionalString}\n\n") if $conditionalString; -} - -sub AddEarlyReturnStatement -{ - my $returnType = shift; - - if (!defined($returnType) or $returnType eq "void") { - $returnType = ""; - } elsif ($codeGenerator->IsPrimitiveType($returnType)) { - $returnType = " 0"; - } elsif ($returnType eq "bool") { - $returnType = " false"; - } else { - $returnType = " $returnType()"; - } - - # TODO: We could set exceptions here, if we want that - my $statement = " if (!impl())\n"; - $statement .= " return$returnType;\n\n"; - return $statement; -} - -sub AddReturnStatement -{ - my $typeInfo = shift; - my $returnValue = shift; - - # Used to invoke KURLs "const String&" operator - if ($codeGenerator->IsStringType($typeInfo->signature->type)) { - return " return static_cast<const WTF::String&>($returnValue);\n"; - } - - return " return $returnValue;\n"; -} - -sub GenerateImplementation -{ - my $object = shift; - my $interface = shift; - - my @ancestorInterfaceNames = (); - - if (@{$interface->parents} > 1) { - $codeGenerator->AddMethodsConstantsAndAttributesFromParentInterfaces($interface, \@ancestorInterfaceNames); - } - - my $interfaceName = $interface->name; - my $className = GetClassName($interfaceName); - my $implClassName = GetImplClassName($interfaceName); - my $parentImplClassName = GetParentImplClassName($interface); - my $implClassNameWithNamespace = GetNamespaceForClass($implClassName) . "::" . $implClassName; - my $baseClass = "WebDOM$parentImplClassName"; - my $conditional = $interface->extendedAttributes->{"Conditional"}; - - my $numAttributes = @{$interface->attributes}; - my $numFunctions = @{$interface->functions}; - - # - Add default header template. - @implContentHeader = split("\r", $implementationLicenseTemplate); - - # - INCLUDES - - push(@implContentHeader, "\n#include \"config.h\"\n"); - my $conditionalString = $codeGenerator->GenerateConditionalString($interface); - push(@implContentHeader, "\n#if ${conditionalString}\n\n") if $conditionalString; - push(@implContentHeader, "#include \"$className.h\"\n\n"); - - $implIncludes{"WebExceptionHandler.h"} = 1; - $implIncludes{"$implClassName.h"} = 1; - @implContent = (); - - push(@implContent, "#include <wtf/GetPtr.h>\n"); - push(@implContent, "#include <wtf/RefPtr.h>\n\n"); - - # Private datastructure, encapsulating WebCore types - if ($baseClass eq "WebDOMObject") { - push(@implContent, "struct ${className}::${className}Private {\n"); - push(@implContent, " ${className}Private($implClassNameWithNamespace* object = 0)\n"); - push(@implContent, " : impl(object)\n"); - push(@implContent, " {\n"); - push(@implContent, " }\n\n"); - push(@implContent, " RefPtr<$implClassNameWithNamespace> impl;\n"); - push(@implContent, "};\n\n"); - } - - # Constructor - push(@implContent, "${className}::$className()\n"); - push(@implContent, " : ${baseClass}()\n"); - push(@implContent, " , m_impl(0)\n") if ($baseClass eq "WebDOMObject"); - push(@implContent, "{\n"); - push(@implContent, "}\n\n"); - - push(@implContent, "${className}::$className($implClassNameWithNamespace* impl)\n"); - if ($baseClass eq "WebDOMObject") { - push(@implContent, " : ${baseClass}()\n"); - push(@implContent, " , m_impl(new ${className}Private(impl))\n"); - push(@implContent, "{\n"); - push(@implContent, "}\n\n"); - - push(@implContent, "${className}::${className}(const ${className}& copy)\n"); - push(@implContent, " : ${baseClass}()\n"); - push(@implContent, "{\n"); - push(@implContent, " m_impl = copy.impl() ? new ${className}Private(copy.impl()) : 0;\n"); - push(@implContent, "}\n\n"); - - push(@implContent, "${className}& ${className}::operator\=(const ${className}& copy)\n"); - push(@implContent, "{\n"); - push(@implContent, " delete m_impl;\n"); - push(@implContent, " m_impl = copy.impl() ? new ${className}Private(copy.impl()) : 0;\n"); - push(@implContent, " return *this;\n"); - push(@implContent, "}\n\n"); - - push(@implContent, "$implClassNameWithNamespace* ${className}::impl() const\n"); - push(@implContent, "{\n"); - push(@implContent, " return m_impl ? WTF::getPtr(m_impl->impl) : 0;\n"); - push(@implContent, "}\n\n"); - - # Destructor - push(@implContent, "${className}::~$className()\n"); - push(@implContent, "{\n"); - push(@implContent, " delete m_impl;\n"); - push(@implContent, " m_impl = 0;\n"); - push(@implContent, "}\n\n"); - } else { - push(@implContent, " : ${baseClass}(impl)\n"); - push(@implContent, "{\n"); - push(@implContent, "}\n\n"); - - push(@implContent, "$implClassNameWithNamespace* ${className}::impl() const\n"); - push(@implContent, "{\n"); - push(@implContent, " return static_cast<$implClassNameWithNamespace*>(${baseClass}::impl());\n"); - push(@implContent, "}\n\n"); - } - - # START implementation - %attributeNames = (); - - # - Attributes - if ($numAttributes > 0) { - foreach my $attribute (@{$interface->attributes}) { - next if SkipAttribute($attribute); - AddIncludesForType($attribute->signature->type); - - my $idlType = $attribute->signature->type; - - my $attributeName = $attribute->signature->name; - my $attributeType = GetCPPType($attribute->signature->type, 0); - my $attributeIsReadonly = ($attribute->type =~ /^readonly/); - - $attributeNames{$attributeName} = 1; - - # - GETTER - my $getterSig = "$attributeType $className\:\:$attributeName() const\n"; - my $hasGetterException = @{$attribute->getterExceptions}; - my ($functionName, @arguments) = $codeGenerator->GetterExpression(\%implIncludes, $interfaceName, $attribute); - push(@arguments, "ec") if $hasGetterException; - if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) { - my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"}; - $implIncludes{"${implementedBy}.h"} = 1; - unshift(@arguments, "impl()"); - $functionName = "${implementedBy}::${functionName}"; - } else { - $functionName = "impl()->${functionName}"; - } - - # Special cases - my $getterContentHead = ""; - my $getterContentTail = ""; - my @customGetterContent = (); - if ($attribute->signature->extendedAttributes->{"ConvertToString"}) { - $getterContentHead = "WTF::String::number("; - $getterContentTail = ")"; - } elsif ($attribute->signature->type eq "SerializedScriptValue") { - $getterContentTail = "->toString()"; - } elsif (ConversionNeeded($attribute->signature->type)) { - $getterContentHead = "toWebKit(WTF::getPtr("; - $getterContentTail = "))"; - } - - my $getterContent = "${getterContentHead}${functionName}(" . join(", ", @arguments) . ")${getterContentTail}"; - my $attributeConditionalString = $codeGenerator->GenerateConditionalString($attribute->signature); - push(@implContent, "#if ${attributeConditionalString}\n") if $attributeConditionalString; - - push(@implContent, $getterSig); - push(@implContent, "{\n"); - push(@implContent, AddEarlyReturnStatement($attributeType)); - push(@implContent, @customGetterContent); - if ($hasGetterException) { - # Differentiated between when the return type is a pointer and - # not for white space issue (ie. Foo *result vs. int result). - if ($attributeType =~ /\*$/) { - $getterContent = $attributeType . "result = " . $getterContent; - } else { - $getterContent = $attributeType . " result = " . $getterContent; - } - - push(@implContent, " $exceptionInit\n"); - push(@implContent, " $getterContent;\n"); - push(@implContent, " $exceptionRaiseOnError\n"); - push(@implContent, AddReturnStatement($attribute, "result")); - } else { - push(@implContent, AddReturnStatement($attribute, $getterContent)); - } - push(@implContent, "}\n\n"); - - # - SETTER - if (!$attributeIsReadonly and !$attribute->signature->extendedAttributes->{"Replaceable"}) { - # Exception handling - my $hasSetterException = @{$attribute->setterExceptions}; - - my $coreSetterName = "set" . $codeGenerator->WK_ucfirst($attributeName); - my $setterName = "set" . ucfirst($attributeName); - my $argName = "new" . ucfirst($attributeName); - my $arg = GetCPPTypeGetter($argName, $idlType); - - my $attributeType = GetCPPType($attribute->signature->type, 1); - push(@implContent, "void $className\:\:$setterName($attributeType $argName)\n"); - push(@implContent, "{\n"); - push(@implContent, AddEarlyReturnStatement()); - - push(@implContent, " $exceptionInit\n") if $hasSetterException; - - my ($functionName, @arguments) = $codeGenerator->SetterExpression(\%implIncludes, $interfaceName, $attribute); - push(@arguments, $arg); - push(@arguments, "ec") if $hasSetterException; - if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) { - my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"}; - $implIncludes{"${implementedBy}.h"} = 1; - unshift(@arguments, "impl()"); - $functionName = "${implementedBy}::${functionName}"; - } else { - $functionName = "impl()->${functionName}"; - } - push(@implContent, " ${functionName}(" . join(", ", @arguments) . ");\n"); - push(@implContent, " $exceptionRaiseOnError\n") if $hasSetterException; - push(@implContent, "}\n\n"); - } - - push(@implContent, "#endif\n") if $attributeConditionalString; - } - } - - # - Functions - if ($numFunctions > 0) { - foreach my $function (@{$interface->functions}) { - # Treat CPPPureInterface as Custom as well, since the WebCore versions will take a script context as well - next if SkipFunction($function) || $interface->extendedAttributes->{"CPPPureInterface"}; - next if ($function->signature->name eq "set" and $interface->extendedAttributes->{"TypedArray"}); - AddIncludesForType($function->signature->type); - - my $functionName = $function->signature->name; - my $returnType = GetCPPType($function->signature->type, 0); - my $hasParameters = @{$function->parameters}; - my $raisesExceptions = @{$function->raisesExceptions}; - - my @parameterNames = (); - my @needsAssert = (); - my %needsCustom = (); - - my $parameterIndex = 0; - - my $functionSig = "$returnType $className\:\:$functionName("; - foreach my $param (@{$function->parameters}) { - my $paramName = $param->name; - my $paramType = GetCPPType($param->type, 1); - - # make a new parameter name if the original conflicts with a property name - $paramName = "in" . ucfirst($paramName) if $attributeNames{$paramName}; - - AddIncludesForType($param->type); - - my $idlType = $param->type; - my $implGetter = GetCPPTypeGetter($paramName, $idlType); - - push(@parameterNames, $implGetter); - $needsCustom{"NodeToReturn"} = $paramName if $param->extendedAttributes->{"CustomReturn"}; - - unless ($codeGenerator->IsPrimitiveType($idlType) or $codeGenerator->IsStringType($idlType)) { - push(@needsAssert, " ASSERT($paramName);\n"); - } - - $functionSig .= ", " if $parameterIndex >= 1; - $functionSig .= "$paramType $paramName"; - $parameterIndex++; - } - - $functionSig .= ")"; - - my @functionContent = (); - push(@parameterNames, "ec") if $raisesExceptions; - - my $content; - if ($function->signature->extendedAttributes->{"ImplementedBy"}) { - my $implementedBy = $function->signature->extendedAttributes->{"ImplementedBy"}; - $implIncludes{"${implementedBy}.h"} = 1; - unshift(@parameterNames, "impl()"); - $content = "WebCore::${implementedBy}::" . $codeGenerator->WK_lcfirst($functionName) . "(" . join(", ", @parameterNames) . ")"; - } else { - $content = "impl()->" . $codeGenerator->WK_lcfirst($functionName) . "(" . join(", ", @parameterNames) . ")"; - } - - if ($returnType eq "void") { - # Special case 'void' return type. - if ($raisesExceptions) { - push(@functionContent, " $exceptionInit\n"); - push(@functionContent, " $content;\n"); - push(@functionContent, " $exceptionRaiseOnError\n"); - } else { - push(@functionContent, " $content;\n"); - } - } elsif (defined $needsCustom{"NodeToReturn"}) { - # TODO: This is important to enable, once we care about custom code! - - # Special case the insertBefore, replaceChild, removeChild - # and appendChild functions from DOMNode - my $toReturn = $needsCustom{"NodeToReturn"}; - if ($raisesExceptions) { - push(@functionContent, " $exceptionInit\n"); - push(@functionContent, " if ($content)\n"); - push(@functionContent, " return $toReturn;\n"); - push(@functionContent, " $exceptionRaiseOnError\n"); - push(@functionContent, " return $className();\n"); - } else { - push(@functionContent, " if ($content)\n"); - push(@functionContent, " return $toReturn;\n"); - push(@functionContent, " return NULL;\n"); - } - } else { - if (ConversionNeeded($function->signature->type)) { - $content = "toWebKit(WTF::getPtr($content))"; - } - - if ($raisesExceptions) { - # Differentiated between when the return type is a pointer and - # not for white space issue (ie. Foo *result vs. int result). - if ($returnType =~ /\*$/) { - $content = $returnType . "result = " . $content; - } else { - $content = $returnType . " result = " . $content; - } - - push(@functionContent, " $exceptionInit\n"); - push(@functionContent, " $content;\n"); - push(@functionContent, " $exceptionRaiseOnError\n"); - push(@functionContent, " return result;\n"); - } else { - push(@functionContent, " return $content;\n"); - } - } - - my $conditionalString = $codeGenerator->GenerateConditionalString($function->signature); - push(@implContent, "\n#if ${conditionalString}\n") if $conditionalString; - - push(@implContent, "$functionSig\n"); - push(@implContent, "{\n"); - push(@implContent, AddEarlyReturnStatement($returnType)); - push(@implContent, @functionContent); - push(@implContent, "}\n\n"); - - push(@implContent, "#endif\n\n") if $conditionalString; - - # Clear the hash - %needsCustom = (); - } - } - - # END implementation - - # Generate internal interfaces - my $namespace = GetNamespaceForClass($implClassName); - push(@implContent, "$namespace" . "::$implClassName* toWebCore(const $className& wrapper)\n"); - push(@implContent, "{\n"); - push(@implContent, " return wrapper.impl();\n"); - push(@implContent, "}\n\n"); - - push(@implContent, "$className toWebKit($namespace" . "::$implClassName* value)\n"); - push(@implContent, "{\n"); - push(@implContent, " return $className(value);\n"); - push(@implContent, "}\n"); - - # - End the ifdef conditional if necessary - push(@implContent, "\n#endif // ${conditionalString}\n") if $conditionalString; -} - -sub WriteData -{ - my $object = shift; - my $dataNode = shift; - my $outputDir = shift; - - # Open files for writing... - my $name = $dataNode->name; - my $prefix = FileNamePrefix; - my $headerFileName = "$outputDir/$prefix$name.h"; - my $implFileName = "$outputDir/$prefix$name.cpp"; - - # Update a .h file if the contents are changed. - my $contents = join "", @headerContentHeader; - $contents .= "\n"; - foreach my $class (sort keys(%headerForwardDeclarations)) { - if ($class =~ /::/) { - my $namespacePart = $class; - $namespacePart =~ s/::.*//; - - my $classPart = $class; - $classPart =~ s/${namespacePart}:://; - - $contents .= "namespace $namespacePart {\nclass $classPart;\n};\n\n"; - } else { - $contents .= "class $class;\n" - } - } - - my $hasForwardDeclarations = keys(%headerForwardDeclarations); - $contents .= "\n" if $hasForwardDeclarations; - $contents .= join "", @headerContent; - $codeGenerator->UpdateFile($headerFileName, $contents); - - @headerContentHeader = (); - @headerContent = (); - %headerForwardDeclarations = (); - - # Update a .cpp file if the contents are changed. - $contents = join "", @implContentHeader; - - foreach my $include (sort keys(%implIncludes)) { - # "className.h" is already included right after config.h, silence check-webkit-style - next if $include eq "$name.h"; - $contents .= "#include \"$include\"\n"; - } - - $contents .= join "", @implContent; - $codeGenerator->UpdateFile($implFileName, $contents); - - @implContentHeader = (); - @implContent = (); - %implIncludes = (); -} - -1; diff --git a/contrib/dom/scripts/CodeGeneratorGObject.pm b/contrib/dom/scripts/CodeGeneratorGObject.pm deleted file mode 100644 index 3d84115..0000000 --- a/contrib/dom/scripts/CodeGeneratorGObject.pm +++ /dev/null @@ -1,1489 +0,0 @@ -# Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net> -# Copyright (C) 2008 Martin Soto <soto@freedesktop.org> -# Copyright (C) 2008 Alp Toker <alp@atoker.com> -# Copyright (C) 2009 Adam Dingle <adam@yorba.org> -# Copyright (C) 2009 Jim Nelson <jim@yorba.org> -# Copyright (C) 2009, 2010 Igalia S.L. -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library 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. See the GNU -# Library General Public License for more details. -# -# You should have received a copy of the GNU Library General Public License -# along with this library; see the file COPYING.LIB. If not, write to -# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -package CodeGeneratorGObject; - -use constant FileNamePrefix => "WebKitDOM"; - -# Global Variables -my %implIncludes = (); -my %hdrIncludes = (); - -my $defineTypeMacro = "G_DEFINE_TYPE"; -my $defineTypeInterfaceImplementation = ")"; -my @txtEventListeners = (); -my @txtInstallProps = (); -my @txtSetProps = (); -my @txtGetProps = (); - -my $className = ""; - -# Default constructor -sub new { - my $object = shift; - my $reference = { }; - - $codeGenerator = shift; - - bless($reference, $object); -} - -my $licenceTemplate = << "EOF"; -/* - This file is part of the WebKit open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ -EOF - -sub GetParentClassName { - my $interface = shift; - - return "WebKitDOMObject" if @{$interface->parents} eq 0; - return "WebKitDOM" . $interface->parents(0); -} - -sub GetParentImplClassName { - my $interface = shift; - - return "Object" if @{$interface->parents} eq 0; - return $interface->parents(0); -} - -# From String::CamelCase 0.01 -sub camelize -{ - my $s = shift; - join('', map{ ucfirst $_ } split(/(?<=[A-Za-z])_(?=[A-Za-z])|\b/, $s)); -} - -sub decamelize -{ - my $s = shift; - $s =~ s{([^a-zA-Z]?)([A-Z]*)([A-Z])([a-z]?)}{ - my $fc = pos($s)==0; - my ($p0,$p1,$p2,$p3) = ($1,lc$2,lc$3,$4); - my $t = $p0 || $fc ? $p0 : '_'; - $t .= $p3 ? $p1 ? "${p1}_$p2$p3" : "$p2$p3" : "$p1$p2"; - $t; - }ge; - $s; -} - -sub FixUpDecamelizedName { - my $classname = shift; - - # FIXME: try to merge this somehow with the fixes in ClassNameToGobjectType - $classname =~ s/x_path/xpath/; - $classname =~ s/web_kit/webkit/; - $classname =~ s/htmli_frame/html_iframe/; - - return $classname; -} - -sub HumanReadableConditional { - my @conditional = split('_', shift); - my @upperCaseExceptions = ("SQL", "API"); - my @humanReadable; - - for $part (@conditional) { - if (!grep {$_ eq $part} @upperCaseExceptions) { - $part = camelize(lc($part)); - } - push(@humanReadable, $part); - } - - return join(' ', @humanReadable); -} - -sub ClassNameToGObjectType { - my $className = shift; - my $CLASS_NAME = uc(decamelize($className)); - # Fixup: with our prefix being 'WebKitDOM' decamelize can't get - # WebKitDOMCSS and similar names right, so we have to fix it - # manually. - $CLASS_NAME =~ s/DOMCSS/DOM_CSS/; - $CLASS_NAME =~ s/DOMHTML/DOM_HTML/; - $CLASS_NAME =~ s/DOMDOM/DOM_DOM/; - $CLASS_NAME =~ s/DOMCDATA/DOM_CDATA/; - $CLASS_NAME =~ s/DOMX_PATH/DOM_XPATH/; - $CLASS_NAME =~ s/DOM_WEB_KIT/DOM_WEBKIT/; - $CLASS_NAME =~ s/DOMUI/DOM_UI/; - $CLASS_NAME =~ s/HTMLI_FRAME/HTML_IFRAME/; - return $CLASS_NAME; -} - -sub GetParentGObjType { - my $interface = shift; - - return "WEBKIT_TYPE_DOM_OBJECT" if @{$interface->parents} eq 0; - return "WEBKIT_TYPE_DOM_" . ClassNameToGObjectType($interface->parents(0)); -} - -sub GetClassName { - my $name = shift; - - return "WebKitDOM$name"; -} - -sub GetCoreObject { - my ($interfaceName, $name, $parameter) = @_; - - return "WebCore::${interfaceName}* $name = WebKit::core($parameter);"; -} - -sub SkipAttribute { - my $attribute = shift; - - if ($attribute->signature->extendedAttributes->{"Custom"} - || $attribute->signature->extendedAttributes->{"CustomGetter"} - || $attribute->signature->extendedAttributes->{"CustomSetter"}) { - return 1; - } - - my $propType = $attribute->signature->type; - if ($propType =~ /Constructor$/) { - return 1; - } - - return 1 if $codeGenerator->IsTypedArrayType($propType); - - $codeGenerator->AssertNotSequenceType($propType); - - if ($codeGenerator->GetArrayType($propType)) { - return 1; - } - - # This is for DOMWindow.idl location attribute - if ($attribute->signature->name eq "location") { - return 1; - } - - # This is for HTMLInput.idl valueAsDate - if ($attribute->signature->name eq "valueAsDate") { - return 1; - } - - # This is for DOMWindow.idl Crypto attribute - if ($attribute->signature->type eq "Crypto") { - return 1; - } - - # Skip indexed database attributes for now, they aren't yet supported for the GObject generator. - if ($attribute->signature->name =~ /^(?:webkit)?[Ii]ndexedDB/ or $attribute->signature->name =~ /^(?:webkit)?IDB/) { - return 1; - } - - return 0; -} - -sub SkipFunction { - my $function = shift; - my $decamelize = shift; - my $prefix = shift; - - my $functionName = "webkit_dom_" . $decamelize . "_" . $prefix . decamelize($function->signature->name); - my $functionReturnType = $prefix eq "set_" ? "void" : $function->signature->type; - my $isCustomFunction = $function->signature->extendedAttributes->{"Custom"}; - my $callWith = $function->signature->extendedAttributes->{"CallWith"}; - my $isUnsupportedCallWith = $codeGenerator->ExtendedAttributeContains($callWith, "ScriptArguments") || $codeGenerator->ExtendedAttributeContains($callWith, "CallStack"); - - if (($isCustomFunction || $isUnsupportedCallWith) && - $functionName ne "webkit_dom_node_replace_child" && - $functionName ne "webkit_dom_node_insert_before" && - $functionName ne "webkit_dom_node_remove_child" && - $functionName ne "webkit_dom_node_append_child" && - $functionName ne "webkit_dom_html_collection_item" && - $functionName ne "webkit_dom_html_collection_named_item") { - return 1; - } - - if ($function->signature->name eq "getSVGDocument") { - return 1; - } - - if ($function->signature->name eq "getCSSCanvasContext") { - return 1; - } - - if ($function->signature->name eq "setRangeText" && @{$function->parameters} == 1) { - return 1; - } - - if ($function->signature->name eq "timeEnd") { - return 1; - } - - if ($codeGenerator->GetSequenceType($functionReturnType)) { - return 1; - } - - # Skip functions that have ["Callback"] parameters, because this - # code generator doesn't know how to auto-generate callbacks. - # Skip functions that have "MediaQueryListListener" or sequence<T> parameters, because this - # code generator doesn't know how to auto-generate MediaQueryListListener or sequence<T>. - foreach my $param (@{$function->parameters}) { - if ($param->extendedAttributes->{"Callback"} || - $param->extendedAttributes->{"Clamp"} || - $param->type eq "MediaQueryListListener" || - $codeGenerator->GetSequenceType($param->type)) { - return 1; - } - } - - return 0; -} - -# Name type used in the g_value_{set,get}_* functions -sub GetGValueTypeName { - my $type = shift; - - my %types = ("DOMString", "string", - "DOMTimeStamp", "uint", - "float", "float", - "double", "double", - "boolean", "boolean", - "char", "char", - "long", "long", - "long long", "int64", - "short", "int", - "uchar", "uchar", - "unsigned", "uint", - "int", "int", - "unsigned int", "uint", - "unsigned long long", "uint64", - "unsigned long", "ulong", - "unsigned short", "uint"); - - return $types{$type} ? $types{$type} : "object"; -} - -# Name type used in C declarations -sub GetGlibTypeName { - my $type = shift; - my $name = GetClassName($type); - - my %types = ("DOMString", "gchar*", - "DOMTimeStamp", "guint32", - "CompareHow", "gushort", - "float", "gfloat", - "double", "gdouble", - "boolean", "gboolean", - "char", "gchar", - "long", "glong", - "long long", "gint64", - "short", "gshort", - "uchar", "guchar", - "unsigned", "guint", - "int", "gint", - "unsigned int", "guint", - "unsigned long", "gulong", - "unsigned long long", "guint64", - "unsigned short", "gushort", - "void", "void"); - - return $types{$type} ? $types{$type} : "$name*"; -} - -sub IsGDOMClassType { - my $type = shift; - - return 0 if $codeGenerator->IsNonPointerType($type) || $codeGenerator->IsStringType($type); - return 1; -} - -sub GetReadableProperties { - my $properties = shift; - - my @result = (); - - foreach my $property (@{$properties}) { - if (!SkipAttribute($property)) { - push(@result, $property); - } - } - - return @result; -} - -sub GetWriteableProperties { - my $properties = shift; - my @result = (); - - foreach my $property (@{$properties}) { - my $writeable = $property->type !~ /^readonly/; - my $gtype = GetGValueTypeName($property->signature->type); - my $hasGtypeSignature = ($gtype eq "boolean" || $gtype eq "float" || $gtype eq "double" || - $gtype eq "uint64" || $gtype eq "ulong" || $gtype eq "long" || - $gtype eq "uint" || $gtype eq "ushort" || $gtype eq "uchar" || - $gtype eq "char" || $gtype eq "string"); - # FIXME: We are not generating setters for 'Replaceable' - # attributes now, but we should somehow. - my $replaceable = $property->signature->extendedAttributes->{"Replaceable"}; - if ($writeable && $hasGtypeSignature && !$replaceable) { - push(@result, $property); - } - } - - return @result; -} - -sub GenerateConditionalWarning -{ - my $node = shift; - my $indentSize = shift; - if (!$indentSize) { - $indentSize = 4; - } - - my $conditional = $node->extendedAttributes->{"Conditional"}; - my @warn; - - if ($conditional) { - if ($conditional =~ /&/) { - my @splitConditionals = split(/&/, $conditional); - foreach $condition (@splitConditionals) { - push(@warn, "#if !ENABLE($condition)\n"); - push(@warn, ' ' x $indentSize . "WEBKIT_WARN_FEATURE_NOT_PRESENT(\"" . HumanReadableConditional($condition) . "\")\n"); - push(@warn, "#endif\n"); - } - } elsif ($conditional =~ /\|/) { - foreach $condition (split(/\|/, $conditional)) { - push(@warn, ' ' x $indentSize . "WEBKIT_WARN_FEATURE_NOT_PRESENT(\"" . HumanReadableConditional($condition) . "\")\n"); - } - } else { - push(@warn, ' ' x $indentSize . "WEBKIT_WARN_FEATURE_NOT_PRESENT(\"" . HumanReadableConditional($conditional) . "\")\n"); - } - } - - return @warn; -} - -sub GenerateProperty { - my $attribute = shift; - my $interfaceName = shift; - my @writeableProperties = @{shift @_}; - my $parentNode = shift; - - my $conditionalString = $codeGenerator->GenerateConditionalString($attribute->signature); - my @conditionalWarn = GenerateConditionalWarning($attribute->signature, 8); - my $parentConditionalString = $codeGenerator->GenerateConditionalString($parentNode); - my @parentConditionalWarn = GenerateConditionalWarning($parentNode, 8); - my $camelPropName = $attribute->signature->name; - my $setPropNameFunction = $codeGenerator->WK_ucfirst($camelPropName); - my $getPropNameFunction = $codeGenerator->WK_lcfirst($camelPropName); - - my $propName = decamelize($camelPropName); - my $propNameCaps = uc($propName); - $propName =~ s/_/-/g; - my ${propEnum} = "PROP_${propNameCaps}"; - push(@cBodyProperties, " ${propEnum},\n"); - - my $propType = $attribute->signature->type; - my ${propGType} = decamelize($propType); - my ${ucPropGType} = uc($propGType); - - my $gtype = GetGValueTypeName($propType); - my $gparamflag = "WEBKIT_PARAM_READABLE"; - my $writeable = $attribute->type !~ /^readonly/; - my $const = "read-only "; - my $custom = $attribute->signature->extendedAttributes->{"Custom"}; - if ($writeable && $custom) { - $const = "read-only (due to custom functions needed in webkitdom)"; - return; - } - if ($writeable && !$custom) { - $gparamflag = "WEBKIT_PARAM_READWRITE"; - $const = "read-write "; - } - - my $type = GetGlibTypeName($propType); - $nick = decamelize("${interfaceName}_${propName}"); - $long = "${const} ${type} ${interfaceName}.${propName}"; - - my $convertFunction = ""; - if ($gtype eq "string") { - $convertFunction = "WTF::String::fromUTF8"; - } - - my ($getterFunctionName, @getterArguments) = $codeGenerator->GetterExpression(\%implIncludes, $interfaceName, $attribute); - my ($setterFunctionName, @setterArguments) = $codeGenerator->SetterExpression(\%implIncludes, $interfaceName, $attribute); - - if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) { - my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"}; - $implIncludes{"${implementedBy}.h"} = 1; - push(@setterArguments, "${convertFunction}(g_value_get_$gtype(value))"); - unshift(@getterArguments, "coreSelf"); - unshift(@setterArguments, "coreSelf"); - $getterFunctionName = "WebCore::${implementedBy}::$getterFunctionName"; - $setterFunctionName = "WebCore::${implementedBy}::$setterFunctionName"; - } else { - push(@setterArguments, "${convertFunction}(g_value_get_$gtype(value))"); - $getterFunctionName = "coreSelf->$getterFunctionName"; - $setterFunctionName = "coreSelf->$setterFunctionName"; - } - push(@getterArguments, "ec") if @{$attribute->getterExceptions}; - push(@setterArguments, "ec") if @{$attribute->setterExceptions}; - - if (grep {$_ eq $attribute} @writeableProperties) { - push(@txtSetProps, " case ${propEnum}: {\n"); - push(@txtSetProps, "#if ${parentConditionalString}\n") if $parentConditionalString; - push(@txtSetProps, "#if ${conditionalString}\n") if $conditionalString; - push(@txtSetProps, " WebCore::ExceptionCode ec = 0;\n") if @{$attribute->setterExceptions}; - push(@txtSetProps, " ${setterFunctionName}(" . join(", ", @setterArguments) . ");\n"); - push(@txtSetProps, "#else\n") if $conditionalString; - push(@txtSetProps, @conditionalWarn) if scalar(@conditionalWarn); - push(@txtSetProps, "#endif /* ${conditionalString} */\n") if $conditionalString; - push(@txtSetProps, "#else\n") if $parentConditionalString; - push(@txtSetProps, @parentConditionalWarn) if scalar(@parentConditionalWarn); - push(@txtSetProps, "#endif /* ${parentConditionalString} */\n") if $parentConditionalString; - push(@txtSetProps, " break;\n }\n"); - } - - push(@txtGetProps, " case ${propEnum}: {\n"); - push(@txtGetProps, "#if ${parentConditionalString}\n") if $parentConditionalString; - push(@txtGetProps, "#if ${conditionalString}\n") if $conditionalString; - push(@txtGetProps, " WebCore::ExceptionCode ec = 0;\n") if @{$attribute->getterExceptions}; - - my $postConvertFunction = ""; - my $done = 0; - if ($gtype eq "string") { - push(@txtGetProps, " g_value_take_string(value, convertToUTF8String(${getterFunctionName}(" . join(", ", @getterArguments) . ")));\n"); - $done = 1; - } elsif ($gtype eq "object") { - push(@txtGetProps, " RefPtr<WebCore::${propType}> ptr = ${getterFunctionName}(" . join(", ", @getterArguments) . ");\n"); - push(@txtGetProps, " g_value_set_object(value, WebKit::kit(ptr.get()));\n"); - $done = 1; - } - - # FIXME: get rid of this glitch? - my $_gtype = $gtype; - if ($gtype eq "ushort") { - $_gtype = "uint"; - } - - if (!$done) { - if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) { - my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"}; - $implIncludes{"${implementedBy}.h"} = 1; - push(@txtGetProps, " g_value_set_$_gtype(value, ${convertFunction}${getterFunctionName}(" . join(", ", @getterArguments) . ")${postConvertFunction});\n"); - } else { - push(@txtGetProps, " g_value_set_$_gtype(value, ${convertFunction}${getterFunctionName}(" . join(", ", @getterArguments) . ")${postConvertFunction});\n"); - } - } - - push(@txtGetProps, "#else\n") if $conditionalString; - push(@txtGetProps, @conditionalWarn) if scalar(@conditionalWarn); - push(@txtGetProps, "#endif /* ${conditionalString} */\n") if $conditionalString; - push(@txtGetProps, "#else\n") if $parentConditionalString; - push(@txtGetProps, @parentConditionalWarn) if scalar(@parentConditionalWarn); - push(@txtGetProps, "#endif /* ${parentConditionalString} */\n") if $parentConditionalString; - push(@txtGetProps, " break;\n }\n"); - - my %param_spec_options = ("int", "G_MININT, /* min */\nG_MAXINT, /* max */\n0, /* default */", - "boolean", "FALSE, /* default */", - "float", "-G_MAXFLOAT, /* min */\nG_MAXFLOAT, /* max */\n0.0, /* default */", - "double", "-G_MAXDOUBLE, /* min */\nG_MAXDOUBLE, /* max */\n0.0, /* default */", - "uint64", "0, /* min */\nG_MAXUINT64, /* min */\n0, /* default */", - "long", "G_MINLONG, /* min */\nG_MAXLONG, /* max */\n0, /* default */", - "int64", "G_MININT64, /* min */\nG_MAXINT64, /* max */\n0, /* default */", - "ulong", "0, /* min */\nG_MAXULONG, /* max */\n0, /* default */", - "uint", "0, /* min */\nG_MAXUINT, /* max */\n0, /* default */", - "ushort", "0, /* min */\nG_MAXUINT16, /* max */\n0, /* default */", - "uchar", "G_MININT8, /* min */\nG_MAXINT8, /* max */\n0, /* default */", - "char", "0, /* min */\nG_MAXUINT8, /* max */\n0, /* default */", - "string", "\"\", /* default */", - "object", "WEBKIT_TYPE_DOM_${ucPropGType}, /* gobject type */"); - - my $txtInstallProp = << "EOF"; - g_object_class_install_property(gobjectClass, - ${propEnum}, - g_param_spec_${_gtype}("${propName}", /* name */ - "$nick", /* short description */ - "$long", /* longer - could do with some extra doc stuff here */ - $param_spec_options{$gtype} - ${gparamflag})); -EOF - push(@txtInstallProps, $txtInstallProp); -} - -sub GenerateProperties { - my ($object, $interfaceName, $interface) = @_; - - my $clsCaps = substr(ClassNameToGObjectType($className), 12); - my $lowerCaseIfaceName = "webkit_dom_" . (FixUpDecamelizedName(decamelize($interfaceName))); - my $parentImplClassName = GetParentImplClassName($interface); - - my $conditionGuardStart = ""; - my $conditionGuardEnd = ""; - my $conditionalString = $codeGenerator->GenerateConditionalString($interface); - if ($conditionalString) { - $conditionGuardStart = "#if ${conditionalString}"; - $conditionGuardEnd = "#endif // ${conditionalString}"; - } - - # Properties - my $implContent = ""; - my @readableProperties = GetReadableProperties($interface->attributes); - my @writeableProperties = GetWriteableProperties(\@readableProperties); - my $numProperties = scalar @readableProperties; - - # Properties - my $privFunction = GetCoreObject($interfaceName, "coreSelf", "self"); - if ($numProperties > 0) { - $implContent = << "EOF"; -enum { - PROP_0, -EOF - push(@cBodyProperties, $implContent); - - my $txtGetProp = << "EOF"; -static void ${lowerCaseIfaceName}_get_property(GObject* object, guint propertyId, GValue* value, GParamSpec* pspec) -{ - WebCore::JSMainThreadNullState state; -EOF - push(@txtGetProps, $txtGetProp); - $txtGetProp = << "EOF"; -$conditionGuardStart - ${className}* self = WEBKIT_DOM_${clsCaps}(object); - $privFunction -$conditionGuardEnd -EOF - push(@txtGetProps, $txtGetProp); - - $txtGetProp = << "EOF"; - switch (propertyId) { -EOF - push(@txtGetProps, $txtGetProp); - - if (scalar @writeableProperties > 0) { - my $txtSetProps = << "EOF"; -static void ${lowerCaseIfaceName}_set_property(GObject* object, guint propertyId, const GValue* value, GParamSpec* pspec) -{ - WebCore::JSMainThreadNullState state; -EOF - push(@txtSetProps, $txtSetProps); - - $txtSetProps = << "EOF"; -$conditionGuardStart - ${className}* self = WEBKIT_DOM_${clsCaps}(object); - $privFunction -$conditionGuardEnd -EOF - push(@txtSetProps, $txtSetProps); - - $txtSetProps = << "EOF"; - switch (propertyId) { -EOF - push(@txtSetProps, $txtSetProps); - } - - foreach my $attribute (@readableProperties) { - if ($attribute->signature->type ne "EventListener" && - $attribute->signature->type ne "MediaQueryListListener") { - GenerateProperty($attribute, $interfaceName, \@writeableProperties, $interface); - } - } - - push(@cBodyProperties, "};\n\n"); - - $txtGetProp = << "EOF"; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec); - break; - } -} -EOF - push(@txtGetProps, $txtGetProp); - - if (scalar @writeableProperties > 0) { - $txtSetProps = << "EOF"; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec); - break; - } -} -EOF - push(@txtSetProps, $txtSetProps); - } - } - - # Do not insert extra spaces when interpolating array variables - $" = ""; - - if ($parentImplClassName eq "Object") { - $implContent = << "EOF"; -static void ${lowerCaseIfaceName}_finalize(GObject* object) -{ - ${className}Private* priv = WEBKIT_DOM_${clsCaps}_GET_PRIVATE(object); -$conditionGuardStart - WebKit::DOMObjectCache::forget(priv->coreObject.get()); -$conditionGuardEnd - priv->~${className}Private(); - G_OBJECT_CLASS(${lowerCaseIfaceName}_parent_class)->finalize(object); -} - -EOF - push(@cBodyProperties, $implContent); - } - - if ($numProperties > 0) { - if (scalar @writeableProperties > 0) { - push(@cBodyProperties, @txtSetProps); - push(@cBodyProperties, "\n"); - } - push(@cBodyProperties, @txtGetProps); - push(@cBodyProperties, "\n"); - } - - # Add a constructor implementation only for direct subclasses of Object to make sure - # that the WebCore wrapped object is added only once to the DOM cache. The DOM garbage - # collector works because Node is a direct subclass of Object and the version of - # DOMObjectCache::put() that receives a Node (which is the one setting the frame) is - # always called for DOM objects derived from Node. - if ($parentImplClassName eq "Object") { - $implContent = << "EOF"; -static GObject* ${lowerCaseIfaceName}_constructor(GType type, guint constructPropertiesCount, GObjectConstructParam* constructProperties) -{ - GObject* object = G_OBJECT_CLASS(${lowerCaseIfaceName}_parent_class)->constructor(type, constructPropertiesCount, constructProperties); -$conditionGuardStart - ${className}Private* priv = WEBKIT_DOM_${clsCaps}_GET_PRIVATE(object); - priv->coreObject = static_cast<WebCore::${interfaceName}*>(WEBKIT_DOM_OBJECT(object)->coreObject); - WebKit::DOMObjectCache::put(priv->coreObject.get(), object); -$conditionGuardEnd - return object; -} - -EOF - push(@cBodyProperties, $implContent); - } - - $implContent = << "EOF"; -static void ${lowerCaseIfaceName}_class_init(${className}Class* requestClass) -{ -EOF - push(@cBodyProperties, $implContent); - - if ($parentImplClassName eq "Object" || $numProperties > 0) { - push(@cBodyProperties, " GObjectClass* gobjectClass = G_OBJECT_CLASS(requestClass);\n"); - - if ($parentImplClassName eq "Object") { - push(@cBodyProperties, " g_type_class_add_private(gobjectClass, sizeof(${className}Private));\n"); - push(@cBodyProperties, " gobjectClass->constructor = ${lowerCaseIfaceName}_constructor;\n"); - push(@cBodyProperties, " gobjectClass->finalize = ${lowerCaseIfaceName}_finalize;\n"); - } - - if ($numProperties > 0) { - if (scalar @writeableProperties > 0) { - push(@cBodyProperties, " gobjectClass->set_property = ${lowerCaseIfaceName}_set_property;\n"); - } - push(@cBodyProperties, " gobjectClass->get_property = ${lowerCaseIfaceName}_get_property;\n"); - push(@cBodyProperties, "\n"); - push(@cBodyProperties, @txtInstallProps); - } - } - $implContent = << "EOF"; -} - -static void ${lowerCaseIfaceName}_init(${className}* request) -{ -EOF - push(@cBodyProperties, $implContent); - - if ($parentImplClassName eq "Object") { - $implContent = << "EOF"; - ${className}Private* priv = WEBKIT_DOM_${clsCaps}_GET_PRIVATE(request); - new (priv) ${className}Private(); -EOF - push(@cBodyProperties, $implContent); - } - $implContent = << "EOF"; -} - -EOF - push(@cBodyProperties, $implContent); -} - -sub GenerateHeader { - my ($object, $interfaceName, $parentClassName) = @_; - - my $implContent = ""; - - # Add the default header template - @hPrefix = split("\r", $licenceTemplate); - push(@hPrefix, "\n"); - - #Header guard - my $guard = $className . "_h"; - - @hPrefixGuard = << "EOF"; -#ifndef $guard -#define $guard - -EOF - - $implContent = << "EOF"; -G_BEGIN_DECLS - -EOF - - push(@hBodyPre, $implContent); - - my $decamelize = FixUpDecamelizedName(decamelize($interfaceName)); - my $clsCaps = uc($decamelize); - my $lowerCaseIfaceName = "webkit_dom_" . ($decamelize); - - $implContent = << "EOF"; -#define WEBKIT_TYPE_DOM_${clsCaps} (${lowerCaseIfaceName}_get_type()) -#define WEBKIT_DOM_${clsCaps}(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_DOM_${clsCaps}, ${className})) -#define WEBKIT_DOM_${clsCaps}_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_DOM_${clsCaps}, ${className}Class) -#define WEBKIT_DOM_IS_${clsCaps}(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_DOM_${clsCaps})) -#define WEBKIT_DOM_IS_${clsCaps}_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_DOM_${clsCaps})) -#define WEBKIT_DOM_${clsCaps}_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_DOM_${clsCaps}, ${className}Class)) - -struct _${className} { - ${parentClassName} parent_instance; -}; - -struct _${className}Class { - ${parentClassName}Class parent_class; -}; - -WEBKIT_API GType -${lowerCaseIfaceName}_get_type (void); - -EOF - - push(@hBody, $implContent); -} - -sub GetGReturnMacro { - my ($paramName, $paramIDLType, $returnType) = @_; - - my $condition; - if ($paramIDLType eq "GError") { - $condition = "!$paramName || !*$paramName"; - } elsif (IsGDOMClassType($paramIDLType)) { - my $paramTypeCaps = uc(FixUpDecamelizedName(decamelize($paramIDLType))); - $condition = "WEBKIT_DOM_IS_${paramTypeCaps}($paramName)"; - } else { - $condition = "$paramName"; - } - - my $macro; - if ($returnType ne "void") { - $defaultReturn = $returnType eq "gboolean" ? "FALSE" : 0; - $macro = " g_return_val_if_fail($condition, $defaultReturn);\n"; - } else { - $macro = " g_return_if_fail($condition);\n"; - } - - return $macro; -} - -sub GenerateFunction { - my ($object, $interfaceName, $function, $prefix, $parentNode) = @_; - - my $decamelize = FixUpDecamelizedName(decamelize($interfaceName)); - - if ($object eq "MediaQueryListListener") { - return; - } - - if (SkipFunction($function, $decamelize, $prefix)) { - return; - } - - return if ($function->signature->name eq "set" and $parentNode->extendedAttributes->{"TypedArray"}); - - my $functionSigType = $prefix eq "set_" ? "void" : $function->signature->type; - my $functionName = "webkit_dom_" . $decamelize . "_" . $prefix . decamelize($function->signature->name); - my $returnType = GetGlibTypeName($functionSigType); - my $returnValueIsGDOMType = IsGDOMClassType($functionSigType); - - my $conditionalString = $codeGenerator->GenerateConditionalString($function->signature); - my $parentConditionalString = $codeGenerator->GenerateConditionalString($parentNode); - my @conditionalWarn = GenerateConditionalWarning($function->signature); - my @parentConditionalWarn = GenerateConditionalWarning($parentNode); - - my $functionSig = "${className}* self"; - - my @callImplParams; - - foreach my $param (@{$function->parameters}) { - my $paramIDLType = $param->type; - if ($paramIDLType eq "EventListener" || $paramIDLType eq "MediaQueryListListener") { - # EventListeners are handled elsewhere. - return; - } - - my $paramType = GetGlibTypeName($paramIDLType); - my $const = $paramType eq "gchar*" ? "const " : ""; - my $paramName = $param->name; - - $functionSig .= ", ${const}$paramType $paramName"; - - my $paramIsGDOMType = IsGDOMClassType($paramIDLType); - if ($paramIsGDOMType) { - if ($paramIDLType ne "DOMObject") { - $implIncludes{"WebKitDOM${paramIDLType}Private.h"} = 1; - } - } - if ($paramIsGDOMType || ($paramIDLType eq "DOMString") || ($paramIDLType eq "CompareHow")) { - $paramName = "converted" . $codeGenerator->WK_ucfirst($paramName); - } - push(@callImplParams, $paramName); - } - - if ($returnType ne "void" && $returnValueIsGDOMType && $functionSigType ne "DOMObject") { - if ($functionSigType ne "EventTarget") { - $implIncludes{"WebKitDOM${functionSigType}Private.h"} = 1; - } else { - $implIncludes{"WebKitDOM${functionSigType}.h"} = 1; - } - } - - if (@{$function->raisesExceptions}) { - $functionSig .= ", GError** error"; - } - - # Insert introspection annotations - push(@hBody, "/**\n"); - push(@hBody, " * ${functionName}:\n"); - push(@hBody, " * \@self: A #${className}\n"); - - foreach my $param (@{$function->parameters}) { - my $paramType = GetGlibTypeName($param->type); - # $paramType can have a trailing * in some cases - $paramType =~ s/\*$//; - my $paramName = $param->name; - push(@hBody, " * \@${paramName}: A #${paramType}\n"); - } - if(@{$function->raisesExceptions}) { - push(@hBody, " * \@error: #GError\n"); - } - push(@hBody, " *\n"); - if (IsGDOMClassType($function->signature->type)) { - push(@hBody, " * Returns: (transfer none):\n"); - } else { - push(@hBody, " * Returns:\n"); - } - push(@hBody, " *\n"); - push(@hBody, "**/\n"); - - push(@hBody, "WEBKIT_API $returnType\n$functionName($functionSig);\n"); - push(@hBody, "\n"); - - push(@cBody, "$returnType\n$functionName($functionSig)\n{\n"); - push(@cBody, "#if ${parentConditionalString}\n") if $parentConditionalString; - push(@cBody, "#if ${conditionalString}\n") if $conditionalString; - - push(@cBody, " WebCore::JSMainThreadNullState state;\n"); - - # g_return macros to check parameters of public methods. - $gReturnMacro = GetGReturnMacro("self", $interfaceName, $returnType); - push(@cBody, $gReturnMacro); - - foreach my $param (@{$function->parameters}) { - my $paramName = $param->name; - my $paramIDLType = $param->type; - my $paramTypeIsPrimitive = $codeGenerator->IsPrimitiveType($paramIDLType); - my $paramIsGDOMType = IsGDOMClassType($paramIDLType); - if (!$paramTypeIsPrimitive) { - # FIXME: Temporary hack for generating a proper implementation - # of the webkit_dom_document_evaluate function (Bug-ID: 42115) - if (!(($functionName eq "webkit_dom_document_evaluate") && ($paramIDLType eq "XPathResult"))) { - $gReturnMacro = GetGReturnMacro($paramName, $paramIDLType, $returnType); - push(@cBody, $gReturnMacro); - } - } - } - - if (@{$function->raisesExceptions}) { - $gReturnMacro = GetGReturnMacro("error", "GError", $returnType); - push(@cBody, $gReturnMacro); - } - - # The WebKit::core implementations check for null already; no need to duplicate effort. - push(@cBody, " WebCore::${interfaceName}* item = WebKit::core(self);\n"); - - $returnParamName = ""; - foreach my $param (@{$function->parameters}) { - my $paramIDLType = $param->type; - my $paramName = $param->name; - - my $paramIsGDOMType = IsGDOMClassType($paramIDLType); - $convertedParamName = "converted" . $codeGenerator->WK_ucfirst($paramName); - if ($paramIDLType eq "DOMString") { - push(@cBody, " WTF::String ${convertedParamName} = WTF::String::fromUTF8($paramName);\n"); - } elsif ($paramIDLType eq "CompareHow") { - push(@cBody, " WebCore::Range::CompareHow ${convertedParamName} = static_cast<WebCore::Range::CompareHow>($paramName);\n"); - } elsif ($paramIsGDOMType) { - push(@cBody, " WebCore::${paramIDLType}* ${convertedParamName} = WebKit::core($paramName);\n"); - } - $returnParamName = $convertedParamName if $param->extendedAttributes->{"CustomReturn"}; - } - - my $assign = ""; - my $assignPre = ""; - my $assignPost = ""; - - # We need to special-case these Node methods because their C++ - # signature is different from what we'd expect given their IDL - # description; see Node.h. - my $functionHasCustomReturn = $functionName eq "webkit_dom_node_append_child" || - $functionName eq "webkit_dom_node_insert_before" || - $functionName eq "webkit_dom_node_replace_child" || - $functionName eq "webkit_dom_node_remove_child"; - - if ($returnType ne "void" && !$functionHasCustomReturn) { - if ($returnValueIsGDOMType) { - $assign = "RefPtr<WebCore::${functionSigType}> gobjectResult = "; - $assignPre = "WTF::getPtr("; - $assignPost = ")"; - } else { - $assign = "${returnType} result = "; - } - } - - if (@{$function->raisesExceptions}) { - push(@cBody, " WebCore::ExceptionCode ec = 0;\n") ; - push(@callImplParams, "ec"); - } - - my $functionImplementationName = $function->signature->extendedAttributes->{"ImplementedAs"} || $function->signature->name; - - if ($functionHasCustomReturn) { - push(@cBody, " bool ok = item->${functionImplementationName}(" . join(", ", @callImplParams) . ");\n"); - my $customNodeAppendChild = << "EOF"; - if (ok) - return WebKit::kit($returnParamName); -EOF - push(@cBody, $customNodeAppendChild); - - if(@{$function->raisesExceptions}) { - my $exceptionHandling = << "EOF"; - - WebCore::ExceptionCodeDescription ecdesc(ec); - g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name); -EOF - push(@cBody, $exceptionHandling); - } - push(@cBody, " return 0;\n"); - push(@cBody, "}\n\n"); - return; - } elsif ($functionSigType eq "DOMString") { - my $getterContentHead; - if ($prefix) { - my ($functionName, @arguments) = $codeGenerator->GetterExpression(\%implIncludes, $interfaceName, $function); - push(@arguments, @callImplParams); - if ($function->signature->extendedAttributes->{"ImplementedBy"}) { - my $implementedBy = $function->signature->extendedAttributes->{"ImplementedBy"}; - $implIncludes{"${implementedBy}.h"} = 1; - unshift(@arguments, "item"); - $functionName = "WebCore::${implementedBy}::${functionName}"; - } else { - $functionName = "item->${functionName}"; - } - $getterContentHead = "${assign}convertToUTF8String(${functionName}(" . join(", ", @arguments) . "));\n"; - } else { - my @arguments = @callImplParams; - if ($function->signature->extendedAttributes->{"ImplementedBy"}) { - my $implementedBy = $function->signature->extendedAttributes->{"ImplementedBy"}; - $implIncludes{"${implementedBy}.h"} = 1; - unshift(@arguments, "item"); - $getterContentHead = "${assign}convertToUTF8String(WebCore::${implementedBy}::${functionImplementationName}(" . join(", ", @arguments) . "));\n"; - } else { - $getterContentHead = "${assign}convertToUTF8String(item->${functionImplementationName}(" . join(", ", @arguments) . "));\n"; - } - } - push(@cBody, " ${getterContentHead}"); - } else { - my $contentHead; - if ($prefix eq "get_") { - my ($functionName, @arguments) = $codeGenerator->GetterExpression(\%implIncludes, $interfaceName, $function); - push(@arguments, @callImplParams); - if ($function->signature->extendedAttributes->{"ImplementedBy"}) { - my $implementedBy = $function->signature->extendedAttributes->{"ImplementedBy"}; - $implIncludes{"${implementedBy}.h"} = 1; - unshift(@arguments, "item"); - $functionName = "WebCore::${implementedBy}::${functionName}"; - } else { - $functionName = "item->${functionName}"; - } - $contentHead = "${assign}${assignPre}${functionName}(" . join(", ", @arguments) . "${assignPost});\n"; - } elsif ($prefix eq "set_") { - my ($functionName, @arguments) = $codeGenerator->SetterExpression(\%implIncludes, $interfaceName, $function); - push(@arguments, @callImplParams); - if ($function->signature->extendedAttributes->{"ImplementedBy"}) { - my $implementedBy = $function->signature->extendedAttributes->{"ImplementedBy"}; - $implIncludes{"${implementedBy}.h"} = 1; - unshift(@arguments, "item"); - $functionName = "WebCore::${implementedBy}::${functionName}"; - $contentHead = "${assign}${assignPre}${functionName}(" . join(", ", @arguments) . "${assignPost});\n"; - } else { - $functionName = "item->${functionName}"; - $contentHead = "${assign}${assignPre}${functionName}(" . join(", ", @arguments) . "${assignPost});\n"; - } - } else { - my @arguments = @callImplParams; - if ($function->signature->extendedAttributes->{"ImplementedBy"}) { - my $implementedBy = $function->signature->extendedAttributes->{"ImplementedBy"}; - $implIncludes{"${implementedBy}.h"} = 1; - unshift(@arguments, "item"); - $contentHead = "${assign}${assignPre}WebCore::${implementedBy}::${functionImplementationName}(" . join(", ", @arguments) . "${assignPost});\n"; - } else { - $contentHead = "${assign}${assignPre}item->${functionImplementationName}(" . join(", ", @arguments) . "${assignPost});\n"; - } - } - push(@cBody, " ${contentHead}"); - - if(@{$function->raisesExceptions}) { - my $exceptionHandling = << "EOF"; - if (ec) { - WebCore::ExceptionCodeDescription ecdesc(ec); - g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name); - } -EOF - push(@cBody, $exceptionHandling); - } - } - - if ($returnType ne "void" && !$functionHasCustomReturn) { - if ($functionSigType ne "DOMObject") { - if ($returnValueIsGDOMType) { - push(@cBody, " return WebKit::kit(gobjectResult.get());\n"); - } else { - push(@cBody, " return result;\n"); - } - } else { - push(@cBody, " return 0; // TODO: return canvas object\n"); - } - } - - if ($conditionalString) { - push(@cBody, "#else\n"); - push(@cBody, @conditionalWarn) if scalar(@conditionalWarn); - if ($returnType ne "void") { - if ($codeGenerator->IsNonPointerType($functionSigType)) { - push(@cBody, " return static_cast<${returnType}>(0);\n"); - } else { - push(@cBody, " return 0;\n"); - } - } - push(@cBody, "#endif /* ${conditionalString} */\n"); - } - - if ($parentConditionalString) { - push(@cBody, "#else\n"); - push(@cBody, @parentConditionalWarn) if scalar(@parentConditionalWarn); - if ($returnType ne "void") { - if ($codeGenerator->IsNonPointerType($functionSigType)) { - push(@cBody, " return static_cast<${returnType}>(0);\n"); - } else { - push(@cBody, " return 0;\n"); - } - } - push(@cBody, "#endif /* ${parentConditionalString} */\n"); - } - - push(@cBody, "}\n\n"); -} - -sub ClassHasFunction { - my ($class, $name) = @_; - - foreach my $function (@{$class->functions}) { - if ($function->signature->name eq $name) { - return 1; - } - } - - return 0; -} - -sub GenerateFunctions { - my ($object, $interfaceName, $interface) = @_; - - foreach my $function (@{$interface->functions}) { - $object->GenerateFunction($interfaceName, $function, "", $interface); - } - - TOP: - foreach my $attribute (@{$interface->attributes}) { - if (SkipAttribute($attribute) || - $attribute->signature->type eq "EventListener" || - $attribute->signature->type eq "MediaQueryListListener") { - next TOP; - } - - if ($attribute->signature->name eq "type" - # This will conflict with the get_type() function we define to return a GType - # according to GObject conventions. Skip this for now. - || $attribute->signature->name eq "URL" # TODO: handle this - ) { - next TOP; - } - - my $attrNameUpper = $codeGenerator->WK_ucfirst($attribute->signature->name); - my $getname = "get${attrNameUpper}"; - my $setname = "set${attrNameUpper}"; - if (ClassHasFunction($interface, $getname) || ClassHasFunction($interface, $setname)) { - # Very occasionally an IDL file defines getter/setter functions for one of its - # attributes; in this case we don't need to autogenerate the getter/setter. - next TOP; - } - - # Generate an attribute getter. For an attribute "foo", this is a function named - # "get_foo" which calls a DOM class method named foo(). - my $function = new domFunction(); - $function->signature($attribute->signature); - $function->raisesExceptions($attribute->getterExceptions); - $object->GenerateFunction($interfaceName, $function, "get_", $interface); - - # FIXME: We are not generating setters for 'Replaceable' - # attributes now, but we should somehow. - if ($attribute->type =~ /^readonly/ || - $attribute->signature->extendedAttributes->{"Replaceable"}) { - next TOP; - } - - # Generate an attribute setter. For an attribute, "foo", this is a function named - # "set_foo" which calls a DOM class method named setFoo(). - $function = new domFunction(); - - $function->signature(new domSignature()); - $function->signature->name($attribute->signature->name); - $function->signature->type($attribute->signature->type); - $function->signature->extendedAttributes($attribute->signature->extendedAttributes); - - my $param = new domSignature(); - $param->name("value"); - $param->type($attribute->signature->type); - my %attributes = (); - $param->extendedAttributes(\%attributes); - my $arrayRef = $function->parameters; - push(@$arrayRef, $param); - - $function->raisesExceptions($attribute->setterExceptions); - - $object->GenerateFunction($interfaceName, $function, "set_", $interface); - } -} - -sub GenerateCFile { - my ($object, $interfaceName, $parentClassName, $parentGObjType, $interface) = @_; - - if ($interface->extendedAttributes->{"EventTarget"}) { - $object->GenerateEventTargetIface($interface); - } - - my $implContent = ""; - - my $clsCaps = uc(FixUpDecamelizedName(decamelize($interfaceName))); - my $lowerCaseIfaceName = "webkit_dom_" . FixUpDecamelizedName(decamelize($interfaceName)); - my $parentImplClassName = GetParentImplClassName($interface); - - # Add a private struct only for direct subclasses of Object so that we can use RefPtr - # for the WebCore wrapped object and make sure we only increment the reference counter once. - if ($parentImplClassName eq "Object") { - my $conditionalString = $codeGenerator->GenerateConditionalString($interface); - push(@cStructPriv, "#define WEBKIT_DOM_${clsCaps}_GET_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE(obj, WEBKIT_TYPE_DOM_${clsCaps}, ${className}Private)\n\n"); - push(@cStructPriv, "typedef struct _${className}Private {\n"); - push(@cStructPriv, "#if ${conditionalString}\n") if $conditionalString; - push(@cStructPriv, " RefPtr<WebCore::${interfaceName}> coreObject;\n"); - push(@cStructPriv, "#endif // ${conditionalString}\n") if $conditionalString; - push(@cStructPriv, "} ${className}Private;\n\n"); - } - - $implContent = << "EOF"; -${defineTypeMacro}(${className}, ${lowerCaseIfaceName}, ${parentGObjType}${defineTypeInterfaceImplementation} - -EOF - push(@cBodyProperties, $implContent); - - if (!UsesManualKitImplementation($interfaceName)) { - $implContent = << "EOF"; -${className}* kit(WebCore::$interfaceName* obj) -{ - if (!obj) - return 0; - - if (gpointer ret = DOMObjectCache::get(obj)) - return WEBKIT_DOM_${clsCaps}(ret); - - return wrap${interfaceName}(obj); -} - -EOF - push(@cBodyPriv, $implContent); - } - - $implContent = << "EOF"; -WebCore::${interfaceName}* core(${className}* request) -{ - return request ? static_cast<WebCore::${interfaceName}*>(WEBKIT_DOM_OBJECT(request)->coreObject) : 0; -} - -${className}* wrap${interfaceName}(WebCore::${interfaceName}* coreObject) -{ - ASSERT(coreObject); - return WEBKIT_DOM_${clsCaps}(g_object_new(WEBKIT_TYPE_DOM_${clsCaps}, "core-object", coreObject, NULL)); -} - -EOF - push(@cBodyPriv, $implContent); - - $object->GenerateProperties($interfaceName, $interface); - $object->GenerateFunctions($interfaceName, $interface); -} - -sub GenerateEndHeader { - my ($object) = @_; - - #Header guard - my $guard = $className . "_h"; - - push(@hBody, "G_END_DECLS\n\n"); - push(@hPrefixGuardEnd, "#endif /* $guard */\n"); -} - -sub UsesManualKitImplementation { - my $type = shift; - - return 1 if $type eq "Node" or $type eq "Element" or $type eq "Event"; - return 0; -} - -sub GenerateEventTargetIface { - my $object = shift; - my $interface = shift; - - my $interfaceName = $interface->name; - my $decamelize = FixUpDecamelizedName(decamelize($interfaceName)); - - $implIncludes{"GObjectEventListener.h"} = 1; - $implIncludes{"WebKitDOMEventTarget.h"} = 1; - $implIncludes{"WebKitDOMEventPrivate.h"} = 1; - - my $impl = << "EOF"; -static void webkit_dom_${decamelize}_dispatch_event(WebKitDOMEventTarget* target, WebKitDOMEvent* event, GError** error) -{ - WebCore::Event* coreEvent = WebKit::core(event); - WebCore::${interfaceName}* coreTarget = static_cast<WebCore::${interfaceName}*>(WEBKIT_DOM_OBJECT(target)->coreObject); - - WebCore::ExceptionCode ec = 0; - coreTarget->dispatchEvent(coreEvent, ec); - if (ec) { - WebCore::ExceptionCodeDescription description(ec); - g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), description.code, description.name); - } -} - -static gboolean webkit_dom_${decamelize}_add_event_listener(WebKitDOMEventTarget* target, const char* eventName, GCallback handler, gboolean bubble, gpointer userData) -{ - WebCore::${interfaceName}* coreTarget = static_cast<WebCore::${interfaceName}*>(WEBKIT_DOM_OBJECT(target)->coreObject); - return WebCore::GObjectEventListener::addEventListener(G_OBJECT(target), coreTarget, eventName, handler, bubble, userData); -} - -static gboolean webkit_dom_${decamelize}_remove_event_listener(WebKitDOMEventTarget* target, const char* eventName, GCallback handler, gboolean bubble) -{ - WebCore::${interfaceName}* coreTarget = static_cast<WebCore::${interfaceName}*>(WEBKIT_DOM_OBJECT(target)->coreObject); - return WebCore::GObjectEventListener::removeEventListener(G_OBJECT(target), coreTarget, eventName, handler, bubble); -} - -static void webkit_dom_event_target_init(WebKitDOMEventTargetIface* iface) -{ - iface->dispatch_event = webkit_dom_${decamelize}_dispatch_event; - iface->add_event_listener = webkit_dom_${decamelize}_add_event_listener; - iface->remove_event_listener = webkit_dom_${decamelize}_remove_event_listener; -} - -EOF - - push(@cBodyProperties, $impl); - - $defineTypeMacro = "G_DEFINE_TYPE_WITH_CODE"; - $defineTypeInterfaceImplementation = ", G_IMPLEMENT_INTERFACE(WEBKIT_TYPE_DOM_EVENT_TARGET, webkit_dom_event_target_init))"; -} - -sub Generate { - my ($object, $interface) = @_; - - my $parentClassName = GetParentClassName($interface); - my $parentGObjType = GetParentGObjType($interface); - my $interfaceName = $interface->name; - - # Add the default impl header template - @cPrefix = split("\r", $licenceTemplate); - push(@cPrefix, "\n"); - - $implIncludes{"DOMObjectCache.h"} = 1; - $implIncludes{"WebKitDOMBinding.h"} = 1; - $implIncludes{"gobject/ConvertToUTF8String.h"} = 1; - $implIncludes{"${className}Private.h"} = 1; - $implIncludes{"JSMainThreadExecState.h"} = 1; - $implIncludes{"ExceptionCode.h"} = 1; - - $hdrIncludes{"webkitdom/${parentClassName}.h"} = 1; - - $object->GenerateHeader($interfaceName, $parentClassName); - $object->GenerateCFile($interfaceName, $parentClassName, $parentGObjType, $interface); - $object->GenerateEndHeader(); -} - -sub WriteData { - my $object = shift; - my $interface = shift; - my $outputDir = shift; - mkdir $outputDir; - - # Write a private header. - my $interfaceName = $interface->name; - my $filename = "$outputDir/" . $className . "Private.h"; - my $guard = "${className}Private_h"; - - # Add the guard if the 'Conditional' extended attribute exists - my $conditionalString = $codeGenerator->GenerateConditionalString($interface); - - open(PRIVHEADER, ">$filename") or die "Couldn't open file $filename for writing"; - - print PRIVHEADER split("\r", $licenceTemplate); - print PRIVHEADER "\n"; - - my $text = << "EOF"; -#ifndef $guard -#define $guard - -#include "${interfaceName}.h" -#include <webkitdom/${className}.h> -EOF - - print PRIVHEADER $text; - print PRIVHEADER "#if ${conditionalString}\n" if $conditionalString; - print PRIVHEADER map { "#include \"$_\"\n" } sort keys(%hdrPropIncludes); - print PRIVHEADER "\n"; - $text = << "EOF"; -namespace WebKit { -${className}* wrap${interfaceName}(WebCore::${interfaceName}*); -WebCore::${interfaceName}* core(${className}* request); -EOF - - print PRIVHEADER $text; - - if ($className ne "WebKitDOMNode") { - print PRIVHEADER "${className}* kit(WebCore::${interfaceName}* node);\n" - } - - $text = << "EOF"; -} // namespace WebKit - -EOF - - print PRIVHEADER $text; - print PRIVHEADER "#endif /* ${conditionalString} */\n\n" if $conditionalString; - print PRIVHEADER "#endif /* ${guard} */\n"; - - close(PRIVHEADER); - - my $basename = FileNamePrefix . $interfaceName; - $basename =~ s/_//g; - - # Write public header. - my $fullHeaderFilename = "$outputDir/" . $basename . ".h"; - my $installedHeaderFilename = "${basename}.h"; - open(HEADER, ">$fullHeaderFilename") or die "Couldn't open file $fullHeaderFilename"; - - print HEADER @hPrefix; - print HEADER @hPrefixGuard; - print HEADER "#include <glib-object.h>\n"; - print HEADER map { "#include <$_>\n" } sort keys(%hdrIncludes); - print HEADER "#include <webkitdom/webkitdomdefines.h>\n\n"; - print HEADER @hBodyPre; - print HEADER @hBody; - print HEADER @hPrefixGuardEnd; - - close(HEADER); - - # Write the implementation sources - my $implFileName = "$outputDir/" . $basename . ".cpp"; - open(IMPL, ">$implFileName") or die "Couldn't open file $implFileName"; - - print IMPL @cPrefix; - print IMPL "#include \"config.h\"\n"; - print IMPL "#include \"$installedHeaderFilename\"\n\n"; - - # Remove the implementation header from the list of included files. - %includesCopy = %implIncludes; - print IMPL map { "#include \"$_\"\n" } sort keys(%includesCopy); - - print IMPL "#include <wtf/GetPtr.h>\n"; - print IMPL "#include <wtf/RefPtr.h>\n\n"; - print IMPL @cStructPriv; - print IMPL "#if ${conditionalString}\n\n" if $conditionalString; - - print IMPL "namespace WebKit {\n\n"; - print IMPL @cBodyPriv; - print IMPL "} // namespace WebKit\n\n"; - print IMPL "#endif // ${conditionalString}\n\n" if $conditionalString; - - print IMPL @cBodyProperties; - print IMPL @cBody; - - close(IMPL); - - %implIncludes = (); - %hdrIncludes = (); - @hPrefix = (); - @hBody = (); - - @cPrefix = (); - @cBody = (); - @cBodyPriv = (); - @cBodyProperties = (); - @cStructPriv = (); -} - -sub GenerateInterface { - my ($object, $interface, $defines) = @_; - - # Set up some global variables - $className = GetClassName($interface->name); - - $object->Generate($interface); -} - -1; diff --git a/contrib/dom/scripts/CodeGeneratorJS.pm b/contrib/dom/scripts/CodeGeneratorJS.pm deleted file mode 100644 index 6c92d71..0000000 --- a/contrib/dom/scripts/CodeGeneratorJS.pm +++ /dev/null @@ -1,4077 +0,0 @@ -# -# Copyright (C) 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> -# Copyright (C) 2006 Anders Carlsson <andersca@mac.com> -# Copyright (C) 2006, 2007 Samuel Weinig <sam@webkit.org> -# Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> -# Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. -# Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> -# Copyright (C) Research In Motion Limited 2010. All rights reserved. -# Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) -# Copyright (C) 2011 Patrick Gansterer <paroga@webkit.org> -# Copyright (C) 2012 Ericsson AB. All rights reserved. -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library 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. See the GNU -# Library General Public License for more details. -# -# You should have received a copy of the GNU Library General Public License -# along with this library; see the file COPYING.LIB. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. - -package CodeGeneratorJS; - -use strict; - -use constant FileNamePrefix => "JS"; - -my $codeGenerator; - -my $writeDependencies = 0; - -my @headerContentHeader = (); -my @headerContent = (); -my %headerIncludes = (); -my %headerTrailingIncludes = (); - -my @implContentHeader = (); -my @implContent = (); -my %implIncludes = (); -my @depsContent = (); -my $numCachedAttributes = 0; -my $currentCachedAttribute = 0; - -# Default .h template -my $headerTemplate = << "EOF"; -/* - This file is part of the WebKit open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ -EOF - -# Default constructor -sub new -{ - my $object = shift; - my $reference = { }; - - $codeGenerator = shift; - shift; # $useLayerOnTop - shift; # $preprocessor - $writeDependencies = shift; - - bless($reference, $object); - return $reference; -} - -sub leftShift($$) { - my ($value, $distance) = @_; - return (($value << $distance) & 0xFFFFFFFF); -} - -sub GenerateInterface -{ - my $object = shift; - my $interface = shift; - my $defines = shift; - - $codeGenerator->LinkOverloadedFunctions($interface); - - # Start actual generation - if ($interface->extendedAttributes->{"Callback"}) { - $object->GenerateCallbackHeader($interface); - $object->GenerateCallbackImplementation($interface); - } else { - $object->GenerateHeader($interface); - $object->GenerateImplementation($interface); - } -} - -sub GenerateAttributeEventListenerCall -{ - my $className = shift; - my $implSetterFunctionName = shift; - my $windowEventListener = shift; - - my $wrapperObject = $windowEventListener ? "globalObject" : "thisObject"; - my @GenerateEventListenerImpl = (); - - if ($className eq "JSSVGElementInstance") { - # SVGElementInstances have to create JSEventListeners with the wrapper equal to the correspondingElement - $wrapperObject = "asObject(correspondingElementWrapper)"; - - push(@GenerateEventListenerImpl, <<END); - JSValue correspondingElementWrapper = toJS(exec, castedThis->globalObject(), impl->correspondingElement()); - if (correspondingElementWrapper.isObject()) -END - - # Add leading whitespace to format the impl->set... line correctly - push(@GenerateEventListenerImpl, " "); - } - - push(@GenerateEventListenerImpl, " impl->set$implSetterFunctionName(createJSAttributeEventListener(exec, value, $wrapperObject));\n"); - return @GenerateEventListenerImpl; -} - -sub GenerateEventListenerCall -{ - my $className = shift; - my $functionName = shift; - my $passRefPtrHandling = ($functionName eq "add") ? "" : ".get()"; - - $implIncludes{"JSEventListener.h"} = 1; - - my @GenerateEventListenerImpl = (); - my $wrapperObject = "castedThis"; - if ($className eq "JSSVGElementInstance") { - # SVGElementInstances have to create JSEventListeners with the wrapper equal to the correspondingElement - $wrapperObject = "asObject(correspondingElementWrapper)"; - - push(@GenerateEventListenerImpl, <<END); - JSValue correspondingElementWrapper = toJS(exec, castedThis->globalObject(), impl->correspondingElement()); - if (!correspondingElementWrapper.isObject()) - return JSValue::encode(jsUndefined()); -END - } - - push(@GenerateEventListenerImpl, <<END); - JSValue listener = exec->argument(1); - if (!listener.isObject()) - return JSValue::encode(jsUndefined()); - impl->${functionName}EventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), $wrapperObject, false, currentWorld(exec))$passRefPtrHandling, exec->argument(2).toBoolean(exec)); - return JSValue::encode(jsUndefined()); -END - return @GenerateEventListenerImpl; -} - -sub GetParentClassName -{ - my $interface = shift; - - return $interface->extendedAttributes->{"JSLegacyParent"} if $interface->extendedAttributes->{"JSLegacyParent"}; - return "JSDOMWrapper" if (@{$interface->parents} eq 0); - return "JS" . $interface->parents(0); -} - -sub GetCallbackClassName -{ - my $className = shift; - - return "JS$className"; -} - -sub IndexGetterReturnsStrings -{ - my $type = shift; - - return 1 if $type eq "CSSStyleDeclaration" or $type eq "MediaList" or $type eq "DOMStringList" or $type eq "DOMString[]" or $type eq "DOMTokenList" or $type eq "DOMSettableTokenList"; - return 0; -} - -sub AddIncludesForTypeInImpl -{ - my $type = shift; - my $isCallback = @_ ? shift : 0; - - AddIncludesForType($type, $isCallback, \%implIncludes); - - # additional includes (things needed to compile the bindings but not the header) - if ($type eq "CanvasRenderingContext2D") { - $implIncludes{"CanvasGradient.h"} = 1; - $implIncludes{"CanvasPattern.h"} = 1; - $implIncludes{"CanvasStyle.h"} = 1; - } - - if ($type eq "CanvasGradient" or $type eq "XPathNSResolver" or $type eq "MessagePort") { - $implIncludes{"<wtf/text/WTFString.h>"} = 1; - } - - if ($type eq "Document") { - $implIncludes{"NodeFilter.h"} = 1; - } - - if ($type eq "MediaQueryListListener") { - $implIncludes{"MediaQueryListListener.h"} = 1; - } -} - -sub AddIncludesForTypeInHeader -{ - my $type = shift; - my $isCallback = @_ ? shift : 0; - - AddIncludesForType($type, $isCallback, \%headerIncludes); -} - -sub AddIncludesForType -{ - my $type = shift; - my $isCallback = shift; - my $includesRef = shift; - - # When we're finished with the one-file-per-class - # reorganization, we won't need these special cases. - if ($codeGenerator->IsPrimitiveType($type) or $codeGenerator->SkipIncludeHeader($type) - or $type eq "DOMString" or $type eq "DOMObject" or $type eq "any" or $type eq "Array" or $type eq "DOMTimeStamp") { - } elsif ($type =~ /SVGPathSeg/) { - my $joinedName = $type; - $joinedName =~ s/Abs|Rel//; - $includesRef->{"${joinedName}.h"} = 1; - } elsif ($type eq "XPathNSResolver") { - $includesRef->{"JSXPathNSResolver.h"} = 1; - $includesRef->{"JSCustomXPathNSResolver.h"} = 1; - } elsif ($type eq "DOMString[]") { - # FIXME: Consider replacing DOMStringList with DOMString[] or sequence<DOMString>. - $includesRef->{"JSDOMStringList.h"} = 1; - } elsif ($type eq "SerializedScriptValue") { - $includesRef->{"SerializedScriptValue.h"} = 1; - } elsif ($isCallback) { - $includesRef->{"JS${type}.h"} = 1; - } elsif ($codeGenerator->IsTypedArrayType($type)) { - $includesRef->{"<wtf/${type}.h>"} = 1; - } elsif ($codeGenerator->GetSequenceType($type)) { - } else { - # default, include the same named file - $includesRef->{"${type}.h"} = 1; - } -} - -# FIXME: This method will go away once all SVG animated properties are converted to the new scheme. -sub AddIncludesForSVGAnimatedType -{ - my $type = shift; - $type =~ s/SVGAnimated//; - - if ($type eq "Point" or $type eq "Rect") { - $implIncludes{"Float$type.h"} = 1; - } elsif ($type eq "String") { - $implIncludes{"<wtf/text/WTFString.h>"} = 1; - } -} - -sub AddToImplIncludes -{ - my $header = shift; - my $conditional = shift; - - if (not $conditional) { - $implIncludes{$header} = 1; - } elsif (not exists($implIncludes{$header})) { - $implIncludes{$header} = $conditional; - } else { - my $oldValue = $implIncludes{$header}; - if ($oldValue ne 1) { - my %newValue = (); - $newValue{$conditional} = 1; - foreach my $condition (split(/\|/, $oldValue)) { - $newValue{$condition} = 1; - } - $implIncludes{$header} = join("|", sort keys %newValue); - } - } -} - -sub IsScriptProfileType -{ - my $type = shift; - return 1 if ($type eq "ScriptProfileNode"); - return 0; -} - -sub IsReadonly -{ - my $attribute = shift; - return $attribute->type =~ /readonly/ && !$attribute->signature->extendedAttributes->{"Replaceable"}; -} - -sub AddTypedefForScriptProfileType -{ - my $type = shift; - (my $jscType = $type) =~ s/Script//; - - push(@headerContent, "typedef JSC::$jscType $type;\n\n"); -} - -sub AddClassForwardIfNeeded -{ - my $interfaceName = shift; - - # SVGAnimatedLength/Number/etc. are typedefs to SVGAnimatedTemplate, so don't use class forwards for them! - unless ($codeGenerator->IsSVGAnimatedType($interfaceName) or IsScriptProfileType($interfaceName) or $codeGenerator->IsTypedArrayType($interfaceName)) { - push(@headerContent, "class $interfaceName;\n\n"); - # ScriptProfile and ScriptProfileNode are typedefs to JSC::Profile and JSC::ProfileNode. - } elsif (IsScriptProfileType($interfaceName)) { - $headerIncludes{"<profiler/ProfileNode.h>"} = 1; - AddTypedefForScriptProfileType($interfaceName); - } -} - -sub HashValueForClassAndName -{ - my $class = shift; - my $name = shift; - - # SVG Filter enums live in WebCore namespace (platform/graphics/) - if ($class =~ /^SVGFE*/ or $class =~ /^SVGComponentTransferFunctionElement$/) { - return "WebCore::$name"; - } - - return "${class}::$name"; -} - -sub hashTableAccessor -{ - my $noStaticTables = shift; - my $className = shift; - if ($noStaticTables) { - return "get${className}Table(exec)"; - } else { - return "&${className}Table"; - } -} - -sub prototypeHashTableAccessor -{ - my $noStaticTables = shift; - my $className = shift; - if ($noStaticTables) { - return "get${className}PrototypeTable(exec)"; - } else { - return "&${className}PrototypeTable"; - } -} - -sub constructorHashTableAccessor -{ - my $noStaticTables = shift; - my $constructorClassName = shift; - if ($noStaticTables) { - return "get${constructorClassName}Table(exec)"; - } else { - return "&${constructorClassName}Table"; - } -} - -sub GetGenerateIsReachable -{ - my $interface = shift; - return $interface->extendedAttributes->{"GenerateIsReachable"} || $interface->extendedAttributes->{"JSGenerateIsReachable"}; -} - -sub GetCustomIsReachable -{ - my $interface = shift; - return $interface->extendedAttributes->{"CustomIsReachable"} || $interface->extendedAttributes->{"JSCustomIsReachable"}; -} - -sub GenerateGetOwnPropertySlotBody -{ - my ($interface, $interfaceName, $className, $hasAttributes, $inlined) = @_; - - my $namespaceMaybe = ($inlined ? "JSC::" : ""); - - my @getOwnPropertySlotImpl = (); - - if ($interfaceName eq "NamedNodeMap" or $interfaceName =~ /^HTML\w*Collection$/) { - push(@getOwnPropertySlotImpl, " ${namespaceMaybe}JSValue proto = thisObject->prototype();\n"); - push(@getOwnPropertySlotImpl, " if (proto.isObject() && jsCast<${namespaceMaybe}JSObject*>(asObject(proto))->hasProperty(exec, propertyName))\n"); - push(@getOwnPropertySlotImpl, " return false;\n\n"); - } - - my $manualLookupGetterGeneration = sub { - my $requiresManualLookup = $interface->extendedAttributes->{"IndexedGetter"} || $interface->extendedAttributes->{"NamedGetter"}; - if ($requiresManualLookup) { - push(@getOwnPropertySlotImpl, " const ${namespaceMaybe}HashEntry* entry = ${className}Table.entry(exec, propertyName);\n"); - push(@getOwnPropertySlotImpl, " if (entry) {\n"); - push(@getOwnPropertySlotImpl, " slot.setCustom(thisObject, entry->propertyGetter());\n"); - push(@getOwnPropertySlotImpl, " return true;\n"); - push(@getOwnPropertySlotImpl, " }\n"); - } - }; - - if (!$interface->extendedAttributes->{"CustomNamedGetter"}) { - &$manualLookupGetterGeneration(); - } - - if ($interface->extendedAttributes->{"IndexedGetter"} || $interface->extendedAttributes->{"NumericIndexedGetter"}) { - push(@getOwnPropertySlotImpl, " unsigned index = propertyName.asIndex();\n"); - - # If the item function returns a string then we let the TreatReturnedNullStringAs handle the cases - # where the index is out of range. - if (IndexGetterReturnsStrings($interfaceName)) { - push(@getOwnPropertySlotImpl, " if (index != PropertyName::NotAnIndex) {\n"); - } else { - push(@getOwnPropertySlotImpl, " if (index != PropertyName::NotAnIndex && index < static_cast<$interfaceName*>(thisObject->impl())->length()) {\n"); - } - if ($interface->extendedAttributes->{"NumericIndexedGetter"}) { - push(@getOwnPropertySlotImpl, " slot.setValue(thisObject->getByIndex(exec, index));\n"); - } else { - push(@getOwnPropertySlotImpl, " slot.setCustomIndex(thisObject, index, indexGetter);\n"); - } - push(@getOwnPropertySlotImpl, " return true;\n"); - push(@getOwnPropertySlotImpl, " }\n"); - } - - if ($interface->extendedAttributes->{"NamedGetter"} || $interface->extendedAttributes->{"CustomNamedGetter"}) { - push(@getOwnPropertySlotImpl, " if (canGetItemsForName(exec, static_cast<$interfaceName*>(thisObject->impl()), propertyName)) {\n"); - push(@getOwnPropertySlotImpl, " slot.setCustom(thisObject, thisObject->nameGetter);\n"); - push(@getOwnPropertySlotImpl, " return true;\n"); - push(@getOwnPropertySlotImpl, " }\n"); - if ($inlined) { - $headerIncludes{"wtf/text/AtomicString.h"} = 1; - } else { - $implIncludes{"wtf/text/AtomicString.h"} = 1; - } - } - - if ($interface->extendedAttributes->{"CustomNamedGetter"}) { - &$manualLookupGetterGeneration(); - } - - if ($interface->extendedAttributes->{"JSCustomGetOwnPropertySlotAndDescriptor"}) { - push(@getOwnPropertySlotImpl, " if (thisObject->getOwnPropertySlotDelegate(exec, propertyName, slot))\n"); - push(@getOwnPropertySlotImpl, " return true;\n"); - } - - if ($hasAttributes) { - if ($inlined) { - die "Cannot inline if NoStaticTables is set." if ($interface->extendedAttributes->{"JSNoStaticTables"}); - push(@getOwnPropertySlotImpl, " return ${namespaceMaybe}getStaticValueSlot<$className, Base>(exec, s_info.staticPropHashTable, thisObject, propertyName, slot);\n"); - } else { - push(@getOwnPropertySlotImpl, " return ${namespaceMaybe}getStaticValueSlot<$className, Base>(exec, " . hashTableAccessor($interface->extendedAttributes->{"JSNoStaticTables"}, $className) . ", thisObject, propertyName, slot);\n"); - } - } else { - push(@getOwnPropertySlotImpl, " return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);\n"); - } - - return @getOwnPropertySlotImpl; -} - -sub GenerateGetOwnPropertyDescriptorBody -{ - my ($interface, $interfaceName, $className, $hasAttributes, $inlined) = @_; - - my $namespaceMaybe = ($inlined ? "JSC::" : ""); - - my @getOwnPropertyDescriptorImpl = (); - if ($interface->extendedAttributes->{"CheckSecurity"}) { - if ($interfaceName eq "DOMWindow") { - $implIncludes{"BindingSecurity.h"} = 1; - push(@implContent, " if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, jsCast<$className*>(thisObject)->impl()))\n"); - } else { - push(@implContent, " if (!shouldAllowAccessToFrame(exec, thisObject->impl()->frame()))\n"); - } - push(@implContent, " return false;\n"); - } - - if ($interfaceName eq "NamedNodeMap" or $interfaceName =~ /^HTML\w*Collection$/) { - push(@getOwnPropertyDescriptorImpl, " ${namespaceMaybe}JSValue proto = thisObject->prototype();\n"); - push(@getOwnPropertyDescriptorImpl, " if (proto.isObject() && jsCast<${namespaceMaybe}JSObject*>(asObject(proto))->hasProperty(exec, propertyName))\n"); - push(@getOwnPropertyDescriptorImpl, " return false;\n\n"); - } - - my $manualLookupGetterGeneration = sub { - my $requiresManualLookup = $interface->extendedAttributes->{"IndexedGetter"} || $interface->extendedAttributes->{"NamedGetter"}; - if ($requiresManualLookup) { - push(@getOwnPropertyDescriptorImpl, " const ${namespaceMaybe}HashEntry* entry = ${className}Table.entry(exec, propertyName);\n"); - push(@getOwnPropertyDescriptorImpl, " if (entry) {\n"); - push(@getOwnPropertyDescriptorImpl, " PropertySlot slot;\n"); - push(@getOwnPropertyDescriptorImpl, " slot.setCustom(thisObject, entry->propertyGetter());\n"); - push(@getOwnPropertyDescriptorImpl, " descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes());\n"); - push(@getOwnPropertyDescriptorImpl, " return true;\n"); - push(@getOwnPropertyDescriptorImpl, " }\n"); - } - }; - - if (!$interface->extendedAttributes->{"CustomNamedGetter"}) { - &$manualLookupGetterGeneration(); - } - - if ($interface->extendedAttributes->{"IndexedGetter"} || $interface->extendedAttributes->{"NumericIndexedGetter"}) { - push(@getOwnPropertyDescriptorImpl, " unsigned index = propertyName.asIndex();\n"); - push(@getOwnPropertyDescriptorImpl, " if (index != PropertyName::NotAnIndex && index < static_cast<$interfaceName*>(thisObject->impl())->length()) {\n"); - if ($interface->extendedAttributes->{"NumericIndexedGetter"}) { - # Assume that if there's a setter, the index will be writable - if ($interface->extendedAttributes->{"CustomIndexedSetter"}) { - push(@getOwnPropertyDescriptorImpl, " descriptor.setDescriptor(thisObject->getByIndex(exec, index), ${namespaceMaybe}DontDelete);\n"); - } else { - push(@getOwnPropertyDescriptorImpl, " descriptor.setDescriptor(thisObject->getByIndex(exec, index), ${namespaceMaybe}DontDelete | ${namespaceMaybe}ReadOnly);\n"); - } - } else { - push(@getOwnPropertyDescriptorImpl, " ${namespaceMaybe}PropertySlot slot;\n"); - push(@getOwnPropertyDescriptorImpl, " slot.setCustomIndex(thisObject, index, indexGetter);\n"); - # Assume that if there's a setter, the index will be writable - if ($interface->extendedAttributes->{"CustomIndexedSetter"}) { - push(@getOwnPropertyDescriptorImpl, " descriptor.setDescriptor(slot.getValue(exec, propertyName), ${namespaceMaybe}DontDelete);\n"); - } else { - push(@getOwnPropertyDescriptorImpl, " descriptor.setDescriptor(slot.getValue(exec, propertyName), ${namespaceMaybe}DontDelete | ${namespaceMaybe}ReadOnly);\n"); - } - } - push(@getOwnPropertyDescriptorImpl, " return true;\n"); - push(@getOwnPropertyDescriptorImpl, " }\n"); - } - - if ($interface->extendedAttributes->{"NamedGetter"} || $interface->extendedAttributes->{"CustomNamedGetter"}) { - push(@getOwnPropertyDescriptorImpl, " if (canGetItemsForName(exec, static_cast<$interfaceName*>(thisObject->impl()), propertyName)) {\n"); - push(@getOwnPropertyDescriptorImpl, " ${namespaceMaybe}PropertySlot slot;\n"); - push(@getOwnPropertyDescriptorImpl, " slot.setCustom(thisObject, nameGetter);\n"); - push(@getOwnPropertyDescriptorImpl, " descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);\n"); - push(@getOwnPropertyDescriptorImpl, " return true;\n"); - push(@getOwnPropertyDescriptorImpl, " }\n"); - if ($inlined) { - $headerIncludes{"wtf/text/AtomicString.h"} = 1; - } else { - $implIncludes{"wtf/text/AtomicString.h"} = 1; - } - } - - if ($interface->extendedAttributes->{"CustomNamedGetter"}) { - &$manualLookupGetterGeneration(); - } - - if ($interface->extendedAttributes->{"JSCustomGetOwnPropertySlotAndDescriptor"}) { - push(@getOwnPropertyDescriptorImpl, " if (thisObject->getOwnPropertyDescriptorDelegate(exec, propertyName, descriptor))\n"); - push(@getOwnPropertyDescriptorImpl, " return true;\n"); - } - - if ($hasAttributes) { - if ($inlined) { - die "Cannot inline if NoStaticTables is set." if ($interface->extendedAttributes->{"JSNoStaticTables"}); - push(@getOwnPropertyDescriptorImpl, " return ${namespaceMaybe}getStaticValueDescriptor<$className, Base>(exec, s_info.staticPropHashTable, thisObject, propertyName, descriptor);\n"); - } else { - push(@getOwnPropertyDescriptorImpl, " return ${namespaceMaybe}getStaticValueDescriptor<$className, Base>(exec, " . hashTableAccessor($interface->extendedAttributes->{"JSNoStaticTables"}, $className) . ", thisObject, propertyName, descriptor);\n"); - } - } else { - push(@getOwnPropertyDescriptorImpl, " return Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);\n"); - } - - return @getOwnPropertyDescriptorImpl; -} - -sub GenerateHeaderContentHeader -{ - my $interface = shift; - my $className = "JS" . $interface->name; - - my @headerContentHeader = split("\r", $headerTemplate); - - # - Add header protection - push(@headerContentHeader, "\n#ifndef $className" . "_h"); - push(@headerContentHeader, "\n#define $className" . "_h\n\n"); - - my $conditionalString = $codeGenerator->GenerateConditionalString($interface); - push(@headerContentHeader, "#if ${conditionalString}\n\n") if $conditionalString; - return @headerContentHeader; -} - -sub GenerateImplementationContentHeader -{ - my $interface = shift; - my $className = "JS" . $interface->name; - - my @implContentHeader = split("\r", $headerTemplate); - - push(@implContentHeader, "\n#include \"config.h\"\n"); - my $conditionalString = $codeGenerator->GenerateConditionalString($interface); - push(@implContentHeader, "\n#if ${conditionalString}\n\n") if $conditionalString; - push(@implContentHeader, "#include \"$className.h\"\n\n"); - return @implContentHeader; -} - -my %usesToJSNewlyCreated = ( - "CDATASection" => 1, - "Element" => 1, - "Node" => 1, - "Text" => 1, - "Touch" => 1, - "TouchList" => 1 -); - -sub ShouldGenerateToJSDeclaration -{ - my ($hasParent, $interface) = @_; - return 0 if ($interface->extendedAttributes->{"SuppressToJSObject"}); - return 1 if (!$hasParent or $interface->extendedAttributes->{"JSGenerateToJSObject"} or ($interface->extendedAttributes->{"CustomToJSObject"} or $interface->extendedAttributes->{"JSCustomToJSObject"})); - return 0; -} - -sub ShouldGenerateToJSImplementation -{ - my ($hasParent, $interface) = @_; - return 0 if ($interface->extendedAttributes->{"SuppressToJSObject"}); - return 1 if ((!$hasParent or $interface->extendedAttributes->{"JSGenerateToJSObject"}) and !($interface->extendedAttributes->{"CustomToJSObject"} or $interface->extendedAttributes->{"JSCustomToJSObject"})); - return 0; -} - -sub GetAttributeGetterName -{ - my ($interfaceName, $className, $attribute) = @_; - if ($attribute->isStatic) { - return $codeGenerator->WK_lcfirst($className) . "Constructor" . $codeGenerator->WK_ucfirst($attribute->signature->name); - } - return "js" . $interfaceName . $codeGenerator->WK_ucfirst($attribute->signature->name) . ($attribute->signature->type =~ /Constructor$/ ? "Constructor" : ""); -} - -sub GetAttributeSetterName -{ - my ($interfaceName, $className, $attribute) = @_; - if ($attribute->isStatic) { - return "set" . $codeGenerator->WK_ucfirst($className) . "Constructor" . $codeGenerator->WK_ucfirst($attribute->signature->name); - } - return "setJS" . $interfaceName . $codeGenerator->WK_ucfirst($attribute->signature->name) . ($attribute->signature->type =~ /Constructor$/ ? "Constructor" : ""); -} - -sub GetFunctionName -{ - my ($className, $function) = @_; - my $kind = $function->isStatic ? "Constructor" : "Prototype"; - return $codeGenerator->WK_lcfirst($className) . $kind . "Function" . $codeGenerator->WK_ucfirst($function->signature->name); -} - -sub GenerateHeader -{ - my $object = shift; - my $interface = shift; - - my $interfaceName = $interface->name; - my $className = "JS$interfaceName"; - my @ancestorInterfaceNames = (); - my %structureFlags = (); - - # We only support multiple parents with SVG (for now). - if (@{$interface->parents} > 1) { - die "A class can't have more than one parent" unless $interfaceName =~ /SVG/; - $codeGenerator->AddMethodsConstantsAndAttributesFromParentInterfaces($interface, \@ancestorInterfaceNames); - } - - my $hasLegacyParent = $interface->extendedAttributes->{"JSLegacyParent"}; - my $hasRealParent = @{$interface->parents} > 0; - my $hasParent = $hasLegacyParent || $hasRealParent; - my $parentClassName = GetParentClassName($interface); - my $needsMarkChildren = $interface->extendedAttributes->{"JSCustomMarkFunction"} || $interface->extendedAttributes->{"EventTarget"} || $interface->name eq "EventTarget"; - - # - Add default header template and header protection - push(@headerContentHeader, GenerateHeaderContentHeader($interface)); - - if ($hasParent) { - $headerIncludes{"$parentClassName.h"} = 1; - } else { - $headerIncludes{"JSDOMBinding.h"} = 1; - $headerIncludes{"<runtime/JSGlobalObject.h>"} = 1; - if ($interface->isException) { - $headerIncludes{"<runtime/ErrorPrototype.h>"} = 1; - } else { - $headerIncludes{"<runtime/ObjectPrototype.h>"} = 1; - } - } - - if ($interface->extendedAttributes->{"CustomCall"}) { - $headerIncludes{"<runtime/CallData.h>"} = 1; - } - - if ($interface->extendedAttributes->{"JSInlineGetOwnPropertySlot"}) { - $headerIncludes{"<runtime/Lookup.h>"} = 1; - $headerIncludes{"<wtf/AlwaysInline.h>"} = 1; - } - - if ($hasParent && $interface->extendedAttributes->{"JSGenerateToNativeObject"}) { - if ($codeGenerator->IsTypedArrayType($interfaceName)) { - $headerIncludes{"<wtf/$interfaceName.h>"} = 1; - } else { - $headerIncludes{"$interfaceName.h"} = 1; - } - } - - $headerIncludes{"<runtime/JSObject.h>"} = 1; - $headerIncludes{"SVGElement.h"} = 1 if $className =~ /^JSSVG/; - - my $implType = $interfaceName; - my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implType); - $implType = $svgNativeType if $svgNativeType; - - my $svgPropertyOrListPropertyType; - $svgPropertyOrListPropertyType = $svgPropertyType if $svgPropertyType; - $svgPropertyOrListPropertyType = $svgListPropertyType if $svgListPropertyType; - - my $numConstants = @{$interface->constants}; - my $numAttributes = @{$interface->attributes}; - my $numFunctions = @{$interface->functions}; - - push(@headerContent, "\nnamespace WebCore {\n\n"); - - if ($codeGenerator->IsSVGAnimatedType($interfaceName)) { - $headerIncludes{"$interfaceName.h"} = 1; - } else { - # Implementation class forward declaration - if ($interfaceName eq "DOMWindow" || $interface->extendedAttributes->{"IsWorkerContext"}) { - AddClassForwardIfNeeded($interfaceName) unless $svgPropertyOrListPropertyType; - } - } - - AddClassForwardIfNeeded("JSDOMWindowShell") if $interfaceName eq "DOMWindow"; - AddClassForwardIfNeeded("JSDictionary") if $codeGenerator->IsConstructorTemplate($interface, "Event"); - - # Class declaration - push(@headerContent, "class $className : public $parentClassName {\n"); - - # Static create methods - push(@headerContent, "public:\n"); - push(@headerContent, " typedef $parentClassName Base;\n"); - if ($interfaceName eq "DOMWindow") { - push(@headerContent, " static $className* create(JSC::JSGlobalData& globalData, JSC::Structure* structure, PassRefPtr<$implType> impl, JSDOMWindowShell* windowShell)\n"); - push(@headerContent, " {\n"); - push(@headerContent, " $className* ptr = new (NotNull, JSC::allocateCell<$className>(globalData.heap)) ${className}(globalData, structure, impl, windowShell);\n"); - push(@headerContent, " ptr->finishCreation(globalData, windowShell);\n"); - push(@headerContent, " globalData.heap.addFinalizer(ptr, destroy);\n"); - push(@headerContent, " return ptr;\n"); - push(@headerContent, " }\n\n"); - } elsif ($interface->extendedAttributes->{"IsWorkerContext"}) { - push(@headerContent, " static $className* create(JSC::JSGlobalData& globalData, JSC::Structure* structure, PassRefPtr<$implType> impl)\n"); - push(@headerContent, " {\n"); - push(@headerContent, " $className* ptr = new (NotNull, JSC::allocateCell<$className>(globalData.heap)) ${className}(globalData, structure, impl);\n"); - push(@headerContent, " ptr->finishCreation(globalData);\n"); - push(@headerContent, " globalData.heap.addFinalizer(ptr, destroy);\n"); - push(@headerContent, " return ptr;\n"); - push(@headerContent, " }\n\n"); - } elsif ($interface->extendedAttributes->{"MasqueradesAsUndefined"}) { - AddIncludesForTypeInHeader($implType) unless $svgPropertyOrListPropertyType; - push(@headerContent, " static $className* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<$implType> impl)\n"); - push(@headerContent, " {\n"); - push(@headerContent, " globalObject->masqueradesAsUndefinedWatchpoint()->notifyWrite();\n"); - push(@headerContent, " $className* ptr = new (NotNull, JSC::allocateCell<$className>(globalObject->globalData().heap)) $className(structure, globalObject, impl);\n"); - push(@headerContent, " ptr->finishCreation(globalObject->globalData());\n"); - push(@headerContent, " return ptr;\n"); - push(@headerContent, " }\n\n"); - } else { - AddIncludesForTypeInHeader($implType) unless $svgPropertyOrListPropertyType; - push(@headerContent, " static $className* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<$implType> impl)\n"); - push(@headerContent, " {\n"); - push(@headerContent, " $className* ptr = new (NotNull, JSC::allocateCell<$className>(globalObject->globalData().heap)) $className(structure, globalObject, impl);\n"); - push(@headerContent, " ptr->finishCreation(globalObject->globalData());\n"); - push(@headerContent, " return ptr;\n"); - push(@headerContent, " }\n\n"); - } - - if ($interfaceName eq "DOMWindow" || $interface->extendedAttributes->{"IsWorkerContext"}) { - push(@headerContent, " static const bool needsDestruction = false;\n\n"); - } - - # Prototype - push(@headerContent, " static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);\n") unless ($interface->extendedAttributes->{"ExtendsDOMGlobalObject"}); - - $headerTrailingIncludes{"${className}Custom.h"} = 1 if $interface->extendedAttributes->{"JSCustomHeader"}; - - $implIncludes{"${className}Custom.h"} = 1 if !$interface->extendedAttributes->{"JSCustomHeader"} && ($interface->extendedAttributes->{"CustomPutFunction"} || $interface->extendedAttributes->{"CustomNamedSetter"}); - - my $hasImpureNamedGetter = - $interface->extendedAttributes->{"NamedGetter"} - || $interface->extendedAttributes->{"CustomNamedGetter"} - || $interface->extendedAttributes->{"CustomGetOwnPropertySlot"}; - - my $hasComplexGetter = - $interface->extendedAttributes->{"IndexedGetter"} - || $interface->extendedAttributes->{"NumericIndexedGetter"} - || $interface->extendedAttributes->{"JSCustomGetOwnPropertySlotAndDescriptor"} - || $hasImpureNamedGetter; - - my $hasGetter = $numAttributes > 0 || !$interface->extendedAttributes->{"OmitConstructor"} || $hasComplexGetter; - - if ($hasImpureNamedGetter) { - $structureFlags{"JSC::HasImpureGetOwnPropertySlot"} = 1; - } - - # Getters - if ($hasGetter) { - push(@headerContent, " static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n"); - push(@headerContent, " static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&);\n"); - push(@headerContent, " static bool getOwnPropertySlotByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);\n") if ($hasComplexGetter); - push(@headerContent, " bool getOwnPropertySlotDelegate(JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n") if $interface->extendedAttributes->{"JSCustomGetOwnPropertySlotAndDescriptor"}; - push(@headerContent, " bool getOwnPropertyDescriptorDelegate(JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&);\n") if $interface->extendedAttributes->{"JSCustomGetOwnPropertySlotAndDescriptor"}; - $structureFlags{"JSC::OverridesGetOwnPropertySlot"} = 1; - $structureFlags{"JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero"} = 1; - } - - # Check if we have any writable properties - my $hasReadWriteProperties = 0; - foreach (@{$interface->attributes}) { - if (!IsReadonly($_) && !$_->isStatic) { - $hasReadWriteProperties = 1; - } - } - - my $hasComplexSetter = - $interface->extendedAttributes->{"CustomPutFunction"} - || $interface->extendedAttributes->{"CustomNamedSetter"} - || $interface->extendedAttributes->{"CustomIndexedSetter"}; - - my $hasSetter = $hasReadWriteProperties || $hasComplexSetter; - - # Getters - if ($hasSetter) { - push(@headerContent, " static void put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);\n"); - push(@headerContent, " static void putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool shouldThrow);\n") if ($hasComplexSetter); - push(@headerContent, " bool putDelegate(JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);\n") if $interface->extendedAttributes->{"CustomNamedSetter"}; - } - - if (!$hasParent) { - push(@headerContent, " static void destroy(JSC::JSCell*);\n"); - push(@headerContent, " ~${className}();\n"); - } - - # Class info - if ($interfaceName eq "Node") { - push(@headerContent, " static WEBKIT_EXPORTDATA const JSC::ClassInfo s_info;\n\n"); - } else { - push(@headerContent, " static const JSC::ClassInfo s_info;\n\n"); - } - # Structure ID - if ($interfaceName eq "DOMWindow") { - $structureFlags{"JSC::ImplementsHasInstance"} = 1; - } - push(@headerContent, " static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)\n"); - push(@headerContent, " {\n"); - if ($interfaceName eq "DOMWindow" || $interface->extendedAttributes->{"IsWorkerContext"}) { - push(@headerContent, " return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::GlobalObjectType, StructureFlags), &s_info);\n"); - } else { - push(@headerContent, " return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);\n"); - } - push(@headerContent, " }\n\n"); - - # Custom pushEventHandlerScope function - push(@headerContent, " JSC::JSScope* pushEventHandlerScope(JSC::ExecState*, JSC::JSScope*) const;\n\n") if $interface->extendedAttributes->{"JSCustomPushEventHandlerScope"}; - - # Custom call functions - push(@headerContent, " static JSC::CallType getCallData(JSC::JSCell*, JSC::CallData&);\n\n") if $interface->extendedAttributes->{"CustomCall"}; - - # Custom deleteProperty function - push(@headerContent, " static bool deleteProperty(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName);\n") if $interface->extendedAttributes->{"CustomDeleteProperty"}; - push(@headerContent, " static bool deletePropertyByIndex(JSC::JSCell*, JSC::ExecState*, unsigned);\n") if $interface->extendedAttributes->{"CustomDeleteProperty"}; - - # Custom getPropertyNames function exists on DOMWindow - if ($interfaceName eq "DOMWindow") { - push(@headerContent, " static void getPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode mode = JSC::ExcludeDontEnumProperties);\n"); - $structureFlags{"JSC::OverridesGetPropertyNames"} = 1; - } - - # Custom getOwnPropertyNames function - if ($interface->extendedAttributes->{"CustomEnumerateProperty"} || $interface->extendedAttributes->{"IndexedGetter"} || $interface->extendedAttributes->{"NumericIndexedGetter"}) { - push(@headerContent, " static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode mode = JSC::ExcludeDontEnumProperties);\n"); - $structureFlags{"JSC::OverridesGetPropertyNames"} = 1; - } - - # Custom defineOwnProperty function - push(@headerContent, " static bool defineOwnProperty(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&, bool shouldThrow);\n") if $interface->extendedAttributes->{"JSCustomDefineOwnProperty"}; - - # Override toBoolean to return false for objects that want to 'MasqueradesAsUndefined'. - if ($interface->extendedAttributes->{"MasqueradesAsUndefined"}) { - $structureFlags{"JSC::MasqueradesAsUndefined"} = 1; - } - - # Constructor object getter - push(@headerContent, " static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*);\n") if !$interface->extendedAttributes->{"OmitConstructor"}; - - my $numCustomFunctions = 0; - my $numCustomAttributes = 0; - - # Attribute and function enums - if ($numAttributes > 0) { - foreach (@{$interface->attributes}) { - my $attribute = $_; - $numCustomAttributes++ if $attribute->signature->extendedAttributes->{"Custom"} || $attribute->signature->extendedAttributes->{"JSCustom"}; - $numCustomAttributes++ if ($attribute->signature->extendedAttributes->{"CustomGetter"} || $attribute->signature->extendedAttributes->{"JSCustomGetter"}); - $numCustomAttributes++ if ($attribute->signature->extendedAttributes->{"CustomSetter"} || $attribute->signature->extendedAttributes->{"JSCustomSetter"}); - if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) { - my $conditionalString = $codeGenerator->GenerateConditionalString($attribute->signature); - push(@headerContent, "#if ${conditionalString}\n") if $conditionalString; - push(@headerContent, " JSC::WriteBarrier<JSC::Unknown> m_" . $attribute->signature->name . ";\n"); - $numCachedAttributes++; - $needsMarkChildren = 1; - push(@headerContent, "#endif\n") if $conditionalString; - } - } - } - - # visit function - if ($needsMarkChildren) { - push(@headerContent, " static void visitChildren(JSCell*, JSC::SlotVisitor&);\n\n"); - $structureFlags{"JSC::OverridesVisitChildren"} = 1; - } - - if ($numCustomAttributes > 0) { - push(@headerContent, "\n // Custom attributes\n"); - - foreach my $attribute (@{$interface->attributes}) { - my $conditionalString = $codeGenerator->GenerateConditionalString($attribute->signature); - if ($attribute->signature->extendedAttributes->{"Custom"} || $attribute->signature->extendedAttributes->{"JSCustom"} || $attribute->signature->extendedAttributes->{"CustomGetter"} || $attribute->signature->extendedAttributes->{"JSCustomGetter"}) { - push(@headerContent, "#if ${conditionalString}\n") if $conditionalString; - my $methodName = $codeGenerator->WK_lcfirst($attribute->signature->name); - push(@headerContent, " JSC::JSValue " . $methodName . "(JSC::ExecState*) const;\n"); - push(@headerContent, "#endif\n") if $conditionalString; - } - if (($attribute->signature->extendedAttributes->{"Custom"} || $attribute->signature->extendedAttributes->{"JSCustom"} || $attribute->signature->extendedAttributes->{"CustomSetter"} || $attribute->signature->extendedAttributes->{"JSCustomSetter"}) && !IsReadonly($attribute)) { - push(@headerContent, "#if ${conditionalString}\n") if $conditionalString; - push(@headerContent, " void set" . $codeGenerator->WK_ucfirst($attribute->signature->name) . "(JSC::ExecState*, JSC::JSValue);\n"); - push(@headerContent, "#endif\n") if $conditionalString; - } - } - } - - foreach my $function (@{$interface->functions}) { - $numCustomFunctions++ if $function->signature->extendedAttributes->{"Custom"} || $function->signature->extendedAttributes->{"JSCustom"}; - } - - if ($numCustomFunctions > 0) { - push(@headerContent, "\n // Custom functions\n"); - foreach my $function (@{$interface->functions}) { - next unless $function->signature->extendedAttributes->{"Custom"} or $function->signature->extendedAttributes->{"JSCustom"}; - next if $function->{overloads} && $function->{overloadIndex} != 1; - my $conditionalString = $codeGenerator->GenerateConditionalString($function->signature); - push(@headerContent, "#if ${conditionalString}\n") if $conditionalString; - my $functionImplementationName = $function->signature->extendedAttributes->{"ImplementedAs"} || $codeGenerator->WK_lcfirst($function->signature->name); - push(@headerContent, " " . ($function->isStatic ? "static " : "") . "JSC::JSValue " . $functionImplementationName . "(JSC::ExecState*);\n"); - push(@headerContent, "#endif\n") if $conditionalString; - } - } - - if (!$hasParent) { - push(@headerContent, " $implType* impl() const { return m_impl; }\n"); - push(@headerContent, " void releaseImpl() { m_impl->deref(); m_impl = 0; }\n\n"); - push(@headerContent, " void releaseImplIfNotNull() { if (m_impl) { m_impl->deref(); m_impl = 0; } }\n\n"); - push(@headerContent, "private:\n"); - push(@headerContent, " $implType* m_impl;\n"); - } elsif ($interface->extendedAttributes->{"JSGenerateToNativeObject"}) { - push(@headerContent, " $interfaceName* impl() const\n"); - push(@headerContent, " {\n"); - push(@headerContent, " return static_cast<$interfaceName*>(Base::impl());\n"); - push(@headerContent, " }\n"); - } - - if ($codeGenerator->IsTypedArrayType($implType) and ($implType ne "ArrayBufferView") and ($implType ne "ArrayBuffer")) { - push(@headerContent, " static const JSC::TypedArrayType TypedArrayStorageType = JSC::"); - push(@headerContent, "TypedArrayInt8") if $implType eq "Int8Array"; - push(@headerContent, "TypedArrayInt16") if $implType eq "Int16Array"; - push(@headerContent, "TypedArrayInt32") if $implType eq "Int32Array"; - push(@headerContent, "TypedArrayUint8") if $implType eq "Uint8Array"; - push(@headerContent, "TypedArrayUint8Clamped") if $implType eq "Uint8ClampedArray"; - push(@headerContent, "TypedArrayUint16") if $implType eq "Uint16Array"; - push(@headerContent, "TypedArrayUint32") if $implType eq "Uint32Array"; - push(@headerContent, "TypedArrayFloat32") if $implType eq "Float32Array"; - push(@headerContent, "TypedArrayFloat64") if $implType eq "Float64Array"; - push(@headerContent, ";\n"); - push(@headerContent, " intptr_t m_storageLength;\n"); - push(@headerContent, " void* m_storage;\n"); - } - - push(@headerContent, "protected:\n"); - # Constructor - if ($interfaceName eq "DOMWindow") { - push(@headerContent, " $className(JSC::JSGlobalData&, JSC::Structure*, PassRefPtr<$implType>, JSDOMWindowShell*);\n"); - } elsif ($interface->extendedAttributes->{"IsWorkerContext"}) { - push(@headerContent, " $className(JSC::JSGlobalData&, JSC::Structure*, PassRefPtr<$implType>);\n"); - } else { - push(@headerContent, " $className(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<$implType>);\n"); - push(@headerContent, " void finishCreation(JSC::JSGlobalData&);\n"); - } - - # structure flags - push(@headerContent, " static const unsigned StructureFlags = "); - foreach my $structureFlag (keys %structureFlags) { - push(@headerContent, $structureFlag . " | "); - } - push(@headerContent, "Base::StructureFlags;\n"); - - # Index getter - if ($interface->extendedAttributes->{"IndexedGetter"}) { - push(@headerContent, " static JSC::JSValue indexGetter(JSC::ExecState*, JSC::JSValue, unsigned);\n"); - } - if ($interface->extendedAttributes->{"NumericIndexedGetter"}) { - push(@headerContent, " JSC::JSValue getByIndex(JSC::ExecState*, unsigned index);\n"); - } - - # Index setter - if ($interface->extendedAttributes->{"CustomIndexedSetter"}) { - push(@headerContent, " void indexSetter(JSC::ExecState*, unsigned index, JSC::JSValue);\n"); - } - # Name getter - if ($interface->extendedAttributes->{"NamedGetter"} || $interface->extendedAttributes->{"CustomNamedGetter"}) { - push(@headerContent, "private:\n"); - push(@headerContent, " static bool canGetItemsForName(JSC::ExecState*, $interfaceName*, JSC::PropertyName);\n"); - push(@headerContent, " static JSC::JSValue nameGetter(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);\n"); - } - - push(@headerContent, "};\n\n"); - - if ($interface->extendedAttributes->{"JSInlineGetOwnPropertySlot"} && !$interface->extendedAttributes->{"CustomGetOwnPropertySlot"}) { - push(@headerContent, "ALWAYS_INLINE bool ${className}::getOwnPropertySlot(JSC::JSCell* cell, JSC::ExecState* exec, JSC::PropertyName propertyName, JSC::PropertySlot& slot)\n"); - push(@headerContent, "{\n"); - push(@headerContent, " ${className}* thisObject = JSC::jsCast<${className}*>(cell);\n"); - push(@headerContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n"); - push(@headerContent, GenerateGetOwnPropertySlotBody($interface, $interfaceName, $className, $numAttributes > 0, 1)); - push(@headerContent, "}\n\n"); - push(@headerContent, "ALWAYS_INLINE bool ${className}::getOwnPropertyDescriptor(JSC::JSObject* object, JSC::ExecState* exec, JSC::PropertyName propertyName, JSC::PropertyDescriptor& descriptor)\n"); - push(@headerContent, "{\n"); - push(@headerContent, " ${className}* thisObject = JSC::jsCast<${className}*>(object);\n"); - push(@headerContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n"); - push(@headerContent, GenerateGetOwnPropertyDescriptorBody($interface, $interfaceName, $className, $numAttributes > 0, 1)); - push(@headerContent, "}\n\n"); - } - - if (!$hasParent || - GetGenerateIsReachable($interface) || - GetCustomIsReachable($interface) || - $interface->extendedAttributes->{"JSCustomFinalize"} || - $interface->extendedAttributes->{"ActiveDOMObject"}) { - if ($interfaceName ne "Node" && $codeGenerator->IsSubType($interface, "Node")) { - $headerIncludes{"JSNode.h"} = 1; - push(@headerContent, "class JS${interfaceName}Owner : public JSNodeOwner {\n"); - } else { - push(@headerContent, "class JS${interfaceName}Owner : public JSC::WeakHandleOwner {\n"); - } - push(@headerContent, "public:\n"); - push(@headerContent, " virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);\n"); - push(@headerContent, " virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);\n"); - push(@headerContent, "};\n"); - push(@headerContent, "\n"); - push(@headerContent, "inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, $implType*)\n"); - push(@headerContent, "{\n"); - push(@headerContent, " DEFINE_STATIC_LOCAL(JS${interfaceName}Owner, js${interfaceName}Owner, ());\n"); - push(@headerContent, " return &js${interfaceName}Owner;\n"); - push(@headerContent, "}\n"); - push(@headerContent, "\n"); - push(@headerContent, "inline void* wrapperContext(DOMWrapperWorld* world, $implType*)\n"); - push(@headerContent, "{\n"); - push(@headerContent, " return world;\n"); - push(@headerContent, "}\n"); - push(@headerContent, "\n"); - } - if (ShouldGenerateToJSDeclaration($hasParent, $interface)) { - push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $implType*);\n"); - } - if (!$hasParent || $interface->extendedAttributes->{"JSGenerateToNativeObject"}) { - if ($interfaceName eq "NodeFilter") { - push(@headerContent, "PassRefPtr<NodeFilter> toNodeFilter(JSC::JSGlobalData&, JSC::JSValue);\n"); - } elsif ($interfaceName eq "DOMStringList") { - push(@headerContent, "PassRefPtr<DOMStringList> toDOMStringList(JSC::ExecState*, JSC::JSValue);\n"); - } else { - push(@headerContent, "$implType* to${interfaceName}(JSC::JSValue);\n"); - } - } - if ($usesToJSNewlyCreated{$interfaceName}) { - push(@headerContent, "JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, $interfaceName*);\n"); - } - - push(@headerContent, "\n"); - - # Add prototype declaration. - %structureFlags = (); - push(@headerContent, "class ${className}Prototype : public JSC::JSNonFinalObject {\n"); - push(@headerContent, "public:\n"); - push(@headerContent, " typedef JSC::JSNonFinalObject Base;\n"); - if ($interfaceName ne "DOMWindow" && !$interface->extendedAttributes->{"IsWorkerContext"}) { - push(@headerContent, " static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);\n"); - } - - push(@headerContent, " static ${className}Prototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)\n"); - push(@headerContent, " {\n"); - push(@headerContent, " ${className}Prototype* ptr = new (NotNull, JSC::allocateCell<${className}Prototype>(globalData.heap)) ${className}Prototype(globalData, globalObject, structure);\n"); - push(@headerContent, " ptr->finishCreation(globalData);\n"); - push(@headerContent, " return ptr;\n"); - push(@headerContent, " }\n\n"); - - push(@headerContent, " static const JSC::ClassInfo s_info;\n"); - if ($numFunctions > 0 || $numConstants > 0) { - push(@headerContent, " static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n"); - push(@headerContent, " static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&);\n"); - $structureFlags{"JSC::OverridesGetOwnPropertySlot"} = 1; - } - if ($interface->extendedAttributes->{"JSCustomMarkFunction"} or $needsMarkChildren) { - $structureFlags{"JSC::OverridesVisitChildren"} = 1; - } - push(@headerContent, - " static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)\n" . - " {\n" . - " return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);\n" . - " }\n"); - if ($interface->extendedAttributes->{"JSCustomNamedGetterOnPrototype"}) { - push(@headerContent, " static void put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);\n"); - push(@headerContent, " bool putDelegate(JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);\n"); - } - - # Custom defineOwnProperty function - push(@headerContent, " static bool defineOwnProperty(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&, bool shouldThrow);\n") if $interface->extendedAttributes->{"JSCustomDefineOwnPropertyOnPrototype"}; - - push(@headerContent, "\nprivate:\n"); - push(@headerContent, " ${className}Prototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { }\n"); - - # structure flags - push(@headerContent, "protected:\n"); - push(@headerContent, " static const unsigned StructureFlags = "); - foreach my $structureFlag (keys %structureFlags) { - push(@headerContent, $structureFlag . " | "); - } - push(@headerContent, "Base::StructureFlags;\n"); - - push(@headerContent, "};\n\n"); - - if (!$interface->extendedAttributes->{"OmitConstructor"}) { - $headerIncludes{"JSDOMBinding.h"} = 1; - GenerateConstructorDeclaration(\@headerContent, $className, $interface, $interfaceName); - } - - if ($numFunctions > 0) { - push(@headerContent,"// Functions\n\n"); - foreach my $function (@{$interface->functions}) { - next if $function->{overloadIndex} && $function->{overloadIndex} > 1; - my $conditionalString = $codeGenerator->GenerateConditionalString($function->signature); - push(@headerContent, "#if ${conditionalString}\n") if $conditionalString; - my $functionName = GetFunctionName($className, $function); - push(@headerContent, "JSC::EncodedJSValue JSC_HOST_CALL ${functionName}(JSC::ExecState*);\n"); - push(@headerContent, "#endif\n") if $conditionalString; - } - } - - if ($numAttributes > 0 || !$interface->extendedAttributes->{"OmitConstructor"}) { - push(@headerContent,"// Attributes\n\n"); - foreach my $attribute (@{$interface->attributes}) { - my $conditionalString = $codeGenerator->GenerateConditionalString($attribute->signature); - push(@headerContent, "#if ${conditionalString}\n") if $conditionalString; - my $getter = GetAttributeGetterName($interfaceName, $className, $attribute); - push(@headerContent, "JSC::JSValue ${getter}(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);\n"); - if (!IsReadonly($attribute)) { - my $setter = GetAttributeSetterName($interfaceName, $className, $attribute); - push(@headerContent, "void ${setter}(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);\n"); - } - push(@headerContent, "#endif\n") if $conditionalString; - } - - if (!$interface->extendedAttributes->{"OmitConstructor"}) { - my $getter = "js" . $interfaceName . "Constructor"; - push(@headerContent, "JSC::JSValue ${getter}(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);\n"); - } - - if ($interface->extendedAttributes->{"ReplaceableConstructor"}) { - my $constructorFunctionName = "setJS" . $interfaceName . "Constructor"; - push(@headerContent, "void ${constructorFunctionName}(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);\n"); - } - } - - if ($numConstants > 0) { - push(@headerContent,"// Constants\n\n"); - foreach my $constant (@{$interface->constants}) { - my $conditionalString = $codeGenerator->GenerateConditionalString($constant); - push(@headerContent, "#if ${conditionalString}\n") if $conditionalString; - my $getter = "js" . $interfaceName . $codeGenerator->WK_ucfirst($constant->name); - push(@headerContent, "JSC::JSValue ${getter}(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);\n"); - push(@headerContent, "#endif\n") if $conditionalString; - } - } - - my $conditionalString = $codeGenerator->GenerateConditionalString($interface); - push(@headerContent, "\n} // namespace WebCore\n\n"); - push(@headerContent, "#endif // ${conditionalString}\n\n") if $conditionalString; - push(@headerContent, "#endif\n"); - - # - Generate dependencies. - if ($writeDependencies && @ancestorInterfaceNames) { - push(@depsContent, "$className.h : ", join(" ", map { "$_.idl" } @ancestorInterfaceNames), "\n"); - push(@depsContent, map { "$_.idl :\n" } @ancestorInterfaceNames); - } -} - -sub GenerateAttributesHashTable($$) -{ - my ($object, $interface) = @_; - - # FIXME: These should be functions on $interface. - my $interfaceName = $interface->name; - my $className = "JS$interfaceName"; - - # - Add all attributes in a hashtable definition - my $numAttributes = @{$interface->attributes}; - $numAttributes++ if !$interface->extendedAttributes->{"OmitConstructor"}; - - return 0 if !$numAttributes; - - my $hashSize = $numAttributes; - my $hashName = $className . "Table"; - - my @hashKeys = (); - my @hashSpecials = (); - my @hashValue1 = (); - my @hashValue2 = (); - my %conditionals = (); - - my @entries = (); - - foreach my $attribute (@{$interface->attributes}) { - next if ($attribute->isStatic); - my $name = $attribute->signature->name; - push(@hashKeys, $name); - - my @specials = (); - push(@specials, "DontDelete") unless $attribute->signature->extendedAttributes->{"Deletable"}; - push(@specials, "DontEnum") if $attribute->signature->extendedAttributes->{"NotEnumerable"}; - push(@specials, "ReadOnly") if IsReadonly($attribute); - my $special = (@specials > 0) ? join(" | ", @specials) : "0"; - push(@hashSpecials, $special); - - my $getter = GetAttributeGetterName($interfaceName, $className, $attribute); - push(@hashValue1, $getter); - - if (IsReadonly($attribute)) { - push(@hashValue2, "0"); - } else { - my $setter = GetAttributeSetterName($interfaceName, $className, $attribute); - push(@hashValue2, $setter); - } - - my $conditional = $attribute->signature->extendedAttributes->{"Conditional"}; - if ($conditional) { - $conditionals{$name} = $conditional; - } - } - - if (!$interface->extendedAttributes->{"OmitConstructor"}) { - push(@hashKeys, "constructor"); - my $getter = "js" . $interfaceName . "Constructor"; - push(@hashValue1, $getter); - if ($interface->extendedAttributes->{"ReplaceableConstructor"}) { - my $setter = "setJS" . $interfaceName . "Constructor"; - push(@hashValue2, $setter); - push(@hashSpecials, "DontEnum | DontDelete"); - } else { - push(@hashValue2, "0"); - push(@hashSpecials, "DontEnum | ReadOnly"); - } - } - - $object->GenerateHashTable($hashName, $hashSize, - \@hashKeys, \@hashSpecials, - \@hashValue1, \@hashValue2, - \%conditionals); - return $numAttributes; -} - -sub GenerateParametersCheckExpression -{ - my $numParameters = shift; - my $function = shift; - - my @andExpression = (); - push(@andExpression, "argsCount == $numParameters"); - my $parameterIndex = 0; - my %usedArguments = (); - foreach my $parameter (@{$function->parameters}) { - last if $parameterIndex >= $numParameters; - my $value = "arg$parameterIndex"; - my $type = $parameter->type; - - # Only DOMString or wrapper types are checked. - # For DOMString with StrictTypeChecking only Null, Undefined and Object - # are accepted for compatibility. Otherwise, no restrictions are made to - # match the non-overloaded behavior. - # FIXME: Implement WebIDL overload resolution algorithm. - if ($codeGenerator->IsStringType($type)) { - if ($parameter->extendedAttributes->{"StrictTypeChecking"}) { - push(@andExpression, "(${value}.isUndefinedOrNull() || ${value}.isString() || ${value}.isObject())"); - $usedArguments{$parameterIndex} = 1; - } - } elsif ($parameter->extendedAttributes->{"Callback"}) { - # For Callbacks only checks if the value is null or object. - push(@andExpression, "(${value}.isNull() || ${value}.isFunction())"); - $usedArguments{$parameterIndex} = 1; - } elsif ($codeGenerator->IsArrayType($type) || $codeGenerator->GetSequenceType($type)) { - # FIXME: Add proper support for T[], T[]?, sequence<T> - if ($parameter->isNullable) { - push(@andExpression, "(${value}.isNull() || (${value}.isObject() && isJSArray(${value})))"); - } else { - push(@andExpression, "(${value}.isObject() && isJSArray(${value}))"); - } - $usedArguments{$parameterIndex} = 1; - } elsif (!IsNativeType($type)) { - if ($parameter->isNullable) { - push(@andExpression, "(${value}.isNull() || (${value}.isObject() && asObject(${value})->inherits(&JS${type}::s_info)))"); - } else { - push(@andExpression, "(${value}.isObject() && asObject(${value})->inherits(&JS${type}::s_info))"); - } - $usedArguments{$parameterIndex} = 1; - } - $parameterIndex++; - } - my $res = join(" && ", @andExpression); - $res = "($res)" if @andExpression > 1; - return ($res, keys %usedArguments); -} - -sub GenerateFunctionParametersCheck -{ - my $function = shift; - - my @orExpression = (); - my $numParameters = 0; - my @neededArguments = (); - my $hasVariadic = 0; - my $numMandatoryParams = @{$function->parameters}; - - foreach my $parameter (@{$function->parameters}) { - if ($parameter->extendedAttributes->{"Optional"}) { - my ($expression, @usedArguments) = GenerateParametersCheckExpression($numParameters, $function); - push(@orExpression, $expression); - push(@neededArguments, @usedArguments); - $numMandatoryParams--; - } - if ($parameter->isVariadic) { - $hasVariadic = 1; - last; - } - $numParameters++; - } - if (!$hasVariadic) { - my ($expression, @usedArguments) = GenerateParametersCheckExpression($numParameters, $function); - push(@orExpression, $expression); - push(@neededArguments, @usedArguments); - } - return ($numMandatoryParams, join(" || ", @orExpression), @neededArguments); -} - -sub GenerateOverloadedFunction -{ - my $function = shift; - my $interface = shift; - my $interfaceName = shift; - - # Generate code for choosing the correct overload to call. Overloads are - # chosen based on the total number of arguments passed and the type of - # values passed in non-primitive argument slots. When more than a single - # overload is applicable, precedence is given according to the order of - # declaration in the IDL. - - my $kind = $function->isStatic ? "Constructor" : "Prototype"; - my $functionName = "js${interfaceName}${kind}Function" . $codeGenerator->WK_ucfirst($function->signature->name); - - push(@implContent, "EncodedJSValue JSC_HOST_CALL ${functionName}(ExecState* exec)\n"); - push(@implContent, <<END); -{ - size_t argsCount = exec->argumentCount(); -END - - my %fetchedArguments = (); - my $leastNumMandatoryParams = 255; - - foreach my $overload (@{$function->{overloads}}) { - my ($numMandatoryParams, $parametersCheck, @neededArguments) = GenerateFunctionParametersCheck($overload); - $leastNumMandatoryParams = $numMandatoryParams if ($numMandatoryParams < $leastNumMandatoryParams); - - foreach my $parameterIndex (@neededArguments) { - next if exists $fetchedArguments{$parameterIndex}; - push(@implContent, " JSValue arg$parameterIndex(exec->argument($parameterIndex));\n"); - $fetchedArguments{$parameterIndex} = 1; - } - - push(@implContent, " if ($parametersCheck)\n"); - push(@implContent, " return ${functionName}$overload->{overloadIndex}(exec);\n"); - } - if ($leastNumMandatoryParams >= 1) { - push(@implContent, " if (argsCount < $leastNumMandatoryParams)\n"); - push(@implContent, " return throwVMError(exec, createNotEnoughArgumentsError(exec));\n"); - } - push(@implContent, <<END); - return throwVMTypeError(exec); -} - -END -} - -sub GenerateImplementation -{ - my ($object, $interface) = @_; - - my $interfaceName = $interface->name; - my $className = "JS$interfaceName"; - - my $hasLegacyParent = $interface->extendedAttributes->{"JSLegacyParent"}; - my $hasRealParent = @{$interface->parents} > 0; - my $hasParent = $hasLegacyParent || $hasRealParent; - my $parentClassName = GetParentClassName($interface); - my $visibleInterfaceName = $codeGenerator->GetVisibleInterfaceName($interface); - my $eventTarget = $interface->extendedAttributes->{"EventTarget"} || ($codeGenerator->IsSubType($interface, "EventTarget") && $interface->name ne "EventTarget"); - my $needsMarkChildren = $interface->extendedAttributes->{"JSCustomMarkFunction"} || $interface->extendedAttributes->{"EventTarget"} || $interface->name eq "EventTarget"; - - # - Add default header template - push(@implContentHeader, GenerateImplementationContentHeader($interface)); - - AddIncludesForSVGAnimatedType($interfaceName) if $className =~ /^JSSVGAnimated/; - - $implIncludes{"<wtf/GetPtr.h>"} = 1; - $implIncludes{"<runtime/PropertyNameArray.h>"} = 1 if $interface->extendedAttributes->{"IndexedGetter"} || $interface->extendedAttributes->{"NumericIndexedGetter"}; - - AddIncludesForTypeInImpl($interfaceName); - - @implContent = (); - - push(@implContent, "\nusing namespace JSC;\n\n"); - push(@implContent, "namespace WebCore {\n\n"); - - my $numAttributes = GenerateAttributesHashTable($object, $interface); - - my $numConstants = @{$interface->constants}; - my $numFunctions = @{$interface->functions}; - - # - Add all constants - if (!$interface->extendedAttributes->{"OmitConstructor"}) { - my $hashSize = $numConstants; - my $hashName = $className . "ConstructorTable"; - - my @hashKeys = (); - my @hashValue1 = (); - my @hashValue2 = (); - my @hashSpecials = (); - my %conditionals = (); - - # FIXME: we should not need a function for every constant. - foreach my $constant (@{$interface->constants}) { - my $name = $constant->name; - push(@hashKeys, $name); - my $getter = "js" . $interfaceName . $codeGenerator->WK_ucfirst($name); - push(@hashValue1, $getter); - push(@hashValue2, "0"); - push(@hashSpecials, "DontDelete | ReadOnly"); - - my $implementedBy = $constant->extendedAttributes->{"ImplementedBy"}; - if ($implementedBy) { - $implIncludes{"${implementedBy}.h"} = 1; - } - my $conditional = $constant->extendedAttributes->{"Conditional"}; - if ($conditional) { - $conditionals{$name} = $conditional; - } - } - - foreach my $attribute (@{$interface->attributes}) { - next unless ($attribute->isStatic); - my $name = $attribute->signature->name; - push(@hashKeys, $name); - - my @specials = (); - push(@specials, "DontDelete") unless $attribute->signature->extendedAttributes->{"Deletable"}; - push(@specials, "ReadOnly") if IsReadonly($attribute); - my $special = (@specials > 0) ? join(" | ", @specials) : "0"; - push(@hashSpecials, $special); - - my $getter = GetAttributeGetterName($interfaceName, $className, $attribute); - push(@hashValue1, $getter); - - if (IsReadonly($attribute)) { - push(@hashValue2, "0"); - } else { - my $setter = GetAttributeSetterName($interfaceName, $className, $attribute); - push(@hashValue2, $setter); - } - - my $conditional = $attribute->signature->extendedAttributes->{"Conditional"}; - if ($conditional) { - $conditionals{$name} = $conditional; - } - } - - foreach my $function (@{$interface->functions}) { - next unless ($function->isStatic); - next if $function->{overloadIndex} && $function->{overloadIndex} > 1; - my $name = $function->signature->name; - push(@hashKeys, $name); - - my $functionName = GetFunctionName($className, $function); - push(@hashValue1, $functionName); - - my $numParameters = @{$function->parameters}; - push(@hashValue2, $numParameters); - - my @specials = (); - push(@specials, "DontDelete") unless $function->signature->extendedAttributes->{"Deletable"}; - push(@specials, "DontEnum") if $function->signature->extendedAttributes->{"NotEnumerable"}; - push(@specials, "JSC::Function"); - my $special = (@specials > 0) ? join(" | ", @specials) : "0"; - push(@hashSpecials, $special); - - my $conditional = $function->signature->extendedAttributes->{"Conditional"}; - if ($conditional) { - $conditionals{$name} = $conditional; - } - } - - $object->GenerateHashTable($hashName, $hashSize, - \@hashKeys, \@hashSpecials, - \@hashValue1, \@hashValue2, - \%conditionals); - - push(@implContent, $codeGenerator->GenerateCompileTimeCheckForEnumsIfNeeded($interface)); - - my $protoClassName = "${className}Prototype"; - GenerateConstructorDefinitions(\@implContent, $className, $protoClassName, $interfaceName, $visibleInterfaceName, $interface); - if ($interface->extendedAttributes->{"NamedConstructor"}) { - GenerateConstructorDefinitions(\@implContent, $className, $protoClassName, $interfaceName, $interface->extendedAttributes->{"NamedConstructor"}, $interface, "GeneratingNamedConstructor"); - } - } - - # - Add functions and constants to a hashtable definition - my $hashSize = $numFunctions + $numConstants; - my $hashName = $className . "PrototypeTable"; - - my @hashKeys = (); - my @hashValue1 = (); - my @hashValue2 = (); - my @hashSpecials = (); - my %conditionals = (); - - # FIXME: we should not need a function for every constant. - foreach my $constant (@{$interface->constants}) { - my $name = $constant->name; - push(@hashKeys, $name); - my $getter = "js" . $interfaceName . $codeGenerator->WK_ucfirst($name); - push(@hashValue1, $getter); - push(@hashValue2, "0"); - push(@hashSpecials, "DontDelete | ReadOnly"); - - my $conditional = $constant->extendedAttributes->{"Conditional"}; - if ($conditional) { - $conditionals{$name} = $conditional; - } - } - - foreach my $function (@{$interface->functions}) { - next if ($function->isStatic); - next if $function->{overloadIndex} && $function->{overloadIndex} > 1; - my $name = $function->signature->name; - push(@hashKeys, $name); - - my $functionName = GetFunctionName($className, $function); - push(@hashValue1, $functionName); - - my $numParameters = @{$function->parameters}; - push(@hashValue2, $numParameters); - - my @specials = (); - push(@specials, "DontDelete") unless $function->signature->extendedAttributes->{"Deletable"}; - push(@specials, "DontEnum") if $function->signature->extendedAttributes->{"NotEnumerable"}; - push(@specials, "JSC::Function"); - my $special = (@specials > 0) ? join(" | ", @specials) : "0"; - push(@hashSpecials, $special); - - my $conditional = $function->signature->extendedAttributes->{"Conditional"}; - if ($conditional) { - $conditionals{$name} = $conditional; - } - } - - $object->GenerateHashTable($hashName, $hashSize, - \@hashKeys, \@hashSpecials, - \@hashValue1, \@hashValue2, - \%conditionals); - - if ($interface->extendedAttributes->{"JSNoStaticTables"}) { - push(@implContent, "static const HashTable* get${className}PrototypeTable(ExecState* exec)\n"); - push(@implContent, "{\n"); - push(@implContent, " return getHashTableForGlobalData(exec->globalData(), &${className}PrototypeTable);\n"); - push(@implContent, "}\n\n"); - push(@implContent, "const ClassInfo ${className}Prototype::s_info = { \"${visibleInterfaceName}Prototype\", &Base::s_info, 0, get${className}PrototypeTable, CREATE_METHOD_TABLE(${className}Prototype) };\n\n"); - } else { - push(@implContent, "const ClassInfo ${className}Prototype::s_info = { \"${visibleInterfaceName}Prototype\", &Base::s_info, &${className}PrototypeTable, 0, CREATE_METHOD_TABLE(${className}Prototype) };\n\n"); - } - if ($interfaceName ne "DOMWindow" && !$interface->extendedAttributes->{"IsWorkerContext"}) { - push(@implContent, "JSObject* ${className}Prototype::self(ExecState* exec, JSGlobalObject* globalObject)\n"); - push(@implContent, "{\n"); - push(@implContent, " return getDOMPrototype<${className}>(exec, globalObject);\n"); - push(@implContent, "}\n\n"); - } - - if ($numConstants > 0 || $numFunctions > 0) { - push(@implContent, "bool ${className}Prototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)\n"); - push(@implContent, "{\n"); - push(@implContent, " ${className}Prototype* thisObject = jsCast<${className}Prototype*>(cell);\n"); - - if ($numConstants eq 0 && $numFunctions eq 0) { - push(@implContent, " return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);\n"); - } elsif ($numConstants eq 0) { - push(@implContent, " return getStaticFunctionSlot<JSObject>(exec, " . prototypeHashTableAccessor($interface->extendedAttributes->{"JSNoStaticTables"}, $className) . ", thisObject, propertyName, slot);\n"); - } elsif ($numFunctions eq 0) { - push(@implContent, " return getStaticValueSlot<${className}Prototype, JSObject>(exec, " . prototypeHashTableAccessor($interface->extendedAttributes->{"JSNoStaticTables"}, $className) . ", thisObject, propertyName, slot);\n"); - } else { - push(@implContent, " return getStaticPropertySlot<${className}Prototype, JSObject>(exec, " . prototypeHashTableAccessor($interface->extendedAttributes->{"JSNoStaticTables"}, $className) . ", thisObject, propertyName, slot);\n"); - } - push(@implContent, "}\n\n"); - - push(@implContent, "bool ${className}Prototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)\n"); - push(@implContent, "{\n"); - push(@implContent, " ${className}Prototype* thisObject = jsCast<${className}Prototype*>(object);\n"); - - if ($numConstants eq 0 && $numFunctions eq 0) { - push(@implContent, " return Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);\n"); - } elsif ($numConstants eq 0) { - push(@implContent, " return getStaticFunctionDescriptor<JSObject>(exec, " . prototypeHashTableAccessor($interface->extendedAttributes->{"JSNoStaticTables"}, $className) . ", thisObject, propertyName, descriptor);\n"); - } elsif ($numFunctions eq 0) { - push(@implContent, " return getStaticValueDescriptor<${className}Prototype, JSObject>(exec, " . prototypeHashTableAccessor($interface->extendedAttributes->{"JSNoStaticTables"}, $className) . ", thisObject, propertyName, descriptor);\n"); - } else { - push(@implContent, " return getStaticPropertyDescriptor<${className}Prototype, JSObject>(exec, " . prototypeHashTableAccessor($interface->extendedAttributes->{"JSNoStaticTables"}, $className) . ", thisObject, propertyName, descriptor);\n"); - } - push(@implContent, "}\n\n"); - } - - if ($interface->extendedAttributes->{"JSCustomNamedGetterOnPrototype"}) { - push(@implContent, "void ${className}Prototype::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)\n"); - push(@implContent, "{\n"); - push(@implContent, " ${className}Prototype* thisObject = jsCast<${className}Prototype*>(cell);\n"); - push(@implContent, " if (thisObject->putDelegate(exec, propertyName, value, slot))\n"); - push(@implContent, " return;\n"); - push(@implContent, " Base::put(thisObject, exec, propertyName, value, slot);\n"); - push(@implContent, "}\n\n"); - } - - # - Initialize static ClassInfo object - if ($numAttributes > 0 && $interface->extendedAttributes->{"JSNoStaticTables"}) { - push(@implContent, "static const HashTable* get${className}Table(ExecState* exec)\n"); - push(@implContent, "{\n"); - push(@implContent, " return getHashTableForGlobalData(exec->globalData(), &${className}Table);\n"); - push(@implContent, "}\n\n"); - } - - push(@implContent, "const ClassInfo $className" . "::s_info = { \"${visibleInterfaceName}\", &Base::s_info, "); - - if ($numAttributes > 0 && !$interface->extendedAttributes->{"JSNoStaticTables"}) { - push(@implContent, "&${className}Table"); - } else { - push(@implContent, "0"); - } - if ($numAttributes > 0 && $interface->extendedAttributes->{"JSNoStaticTables"}) { - push(@implContent, ", get${className}Table "); - } else { - push(@implContent, ", 0 "); - } - push(@implContent, ", CREATE_METHOD_TABLE($className) };\n\n"); - - my $implType = $interfaceName; - my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implType); - $implType = $svgNativeType if $svgNativeType; - - my $svgPropertyOrListPropertyType; - $svgPropertyOrListPropertyType = $svgPropertyType if $svgPropertyType; - $svgPropertyOrListPropertyType = $svgListPropertyType if $svgListPropertyType; - - # Constructor - if ($interfaceName eq "DOMWindow") { - AddIncludesForTypeInImpl("JSDOMWindowShell"); - push(@implContent, "${className}::$className(JSGlobalData& globalData, Structure* structure, PassRefPtr<$implType> impl, JSDOMWindowShell* shell)\n"); - push(@implContent, " : $parentClassName(globalData, structure, impl, shell)\n"); - push(@implContent, "{\n"); - push(@implContent, "}\n\n"); - } elsif ($interface->extendedAttributes->{"IsWorkerContext"}) { - AddIncludesForTypeInImpl($interfaceName); - push(@implContent, "${className}::$className(JSGlobalData& globalData, Structure* structure, PassRefPtr<$implType> impl)\n"); - push(@implContent, " : $parentClassName(globalData, structure, impl)\n"); - push(@implContent, "{\n"); - push(@implContent, "}\n\n"); - } else { - push(@implContent, "${className}::$className(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<$implType> impl)\n"); - if ($hasParent) { - push(@implContent, " : $parentClassName(structure, globalObject, impl)\n"); - } else { - push(@implContent, " : $parentClassName(structure, globalObject)\n"); - push(@implContent, " , m_impl(impl.leakRef())\n"); - } - push(@implContent, "{\n"); - push(@implContent, "}\n\n"); - - push(@implContent, "void ${className}::finishCreation(JSGlobalData& globalData)\n"); - push(@implContent, "{\n"); - push(@implContent, " Base::finishCreation(globalData);\n"); - if ($codeGenerator->IsTypedArrayType($implType) and ($implType ne "ArrayBufferView") and ($implType ne "ArrayBuffer")) { - push(@implContent, " TypedArrayDescriptor descriptor(&${className}::s_info, OBJECT_OFFSETOF(${className}, m_storage), OBJECT_OFFSETOF(${className}, m_storageLength));\n"); - push(@implContent, " globalData.registerTypedArrayDescriptor(impl(), descriptor);\n"); - push(@implContent, " m_storage = impl()->data();\n"); - push(@implContent, " m_storageLength = impl()->length();\n"); - } - push(@implContent, " ASSERT(inherits(&s_info));\n"); - push(@implContent, "}\n\n"); - } - - if (!$interface->extendedAttributes->{"ExtendsDOMGlobalObject"}) { - push(@implContent, "JSObject* ${className}::createPrototype(ExecState* exec, JSGlobalObject* globalObject)\n"); - push(@implContent, "{\n"); - if ($hasParent && $parentClassName ne "JSC::DOMNodeFilter") { - push(@implContent, " return ${className}Prototype::create(exec->globalData(), globalObject, ${className}Prototype::createStructure(exec->globalData(), globalObject, ${parentClassName}Prototype::self(exec, globalObject)));\n"); - } else { - my $prototype = $interface->isException ? "errorPrototype" : "objectPrototype"; - push(@implContent, " return ${className}Prototype::create(exec->globalData(), globalObject, ${className}Prototype::createStructure(globalObject->globalData(), globalObject, globalObject->${prototype}()));\n"); - } - push(@implContent, "}\n\n"); - } - - if (!$hasParent) { - # FIXME: This destroy function should not be necessary, as - # a finalizer should be called for each DOM object wrapper. - # However, that seems not to be the case, so this has been - # added back to avoid leaking while we figure out why the - # finalizers are not always getting called. The work tracking - # the finalizer issue is being tracked in http://webkit.org/b/75451 - push(@implContent, "void ${className}::destroy(JSC::JSCell* cell)\n"); - push(@implContent, "{\n"); - push(@implContent, " ${className}* thisObject = static_cast<${className}*>(cell);\n"); - push(@implContent, " thisObject->${className}::~${className}();\n"); - push(@implContent, "}\n\n"); - - # We also need a destructor for the allocateCell to work properly with the destructor-free part of the heap. - # Otherwise, these destroy functions/destructors won't get called. - push(@implContent, "${className}::~${className}()\n"); - push(@implContent, "{\n"); - push(@implContent, " releaseImplIfNotNull();\n"); - push(@implContent, "}\n\n"); - } - - my $hasGetter = $numAttributes > 0 - || !$interface->extendedAttributes->{"OmitConstructor"} - || $interface->extendedAttributes->{"IndexedGetter"} - || $interface->extendedAttributes->{"NumericIndexedGetter"} - || $interface->extendedAttributes->{"JSCustomGetOwnPropertySlotAndDescriptor"} - || $interface->extendedAttributes->{"CustomGetOwnPropertySlot"} - || $interface->extendedAttributes->{"NamedGetter"} - || $interface->extendedAttributes->{"CustomNamedGetter"}; - - # Attributes - if ($hasGetter) { - if (!$interface->extendedAttributes->{"JSInlineGetOwnPropertySlot"} && !$interface->extendedAttributes->{"CustomGetOwnPropertySlot"}) { - push(@implContent, "bool ${className}::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)\n"); - push(@implContent, "{\n"); - push(@implContent, " ${className}* thisObject = jsCast<${className}*>(cell);\n"); - push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n"); - push(@implContent, GenerateGetOwnPropertySlotBody($interface, $interfaceName, $className, $numAttributes > 0, 0)); - push(@implContent, "}\n\n"); - push(@implContent, "bool ${className}::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)\n"); - push(@implContent, "{\n"); - push(@implContent, " ${className}* thisObject = jsCast<${className}*>(object);\n"); - push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n"); - push(@implContent, GenerateGetOwnPropertyDescriptorBody($interface, $interfaceName, $className, $numAttributes > 0, 0)); - push(@implContent, "}\n\n"); - } - - if ($interface->extendedAttributes->{"IndexedGetter"} || $interface->extendedAttributes->{"NumericIndexedGetter"} - || $interface->extendedAttributes->{"NamedGetter"} || $interface->extendedAttributes->{"CustomNamedGetter"} - || $interface->extendedAttributes->{"JSCustomGetOwnPropertySlotAndDescriptor"}) { - push(@implContent, "bool ${className}::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned index, PropertySlot& slot)\n"); - push(@implContent, "{\n"); - push(@implContent, " ${className}* thisObject = jsCast<${className}*>(cell);\n"); - push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n"); - - # Sink the int-to-string conversion that happens when we create a PropertyName - # to the point where we actually need it. - my $generatedPropertyName = 0; - my $propertyNameGeneration = sub { - if ($generatedPropertyName) { - return; - } - push(@implContent, " PropertyName propertyName = Identifier::from(exec, index);\n"); - $generatedPropertyName = 1; - }; - - if ($interface->extendedAttributes->{"IndexedGetter"} || $interface->extendedAttributes->{"NumericIndexedGetter"}) { - if (IndexGetterReturnsStrings($interfaceName)) { - push(@implContent, " if (index <= MAX_ARRAY_INDEX) {\n"); - } else { - push(@implContent, " if (index < static_cast<$interfaceName*>(thisObject->impl())->length()) {\n"); - } - if ($interface->extendedAttributes->{"NumericIndexedGetter"}) { - push(@implContent, " slot.setValue(thisObject->getByIndex(exec, index));\n"); - } else { - push(@implContent, " slot.setCustomIndex(thisObject, index, thisObject->indexGetter);\n"); - } - push(@implContent, " return true;\n"); - push(@implContent, " }\n"); - } - - if ($interface->extendedAttributes->{"NamedGetter"} || $interface->extendedAttributes->{"CustomNamedGetter"}) { - &$propertyNameGeneration(); - push(@implContent, " if (canGetItemsForName(exec, static_cast<$interfaceName*>(thisObject->impl()), propertyName)) {\n"); - push(@implContent, " slot.setCustom(thisObject, thisObject->nameGetter);\n"); - push(@implContent, " return true;\n"); - push(@implContent, " }\n"); - $implIncludes{"wtf/text/AtomicString.h"} = 1; - } - - if ($interface->extendedAttributes->{"JSCustomGetOwnPropertySlotAndDescriptor"}) { - &$propertyNameGeneration(); - push(@implContent, " if (thisObject->getOwnPropertySlotDelegate(exec, propertyName, slot))\n"); - push(@implContent, " return true;\n"); - } - - push(@implContent, " return Base::getOwnPropertySlotByIndex(thisObject, exec, index, slot);\n"); - push(@implContent, "}\n\n"); - } - - if ($numAttributes > 0) { - foreach my $attribute (@{$interface->attributes}) { - my $name = $attribute->signature->name; - my $type = $attribute->signature->type; - $codeGenerator->AssertNotSequenceType($type); - my $getFunctionName = GetAttributeGetterName($interfaceName, $className, $attribute); - my $implGetterFunctionName = $codeGenerator->WK_lcfirst($name); - - my $attributeConditionalString = $codeGenerator->GenerateConditionalString($attribute->signature); - push(@implContent, "#if ${attributeConditionalString}\n") if $attributeConditionalString; - - push(@implContent, "JSValue ${getFunctionName}(ExecState* exec, JSValue slotBase, PropertyName)\n"); - push(@implContent, "{\n"); - - if (!$attribute->isStatic || $attribute->signature->type =~ /Constructor$/) { - push(@implContent, " ${className}* castedThis = jsCast<$className*>(asObject(slotBase));\n"); - } else { - push(@implContent, " UNUSED_PARAM(slotBase);\n"); - } - - if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) { - $needsMarkChildren = 1; - } - - if ($interface->extendedAttributes->{"CheckSecurity"} && - !$attribute->signature->extendedAttributes->{"DoNotCheckSecurity"} && - !$attribute->signature->extendedAttributes->{"DoNotCheckSecurityOnGetter"}) { - $implIncludes{"BindingSecurity.h"} = 1; - push(@implContent, " if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, castedThis->impl()))\n"); - push(@implContent, " return jsUndefined();\n"); - } - - if ($attribute->signature->extendedAttributes->{"Custom"} || $attribute->signature->extendedAttributes->{"JSCustom"} || $attribute->signature->extendedAttributes->{"CustomGetter"} || $attribute->signature->extendedAttributes->{"JSCustomGetter"}) { - push(@implContent, " return castedThis->$implGetterFunctionName(exec);\n"); - } elsif ($attribute->signature->extendedAttributes->{"CheckSecurityForNode"}) { - $implIncludes{"JSDOMBinding.h"} = 1; - push(@implContent, " $interfaceName* impl = static_cast<$interfaceName*>(castedThis->impl());\n"); - push(@implContent, " return shouldAllowAccessToNode(exec, impl->" . $attribute->signature->name . "()) ? " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl->$implGetterFunctionName()", "castedThis") . " : jsNull();\n"); - } elsif ($type eq "EventListener") { - $implIncludes{"EventListener.h"} = 1; - push(@implContent, " UNUSED_PARAM(exec);\n"); - push(@implContent, " $interfaceName* impl = static_cast<$interfaceName*>(castedThis->impl());\n"); - push(@implContent, " if (EventListener* listener = impl->$implGetterFunctionName()) {\n"); - push(@implContent, " if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {\n"); - if ($interfaceName eq "Document" || $interfaceName eq "WorkerContext" || $interfaceName eq "SharedWorkerContext" || $interfaceName eq "DedicatedWorkerContext") { - push(@implContent, " if (JSObject* jsFunction = jsListener->jsFunction(impl))\n"); - } else { - push(@implContent, " if (JSObject* jsFunction = jsListener->jsFunction(impl->scriptExecutionContext()))\n"); - } - push(@implContent, " return jsFunction;\n"); - push(@implContent, " }\n"); - push(@implContent, " }\n"); - push(@implContent, " return jsNull();\n"); - } elsif ($attribute->signature->type =~ /Constructor$/) { - my $constructorType = $attribute->signature->type; - $constructorType =~ s/Constructor$//; - # When Constructor attribute is used by DOMWindow.idl, it's correct to pass castedThis as the global object - # When JSDOMWrappers have a back-pointer to the globalObject we can pass castedThis->globalObject() - if ($interfaceName eq "DOMWindow") { - push(@implContent, " return JS" . $constructorType . "::getConstructor(exec, castedThis);\n"); - } else { - AddToImplIncludes("JS" . $constructorType . ".h", $attribute->signature->extendedAttributes->{"Conditional"}); - push(@implContent, " return JS" . $constructorType . "::getConstructor(exec, castedThis->globalObject());\n"); - } - } elsif (!@{$attribute->getterExceptions}) { - push(@implContent, " UNUSED_PARAM(exec);\n") if !$attribute->signature->extendedAttributes->{"CallWith"}; - - my $cacheIndex = 0; - if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) { - $cacheIndex = $currentCachedAttribute; - $currentCachedAttribute++; - push(@implContent, " if (JSValue cachedValue = castedThis->m_" . $attribute->signature->name . ".get())\n"); - push(@implContent, " return cachedValue;\n"); - } - - my @callWithArgs = GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, "jsUndefined()"); - - if ($svgListPropertyType) { - push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "castedThis->impl()->$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "castedThis") . ";\n"); - } elsif ($svgPropertyOrListPropertyType) { - push(@implContent, " $svgPropertyOrListPropertyType& impl = castedThis->impl()->propertyReference();\n"); - if ($svgPropertyOrListPropertyType eq "float") { # Special case for JSSVGNumber - push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl", "castedThis") . ";\n"); - } else { - push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl.$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "castedThis") . ";\n"); - - } - } else { - my ($functionName, @arguments) = $codeGenerator->GetterExpression(\%implIncludes, $interfaceName, $attribute); - if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) { - my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"}; - $implIncludes{"${implementedBy}.h"} = 1; - $functionName = "${implementedBy}::${functionName}"; - unshift(@arguments, "impl") if !$attribute->isStatic; - } elsif ($attribute->isStatic) { - $functionName = "${interfaceName}::${functionName}"; - } else { - $functionName = "impl->${functionName}"; - } - - unshift(@arguments, @callWithArgs); - - my $jsType = NativeToJSValue($attribute->signature, 0, $interfaceName, "${functionName}(" . join(", ", @arguments) . ")", "castedThis"); - push(@implContent, " $interfaceName* impl = static_cast<$interfaceName*>(castedThis->impl());\n") if !$attribute->isStatic; - if ($codeGenerator->IsSVGAnimatedType($type)) { - push(@implContent, " RefPtr<$type> obj = $jsType;\n"); - push(@implContent, " JSValue result = toJS(exec, castedThis->globalObject(), obj.get());\n"); - } else { - push(@implContent, " JSValue result = $jsType;\n"); - } - } - - push(@implContent, " castedThis->m_" . $attribute->signature->name . ".set(exec->globalData(), castedThis, result);\n") if ($attribute->signature->extendedAttributes->{"CachedAttribute"}); - push(@implContent, " return result;\n"); - - } else { - my @arguments = ("ec"); - push(@implContent, " ExceptionCode ec = 0;\n"); - - unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, "jsUndefined()")); - - if ($svgPropertyOrListPropertyType) { - push(@implContent, " $svgPropertyOrListPropertyType impl(*castedThis->impl());\n"); - push(@implContent, " JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n"); - } else { - push(@implContent, " $interfaceName* impl = static_cast<$interfaceName*>(castedThis->impl());\n"); - push(@implContent, " JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl->$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n"); - } - - push(@implContent, " setDOMException(exec, ec);\n"); - push(@implContent, " return result;\n"); - } - - push(@implContent, "}\n\n"); - - push(@implContent, "#endif\n") if $attributeConditionalString; - - push(@implContent, "\n"); - } - - if (!$interface->extendedAttributes->{"OmitConstructor"}) { - my $constructorFunctionName = "js" . $interfaceName . "Constructor"; - - push(@implContent, "JSValue ${constructorFunctionName}(ExecState* exec, JSValue slotBase, PropertyName)\n"); - push(@implContent, "{\n"); - push(@implContent, " ${className}* domObject = jsCast<$className*>(asObject(slotBase));\n"); - - if ($interface->extendedAttributes->{"CheckSecurity"}) { - $implIncludes{"BindingSecurity.h"} = 1; - push(@implContent, " if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, domObject->impl()))\n"); - push(@implContent, " return jsUndefined();\n"); - } - - push(@implContent, " return ${className}::getConstructor(exec, domObject->globalObject());\n"); - push(@implContent, "}\n\n"); - } - } - - # Check if we have any writable attributes - my $hasReadWriteProperties = 0; - foreach my $attribute (@{$interface->attributes}) { - $hasReadWriteProperties = 1 if !IsReadonly($attribute) && !$attribute->isStatic; - } - - my $hasSetter = $hasReadWriteProperties - || $interface->extendedAttributes->{"CustomNamedSetter"} - || $interface->extendedAttributes->{"CustomIndexedSetter"}; - - if ($hasSetter) { - if (!$interface->extendedAttributes->{"CustomPutFunction"}) { - push(@implContent, "void ${className}::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)\n"); - push(@implContent, "{\n"); - push(@implContent, " ${className}* thisObject = jsCast<${className}*>(cell);\n"); - push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n"); - if ($interface->extendedAttributes->{"CustomIndexedSetter"}) { - push(@implContent, " unsigned index = propertyName.asIndex();\n"); - push(@implContent, " if (index != PropertyName::NotAnIndex) {\n"); - push(@implContent, " thisObject->indexSetter(exec, index, value);\n"); - push(@implContent, " return;\n"); - push(@implContent, " }\n"); - } - if ($interface->extendedAttributes->{"CustomNamedSetter"}) { - push(@implContent, " if (thisObject->putDelegate(exec, propertyName, value, slot))\n"); - push(@implContent, " return;\n"); - } - - if ($hasReadWriteProperties) { - push(@implContent, " lookupPut<$className, Base>(exec, propertyName, value, " . hashTableAccessor($interface->extendedAttributes->{"JSNoStaticTables"}, $className) . ", thisObject, slot);\n"); - } else { - push(@implContent, " Base::put(thisObject, exec, propertyName, value, slot);\n"); - } - push(@implContent, "}\n\n"); - - if ($interface->extendedAttributes->{"CustomIndexedSetter"} || $interface->extendedAttributes->{"CustomNamedSetter"}) { - push(@implContent, "void ${className}::putByIndex(JSCell* cell, ExecState* exec, unsigned index, JSValue value, bool shouldThrow)\n"); - push(@implContent, "{\n"); - push(@implContent, " ${className}* thisObject = jsCast<${className}*>(cell);\n"); - push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n"); - if ($interface->extendedAttributes->{"CustomIndexedSetter"}) { - push(@implContent, " if (index <= MAX_ARRAY_INDEX) {\n"); - push(@implContent, " UNUSED_PARAM(shouldThrow);\n"); - push(@implContent, " thisObject->indexSetter(exec, index, value);\n"); - push(@implContent, " return;\n"); - push(@implContent, " }\n"); - } - - if ($interface->extendedAttributes->{"CustomNamedSetter"}) { - push(@implContent, " PropertyName propertyName = Identifier::from(exec, index);\n"); - push(@implContent, " PutPropertySlot slot(shouldThrow);\n"); - push(@implContent, " if (thisObject->putDelegate(exec, propertyName, value, slot))\n"); - push(@implContent, " return;\n"); - } - - push(@implContent, " Base::putByIndex(cell, exec, index, value, shouldThrow);\n"); - push(@implContent, "}\n\n"); - } - } - - if ($hasReadWriteProperties) { - foreach my $attribute (@{$interface->attributes}) { - if (!IsReadonly($attribute)) { - my $name = $attribute->signature->name; - my $type = $attribute->signature->type; - my $putFunctionName = GetAttributeSetterName($interfaceName, $className, $attribute); - my $implSetterFunctionName = $codeGenerator->WK_ucfirst($name); - - my $attributeConditionalString = $codeGenerator->GenerateConditionalString($attribute->signature); - push(@implContent, "#if ${attributeConditionalString}\n") if $attributeConditionalString; - - push(@implContent, "void ${putFunctionName}(ExecState* exec, JSObject*"); - push(@implContent, " thisObject") if !$attribute->isStatic; - push(@implContent, ", JSValue value)\n"); - push(@implContent, "{\n"); - - push(@implContent, " UNUSED_PARAM(exec);\n"); - - if ($interface->extendedAttributes->{"CheckSecurity"} && !$attribute->signature->extendedAttributes->{"DoNotCheckSecurity"}) { - if ($interfaceName eq "DOMWindow") { - $implIncludes{"BindingSecurity.h"} = 1; - push(@implContent, " if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, jsCast<$className*>(thisObject)->impl()))\n"); - } else { - push(@implContent, " if (!shouldAllowAccessToFrame(exec, jsCast<$className*>(thisObject)->impl()->frame()))\n"); - } - push(@implContent, " return;\n"); - } - - if ($attribute->signature->extendedAttributes->{"Custom"} || $attribute->signature->extendedAttributes->{"JSCustom"} || $attribute->signature->extendedAttributes->{"CustomSetter"} || $attribute->signature->extendedAttributes->{"JSCustomSetter"}) { - push(@implContent, " jsCast<$className*>(thisObject)->set$implSetterFunctionName(exec, value);\n"); - } elsif ($type eq "EventListener") { - $implIncludes{"JSEventListener.h"} = 1; - push(@implContent, " UNUSED_PARAM(exec);\n"); - push(@implContent, " ${className}* castedThis = jsCast<${className}*>(thisObject);\n"); - my $windowEventListener = $attribute->signature->extendedAttributes->{"JSWindowEventListener"}; - if ($windowEventListener) { - push(@implContent, " JSDOMGlobalObject* globalObject = castedThis->globalObject();\n"); - } - push(@implContent, " $interfaceName* impl = static_cast<$interfaceName*>(castedThis->impl());\n"); - if ((($interfaceName eq "DOMWindow") or ($interfaceName eq "WorkerContext")) and $name eq "onerror") { - $implIncludes{"JSErrorHandler.h"} = 1; - push(@implContent, " impl->set$implSetterFunctionName(createJSErrorHandler(exec, value, thisObject));\n"); - } else { - push(@implContent, GenerateAttributeEventListenerCall($className, $implSetterFunctionName, $windowEventListener)); - } - } elsif ($attribute->signature->type =~ /Constructor$/) { - my $constructorType = $attribute->signature->type; - $constructorType =~ s/Constructor$//; - # $constructorType ~= /Constructor$/ indicates that it is NamedConstructor. - # We do not generate the header file for NamedConstructor of class XXXX, - # since we generate the NamedConstructor declaration into the header file of class XXXX. - if ($constructorType ne "DOMObject" and $constructorType !~ /Constructor$/) { - AddToImplIncludes("JS" . $constructorType . ".h", $attribute->signature->extendedAttributes->{"Conditional"}); - } - push(@implContent, " // Shadowing a built-in constructor\n"); - if ($interfaceName eq "DOMWindow" && $className eq "JSblah") { - # FIXME: This branch never executes and should be removed. - push(@implContent, " jsCast<$className*>(thisObject)->putDirect(exec->globalData(), exec->propertyNames().constructor, value);\n"); - } else { - push(@implContent, " jsCast<$className*>(thisObject)->putDirect(exec->globalData(), Identifier(exec, \"$name\"), value);\n"); - } - } elsif ($attribute->signature->extendedAttributes->{"Replaceable"}) { - push(@implContent, " // Shadowing a built-in object\n"); - push(@implContent, " jsCast<$className*>(thisObject)->putDirect(exec->globalData(), Identifier(exec, \"$name\"), value);\n"); - } else { - if (!$attribute->isStatic) { - push(@implContent, " $className* castedThis = jsCast<$className*>(thisObject);\n"); - push(@implContent, " $implType* impl = static_cast<$implType*>(castedThis->impl());\n"); - } - push(@implContent, " ExceptionCode ec = 0;\n") if @{$attribute->setterExceptions}; - - # If the "StrictTypeChecking" extended attribute is present, and the attribute's type is an - # interface type, then if the incoming value does not implement that interface, a TypeError - # is thrown rather than silently passing NULL to the C++ code. - # Per the Web IDL and ECMAScript specifications, incoming values can always be converted to - # both strings and numbers, so do not throw TypeError if the attribute is of these types. - if ($attribute->signature->extendedAttributes->{"StrictTypeChecking"}) { - $implIncludes{"<runtime/Error.h>"} = 1; - - my $argType = $attribute->signature->type; - if (!IsNativeType($argType)) { - push(@implContent, " if (!value.isUndefinedOrNull() && !value.inherits(&JS${argType}::s_info)) {\n"); - push(@implContent, " throwVMTypeError(exec);\n"); - push(@implContent, " return;\n"); - push(@implContent, " };\n"); - } - } - - my $nativeValue = JSValueToNative($attribute->signature, "value"); - if ($svgPropertyOrListPropertyType) { - if ($svgPropertyType) { - push(@implContent, " if (impl->isReadOnly()) {\n"); - push(@implContent, " setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);\n"); - push(@implContent, " return;\n"); - push(@implContent, " }\n"); - $implIncludes{"ExceptionCode.h"} = 1; - } - push(@implContent, " $svgPropertyOrListPropertyType& podImpl = impl->propertyReference();\n"); - if ($svgPropertyOrListPropertyType eq "float") { # Special case for JSSVGNumber - push(@implContent, " podImpl = $nativeValue;\n"); - } else { - push(@implContent, " podImpl.set$implSetterFunctionName($nativeValue"); - push(@implContent, ", ec") if @{$attribute->setterExceptions}; - push(@implContent, ");\n"); - push(@implContent, " setDOMException(exec, ec);\n") if @{$attribute->setterExceptions}; - } - if ($svgPropertyType) { - if (@{$attribute->setterExceptions}) { - push(@implContent, " if (!ec)\n"); - push(@implContent, " impl->commitChange();\n"); - } else { - push(@implContent, " impl->commitChange();\n"); - } - } - } else { - my ($functionName, @arguments) = $codeGenerator->SetterExpression(\%implIncludes, $interfaceName, $attribute); - push(@arguments, $nativeValue); - if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) { - my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"}; - $implIncludes{"${implementedBy}.h"} = 1; - unshift(@arguments, "impl") if !$attribute->isStatic; - $functionName = "${implementedBy}::${functionName}"; - } elsif ($attribute->isStatic) { - $functionName = "${interfaceName}::${functionName}"; - } else { - $functionName = "impl->${functionName}"; - } - - unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, "")); - - push(@arguments, "ec") if @{$attribute->setterExceptions}; - push(@implContent, " ${functionName}(" . join(", ", @arguments) . ");\n"); - push(@implContent, " setDOMException(exec, ec);\n") if @{$attribute->setterExceptions}; - } - } - - push(@implContent, "}\n\n"); - push(@implContent, "#endif\n") if $attributeConditionalString; - push(@implContent, "\n"); - } - } - } - - if ($interface->extendedAttributes->{"ReplaceableConstructor"}) { - my $constructorFunctionName = "setJS" . $interfaceName . "Constructor"; - - push(@implContent, "void ${constructorFunctionName}(ExecState* exec, JSObject* thisObject, JSValue value)\n"); - push(@implContent, "{\n"); - if ($interface->extendedAttributes->{"CheckSecurity"}) { - if ($interfaceName eq "DOMWindow") { - $implIncludes{"BindingSecurity.h"} = 1; - push(@implContent, " if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, jsCast<$className*>(thisObject)->impl()))\n"); - } else { - push(@implContent, " if (!shouldAllowAccessToFrame(exec, jsCast<$className*>(thisObject)->impl()->frame()))\n"); - } - push(@implContent, " return;\n"); - } - - push(@implContent, " // Shadowing a built-in constructor\n"); - - if ($interfaceName eq "DOMWindow") { - push(@implContent, " jsCast<$className*>(thisObject)->putDirect(exec->globalData(), exec->propertyNames().constructor, value);\n"); - } else { - die "No way to handle interface with ReplaceableConstructor extended attribute: $interfaceName"; - } - push(@implContent, "}\n\n"); - } - } - } - - if (($interface->extendedAttributes->{"IndexedGetter"} || $interface->extendedAttributes->{"NumericIndexedGetter"}) && !$interface->extendedAttributes->{"CustomEnumerateProperty"}) { - push(@implContent, "void ${className}::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)\n"); - push(@implContent, "{\n"); - push(@implContent, " ${className}* thisObject = jsCast<${className}*>(object);\n"); - push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n"); - if ($interface->extendedAttributes->{"IndexedGetter"} || $interface->extendedAttributes->{"NumericIndexedGetter"}) { - push(@implContent, " for (unsigned i = 0; i < static_cast<${interfaceName}*>(thisObject->impl())->length(); ++i)\n"); - push(@implContent, " propertyNames.add(Identifier::from(exec, i));\n"); - } - push(@implContent, " Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);\n"); - push(@implContent, "}\n\n"); - } - - if (!$interface->extendedAttributes->{"OmitConstructor"}) { - push(@implContent, "JSValue ${className}::getConstructor(ExecState* exec, JSGlobalObject* globalObject)\n{\n"); - push(@implContent, " return getDOMConstructor<${className}Constructor>(exec, jsCast<JSDOMGlobalObject*>(globalObject));\n"); - push(@implContent, "}\n\n"); - } - - # Functions - if ($numFunctions > 0) { - foreach my $function (@{$interface->functions}) { - AddIncludesForTypeInImpl($function->signature->type); - - my $isCustom = $function->signature->extendedAttributes->{"Custom"} || $function->signature->extendedAttributes->{"JSCustom"}; - my $isOverloaded = $function->{overloads} && @{$function->{overloads}} > 1; - - next if $isCustom && $isOverloaded && $function->{overloadIndex} > 1; - - my $functionName = GetFunctionName($className, $function); - - my $conditional = $function->signature->extendedAttributes->{"Conditional"}; - if ($conditional) { - my $conditionalString = $codeGenerator->GenerateConditionalStringFromAttributeValue($conditional); - push(@implContent, "#if ${conditionalString}\n"); - } - - - if (!$isCustom && $isOverloaded) { - # Append a number to an overloaded method's name to make it unique: - $functionName = $functionName . $function->{overloadIndex}; - # Make this function static to avoid compiler warnings, since we - # don't generate a prototype for it in the header. - push(@implContent, "static "); - } - - my $functionImplementationName = $function->signature->extendedAttributes->{"ImplementedAs"} || $codeGenerator->WK_lcfirst($function->signature->name); - - push(@implContent, "EncodedJSValue JSC_HOST_CALL ${functionName}(ExecState* exec)\n"); - push(@implContent, "{\n"); - - $implIncludes{"<runtime/Error.h>"} = 1; - - if ($function->isStatic) { - if ($isCustom) { - GenerateArgumentsCountCheck(\@implContent, $function, $interface); - push(@implContent, " return JSValue::encode(${className}::" . $functionImplementationName . "(exec));\n"); - } else { - GenerateArgumentsCountCheck(\@implContent, $function, $interface); - - if (@{$function->raisesExceptions}) { - push(@implContent, " ExceptionCode ec = 0;\n"); - } - - my $numParameters = @{$function->parameters}; - my ($functionString, $dummy) = GenerateParametersCheck(\@implContent, $function, $interface, $numParameters, $interfaceName, $functionImplementationName, $svgPropertyType, $svgPropertyOrListPropertyType, $svgListPropertyType); - GenerateImplementationFunctionCall($function, $functionString, " ", $svgPropertyType, $interfaceName); - } - } else { - if ($interfaceName eq "DOMWindow") { - push(@implContent, " $className* castedThis = toJSDOMWindow(exec->hostThisValue().toThisObject(exec));\n"); - push(@implContent, " if (!castedThis)\n"); - push(@implContent, " return throwVMTypeError(exec);\n"); - } elsif ($interface->extendedAttributes->{"IsWorkerContext"}) { - push(@implContent, " $className* castedThis = to${className}(exec->hostThisValue().toThisObject(exec));\n"); - push(@implContent, " if (!castedThis)\n"); - push(@implContent, " return throwVMTypeError(exec);\n"); - } else { - push(@implContent, " JSValue thisValue = exec->hostThisValue();\n"); - push(@implContent, " if (!thisValue.inherits(&${className}::s_info))\n"); - push(@implContent, " return throwVMTypeError(exec);\n"); - push(@implContent, " $className* castedThis = jsCast<$className*>(asObject(thisValue));\n"); - } - - push(@implContent, " ASSERT_GC_OBJECT_INHERITS(castedThis, &${className}::s_info);\n"); - - if ($interface->extendedAttributes->{"CheckSecurity"} and - !$function->signature->extendedAttributes->{"DoNotCheckSecurity"}) { - $implIncludes{"BindingSecurity.h"} = 1; - push(@implContent, " if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, castedThis->impl()))\n"); - push(@implContent, " return JSValue::encode(jsUndefined());\n"); - } - - if ($isCustom) { - push(@implContent, " return JSValue::encode(castedThis->" . $functionImplementationName . "(exec));\n"); - } else { - if ($function->signature->name eq "set" and $interface->extendedAttributes->{"TypedArray"}) { - my $viewType = $interface->extendedAttributes->{"TypedArray"}; - push(@implContent, " return JSValue::encode(setWebGLArrayHelper<$implType, $viewType>(exec, castedThis->impl()));\n"); - push(@implContent, "}\n\n"); - next; - } - - push(@implContent, " $implType* impl = static_cast<$implType*>(castedThis->impl());\n"); - if ($svgPropertyType) { - push(@implContent, " if (impl->isReadOnly()) {\n"); - push(@implContent, " setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);\n"); - push(@implContent, " return JSValue::encode(jsUndefined());\n"); - push(@implContent, " }\n"); - push(@implContent, " $svgPropertyType& podImpl = impl->propertyReference();\n"); - $implIncludes{"ExceptionCode.h"} = 1; - } - - # For compatibility with legacy content, the EventListener calls are generated without GenerateArgumentsCountCheck. - if ($function->signature->name eq "addEventListener") { - push(@implContent, GenerateEventListenerCall($className, "add")); - } elsif ($function->signature->name eq "removeEventListener") { - push(@implContent, GenerateEventListenerCall($className, "remove")); - } else { - GenerateArgumentsCountCheck(\@implContent, $function, $interface); - - if (@{$function->raisesExceptions}) { - push(@implContent, " ExceptionCode ec = 0;\n"); - } - - if ($function->signature->extendedAttributes->{"CheckSecurityForNode"}) { - push(@implContent, " if (!shouldAllowAccessToNode(exec, impl->" . $function->signature->name . "(" . (@{$function->raisesExceptions} ? "ec" : "") .")))\n"); - push(@implContent, " return JSValue::encode(jsNull());\n"); - $implIncludes{"JSDOMBinding.h"} = 1; - } - - my $numParameters = @{$function->parameters}; - my ($functionString, $dummy) = GenerateParametersCheck(\@implContent, $function, $interface, $numParameters, $interfaceName, $functionImplementationName, $svgPropertyType, $svgPropertyOrListPropertyType, $svgListPropertyType); - GenerateImplementationFunctionCall($function, $functionString, " ", $svgPropertyType, $interfaceName); - } - } - } - - push(@implContent, "}\n\n"); - - if (!$isCustom && $isOverloaded && $function->{overloadIndex} == @{$function->{overloads}}) { - # Generate a function dispatching call to the rest of the overloads. - GenerateOverloadedFunction($function, $interface, $interfaceName); - } - - push(@implContent, "#endif\n\n") if $conditional; - } - } - - if ($needsMarkChildren && !$interface->extendedAttributes->{"JSCustomMarkFunction"}) { - push(@implContent, "void ${className}::visitChildren(JSCell* cell, SlotVisitor& visitor)\n"); - push(@implContent, "{\n"); - push(@implContent, " ${className}* thisObject = jsCast<${className}*>(cell);\n"); - push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n"); - push(@implContent, " COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);\n"); - push(@implContent, " ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());\n"); - push(@implContent, " Base::visitChildren(thisObject, visitor);\n"); - if ($interface->extendedAttributes->{"EventTarget"} || $interface->name eq "EventTarget") { - push(@implContent, " thisObject->impl()->visitJSEventListeners(visitor);\n"); - } - if ($numCachedAttributes > 0) { - foreach (@{$interface->attributes}) { - my $attribute = $_; - if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) { - push(@implContent, " visitor.append(&thisObject->m_" . $attribute->signature->name . ");\n"); - } - } - } - push(@implContent, "}\n\n"); - } - - # Cached attributes are indeed allowed when there is a custom mark/visitChildren function. - # The custom function must make sure to account for the cached attribute. - # Uncomment the below line to temporarily enforce generated mark functions when cached attributes are present. - # die "Can't generate binding for class with cached attribute and custom mark." if (($numCachedAttributes > 0) and ($interface->extendedAttributes->{"JSCustomMarkFunction"})); - - if ($numConstants > 0) { - push(@implContent, "// Constant getters\n\n"); - - foreach my $constant (@{$interface->constants}) { - my $getter = "js" . $interfaceName . $codeGenerator->WK_ucfirst($constant->name); - my $conditional = $constant->extendedAttributes->{"Conditional"}; - - if ($conditional) { - my $conditionalString = $codeGenerator->GenerateConditionalStringFromAttributeValue($conditional); - push(@implContent, "#if ${conditionalString}\n"); - } - - # FIXME: this casts into int to match our previous behavior which turned 0xFFFFFFFF in -1 for NodeFilter.SHOW_ALL - push(@implContent, "JSValue ${getter}(ExecState* exec, JSValue, PropertyName)\n"); - push(@implContent, "{\n"); - if ($constant->type eq "DOMString") { - push(@implContent, " return jsStringOrNull(exec, String(" . $constant->value . "));\n"); - } else { - push(@implContent, " UNUSED_PARAM(exec);\n"); - push(@implContent, " return jsNumber(static_cast<int>(" . $constant->value . "));\n"); - } - push(@implContent, "}\n\n"); - push(@implContent, "#endif\n") if $conditional; - } - } - - if ($interface->extendedAttributes->{"IndexedGetter"}) { - push(@implContent, "\nJSValue ${className}::indexGetter(ExecState* exec, JSValue slotBase, unsigned index)\n"); - push(@implContent, "{\n"); - push(@implContent, " ${className}* thisObj = jsCast<$className*>(asObject(slotBase));\n"); - push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObj, &s_info);\n"); - if (IndexGetterReturnsStrings($interfaceName)) { - $implIncludes{"KURL.h"} = 1; - push(@implContent, " return jsStringOrUndefined(exec, thisObj->impl()->item(index));\n"); - } else { - push(@implContent, " return toJS(exec, thisObj->globalObject(), static_cast<$interfaceName*>(thisObj->impl())->item(index));\n"); - } - push(@implContent, "}\n\n"); - if ($interfaceName =~ /^HTML\w*Collection$/ or $interfaceName eq "RadioNodeList") { - $implIncludes{"JSNode.h"} = 1; - $implIncludes{"Node.h"} = 1; - } - } - - if ($interface->extendedAttributes->{"NumericIndexedGetter"}) { - push(@implContent, "\nJSValue ${className}::getByIndex(ExecState*, unsigned index)\n"); - push(@implContent, "{\n"); - push(@implContent, " ASSERT_GC_OBJECT_INHERITS(this, &s_info);\n"); - push(@implContent, " double result = static_cast<$interfaceName*>(impl())->item(index);\n"); - # jsNumber conversion doesn't suppress signalling NaNs, so enforce that here. - push(@implContent, " if (isnan(result))\n"); - push(@implContent, " return jsNaN();\n"); - push(@implContent, " return JSValue(result);\n"); - push(@implContent, "}\n\n"); - if ($interfaceName =~ /^HTML\w*Collection$/) { - $implIncludes{"JSNode.h"} = 1; - $implIncludes{"Node.h"} = 1; - } - } - - if ($interfaceName eq "HTMLPropertiesCollection" or $interfaceName eq "DOMNamedFlowCollection") { - if ($interface->extendedAttributes->{"NamedGetter"}) { - push(@implContent, "bool ${className}::canGetItemsForName(ExecState*, $interfaceName* collection, PropertyName propertyName)\n"); - push(@implContent, "{\n"); - push(@implContent, " return collection->hasNamedItem(propertyNameToAtomicString(propertyName));\n"); - push(@implContent, "}\n\n"); - push(@implContent, "JSValue ${className}::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)\n"); - push(@implContent, "{\n"); - push(@implContent, " ${className}* thisObj = jsCast<$className*>(asObject(slotBase));\n"); - if ($interfaceName eq "HTMLPropertiesCollection") { - push(@implContent, " return toJS(exec, thisObj->globalObject(), static_cast<$interfaceName*>(thisObj->impl())->propertyNodeList(propertyNameToAtomicString(propertyName)));\n"); - } else { - push(@implContent, " return toJS(exec, thisObj->globalObject(), static_cast<$interfaceName*>(thisObj->impl())->namedItem(propertyNameToAtomicString(propertyName)));\n"); - } - push(@implContent, "}\n\n"); - } - } - - if ((!$hasParent && !GetCustomIsReachable($interface))|| GetGenerateIsReachable($interface) || $interface->extendedAttributes->{"ActiveDOMObject"}) { - push(@implContent, "static inline bool isObservable(JS${interfaceName}* js${interfaceName})\n"); - push(@implContent, "{\n"); - push(@implContent, " if (js${interfaceName}->hasCustomProperties())\n"); - push(@implContent, " return true;\n"); - if ($eventTarget) { - push(@implContent, " if (js${interfaceName}->impl()->hasEventListeners())\n"); - push(@implContent, " return true;\n"); - } - push(@implContent, " return false;\n"); - push(@implContent, "}\n\n"); - - push(@implContent, "bool JS${interfaceName}Owner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)\n"); - push(@implContent, "{\n"); - push(@implContent, " JS${interfaceName}* js${interfaceName} = jsCast<JS${interfaceName}*>(handle.get().asCell());\n"); - # All ActiveDOMObjects implement hasPendingActivity(), but not all of them - # increment their C++ reference counts when hasPendingActivity() becomes - # true. As a result, ActiveDOMObjects can be prematurely destroyed before - # their pending activities complete. To wallpaper over this bug, JavaScript - # wrappers unconditionally keep ActiveDOMObjects with pending activity alive. - # FIXME: Fix this lifetime issue in the DOM, and move this hasPendingActivity - # check below the isObservable check. - if ($interface->extendedAttributes->{"ActiveDOMObject"}) { - push(@implContent, " if (js${interfaceName}->impl()->hasPendingActivity())\n"); - push(@implContent, " return true;\n"); - } - if ($codeGenerator->IsSubType($interface, "Node")) { - push(@implContent, " if (JSNodeOwner::isReachableFromOpaqueRoots(handle, 0, visitor))\n"); - push(@implContent, " return true;\n"); - } - push(@implContent, " if (!isObservable(js${interfaceName}))\n"); - push(@implContent, " return false;\n"); - if (GetGenerateIsReachable($interface)) { - my $rootString; - if (GetGenerateIsReachable($interface) eq "Impl") { - $rootString = " ${implType}* root = js${interfaceName}->impl();\n"; - } elsif (GetGenerateIsReachable($interface) eq "ImplContext") { - $rootString = " WebGLRenderingContext* root = js${interfaceName}->impl()->context();\n"; - } elsif (GetGenerateIsReachable($interface) eq "ImplFrame") { - $rootString = " Frame* root = js${interfaceName}->impl()->frame();\n"; - $rootString .= " if (!root)\n"; - $rootString .= " return false;\n"; - } elsif (GetGenerateIsReachable($interface) eq "ImplDocument") { - $rootString = " Document* root = js${interfaceName}->impl()->document();\n"; - $rootString .= " if (!root)\n"; - $rootString .= " return false;\n"; - } elsif (GetGenerateIsReachable($interface) eq "ImplElementRoot") { - $rootString = " Element* element = js${interfaceName}->impl()->element();\n"; - $rootString .= " if (!element)\n"; - $rootString .= " return false;\n"; - $rootString .= " void* root = WebCore::root(element);\n"; - } elsif ($interfaceName eq "CanvasRenderingContext") { - $rootString = " void* root = WebCore::root(js${interfaceName}->impl()->canvas());\n"; - } elsif (GetGenerateIsReachable($interface) eq "ImplOwnerNodeRoot") { - $rootString = " void* root = WebCore::root(js${interfaceName}->impl()->ownerNode());\n"; - } else { - $rootString = " void* root = WebCore::root(js${interfaceName}->impl());\n"; - } - - push(@implContent, $rootString); - push(@implContent, " return visitor.containsOpaqueRoot(root);\n"); - } else { - push(@implContent, " UNUSED_PARAM(visitor);\n"); - push(@implContent, " return false;\n"); - } - push(@implContent, "}\n\n"); - } - - if (!$interface->extendedAttributes->{"JSCustomFinalize"} && - (!$hasParent || - GetGenerateIsReachable($interface) || - GetCustomIsReachable($interface) || - $interface->extendedAttributes->{"ActiveDOMObject"})) { - push(@implContent, "void JS${interfaceName}Owner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)\n"); - push(@implContent, "{\n"); - push(@implContent, " JS${interfaceName}* js${interfaceName} = jsCast<JS${interfaceName}*>(handle.get().asCell());\n"); - push(@implContent, " DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);\n"); - push(@implContent, " uncacheWrapper(world, js${interfaceName}->impl(), js${interfaceName});\n"); - push(@implContent, " js${interfaceName}->releaseImpl();\n"); - push(@implContent, "}\n\n"); - } - - if (ShouldGenerateToJSImplementation($hasParent, $interface)) { - push(@implContent, "JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, $implType* impl)\n"); - push(@implContent, "{\n"); - if ($svgPropertyType) { - push(@implContent, " return wrap<$className, $implType>(exec, globalObject, impl);\n"); - } else { - push(@implContent, " return wrap<$className>(exec, globalObject, impl);\n"); - } - push(@implContent, "}\n\n"); - } - - if ((!$hasParent or $interface->extendedAttributes->{"JSGenerateToNativeObject"}) and !$interface->extendedAttributes->{"JSCustomToNativeObject"}) { - push(@implContent, "$implType* to${interfaceName}(JSC::JSValue value)\n"); - push(@implContent, "{\n"); - push(@implContent, " return value.inherits(&${className}::s_info) ? jsCast<$className*>(asObject(value))->impl() : 0"); - push(@implContent, ";\n}\n"); - } - - push(@implContent, "\n}\n"); - - my $conditionalString = $codeGenerator->GenerateConditionalString($interface); - push(@implContent, "\n#endif // ${conditionalString}\n") if $conditionalString; -} - -sub GenerateCallWith -{ - my $callWith = shift; - return () unless $callWith; - my $outputArray = shift; - my $returnValue = shift; - my $function = shift; - - my @callWithArgs; - if ($codeGenerator->ExtendedAttributeContains($callWith, "ScriptState")) { - push(@callWithArgs, "exec"); - } - if ($codeGenerator->ExtendedAttributeContains($callWith, "ScriptExecutionContext")) { - push(@$outputArray, " ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();\n"); - push(@$outputArray, " if (!scriptContext)\n"); - push(@$outputArray, " return" . ($returnValue ? " " . $returnValue : "") . ";\n"); - push(@callWithArgs, "scriptContext"); - } - if ($function and $codeGenerator->ExtendedAttributeContains($callWith, "ScriptArguments")) { - push(@$outputArray, " RefPtr<ScriptArguments> scriptArguments(createScriptArguments(exec, " . @{$function->parameters} . "));\n"); - $implIncludes{"ScriptArguments.h"} = 1; - $implIncludes{"ScriptCallStackFactory.h"} = 1; - push(@callWithArgs, "scriptArguments.release()"); - } - return @callWithArgs; -} - -sub GenerateArgumentsCountCheck -{ - my $outputArray = shift; - my $function = shift; - my $interface = shift; - - my $numMandatoryParams = @{$function->parameters}; - foreach my $param (reverse(@{$function->parameters})) { - if ($param->extendedAttributes->{"Optional"} or $param->isVariadic) { - $numMandatoryParams--; - } else { - last; - } - } - if ($numMandatoryParams >= 1) - { - push(@$outputArray, " if (exec->argumentCount() < $numMandatoryParams)\n"); - push(@$outputArray, " return throwVMError(exec, createNotEnoughArgumentsError(exec));\n"); - } -} - -sub GenerateParametersCheck -{ - my $outputArray = shift; - my $function = shift; - my $interface = shift; - my $numParameters = shift; - my $interfaceName = shift; - my $functionImplementationName = shift; - my $svgPropertyType = shift; - my $svgPropertyOrListPropertyType = shift; - my $svgListPropertyType = shift; - - my $argsIndex = 0; - my $hasOptionalArguments = 0; - - my @arguments; - my $functionName; - my $implementedBy = $function->signature->extendedAttributes->{"ImplementedBy"}; - if ($implementedBy) { - AddToImplIncludes("${implementedBy}.h"); - unshift(@arguments, "impl") if !$function->isStatic; - $functionName = "${implementedBy}::${functionImplementationName}"; - } elsif ($function->isStatic) { - $functionName = "${interfaceName}::${functionImplementationName}"; - } elsif ($svgPropertyOrListPropertyType and !$svgListPropertyType) { - $functionName = "podImpl.${functionImplementationName}"; - } else { - $functionName = "impl->${functionImplementationName}"; - } - - if (!$function->signature->extendedAttributes->{"Constructor"}) { - push(@arguments, GenerateCallWith($function->signature->extendedAttributes->{"CallWith"}, \@$outputArray, "JSValue::encode(jsUndefined())", $function)); - } - - $implIncludes{"ExceptionCode.h"} = 1; - $implIncludes{"JSDOMBinding.h"} = 1; - - foreach my $parameter (@{$function->parameters}) { - my $argType = $parameter->type; - - # Optional arguments with [Optional] should generate an early call with fewer arguments. - # Optional arguments with [Optional=...] should not generate the early call. - # Optional Dictionary arguments always considered to have default of empty dictionary. - my $optional = $parameter->extendedAttributes->{"Optional"}; - if ($optional && $optional ne "DefaultIsUndefined" && $optional ne "DefaultIsNullString" && $argType ne "Dictionary" && !$parameter->extendedAttributes->{"Callback"}) { - # Generate early call if there are enough parameters. - if (!$hasOptionalArguments) { - push(@$outputArray, "\n size_t argsCount = exec->argumentCount();\n"); - $hasOptionalArguments = 1; - } - push(@$outputArray, " if (argsCount <= $argsIndex) {\n"); - - my @optionalCallbackArguments = @arguments; - if (@{$function->raisesExceptions}) { - push @optionalCallbackArguments, "ec"; - } - my $functionString = "$functionName(" . join(", ", @optionalCallbackArguments) . ")"; - GenerateImplementationFunctionCall($function, $functionString, " " x 2, $svgPropertyType, $interfaceName); - push(@$outputArray, " }\n\n"); - } - - my $name = $parameter->name; - - if ($argType eq "XPathNSResolver") { - push(@$outputArray, " RefPtr<XPathNSResolver> customResolver;\n"); - push(@$outputArray, " XPathNSResolver* resolver = toXPathNSResolver(exec->argument($argsIndex));\n"); - push(@$outputArray, " if (!resolver) {\n"); - push(@$outputArray, " customResolver = JSCustomXPathNSResolver::create(exec, exec->argument($argsIndex));\n"); - push(@$outputArray, " if (exec->hadException())\n"); - push(@$outputArray, " return JSValue::encode(jsUndefined());\n"); - push(@$outputArray, " resolver = customResolver.get();\n"); - push(@$outputArray, " }\n"); - } elsif ($parameter->extendedAttributes->{"Callback"}) { - my $callbackClassName = GetCallbackClassName($argType); - $implIncludes{"$callbackClassName.h"} = 1; - if ($optional) { - push(@$outputArray, " RefPtr<$argType> $name;\n"); - push(@$outputArray, " if (exec->argumentCount() > $argsIndex && !exec->argument($argsIndex).isUndefinedOrNull()) {\n"); - push(@$outputArray, " if (!exec->argument($argsIndex).isFunction())\n"); - push(@$outputArray, " return throwVMTypeError(exec);\n"); - push(@$outputArray, " $name = ${callbackClassName}::create(asObject(exec->argument($argsIndex)), castedThis->globalObject());\n"); - push(@$outputArray, " }\n"); - } else { - push(@$outputArray, " if (exec->argumentCount() <= $argsIndex || !exec->argument($argsIndex).isFunction())\n"); - push(@$outputArray, " return throwVMTypeError(exec);\n"); - push(@$outputArray, " RefPtr<$argType> $name = ${callbackClassName}::create(asObject(exec->argument($argsIndex)), castedThis->globalObject());\n"); - } - } elsif ($parameter->extendedAttributes->{"Clamp"}) { - my $nativeValue = "${name}NativeValue"; - push(@$outputArray, " $argType $name = 0;\n"); - push(@$outputArray, " double $nativeValue = exec->argument($argsIndex).toNumber(exec);\n"); - push(@$outputArray, " if (exec->hadException())\n"); - push(@$outputArray, " return JSValue::encode(jsUndefined());\n\n"); - push(@$outputArray, " if (!isnan($nativeValue))\n"); - push(@$outputArray, " $name = clampTo<$argType>($nativeValue);\n\n"); - } elsif ($parameter->isVariadic) { - my $nativeElementType; - if ($argType eq "DOMString") { - $nativeElementType = "String"; - } else { - $nativeElementType = GetNativeType($argType); - if ($nativeElementType =~ />$/) { - $nativeElementType .= " "; - } - } - - if (!IsNativeType($argType)) { - push(@$outputArray, " Vector<$nativeElementType> $name;\n"); - push(@$outputArray, " for (unsigned i = $argsIndex; i < exec->argumentCount(); ++i) {\n"); - push(@$outputArray, " if (!exec->argument(i).inherits(&JS${argType}::s_info))\n"); - push(@$outputArray, " return throwVMTypeError(exec);\n"); - push(@$outputArray, " $name.append(to$argType(exec->argument(i)));\n"); - push(@$outputArray, " }\n") - } else { - push(@$outputArray, " Vector<$nativeElementType> $name = toNativeArguments<$nativeElementType>(exec, $argsIndex);\n"); - # Check if the type conversion succeeded. - push(@$outputArray, " if (exec->hadException())\n"); - push(@$outputArray, " return JSValue::encode(jsUndefined());\n"); - } - - } else { - # If the "StrictTypeChecking" extended attribute is present, and the argument's type is an - # interface type, then if the incoming value does not implement that interface, a TypeError - # is thrown rather than silently passing NULL to the C++ code. - # Per the Web IDL and ECMAScript semantics, incoming values can always be converted to both - # strings and numbers, so do not throw TypeError if the argument is of these types. - if ($function->signature->extendedAttributes->{"StrictTypeChecking"}) { - $implIncludes{"<runtime/Error.h>"} = 1; - - my $argValue = "exec->argument($argsIndex)"; - if (!IsNativeType($argType)) { - push(@$outputArray, " if (exec->argumentCount() > $argsIndex && !${argValue}.isUndefinedOrNull() && !${argValue}.inherits(&JS${argType}::s_info))\n"); - push(@$outputArray, " return throwVMTypeError(exec);\n"); - } - } - - my $parameterDefaultPolicy = "DefaultIsUndefined"; - if ($optional and $optional eq "DefaultIsNullString") { - $parameterDefaultPolicy = "DefaultIsNullString"; - } - - push(@$outputArray, " " . GetNativeTypeFromSignature($parameter) . " $name(" . JSValueToNative($parameter, "MAYBE_MISSING_PARAMETER(exec, $argsIndex, $parameterDefaultPolicy)") . ");\n"); - - # If a parameter is "an index" and it's negative it should throw an INDEX_SIZE_ERR exception. - # But this needs to be done in the bindings, because the type is unsigned and the fact that it - # was negative will be lost by the time we're inside the DOM. - if ($parameter->extendedAttributes->{"IsIndex"}) { - push(@$outputArray, " if ($name < 0) {\n"); - push(@$outputArray, " setDOMException(exec, INDEX_SIZE_ERR);\n"); - push(@$outputArray, " return JSValue::encode(jsUndefined());\n"); - push(@$outputArray, " }\n"); - } - - # Check if the type conversion succeeded. - push(@$outputArray, " if (exec->hadException())\n"); - push(@$outputArray, " return JSValue::encode(jsUndefined());\n"); - - if ($codeGenerator->IsSVGTypeNeedingTearOff($argType) and not $interfaceName =~ /List$/) { - push(@$outputArray, " if (!$name) {\n"); - push(@$outputArray, " setDOMException(exec, TYPE_MISMATCH_ERR);\n"); - push(@$outputArray, " return JSValue::encode(jsUndefined());\n"); - push(@$outputArray, " }\n"); - } - } - - if ($argType eq "NodeFilter") { - push @arguments, "$name.get()"; - } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($argType) and not $interfaceName =~ /List$/) { - push @arguments, "$name->propertyReference()"; - } else { - push @arguments, $name; - } - $argsIndex++; - } - - if (@{$function->raisesExceptions}) { - push @arguments, "ec"; - } - return ("$functionName(" . join(", ", @arguments) . ")", scalar @arguments); -} - -sub GenerateCallbackHeader -{ - my $object = shift; - my $interface = shift; - - my $interfaceName = $interface->name; - my $className = "JS$interfaceName"; - - # - Add default header template and header protection - push(@headerContentHeader, GenerateHeaderContentHeader($interface)); - - $headerIncludes{"ActiveDOMCallback.h"} = 1; - $headerIncludes{"$interfaceName.h"} = 1; - $headerIncludes{"JSCallbackData.h"} = 1; - $headerIncludes{"<wtf/Forward.h>"} = 1; - - push(@headerContent, "\nnamespace WebCore {\n\n"); - push(@headerContent, "class $className : public $interfaceName, public ActiveDOMCallback {\n"); - push(@headerContent, "public:\n"); - - # The static create() method. - push(@headerContent, " static PassRefPtr<$className> create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject)\n"); - push(@headerContent, " {\n"); - push(@headerContent, " return adoptRef(new $className(callback, globalObject));\n"); - push(@headerContent, " }\n\n"); - - # Destructor - push(@headerContent, " virtual ~$className();\n"); - - # Functions - my $numFunctions = @{$interface->functions}; - if ($numFunctions > 0) { - push(@headerContent, "\n // Functions\n"); - foreach my $function (@{$interface->functions}) { - my @params = @{$function->parameters}; - if (!$function->signature->extendedAttributes->{"Custom"} && - !(GetNativeType($function->signature->type) eq "bool")) { - push(@headerContent, " COMPILE_ASSERT(false)"); - } - - push(@headerContent, " virtual " . GetNativeTypeForCallbacks($function->signature->type) . " " . $function->signature->name . "("); - - my @args = (); - foreach my $param (@params) { - push(@args, GetNativeTypeForCallbacks($param->type) . " " . $param->name); - } - push(@headerContent, join(", ", @args)); - - push(@headerContent, ");\n"); - } - } - - push(@headerContent, "\nprivate:\n"); - - # Constructor - push(@headerContent, " $className(JSC::JSObject* callback, JSDOMGlobalObject*);\n\n"); - - # Private members - push(@headerContent, " JSCallbackData* m_data;\n"); - push(@headerContent, "};\n\n"); - - push(@headerContent, "} // namespace WebCore\n\n"); - my $conditionalString = $codeGenerator->GenerateConditionalString($interface); - push(@headerContent, "#endif // ${conditionalString}\n\n") if $conditionalString; - push(@headerContent, "#endif\n"); -} - -sub GenerateCallbackImplementation -{ - my ($object, $interface) = @_; - - my $interfaceName = $interface->name; - my $className = "JS$interfaceName"; - - # - Add default header template - push(@implContentHeader, GenerateImplementationContentHeader($interface)); - - $implIncludes{"ScriptExecutionContext.h"} = 1; - $implIncludes{"<runtime/JSLock.h>"} = 1; - - @implContent = (); - - push(@implContent, "\nusing namespace JSC;\n\n"); - push(@implContent, "namespace WebCore {\n\n"); - - # Constructor - push(@implContent, "${className}::${className}(JSObject* callback, JSDOMGlobalObject* globalObject)\n"); - push(@implContent, " : ActiveDOMCallback(globalObject->scriptExecutionContext())\n"); - push(@implContent, " , m_data(new JSCallbackData(callback, globalObject))\n"); - push(@implContent, "{\n"); - push(@implContent, "}\n\n"); - - # Destructor - push(@implContent, "${className}::~${className}()\n"); - push(@implContent, "{\n"); - push(@implContent, " ScriptExecutionContext* context = scriptExecutionContext();\n"); - push(@implContent, " // When the context is destroyed, all tasks with a reference to a callback\n"); - push(@implContent, " // should be deleted. So if the context is 0, we are on the context thread.\n"); - push(@implContent, " if (!context || context->isContextThread())\n"); - push(@implContent, " delete m_data;\n"); - push(@implContent, " else\n"); - push(@implContent, " context->postTask(DeleteCallbackDataTask::create(m_data));\n"); - push(@implContent, "#ifndef NDEBUG\n"); - push(@implContent, " m_data = 0;\n"); - push(@implContent, "#endif\n"); - push(@implContent, "}\n"); - - # Functions - my $numFunctions = @{$interface->functions}; - if ($numFunctions > 0) { - push(@implContent, "\n// Functions\n"); - foreach my $function (@{$interface->functions}) { - my @params = @{$function->parameters}; - if ($function->signature->extendedAttributes->{"Custom"} || - !(GetNativeType($function->signature->type) eq "bool")) { - next; - } - - AddIncludesForTypeInImpl($function->signature->type); - push(@implContent, "\n" . GetNativeTypeForCallbacks($function->signature->type) . " ${className}::" . $function->signature->name . "("); - - my @args = (); - my @argsCheck = (); - my $thisType = $function->signature->extendedAttributes->{"PassThisToCallback"}; - foreach my $param (@params) { - my $paramName = $param->name; - AddIncludesForTypeInImpl($param->type, 1); - push(@args, GetNativeTypeForCallbacks($param->type) . " " . $paramName); - if ($thisType and $thisType eq $param->type) { - push(@argsCheck, <<END); - ASSERT(${paramName}); - -END - } - } - push(@implContent, join(", ", @args)); - push(@implContent, ")\n"); - - push(@implContent, "{\n"); - push(@implContent, @argsCheck) if @argsCheck; - push(@implContent, " if (!canInvokeCallback())\n"); - push(@implContent, " return true;\n\n"); - push(@implContent, " RefPtr<$className> protect(this);\n\n"); - push(@implContent, " JSLockHolder lock(m_data->globalObject()->globalData());\n\n"); - if (@params) { - push(@implContent, " ExecState* exec = m_data->globalObject()->globalExec();\n"); - } - push(@implContent, " MarkedArgumentBuffer args;\n"); - - foreach my $param (@params) { - my $paramName = $param->name; - if ($param->type eq "DOMString") { - push(@implContent, " args.append(jsStringWithCache(exec, ${paramName}));\n"); - } elsif ($param->type eq "boolean") { - push(@implContent, " args.append(jsBoolean(${paramName}));\n"); - } elsif ($param->type eq "SerializedScriptValue") { - push(@implContent, " args.append($paramName ? $paramName->deserialize(exec, m_data->globalObject(), 0) : jsNull());\n"); - } else { - push(@implContent, " args.append(toJS(exec, m_data->globalObject(), ${paramName}));\n"); - } - } - - push(@implContent, "\n bool raisedException = false;\n"); - if ($thisType) { - foreach my $param (@params) { - next if $param->type ne $thisType; - my $paramName = $param->name; - push(@implContent, <<END); - JSValue js${paramName} = toJS(exec, m_data->globalObject(), ${paramName}); - m_data->invokeCallback(js${paramName}, args, &raisedException); - -END - last; - } - } else { - push(@implContent, " m_data->invokeCallback(args, &raisedException);\n"); - } - push(@implContent, " return !raisedException;\n"); - push(@implContent, "}\n"); - } - } - - push(@implContent, "\n}\n"); - my $conditionalString = $codeGenerator->GenerateConditionalString($interface); - push(@implContent, "\n#endif // ${conditionalString}\n") if $conditionalString; -} - -sub GenerateImplementationFunctionCall() -{ - my $function = shift; - my $functionString = shift; - my $indent = shift; - my $svgPropertyType = shift; - my $interfaceName = shift; - - if ($function->signature->type eq "void") { - push(@implContent, $indent . "$functionString;\n"); - push(@implContent, $indent . "setDOMException(exec, ec);\n") if @{$function->raisesExceptions}; - - if ($svgPropertyType and !$function->isStatic) { - if (@{$function->raisesExceptions}) { - push(@implContent, $indent . "if (!ec)\n"); - push(@implContent, $indent . " impl->commitChange();\n"); - } else { - push(@implContent, $indent . "impl->commitChange();\n"); - } - } - - push(@implContent, $indent . "return JSValue::encode(jsUndefined());\n"); - } else { - my $thisObject = $function->isStatic ? 0 : "castedThis"; - push(@implContent, "\n" . $indent . "JSC::JSValue result = " . NativeToJSValue($function->signature, 1, $interfaceName, $functionString, $thisObject) . ";\n"); - push(@implContent, $indent . "setDOMException(exec, ec);\n") if @{$function->raisesExceptions}; - - if ($codeGenerator->ExtendedAttributeContains($function->signature->extendedAttributes->{"CallWith"}, "ScriptState")) { - push(@implContent, $indent . "if (exec->hadException())\n"); - push(@implContent, $indent . " return JSValue::encode(jsUndefined());\n"); - } - - push(@implContent, $indent . "return JSValue::encode(result);\n"); - } -} - -sub GetNativeTypeFromSignature -{ - my $signature = shift; - my $type = $signature->type; - - if ($type eq "unsigned long" and $signature->extendedAttributes->{"IsIndex"}) { - # Special-case index arguments because we need to check that they aren't < 0. - return "int"; - } - - return GetNativeType($type); -} - -my %nativeType = ( - "CompareHow" => "Range::CompareHow", - "DOMString" => "const String&", - # FIXME: Consider replacing DOMStringList with DOMString[] or sequence<DOMString>. - "DOMString[]" => "RefPtr<DOMStringList>", - "DOMObject" => "ScriptValue", - "NodeFilter" => "RefPtr<NodeFilter>", - "SerializedScriptValue" => "RefPtr<SerializedScriptValue>", - "IDBKey" => "PassRefPtr<IDBKey>", - "Dictionary" => "Dictionary", - "any" => "ScriptValue", - "boolean" => "bool", - "double" => "double", - "float" => "float", - "short" => "short", - "long" => "int", - "unsigned long" => "unsigned", - "unsigned short" => "unsigned short", - "long long" => "long long", - "unsigned long long" => "unsigned long long", - "MediaQueryListListener" => "RefPtr<MediaQueryListListener>", - "DOMTimeStamp" => "DOMTimeStamp", -); - -sub GetNativeType -{ - my $type = shift; - - my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($type); - return "${svgNativeType}*" if $svgNativeType; - return "RefPtr<DOMStringList>" if $type eq "DOMStringList" or $type eq "DOMString[]"; - return $nativeType{$type} if exists $nativeType{$type}; - - my $arrayType = $codeGenerator->GetArrayType($type); - my $sequenceType = $codeGenerator->GetSequenceType($type); - my $arrayOrSequenceType = $arrayType || $sequenceType; - - return "Vector<" . GetNativeVectorInnerType($arrayOrSequenceType) . ">" if $arrayOrSequenceType; - - # For all other types, the native type is a pointer with same type name as the IDL type. - return "${type}*"; -} - -sub GetNativeVectorInnerType -{ - my $arrayOrSequenceType = shift; - - return "String" if $arrayOrSequenceType eq "DOMString"; - return $nativeType{$arrayOrSequenceType} if exists $nativeType{$arrayOrSequenceType}; - return "RefPtr<${arrayOrSequenceType}> "; -} - -sub GetNativeTypeForCallbacks -{ - my $type = shift; - return "SerializedScriptValue*" if $type eq "SerializedScriptValue"; - return "PassRefPtr<DOMStringList>" if $type eq "DOMStringList" or $type eq "DOMString[]"; - - return GetNativeType($type); -} - -sub GetSVGPropertyTypes -{ - my $implType = shift; - - my $svgPropertyType; - my $svgListPropertyType; - my $svgNativeType; - - return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $implType =~ /SVG/; - - $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($implType); - return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $svgNativeType; - - # Append space to avoid compilation errors when using PassRefPtr<$svgNativeType> - $svgNativeType = "$svgNativeType "; - - my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implType); - if ($svgNativeType =~ /SVGPropertyTearOff/) { - $svgPropertyType = $svgWrappedNativeType; - $headerIncludes{"$svgWrappedNativeType.h"} = 1; - $headerIncludes{"SVGAnimatedPropertyTearOff.h"} = 1; - } elsif ($svgNativeType =~ /SVGListPropertyTearOff/ or $svgNativeType =~ /SVGStaticListPropertyTearOff/) { - $svgListPropertyType = $svgWrappedNativeType; - $headerIncludes{"$svgWrappedNativeType.h"} = 1; - $headerIncludes{"SVGAnimatedListPropertyTearOff.h"} = 1; - } elsif ($svgNativeType =~ /SVGTransformListPropertyTearOff/) { - $svgListPropertyType = $svgWrappedNativeType; - $headerIncludes{"$svgWrappedNativeType.h"} = 1; - $headerIncludes{"SVGAnimatedListPropertyTearOff.h"} = 1; - $headerIncludes{"SVGTransformListPropertyTearOff.h"} = 1; - } elsif ($svgNativeType =~ /SVGPathSegListPropertyTearOff/) { - $svgListPropertyType = $svgWrappedNativeType; - $headerIncludes{"$svgWrappedNativeType.h"} = 1; - $headerIncludes{"SVGAnimatedListPropertyTearOff.h"} = 1; - $headerIncludes{"SVGPathSegListPropertyTearOff.h"} = 1; - } - - return ($svgPropertyType, $svgListPropertyType, $svgNativeType); -} - -sub IsNativeType -{ - my $type = shift; - return exists $nativeType{$type}; -} - -sub JSValueToNative -{ - my $signature = shift; - my $value = shift; - - my $conditional = $signature->extendedAttributes->{"Conditional"}; - my $type = $signature->type; - - return "$value.toBoolean(exec)" if $type eq "boolean"; - return "$value.toNumber(exec)" if $type eq "double"; - return "$value.toFloat(exec)" if $type eq "float"; - return "$value.toInt32(exec)" if $type eq "long" or $type eq "short"; - return "$value.toUInt32(exec)" if $type eq "unsigned long" or $type eq "unsigned short"; - return "static_cast<$type>($value.toInteger(exec))" if $type eq "long long" or $type eq "unsigned long long"; - - return "valueToDate(exec, $value)" if $type eq "Date"; - return "static_cast<Range::CompareHow>($value.toInt32(exec))" if $type eq "CompareHow"; - - if ($type eq "DOMString") { - # FIXME: This implements [TreatNullAs=NullString] and [TreatUndefinedAs=NullString], - # but the Web IDL spec requires [TreatNullAs=EmptyString] and [TreatUndefinedAs=EmptyString]. - if (($signature->extendedAttributes->{"TreatNullAs"} and $signature->extendedAttributes->{"TreatNullAs"} eq "NullString") and ($signature->extendedAttributes->{"TreatUndefinedAs"} and $signature->extendedAttributes->{"TreatUndefinedAs"} eq "NullString")) { - return "valueToStringWithUndefinedOrNullCheck(exec, $value)" - } - if (($signature->extendedAttributes->{"TreatNullAs"} and $signature->extendedAttributes->{"TreatNullAs"} eq "NullString") or $signature->extendedAttributes->{"Reflect"}) { - return "valueToStringWithNullCheck(exec, $value)" - } - # FIXME: Add the case for 'if ($signature->extendedAttributes->{"TreatUndefinedAs"} and $signature->extendedAttributes->{"TreatUndefinedAs"} eq "NullString"))'. - return "$value.isEmpty() ? String() : $value.toString(exec)->value(exec)"; - } - - if ($type eq "DOMObject" or $type eq "any") { - return "exec->globalData(), $value"; - } - - if ($type eq "NodeFilter") { - AddToImplIncludes("JS$type.h", $conditional); - return "to$type(exec->globalData(), $value)"; - } - - if ($type eq "MediaQueryListListener") { - AddToImplIncludes("MediaQueryListListener.h", $conditional); - return "MediaQueryListListener::create(ScriptValue(exec->globalData(), " . $value ."))"; - } - - if ($type eq "SerializedScriptValue") { - AddToImplIncludes("SerializedScriptValue.h", $conditional); - return "SerializedScriptValue::create(exec, $value, 0, 0)"; - } - - if ($type eq "IDBKey") { - AddToImplIncludes("IDBBindingUtilities.h", $conditional); - AddToImplIncludes("IDBKey.h", $conditional); - return "createIDBKeyFromValue(exec, $value)"; - } - - if ($type eq "Dictionary") { - AddToImplIncludes("Dictionary.h", $conditional); - return "exec, $value"; - } - - if ($type eq "DOMString[]" or $type eq "DOMStringList" ) { - AddToImplIncludes("JSDOMStringList.h", $conditional); - return "toDOMStringList(exec, $value)"; - } - - AddToImplIncludes("HTMLOptionElement.h", $conditional) if $type eq "HTMLOptionElement"; - AddToImplIncludes("Event.h", $conditional) if $type eq "Event"; - - my $arrayType = $codeGenerator->GetArrayType($type); - my $sequenceType = $codeGenerator->GetSequenceType($type); - my $arrayOrSequenceType = $arrayType || $sequenceType; - - if ($arrayOrSequenceType) { - if ($codeGenerator->IsRefPtrType($arrayOrSequenceType)) { - AddToImplIncludes("JS${arrayOrSequenceType}.h"); - return "(toRefPtrNativeArray<${arrayOrSequenceType}, JS${arrayOrSequenceType}>(exec, $value, &to${arrayOrSequenceType}))"; - } - return "toNativeArray<" . GetNativeVectorInnerType($arrayOrSequenceType) . ">(exec, $value)"; - } - - # Default, assume autogenerated type conversion routines - AddToImplIncludes("JS$type.h", $conditional); - return "to$type($value)"; -} - -sub NativeToJSValue -{ - my $signature = shift; - my $inFunctionCall = shift; - my $interfaceName = shift; - my $value = shift; - my $thisValue = shift; - - my $conditional = $signature->extendedAttributes->{"Conditional"}; - my $type = $signature->type; - - return "jsBoolean($value)" if $type eq "boolean"; - - # Need to check Date type before IsPrimitiveType(). - if ($type eq "Date") { - return "jsDateOrNull(exec, $value)"; - } - - if ($signature->extendedAttributes->{"Reflect"} and ($type eq "unsigned long" or $type eq "unsigned short")) { - $value =~ s/getUnsignedIntegralAttribute/getIntegralAttribute/g; - return "jsNumber(std::max(0, " . $value . "))"; - } - - if ($codeGenerator->IsPrimitiveType($type) or $type eq "DOMTimeStamp") { - return "jsNumber($value)"; - } - - if ($codeGenerator->IsStringType($type)) { - AddToImplIncludes("KURL.h", $conditional); - my $conv = $signature->extendedAttributes->{"TreatReturnedNullStringAs"}; - if (defined $conv) { - return "jsStringOrNull(exec, $value)" if $conv eq "Null"; - return "jsStringOrUndefined(exec, $value)" if $conv eq "Undefined"; - - die "Unknown value for TreatReturnedNullStringAs extended attribute"; - } - AddToImplIncludes("<runtime/JSString.h>", $conditional); - return "jsStringWithCache(exec, $value)"; - } - - my $globalObject; - if ($thisValue) { - $globalObject = "$thisValue->globalObject()"; - } - - if ($type eq "CSSStyleDeclaration") { - AddToImplIncludes("StylePropertySet.h", $conditional); - } - - if ($type eq "NodeList") { - AddToImplIncludes("NameNodeList.h", $conditional); - } - - my $arrayType = $codeGenerator->GetArrayType($type); - my $sequenceType = $codeGenerator->GetSequenceType($type); - my $arrayOrSequenceType = $arrayType || $sequenceType; - - if ($arrayOrSequenceType) { - if ($arrayType eq "DOMString") { - AddToImplIncludes("JSDOMStringList.h", $conditional); - AddToImplIncludes("DOMStringList.h", $conditional); - - } elsif ($codeGenerator->IsRefPtrType($arrayOrSequenceType)) { - AddToImplIncludes("JS${arrayOrSequenceType}.h", $conditional); - AddToImplIncludes("${arrayOrSequenceType}.h", $conditional); - } - AddToImplIncludes("<runtime/JSArray.h>", $conditional); - return "jsArray(exec, $thisValue->globalObject(), $value)"; - } - - if ($type eq "DOMObject" or $type eq "any") { - if ($interfaceName eq "Document") { - AddToImplIncludes("JSCanvasRenderingContext2D.h", $conditional); - } else { - return "($value.hasNoValue() ? jsNull() : $value.jsValue())"; - } - } elsif ($type =~ /SVGPathSeg/) { - AddToImplIncludes("JS$type.h", $conditional); - my $joinedName = $type; - $joinedName =~ s/Abs|Rel//; - AddToImplIncludes("$joinedName.h", $conditional); - } elsif ($type eq "SerializedScriptValue" or $type eq "any") { - AddToImplIncludes("SerializedScriptValue.h", $conditional); - return "$value ? $value->deserialize(exec, castedThis->globalObject(), 0) : jsNull()"; - } elsif ($type eq "MessagePortArray") { - AddToImplIncludes("MessagePort.h", $conditional); - AddToImplIncludes("JSMessagePort.h", $conditional); - AddToImplIncludes("<runtime/JSArray.h>", $conditional); - return "jsArray(exec, $globalObject, *$value)"; - } else { - # Default, include header with same name. - AddToImplIncludes("JS$type.h", $conditional); - if ($codeGenerator->IsTypedArrayType($type)) { - AddToImplIncludes("<wtf/$type.h>", $conditional) if not $codeGenerator->SkipIncludeHeader($type); - } else { - AddToImplIncludes("$type.h", $conditional) if not $codeGenerator->SkipIncludeHeader($type); - } - } - - return $value if $codeGenerator->IsSVGAnimatedType($type); - - if ($signature->extendedAttributes->{"ReturnNewObject"}) { - return "toJSNewlyCreated(exec, $globalObject, WTF::getPtr($value))"; - } - - if ($codeGenerator->IsSVGAnimatedType($interfaceName) or $interfaceName eq "SVGViewSpec") { - # Convert from abstract SVGProperty to real type, so the right toJS() method can be invoked. - $value = "static_cast<" . GetNativeType($type) . ">($value)"; - } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($type) and not $interfaceName =~ /List$/) { - my $tearOffType = $codeGenerator->GetSVGTypeNeedingTearOff($type); - if ($codeGenerator->IsSVGTypeWithWritablePropertiesNeedingTearOff($type) and $inFunctionCall eq 0 and not defined $signature->extendedAttributes->{"Immutable"}) { - my $getter = $value; - $getter =~ s/impl\.//; - $getter =~ s/impl->//; - $getter =~ s/\(\)//; - my $updateMethod = "&${interfaceName}::update" . $codeGenerator->WK_ucfirst($getter); - - my $selfIsTearOffType = $codeGenerator->IsSVGTypeNeedingTearOff($interfaceName); - if ($selfIsTearOffType) { - AddToImplIncludes("SVGStaticPropertyWithParentTearOff.h", $conditional); - $tearOffType =~ s/SVGPropertyTearOff</SVGStaticPropertyWithParentTearOff<$interfaceName, /; - - if ($value =~ /matrix/ and $interfaceName eq "SVGTransform") { - # SVGTransform offers a matrix() method for internal usage that returns an AffineTransform - # and a svgMatrix() method returning a SVGMatrix, used for the bindings. - $value =~ s/matrix/svgMatrix/; - } - - $value = "${tearOffType}::create(castedThis->impl(), $value, $updateMethod)"; - } else { - AddToImplIncludes("SVGStaticPropertyTearOff.h", $conditional); - $tearOffType =~ s/SVGPropertyTearOff</SVGStaticPropertyTearOff<$interfaceName, /; - $value = "${tearOffType}::create(impl, $value, $updateMethod)"; - } - } elsif ($tearOffType =~ /SVGStaticListPropertyTearOff/) { - $value = "${tearOffType}::create(impl, $value)"; - } elsif (not $tearOffType =~ /SVG(Point|PathSeg)List/) { - $value = "${tearOffType}::create($value)"; - } - } - if ($globalObject) { - return "toJS(exec, $globalObject, WTF::getPtr($value))"; - } else { - return "toJS(exec, jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), WTF::getPtr($value))"; - } -} - -sub ceilingToPowerOf2 -{ - my ($size) = @_; - - my $powerOf2 = 1; - while ($size > $powerOf2) { - $powerOf2 <<= 1; - } - - return $powerOf2; -} - -# Internal Helper -sub GenerateHashTable -{ - my $object = shift; - - my $name = shift; - my $size = shift; - my $keys = shift; - my $specials = shift; - my $value1 = shift; - my $value2 = shift; - my $conditionals = shift; - - # Generate size data for compact' size hash table - - my @table = (); - my @links = (); - - my $compactSize = ceilingToPowerOf2($size * 2); - - my $maxDepth = 0; - my $collisions = 0; - my $numEntries = $compactSize; - - my $i = 0; - foreach (@{$keys}) { - my $depth = 0; - my $h = $object->GenerateHashValue($_) % $numEntries; - - while (defined($table[$h])) { - if (defined($links[$h])) { - $h = $links[$h]; - $depth++; - } else { - $collisions++; - $links[$h] = $compactSize; - $h = $compactSize; - $compactSize++; - } - } - - $table[$h] = $i; - - $i++; - $maxDepth = $depth if ($depth > $maxDepth); - } - - # Start outputing the hashtables - my $nameEntries = "${name}Values"; - $nameEntries =~ s/:/_/g; - - if (($name =~ /Prototype/) or ($name =~ /Constructor/)) { - my $type = $name; - my $implClass; - - if ($name =~ /Prototype/) { - $type =~ s/Prototype.*//; - $implClass = $type; $implClass =~ s/Wrapper$//; - push(@implContent, "/* Hash table for prototype */\n"); - } else { - $type =~ s/Constructor.*//; - $implClass = $type; $implClass =~ s/Constructor$//; - push(@implContent, "/* Hash table for constructor */\n"); - } - } else { - push(@implContent, "/* Hash table */\n"); - } - - # Dump the hash table - push(@implContent, "\nstatic const HashTableValue $nameEntries\[\] =\n\{\n"); - $i = 0; - foreach my $key (@{$keys}) { - my $conditional; - my $targetType; - - if ($conditionals) { - $conditional = $conditionals->{$key}; - } - if ($conditional) { - my $conditionalString = $codeGenerator->GenerateConditionalStringFromAttributeValue($conditional); - push(@implContent, "#if ${conditionalString}\n"); - } - - if ("@$specials[$i]" =~ m/Function/) { - $targetType = "static_cast<NativeFunction>"; - } else { - $targetType = "static_cast<PropertySlot::GetValueFunc>"; - } - push(@implContent, " { \"$key\", @$specials[$i], (intptr_t)" . $targetType . "(@$value1[$i]), (intptr_t)@$value2[$i], NoIntrinsic },\n"); - push(@implContent, "#endif\n") if $conditional; - ++$i; - } - push(@implContent, " { 0, 0, 0, 0, NoIntrinsic }\n"); - push(@implContent, "};\n\n"); - my $compactSizeMask = $numEntries - 1; - push(@implContent, "static const HashTable $name = { $compactSize, $compactSizeMask, $nameEntries, 0 };\n"); -} - -# Paul Hsieh's SuperFastHash -# http://www.azillionmonkeys.com/qed/hash.html -sub GenerateHashValue -{ - my $object = shift; - - my @chars = split(/ */, $_[0]); - - # This hash is designed to work on 16-bit chunks at a time. But since the normal case - # (above) is to hash UTF-16 characters, we just treat the 8-bit chars as if they - # were 16-bit chunks, which should give matching results - - my $EXP2_32 = 4294967296; - - my $hash = 0x9e3779b9; - my $l = scalar @chars; #I wish this was in Ruby --- Maks - my $rem = $l & 1; - $l = $l >> 1; - - my $s = 0; - - # Main loop - for (; $l > 0; $l--) { - $hash += ord($chars[$s]); - my $tmp = leftShift(ord($chars[$s+1]), 11) ^ $hash; - $hash = (leftShift($hash, 16)% $EXP2_32) ^ $tmp; - $s += 2; - $hash += $hash >> 11; - $hash %= $EXP2_32; - } - - # Handle end case - if ($rem != 0) { - $hash += ord($chars[$s]); - $hash ^= (leftShift($hash, 11)% $EXP2_32); - $hash += $hash >> 17; - } - - # Force "avalanching" of final 127 bits - $hash ^= leftShift($hash, 3); - $hash += ($hash >> 5); - $hash = ($hash% $EXP2_32); - $hash ^= (leftShift($hash, 2)% $EXP2_32); - $hash += ($hash >> 15); - $hash = $hash% $EXP2_32; - $hash ^= (leftShift($hash, 10)% $EXP2_32); - - # Save 8 bits for StringImpl to use as flags. - $hash &= 0xffffff; - - # This avoids ever returning a hash code of 0, since that is used to - # signal "hash not computed yet". Setting the high bit maintains - # reasonable fidelity to a hash code of 0 because it is likely to yield - # exactly 0 when hash lookup masks out the high bits. - $hash = (0x80000000 >> 8) if ($hash == 0); - - return $hash; -} - -sub WriteData -{ - my $object = shift; - my $interface = shift; - my $outputDir = shift; - - my $name = $interface->name; - my $prefix = FileNamePrefix; - my $headerFileName = "$outputDir/$prefix$name.h"; - my $implFileName = "$outputDir/$prefix$name.cpp"; - my $depsFileName = "$outputDir/$prefix$name.dep"; - - # Update a .cpp file if the contents are changed. - my $contents = join "", @implContentHeader; - - my @includes = (); - my %implIncludeConditions = (); - foreach my $include (keys %implIncludes) { - my $condition = $implIncludes{$include}; - my $checkType = $include; - $checkType =~ s/\.h//; - next if $codeGenerator->IsSVGAnimatedType($checkType); - - $include = "\"$include\"" unless $include =~ /^["<]/; # " - - if ($condition eq 1) { - push @includes, $include; - } else { - push @{$implIncludeConditions{$condition}}, $include; - } - } - foreach my $include (sort @includes) { - $contents .= "#include $include\n"; - } - foreach my $condition (sort keys %implIncludeConditions) { - $contents .= "\n#if " . $codeGenerator->GenerateConditionalStringFromAttributeValue($condition) . "\n"; - foreach my $include (sort @{$implIncludeConditions{$condition}}) { - $contents .= "#include $include\n"; - } - $contents .= "#endif\n"; - } - - $contents .= join "", @implContent; - $codeGenerator->UpdateFile($implFileName, $contents); - - @implContentHeader = (); - @implContent = (); - %implIncludes = (); - - # Update a .h file if the contents are changed. - $contents = join "", @headerContentHeader; - - @includes = (); - foreach my $include (keys %headerIncludes) { - $include = "\"$include\"" unless $include =~ /^["<]/; # " - push @includes, $include; - } - foreach my $include (sort @includes) { - $contents .= "#include $include\n"; - } - - $contents .= join "", @headerContent; - - @includes = (); - foreach my $include (keys %headerTrailingIncludes) { - $include = "\"$include\"" unless $include =~ /^["<]/; # " - push @includes, $include; - } - foreach my $include (sort @includes) { - $contents .= "#include $include\n"; - } - $codeGenerator->UpdateFile($headerFileName, $contents); - - @headerContentHeader = (); - @headerContent = (); - %headerIncludes = (); - %headerTrailingIncludes = (); - - if (@depsContent) { - # Update a .dep file if the contents are changed. - $contents = join "", @depsContent; - $codeGenerator->UpdateFile($depsFileName, $contents); - - @depsContent = (); - } -} - -sub GenerateConstructorDeclaration -{ - my $outputArray = shift; - my $className = shift; - my $interface = shift; - my $interfaceName = shift; - - my $constructorClassName = "${className}Constructor"; - - push(@$outputArray, "class ${constructorClassName} : public DOMConstructorObject {\n"); - push(@$outputArray, "private:\n"); - push(@$outputArray, " ${constructorClassName}(JSC::Structure*, JSDOMGlobalObject*);\n"); - push(@$outputArray, " void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);\n\n"); - - push(@$outputArray, "public:\n"); - push(@$outputArray, " typedef DOMConstructorObject Base;\n"); - push(@$outputArray, " static $constructorClassName* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)\n"); - push(@$outputArray, " {\n"); - push(@$outputArray, " $constructorClassName* ptr = new (NotNull, JSC::allocateCell<$constructorClassName>(*exec->heap())) $constructorClassName(structure, globalObject);\n"); - push(@$outputArray, " ptr->finishCreation(exec, globalObject);\n"); - push(@$outputArray, " return ptr;\n"); - push(@$outputArray, " }\n\n"); - - push(@$outputArray, " static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n"); - push(@$outputArray, " static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&);\n"); - push(@$outputArray, " static const JSC::ClassInfo s_info;\n"); - - push(@$outputArray, " static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)\n"); - push(@$outputArray, " {\n"); - push(@$outputArray, " return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);\n"); - push(@$outputArray, " }\n"); - - push(@$outputArray, "protected:\n"); - push(@$outputArray, " static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;\n"); - - if (IsConstructable($interface) && !$interface->extendedAttributes->{"NamedConstructor"}) { - push(@$outputArray, " static JSC::EncodedJSValue JSC_HOST_CALL construct${className}(JSC::ExecState*);\n"); - - if (!HasCustomConstructor($interface)) { - my @constructors = @{$interface->constructors}; - if (@constructors > 1) { - foreach my $constructor (@constructors) { - my $overloadedIndex = "" . $constructor->{overloadedIndex}; - push(@$outputArray, " static JSC::EncodedJSValue JSC_HOST_CALL construct${className}${overloadedIndex}(JSC::ExecState*);\n"); - } - } - } - - push(@$outputArray, " static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);\n"); - } - push(@$outputArray, "};\n\n"); - - if ($codeGenerator->IsConstructorTemplate($interface, "Event")) { - push(@$outputArray, "bool fill${interfaceName}Init(${interfaceName}Init&, JSDictionary&);\n\n"); - } - - if ($interface->extendedAttributes->{"NamedConstructor"}) { - push(@$outputArray, <<END); -class JS${interfaceName}NamedConstructor : public DOMConstructorWithDocument { -public: - typedef DOMConstructorWithDocument Base; - - static JS${interfaceName}NamedConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject) - { - JS${interfaceName}NamedConstructor* constructor = new (NotNull, JSC::allocateCell<JS${interfaceName}NamedConstructor>(*exec->heap())) JS${interfaceName}NamedConstructor(structure, globalObject); - constructor->finishCreation(exec, globalObject); - return constructor; - } - - static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) - { - return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info); - } - - static const JSC::ClassInfo s_info; - -private: - JS${interfaceName}NamedConstructor(JSC::Structure*, JSDOMGlobalObject*); - static JSC::EncodedJSValue JSC_HOST_CALL constructJS${interfaceName}(JSC::ExecState*); - static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&); - void finishCreation(JSC::ExecState*, JSDOMGlobalObject*); -}; - -END - } -} - -sub GenerateConstructorDefinitions -{ - my $outputArray = shift; - my $className = shift; - my $protoClassName = shift; - my $interfaceName = shift; - my $visibleInterfaceName = shift; - my $interface = shift; - my $generatingNamedConstructor = shift; - - if (IsConstructable($interface)) { - my @constructors = @{$interface->constructors}; - if (@constructors > 1) { - foreach my $constructor (@constructors) { - GenerateConstructorDefinition($outputArray, $className, $protoClassName, $interfaceName, $visibleInterfaceName, $interface, $generatingNamedConstructor, $constructor); - } - GenerateOverloadedConstructorDefinition($outputArray, $className, $interface); - } elsif (@constructors == 1) { - GenerateConstructorDefinition($outputArray, $className, $protoClassName, $interfaceName, $visibleInterfaceName, $interface, $generatingNamedConstructor, $constructors[0]); - } else { - GenerateConstructorDefinition($outputArray, $className, $protoClassName, $interfaceName, $visibleInterfaceName, $interface, $generatingNamedConstructor); - } - } - - GenerateConstructorHelperMethods($outputArray, $className, $protoClassName, $interfaceName, $visibleInterfaceName, $interface, $generatingNamedConstructor); -} - -sub GenerateOverloadedConstructorDefinition -{ - my $outputArray = shift; - my $className = shift; - my $interface = shift; - - my $functionName = "${className}Constructor::construct${className}"; - push(@$outputArray, <<END); -EncodedJSValue JSC_HOST_CALL ${functionName}(ExecState* exec) -{ - size_t argsCount = exec->argumentCount(); -END - - my %fetchedArguments = (); - my $leastNumMandatoryParams = 255; - - my @constructors = @{$interface->constructors}; - foreach my $overload (@constructors) { - my ($numMandatoryParams, $parametersCheck, @neededArguments) = GenerateFunctionParametersCheck($overload); - $leastNumMandatoryParams = $numMandatoryParams if ($numMandatoryParams < $leastNumMandatoryParams); - - foreach my $parameterIndex (@neededArguments) { - next if exists $fetchedArguments{$parameterIndex}; - push(@$outputArray, " JSValue arg$parameterIndex(exec->argument($parameterIndex));\n"); - $fetchedArguments{$parameterIndex} = 1; - } - - push(@$outputArray, " if ($parametersCheck)\n"); - push(@$outputArray, " return ${functionName}$overload->{overloadedIndex}(exec);\n"); - } - - if ($leastNumMandatoryParams >= 1) { - push(@$outputArray, " if (argsCount < $leastNumMandatoryParams)\n"); - push(@$outputArray, " return throwVMError(exec, createNotEnoughArgumentsError(exec));\n"); - } - push(@$outputArray, <<END); - return throwVMTypeError(exec); -} - -END -} - -sub GenerateConstructorDefinition -{ - my $outputArray = shift; - my $className = shift; - my $protoClassName = shift; - my $interfaceName = shift; - my $visibleInterfaceName = shift; - my $interface = shift; - my $generatingNamedConstructor = shift; - my $function = shift; - - my $constructorClassName = $generatingNamedConstructor ? "${className}NamedConstructor" : "${className}Constructor"; - - if (IsConstructable($interface)) { - if ($codeGenerator->IsConstructorTemplate($interface, "Event")) { - $implIncludes{"JSDictionary.h"} = 1; - $implIncludes{"<runtime/Error.h>"} = 1; - - push(@$outputArray, <<END); -EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct${className}(ExecState* exec) -{ - ${constructorClassName}* jsConstructor = jsCast<${constructorClassName}*>(exec->callee()); - - ScriptExecutionContext* executionContext = jsConstructor->scriptExecutionContext(); - if (!executionContext) - return throwVMError(exec, createReferenceError(exec, "Constructor associated execution context is unavailable")); - - AtomicString eventType = exec->argument(0).toString(exec)->value(exec); - if (exec->hadException()) - return JSValue::encode(jsUndefined()); - - ${interfaceName}Init eventInit; - - JSValue initializerValue = exec->argument(1); - if (!initializerValue.isUndefinedOrNull()) { - // Given the above test, this will always yield an object. - JSObject* initializerObject = initializerValue.toObject(exec); - - // Create the dictionary wrapper from the initializer object. - JSDictionary dictionary(exec, initializerObject); - - // Attempt to fill in the EventInit. - if (!fill${interfaceName}Init(eventInit, dictionary)) - return JSValue::encode(jsUndefined()); - } - - RefPtr<${interfaceName}> event = ${interfaceName}::create(eventType, eventInit); - return JSValue::encode(toJS(exec, jsConstructor->globalObject(), event.get())); -} - -bool fill${interfaceName}Init(${interfaceName}Init& eventInit, JSDictionary& dictionary) -{ -END - - foreach my $interfaceBase (@{$interface->parents}) { - push(@implContent, <<END); - if (!fill${interfaceBase}Init(eventInit, dictionary)) - return false; - -END - } - - for (my $index = 0; $index < @{$interface->attributes}; $index++) { - my $attribute = @{$interface->attributes}[$index]; - if ($attribute->signature->extendedAttributes->{"InitializedByEventConstructor"}) { - my $attributeName = $attribute->signature->name; - push(@implContent, <<END); - if (!dictionary.tryGetProperty("${attributeName}", eventInit.${attributeName})) - return false; -END - } - } - - push(@$outputArray, <<END); - return true; -} - -END - } elsif ($codeGenerator->IsConstructorTemplate($interface, "TypedArray")) { - $implIncludes{"JSArrayBufferViewHelper.h"} = 1; - my $viewType = $interface->extendedAttributes->{"TypedArray"}; - push(@$outputArray, "EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct${className}(ExecState* exec)\n"); - push(@$outputArray, "{\n"); - push(@$outputArray, " ${constructorClassName}* jsConstructor = jsCast<${constructorClassName}*>(exec->callee());\n"); - push(@$outputArray, " RefPtr<$interfaceName> array = constructArrayBufferView<$interfaceName, $viewType>(exec);\n"); - push(@$outputArray, " if (!array.get())\n"); - push(@$outputArray, " // Exception has already been thrown.\n"); - push(@$outputArray, " return JSValue::encode(JSValue());\n"); - push(@$outputArray, " return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), array.get())));\n"); - push(@$outputArray, "}\n\n"); - - push(@$outputArray, "JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, ${interfaceName}* object)\n"); - push(@$outputArray, "{\n"); - push(@$outputArray, " return toJSArrayBufferView<${className}>(exec, globalObject, object);\n"); - push(@$outputArray, "}\n\n"); - - if ($interface->extendedAttributes->{"CustomIndexedSetter"}) { - push(@$outputArray, "void ${className}::indexSetter(JSC::ExecState* exec, unsigned index, JSC::JSValue value)\n"); - push(@$outputArray, "{\n"); - push(@$outputArray, " impl()->set(index, value.toNumber(exec));\n"); - push(@$outputArray, "}\n\n"); - } - } elsif (!HasCustomConstructor($interface) && (!$interface->extendedAttributes->{"NamedConstructor"} || $generatingNamedConstructor)) { - my $overloadedIndexString = ""; - if ($function->{overloadedIndex} && $function->{overloadedIndex} > 0) { - $overloadedIndexString .= $function->{overloadedIndex}; - } - - push(@$outputArray, "EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct${className}${overloadedIndexString}(ExecState* exec)\n"); - push(@$outputArray, "{\n"); - push(@$outputArray, " ${constructorClassName}* castedThis = jsCast<${constructorClassName}*>(exec->callee());\n"); - - my @constructorArgList; - - $implIncludes{"<runtime/Error.h>"} = 1; - - GenerateArgumentsCountCheck($outputArray, $function, $interface); - - if (@{$function->raisesExceptions} || $interface->extendedAttributes->{"ConstructorRaisesException"}) { - $implIncludes{"ExceptionCode.h"} = 1; - push(@$outputArray, " ExceptionCode ec = 0;\n"); - } - - # FIXME: For now, we do not support SVG constructors. - # FIXME: Currently [Constructor(...)] does not yet support [Optional] arguments. - # It just supports [Optional=DefaultIsUndefined] or [Optional=DefaultIsNullString]. - my $numParameters = @{$function->parameters}; - my ($dummy, $paramIndex) = GenerateParametersCheck($outputArray, $function, $interface, $numParameters, $interfaceName, "constructorCallback", undef, undef, undef); - - if ($codeGenerator->ExtendedAttributeContains($interface->extendedAttributes->{"CallWith"}, "ScriptExecutionContext")) { - push(@constructorArgList, "context"); - push(@$outputArray, " ScriptExecutionContext* context = castedThis->scriptExecutionContext();\n"); - push(@$outputArray, " if (!context)\n"); - push(@$outputArray, " return throwVMError(exec, createReferenceError(exec, \"${interfaceName} constructor associated document is unavailable\"));\n"); - } - if ($generatingNamedConstructor) { - push(@constructorArgList, "castedThis->document()"); - } - - my $index = 0; - foreach my $parameter (@{$function->parameters}) { - last if $index eq $paramIndex; - push(@constructorArgList, $parameter->name); - $index++; - } - - if ($interface->extendedAttributes->{"ConstructorRaisesException"}) { - push(@constructorArgList, "ec"); - } - my $constructorArg = join(", ", @constructorArgList); - if ($generatingNamedConstructor) { - push(@$outputArray, " RefPtr<${interfaceName}> object = ${interfaceName}::createForJSConstructor(${constructorArg});\n"); - } else { - push(@$outputArray, " RefPtr<${interfaceName}> object = ${interfaceName}::create(${constructorArg});\n"); - } - - if ($interface->extendedAttributes->{"ConstructorRaisesException"}) { - push(@$outputArray, " if (ec) {\n"); - push(@$outputArray, " setDOMException(exec, ec);\n"); - push(@$outputArray, " return JSValue::encode(JSValue());\n"); - push(@$outputArray, " }\n"); - } - - push(@$outputArray, " return JSValue::encode(asObject(toJS(exec, castedThis->globalObject(), object.get())));\n"); - push(@$outputArray, "}\n\n"); - } - } -} - -sub GenerateConstructorHelperMethods -{ - my $outputArray = shift; - my $className = shift; - my $protoClassName = shift; - my $interfaceName = shift; - my $visibleInterfaceName = shift; - my $interface = shift; - my $generatingNamedConstructor = shift; - - my $constructorClassName = $generatingNamedConstructor ? "${className}NamedConstructor" : "${className}Constructor"; - my $numberOfConstructorParameters = $interface->extendedAttributes->{"ConstructorParameters"}; - if (!defined $numberOfConstructorParameters) { - if ($codeGenerator->IsConstructorTemplate($interface, "Event")) { - $numberOfConstructorParameters = 2; - } elsif ($interface->extendedAttributes->{"Constructor"}) { - my @constructors = @{$interface->constructors}; - $numberOfConstructorParameters = 255; - foreach my $constructor (@constructors) { - my $currNumberOfParameters = @{$constructor->parameters}; - if ($currNumberOfParameters < $numberOfConstructorParameters) { - $numberOfConstructorParameters = $currNumberOfParameters; - } - } - } - } - - if ($generatingNamedConstructor) { - push(@$outputArray, "const ClassInfo ${constructorClassName}::s_info = { \"${visibleInterfaceName}Constructor\", &Base::s_info, 0, 0, CREATE_METHOD_TABLE($constructorClassName) };\n\n"); - push(@$outputArray, "${constructorClassName}::${constructorClassName}(Structure* structure, JSDOMGlobalObject* globalObject)\n"); - push(@$outputArray, " : DOMConstructorWithDocument(structure, globalObject)\n"); - push(@$outputArray, "{\n"); - push(@$outputArray, "}\n\n"); - } else { - if ($interface->extendedAttributes->{"JSNoStaticTables"}) { - push(@$outputArray, "static const HashTable* get${constructorClassName}Table(ExecState* exec)\n"); - push(@$outputArray, "{\n"); - push(@$outputArray, " return getHashTableForGlobalData(exec->globalData(), &${constructorClassName}Table);\n"); - push(@$outputArray, "}\n\n"); - push(@$outputArray, "const ClassInfo ${constructorClassName}::s_info = { \"${visibleInterfaceName}Constructor\", &Base::s_info, 0, get${constructorClassName}Table, CREATE_METHOD_TABLE($constructorClassName) };\n\n"); - } else { - push(@$outputArray, "const ClassInfo ${constructorClassName}::s_info = { \"${visibleInterfaceName}Constructor\", &Base::s_info, &${constructorClassName}Table, 0, CREATE_METHOD_TABLE($constructorClassName) };\n\n"); - } - - push(@$outputArray, "${constructorClassName}::${constructorClassName}(Structure* structure, JSDOMGlobalObject* globalObject)\n"); - push(@$outputArray, " : DOMConstructorObject(structure, globalObject)\n"); - push(@$outputArray, "{\n}\n\n"); - } - - push(@$outputArray, "void ${constructorClassName}::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)\n"); - push(@$outputArray, "{\n"); - if ($interfaceName eq "DOMWindow") { - push(@$outputArray, " Base::finishCreation(exec->globalData());\n"); - push(@$outputArray, " ASSERT(inherits(&s_info));\n"); - push(@$outputArray, " putDirect(exec->globalData(), exec->propertyNames().prototype, globalObject->prototype(), DontDelete | ReadOnly);\n"); - } elsif ($generatingNamedConstructor) { - push(@$outputArray, " Base::finishCreation(globalObject);\n"); - push(@$outputArray, " ASSERT(inherits(&s_info));\n"); - push(@$outputArray, " putDirect(exec->globalData(), exec->propertyNames().prototype, ${className}Prototype::self(exec, globalObject), None);\n"); - } else { - push(@$outputArray, " Base::finishCreation(exec->globalData());\n"); - push(@$outputArray, " ASSERT(inherits(&s_info));\n"); - push(@$outputArray, " putDirect(exec->globalData(), exec->propertyNames().prototype, ${protoClassName}::self(exec, globalObject), DontDelete | ReadOnly);\n"); - } - push(@$outputArray, " putDirect(exec->globalData(), exec->propertyNames().length, jsNumber(${numberOfConstructorParameters}), ReadOnly | DontDelete | DontEnum);\n") if defined $numberOfConstructorParameters; - push(@$outputArray, "}\n\n"); - - if (!$generatingNamedConstructor) { - my $hasStaticFunctions = 0; - foreach my $function (@{$interface->functions}) { - if ($function->isStatic) { - $hasStaticFunctions = 1; - last; - } - } - - my $kind = $hasStaticFunctions ? "Property" : "Value"; - - push(@$outputArray, "bool ${constructorClassName}::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)\n"); - push(@$outputArray, "{\n"); - push(@$outputArray, " return getStatic${kind}Slot<${constructorClassName}, JSDOMWrapper>(exec, " . constructorHashTableAccessor($interface->extendedAttributes->{"JSNoStaticTables"}, $constructorClassName) . ", jsCast<${constructorClassName}*>(cell), propertyName, slot);\n"); - push(@$outputArray, "}\n\n"); - - push(@$outputArray, "bool ${constructorClassName}::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)\n"); - push(@$outputArray, "{\n"); - push(@$outputArray, " return getStatic${kind}Descriptor<${constructorClassName}, JSDOMWrapper>(exec, " . constructorHashTableAccessor($interface->extendedAttributes->{"JSNoStaticTables"}, $constructorClassName) . ", jsCast<${constructorClassName}*>(object), propertyName, descriptor);\n"); - push(@$outputArray, "}\n\n"); - } - - if (IsConstructable($interface)) { - if (!$interface->extendedAttributes->{"NamedConstructor"} || $generatingNamedConstructor) { - push(@$outputArray, "ConstructType ${constructorClassName}::getConstructData(JSCell*, ConstructData& constructData)\n"); - push(@$outputArray, "{\n"); - push(@$outputArray, " constructData.native.function = construct${className};\n"); - push(@$outputArray, " return ConstructTypeHost;\n"); - push(@$outputArray, "}\n\n"); - } - } -} - -sub HasCustomConstructor -{ - my $interface = shift; - - return $interface->extendedAttributes->{"CustomConstructor"} || $interface->extendedAttributes->{"JSCustomConstructor"}; -} - -sub IsConstructable -{ - my $interface = shift; - - return HasCustomConstructor($interface) || $interface->extendedAttributes->{"Constructor"} || $interface->extendedAttributes->{"NamedConstructor"} || $interface->extendedAttributes->{"ConstructorTemplate"}; -} - -1; diff --git a/contrib/dom/scripts/CodeGeneratorObjC.pm b/contrib/dom/scripts/CodeGeneratorObjC.pm deleted file mode 100644 index cf0c2c5..0000000 --- a/contrib/dom/scripts/CodeGeneratorObjC.pm +++ /dev/null @@ -1,1820 +0,0 @@ -# -# Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> -# Copyright (C) 2006 Anders Carlsson <andersca@mac.com> -# Copyright (C) 2006, 2007 Samuel Weinig <sam@webkit.org> -# Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> -# Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. -# Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> -# Copyright (C) 2010 Google Inc. -# Copyright (C) Research In Motion Limited 2010. All rights reserved. -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library 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. See the GNU -# Library General Public License for more details. -# -# You should have received a copy of the GNU Library General Public License -# along with this library; see the file COPYING.LIB. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# - -package CodeGeneratorObjC; - -use constant FileNamePrefix => "DOM"; - -# Global Variables -my $writeDependencies = 0; -my %publicInterfaces = (); -my $newPublicClass = 0; -my $interfaceAvailabilityVersion = ""; -my $isProtocol = 0; -my $noImpl = 0; - -my @headerContentHeader = (); -my @headerContent = (); -my %headerForwardDeclarations = (); -my %headerForwardDeclarationsForProtocols = (); - -my @privateHeaderContentHeader = (); -my @privateHeaderContent = (); -my %privateHeaderForwardDeclarations = (); -my %privateHeaderForwardDeclarationsForProtocols = (); - -my @internalHeaderContent = (); - -my @implContentHeader = (); -my @implContent = (); -my %implIncludes = (); -my @depsContent = (); - -# Hashes -my %protocolTypeHash = ("XPathNSResolver" => 1, "EventListener" => 1, "EventTarget" => 1, "NodeFilter" => 1, - "SVGLocatable" => 1, "SVGTransformable" => 1, "SVGStylable" => 1, "SVGFilterPrimitiveStandardAttributes" => 1, - "SVGTests" => 1, "SVGLangSpace" => 1, "SVGExternalResourcesRequired" => 1, "SVGURIReference" => 1, - "SVGZoomAndPan" => 1, "SVGFitToViewBox" => 1, "SVGAnimatedPathData" => 1, "ElementTimeControl" => 1); -my %nativeObjCTypeHash = ("URL" => 1, "Color" => 1); - -# FIXME: this should be replaced with a function that recurses up the tree -# to find the actual base type. -my %baseTypeHash = ("Object" => 1, "Node" => 1, "NodeList" => 1, "NamedNodeMap" => 1, "DOMImplementation" => 1, - "Event" => 1, "CSSRule" => 1, "CSSValue" => 1, "StyleSheet" => 1, "MediaList" => 1, - "Counter" => 1, "Rect" => 1, "RGBColor" => 1, "XPathExpression" => 1, "XPathResult" => 1, - "NodeIterator" => 1, "TreeWalker" => 1, "AbstractView" => 1, "Blob" => 1, - "SVGAngle" => 1, "SVGAnimatedAngle" => 1, "SVGAnimatedBoolean" => 1, "SVGAnimatedEnumeration" => 1, - "SVGAnimatedInteger" => 1, "SVGAnimatedLength" => 1, "SVGAnimatedLengthList" => 1, - "SVGAnimatedNumber" => 1, "SVGAnimatedNumberList" => 1, - "SVGAnimatedPreserveAspectRatio" => 1, "SVGAnimatedRect" => 1, "SVGAnimatedString" => 1, - "SVGAnimatedTransformList" => 1, "SVGLength" => 1, "SVGLengthList" => 1, "SVGMatrix" => 1, - "SVGNumber" => 1, "SVGNumberList" => 1, "SVGPathSeg" => 1, "SVGPathSegList" => 1, "SVGPoint" => 1, - "SVGPointList" => 1, "SVGPreserveAspectRatio" => 1, "SVGRect" => 1, "SVGRenderingIntent" => 1, - "SVGStringList" => 1, "SVGTransform" => 1, "SVGTransformList" => 1, "SVGUnitTypes" => 1); - -# Constants -my $exceptionInit = "WebCore::ExceptionCode ec = 0;"; -my $jsContextSetter = "WebCore::JSMainThreadNullState state;"; -my $exceptionRaiseOnError = "WebCore::raiseOnDOMError(ec);"; -my $assertMainThread = "{ DOM_ASSERT_MAIN_THREAD(); WebCoreThreadViolationCheckRoundOne(); }"; - -my %conflictMethod = ( - # FIXME: Add C language keywords? - # FIXME: Add other predefined types like "id"? - - "callWebScriptMethod:withArguments:" => "WebScriptObject", - "evaluateWebScript:" => "WebScriptObject", - "removeWebScriptKey:" => "WebScriptObject", - "setException:" => "WebScriptObject", - "setWebScriptValueAtIndex:value:" => "WebScriptObject", - "stringRepresentation" => "WebScriptObject", - "webScriptValueAtIndex:" => "WebScriptObject", - - "autorelease" => "NSObject", - "awakeAfterUsingCoder:" => "NSObject", - "class" => "NSObject", - "classForCoder" => "NSObject", - "conformsToProtocol:" => "NSObject", - "copy" => "NSObject", - "copyWithZone:" => "NSObject", - "dealloc" => "NSObject", - "description" => "NSObject", - "doesNotRecognizeSelector:" => "NSObject", - "encodeWithCoder:" => "NSObject", - "finalize" => "NSObject", - "forwardInvocation:" => "NSObject", - "hash" => "NSObject", - "init" => "NSObject", - "initWithCoder:" => "NSObject", - "isEqual:" => "NSObject", - "isKindOfClass:" => "NSObject", - "isMemberOfClass:" => "NSObject", - "isProxy" => "NSObject", - "methodForSelector:" => "NSObject", - "methodSignatureForSelector:" => "NSObject", - "mutableCopy" => "NSObject", - "mutableCopyWithZone:" => "NSObject", - "performSelector:" => "NSObject", - "release" => "NSObject", - "replacementObjectForCoder:" => "NSObject", - "respondsToSelector:" => "NSObject", - "retain" => "NSObject", - "retainCount" => "NSObject", - "self" => "NSObject", - "superclass" => "NSObject", - "zone" => "NSObject", -); - -my $fatalError = 0; - -# Default License Templates -my $headerLicenseTemplate = << "EOF"; -/* - * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2006 Samuel Weinig <sam.weinig\@gmail.com> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -EOF - -my $implementationLicenseTemplate = << "EOF"; -/* - * This file is part of the WebKit open source project. - * This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -EOF - -# Default constructor -sub new -{ - my $object = shift; - my $reference = { }; - - $codeGenerator = shift; - shift; # $useLayerOnTop - shift; # $preprocessor - $writeDependencies = shift; - - bless($reference, $object); - return $reference; -} - -sub ReadPublicInterfaces -{ - my $class = shift; - my $superClass = shift; - my $defines = shift; - my $isProtocol = shift; - - my $found = 0; - my $actualSuperClass; - %publicInterfaces = (); - - my $fileName = "WebCore/bindings/objc/PublicDOMInterfaces.h"; - my $gccLocation = ""; - if ($ENV{CC}) { - $gccLocation = $ENV{CC}; - } elsif (($Config::Config{'osname'}) =~ /solaris/i) { - $gccLocation = "/usr/sfw/bin/gcc"; - } else { - $gccLocation = "/usr/bin/gcc"; - } - open FILE, "-|", $gccLocation, "-E", "-P", "-x", "objective-c", - (map { "-D$_" } split(/ +/, $defines)), "-DOBJC_CODE_GENERATION", $fileName or die "Could not open $fileName"; - my @documentContent = <FILE>; - close FILE; - - foreach $line (@documentContent) { - if (!$isProtocol && $line =~ /^\s*\@interface\s*$class\s*:\s*(\w+)\s*([A-Z0-9_]*)/) { - if ($superClass ne $1) { - warn "Public API change. Superclass for \"$class\" differs ($1 != $superClass)"; - $fatalError = 1; - } - - $interfaceAvailabilityVersion = $2 if defined $2; - $found = 1; - next; - } elsif ($isProtocol && $line =~ /^\s*\@protocol $class\s*<[^>]+>\s*([A-Z0-9_]*)/) { - $interfaceAvailabilityVersion = $1 if defined $1; - $found = 1; - next; - } - - last if $found and $line =~ /^\s?\@end\s?$/; - - if ($found) { - # trim whitspace - $line =~ s/^\s+//; - $line =~ s/\s+$//; - - my $availabilityMacro = ""; - $line =~ s/\s([A-Z0-9_]+)\s*;$/;/; - $availabilityMacro = $1 if defined $1; - - $publicInterfaces{$line} = $availabilityMacro if length $line; - } - } - - # If this class was not found in PublicDOMInterfaces.h then it should be considered as an entirely new public class. - $newPublicClass = !$found; - $interfaceAvailabilityVersion = "WEBKIT_VERSION_LATEST" if $newPublicClass; -} - -sub GenerateInterface -{ - my $object = shift; - my $interface = shift; - my $defines = shift; - - $fatalError = 0; - - my $name = $interface->name; - my $className = GetClassName($name); - my $parentClassName = "DOM" . GetParentImplClassName($interface); - $isProtocol = $interface->extendedAttributes->{ObjCProtocol}; - $noImpl = $interface->extendedAttributes->{ObjCCustomImplementation} || $isProtocol; - - ReadPublicInterfaces($className, $parentClassName, $defines, $isProtocol); - - # Start actual generation.. - $object->GenerateHeader($interface); - $object->GenerateImplementation($interface) unless $noImpl; - - # Check for missing public API - if (keys %publicInterfaces > 0) { - my $missing = join("\n", keys %publicInterfaces); - warn "Public API change. There are missing public properties and/or methods from the \"$className\" class.\n$missing\n"; - $fatalError = 1; - } - - die if $fatalError; -} - -sub GetClassName -{ - my $name = shift; - - # special cases - return "NSString" if $codeGenerator->IsStringType($name) or $name eq "SerializedScriptValue"; - return "NS$name" if IsNativeObjCType($name); - return "BOOL" if $name eq "boolean"; - return "unsigned" if $name eq "unsigned long"; - return "int" if $name eq "long"; - return "NSTimeInterval" if $name eq "Date"; - return "DOMAbstractView" if $name eq "DOMWindow"; - return $name if $codeGenerator->IsPrimitiveType($name) or $name eq "DOMImplementation" or $name eq "DOMTimeStamp"; - - # Default, assume Objective-C type has the same type name as - # idl type prefixed with "DOM". - return "DOM$name"; -} - -sub GetClassHeaderName -{ - my $name = shift; - - return "DOMDOMImplementation" if $name eq "DOMImplementation"; - return $name; -} - -sub GetImplClassName -{ - my $name = shift; - - return "DOMImplementationFront" if $name eq "DOMImplementation"; - return "DOMWindow" if $name eq "AbstractView"; - return $name; -} - -sub GetParentImplClassName -{ - my $interface = shift; - - return "Object" if @{$interface->parents} eq 0; - - my $parent = $interface->parents(0); - - # special cases - return "Object" if $parent eq "HTMLCollection"; - - return $parent; -} - -sub GetParentAndProtocols -{ - my $interface = shift; - my $numParents = @{$interface->parents}; - - my $parent = ""; - my @protocols = (); - if ($numParents eq 0) { - if ($isProtocol) { - push(@protocols, "NSObject"); - push(@protocols, "NSCopying") if $interface->name eq "EventTarget"; - } else { - $parent = "DOMObject"; - } - } elsif ($numParents eq 1) { - my $parentName = $interface->parents(0); - if ($isProtocol) { - die "Parents of protocols must also be protocols." unless IsProtocolType($parentName); - push(@protocols, "DOM" . $parentName); - } else { - if (IsProtocolType($parentName)) { - push(@protocols, "DOM" . $parentName); - } elsif ($parentName eq "HTMLCollection") { - $parent = "DOMObject"; - } else { - $parent = "DOM" . $parentName; - } - } - } else { - my @parents = @{$interface->parents}; - my $firstParent = shift(@parents); - if (IsProtocolType($firstParent)) { - push(@protocols, "DOM" . $firstParent); - if (!$isProtocol) { - $parent = "DOMObject"; - } - } else { - $parent = "DOM" . $firstParent; - } - - foreach my $parentName (@parents) { - die "Everything past the first class should be a protocol!" unless IsProtocolType($parentName); - - push(@protocols, "DOM" . $parentName); - } - } - - return ($parent, @protocols); -} - -sub GetBaseClass -{ - $parent = shift; - - return $parent if $parent eq "Object" or IsBaseType($parent); - return "Event" if $parent eq "UIEvent" or $parent eq "MouseEvent"; - return "CSSValue" if $parent eq "SVGColor" or $parent eq "CSSValueList"; - return "Node"; -} - -sub IsBaseType -{ - my $type = shift; - - return 1 if $baseTypeHash{$type}; - return 0; -} - -sub IsProtocolType -{ - my $type = shift; - - return 1 if $protocolTypeHash{$type}; - return 0; -} - -sub IsNativeObjCType -{ - my $type = shift; - - return 1 if $nativeObjCTypeHash{$type}; - return 0; -} - -sub SkipFunction -{ - my $function = shift; - - return 1 if $codeGenerator->GetSequenceType($function->signature->type); - return 1 if $codeGenerator->GetArrayType($function->signature->type); - - foreach my $param (@{$function->parameters}) { - return 1 if $codeGenerator->GetSequenceType($param->type); - return 1 if $codeGenerator->GetArrayType($param->type); - return 1 if $param->extendedAttributes->{"Clamp"}; - } - - return 0; -} - -sub SkipAttribute -{ - my $attribute = shift; - - $codeGenerator->AssertNotSequenceType($attribute->signature->type); - return 1 if $codeGenerator->GetArrayType($attribute->signature->type); - return 1 if $codeGenerator->IsTypedArrayType($attribute->signature->type); - - # This is for DynamicsCompressorNode.idl - if ($attribute->signature->name eq "release") { - return 1; - } - - return 0; -} - - -sub GetObjCType -{ - my $type = shift; - my $name = GetClassName($type); - - return "id <$name>" if IsProtocolType($type); - return $name if $codeGenerator->IsPrimitiveType($type) or $type eq "DOMTimeStamp"; - return "unsigned short" if $type eq "CompareHow"; - return "$name *"; -} - -sub GetPropertyAttributes -{ - my $type = shift; - my $readOnly = shift; - - my @attributes = (); - - push(@attributes, "readonly") if $readOnly; - - # FIXME: <rdar://problem/5049934> Consider using 'nonatomic' on the DOM @property declarations. - if ($codeGenerator->IsStringType($type) || IsNativeObjCType($type)) { - push(@attributes, "copy"); - } elsif ($codeGenerator->IsSVGAnimatedType($type)) { - push(@attributes, "retain"); - } elsif (!$codeGenerator->IsStringType($type) && !$codeGenerator->IsPrimitiveType($type) && $type ne "DOMTimeStamp" && $type ne "CompareHow") { - push(@attributes, "retain"); - } - - return "" unless @attributes > 0; - return "(" . join(", ", @attributes) . ")"; -} - -sub ConversionNeeded -{ - my $type = shift; - - return !$codeGenerator->IsNonPointerType($type) && !$codeGenerator->IsStringType($type) && !IsNativeObjCType($type); -} - -sub GetObjCTypeGetter -{ - my $argName = shift; - my $type = shift; - - return $argName if $codeGenerator->IsPrimitiveType($type) or $codeGenerator->IsStringType($type) or IsNativeObjCType($type); - return $argName . "Node" if $type eq "EventTarget"; - return "static_cast<WebCore::Range::CompareHow>($argName)" if $type eq "CompareHow"; - return "WTF::getPtr(nativeEventListener)" if $type eq "EventListener"; - return "WTF::getPtr(nativeNodeFilter)" if $type eq "NodeFilter"; - return "WTF::getPtr(nativeResolver)" if $type eq "XPathNSResolver"; - - if ($type eq "SerializedScriptValue") { - $implIncludes{"SerializedScriptValue.h"} = 1; - return "WebCore::SerializedScriptValue::create(WTF::String($argName))"; - } - return "core($argName)"; -} - -sub AddForwardDeclarationsForType -{ - my $type = shift; - my $public = shift; - - return if $codeGenerator->IsNonPointerType($type); - return if $codeGenerator->GetSequenceType($type); - return if $codeGenerator->GetArrayType($type); - - my $class = GetClassName($type); - - if (IsProtocolType($type)) { - $headerForwardDeclarationsForProtocols{$class} = 1 if $public; - $privateHeaderForwardDeclarationsForProtocols{$class} = 1 if !$public and !$headerForwardDeclarationsForProtocols{$class}; - return; - } - - $headerForwardDeclarations{$class} = 1 if $public; - - # Private headers include the public header, so only add a forward declaration to the private header - # if the public header does not already have the same forward declaration. - $privateHeaderForwardDeclarations{$class} = 1 if !$public and !$headerForwardDeclarations{$class}; -} - -sub AddIncludesForType -{ - my $type = shift; - - return if $codeGenerator->IsNonPointerType($type); - return if $codeGenerator->GetSequenceType($type); - return if $codeGenerator->GetArrayType($type); - - if (IsNativeObjCType($type)) { - if ($type eq "Color") { - $implIncludes{"ColorMac.h"} = 1; - } - return; - } - - if ($codeGenerator->IsStringType($type)) { - $implIncludes{"KURL.h"} = 1; - return; - } - - if ($type eq "DOMWindow") { - $implIncludes{"DOMAbstractViewInternal.h"} = 1; - $implIncludes{"DOMWindow.h"} = 1; - return; - } - - if ($type eq "DOMImplementation") { - $implIncludes{"DOMDOMImplementationInternal.h"} = 1; - $implIncludes{"DOMImplementationFront.h"} = 1; - return; - } - - if ($type eq "EventTarget") { - $implIncludes{"Node.h"} = 1; - $implIncludes{"DOMEventTarget.h"} = 1; - return; - } - - if ($codeGenerator->IsSVGAnimatedType($type)) { - $implIncludes{"${type}.h"} = 1; - $implIncludes{"DOM${type}Internal.h"} = 1; - return; - } - - if ($type =~ /(\w+)(Abs|Rel)$/) { - $implIncludes{"$1.h"} = 1; - $implIncludes{"DOM${type}Internal.h"} = 1; - return; - } - - if ($type eq "NodeFilter") { - $implIncludes{"NodeFilter.h"} = 1; - $implIncludes{"ObjCNodeFilterCondition.h"} = 1; - return; - } - - if ($type eq "EventListener") { - $implIncludes{"EventListener.h"} = 1; - $implIncludes{"ObjCEventListener.h"} = 1; - return; - } - - if ($type eq "XPathNSResolver") { - $implIncludes{"DOMCustomXPathNSResolver.h"} = 1; - $implIncludes{"XPathNSResolver.h"} = 1; - return; - } - - if ($type eq "SerializedScriptValue") { - $implIncludes{"SerializedScriptValue.h"} = 1; - return; - } - - # FIXME: won't compile without these - $implIncludes{"StylePropertySet.h"} = 1 if $type eq "CSSStyleDeclaration"; - $implIncludes{"NameNodeList.h"} = 1 if $type eq "NodeList"; - - # Default, include the same named file (the implementation) and the same name prefixed with "DOM". - $implIncludes{"$type.h"} = 1 if not $codeGenerator->SkipIncludeHeader($type); - $implIncludes{"DOM${type}Internal.h"} = 1; -} - -sub GetSVGTypeWithNamespace -{ - my $type = shift; - my $typeWithNamespace = "WebCore::" . $codeGenerator->GetSVGTypeNeedingTearOff($type); - - # Special case for DOMSVGNumber - $typeWithNamespace =~ s/</\<WebCore::/ unless $type eq "SVGNumber"; - return $typeWithNamespace; -} - -sub GetSVGPropertyTypes -{ - my $implType = shift; - - my $svgPropertyType; - my $svgListPropertyType; - my $svgNativeType; - - return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $implType =~ /SVG/; - - $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($implType); - return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $svgNativeType; - - # Append space to avoid compilation errors when using PassRefPtr<$svgNativeType> - $svgNativeType = "WebCore::$svgNativeType "; - $svgNativeType =~ s/</\<WebCore::/ if not $svgNativeType =~ /float/; - - my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implType); - if ($svgNativeType =~ /SVGPropertyTearOff/) { - if ($svgWrappedNativeType eq "float") { - # Special case for DOMSVGNumber - $svgPropertyType = $svgWrappedNativeType; - } else { - $svgPropertyType = "WebCore::$svgWrappedNativeType"; - $svgPropertyType =~ s/</\<WebCore::/; - } - } elsif ($svgNativeType =~ /SVGListPropertyTearOff/ or $svgNativeType =~ /SVGStaticListPropertyTearOff/) { - $svgListPropertyType = "WebCore::$svgWrappedNativeType"; - $svgListPropertyType =~ s/</\<WebCore::/; - } elsif ($svgNativeType =~ /SVGTransformListPropertyTearOff/) { - $svgListPropertyType = "WebCore::$svgWrappedNativeType"; - $svgListPropertyType =~ s/</\<WebCore::/; - } elsif ($svgNativeType =~ /SVGPathSegListPropertyTearOff/) { - $svgListPropertyType = "WebCore::$svgWrappedNativeType"; - $svgListPropertyType =~ s/</\<WebCore::/; - } - - return ($svgPropertyType, $svgListPropertyType, $svgNativeType); -} - -sub GenerateHeader -{ - my $object = shift; - my $interface = shift; - - my $interfaceName = $interface->name; - my $className = GetClassName($interfaceName); - - my $parentName = ""; - my @protocolsToImplement = (); - ($parentName, @protocolsToImplement) = GetParentAndProtocols($interface); - - my $numConstants = @{$interface->constants}; - my $numAttributes = @{$interface->attributes}; - my $numFunctions = @{$interface->functions}; - - # - Add default header template - @headerContentHeader = split("\r", $headerLicenseTemplate); - push(@headerContentHeader, "\n"); - - # - INCLUDES - - my $includedWebKitAvailabilityHeader = 0; - unless ($isProtocol) { - my $parentHeaderName = GetClassHeaderName($parentName); - push(@headerContentHeader, "#import <WebCore/$parentHeaderName.h>\n"); - $includedWebKitAvailabilityHeader = 1; - } - - foreach my $parentProtocol (@protocolsToImplement) { - next if $parentProtocol =~ /^NS/; - $parentProtocol = GetClassHeaderName($parentProtocol); - push(@headerContentHeader, "#import <WebCore/$parentProtocol.h>\n"); - $includedWebKitAvailabilityHeader = 1; - } - - # Special case needed for legacy support of DOMRange - if ($interfaceName eq "Range") { - push(@headerContentHeader, "#import <WebCore/DOMCore.h>\n"); - push(@headerContentHeader, "#import <WebCore/DOMDocument.h>\n"); - push(@headerContentHeader, "#import <WebCore/DOMRangeException.h>\n"); - $includedWebKitAvailabilityHeader = 1; - } - - push(@headerContentHeader, "#import <JavaScriptCore/WebKitAvailability.h>\n") unless $includedWebKitAvailabilityHeader; - - my $interfaceAvailabilityVersionCheck = "#if WEBKIT_VERSION_MAX_ALLOWED >= $interfaceAvailabilityVersion\n\n"; - - push(@headerContentHeader, "\n"); - push(@headerContentHeader, $interfaceAvailabilityVersionCheck) if length $interfaceAvailabilityVersion; - - # - Add constants. - if ($numConstants > 0) { - my @headerConstants = (); - my @constants = @{$interface->constants}; - my $combinedConstants = ""; - - # FIXME: we need a way to include multiple enums. - foreach my $constant (@constants) { - my $constantName = $constant->name; - my $constantValue = $constant->value; - my $conditional = $constant->extendedAttributes->{"Conditional"}; - my $notLast = $constant ne $constants[-1]; - - if ($conditional) { - my $conditionalString = $codeGenerator->GenerateConditionalStringFromAttributeValue($conditional); - $combinedConstants .= "#if ${conditionalString}\n"; - } - $combinedConstants .= " DOM_$constantName = $constantValue"; - $combinedConstants .= "," if $notLast; - if ($conditional) { - $combinedConstants .= "\n#endif\n"; - } elsif ($notLast) { - $combinedConstants .= "\n"; - } - } - - # FIXME: the formatting of the enums should line up the equal signs. - # FIXME: enums are unconditionally placed in the public header. - push(@headerContent, "enum {\n"); - push(@headerContent, $combinedConstants); - push(@headerContent, "\n};\n\n"); - } - - # - Begin @interface or @protocol - my $interfaceDeclaration = ($isProtocol ? "\@protocol $className" : "\@interface $className : $parentName"); - $interfaceDeclaration .= " <" . join(", ", @protocolsToImplement) . ">" if @protocolsToImplement > 0; - $interfaceDeclaration .= "\n"; - - push(@headerContent, $interfaceDeclaration); - - my @headerAttributes = (); - my @privateHeaderAttributes = (); - - # - Add attribute getters/setters. - if ($numAttributes > 0) { - foreach my $attribute (@{$interface->attributes}) { - next if SkipAttribute($attribute); - my $attributeName = $attribute->signature->name; - - if ($attributeName eq "id" or $attributeName eq "hash" or $attributeName eq "description") { - # Special case some attributes (like id and hash) to have a "Name" suffix to avoid ObjC naming conflicts. - $attributeName .= "Name"; - } elsif ($attributeName eq "frame") { - # Special case attribute frame to be frameBorders. - $attributeName .= "Borders"; - } - - my $attributeType = GetObjCType($attribute->signature->type); - my $attributeIsReadonly = ($attribute->type =~ /^readonly/); - - my $property = "\@property" . GetPropertyAttributes($attribute->signature->type, $attributeIsReadonly); - # Some SVGFE*Element.idl use 'operator' as attribute name, rewrite as '_operator' to avoid clashes with C/C++ - $attributeName =~ s/operator/_operator/ if ($attributeName =~ /operator/); - $property .= " " . $attributeType . ($attributeType =~ /\*$/ ? "" : " ") . $attributeName; - - my $publicInterfaceKey = $property . ";"; - - my $availabilityMacro = ""; - if (defined $publicInterfaces{$publicInterfaceKey} and length $publicInterfaces{$publicInterfaceKey}) { - $availabilityMacro = $publicInterfaces{$publicInterfaceKey}; - } - - my $declarationSuffix = ";\n"; - $declarationSuffix = " $availabilityMacro;\n" if length $availabilityMacro; - - my $public = (defined $publicInterfaces{$publicInterfaceKey} or $newPublicClass); - delete $publicInterfaces{$publicInterfaceKey}; - - AddForwardDeclarationsForType($attribute->signature->type, $public); - - my $setterName = "set" . ucfirst($attributeName) . ":"; - - my $conflict = $conflictMethod{$attributeName}; - if ($conflict) { - warn "$className conflicts with $conflict method $attributeName\n"; - $fatalError = 1; - } - - $conflict = $conflictMethod{$setterName}; - if ($conflict) { - warn "$className conflicts with $conflict method $setterName\n"; - $fatalError = 1; - } - - $property .= $declarationSuffix; - push(@headerAttributes, $property) if $public; - push(@privateHeaderAttributes, $property) unless $public; - } - - push(@headerContent, @headerAttributes) if @headerAttributes > 0; - } - - my @headerFunctions = (); - my @privateHeaderFunctions = (); - my @deprecatedHeaderFunctions = (); - - # - Add functions. - if ($numFunctions > 0) { - foreach my $function (@{$interface->functions}) { - next if SkipFunction($function); - next if ($function->signature->name eq "set" and $interface->extendedAttributes->{"TypedArray"}); - my $functionName = $function->signature->name; - - my $returnType = GetObjCType($function->signature->type); - my $needsDeprecatedVersion = (@{$function->parameters} > 1 and $function->signature->extendedAttributes->{"ObjCLegacyUnnamedParameters"}); - my $numberOfParameters = @{$function->parameters}; - my %typesToForwardDeclare = ($function->signature->type => 1); - - my $parameterIndex = 0; - my $functionSig = "- ($returnType)$functionName"; - my $methodName = $functionName; - foreach my $param (@{$function->parameters}) { - my $paramName = $param->name; - my $paramType = GetObjCType($param->type); - - $typesToForwardDeclare{$param->type} = 1; - - if ($parameterIndex >= 1) { - $functionSig .= " $paramName"; - $methodName .= $paramName; - } - - $functionSig .= ":($paramType)$paramName"; - $methodName .= ":"; - - $parameterIndex++; - } - - my $publicInterfaceKey = $functionSig . ";"; - - my $conflict = $conflictMethod{$methodName}; - if ($conflict) { - warn "$className conflicts with $conflict method $methodName\n"; - $fatalError = 1; - } - - if ($isProtocol && !$newPublicClass && !defined $publicInterfaces{$publicInterfaceKey}) { - warn "Protocol method $publicInterfaceKey is not in PublicDOMInterfaces.h. Protocols require all methods to be public"; - $fatalError = 1; - } - - my $availabilityMacro = ""; - if (defined $publicInterfaces{$publicInterfaceKey} and length $publicInterfaces{$publicInterfaceKey}) { - $availabilityMacro = $publicInterfaces{$publicInterfaceKey}; - } - - my $functionDeclaration = $functionSig; - $functionDeclaration .= " " . $availabilityMacro if length $availabilityMacro; - $functionDeclaration .= ";\n"; - - my $public = (defined $publicInterfaces{$publicInterfaceKey} or $newPublicClass); - delete $publicInterfaces{$publicInterfaceKey}; - - foreach my $type (keys %typesToForwardDeclare) { - # add any forward declarations to the public header if a deprecated version will be generated - AddForwardDeclarationsForType($type, 1) if $needsDeprecatedVersion; - AddForwardDeclarationsForType($type, $public) unless $public and $needsDeprecatedVersion; - } - - my $functionConditionalString = $codeGenerator->GenerateConditionalString($function->signature); - if ($functionConditionalString) { - push(@headerFunctions, "#if ${functionConditionalString}\n") if $public; - push(@privateHeaderFunctions, "#if ${functionConditionalString}\n") unless $public; - push(@deprecatedHeaderFunctions, "#if ${functionConditionalString}\n") if $needsDeprecatedVersion; - } - - push(@headerFunctions, $functionDeclaration) if $public; - push(@privateHeaderFunctions, $functionDeclaration) unless $public; - - # generate the old style method names with un-named parameters, these methods are deprecated - if ($needsDeprecatedVersion) { - my $deprecatedFunctionSig = $functionSig; - $deprecatedFunctionSig =~ s/\s\w+:/ :/g; # remove parameter names - - $publicInterfaceKey = $deprecatedFunctionSig . ";"; - - my $availabilityMacro = "AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0"; - if (defined $publicInterfaces{$publicInterfaceKey} and length $publicInterfaces{$publicInterfaceKey}) { - $availabilityMacro = $publicInterfaces{$publicInterfaceKey}; - } - - $functionDeclaration = "$deprecatedFunctionSig $availabilityMacro;\n"; - - push(@deprecatedHeaderFunctions, $functionDeclaration); - - unless (defined $publicInterfaces{$publicInterfaceKey}) { - warn "Deprecated method $publicInterfaceKey is not in PublicDOMInterfaces.h. All deprecated methods need to be public, or should have the ObjCLegacyUnnamedParameters IDL attribute removed"; - $fatalError = 1; - } - - delete $publicInterfaces{$publicInterfaceKey}; - } - - if ($functionConditionalString) { - push(@headerFunctions, "#endif\n") if $public; - push(@privateHeaderFunctions, "#endif\n") unless $public; - push(@deprecatedHeaderFunctions, "#endif\n") if $needsDeprecatedVersion; - } - } - - if (@headerFunctions > 0) { - push(@headerContent, "\n") if @headerAttributes > 0; - push(@headerContent, @headerFunctions); - } - } - - if (@deprecatedHeaderFunctions > 0 && $isProtocol) { - push(@headerContent, @deprecatedHeaderFunctions); - } - - # - End @interface or @protocol - push(@headerContent, "\@end\n"); - - if (@deprecatedHeaderFunctions > 0 && !$isProtocol) { - # - Deprecated category @interface - push(@headerContent, "\n\@interface $className (" . $className . "Deprecated)\n"); - push(@headerContent, @deprecatedHeaderFunctions); - push(@headerContent, "\@end\n"); - } - - push(@headerContent, "\n#endif\n") if length $interfaceAvailabilityVersion; - - my %alwaysGenerateForNoSVGBuild = map { $_ => 1 } qw(DOMHTMLEmbedElement DOMHTMLObjectElement); - - if (@privateHeaderAttributes > 0 or @privateHeaderFunctions > 0 or exists $alwaysGenerateForNoSVGBuild{$className}) { - # - Private category @interface - @privateHeaderContentHeader = split("\r", $headerLicenseTemplate); - push(@privateHeaderContentHeader, "\n"); - - my $classHeaderName = GetClassHeaderName($className); - push(@privateHeaderContentHeader, "#import <WebCore/$classHeaderName.h>\n\n"); - push(@privateHeaderContentHeader, $interfaceAvailabilityVersionCheck) if length $interfaceAvailabilityVersion; - - @privateHeaderContent = (); - push(@privateHeaderContent, "\@interface $className (" . $className . "Private)\n"); - push(@privateHeaderContent, @privateHeaderAttributes) if @privateHeaderAttributes > 0; - push(@privateHeaderContent, "\n") if @privateHeaderAttributes > 0 and @privateHeaderFunctions > 0; - push(@privateHeaderContent, @privateHeaderFunctions) if @privateHeaderFunctions > 0; - push(@privateHeaderContent, "\@end\n"); - - push(@privateHeaderContent, "\n#endif\n") if length $interfaceAvailabilityVersion; - } - - unless ($isProtocol) { - # Generate internal interfaces - my $implClassName = GetImplClassName($interfaceName); - my $implClassNameWithNamespace = "WebCore::" . $implClassName; - - my $implType = $implClassNameWithNamespace; - my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implClassName); - $implType = $svgNativeType if $svgNativeType; - - # Generate interface definitions. - @internalHeaderContent = split("\r", $implementationLicenseTemplate); - - push(@internalHeaderContent, "\n#import <WebCore/$className.h>\n\n"); - push(@internalHeaderContent, "#import <WebCore/SVGAnimatedPropertyTearOff.h>\n\n") if $svgPropertyType; - if ($svgListPropertyType) { - push(@internalHeaderContent, "#import <WebCore/SVGAnimatedListPropertyTearOff.h>\n\n"); - push(@internalHeaderContent, "#import <WebCore/SVGTransformListPropertyTearOff.h>\n\n") if $svgListPropertyType =~ /SVGTransformList/; - push(@internalHeaderContent, "#import <WebCore/SVGPathSegListPropertyTearOff.h>\n\n") if $svgListPropertyType =~ /SVGPathSegList/; - } - push(@internalHeaderContent, $interfaceAvailabilityVersionCheck) if length $interfaceAvailabilityVersion; - - if ($interfaceName eq "Node") { - push(@internalHeaderContent, "\@protocol DOMEventTarget;\n\n"); - } - - my $startedNamespace = 0; - - if ($codeGenerator->IsSVGAnimatedType($interfaceName)) { - push(@internalHeaderContent, "#import <WebCore/$implClassName.h>\n\n"); - } else { - push(@internalHeaderContent, "namespace WebCore {\n"); - $startedNamespace = 1; - if ($interfaceName eq "Node") { - push(@internalHeaderContent, " class EventTarget;\n class Node;\n"); - } else { - push(@internalHeaderContent, " class $implClassName;\n"); - } - push(@internalHeaderContent, "}\n\n"); - } - - push(@internalHeaderContent, "$implType* core($className *);\n"); - push(@internalHeaderContent, "$className *kit($implType*);\n"); - - if ($interface->extendedAttributes->{"ObjCPolymorphic"}) { - push(@internalHeaderContent, "Class kitClass($implType*);\n"); - } - - if ($interfaceName eq "Node") { - push(@internalHeaderContent, "id <DOMEventTarget> kit(WebCore::EventTarget*);\n"); - } - - push(@internalHeaderContent, "\n#endif\n") if length $interfaceAvailabilityVersion; - } -} - -sub GenerateImplementation -{ - my $object = shift; - my $interface = shift; - - my @ancestorInterfaceNames = (); - - if (@{$interface->parents} > 1) { - $codeGenerator->AddMethodsConstantsAndAttributesFromParentInterfaces($interface, \@ancestorInterfaceNames); - } - - my $interfaceName = $interface->name; - my $className = GetClassName($interfaceName); - my $implClassName = GetImplClassName($interfaceName); - my $parentImplClassName = GetParentImplClassName($interface); - my $implClassNameWithNamespace = "WebCore::" . $implClassName; - my $baseClass = GetBaseClass($parentImplClassName); - my $classHeaderName = GetClassHeaderName($className); - - my $numAttributes = @{$interface->attributes}; - my $numFunctions = @{$interface->functions}; - my $implType = $implClassNameWithNamespace; - - my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implClassName); - $implType = $svgNativeType if $svgNativeType; - - # - Add default header template. - @implContentHeader = split("\r", $implementationLicenseTemplate); - - # - INCLUDES - - push(@implContentHeader, "\n#import \"config.h\"\n"); - - my $conditionalString = $codeGenerator->GenerateConditionalString($interface); - push(@implContentHeader, "\n#if ${conditionalString}\n\n") if $conditionalString; - - push(@implContentHeader, "#import \"DOMInternal.h\"\n\n"); - push(@implContentHeader, "#import \"$classHeaderName.h\"\n\n"); - - $implIncludes{"ExceptionHandlers.h"} = 1; - $implIncludes{"ThreadCheck.h"} = 1; - $implIncludes{"JSMainThreadExecState.h"} = 1; - $implIncludes{"WebScriptObjectPrivate.h"} = 1; - $implIncludes{$classHeaderName . "Internal.h"} = 1; - - # FIXME: These includes are only needed when the class is a subclass of one of these polymorphic classes. - $implIncludes{"DOMBlobInternal.h"} = 1; - $implIncludes{"DOMCSSRuleInternal.h"} = 1; - $implIncludes{"DOMCSSValueInternal.h"} = 1; - $implIncludes{"DOMEventInternal.h"} = 1; - $implIncludes{"DOMNodeInternal.h"} = 1; - $implIncludes{"DOMStyleSheetInternal.h"} = 1; - - $implIncludes{"DOMSVGPathSegInternal.h"} = 1 if $interfaceName =~ /^SVGPathSeg.+/; - - if ($interfaceName =~ /(\w+)(Abs|Rel)$/) { - $implIncludes{"$1.h"} = 1; - } else { - if (!$codeGenerator->SkipIncludeHeader($implClassName)) { - $implIncludes{"$implClassName.h"} = 1 ; - } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($implClassName)) { - my $includeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implClassName); - $implIncludes{"${includeType}.h"} = 1; - } - } - - @implContent = (); - - push(@implContent, "#import <wtf/GetPtr.h>\n\n"); - - # add implementation accessor - if ($parentImplClassName eq "Object") { - push(@implContent, "#define IMPL reinterpret_cast<$implType*>(_internal)\n\n"); - } else { - my $baseClassWithNamespace = "WebCore::$baseClass"; - push(@implContent, "#define IMPL static_cast<$implClassNameWithNamespace*>(reinterpret_cast<$baseClassWithNamespace*>(_internal))\n\n"); - } - - # START implementation - push(@implContent, "\@implementation $className\n\n"); - - # Only generate 'dealloc' and 'finalize' methods for direct subclasses of DOMObject. - if ($parentImplClassName eq "Object") { - $implIncludes{"WebCoreObjCExtras.h"} = 1; - push(@implContent, "- (void)dealloc\n"); - push(@implContent, "{\n"); - push(@implContent, " if (WebCoreObjCScheduleDeallocateOnMainThread([$className class], self))\n"); - push(@implContent, " return;\n"); - push(@implContent, "\n"); - if ($interfaceName eq "NodeIterator") { - push(@implContent, " if (_internal) {\n"); - push(@implContent, " [self detach];\n"); - push(@implContent, " IMPL->deref();\n"); - push(@implContent, " };\n"); - } else { - push(@implContent, " if (_internal)\n"); - push(@implContent, " IMPL->deref();\n"); - } - push(@implContent, " [super dealloc];\n"); - push(@implContent, "}\n\n"); - - push(@implContent, "- (void)finalize\n"); - push(@implContent, "{\n"); - if ($interfaceName eq "NodeIterator") { - push(@implContent, " if (_internal) {\n"); - push(@implContent, " [self detach];\n"); - push(@implContent, " IMPL->deref();\n"); - push(@implContent, " };\n"); - } else { - push(@implContent, " if (_internal)\n"); - push(@implContent, " IMPL->deref();\n"); - } - push(@implContent, " [super finalize];\n"); - push(@implContent, "}\n\n"); - - } - - %attributeNames = (); - - # - Attributes - if ($numAttributes > 0) { - foreach my $attribute (@{$interface->attributes}) { - next if SkipAttribute($attribute); - AddIncludesForType($attribute->signature->type); - - my $idlType = $attribute->signature->type; - - my $attributeName = $attribute->signature->name; - my $attributeType = GetObjCType($attribute->signature->type); - my $attributeIsReadonly = ($attribute->type =~ /^readonly/); - my $attributeClassName = GetClassName($attribute->signature->type); - - my $attributeInterfaceName = $attributeName; - if ($attributeName eq "id" or $attributeName eq "hash" or $attributeName eq "description") { - # Special case some attributes (like id and hash) to have a "Name" suffix to avoid ObjC naming conflicts. - $attributeInterfaceName .= "Name"; - } elsif ($attributeName eq "frame") { - # Special case attribute frame to be frameBorders. - $attributeInterfaceName .= "Borders"; - } elsif ($attributeName eq "operator") { - # Avoid clash with C++ keyword. - $attributeInterfaceName = "_operator"; - } - - $attributeNames{$attributeInterfaceName} = 1; - - # - GETTER - my $getterSig = "- ($attributeType)$attributeInterfaceName\n"; - - my ($functionName, @arguments) = $codeGenerator->GetterExpression(\%implIncludes, $interfaceName, $attribute); - my $getterExpressionPrefix = "$functionName(" . join(", ", @arguments); - - # FIXME: Special case attribute ownerDocument to call document. This makes it return the - # document when called on the document itself. Legacy behavior, see <https://bugs.webkit.org/show_bug.cgi?id=10889>. - $getterExpressionPrefix =~ s/\bownerDocument\b/document/; - - my $hasGetterException = @{$attribute->getterExceptions}; - my $getterContentHead; - if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) { - my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"}; - $implIncludes{"${implementedBy}.h"} = 1; - $getterContentHead = "${implementedBy}::${getterExpressionPrefix}IMPL"; - } else { - $getterContentHead = "IMPL->$getterExpressionPrefix"; - } - - my $getterContentTail = ")"; - - if ($svgPropertyType) { - $getterContentHead = "$getterExpressionPrefix"; - - # TODO: Handle special case for DOMSVGLength. We do need Custom code support for this. - if ($svgPropertyType eq "WebCore::SVGLength" and $attributeName eq "value") { - $getterContentHead = "value(WebCore::SVGLengthContext(IMPL->contextElement()), "; - } - } - - my $attributeTypeSansPtr = $attributeType; - $attributeTypeSansPtr =~ s/ \*$//; # Remove trailing " *" from pointer types. - - # special case for EventTarget protocol - $attributeTypeSansPtr = "DOMNode" if $idlType eq "EventTarget"; - - # Special cases - my @customGetterContent = (); - if ($attributeTypeSansPtr eq "DOMImplementation") { - # FIXME: We have to special case DOMImplementation until DOMImplementationFront is removed - $getterContentHead = "kit(implementationFront(IMPL"; - $getterContentTail .= ")"; - } elsif ($attributeName =~ /(\w+)DisplayString$/) { - my $attributeToDisplay = $1; - $getterContentHead = "WebCore::displayString(IMPL->$attributeToDisplay(), core(self)"; - $implIncludes{"HitTestResult.h"} = 1; - } elsif ($attributeName =~ /^absolute(\w+)URL$/) { - my $typeOfURL = $1; - $getterContentHead = "[self _getURLAttribute:"; - if ($typeOfURL eq "Link") { - $getterContentTail = "\@\"href\"]"; - } elsif ($typeOfURL eq "Image") { - if ($interfaceName eq "HTMLObjectElement") { - $getterContentTail = "\@\"data\"]"; - } else { - $getterContentTail = "\@\"src\"]"; - } - unless ($interfaceName eq "HTMLImageElement") { - push(@customGetterContent, " if (!IMPL->renderer() || !IMPL->renderer()->isImage())\n"); - push(@customGetterContent, " return nil;\n"); - $implIncludes{"RenderObject.h"} = 1; - } - } - $implIncludes{"DOMPrivate.h"} = 1; - } elsif ($attribute->signature->extendedAttributes->{"ObjCImplementedAsUnsignedLong"}) { - $getterContentHead = "WTF::String::number(" . $getterContentHead; - $getterContentTail .= ")"; - } elsif ($idlType eq "Date") { - $getterContentHead = "kit($getterContentHead"; - $getterContentTail .= ")"; - } elsif ($svgPropertyType) { - # Special case for DOMSVGNumber - if ($svgPropertyType eq "float") { - # Intentional leave out closing brace, it's already contained in getterContentTail - $getterContentHead = "IMPL->propertyReference("; - } else { - $getterContentHead = "IMPL->propertyReference().$getterContentHead"; - } - - if ($codeGenerator->IsSVGTypeWithWritablePropertiesNeedingTearOff($idlType) and not defined $attribute->signature->extendedAttributes->{"Immutable"}) { - my $getter = $getterContentHead; - $getter =~ s/\(\)//; - - my $tearOffType = GetSVGTypeWithNamespace($idlType); - my $selfIsTearOffType = $codeGenerator->IsSVGTypeNeedingTearOff($implClassName); - if ($selfIsTearOffType) { - $implIncludes{"SVGStaticPropertyWithParentTearOff.h"} = 1; - $tearOffType =~ s/SVGPropertyTearOff</SVGStaticPropertyWithParentTearOff<$implClassNameWithNamespace, /; - - my $getter = $getterExpressionPrefix; - $getter =~ s/IMPL->//; - $getter =~ s/\(//; - my $updateMethod = "&${implClassNameWithNamespace}::update" . $codeGenerator->WK_ucfirst($getter); - - if ($getterContentHead =~ /matrix/ and $implClassName eq "SVGTransform") { - # SVGTransform offers a matrix() method for internal usage that returns an AffineTransform - # and a svgMatrix() method returning a SVGMatrix, used for the bindings. - $getterContentHead =~ s/matrix/svgMatrix/; - } - - $getterContentHead = "${tearOffType}::create(IMPL, $getterContentHead$getterContentTail, $updateMethod)"; - - $getterContentHead = "kit(WTF::getPtr($getterContentHead"; - $getterContentTail = "))"; - } - } - } elsif (($codeGenerator->IsSVGAnimatedType($implClassName) or $implClassName eq "SVGViewSpec") and $codeGenerator->IsSVGTypeNeedingTearOff($idlType)) { - my $idlTypeWithNamespace = GetSVGTypeWithNamespace($idlType); - $getterContentHead = "kit(static_cast<$idlTypeWithNamespace*>($getterContentHead)"; - $getterContentTail .= ")"; - } elsif (IsProtocolType($idlType) and $idlType ne "EventTarget") { - $getterContentHead = "kit($getterContentHead"; - $getterContentTail .= ")"; - } elsif ($idlType eq "Color") { - $getterContentHead = "WebCore::nsColor($getterContentHead"; - $getterContentTail .= ")"; - } elsif ($attribute->signature->type eq "SerializedScriptValue") { - $getterContentHead = "$getterContentHead"; - $getterContentTail .= "->toString()"; - } elsif (ConversionNeeded($attribute->signature->type)) { - my $type = $attribute->signature->type; - if ($codeGenerator->IsSVGTypeNeedingTearOff($type) and not $implClassName =~ /List$/) { - my $idlTypeWithNamespace = GetSVGTypeWithNamespace($type); - $implIncludes{"$type.h"} = 1 if not $codeGenerator->SkipIncludeHeader($type); - if ($codeGenerator->IsSVGTypeWithWritablePropertiesNeedingTearOff($type) and not defined $attribute->signature->extendedAttributes->{"Immutable"}) { - $idlTypeWithNamespace =~ s/SVGPropertyTearOff</SVGStaticPropertyTearOff<$implClassNameWithNamespace, /; - $implIncludes{"SVGStaticPropertyTearOff.h"} = 1; - - my $getter = $getterContentHead; - $getter =~ s/IMPL->//; - $getter =~ s/\(//; - my $updateMethod = "&${implClassNameWithNamespace}::update" . $codeGenerator->WK_ucfirst($getter); - $getterContentHead = "kit(WTF::getPtr(${idlTypeWithNamespace}::create(IMPL, $getterContentHead$getterContentTail, $updateMethod"; - $getterContentTail .= "))"; - } elsif ($idlTypeWithNamespace =~ /SVG(Point|PathSeg)List/) { - $getterContentHead = "kit(WTF::getPtr($getterContentHead"; - $getterContentTail .= "))"; - } elsif ($idlTypeWithNamespace =~ /SVGStaticListPropertyTearOff/) { - $getterContentHead = "kit(WTF::getPtr(${idlTypeWithNamespace}::create(IMPL, $getterContentHead"; - $getterContentTail .= ")))"; - } else { - $getterContentHead = "kit(WTF::getPtr(${idlTypeWithNamespace}::create($getterContentHead"; - $getterContentTail .= ")))"; - } - } else { - $getterContentHead = "kit(WTF::getPtr($getterContentHead"; - $getterContentTail .= "))"; - } - } - - my $getterContent; - if ($hasGetterException) { - $getterContent = $getterContentHead . ($getterContentHead =~ /\($|, $/ ? "ec" : ", ec") . $getterContentTail; - } else { - $getterContent = $getterContentHead . $getterContentTail; - } - - my $attributeConditionalString = $codeGenerator->GenerateConditionalString($attribute->signature); - push(@implContent, "#if ${attributeConditionalString}\n") if $attributeConditionalString; - push(@implContent, $getterSig); - push(@implContent, "{\n"); - push(@implContent, " $jsContextSetter\n"); - push(@implContent, @customGetterContent); - if ($hasGetterException) { - # Differentiated between when the return type is a pointer and - # not for white space issue (ie. Foo *result vs. int result). - if ($attributeType =~ /\*$/) { - $getterContent = $attributeType . "result = " . $getterContent; - } else { - $getterContent = $attributeType . " result = " . $getterContent; - } - - push(@implContent, " $exceptionInit\n"); - push(@implContent, " $getterContent;\n"); - push(@implContent, " $exceptionRaiseOnError\n"); - push(@implContent, " return result;\n"); - } else { - push(@implContent, " return $getterContent;\n"); - } - push(@implContent, "}\n"); - - # - SETTER - if (!$attributeIsReadonly) { - # Exception handling - my $hasSetterException = @{$attribute->setterExceptions}; - - my $coreSetterName = "set" . $codeGenerator->WK_ucfirst($attributeName); - my $setterName = "set" . ucfirst($attributeInterfaceName); - my $argName = "new" . ucfirst($attributeInterfaceName); - my $arg = GetObjCTypeGetter($argName, $idlType); - - # The definition of ObjCImplementedAsUnsignedLong is flipped for the setter - if ($attribute->signature->extendedAttributes->{"ObjCImplementedAsUnsignedLong"}) { - $arg = "WTF::String($arg).toInt()"; - } - - my $setterSig = "- (void)$setterName:($attributeType)$argName\n"; - - push(@implContent, "\n"); - push(@implContent, $setterSig); - push(@implContent, "{\n"); - push(@implContent, " $jsContextSetter\n"); - - unless ($codeGenerator->IsPrimitiveType($idlType) or $codeGenerator->IsStringType($idlType)) { - push(@implContent, " ASSERT($argName);\n\n"); - } - - if ($idlType eq "Date") { - $arg = "core(" . $arg . ")"; - } - - if ($svgPropertyType) { - $implIncludes{"ExceptionCode.h"} = 1; - $getterContentHead = "$getterExpressionPrefix"; - push(@implContent, " if (IMPL->isReadOnly()) {\n"); - push(@implContent, " WebCore::raiseOnDOMError(WebCore::NO_MODIFICATION_ALLOWED_ERR);\n"); - push(@implContent, " return;\n"); - push(@implContent, " }\n"); - push(@implContent, " $svgPropertyType& podImpl = IMPL->propertyReference();\n"); - my $ec = $hasSetterException ? ", ec" : ""; - push(@implContent, " $exceptionInit\n") if $hasSetterException; - - # Special case for DOMSVGNumber - if ($svgPropertyType eq "float") { - push(@implContent, " podImpl = $arg;\n"); - } else { - # FIXME: Special case for DOMSVGLength. We do need Custom code support for this. - if ($svgPropertyType eq "WebCore::SVGLength" and $attributeName eq "value") { - push(@implContent, " podImpl.$coreSetterName($arg, WebCore::SVGLengthContext(IMPL->contextElement())$ec);\n"); - } else { - push(@implContent, " podImpl.$coreSetterName($arg$ec);\n"); - } - } - - if ($hasSetterException) { - push(@implContent, " if (!ec)\n"); - push(@implContent, " IMPL->commitChange();\n"); - push(@implContent, " $exceptionRaiseOnError\n"); - } else { - push(@implContent, " IMPL->commitChange();\n"); - } - } elsif ($svgListPropertyType) { - $getterContentHead = "$getterExpressionPrefix"; - push(@implContent, " IMPL->$coreSetterName($arg);\n"); - } else { - my ($functionName, @arguments) = $codeGenerator->SetterExpression(\%implIncludes, $interfaceName, $attribute); - push(@arguments, $arg); - push(@arguments, "ec") if $hasSetterException; - push(@implContent, " $exceptionInit\n") if $hasSetterException; - if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) { - my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"}; - $implIncludes{"${implementedBy}.h"} = 1; - unshift(@arguments, "IMPL"); - $functionName = "${implementedBy}::${functionName}"; - } else { - $functionName = "IMPL->${functionName}"; - } - push(@implContent, " ${functionName}(" . join(", ", @arguments) . ");\n"); - push(@implContent, " $exceptionRaiseOnError\n") if $hasSetterException; - } - - push(@implContent, "}\n"); - } - - push(@implContent, "#endif\n") if $attributeConditionalString; - push(@implContent, "\n"); - } - } - - # - Functions - if ($numFunctions > 0) { - foreach my $function (@{$interface->functions}) { - next if SkipFunction($function); - next if ($function->signature->name eq "set" and $interface->extendedAttributes->{"TypedArray"}); - AddIncludesForType($function->signature->type); - - my $functionName = $function->signature->name; - my $returnType = GetObjCType($function->signature->type); - my $hasParameters = @{$function->parameters}; - my $raisesExceptions = @{$function->raisesExceptions}; - - my @parameterNames = (); - my @needsAssert = (); - my %needsCustom = (); - - my $parameterIndex = 0; - my $functionSig = "- ($returnType)$functionName"; - foreach my $param (@{$function->parameters}) { - my $paramName = $param->name; - my $paramType = GetObjCType($param->type); - - # make a new parameter name if the original conflicts with a property name - $paramName = "in" . ucfirst($paramName) if $attributeNames{$paramName}; - - AddIncludesForType($param->type); - - my $idlType = $param->type; - my $implGetter = GetObjCTypeGetter($paramName, $idlType); - - push(@parameterNames, $implGetter); - $needsCustom{"XPathNSResolver"} = $paramName if $idlType eq "XPathNSResolver"; - $needsCustom{"NodeFilter"} = $paramName if $idlType eq "NodeFilter"; - $needsCustom{"EventListener"} = $paramName if $idlType eq "EventListener"; - $needsCustom{"EventTarget"} = $paramName if $idlType eq "EventTarget"; - $needsCustom{"NodeToReturn"} = $paramName if $param->extendedAttributes->{"CustomReturn"}; - - unless ($codeGenerator->IsPrimitiveType($idlType) or $codeGenerator->IsStringType($idlType)) { - push(@needsAssert, " ASSERT($paramName);\n"); - } - - if ($parameterIndex >= 1) { - $functionSig .= " " . $param->name; - } - - $functionSig .= ":($paramType)$paramName"; - - $parameterIndex++; - } - - my @functionContent = (); - my $caller = "IMPL"; - - # special case the XPathNSResolver - if (defined $needsCustom{"XPathNSResolver"}) { - my $paramName = $needsCustom{"XPathNSResolver"}; - push(@functionContent, " WebCore::XPathNSResolver* nativeResolver = 0;\n"); - push(@functionContent, " RefPtr<WebCore::XPathNSResolver> customResolver;\n"); - push(@functionContent, " if ($paramName) {\n"); - push(@functionContent, " if ([$paramName isMemberOfClass:[DOMNativeXPathNSResolver class]])\n"); - push(@functionContent, " nativeResolver = core(static_cast<DOMNativeXPathNSResolver *>($paramName));\n"); - push(@functionContent, " else {\n"); - push(@functionContent, " customResolver = WebCore::DOMCustomXPathNSResolver::create($paramName);\n"); - push(@functionContent, " nativeResolver = WTF::getPtr(customResolver);\n"); - push(@functionContent, " }\n"); - push(@functionContent, " }\n"); - } - - # special case the EventTarget - if (defined $needsCustom{"EventTarget"}) { - my $paramName = $needsCustom{"EventTarget"}; - push(@functionContent, " DOMNode* ${paramName}ObjC = $paramName;\n"); - push(@functionContent, " WebCore::Node* ${paramName}Node = core(${paramName}ObjC);\n"); - $implIncludes{"DOMNode.h"} = 1; - $implIncludes{"Node.h"} = 1; - } - - if ($function->signature->extendedAttributes->{"ObjCUseDefaultView"}) { - push(@functionContent, " WebCore::DOMWindow* dv = $caller->defaultView();\n"); - push(@functionContent, " if (!dv)\n"); - push(@functionContent, " return nil;\n"); - $implIncludes{"DOMWindow.h"} = 1; - $caller = "dv"; - } - - # special case the EventListener - if (defined $needsCustom{"EventListener"}) { - my $paramName = $needsCustom{"EventListener"}; - push(@functionContent, " RefPtr<WebCore::EventListener> nativeEventListener = WebCore::ObjCEventListener::wrap($paramName);\n"); - } - - # special case the NodeFilter - if (defined $needsCustom{"NodeFilter"}) { - my $paramName = $needsCustom{"NodeFilter"}; - push(@functionContent, " RefPtr<WebCore::NodeFilter> nativeNodeFilter;\n"); - push(@functionContent, " if ($paramName)\n"); - push(@functionContent, " nativeNodeFilter = WebCore::NodeFilter::create(WebCore::ObjCNodeFilterCondition::create($paramName));\n"); - } - - # FIXME! We need [Custom] support for ObjC, to move these hacks into DOMSVGLength/MatrixCustom.mm - my $svgLengthConvertToSpecifiedUnits = ($svgPropertyType and $svgPropertyType eq "WebCore::SVGLength" and $functionName eq "convertToSpecifiedUnits"); - - push(@parameterNames, "WebCore::SVGLengthContext(IMPL->contextElement())") if $svgLengthConvertToSpecifiedUnits; - push(@parameterNames, "ec") if $raisesExceptions; - - # Handle arguments that are 'SVGProperty' based (SVGAngle/SVGLength). We need to convert from SVGPropertyTearOff<Type>* to Type, - # to be able to call the desired WebCore function. If the conversion fails, we can't extract Type and need to raise an exception. - my $currentParameter = -1; - foreach my $param (@{$function->parameters}) { - $currentParameter++; - - my $paramName = $param->name; - - # make a new parameter name if the original conflicts with a property name - $paramName = "in" . ucfirst($paramName) if $attributeNames{$paramName}; - - my $idlType = $param->type; - next if not $codeGenerator->IsSVGTypeNeedingTearOff($idlType) or $implClassName =~ /List$/; - - my $implGetter = GetObjCTypeGetter($paramName, $idlType); - my $idlTypeWithNamespace = GetSVGTypeWithNamespace($idlType); - - $implIncludes{"ExceptionCode.h"} = 1; - push(@functionContent, " $idlTypeWithNamespace* ${paramName}Core = $implGetter;\n"); - push(@functionContent, " if (!${paramName}Core) {\n"); - push(@functionContent, " WebCore::ExceptionCode ec = WebCore::TYPE_MISMATCH_ERR;\n"); - push(@functionContent, " $exceptionRaiseOnError\n"); - if ($returnType eq "void") { - push(@functionContent, " return;\n"); - } else { - push(@functionContent, " return nil;\n"); - } - push(@functionContent, " }\n"); - - # Replace the paramter core() getter, by the cached variable. - splice(@parameterNames, $currentParameter, 1, "${paramName}Core->propertyReference()"); - } - - my $content; - if ($function->signature->extendedAttributes->{"ImplementedBy"}) { - my $implementedBy = $function->signature->extendedAttributes->{"ImplementedBy"}; - $implIncludes{"${implementedBy}.h"} = 1; - unshift(@parameterNames, $caller); - $content = "${implementedBy}::" . $codeGenerator->WK_lcfirst($functionName) . "(" . join(", ", @parameterNames) . ")"; - } elsif ($svgPropertyType) { - $implIncludes{"ExceptionCode.h"} = 1; - push(@functionContent, " if (IMPL->isReadOnly()) {\n"); - push(@functionContent, " WebCore::raiseOnDOMError(WebCore::NO_MODIFICATION_ALLOWED_ERR);\n"); - if ($returnType eq "void") { - push(@functionContent, " return;\n"); - } else { - push(@functionContent, " return nil;\n"); - } - push(@functionContent, " }\n"); - push(@functionContent, " $svgPropertyType& podImpl = IMPL->propertyReference();\n"); - $content = "podImpl." . $codeGenerator->WK_lcfirst($functionName) . "(" . join(", ", @parameterNames) . ")"; - } else { - $content = "$caller->" . $codeGenerator->WK_lcfirst($functionName) . "(" . join(", ", @parameterNames) . ")"; - } - - if ($returnType eq "void") { - # Special case 'void' return type. - if ($raisesExceptions) { - push(@functionContent, " $exceptionInit\n"); - push(@functionContent, " $content;\n"); - if ($svgPropertyType) { - push(@functionContent, " if (!ec)\n"); - push(@functionContent, " IMPL->commitChange();\n"); - } - push(@functionContent, " $exceptionRaiseOnError\n"); - } else { - push(@functionContent, " $content;\n"); - push(@functionContent, " IMPL->commitChange();\n") if $svgPropertyType; - } - } elsif (defined $needsCustom{"NodeToReturn"}) { - # Special case the insertBefore, replaceChild, removeChild - # and appendChild functions from DOMNode - my $toReturn = $needsCustom{"NodeToReturn"}; - if ($raisesExceptions) { - push(@functionContent, " $exceptionInit\n"); - push(@functionContent, " if ($content)\n"); - push(@functionContent, " return $toReturn;\n"); - push(@functionContent, " $exceptionRaiseOnError\n"); - push(@functionContent, " return nil;\n"); - } else { - push(@functionContent, " if ($content)\n"); - push(@functionContent, " return $toReturn;\n"); - push(@functionContent, " return nil;\n"); - } - } elsif ($returnType eq "SerializedScriptValue") { - $content = "foo"; - } else { - if (ConversionNeeded($function->signature->type)) { - if ($codeGenerator->IsSVGTypeNeedingTearOff($function->signature->type) and not $implClassName =~ /List$/) { - my $idlTypeWithNamespace = GetSVGTypeWithNamespace($function->signature->type); - $content = "kit(WTF::getPtr(${idlTypeWithNamespace}::create($content)))"; - } else { - $content = "kit(WTF::getPtr($content))"; - } - } - - if ($raisesExceptions) { - # Differentiated between when the return type is a pointer and - # not for white space issue (ie. Foo *result vs. int result). - if ($returnType =~ /\*$/) { - $content = $returnType . "result = " . $content; - } else { - $content = $returnType . " result = " . $content; - } - - push(@functionContent, " $exceptionInit\n"); - push(@functionContent, " $content;\n"); - push(@functionContent, " $exceptionRaiseOnError\n"); - push(@functionContent, " return result;\n"); - } else { - push(@functionContent, " return $content;\n"); - } - } - - my $conditionalString = $codeGenerator->GenerateConditionalString($function->signature); - push(@implContent, "\n#if ${conditionalString}\n") if $conditionalString; - - push(@implContent, "$functionSig\n"); - push(@implContent, "{\n"); - push(@implContent, " $jsContextSetter\n"); - push(@implContent, @functionContent); - push(@implContent, "}\n\n"); - - push(@implContent, "#endif\n\n") if $conditionalString; - - # generate the old style method names with un-named parameters, these methods are deprecated - if (@{$function->parameters} > 1 and $function->signature->extendedAttributes->{"ObjCLegacyUnnamedParameters"}) { - my $deprecatedFunctionSig = $functionSig; - $deprecatedFunctionSig =~ s/\s\w+:/ :/g; # remove parameter names - - push(@implContent, "$deprecatedFunctionSig\n"); - push(@implContent, "{\n"); - push(@implContent, " $jsContextSetter\n"); - push(@implContent, @functionContent); - push(@implContent, "}\n\n"); - } - - # Clear the hash - %needsCustom = (); - } - } - - # END implementation - push(@implContent, "\@end\n"); - - # Generate internal interfaces - push(@implContent, "\n$implType* core($className *wrapper)\n"); - push(@implContent, "{\n"); - push(@implContent, " return wrapper ? reinterpret_cast<$implType*>(wrapper->_internal) : 0;\n"); - push(@implContent, "}\n\n"); - - if ($parentImplClassName eq "Object") { - push(@implContent, "$className *kit($implType* value)\n"); - push(@implContent, "{\n"); - push(@implContent, " $assertMainThread;\n"); - push(@implContent, " if (!value)\n"); - push(@implContent, " return nil;\n"); - push(@implContent, " if ($className *wrapper = getDOMWrapper(value))\n"); - push(@implContent, " return [[wrapper retain] autorelease];\n"); - if ($interface->extendedAttributes->{"ObjCPolymorphic"}) { - push(@implContent, " $className *wrapper = [[kitClass(value) alloc] _init];\n"); - push(@implContent, " if (!wrapper)\n"); - push(@implContent, " return nil;\n"); - } else { - push(@implContent, " $className *wrapper = [[$className alloc] _init];\n"); - } - push(@implContent, " wrapper->_internal = reinterpret_cast<DOMObjectInternal*>(value);\n"); - push(@implContent, " value->ref();\n"); - push(@implContent, " addDOMWrapper(wrapper, value);\n"); - push(@implContent, " return [wrapper autorelease];\n"); - push(@implContent, "}\n"); - } else { - push(@implContent, "$className *kit($implType* value)\n"); - push(@implContent, "{\n"); - push(@implContent, " $assertMainThread;\n"); - push(@implContent, " return static_cast<$className*>(kit(static_cast<WebCore::$baseClass*>(value)));\n"); - push(@implContent, "}\n"); - } - - # - End the ifdef conditional if necessary - push(@implContent, "\n#endif // ${conditionalString}\n") if $conditionalString; - - # - Generate dependencies. - if ($writeDependencies && @ancestorInterfaceNames) { - push(@depsContent, "$className.h : ", join(" ", map { "$_.idl" } @ancestorInterfaceNames), "\n"); - push(@depsContent, map { "$_.idl :\n" } @ancestorInterfaceNames); - } -} - -# Internal helper -sub WriteData -{ - my $object = shift; - my $dataNode = shift; - my $outputDir = shift; - - # Open files for writing... - my $name = $dataNode->name; - my $prefix = FileNamePrefix; - my $headerFileName = "$outputDir/$prefix$name.h"; - my $privateHeaderFileName = "$outputDir/$prefix${name}Private.h"; - my $implFileName = "$outputDir/$prefix$name.mm"; - my $internalHeaderFileName = "$outputDir/$prefix${name}Internal.h"; - my $depsFileName = "$outputDir/$prefix$name.dep"; - - # Write public header. - my $contents = join "", @headerContentHeader; - map { $contents .= "\@class $_;\n" } sort keys(%headerForwardDeclarations); - map { $contents .= "\@protocol $_;\n" } sort keys(%headerForwardDeclarationsForProtocols); - - my $hasForwardDeclarations = keys(%headerForwardDeclarations) + keys(%headerForwardDeclarationsForProtocols); - $contents .= "\n" if $hasForwardDeclarations; - $contents .= join "", @headerContent; - $codeGenerator->UpdateFile($headerFileName, $contents); - - @headerContentHeader = (); - @headerContent = (); - %headerForwardDeclarations = (); - %headerForwardDeclarationsForProtocols = (); - - if (@privateHeaderContent > 0) { - $contents = join "", @privateHeaderContentHeader; - map { $contents .= "\@class $_;\n" } sort keys(%privateHeaderForwardDeclarations); - map { $contents .= "\@protocol $_;\n" } sort keys(%privateHeaderForwardDeclarationsForProtocols); - - $hasForwardDeclarations = keys(%privateHeaderForwardDeclarations) + keys(%privateHeaderForwardDeclarationsForProtocols); - $contents .= "\n" if $hasForwardDeclarations; - $contents .= join "", @privateHeaderContent; - $codeGenerator->UpdateFile($privateHeaderFileName, $contents); - - @privateHeaderContentHeader = (); - @privateHeaderContent = (); - %privateHeaderForwardDeclarations = (); - %privateHeaderForwardDeclarationsForProtocols = (); - } - - # Write implementation file. - unless ($noImpl) { - $contents = join "", @implContentHeader; - map { $contents .= "#import \"$_\"\n" } sort keys(%implIncludes); - $contents .= join "", @implContent; - $codeGenerator->UpdateFile($implFileName, $contents); - - @implContentHeader = (); - @implContent = (); - %implIncludes = (); - } - - if (@internalHeaderContent > 0) { - $contents = join "", @internalHeaderContent; - $codeGenerator->UpdateFile($internalHeaderFileName, $contents); - - @internalHeaderContent = (); - } - - # Write dependency file. - if (@depsContent) { - $contents = join "", @depsContent; - $codeGenerator->UpdateFile($depsFileName, $contents); - - @depsContent = (); - } -} - -1; diff --git a/contrib/dom/scripts/CodeGeneratorV8.pm b/contrib/dom/scripts/CodeGeneratorV8.pm deleted file mode 100644 index 7652cd2..0000000 --- a/contrib/dom/scripts/CodeGeneratorV8.pm +++ /dev/null @@ -1,4231 +0,0 @@ -# Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> -# Copyright (C) 2006 Anders Carlsson <andersca@mac.com> -# Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> -# Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> -# Copyright (C) 2006 Apple Computer, Inc. -# Copyright (C) 2007, 2008, 2009, 2012 Google Inc. -# Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> -# Copyright (C) Research In Motion Limited 2010. All rights reserved. -# Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) -# Copyright (C) 2012 Ericsson AB. All rights reserved. -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library 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. See the GNU -# Library General Public License for more details. -# -# You should have received a copy of the GNU Library General Public License -# along with this library; see the file COPYING.LIB. If not, write to -# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. -# - -package CodeGeneratorV8; - -use strict; - -use constant FileNamePrefix => "V8"; - -my $codeGenerator; - - -my @headerContent = (); -my @implContentHeader = (); -my @implContent = (); -my @implContentDecls = (); -my %implIncludes = (); -my %headerIncludes = (); - -# Default .h template -my $headerTemplate = << "EOF"; -/* - This file is part of the WebKit open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ -EOF - -# Default constructor -sub new -{ - my $object = shift; - my $reference = { }; - - $codeGenerator = shift; - - bless($reference, $object); - return $reference; -} - -sub GenerateInterface -{ - my $object = shift; - my $interface = shift; - - # Start actual generation - if ($interface->extendedAttributes->{"Callback"}) { - $object->GenerateCallbackHeader($interface); - $object->GenerateCallbackImplementation($interface); - } else { - $object->GenerateHeader($interface); - $object->GenerateImplementation($interface); - } -} - -sub AddToImplIncludes -{ - my $header = shift; - my $conditional = shift; - - if (not $conditional) { - $implIncludes{$header} = 1; - } elsif (not exists($implIncludes{$header})) { - $implIncludes{$header} = $conditional; - } else { - my $oldValue = $implIncludes{$header}; - if ($oldValue ne 1) { - my %newValue = (); - $newValue{$conditional} = 1; - foreach my $condition (split(/\|/, $oldValue)) { - $newValue{$condition} = 1; - } - $implIncludes{$header} = join("|", sort keys %newValue); - } - } -} - -sub AddIncludesForType -{ - my $type = shift; - - # When we're finished with the one-file-per-class - # reorganization, we won't need these special cases. - if ($codeGenerator->IsTypedArrayType($type)) { - AddToImplIncludes("wtf/${type}.h"); - } - if (!$codeGenerator->IsPrimitiveType($type) and !$codeGenerator->IsStringType($type) and !$codeGenerator->SkipIncludeHeader($type) and $type ne "Date") { - # default, include the same named file - AddToImplIncludes(GetV8HeaderName(${type})); - - if ($type =~ /SVGPathSeg/) { - my $joinedName = $type; - $joinedName =~ s/Abs|Rel//; - AddToImplIncludes("${joinedName}.h"); - } - } - - # additional includes (things needed to compile the bindings but not the header) - - if ($type eq "CanvasRenderingContext2D") { - AddToImplIncludes("CanvasGradient.h"); - AddToImplIncludes("CanvasPattern.h"); - AddToImplIncludes("CanvasStyle.h"); - } - - if ($type eq "CanvasGradient" or $type eq "XPathNSResolver") { - AddToImplIncludes("wtf/text/WTFString.h"); - } - - if ($type eq "CSSStyleSheet" or $type eq "StyleSheet") { - AddToImplIncludes("CSSImportRule.h"); - } - - if ($type eq "CSSStyleDeclaration") { - AddToImplIncludes("StylePropertySet.h"); - } - - if ($type eq "Plugin" or $type eq "PluginArray" or $type eq "MimeTypeArray") { - # So we can get String -> AtomicString conversion for namedItem(). - AddToImplIncludes("wtf/text/AtomicString.h"); - } -} - -sub NeedsCustomOpaqueRootForGC -{ - my $interface = shift; - return GetGenerateIsReachable($interface) || GetCustomIsReachable($interface); -} - -sub GetGenerateIsReachable -{ - my $interface = shift; - return $interface->extendedAttributes->{"GenerateIsReachable"} || $interface->extendedAttributes->{"V8GenerateIsReachable"} || "" -} - -sub GetCustomIsReachable -{ - my $interface = shift; - return $interface->extendedAttributes->{"CustomIsReachable"} || $interface->extendedAttributes->{"V8CustomIsReachable"}; -} - -sub GenerateOpaqueRootForGC -{ - my $interface = shift; - my $interfaceName = $interface->name; - - if (GetCustomIsReachable($interface)) { - return; - } - - push(@implContent, <<END); -void* V8${interfaceName}::opaqueRootForGC(void* object, v8::Persistent<v8::Object> wrapper) -{ - ASSERT(!wrapper.IsIndependent()); - ${interfaceName}* impl = static_cast<${interfaceName}*>(object); -END - if (GetGenerateIsReachable($interface) eq "ImplDocument" || - GetGenerateIsReachable($interface) eq "ImplElementRoot" || - GetGenerateIsReachable($interface) eq "ImplOwnerRoot" || - GetGenerateIsReachable($interface) eq "ImplOwnerNodeRoot") { - - $implIncludes{"V8GCController.h"} = 1; - - my $methodName; - $methodName = "document" if (GetGenerateIsReachable($interface) eq "ImplDocument"); - $methodName = "element" if (GetGenerateIsReachable($interface) eq "ImplElementRoot"); - $methodName = "owner" if (GetGenerateIsReachable($interface) eq "ImplOwnerRoot"); - $methodName = "ownerNode" if (GetGenerateIsReachable($interface) eq "ImplOwnerNodeRoot"); - - push(@implContent, <<END); - if (Node* owner = impl->${methodName}()) - return V8GCController::opaqueRootForGC(owner); -END - } - - push(@implContent, <<END); - return object; -} - -END -} - -sub GetSVGPropertyTypes -{ - my $implType = shift; - - my $svgPropertyType; - my $svgListPropertyType; - my $svgNativeType; - - return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $implType =~ /SVG/; - - $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($implType); - return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $svgNativeType; - - # Append space to avoid compilation errors when using PassRefPtr<$svgNativeType> - $svgNativeType = "$svgNativeType "; - - my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implType); - if ($svgNativeType =~ /SVGPropertyTearOff/) { - $svgPropertyType = $svgWrappedNativeType; - AddToImplIncludes("SVGAnimatedPropertyTearOff.h"); - } elsif ($svgNativeType =~ /SVGListPropertyTearOff/ or $svgNativeType =~ /SVGStaticListPropertyTearOff/) { - $svgListPropertyType = $svgWrappedNativeType; - $headerIncludes{"SVGAnimatedListPropertyTearOff.h"} = 1; - $headerIncludes{"SVGStaticListPropertyTearOff.h"} = 1; - } elsif ($svgNativeType =~ /SVGTransformListPropertyTearOff/) { - $svgListPropertyType = $svgWrappedNativeType; - $headerIncludes{"SVGAnimatedListPropertyTearOff.h"} = 1; - $headerIncludes{"SVGTransformListPropertyTearOff.h"} = 1; - } elsif ($svgNativeType =~ /SVGPathSegListPropertyTearOff/) { - $svgListPropertyType = $svgWrappedNativeType; - $headerIncludes{"SVGPathSegListPropertyTearOff.h"} = 1; - } - - if ($svgPropertyType) { - $svgPropertyType = "SVGPoint" if $svgPropertyType eq "FloatPoint"; - } - - return ($svgPropertyType, $svgListPropertyType, $svgNativeType); -} - -sub GenerateHeader -{ - my $object = shift; - my $interface = shift; - - my $interfaceName = $interface->name; - my $v8InterfaceName = "V8$interfaceName"; - - # Copy contents of parent interfaces except the first parent. - my @parents; - $codeGenerator->AddMethodsConstantsAndAttributesFromParentInterfaces($interface, \@parents, 1); - $codeGenerator->LinkOverloadedFunctions($interface); - - # Ensure the IsDOMNodeType function is in sync. - die("IsDOMNodeType is out of date with respect to $interfaceName") if IsDOMNodeType($interfaceName) != $codeGenerator->IsSubType($interface, "Node"); - - my $hasDependentLifetime = $interface->extendedAttributes->{"V8DependentLifetime"} || $interface->extendedAttributes->{"ActiveDOMObject"} - || GetGenerateIsReachable($interface) || $v8InterfaceName =~ /SVG/; - if (!$hasDependentLifetime) { - foreach (@{$interface->parents}) { - my $parent = $_; - $headerIncludes{"V8${parent}.h"} = 1; - } - } - - # - Add default header template - push(@headerContent, GenerateHeaderContentHeader($interface)); - - $headerIncludes{"wtf/text/StringHash.h"} = 1; - $headerIncludes{"WrapperTypeInfo.h"} = 1; - $headerIncludes{"V8Binding.h"} = 1; - $headerIncludes{"V8DOMWrapper.h"} = 1; - $headerIncludes{"wtf/HashMap.h"} = 1; - $headerIncludes{"v8.h"} = 1; - - my $headerClassInclude = GetHeaderClassInclude($interfaceName); - $headerIncludes{$headerClassInclude} = 1 if $headerClassInclude ne ""; - - my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($interfaceName); - - foreach my $headerInclude (sort keys(%headerIncludes)) { - if ($headerInclude =~ /wtf|v8\.h/) { - push(@headerContent, "#include \<${headerInclude}\>\n"); - } else { - push(@headerContent, "#include \"${headerInclude}\"\n"); - } - } - - push(@headerContent, "\nnamespace WebCore {\n"); - push(@headerContent, "\ntemplate<typename PropertyType> class SVGPropertyTearOff;\n") if $svgPropertyType; - if ($svgNativeType) { - if ($svgNativeType =~ /SVGStaticListPropertyTearOff/) { - push(@headerContent, "\ntemplate<typename PropertyType> class SVGStaticListPropertyTearOff;\n"); - } else { - push(@headerContent, "\ntemplate<typename PropertyType> class SVGListPropertyTearOff;\n"); - } - } - - push(@headerContent, "\n"); - push(@headerContent, "class FloatRect;\n") if $svgPropertyType && $svgPropertyType eq "FloatRect"; - push(@headerContent, "class Dictionary;\n") if $codeGenerator->IsConstructorTemplate($interface, "Event"); - - my $nativeType = GetNativeTypeForConversions($interface); - if ($interface->extendedAttributes->{"NamedConstructor"}) { - push(@headerContent, <<END); -class V8${nativeType}Constructor { -public: - static v8::Persistent<v8::FunctionTemplate> GetTemplate(); - static WrapperTypeInfo info; -}; - -END - } - - push(@headerContent, "class $v8InterfaceName {\n"); - push(@headerContent, "public:\n"); - - push(@headerContent, " static const bool hasDependentLifetime = "); - if ($hasDependentLifetime) { - push(@headerContent, "true;\n"); - } elsif (@{$interface->parents}) { - # Even if this type doesn't have the V8DependentLifetime attribute its parents may. - # Let the compiler statically determine this for us. - my $separator = ""; - foreach (@{$interface->parents}) { - my $parent = $_; - $headerIncludes{"V8${parent}.h"} = 1; - push(@headerContent, "${separator}V8${parent}::hasDependentLifetime"); - $separator = " || "; - } - push(@headerContent, ";\n"); - } else { - push(@headerContent, "false;\n"); - } - - push(@headerContent, <<END); - static bool HasInstance(v8::Handle<v8::Value>); - static v8::Persistent<v8::FunctionTemplate> GetRawTemplate(); - static v8::Persistent<v8::FunctionTemplate> GetTemplate(); - static ${nativeType}* toNative(v8::Handle<v8::Object> object) - { - return reinterpret_cast<${nativeType}*>(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)); - } - static void derefObject(void*); - static WrapperTypeInfo info; -END - - if (NeedsCustomOpaqueRootForGC($interface)) { - push(@headerContent, " static void* opaqueRootForGC(void*, v8::Persistent<v8::Object>);\n"); - } - - if ($interface->extendedAttributes->{"ActiveDOMObject"}) { - push(@headerContent, " static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>);\n"); - } - - if ($interfaceName eq "DOMWindow") { - push(@headerContent, <<END); - static v8::Persistent<v8::ObjectTemplate> GetShadowObjectTemplate(); -END - } - - if ($interfaceName eq "HTMLDocument") { - push(@headerContent, <<END); - static v8::Local<v8::Object> wrapInShadowObject(v8::Local<v8::Object> wrapper, Node* impl); - static v8::Handle<v8::Value> getNamedProperty(HTMLDocument* htmlDocument, const AtomicString& key, v8::Handle<v8::Object> creationContext, v8::Isolate*); -END - } - - my @enabledPerContextFunctions; - foreach my $function (@{$interface->functions}) { - my $name = $function->signature->name; - my $attrExt = $function->signature->extendedAttributes; - - if (($attrExt->{"Custom"} || $attrExt->{"V8Custom"}) && !$attrExt->{"ImplementedBy"} && $function->{overloadIndex} == 1) { - my $conditionalString = $codeGenerator->GenerateConditionalString($function->signature); - push(@headerContent, "#if ${conditionalString}\n") if $conditionalString; - push(@headerContent, <<END); - static v8::Handle<v8::Value> ${name}Callback(const v8::Arguments&); -END - push(@headerContent, "#endif // ${conditionalString}\n") if $conditionalString; - } - if ($attrExt->{"V8EnabledPerContext"}) { - push(@enabledPerContextFunctions, $function); - } - } - - if (IsConstructable($interface)) { - push(@headerContent, <<END); - static v8::Handle<v8::Value> constructorCallback(const v8::Arguments&); -END - } - if (HasCustomConstructor($interface)) { - push(@headerContent, <<END); - static v8::Handle<v8::Value> constructorCallbackCustom(const v8::Arguments&); -END - } - - my @enabledPerContextAttributes; - foreach my $attribute (@{$interface->attributes}) { - my $name = $attribute->signature->name; - my $attrExt = $attribute->signature->extendedAttributes; - my $conditionalString = $codeGenerator->GenerateConditionalString($attribute->signature); - if (($attrExt->{"V8CustomGetter"} || $attrExt->{"CustomGetter"} || - $attrExt->{"V8Custom"} || $attrExt->{"Custom"}) && - !$attrExt->{"ImplementedBy"}) { - push(@headerContent, "#if ${conditionalString}\n") if $conditionalString; - push(@headerContent, <<END); - static v8::Handle<v8::Value> ${name}AccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo&); -END - push(@headerContent, "#endif // ${conditionalString}\n") if $conditionalString; - } - if (($attrExt->{"V8CustomSetter"} || $attrExt->{"CustomSetter"} || - $attrExt->{"V8Custom"} || $attrExt->{"Custom"}) && - !$attrExt->{"ImplementedBy"}) { - push(@headerContent, "#if ${conditionalString}\n") if $conditionalString; - push(@headerContent, <<END); - static void ${name}AccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value>, const v8::AccessorInfo&); -END - push(@headerContent, "#endif // ${conditionalString}\n") if $conditionalString; - } - if ($attrExt->{"V8EnabledPerContext"}) { - push(@enabledPerContextAttributes, $attribute); - } - } - - GenerateHeaderNamedAndIndexedPropertyAccessors($interface); - GenerateHeaderCustomCall($interface); - GenerateHeaderCustomInternalFieldIndices($interface); - - if ($interface->extendedAttributes->{"CheckSecurity"}) { - push(@headerContent, <<END); - static bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType, v8::Local<v8::Value> data); - static bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType, v8::Local<v8::Value> data); -END - } - - if (@enabledPerContextAttributes) { - push(@headerContent, <<END); - static void installPerContextProperties(v8::Handle<v8::Object>, ${nativeType}*); -END - } else { - push(@headerContent, <<END); - static void installPerContextProperties(v8::Handle<v8::Object>, ${nativeType}*) { } -END - } - - if (@enabledPerContextFunctions) { - push(@headerContent, <<END); - static void installPerContextPrototypeProperties(v8::Handle<v8::Object>); -END - } else { - push(@headerContent, <<END); - static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { } -END - } - - if ($interfaceName eq "HTMLElement") { - push(@headerContent, <<END); - friend v8::Handle<v8::Object> createV8HTMLWrapper(HTMLElement*, v8::Handle<v8::Object> creationContext, v8::Isolate*); - friend v8::Handle<v8::Object> createV8HTMLDirectWrapper(HTMLElement*, v8::Handle<v8::Object> creationContext, v8::Isolate*); -END - } elsif ($interfaceName eq "SVGElement") { - push(@headerContent, <<END); - friend v8::Handle<v8::Object> createV8SVGWrapper(SVGElement*, v8::Handle<v8::Object> creationContext, v8::Isolate*); - friend v8::Handle<v8::Object> createV8SVGDirectWrapper(SVGElement*, v8::Handle<v8::Object> creationContext, v8::Isolate*); - friend v8::Handle<v8::Object> createV8SVGFallbackWrapper(SVGElement*, v8::Handle<v8::Object> creationContext, v8::Isolate*); -END - } elsif ($interfaceName eq "HTMLUnknownElement") { - push(@headerContent, <<END); - friend v8::Handle<v8::Object> createV8HTMLFallbackWrapper(HTMLUnknownElement*, v8::Handle<v8::Object> creationContext, v8::Isolate*); -END - } elsif ($interfaceName eq "Element") { - push(@headerContent, <<END); - // This is a performance optimization hack. See V8Element::wrap. - friend v8::Handle<v8::Object> wrap(Node*, v8::Handle<v8::Object> creationContext, v8::Isolate*); -END - } - - push(@headerContent, <<END); -private: -END - - if (IsConstructable($interface) && @{$interface->constructors} > 1) { - for (my $i = 1; $i <= @{$interface->constructors}; $i++) { - push(@headerContent, <<END); - static v8::Handle<v8::Value> constructor${i}Callback(const v8::Arguments&); -END - } - } - - my $noToV8 = $interface->extendedAttributes->{"SuppressToJSObject"}; - my $noWrap = $interface->extendedAttributes->{"V8NoWrapperCache"} || $noToV8; - if (!$noWrap) { - my $createWrapperArgumentType = GetPassRefPtrType($nativeType); - push(@headerContent, <<END); - friend v8::Handle<v8::Object> wrap(${nativeType}*, v8::Handle<v8::Object> creationContext, v8::Isolate*); - static v8::Handle<v8::Object> createWrapper(${createWrapperArgumentType}, v8::Handle<v8::Object> creationContext, v8::Isolate*); -END - } - - push(@headerContent, <<END); -}; - -END - - my $customWrap = !!($interface->extendedAttributes->{"CustomToJSObject"} or $interface->extendedAttributes->{"V8CustomToJSObject"}); - if ($noToV8) { - die "Can't suppress toV8 for subclass\n" if @parents; - } elsif ($noWrap) { - die "Must have custom toV8\n" if !$customWrap; - push(@headerContent, <<END); -class ${nativeType}; -v8::Handle<v8::Value> toV8(${nativeType}*, v8::Handle<v8::Object> creationContext = v8::Handle<v8::Object>(), v8::Isolate* = 0); - -template<class HolderContainer, class Wrappable> -inline v8::Handle<v8::Value> toV8Fast(${nativeType}* impl, const HolderContainer& container, Wrappable*) -{ - return toV8(impl, container.Holder(), container.GetIsolate()); -} -END - } else { - - my $createWrapperCall = $customWrap ? "${v8InterfaceName}::wrap" : "${v8InterfaceName}::createWrapper"; - - if ($customWrap) { - push(@headerContent, <<END); - -v8::Handle<v8::Object> wrap(${nativeType}* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* = 0); -END - } else { - push(@headerContent, <<END); - -inline v8::Handle<v8::Object> wrap(${nativeType}* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate = 0) -{ - ASSERT(impl); - ASSERT(DOMDataStore::getWrapper(impl, isolate).IsEmpty()); - return $createWrapperCall(impl, creationContext, isolate); -} -END - } - - push(@headerContent, <<END); - -inline v8::Handle<v8::Value> toV8(${nativeType}* impl, v8::Handle<v8::Object> creationContext = v8::Handle<v8::Object>(), v8::Isolate* isolate = 0) -{ - if (UNLIKELY(!impl)) - return v8NullWithCheck(isolate); - v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper(impl, isolate); - if (!wrapper.IsEmpty()) - return wrapper; - return wrap(impl, creationContext, isolate); -} - -template<class HolderContainer, class Wrappable> -inline v8::Handle<v8::Value> toV8Fast(${nativeType}* impl, const HolderContainer& container, Wrappable* wrappable) -{ - if (UNLIKELY(!impl)) - return v8Null(container.GetIsolate()); - v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast(impl, container, wrappable); - if (!wrapper.IsEmpty()) - return wrapper; - return wrap(impl, container.Holder(), container.GetIsolate()); -} -END - } - - push(@headerContent, <<END); - -template<class HolderContainer, class Wrappable> -inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< ${nativeType} > impl, const HolderContainer& container, Wrappable* wrappable) -{ - return toV8Fast(impl.get(), container, wrappable); -} - -inline v8::Handle<v8::Value> toV8(PassRefPtr< ${nativeType} > impl, v8::Handle<v8::Object> creationContext = v8::Handle<v8::Object>(), v8::Isolate* isolate = 0) -{ - return toV8(impl.get(), creationContext, isolate); -} -END - - if ($codeGenerator->IsConstructorTemplate($interface, "Event")) { - push(@headerContent, "\nbool fill${interfaceName}Init(${interfaceName}Init&, const Dictionary&);\n"); - } - - push(@headerContent, "\n}\n\n"); - push(@headerContent, "#endif // $v8InterfaceName" . "_h\n"); - - my $conditionalString = $codeGenerator->GenerateConditionalString($interface); - push(@headerContent, "#endif // ${conditionalString}\n\n") if $conditionalString; -} - -sub GetInternalFields -{ - my $interface = shift; - - my @customInternalFields = (); - # We can't ask whether a parent type has a given extendedAttribute, - # so special-case AbstractWorker and WorkerContext to include all sub-types. - # Event listeners on DOM nodes are explicitly supported in the GC controller. - # FIXME: Simplify this when all EventTargets are subtypes of EventTarget. - if (!$codeGenerator->IsSubType($interface, "Node") - && ($interface->extendedAttributes->{"EventTarget"} - || $interface->extendedAttributes->{"IsWorkerContext"} - || $codeGenerator->IsSubType($interface, "AbstractWorker") - || $codeGenerator->IsSubType($interface, "EventTarget"))) { - push(@customInternalFields, "eventListenerCacheIndex"); - } - - return @customInternalFields; -} - -sub GetHeaderClassInclude -{ - my $v8InterfaceName = shift; - if ($v8InterfaceName =~ /SVGPathSeg/) { - $v8InterfaceName =~ s/Abs|Rel//; - } - return "wtf/${v8InterfaceName}.h" if $codeGenerator->IsTypedArrayType($v8InterfaceName); - return "" if ($codeGenerator->SkipIncludeHeader($v8InterfaceName)); - return "${v8InterfaceName}.h"; -} - -sub GenerateHeaderCustomInternalFieldIndices -{ - my $interface = shift; - my @customInternalFields = GetInternalFields($interface); - my $customFieldCounter = 0; - foreach my $customInternalField (@customInternalFields) { - push(@headerContent, <<END); - static const int ${customInternalField} = v8DefaultWrapperInternalFieldCount + ${customFieldCounter}; -END - $customFieldCounter++; - } - push(@headerContent, <<END); - static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + ${customFieldCounter}; -END -} - -my %indexerSpecialCases = ( - "Storage" => 1, - "HTMLAppletElement" => 1, - "HTMLEmbedElement" => 1, - "HTMLObjectElement" => 1 -); - -sub GenerateHeaderNamedAndIndexedPropertyAccessors -{ - my $interface = shift; - my $interfaceName = $interface->name; - my $hasCustomIndexedGetter = $interface->extendedAttributes->{"IndexedGetter"} || $interface->extendedAttributes->{"CustomGetOwnPropertySlot"}; - my $hasCustomIndexedSetter = $interface->extendedAttributes->{"CustomIndexedSetter"} && !$interface->extendedAttributes->{"NumericIndexedGetter"}; - my $hasCustomNamedGetter = $interface->extendedAttributes->{"NamedGetter"} || $interface->extendedAttributes->{"CustomNamedGetter"} || $interface->extendedAttributes->{"CustomGetOwnPropertySlot"}; - my $hasCustomNamedSetter = $interface->extendedAttributes->{"CustomNamedSetter"}; - my $hasCustomDeleters = $interface->extendedAttributes->{"CustomDeleteProperty"}; - my $hasCustomEnumerator = $interface->extendedAttributes->{"CustomEnumerateProperty"}; - if ($interfaceName eq "HTMLOptionsCollection") { - $interfaceName = "HTMLCollection"; - $hasCustomIndexedGetter = 1; - $hasCustomNamedGetter = 1; - } - if ($interfaceName eq "DOMWindow") { - $hasCustomDeleters = 0; - $hasCustomEnumerator = 0; - } - if ($interfaceName eq "HTMLAppletElement" || $interfaceName eq "HTMLEmbedElement" || $interfaceName eq "HTMLObjectElement") { - $hasCustomNamedGetter = 1; - } - if ($interfaceName eq "HTMLDocument") { - $hasCustomNamedGetter = 0; - $hasCustomIndexedGetter = 0; - } - my $isIndexerSpecialCase = exists $indexerSpecialCases{$interfaceName}; - - if ($hasCustomIndexedGetter || $isIndexerSpecialCase) { - push(@headerContent, <<END); - static v8::Handle<v8::Value> indexedPropertyGetter(uint32_t, const v8::AccessorInfo&); -END - } - - if ($isIndexerSpecialCase || $hasCustomIndexedSetter) { - push(@headerContent, <<END); - static v8::Handle<v8::Value> indexedPropertySetter(uint32_t, v8::Local<v8::Value>, const v8::AccessorInfo&); -END - } - if ($hasCustomDeleters) { - push(@headerContent, <<END); - static v8::Handle<v8::Boolean> indexedPropertyDeleter(uint32_t, const v8::AccessorInfo&); -END - } - if ($hasCustomNamedGetter) { - push(@headerContent, <<END); - static v8::Handle<v8::Value> namedPropertyGetter(v8::Local<v8::String>, const v8::AccessorInfo&); -END - } - if ($hasCustomNamedSetter) { - push(@headerContent, <<END); - static v8::Handle<v8::Value> namedPropertySetter(v8::Local<v8::String>, v8::Local<v8::Value>, const v8::AccessorInfo&); -END - } - if ($hasCustomDeleters) { - push(@headerContent, <<END); - static v8::Handle<v8::Boolean> namedPropertyDeleter(v8::Local<v8::String>, const v8::AccessorInfo&); -END - } - if ($hasCustomEnumerator) { - push(@headerContent, <<END); - static v8::Handle<v8::Array> namedPropertyEnumerator(const v8::AccessorInfo&); - static v8::Handle<v8::Integer> namedPropertyQuery(v8::Local<v8::String>, const v8::AccessorInfo&); -END - } -} - -sub GenerateHeaderCustomCall -{ - my $interface = shift; - - if ($interface->extendedAttributes->{"CustomCall"}) { - push(@headerContent, " static v8::Handle<v8::Value> callAsFunctionCallback(const v8::Arguments&);\n"); - } - if ($interface->name eq "Event") { - push(@headerContent, " static v8::Handle<v8::Value> dataTransferAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo&);\n"); - push(@headerContent, " static void valueAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value>, const v8::AccessorInfo&);\n"); - } - if ($interface->name eq "Location") { - push(@headerContent, " static v8::Handle<v8::Value> assignAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo&);\n"); - push(@headerContent, " static v8::Handle<v8::Value> reloadAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo&);\n"); - push(@headerContent, " static v8::Handle<v8::Value> replaceAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo&);\n"); - } -} - -sub IsConstructable -{ - my $interface = shift; - - return $interface->extendedAttributes->{"CustomConstructor"} || $interface->extendedAttributes->{"V8CustomConstructor"} || $interface->extendedAttributes->{"Constructor"} || $interface->extendedAttributes->{"ConstructorTemplate"}; -} - -sub HasCustomConstructor -{ - my $interface = shift; - - return $interface->extendedAttributes->{"CustomConstructor"} || $interface->extendedAttributes->{"V8CustomConstructor"}; -} - -sub IsReadonly -{ - my $attribute = shift; - my $attrExt = $attribute->signature->extendedAttributes; - return ($attribute->type =~ /readonly/ || $attrExt->{"V8ReadOnly"}) && !$attrExt->{"Replaceable"}; -} - -sub GenerateDomainSafeFunctionGetter -{ - my $function = shift; - my $interfaceName = shift; - - my $v8InterfaceName = "V8" . $interfaceName; - my $funcName = $function->signature->name; - - my $signature = "v8::Signature::New(" . $v8InterfaceName . "::GetRawTemplate())"; - if ($function->signature->extendedAttributes->{"V8DoNotCheckSignature"}) { - $signature = "v8::Local<v8::Signature>()"; - } - - my $callback = GetFunctionTemplateCallbackName($function, $interfaceName); - my $newTemplateString = "v8::FunctionTemplate::New($callback, v8Undefined(), $signature)"; - - AddToImplIncludes("Frame.h"); - push(@implContentDecls, <<END); -static v8::Handle<v8::Value> ${funcName}AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) -{ - static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New($newTemplateString); - v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(${v8InterfaceName}::GetTemplate()); - if (holder.IsEmpty()) { - // can only reach here by 'object.__proto__.func', and it should passed - // domain security check already - return privateTemplate->GetFunction(); - } - ${interfaceName}* imp = ${v8InterfaceName}::toNative(holder); - if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame(), DoNotReportSecurityError)) { - static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New($newTemplateString); - return sharedTemplate->GetFunction(); - } - - v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(name); - if (!hiddenValue.IsEmpty()) - return hiddenValue; - - return privateTemplate->GetFunction(); -} - -END -} - -sub GenerateDomainSafeFunctionSetter -{ - my $interfaceName = shift; - my $v8InterfaceName = "V8" . $interfaceName; - - push(@implContentDecls, <<END); -static void ${interfaceName}DomainSafeFunctionSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) -{ - v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(${v8InterfaceName}::GetTemplate()); - if (holder.IsEmpty()) - return; - ${interfaceName}* imp = ${v8InterfaceName}::toNative(holder); - if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame())) - return; - - info.This()->SetHiddenValue(name, value); -} - -END -} - -sub GenerateConstructorGetter -{ - my $interface = shift; - my $interfaceName = $interface->name; - - push(@implContentDecls, <<END); -static v8::Handle<v8::Value> ${interfaceName}ConstructorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) -{ - v8::Handle<v8::Value> data = info.Data(); - ASSERT(data->IsExternal()); - V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->CreationContext()); - if (!perContextData) - return v8Undefined(); - return perContextData->constructorForType(WrapperTypeInfo::unwrap(data)); -} -END -} - -sub GenerateFeatureObservation -{ - my $measureAs = shift; - - if ($measureAs) { - AddToImplIncludes("FeatureObserver.h"); - return " FeatureObserver::observe(activeDOMWindow(BindingState::instance()), FeatureObserver::${measureAs});\n"; - } - - return ""; -} - -sub GenerateNormalAttrGetter -{ - my $attribute = shift; - my $interface = shift; - - my $interfaceName = $interface->name; - my $v8InterfaceName = "V8$interfaceName"; - my $attrExt = $attribute->signature->extendedAttributes; - my $attrName = $attribute->signature->name; - my $attrType = $attribute->signature->type; - $codeGenerator->AssertNotSequenceType($attrType); - my $nativeType = GetNativeTypeFromSignature($attribute->signature, -1); - - my $getterStringUsesImp = $interfaceName ne "SVGNumber"; - my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($interfaceName); - - # Getter - my $conditionalString = $codeGenerator->GenerateConditionalString($attribute->signature); - push(@implContentDecls, "#if ${conditionalString}\n\n") if $conditionalString; - - push(@implContentDecls, <<END); -static v8::Handle<v8::Value> ${attrName}AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) -{ -END - push(@implContentDecls, GenerateFeatureObservation($attrExt->{"V8MeasureAs"})); - - if ($svgNativeType) { - my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($interfaceName); - if ($svgWrappedNativeType =~ /List/) { - push(@implContentDecls, <<END); - $svgNativeType* imp = ${v8InterfaceName}::toNative(info.Holder()); -END - } else { - push(@implContentDecls, <<END); - $svgNativeType* wrapper = ${v8InterfaceName}::toNative(info.Holder()); - $svgWrappedNativeType& impInstance = wrapper->propertyReference(); -END - if ($getterStringUsesImp) { - push(@implContentDecls, <<END); - $svgWrappedNativeType* imp = &impInstance; -END - } - } - } elsif ($attrExt->{"V8OnProto"} || $attrExt->{"V8Unforgeable"}) { - if ($interfaceName eq "DOMWindow") { - push(@implContentDecls, <<END); - v8::Handle<v8::Object> holder = info.Holder(); -END - } else { - # perform lookup first - push(@implContentDecls, <<END); - v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(${v8InterfaceName}::GetTemplate()); - if (holder.IsEmpty()) - return v8Undefined(); -END - } - push(@implContentDecls, <<END); - ${interfaceName}* imp = ${v8InterfaceName}::toNative(holder); -END - } else { - my $reflect = $attribute->signature->extendedAttributes->{"Reflect"}; - my $url = $attribute->signature->extendedAttributes->{"URL"}; - if ($getterStringUsesImp && $reflect && !$url && $codeGenerator->IsSubType($interface, "Node") && $codeGenerator->IsStringType($attrType)) { - # Generate super-compact call for regular attribute getter: - my ($functionName, @arguments) = $codeGenerator->GetterExpression(\%implIncludes, $interfaceName, $attribute); - push(@implContentDecls, " Element* imp = V8Element::toNative(info.Holder());\n"); - push(@implContentDecls, " return v8String(imp->${functionName}(" . join(", ", @arguments) . "), info.GetIsolate());\n"); - push(@implContentDecls, "}\n\n"); - push(@implContentDecls, "#endif // ${conditionalString}\n\n") if $conditionalString; - return; - # Skip the rest of the function! - } - if ($attribute->signature->type eq "SerializedScriptValue" && $attrExt->{"CachedAttribute"}) { - push(@implContentDecls, <<END); - v8::Handle<v8::String> propertyName = v8::String::NewSymbol("${attrName}"); - v8::Handle<v8::Value> value = info.Holder()->GetHiddenValue(propertyName); - if (!value.IsEmpty()) - return value; -END - } - if (!$attribute->isStatic) { - push(@implContentDecls, <<END); - ${interfaceName}* imp = ${v8InterfaceName}::toNative(info.Holder()); -END - } - } - - # Generate security checks if necessary - if ($attribute->signature->extendedAttributes->{"CheckSecurityForNode"}) { - push(@implContentDecls, " if (!BindingSecurity::shouldAllowAccessToNode(BindingState::instance(), imp->" . $attribute->signature->name . "()))\n return v8::Handle<v8::Value>(v8Null(info.GetIsolate()));\n\n"); - } - - my $useExceptions = 1 if @{$attribute->getterExceptions}; - if ($useExceptions) { - AddToImplIncludes("ExceptionCode.h"); - push(@implContentDecls, " ExceptionCode ec = 0;\n"); - } - - my $returnType = $attribute->signature->type; - my $getterString; - - if ($getterStringUsesImp) { - my ($functionName, @arguments) = $codeGenerator->GetterExpression(\%implIncludes, $interfaceName, $attribute); - push(@arguments, "ec") if $useExceptions; - if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) { - my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"}; - AddToImplIncludes("${implementedBy}.h"); - unshift(@arguments, "imp") if !$attribute->isStatic; - $functionName = "${implementedBy}::${functionName}"; - } elsif ($attribute->isStatic) { - $functionName = "${interfaceName}::${functionName}"; - } else { - $functionName = "imp->${functionName}"; - } - unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContentDecls, " ", 0)); - $getterString = "${functionName}(" . join(", ", @arguments) . ")"; - } else { - $getterString = "impInstance"; - } - - my $result; - if ($attribute->signature->type eq "EventListener" && $interface->name eq "DOMWindow") { - push(@implContentDecls, " if (!imp->document())\n"); - push(@implContentDecls, " return v8Undefined();\n"); - } - - if ($useExceptions) { - if ($nativeType =~ /^V8StringResource/) { - push(@implContentDecls, " " . ConvertToV8StringResource($attribute->signature, $nativeType, "v", $getterString) . ";\n"); - } else { - push(@implContentDecls, " $nativeType v = $getterString;\n"); - } - push(@implContentDecls, " if (UNLIKELY(ec))\n"); - push(@implContentDecls, " return setDOMException(ec, info.GetIsolate());\n"); - - if ($codeGenerator->ExtendedAttributeContains($attribute->signature->extendedAttributes->{"CallWith"}, "ScriptState")) { - push(@implContentDecls, " if (state.hadException())\n"); - push(@implContentDecls, " return throwError(state.exception(), info.GetIsolate());\n"); - } - - $result = "v"; - $result .= ".release()" if ($codeGenerator->IsRefPtrType($returnType)); - } else { - # Can inline the function call into the return statement to avoid overhead of using a Ref<> temporary - $result = $getterString; - # Fix amigious conversion problem, by casting to the base type first ($getterString returns a type that inherits from SVGAnimatedEnumeration, not the base class directly). - $result = "static_pointer_cast<SVGAnimatedEnumeration>($result)" if $returnType eq "SVGAnimatedEnumeration"; - } - - # Special case for readonly or Replaceable attributes (with a few exceptions). This attempts to ensure that JS wrappers don't get - # garbage-collected prematurely when their lifetime is strongly tied to their owner. We accomplish this by inserting a reference to - # the newly created wrapper into an internal field of the holder object. - if ((!$codeGenerator->IsSubType($interface, "Node") && $attrName ne "self" && IsWrapperType($returnType) && (IsReadonly($attribute) || $attribute->signature->extendedAttributes->{"Replaceable"} || $attrName eq "location") - && $returnType ne "EventTarget" && $returnType ne "SerializedScriptValue" && $returnType ne "DOMWindow" - && $returnType ne "MessagePortArray" - && $returnType !~ /SVG/ && $returnType !~ /HTML/ && !IsDOMNodeType($returnType)) - || $attribute->signature->extendedAttributes->{"V8CacheAttributeForGC"}) { - - my $arrayType = $codeGenerator->GetArrayType($returnType); - if ($arrayType) { - if (!$codeGenerator->SkipIncludeHeader($arrayType)) { - AddToImplIncludes("V8$arrayType.h"); - AddToImplIncludes("$arrayType.h"); - } - push(@implContentDecls, " return v8Array(${getterString}, info.GetIsolate());\n"); - push(@implContentDecls, "}\n\n"); - return; - } - - AddIncludesForType($returnType); - # Check for a wrapper in the wrapper cache. If there is one, we know that a hidden reference has already - # been created. If we don't find a wrapper, we create both a wrapper and a hidden reference. - push(@implContentDecls, " RefPtr<$returnType> result = ${getterString};\n"); - push(@implContentDecls, " v8::Handle<v8::Value> wrapper = result.get() ? v8::Handle<v8::Value>(DOMDataStore::getWrapper(result.get(), info.GetIsolate())) : v8Undefined();\n"); - push(@implContentDecls, " if (wrapper.IsEmpty()) {\n"); - push(@implContentDecls, " wrapper = toV8(result.get(), info.Holder(), info.GetIsolate());\n"); # FIXME: Could use wrap here since the wrapper is empty. - push(@implContentDecls, " if (!wrapper.IsEmpty())\n"); - push(@implContentDecls, " V8DOMWrapper::setNamedHiddenReference(info.Holder(), \"${attrName}\", wrapper);\n"); - push(@implContentDecls, " }\n"); - push(@implContentDecls, " return wrapper;\n"); - push(@implContentDecls, "}\n\n"); - push(@implContentDecls, "#endif // ${conditionalString}\n\n") if $conditionalString; - return; - } - - if (($codeGenerator->IsSVGAnimatedType($interfaceName) or $interfaceName eq "SVGViewSpec") and $codeGenerator->IsSVGTypeNeedingTearOff($attrType)) { - AddToImplIncludes("V8$attrType.h"); - my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($attrType); - # Convert from abstract SVGProperty to real type, so the right toJS() method can be invoked. - push(@implContentDecls, " return toV8Fast(static_cast<$svgNativeType*>($result), info, imp);\n"); - } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($attrType) and not $interfaceName =~ /List$/) { - AddToImplIncludes("V8$attrType.h"); - AddToImplIncludes("SVGPropertyTearOff.h"); - my $tearOffType = $codeGenerator->GetSVGTypeNeedingTearOff($attrType); - my $wrappedValue; - if ($codeGenerator->IsSVGTypeWithWritablePropertiesNeedingTearOff($attrType) and not defined $attribute->signature->extendedAttributes->{"Immutable"}) { - my $getter = $result; - $getter =~ s/imp->//; - $getter =~ s/\(\)//; - - my $updateMethod = "&${interfaceName}::update" . $codeGenerator->WK_ucfirst($getter); - - my $selfIsTearOffType = $codeGenerator->IsSVGTypeNeedingTearOff($interfaceName); - if ($selfIsTearOffType) { - AddToImplIncludes("SVGStaticPropertyWithParentTearOff.h"); - $tearOffType =~ s/SVGPropertyTearOff</SVGStaticPropertyWithParentTearOff<$interfaceName, /; - - if ($result =~ /matrix/ and $interfaceName eq "SVGTransform") { - # SVGTransform offers a matrix() method for internal usage that returns an AffineTransform - # and a svgMatrix() method returning a SVGMatrix, used for the bindings. - $result =~ s/matrix/svgMatrix/; - } - - $wrappedValue = "WTF::getPtr(${tearOffType}::create(wrapper, $result, $updateMethod))"; - } else { - AddToImplIncludes("SVGStaticPropertyTearOff.h"); - $tearOffType =~ s/SVGPropertyTearOff</SVGStaticPropertyTearOff<$interfaceName, /; - - $wrappedValue = "WTF::getPtr(${tearOffType}::create(imp, $result, $updateMethod))"; - } - } elsif ($tearOffType =~ /SVGStaticListPropertyTearOff/) { - $wrappedValue = "WTF::getPtr(${tearOffType}::create(imp, $result))"; - } elsif ($tearOffType =~ /SVG(Point|PathSeg)List/) { - $wrappedValue = "WTF::getPtr($result)"; - } else { - $wrappedValue = "WTF::getPtr(${tearOffType}::create($result))"; - } - push(@implContentDecls, " return toV8Fast($wrappedValue, info, imp);\n"); - } elsif ($attribute->signature->type eq "MessagePortArray") { - AddToImplIncludes("MessagePort.h"); - AddToImplIncludes("V8MessagePort.h"); - my $getterFunc = $codeGenerator->WK_lcfirst($attribute->signature->name); - push(@implContentDecls, <<END); - MessagePortArray* ports = imp->${getterFunc}(); - if (!ports) - return v8::Array::New(0); - MessagePortArray portsCopy(*ports); - v8::Local<v8::Array> portArray = v8::Array::New(portsCopy.size()); - for (size_t i = 0; i < portsCopy.size(); ++i) - portArray->Set(v8Integer(i, info.GetIsolate()), toV8Fast(portsCopy[i].get(), info, imp)); - return portArray; -END - } elsif ($attribute->signature->type eq "SerializedScriptValue" && $attrExt->{"CachedAttribute"}) { - my $getterFunc = $codeGenerator->WK_lcfirst($attribute->signature->name); - push(@implContentDecls, <<END); - SerializedScriptValue* serialized = imp->${getterFunc}(); - value = serialized ? serialized->deserialize() : v8::Handle<v8::Value>(v8Null(info.GetIsolate())); - info.Holder()->SetHiddenValue(propertyName, value); - return value; -END - } else { - push(@implContentDecls, " return " . NativeToJSValue($attribute->signature, $result, "info.Holder()", "info.GetIsolate()", "info", "imp").";\n"); - } - - push(@implContentDecls, "}\n\n"); # end of getter - push(@implContentDecls, "#endif // ${conditionalString}\n\n") if $conditionalString; -} - -sub GenerateReplaceableAttrSetter -{ - my $interface = shift; - my $interfaceName = $interface->name; - - push(@implContentDecls, <<END); -static void ${interfaceName}ReplaceableAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) -{ -END - push(@implContentDecls, GenerateFeatureObservation($interface->extendedAttributes->{"V8MeasureAs"})); - - if ($interfaceName eq "DOMWindow" || $interface->extendedAttributes->{"CheckSecurity"}) { - AddToImplIncludes("Frame.h"); - push(@implContentDecls, <<END); - ${interfaceName}* imp = V8${interfaceName}::toNative(info.Holder()); - if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame())) - return; -END - } - - push(@implContentDecls, <<END); - info.This()->ForceSet(name, value); -} - -END -} - -sub GenerateNormalAttrSetter -{ - my $attribute = shift; - my $interface = shift; - - my $interfaceName = $interface->name; - my $v8InterfaceName = "V8$interfaceName"; - my $attrName = $attribute->signature->name; - my $attrExt = $attribute->signature->extendedAttributes; - - my $conditionalString = $codeGenerator->GenerateConditionalString($attribute->signature); - push(@implContentDecls, "#if ${conditionalString}\n\n") if $conditionalString; - - push(@implContentDecls, "static void ${attrName}AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)\n{\n"); - push(@implContentDecls, GenerateFeatureObservation($attribute->signature->extendedAttributes->{"V8MeasureAs"})); - - # If the "StrictTypeChecking" extended attribute is present, and the attribute's type is an - # interface type, then if the incoming value does not implement that interface, a TypeError is - # thrown rather than silently passing NULL to the C++ code. - # Per the Web IDL and ECMAScript specifications, incoming values can always be converted to both - # strings and numbers, so do not throw TypeError if the attribute is of these types. - if ($attribute->signature->extendedAttributes->{"StrictTypeChecking"}) { - my $argType = $attribute->signature->type; - if (IsWrapperType($argType)) { - push(@implContentDecls, " if (!isUndefinedOrNull(value) && !V8${argType}::HasInstance(value)) {\n"); - push(@implContentDecls, " throwTypeError(0, info.GetIsolate());\n"); - push(@implContentDecls, " return;\n"); - push(@implContentDecls, " }\n"); - } - } - - my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($interfaceName); - if ($svgNativeType) { - my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($interfaceName); - if ($svgWrappedNativeType =~ /List$/) { - push(@implContentDecls, <<END); - $svgNativeType* imp = ${v8InterfaceName}::toNative(info.Holder()); -END - } else { - AddToImplIncludes("ExceptionCode.h"); - push(@implContentDecls, " $svgNativeType* wrapper = ${v8InterfaceName}::toNative(info.Holder());\n"); - push(@implContentDecls, " if (wrapper->isReadOnly()) {\n"); - push(@implContentDecls, " setDOMException(NO_MODIFICATION_ALLOWED_ERR, info.GetIsolate());\n"); - push(@implContentDecls, " return;\n"); - push(@implContentDecls, " }\n"); - push(@implContentDecls, " $svgWrappedNativeType& impInstance = wrapper->propertyReference();\n"); - push(@implContentDecls, " $svgWrappedNativeType* imp = &impInstance;\n"); - } - } elsif ($attrExt->{"V8OnProto"}) { - push(@implContentDecls, <<END); - ${interfaceName}* imp = ${v8InterfaceName}::toNative(info.Holder()); -END - } else { - my $attrType = $attribute->signature->type; - my $reflect = $attribute->signature->extendedAttributes->{"Reflect"}; - if ($reflect && $codeGenerator->IsSubType($interface, "Node") && $codeGenerator->IsStringType($attrType)) { - # Generate super-compact call for regular attribute setter: - my $contentAttributeName = $reflect eq "VALUE_IS_MISSING" ? lc $attrName : $reflect; - my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName); - AddToImplIncludes("${namespace}.h"); - push(@implContentDecls, " Element* imp = V8Element::toNative(info.Holder());\n"); - push(@implContentDecls, " V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, stringResource, value);\n"); - push(@implContentDecls, " imp->setAttribute(${namespace}::${contentAttributeName}Attr, stringResource);\n"); - push(@implContentDecls, "}\n\n"); - push(@implContentDecls, "#endif // ${conditionalString}\n\n") if $conditionalString; - return; - # Skip the rest of the function! - } - - if (!$attribute->isStatic) { - push(@implContentDecls, <<END); - ${interfaceName}* imp = ${v8InterfaceName}::toNative(info.Holder()); -END - } - } - - my $nativeType = GetNativeTypeFromSignature($attribute->signature, 0); - if ($attribute->signature->type eq "EventListener") { - if ($interface->name eq "DOMWindow") { - push(@implContentDecls, " if (!imp->document())\n"); - push(@implContentDecls, " return;\n"); - } - } else { - my $value = JSValueToNative($attribute->signature, "value", "info.GetIsolate()"); - my $arrayType = $codeGenerator->GetArrayType($nativeType); - - if ($nativeType =~ /^V8StringResource/) { - push(@implContentDecls, " " . ConvertToV8StringResource($attribute->signature, $nativeType, "v", $value, "VOID") . "\n"); - } elsif ($arrayType) { - push(@implContentDecls, " Vector<$arrayType> v = $value;\n"); - } else { - push(@implContentDecls, " $nativeType v = $value;\n"); - } - } - - my $result = "v"; - my $returnType = $attribute->signature->type; - if ($codeGenerator->IsRefPtrType($returnType) && !$codeGenerator->GetArrayType($returnType)) { - $result = "WTF::getPtr(" . $result . ")"; - } - - my $useExceptions = 1 if @{$attribute->setterExceptions}; - - if ($useExceptions) { - AddToImplIncludes("ExceptionCode.h"); - push(@implContentDecls, " ExceptionCode ec = 0;\n"); - } - - if ($interfaceName eq "SVGNumber") { - push(@implContentDecls, " *imp = $result;\n"); - } else { - if ($attribute->signature->type eq "EventListener") { - my $implSetterFunctionName = $codeGenerator->WK_ucfirst($attrName); - AddToImplIncludes("V8AbstractEventListener.h"); - if (!$codeGenerator->IsSubType($interface, "Node")) { - push(@implContentDecls, " transferHiddenDependency(info.Holder(), imp->$attrName(), value, ${v8InterfaceName}::eventListenerCacheIndex);\n"); - } - if ($interfaceName eq "WorkerContext" and $attribute->signature->name eq "onerror") { - AddToImplIncludes("V8EventListenerList.h"); - AddToImplIncludes("V8WorkerContextErrorHandler.h"); - push(@implContentDecls, " imp->set$implSetterFunctionName(V8EventListenerList::findOrCreateWrapper<V8WorkerContextErrorHandler>(value, true)"); - } elsif ($interfaceName eq "DOMWindow" and $attribute->signature->name eq "onerror") { - AddToImplIncludes("V8EventListenerList.h"); - AddToImplIncludes("V8WindowErrorHandler.h"); - push(@implContentDecls, " imp->set$implSetterFunctionName(V8EventListenerList::findOrCreateWrapper<V8WindowErrorHandler>(value, true)"); - } else { - push(@implContentDecls, " imp->set$implSetterFunctionName(V8DOMWrapper::getEventListener(value, true, ListenerFindOrCreate)"); - } - push(@implContentDecls, ", ec") if $useExceptions; - push(@implContentDecls, ");\n"); - } else { - my ($functionName, @arguments) = $codeGenerator->SetterExpression(\%implIncludes, $interfaceName, $attribute); - push(@arguments, $result); - push(@arguments, "ec") if $useExceptions; - if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) { - my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"}; - AddToImplIncludes("${implementedBy}.h"); - unshift(@arguments, "imp") if !$attribute->isStatic; - $functionName = "${implementedBy}::${functionName}"; - } elsif ($attribute->isStatic) { - $functionName = "${interfaceName}::${functionName}"; - } else { - $functionName = "imp->${functionName}"; - } - unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContentDecls, " ", 1)); - push(@implContentDecls, " ${functionName}(" . join(", ", @arguments) . ");\n"); - } - } - - if ($useExceptions) { - push(@implContentDecls, " if (UNLIKELY(ec))\n"); - push(@implContentDecls, " setDOMException(ec, info.GetIsolate());\n"); - } - - if ($codeGenerator->ExtendedAttributeContains($attribute->signature->extendedAttributes->{"CallWith"}, "ScriptState")) { - push(@implContentDecls, " if (state.hadException())\n"); - push(@implContentDecls, " throwError(state.exception(), info.GetIsolate());\n"); - } - - if ($svgNativeType) { - if ($useExceptions) { - push(@implContentDecls, " if (!ec)\n"); - push(@implContentDecls, " wrapper->commitChange();\n"); - } else { - push(@implContentDecls, " wrapper->commitChange();\n"); - } - } - - if ($attribute->signature->type eq "SerializedScriptValue" && $attribute->signature->extendedAttributes->{"CachedAttribute"}) { - push(@implContentDecls, <<END); - info.Holder()->DeleteHiddenValue(v8::String::NewSymbol("${attrName}")); // Invalidate the cached value. -END - } - - push(@implContentDecls, " return;\n"); - push(@implContentDecls, "}\n\n"); # end of setter - push(@implContentDecls, "#endif // ${conditionalString}\n\n") if $conditionalString; -} - -sub GetFunctionTemplateCallbackName -{ - my $function = shift; - my $interfaceName = shift; - - my $name = $function->signature->name; - - if ($function->signature->extendedAttributes->{"Custom"} || - $function->signature->extendedAttributes->{"V8Custom"}) { - if ($function->signature->extendedAttributes->{"Custom"} && - $function->signature->extendedAttributes->{"V8Custom"}) { - die "Custom and V8Custom should be mutually exclusive!" - } - return "V8${interfaceName}::${name}Callback"; - } else { - return "${interfaceName}V8Internal::${name}Callback"; - } -} - -sub GenerateEventListenerCallback -{ - my $interfaceName = shift; - my $requiresHiddenDependency = shift; - my $functionName = shift; - my $lookupType = ($functionName eq "add") ? "OrCreate" : "Only"; - my $passRefPtrHandling = ($functionName eq "add") ? "" : ".get()"; - my $hiddenDependencyAction = ($functionName eq "add") ? "create" : "remove"; - - push(@implContentDecls, <<END); -static v8::Handle<v8::Value> ${functionName}EventListenerCallback(const v8::Arguments& args) -{ - RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFind${lookupType}); - if (listener) { - V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<WithNullCheck>, stringResource, args[0]); - V8${interfaceName}::toNative(args.Holder())->${functionName}EventListener(stringResource, listener${passRefPtrHandling}, args[2]->BooleanValue()); -END - if ($requiresHiddenDependency) { - push(@implContentDecls, <<END); - ${hiddenDependencyAction}HiddenDependency(args.Holder(), args[1], V8${interfaceName}::eventListenerCacheIndex); -END - } - push(@implContentDecls, <<END); - } - return v8Undefined(); -} - -END -} - -sub GenerateParametersCheckExpression -{ - my $numParameters = shift; - my $function = shift; - - my @andExpression = (); - push(@andExpression, "args.Length() == $numParameters"); - my $parameterIndex = 0; - foreach my $parameter (@{$function->parameters}) { - last if $parameterIndex >= $numParameters; - my $value = "args[$parameterIndex]"; - my $type = $parameter->type; - - # Only DOMString or wrapper types are checked. - # For DOMString with StrictTypeChecking only Null, Undefined and Object - # are accepted for compatibility. Otherwise, no restrictions are made to - # match the non-overloaded behavior. - # FIXME: Implement WebIDL overload resolution algorithm. - if ($codeGenerator->IsStringType($type)) { - if ($parameter->extendedAttributes->{"StrictTypeChecking"}) { - push(@andExpression, "(${value}->IsNull() || ${value}->IsUndefined() || ${value}->IsString() || ${value}->IsObject())"); - } - } elsif ($parameter->extendedAttributes->{"Callback"}) { - # For Callbacks only checks if the value is null or object. - push(@andExpression, "(${value}->IsNull() || ${value}->IsFunction())"); - } elsif ($codeGenerator->IsArrayType($type) || $codeGenerator->GetSequenceType($type)) { - if ($parameter->isNullable) { - push(@andExpression, "(${value}->IsNull() || ${value}->IsArray())"); - } else { - push(@andExpression, "(${value}->IsArray())"); - } - } elsif (IsWrapperType($type)) { - if ($parameter->isNullable) { - push(@andExpression, "(${value}->IsNull() || V8${type}::HasInstance($value))"); - } else { - push(@andExpression, "(V8${type}::HasInstance($value))"); - } - } - - $parameterIndex++; - } - my $res = join(" && ", @andExpression); - $res = "($res)" if @andExpression > 1; - return $res; -} - -sub GenerateFunctionParametersCheck -{ - my $function = shift; - - my @orExpression = (); - my $numParameters = 0; - my $hasVariadic = 0; - my $numMandatoryParams = @{$function->parameters}; - foreach my $parameter (@{$function->parameters}) { - if ($parameter->extendedAttributes->{"Optional"}) { - push(@orExpression, GenerateParametersCheckExpression($numParameters, $function)); - $numMandatoryParams--; - } - if ($parameter->isVariadic) { - $hasVariadic = 1; - last; - } - $numParameters++; - } - if (!$hasVariadic) { - push(@orExpression, GenerateParametersCheckExpression($numParameters, $function)); - } - return ($numMandatoryParams, join(" || ", @orExpression)); -} - -sub GenerateOverloadedFunctionCallback -{ - my $function = shift; - my $interface = shift; - my $interfaceName = $interface->name; - - # Generate code for choosing the correct overload to call. Overloads are - # chosen based on the total number of arguments passed and the type of - # values passed in non-primitive argument slots. When more than a single - # overload is applicable, precedence is given according to the order of - # declaration in the IDL. - - my $name = $function->signature->name; - my $conditionalString = $codeGenerator->GenerateConditionalString($function->signature); - my $leastNumMandatoryParams = 255; - push(@implContentDecls, "#if ${conditionalString}\n\n") if $conditionalString; - push(@implContentDecls, <<END); -static v8::Handle<v8::Value> ${name}Callback(const v8::Arguments& args) -{ -END - push(@implContentDecls, GenerateFeatureObservation($function->signature->extendedAttributes->{"V8MeasureAs"})); - - foreach my $overload (@{$function->{overloads}}) { - my ($numMandatoryParams, $parametersCheck) = GenerateFunctionParametersCheck($overload); - $leastNumMandatoryParams = $numMandatoryParams if ($numMandatoryParams < $leastNumMandatoryParams); - push(@implContentDecls, " if ($parametersCheck)\n"); - push(@implContentDecls, " return ${name}$overload->{overloadIndex}Callback(args);\n"); - } - if ($leastNumMandatoryParams >= 1) { - push(@implContentDecls, " if (args.Length() < $leastNumMandatoryParams)\n"); - push(@implContentDecls, " return throwNotEnoughArgumentsError(args.GetIsolate());\n"); - } - push(@implContentDecls, <<END); - return throwTypeError(0, args.GetIsolate()); -END - push(@implContentDecls, "}\n\n"); - push(@implContentDecls, "#endif // ${conditionalString}\n\n") if $conditionalString; -} - -sub GenerateFunctionCallback -{ - my $function = shift; - my $interface = shift; - - my $interfaceName = $interface->name; - my $v8InterfaceName = "V8$interfaceName"; - my $name = $function->signature->name; - - if (@{$function->{overloads}} > 1) { - # Append a number to an overloaded method's name to make it unique: - $name = $name . $function->{overloadIndex}; - } - - # Adding and removing event listeners are not standard callback behavior, - # but they are extremely consistent across the various interfaces that take event listeners, - # so we can generate them as a "special case". - if ($name eq "addEventListener") { - GenerateEventListenerCallback($interfaceName, !$codeGenerator->IsSubType($interface, "Node"), "add"); - return; - } elsif ($name eq "removeEventListener") { - GenerateEventListenerCallback($interfaceName, !$codeGenerator->IsSubType($interface, "Node"), "remove"); - return; - } - - my $conditionalString = $codeGenerator->GenerateConditionalString($function->signature); - push(@implContentDecls, "#if ${conditionalString}\n\n") if $conditionalString; - push(@implContentDecls, <<END); -static v8::Handle<v8::Value> ${name}Callback(const v8::Arguments& args) -{ -END - push(@implContentDecls, GenerateFeatureObservation($function->signature->extendedAttributes->{"V8MeasureAs"})); - - push(@implContentDecls, GenerateArgumentsCountCheck($function, $interface)); - - if ($name eq "set" and $interface->extendedAttributes->{"TypedArray"}) { - AddToImplIncludes("V8ArrayBufferViewCustom.h"); - push(@implContentDecls, <<END); - return setWebGLArrayHelper<$interfaceName, ${v8InterfaceName}>(args); -} - -END - return; - } - - my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($interfaceName); - - if ($svgNativeType) { - my $nativeClassName = GetNativeType($interfaceName); - if ($interfaceName =~ /List$/) { - push(@implContentDecls, " $nativeClassName imp = ${v8InterfaceName}::toNative(args.Holder());\n"); - } else { - AddToImplIncludes("ExceptionCode.h"); - push(@implContentDecls, " $nativeClassName wrapper = ${v8InterfaceName}::toNative(args.Holder());\n"); - push(@implContentDecls, " if (wrapper->isReadOnly())\n"); - push(@implContentDecls, " return setDOMException(NO_MODIFICATION_ALLOWED_ERR, args.GetIsolate());\n"); - my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($interfaceName); - push(@implContentDecls, " $svgWrappedNativeType& impInstance = wrapper->propertyReference();\n"); - push(@implContentDecls, " $svgWrappedNativeType* imp = &impInstance;\n"); - } - } elsif (!$function->isStatic) { - push(@implContentDecls, <<END); - ${interfaceName}* imp = ${v8InterfaceName}::toNative(args.Holder()); -END - } - - # Check domain security if needed - if (($interface->extendedAttributes->{"CheckSecurity"} - || $interfaceName eq "DOMWindow") - && !$function->signature->extendedAttributes->{"DoNotCheckSecurity"}) { - # We have not find real use cases yet. - AddToImplIncludes("Frame.h"); - push(@implContentDecls, <<END); - if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame())) - return v8Undefined(); -END - } - - my $raisesExceptions = @{$function->raisesExceptions}; - if (!$raisesExceptions) { - foreach my $parameter (@{$function->parameters}) { - if ((!$parameter->extendedAttributes->{"Callback"} and TypeCanFailConversion($parameter)) or $parameter->extendedAttributes->{"IsIndex"}) { - $raisesExceptions = 1; - } - } - } - - if ($raisesExceptions) { - AddToImplIncludes("ExceptionCode.h"); - push(@implContentDecls, " ExceptionCode ec = 0;\n"); - push(@implContentDecls, " {\n"); - # The brace here is needed to prevent the ensuing 'goto fail's from jumping past constructors - # of objects (like Strings) declared later, causing compile errors. The block scope ends - # right before the label 'fail:'. - } - - if ($function->signature->extendedAttributes->{"CheckSecurityForNode"}) { - push(@implContentDecls, " if (!BindingSecurity::shouldAllowAccessToNode(BindingState::instance(), imp->" . $function->signature->name . "(ec)))\n"); - push(@implContentDecls, " return v8::Handle<v8::Value>(v8Null(args.GetIsolate()));\n"); -END - } - - my ($parameterCheckString, $paramIndex, %replacements) = GenerateParametersCheck($function, $interfaceName); - push(@implContentDecls, $parameterCheckString); - - # Build the function call string. - push(@implContentDecls, GenerateFunctionCallString($function, $paramIndex, " ", $interfaceName, %replacements)); - - if ($raisesExceptions) { - push(@implContentDecls, " }\n"); - push(@implContentDecls, " fail:\n"); - push(@implContentDecls, " return setDOMException(ec, args.GetIsolate());\n"); - } - - push(@implContentDecls, "}\n\n"); - push(@implContentDecls, "#endif // ${conditionalString}\n\n") if $conditionalString; -} - -sub GenerateCallWith -{ - my $callWith = shift; - return () unless $callWith; - my $outputArray = shift; - my $indent = shift; - my $returnVoid = shift; - my $function = shift; - - my @callWithArgs; - if ($codeGenerator->ExtendedAttributeContains($callWith, "ScriptState")) { - push(@$outputArray, $indent . "ScriptState* currentState = ScriptState::current();\n"); - push(@$outputArray, $indent . "if (!currentState)\n"); - push(@$outputArray, $indent . " return" . ($returnVoid ? "" : " v8Undefined()") . ";\n"); - push(@$outputArray, $indent . "ScriptState& state = *currentState;\n"); - push(@callWithArgs, "&state"); - } - if ($codeGenerator->ExtendedAttributeContains($callWith, "ScriptExecutionContext")) { - push(@$outputArray, $indent . "ScriptExecutionContext* scriptContext = getScriptExecutionContext();\n"); - push(@callWithArgs, "scriptContext"); - } - if ($function and $codeGenerator->ExtendedAttributeContains($callWith, "ScriptArguments")) { - push(@$outputArray, $indent . "RefPtr<ScriptArguments> scriptArguments(createScriptArguments(args, " . @{$function->parameters} . "));\n"); - push(@callWithArgs, "scriptArguments.release()"); - AddToImplIncludes("ScriptArguments.h"); - AddToImplIncludes("ScriptCallStackFactory.h"); - } - return @callWithArgs; -} - -sub GenerateArgumentsCountCheck -{ - my $function = shift; - my $interface = shift; - - my $numMandatoryParams = 0; - my $allowNonOptional = 1; - foreach my $param (@{$function->parameters}) { - if ($param->extendedAttributes->{"Optional"} or $param->isVariadic) { - $allowNonOptional = 0; - } else { - die "An argument must not be declared to be optional unless all subsequent arguments to the operation are also optional." if !$allowNonOptional; - $numMandatoryParams++; - } - } - - my $argumentsCountCheckString = ""; - if ($numMandatoryParams >= 1) { - $argumentsCountCheckString .= " if (args.Length() < $numMandatoryParams)\n"; - $argumentsCountCheckString .= " return throwNotEnoughArgumentsError(args.GetIsolate());\n"; - } - return $argumentsCountCheckString; -} - -sub GetIndexOf -{ - my $paramName = shift; - my @paramList = @_; - my $index = 0; - foreach my $param (@paramList) { - if ($paramName eq $param) { - return $index; - } - $index++; - } - return -1; -} - -sub GenerateParametersCheck -{ - my $function = shift; - my $interfaceName = shift; - - my $parameterCheckString = ""; - my $paramIndex = 0; - my @paramTransferListNames = (); - my %replacements = (); - - foreach my $parameter (@{$function->parameters}) { - TranslateParameter($parameter); - my $nativeType = GetNativeTypeFromSignature($parameter, $paramIndex); - - # Optional arguments with [Optional] should generate an early call with fewer arguments. - # Optional arguments with [Optional=...] should not generate the early call. - # Optional Dictionary arguments always considered to have default of empty dictionary. - my $optional = $parameter->extendedAttributes->{"Optional"}; - if ($optional && $optional ne "DefaultIsUndefined" && $optional ne "DefaultIsNullString" && $nativeType ne "Dictionary" && !$parameter->extendedAttributes->{"Callback"}) { - $parameterCheckString .= " if (args.Length() <= $paramIndex) {\n"; - my $functionCall = GenerateFunctionCallString($function, $paramIndex, " " x 2, $interfaceName, %replacements); - $parameterCheckString .= $functionCall; - $parameterCheckString .= " }\n"; - } - - my $parameterDefaultPolicy = "DefaultIsUndefined"; - if ($optional and $optional eq "DefaultIsNullString") { - $parameterDefaultPolicy = "DefaultIsNullString"; - } - - my $parameterName = $parameter->name; - if (GetIndexOf($parameterName, @paramTransferListNames) != -1) { - $replacements{$parameterName} = "messagePortArray" . ucfirst($parameterName); - $paramIndex++; - next; - } - - AddToImplIncludes("ExceptionCode.h"); - if ($parameter->extendedAttributes->{"Callback"}) { - my $v8InterfaceName = "V8" . $parameter->type; - AddToImplIncludes("$v8InterfaceName.h"); - if ($optional) { - $parameterCheckString .= " RefPtr<" . $parameter->type . "> $parameterName;\n"; - $parameterCheckString .= " if (args.Length() > $paramIndex && !args[$paramIndex]->IsNull() && !args[$paramIndex]->IsUndefined()) {\n"; - $parameterCheckString .= " if (!args[$paramIndex]->IsFunction())\n"; - $parameterCheckString .= " return throwTypeError(0, args.GetIsolate());\n"; - $parameterCheckString .= " $parameterName = ${v8InterfaceName}::create(args[$paramIndex], getScriptExecutionContext());\n"; - $parameterCheckString .= " }\n"; - } else { - $parameterCheckString .= " if (args.Length() <= $paramIndex || !args[$paramIndex]->IsFunction())\n"; - $parameterCheckString .= " return throwTypeError(0, args.GetIsolate());\n"; - $parameterCheckString .= " RefPtr<" . $parameter->type . "> $parameterName = ${v8InterfaceName}::create(args[$paramIndex], getScriptExecutionContext());\n"; - } - } elsif ($parameter->extendedAttributes->{"Clamp"}) { - my $nativeValue = "${parameterName}NativeValue"; - my $paramType = $parameter->type; - $parameterCheckString .= " $paramType $parameterName = 0;\n"; - $parameterCheckString .= " V8TRYCATCH(double, $nativeValue, args[$paramIndex]->NumberValue());\n"; - $parameterCheckString .= " if (!isnan($nativeValue))\n"; - $parameterCheckString .= " $parameterName = clampTo<$paramType>($nativeValue);\n"; - } elsif ($parameter->type eq "SerializedScriptValue") { - AddToImplIncludes("SerializedScriptValue.h"); - my $useTransferList = 0; - my $transferListName = ""; - my $TransferListName = ""; - if ($parameter->extendedAttributes->{"TransferList"}) { - $transferListName = $parameter->extendedAttributes->{"TransferList"}; - push(@paramTransferListNames, $transferListName); - - my @allParameterNames = (); - foreach my $parameter (@{$function->parameters}) { - push(@allParameterNames, $parameter->name); - } - my $transferListIndex = GetIndexOf($transferListName, @allParameterNames); - if ($transferListIndex == -1) { - die "IDL error: TransferList refers to a nonexistent argument"; - } - - AddToImplIncludes("wtf/ArrayBuffer.h"); - AddToImplIncludes("MessagePort.h"); - $TransferListName = ucfirst($transferListName); - $parameterCheckString .= " MessagePortArray messagePortArray$TransferListName;\n"; - $parameterCheckString .= " ArrayBufferArray arrayBufferArray$TransferListName;\n"; - $parameterCheckString .= " if (args.Length() > $transferListIndex) {\n"; - $parameterCheckString .= " if (!extractTransferables(args[$transferListIndex], messagePortArray$TransferListName, arrayBufferArray$TransferListName, args.GetIsolate()))\n"; - $parameterCheckString .= " return throwTypeError(\"Could not extract transferables\");\n"; - $parameterCheckString .= " }\n"; - $useTransferList = 1; - } - $parameterCheckString .= " bool ${parameterName}DidThrow = false;\n"; - if (!$useTransferList) { - $parameterCheckString .= " $nativeType $parameterName = SerializedScriptValue::create(args[$paramIndex], 0, 0, ${parameterName}DidThrow, args.GetIsolate());\n"; - } else { - $parameterCheckString .= " $nativeType $parameterName = SerializedScriptValue::create(args[$paramIndex], &messagePortArray$TransferListName, &arrayBufferArray$TransferListName, ${parameterName}DidThrow, args.GetIsolate());\n"; - } - $parameterCheckString .= " if (${parameterName}DidThrow)\n"; - $parameterCheckString .= " return v8Undefined();\n"; - } elsif (TypeCanFailConversion($parameter)) { - $parameterCheckString .= " $nativeType $parameterName = " . - JSValueToNative($parameter, "args[$paramIndex]", "args.GetIsolate()") . ";\n"; - $parameterCheckString .= " if (UNLIKELY(!$parameterName)) {\n"; - $parameterCheckString .= " ec = TYPE_MISMATCH_ERR;\n"; - $parameterCheckString .= " goto fail;\n"; - $parameterCheckString .= " }\n"; - } elsif ($parameter->isVariadic) { - my $nativeElementType = GetNativeType($parameter->type); - if ($nativeElementType =~ />$/) { - $nativeElementType .= " "; - } - - my $argType = $parameter->type; - if (IsWrapperType($argType)) { - $parameterCheckString .= " Vector<$nativeElementType> $parameterName;\n"; - $parameterCheckString .= " for (int i = $paramIndex; i < args.Length(); ++i) {\n"; - $parameterCheckString .= " if (!V8${argType}::HasInstance(args[i]))\n"; - $parameterCheckString .= " return throwTypeError(0, args.GetIsolate());\n"; - $parameterCheckString .= " $parameterName.append(V8${argType}::toNative(v8::Handle<v8::Object>::Cast(args[i])));\n"; - $parameterCheckString .= " }\n"; - } else { - $parameterCheckString .= " V8TRYCATCH(Vector<$nativeElementType>, $parameterName, toNativeArguments<$nativeElementType>(args, $paramIndex));\n"; - } - } elsif ($nativeType =~ /^V8StringResource/) { - my $value = JSValueToNative($parameter, "MAYBE_MISSING_PARAMETER(args, $paramIndex, $parameterDefaultPolicy)", "args.GetIsolate()"); - $parameterCheckString .= " " . ConvertToV8StringResource($parameter, $nativeType, $parameterName, $value) . "\n"; - } else { - # If the "StrictTypeChecking" extended attribute is present, and the argument's type is an - # interface type, then if the incoming value does not implement that interface, a TypeError - # is thrown rather than silently passing NULL to the C++ code. - # Per the Web IDL and ECMAScript specifications, incoming values can always be converted - # to both strings and numbers, so do not throw TypeError if the argument is of these - # types. - if ($function->signature->extendedAttributes->{"StrictTypeChecking"}) { - my $argValue = "args[$paramIndex]"; - my $argType = $parameter->type; - if (IsWrapperType($argType)) { - $parameterCheckString .= " if (args.Length() > $paramIndex && !isUndefinedOrNull($argValue) && !V8${argType}::HasInstance($argValue))\n"; - $parameterCheckString .= " return throwTypeError(0, args.GetIsolate());\n"; - } - } - $parameterCheckString .= " V8TRYCATCH($nativeType, $parameterName, " . - JSValueToNative($parameter, "MAYBE_MISSING_PARAMETER(args, $paramIndex, $parameterDefaultPolicy)", "args.GetIsolate()") . ");\n"; - if ($nativeType eq 'Dictionary') { - $parameterCheckString .= " if (!$parameterName.isUndefinedOrNull() && !$parameterName.isObject())\n"; - $parameterCheckString .= " return throwTypeError(\"Not an object.\", args.GetIsolate());\n"; - } - } - - if ($parameter->extendedAttributes->{"IsIndex"}) { - $parameterCheckString .= " if (UNLIKELY($parameterName < 0)) {\n"; - $parameterCheckString .= " ec = INDEX_SIZE_ERR;\n"; - $parameterCheckString .= " goto fail;\n"; - $parameterCheckString .= " }\n"; - } - - $paramIndex++; - } - return ($parameterCheckString, $paramIndex, %replacements); -} - -sub GenerateOverloadedConstructorCallback -{ - my $interface = shift; - my $interfaceName = $interface->name; - - push(@implContent, <<END); -v8::Handle<v8::Value> V8${interfaceName}::constructorCallback(const v8::Arguments& args) -{ -END - push(@implContent, GenerateConstructorHeader()); - - my $leastNumMandatoryParams = 255; - foreach my $constructor (@{$interface->constructors}) { - my $name = "constructor" . $constructor->{overloadedIndex} . "Callback"; - my ($numMandatoryParams, $parametersCheck) = GenerateFunctionParametersCheck($constructor); - $leastNumMandatoryParams = $numMandatoryParams if ($numMandatoryParams < $leastNumMandatoryParams); - push(@implContent, " if ($parametersCheck)\n"); - push(@implContent, " return $name(args);\n"); - } - if ($leastNumMandatoryParams >= 1) { - push(@implContent, " if (args.Length() < $leastNumMandatoryParams)\n"); - push(@implContent, " return throwNotEnoughArgumentsError(args.GetIsolate());\n"); - } - push(@implContent, <<END); - return throwTypeError(0, args.GetIsolate()); -END - push(@implContent, "}\n\n"); -} - -sub GenerateSingleConstructorCallback -{ - my $interface = shift; - my $function = shift; - - my $interfaceName = $interface->name; - my $overloadedIndexString = ""; - if ($function->{overloadedIndex} > 0) { - $overloadedIndexString .= $function->{overloadedIndex}; - } - - my $raisesExceptions = @{$function->raisesExceptions}; - if ($interface->extendedAttributes->{"ConstructorRaisesException"}) { - $raisesExceptions = 1; - } - if (!$raisesExceptions) { - foreach my $parameter (@{$function->parameters}) { - if ((!$parameter->extendedAttributes->{"Callback"} and TypeCanFailConversion($parameter)) or $parameter->extendedAttributes->{"IsIndex"}) { - $raisesExceptions = 1; - } - } - } - - my $maybeObserveFeature = GenerateFeatureObservation($function->signature->extendedAttributes->{"V8MeasureAs"}); - - my @beforeArgumentList; - my @afterArgumentList; - push(@implContent, <<END); -v8::Handle<v8::Value> V8${interfaceName}::constructor${overloadedIndexString}Callback(const v8::Arguments& args) -{ - ${maybeObserveFeature} -END - - if ($function->{overloadedIndex} == 0) { - push(@implContent, GenerateConstructorHeader()); - push(@implContent, GenerateArgumentsCountCheck($function, $interface)); - } - - if ($raisesExceptions) { - AddToImplIncludes("ExceptionCode.h"); - push(@implContent, "\n"); - push(@implContent, " ExceptionCode ec = 0;\n"); - } - - # FIXME: Currently [Constructor(...)] does not yet support [Optional] arguments. - # It just supports [Optional=DefaultIsUndefined] or [Optional=DefaultIsNullString]. - my ($parameterCheckString, $paramIndex, %replacements) = GenerateParametersCheck($function, $interfaceName); - push(@implContent, $parameterCheckString); - - if ($interface->extendedAttributes->{"CallWith"} && $interface->extendedAttributes->{"CallWith"} eq "ScriptExecutionContext") { - push(@beforeArgumentList, "context"); - push(@implContent, <<END); - - ScriptExecutionContext* context = getScriptExecutionContext(); -END - } - - if ($interface->extendedAttributes->{"ConstructorRaisesException"}) { - push(@afterArgumentList, "ec"); - } - - my @argumentList; - my $index = 0; - foreach my $parameter (@{$function->parameters}) { - last if $index eq $paramIndex; - if ($replacements{$parameter->name}) { - push(@argumentList, $replacements{$parameter->name}); - } else { - push(@argumentList, $parameter->name); - } - $index++; - } - - my $argumentString = join(", ", @beforeArgumentList, @argumentList, @afterArgumentList); - push(@implContent, "\n"); - push(@implContent, " RefPtr<${interfaceName}> impl = ${interfaceName}::create(${argumentString});\n"); - push(@implContent, " v8::Handle<v8::Object> wrapper = args.Holder();\n"); - - if ($interface->extendedAttributes->{"ConstructorRaisesException"}) { - push(@implContent, " if (ec)\n"); - push(@implContent, " goto fail;\n"); - } - - push(@implContent, <<END); - - V8DOMWrapper::associateObjectWithWrapper(impl.release(), &info, wrapper, args.GetIsolate()); - return wrapper; -END - - if ($raisesExceptions) { - push(@implContent, " fail:\n"); - push(@implContent, " return setDOMException(ec, args.GetIsolate());\n"); - } - - push(@implContent, "}\n"); - push(@implContent, "\n"); -} - -sub GenerateCustomConstructorCallback -{ - my $interface = shift; - - my $interfaceName = $interface->name; - my $maybeObserveFeature = GenerateFeatureObservation($interface->extendedAttributes->{"V8MeasureAs"}); - push(@implContent, <<END); -v8::Handle<v8::Value> V8${interfaceName}::constructorCallback(const v8::Arguments& args) -{ - ${maybeObserveFeature} -END - push(@implContent, GenerateConstructorHeader()); - push(@implContent, <<END); - - return V8${interfaceName}::constructorCallbackCustom(args); -} - -END -} - -sub GenerateConstructorCallback -{ - my $interface = shift; - my $interfaceName = $interface->name; - - if (@{$interface->constructors} == 1) { - GenerateSingleConstructorCallback($interface, @{$interface->constructors}[0]); - } else { - foreach my $constructor (@{$interface->constructors}) { - GenerateSingleConstructorCallback($interface, $constructor); - } - GenerateOverloadedConstructorCallback($interface); - } -} - -sub GenerateEventConstructorCallback -{ - my $interface = shift; - my $interfaceName = $interface->name; - - AddToImplIncludes("Dictionary.h"); - push(@implContent, <<END); -v8::Handle<v8::Value> V8${interfaceName}::constructorCallback(const v8::Arguments& args) -{ -END - push(@implContent, GenerateConstructorHeader()); - - push(@implContent, <<END); - if (args.Length() < 1) - return throwNotEnoughArgumentsError(args.GetIsolate()); - - V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, type, args[0]); - ${interfaceName}Init eventInit; - if (args.Length() >= 2) { - V8TRYCATCH(Dictionary, options, Dictionary(args[1], args.GetIsolate())); - if (!fill${interfaceName}Init(eventInit, options)) - return v8Undefined(); - } - - RefPtr<${interfaceName}> event = ${interfaceName}::create(type, eventInit); - - v8::Handle<v8::Object> wrapper = args.Holder(); - V8DOMWrapper::associateObjectWithWrapper(event.release(), &info, wrapper, args.GetIsolate()); - return wrapper; -} - -bool fill${interfaceName}Init(${interfaceName}Init& eventInit, const Dictionary& options) -{ -END - - foreach my $interfaceBase (@{$interface->parents}) { - push(@implContent, <<END); - if (!fill${interfaceBase}Init(eventInit, options)) - return false; - -END - } - - for (my $index = 0; $index < @{$interface->attributes}; $index++) { - my $attribute = @{$interface->attributes}[$index]; - if ($attribute->signature->extendedAttributes->{"InitializedByEventConstructor"}) { - my $attributeName = $attribute->signature->name; - push(@implContent, " options.get(\"$attributeName\", eventInit.$attributeName);\n"); - } - } - - push(@implContent, <<END); - return true; -} - -END -} - -sub GenerateTypedArrayConstructorCallback -{ - my $interface = shift; - my $interfaceName = $interface->name; - my $viewType = GetTypeNameOfExternalTypedArray($interface); - my $type = $interface->extendedAttributes->{"TypedArray"}; - AddToImplIncludes("V8ArrayBufferViewCustom.h"); - - push(@implContent, <<END); -v8::Handle<v8::Value> V8${interfaceName}::constructorCallback(const v8::Arguments& args) -{ - return constructWebGLArray<$interfaceName, V8${interfaceName}, $type>(args, &info, $viewType); -} - -END -} - -sub GenerateNamedConstructorCallback -{ - my $function = shift; - my $interface = shift; - - my $interfaceName = $interface->name; - my $v8InterfaceName = "V8$interfaceName"; - my $raisesExceptions = @{$function->raisesExceptions}; - if ($interface->extendedAttributes->{"ConstructorRaisesException"}) { - $raisesExceptions = 1; - } - if (!$raisesExceptions) { - foreach my $parameter (@{$function->parameters}) { - if ((!$parameter->extendedAttributes->{"Callback"} and TypeCanFailConversion($parameter)) or $parameter->extendedAttributes->{"IsIndex"}) { - $raisesExceptions = 1; - } - } - } - - my $maybeObserveFeature = GenerateFeatureObservation($function->signature->extendedAttributes->{"V8MeasureAs"}); - - my @beforeArgumentList; - my @afterArgumentList; - - my $toActiveDOMObject = "0"; - if ($interface->extendedAttributes->{"ActiveDOMObject"}) { - $toActiveDOMObject = "${v8InterfaceName}::toActiveDOMObject"; - } - AddToImplIncludes("Frame.h"); - - push(@implContent, <<END); -WrapperTypeInfo ${v8InterfaceName}Constructor::info = { ${v8InterfaceName}Constructor::GetTemplate, ${v8InterfaceName}::derefObject, ${toActiveDOMObject}, 0, ${v8InterfaceName}::installPerContextPrototypeProperties, 0, WrapperTypeObjectPrototype }; - -static v8::Handle<v8::Value> ${v8InterfaceName}ConstructorCallback(const v8::Arguments& args) -{ - ${maybeObserveFeature} -END - push(@implContent, GenerateConstructorHeader()); - push(@implContent, <<END); - Document* document = currentDocument(BindingState::instance()); - - // Make sure the document is added to the DOM Node map. Otherwise, the ${interfaceName} instance - // may end up being the only node in the map and get garbage-collected prematurely. - toV8(document, args.Holder(), args.GetIsolate()); - -END - - push(@implContent, GenerateArgumentsCountCheck($function, $interface)); - - if ($raisesExceptions) { - AddToImplIncludes("ExceptionCode.h"); - push(@implContent, "\n"); - push(@implContent, " ExceptionCode ec = 0;\n"); - } - - my ($parameterCheckString, $paramIndex, %replacements) = GenerateParametersCheck($function, $interfaceName); - push(@implContent, $parameterCheckString); - - push(@beforeArgumentList, "document"); - - if ($interface->extendedAttributes->{"ConstructorRaisesException"}) { - push(@afterArgumentList, "ec"); - } - - my @argumentList; - my $index = 0; - foreach my $parameter (@{$function->parameters}) { - last if $index eq $paramIndex; - if ($replacements{$parameter->name}) { - push(@argumentList, $replacements{$parameter->name}); - } else { - push(@argumentList, $parameter->name); - } - $index++; - } - - my $argumentString = join(", ", @beforeArgumentList, @argumentList, @afterArgumentList); - push(@implContent, "\n"); - push(@implContent, " RefPtr<${interfaceName}> impl = ${interfaceName}::createForJSConstructor(${argumentString});\n"); - push(@implContent, " v8::Handle<v8::Object> wrapper = args.Holder();\n"); - - if ($interface->extendedAttributes->{"ConstructorRaisesException"}) { - push(@implContent, " if (ec)\n"); - push(@implContent, " goto fail;\n"); - } - - push(@implContent, <<END); - - V8DOMWrapper::associateObjectWithWrapper(impl.release(), &${v8InterfaceName}Constructor::info, wrapper, args.GetIsolate()); - return wrapper; -END - - if ($raisesExceptions) { - push(@implContent, " fail:\n"); - push(@implContent, " return setDOMException(ec, args.GetIsolate());\n"); - } - - push(@implContent, "}\n"); - - push(@implContent, <<END); - -v8::Persistent<v8::FunctionTemplate> ${v8InterfaceName}Constructor::GetTemplate() -{ - static v8::Persistent<v8::FunctionTemplate> cachedTemplate; - if (!cachedTemplate.IsEmpty()) - return cachedTemplate; - - v8::HandleScope scope; - v8::Local<v8::FunctionTemplate> result = v8::FunctionTemplate::New(${v8InterfaceName}ConstructorCallback); - - v8::Local<v8::ObjectTemplate> instance = result->InstanceTemplate(); - instance->SetInternalFieldCount(${v8InterfaceName}::internalFieldCount); - result->SetClassName(v8::String::NewSymbol("${interfaceName}")); - result->Inherit(${v8InterfaceName}::GetTemplate()); - - cachedTemplate = v8::Persistent<v8::FunctionTemplate>::New(result); - return cachedTemplate; -} - -END -} - -sub GenerateConstructorHeader -{ - my $content = <<END; - if (!args.IsConstructCall()) - return throwTypeError("DOM object constructor cannot be called as a function."); - - if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) - return args.Holder(); -END - return $content; -} - -sub GenerateBatchedAttributeData -{ - my $interface = shift; - my $attributes = shift; - my $interfaceName = $interface->name; - - foreach my $attribute (@$attributes) { - my $conditionalString = $codeGenerator->GenerateConditionalString($attribute->signature); - push(@implContent, "#if ${conditionalString}\n") if $conditionalString; - GenerateSingleBatchedAttribute($interfaceName, $attribute, ",", ""); - push(@implContent, "#endif // ${conditionalString}\n") if $conditionalString; - } -} - -sub GenerateSingleBatchedAttribute -{ - my $interfaceName = shift; - my $attribute = shift; - my $delimiter = shift; - my $indent = shift; - my $attrName = $attribute->signature->name; - my $attrExt = $attribute->signature->extendedAttributes; - - my $accessControl = "v8::DEFAULT"; - if ($attrExt->{"DoNotCheckSecurityOnGetter"}) { - $accessControl = "v8::ALL_CAN_READ"; - } elsif ($attrExt->{"DoNotCheckSecurityOnSetter"}) { - $accessControl = "v8::ALL_CAN_WRITE"; - } elsif ($attrExt->{"DoNotCheckSecurity"}) { - $accessControl = "v8::ALL_CAN_READ"; - if (!IsReadonly($attribute)) { - $accessControl .= " | v8::ALL_CAN_WRITE"; - } - } - if ($attrExt->{"V8Unforgeable"}) { - $accessControl .= " | v8::PROHIBITS_OVERWRITING"; - } - $accessControl = "static_cast<v8::AccessControl>(" . $accessControl . ")"; - - my $customAccessor = - $attrExt->{"Custom"} || - $attrExt->{"CustomSetter"} || - $attrExt->{"CustomGetter"} || - $attrExt->{"V8Custom"} || - $attrExt->{"V8CustomSetter"} || - $attrExt->{"V8CustomGetter"} || - ""; - if ($customAccessor eq "VALUE_IS_MISSING") { - # use the naming convension, interface + (capitalize) attr name - $customAccessor = $interfaceName . "::" . $attrName; - } - - my $getter; - my $setter; - my $propAttr = "v8::None"; - - # Check attributes. - if ($attrExt->{"NotEnumerable"}) { - $propAttr .= " | v8::DontEnum"; - } - if ($attrExt->{"V8Unforgeable"}) { - $propAttr .= " | v8::DontDelete"; - } - - my $on_proto = "0 /* on instance */"; - my $data = "0 /* no data */"; - - # Constructor - if ($attribute->signature->type =~ /Constructor$/) { - my $constructorType = $attribute->signature->type; - $constructorType =~ s/Constructor$//; - # $constructorType ~= /Constructor$/ indicates that it is NamedConstructor. - # We do not generate the header file for NamedConstructor of class XXXX, - # since we generate the NamedConstructor declaration into the header file of class XXXX. - if ($constructorType !~ /Constructor$/ || $attribute->signature->extendedAttributes->{"V8CustomConstructor"} || $attribute->signature->extendedAttributes->{"CustomConstructor"}) { - AddToImplIncludes("V8${constructorType}.h", $attribute->signature->extendedAttributes->{"Conditional"}); - } - if ($customAccessor) { - $getter = "V8${customAccessor}AccessorGetter"; - } else { - $data = "&V8${constructorType}::info"; - $getter = "${interfaceName}V8Internal::${interfaceName}ConstructorGetter"; - } - $setter = "${interfaceName}V8Internal::${interfaceName}ReplaceableAttrSetter"; - } else { - # Default Getter and Setter - $getter = "${interfaceName}V8Internal::${attrName}AttrGetter"; - $setter = "${interfaceName}V8Internal::${attrName}AttrSetter"; - - if ($attrExt->{"Replaceable"}) { - $setter = "${interfaceName}V8Internal::${interfaceName}ReplaceableAttrSetter"; - } - - # Custom Setter - if ($attrExt->{"CustomSetter"} || $attrExt->{"V8CustomSetter"} || $attrExt->{"Custom"} || $attrExt->{"V8Custom"}) { - $setter = "V8${customAccessor}AccessorSetter"; - } - - # Custom Getter - if ($attrExt->{"CustomGetter"} || $attrExt->{"V8CustomGetter"} || $attrExt->{"Custom"} || $attrExt->{"V8Custom"}) { - $getter = "V8${customAccessor}AccessorGetter"; - } - } - - # Read only attributes - if (IsReadonly($attribute)) { - $setter = "0"; - } - - # An accessor can be installed on the proto - if ($attrExt->{"V8OnProto"}) { - $on_proto = "1 /* on proto */"; - } - - my $commentInfo = "Attribute '$attrName' (Type: '" . $attribute->type . - "' ExtAttr: '" . join(' ', keys(%{$attrExt})) . "')"; - - push(@implContent, $indent . " \/\/ $commentInfo\n"); - push(@implContent, $indent . " {\"$attrName\", $getter, $setter, $data, $accessControl, static_cast<v8::PropertyAttribute>($propAttr), $on_proto}" . $delimiter . "\n"); -} - -sub IsStandardFunction -{ - my $interface = shift; - my $function = shift; - - my $interfaceName = $interface->name; - my $attrExt = $function->signature->extendedAttributes; - return 0 if $attrExt->{"V8Unforgeable"}; - return 0 if $function->isStatic; - return 0 if $attrExt->{"V8EnabledAtRuntime"}; - return 0 if $attrExt->{"V8EnabledPerContext"}; - return 0 if RequiresCustomSignature($function); - return 0 if $attrExt->{"V8DoNotCheckSignature"}; - return 0 if ($attrExt->{"DoNotCheckSecurity"} && ($interface->extendedAttributes->{"CheckSecurity"} || $interfaceName eq "DOMWindow")); - return 0 if $attrExt->{"NotEnumerable"}; - return 0 if $attrExt->{"V8ReadOnly"}; - return 1; -} - -sub GenerateNonStandardFunction -{ - my $interface = shift; - my $function = shift; - - my $interfaceName = $interface->name; - my $attrExt = $function->signature->extendedAttributes; - my $name = $function->signature->name; - - my $property_attributes = "v8::DontDelete"; - if ($attrExt->{"NotEnumerable"}) { - $property_attributes .= " | v8::DontEnum"; - } - if ($attrExt->{"V8ReadOnly"}) { - $property_attributes .= " | v8::ReadOnly"; - } - - my $commentInfo = "Function '$name' (ExtAttr: '" . join(' ', keys(%{$attrExt})) . "')"; - - my $template = "proto"; - if ($attrExt->{"V8Unforgeable"}) { - $template = "instance"; - } - if ($function->isStatic) { - $template = "desc"; - } - - my $conditional = ""; - if ($attrExt->{"V8EnabledAtRuntime"}) { - # Only call Set()/SetAccessor() if this method should be enabled - my $enable_function = GetRuntimeEnableFunctionName($function->signature); - $conditional = "if (${enable_function}())\n "; - } - if ($attrExt->{"V8EnabledPerContext"}) { - # Only call Set()/SetAccessor() if this method should be enabled - my $enable_function = GetContextEnableFunction($function->signature); - $conditional = "if (${enable_function}(impl->document()))\n "; - } - - if ($attrExt->{"DoNotCheckSecurity"} && - ($interface->extendedAttributes->{"CheckSecurity"} || $interfaceName eq "DOMWindow")) { - # Functions that are marked DoNotCheckSecurity are always readable but if they are changed - # and then accessed on a different domain we do not return the underlying value but instead - # return a new copy of the original function. This is achieved by storing the changed value - # as hidden property. - push(@implContent, <<END); - - // $commentInfo - ${conditional}$template->SetAccessor(v8::String::NewSymbol("$name"), ${interfaceName}V8Internal::${name}AttrGetter, ${interfaceName}V8Internal::${interfaceName}DomainSafeFunctionSetter, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>($property_attributes)); -END - return; - } - - my $signature = "defaultSignature"; - if ($attrExt->{"V8DoNotCheckSignature"} || $function->isStatic) { - $signature = "v8::Local<v8::Signature>()"; - } - - if (RequiresCustomSignature($function)) { - $signature = "${name}Signature"; - push(@implContent, "\n // Custom Signature '$name'\n", CreateCustomSignature($function)); - } - - # Normal function call is a template - my $callback = GetFunctionTemplateCallbackName($function, $interfaceName); - - if ($property_attributes eq "v8::DontDelete") { - $property_attributes = ""; - } else { - $property_attributes = ", static_cast<v8::PropertyAttribute>($property_attributes)"; - } - - if ($template eq "proto" && $conditional eq "" && $signature eq "defaultSignature" && $property_attributes eq "") { - die "This shouldn't happen: Intraface '$interfaceName' $commentInfo\n"; - } - - my $conditionalString = $codeGenerator->GenerateConditionalString($function->signature); - push(@implContent, "#if ${conditionalString}\n") if $conditionalString; - - push(@implContent, " ${conditional}$template->Set(v8::String::NewSymbol(\"$name\"), v8::FunctionTemplate::New($callback, v8Undefined(), ${signature})$property_attributes);\n"); - - push(@implContent, "#endif // ${conditionalString}\n") if $conditionalString; -} - -sub GenerateImplementationIndexer -{ - my $interface = shift; - my $indexer = shift; - my $interfaceName = $interface->name; - my $v8InterfaceName = "V8$interfaceName"; - - # FIXME: Figure out what NumericIndexedGetter is really supposed to do. Right now, it's only set on WebGL-related files. - my $hasCustomSetter = $interface->extendedAttributes->{"CustomIndexedSetter"} && !$interface->extendedAttributes->{"NumericIndexedGetter"}; - my $hasGetter = $interface->extendedAttributes->{"IndexedGetter"} || $interface->extendedAttributes->{"CustomGetOwnPropertySlot"}; - - # FIXME: Investigate and remove this nastinesss. In V8, named property handling and indexer handling are apparently decoupled, - # which means that object[X] where X is a number doesn't reach named property indexer. So we need to provide - # simplistic, mirrored indexer handling in addition to named property handling. - my $isSpecialCase = exists $indexerSpecialCases{$interfaceName}; - if ($isSpecialCase) { - $hasGetter = 1; - if ($interface->extendedAttributes->{"CustomNamedSetter"}) { - $hasCustomSetter = 1; - } - } - - my $hasEnumerator = !$isSpecialCase && $codeGenerator->IsSubType($interface, "Node"); - - # FIXME: Find a way to not have to special-case HTMLOptionsCollection. - if ($interfaceName eq "HTMLOptionsCollection") { - $hasEnumerator = 1; - $hasGetter = 1; - } - - if (!$hasGetter) { - return; - } - - AddToImplIncludes("V8Collection.h"); - - if (!$indexer) { - $indexer = $codeGenerator->FindSuperMethod($interface, "item"); - } - - my $indexerType = $indexer ? $indexer->type : 0; - - # FIXME: Remove this once toV8 helper methods are implemented (see https://bugs.webkit.org/show_bug.cgi?id=32563). - if ($interfaceName eq "WebKitCSSKeyframesRule") { - $indexerType = "WebKitCSSKeyframeRule"; - } - - if ($indexerType && !$hasCustomSetter) { - if ($indexerType eq "DOMString") { - my $conversion = $indexer->extendedAttributes->{"TreatReturnedNullStringAs"}; - if ($conversion && $conversion eq "Null") { - push(@implContent, <<END); - setCollectionStringOrUndefinedIndexedGetter<${interfaceName}>(desc); -END - } else { - push(@implContent, <<END); - setCollectionStringIndexedGetter<${interfaceName}>(desc); -END - } - } else { - push(@implContent, <<END); - setCollectionIndexedGetter<${interfaceName}, ${indexerType}>(desc); -END - # Include the header for this indexer type, because setCollectionIndexedGetter() requires toV8() for this type. - AddToImplIncludes("V8${indexerType}.h"); - } - - return; - } - - my $hasDeleter = $interface->extendedAttributes->{"CustomDeleteProperty"}; - my $setOn = "Instance"; - - # V8 has access-check callback API (see ObjectTemplate::SetAccessCheckCallbacks) and it's used on DOMWindow - # instead of deleters or enumerators. In addition, the getter should be set on prototype template, to - # get implementation straight out of the DOMWindow prototype regardless of what prototype is actually set - # on the object. - if ($interfaceName eq "DOMWindow") { - $setOn = "Prototype"; - $hasDeleter = 0; - } - - push(@implContent, " desc->${setOn}Template()->SetIndexedPropertyHandler(${v8InterfaceName}::indexedPropertyGetter"); - push(@implContent, $hasCustomSetter ? ", ${v8InterfaceName}::indexedPropertySetter" : ", 0"); - push(@implContent, ", 0"); # IndexedPropertyQuery -- not being used at the moment. - push(@implContent, $hasDeleter ? ", ${v8InterfaceName}::indexedPropertyDeleter" : ", 0"); - push(@implContent, ", nodeCollectionIndexedPropertyEnumerator<${interfaceName}>") if $hasEnumerator; - push(@implContent, ");\n"); -} - -sub GenerateImplementationNamedPropertyGetter -{ - my $interface = shift; - my $namedPropertyGetter = shift; - my $interfaceName = $interface->name; - my $v8InterfaceName = "V8$interfaceName"; - my $hasCustomNamedGetter = $interface->extendedAttributes->{"CustomNamedGetter"} || $interface->extendedAttributes->{"CustomGetOwnPropertySlot"}; - - if ($interfaceName eq "HTMLAppletElement" || $interfaceName eq "HTMLEmbedElement" || $interfaceName eq "HTMLObjectElement") { - $hasCustomNamedGetter = 1; - } - - if ($interfaceName eq "HTMLDocument") { - $hasCustomNamedGetter = 0; - } - - my $hasGetter = $interface->extendedAttributes->{"NamedGetter"} || $hasCustomNamedGetter; - if (!$hasGetter) { - return; - } - - if (!$namedPropertyGetter) { - $namedPropertyGetter = $codeGenerator->FindSuperMethod($interface, "namedItem"); - } - - if ($namedPropertyGetter && $namedPropertyGetter->type ne "Node" && !$namedPropertyGetter->extendedAttributes->{"Custom"} && !$hasCustomNamedGetter) { - AddToImplIncludes("V8Collection.h"); - my $type = $namedPropertyGetter->type; - push(@implContent, <<END); - setCollectionNamedGetter<${interfaceName}, ${type}>(desc); -END - return; - } - - my $hasCustomNamedSetter = $interface->extendedAttributes->{"CustomNamedSetter"}; - my $hasDeleter = $interface->extendedAttributes->{"CustomDeleteProperty"}; - my $hasEnumerator = $interface->extendedAttributes->{"CustomEnumerateProperty"}; - my $setOn = "Instance"; - - # V8 has access-check callback API (see ObjectTemplate::SetAccessCheckCallbacks) and it's used on DOMWindow - # instead of deleters or enumerators. In addition, the getter should be set on prototype template, to - # get implementation straight out of the DOMWindow prototype regardless of what prototype is actually set - # on the object. - if ($interfaceName eq "DOMWindow") { - $setOn = "Prototype"; - $hasDeleter = 0; - $hasEnumerator = 0; - } - - push(@implContent, " desc->${setOn}Template()->SetNamedPropertyHandler(${v8InterfaceName}::namedPropertyGetter, "); - push(@implContent, $hasCustomNamedSetter ? "${v8InterfaceName}::namedPropertySetter, " : "0, "); - # If there is a custom enumerator, there MUST be custom query to properly communicate property attributes. - push(@implContent, $hasEnumerator ? "${v8InterfaceName}::namedPropertyQuery, " : "0, "); - push(@implContent, $hasDeleter ? "${v8InterfaceName}::namedPropertyDeleter, " : "0, "); - push(@implContent, $hasEnumerator ? "${v8InterfaceName}::namedPropertyEnumerator" : "0"); - push(@implContent, ");\n"); -} - -sub GenerateImplementationCustomCall -{ - my $interface = shift; - my $interfaceName = $interface->name; - - if ($interface->extendedAttributes->{"CustomCall"}) { - push(@implContent, " desc->InstanceTemplate()->SetCallAsFunctionHandler(V8${interfaceName}::callAsFunctionCallback);\n"); - } -} - -sub GenerateImplementationMasqueradesAsUndefined -{ - my $interface = shift; - if ($interface->extendedAttributes->{"MasqueradesAsUndefined"}) - { - push(@implContent, " desc->InstanceTemplate()->MarkAsUndetectable();\n"); - } -} - -sub GenerateImplementation -{ - my $object = shift; - my $interface = shift; - my $interfaceName = $interface->name; - my $visibleInterfaceName = $codeGenerator->GetVisibleInterfaceName($interface); - my $v8InterfaceName = "V8$interfaceName"; - my $nativeType = GetNativeTypeForConversions($interface); - - # - Add default header template - push(@implContentHeader, GenerateImplementationContentHeader($interface)); - - AddToImplIncludes("BindingState.h"); - AddToImplIncludes("ContextFeatures.h"); - AddToImplIncludes("RuntimeEnabledFeatures.h"); - AddToImplIncludes("V8Binding.h"); - AddToImplIncludes("V8DOMWrapper.h"); - - AddIncludesForType($interfaceName); - - my $toActive = $interface->extendedAttributes->{"ActiveDOMObject"} ? "${v8InterfaceName}::toActiveDOMObject" : "0"; - my $rootForGC = NeedsCustomOpaqueRootForGC($interface) ? "${v8InterfaceName}::opaqueRootForGC" : "0"; - - # Find the super descriptor. - my $parentClass = ""; - my $parentClassTemplate = ""; - foreach (@{$interface->parents}) { - my $parent = $_; - AddToImplIncludes("V8${parent}.h"); - $parentClass = "V8" . $parent; - $parentClassTemplate = $parentClass . "::GetTemplate()"; - last; - } - push(@implContentDecls, "namespace WebCore {\n\n"); - my $parentClassInfo = $parentClass ? "&${parentClass}::info" : "0"; - - my $WrapperTypePrototype = $interface->isException ? "WrapperTypeErrorPrototype" : "WrapperTypeObjectPrototype"; - - push(@implContentDecls, "WrapperTypeInfo ${v8InterfaceName}::info = { ${v8InterfaceName}::GetTemplate, ${v8InterfaceName}::derefObject, $toActive, $rootForGC, ${v8InterfaceName}::installPerContextPrototypeProperties, $parentClassInfo, $WrapperTypePrototype };\n\n"); - push(@implContentDecls, "namespace ${interfaceName}V8Internal {\n\n"); - - push(@implContentDecls, "template <typename T> void V8_USE(T) { }\n\n"); - - my $hasConstructors = 0; - my $hasReplaceable = 0; - - # Generate property accessors for attributes. - for (my $index = 0; $index < @{$interface->attributes}; $index++) { - my $attribute = @{$interface->attributes}[$index]; - my $attrType = $attribute->signature->type; - - # Generate special code for the constructor attributes. - if ($attrType =~ /Constructor$/) { - if (!($attribute->signature->extendedAttributes->{"CustomGetter"} || - $attribute->signature->extendedAttributes->{"V8CustomGetter"})) { - $hasConstructors = 1; - } - next; - } - - if ($attrType eq "EventListener" && $interfaceName eq "DOMWindow") { - $attribute->signature->extendedAttributes->{"V8OnProto"} = 1; - } - - if ($attrType eq "SerializedScriptValue") { - AddToImplIncludes("SerializedScriptValue.h"); - } - - # Do not generate accessor if this is a custom attribute. The - # call will be forwarded to a hand-written accessor - # implementation. - if ($attribute->signature->extendedAttributes->{"Custom"} || - $attribute->signature->extendedAttributes->{"V8Custom"}) { - next; - } - - # Generate the accessor. - if (!($attribute->signature->extendedAttributes->{"CustomGetter"} || - $attribute->signature->extendedAttributes->{"V8CustomGetter"})) { - GenerateNormalAttrGetter($attribute, $interface); - } - - if ($attribute->signature->extendedAttributes->{"Replaceable"}) { - $hasReplaceable = 1; - } elsif (!$attribute->signature->extendedAttributes->{"CustomSetter"} && - !$attribute->signature->extendedAttributes->{"V8CustomSetter"} && - !IsReadonly($attribute)) { - GenerateNormalAttrSetter($attribute, $interface); - } - } - - if ($hasConstructors) { - GenerateConstructorGetter($interface); - } - - if ($hasConstructors || $hasReplaceable) { - GenerateReplaceableAttrSetter($interface); - } - - if (NeedsCustomOpaqueRootForGC($interface)) { - GenerateOpaqueRootForGC($interface); - } - - if ($interface->extendedAttributes->{"TypedArray"}) { - my $viewType = GetTypeNameOfExternalTypedArray($interface); - push(@implContent, <<END); -v8::Handle<v8::Object> wrap($interfaceName* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) -{ - ASSERT(impl); - v8::Handle<v8::Object> wrapper = ${v8InterfaceName}::createWrapper(impl, creationContext, isolate); - if (!wrapper.IsEmpty()) - wrapper->SetIndexedPropertiesToExternalArrayData(impl->baseAddress(), $viewType, impl->length()); - return wrapper; -} - -END - } - - my $indexer; - my $namedPropertyGetter; - my @enabledPerContextFunctions; - my @normalFunctions; - my $needsDomainSafeFunctionSetter = 0; - # Generate methods for functions. - foreach my $function (@{$interface->functions}) { - my $isCustom = $function->signature->extendedAttributes->{"Custom"} || $function->signature->extendedAttributes->{"V8Custom"}; - if (!$isCustom) { - GenerateFunctionCallback($function, $interface); - if ($function->{overloadIndex} > 1 && $function->{overloadIndex} == @{$function->{overloads}}) { - GenerateOverloadedFunctionCallback($function, $interface); - } - } - - if ($function->signature->name eq "item") { - $indexer = $function->signature; - } - - if ($interfaceName eq "HTMLPropertiesCollection") { - if ($function->signature->name eq "propertyNodeList") { - $namedPropertyGetter = $function->signature; - } - } elsif ($function->signature->name eq "namedItem") { - $namedPropertyGetter = $function->signature; - } - - # If the function does not need domain security check, we need to - # generate an access getter that returns different function objects - # for different calling context. - if (($interface->extendedAttributes->{"CheckSecurity"} || ($interfaceName eq "DOMWindow")) && $function->signature->extendedAttributes->{"DoNotCheckSecurity"}) { - if (!$isCustom || $function->{overloadIndex} == 1) { - GenerateDomainSafeFunctionGetter($function, $interfaceName); - $needsDomainSafeFunctionSetter = 1; - } - } - - # Separate out functions that are enabled per context so we can process them specially. - if ($function->signature->extendedAttributes->{"V8EnabledPerContext"}) { - push(@enabledPerContextFunctions, $function); - } else { - push(@normalFunctions, $function); - } - } - - if ($needsDomainSafeFunctionSetter) { - GenerateDomainSafeFunctionSetter($interfaceName); - } - - # Attributes - my $attributes = $interface->attributes; - - # For the DOMWindow interface we partition the attributes into the - # ones that disallows shadowing and the rest. - my @disallowsShadowing; - # Also separate out attributes that are enabled at runtime so we can process them specially. - my @enabledAtRuntimeAttributes; - my @enabledPerContextAttributes; - my @normalAttributes; - foreach my $attribute (@$attributes) { - - if ($interfaceName eq "DOMWindow" && $attribute->signature->extendedAttributes->{"V8Unforgeable"}) { - push(@disallowsShadowing, $attribute); - } elsif ($attribute->signature->extendedAttributes->{"V8EnabledAtRuntime"}) { - push(@enabledAtRuntimeAttributes, $attribute); - } elsif ($attribute->signature->extendedAttributes->{"V8EnabledPerContext"}) { - push(@enabledPerContextAttributes, $attribute); - } else { - push(@normalAttributes, $attribute); - } - } - $attributes = \@normalAttributes; - # Put the attributes that disallow shadowing on the shadow object. - if (@disallowsShadowing) { - push(@implContent, "static const V8DOMConfiguration::BatchedAttribute shadowAttrs[] = {\n"); - GenerateBatchedAttributeData($interface, \@disallowsShadowing); - push(@implContent, "};\n\n"); - } - - my $has_attributes = 0; - if (@$attributes) { - $has_attributes = 1; - push(@implContent, "static const V8DOMConfiguration::BatchedAttribute ${v8InterfaceName}Attrs[] = {\n"); - GenerateBatchedAttributeData($interface, $attributes); - push(@implContent, "};\n\n"); - } - - # Setup table of standard callback functions - my $num_callbacks = 0; - my $has_callbacks = 0; - foreach my $function (@normalFunctions) { - # Only one table entry is needed for overloaded methods: - next if $function->{overloadIndex} > 1; - # Don't put any nonstandard functions into this table: - next if !IsStandardFunction($interface, $function); - if (!$has_callbacks) { - $has_callbacks = 1; - push(@implContent, "static const V8DOMConfiguration::BatchedCallback ${v8InterfaceName}Callbacks[] = {\n"); - } - my $name = $function->signature->name; - my $callback = GetFunctionTemplateCallbackName($function, $interfaceName); - my $conditionalString = $codeGenerator->GenerateConditionalString($function->signature); - push(@implContent, "#if ${conditionalString}\n") if $conditionalString; - push(@implContent, <<END); - {"$name", $callback}, -END - push(@implContent, "#endif\n") if $conditionalString; - $num_callbacks++; - } - push(@implContent, "};\n\n") if $has_callbacks; - - # Setup constants - my $has_constants = 0; - my @constantsEnabledAtRuntime; - if (@{$interface->constants}) { - $has_constants = 1; - push(@implContent, "static const V8DOMConfiguration::BatchedConstant ${v8InterfaceName}Consts[] = {\n"); - } - foreach my $constant (@{$interface->constants}) { - my $name = $constant->name; - my $value = $constant->value; - my $attrExt = $constant->extendedAttributes; - my $conditional = $attrExt->{"Conditional"}; - my $implementedBy = $attrExt->{"ImplementedBy"}; - if ($implementedBy) { - AddToImplIncludes("${implementedBy}.h"); - } - if ($attrExt->{"V8EnabledAtRuntime"}) { - push(@constantsEnabledAtRuntime, $constant); - } else { - # FIXME: we need the static_cast here only because of one constant, NodeFilter.idl - # defines "const unsigned long SHOW_ALL = 0xFFFFFFFF". It would be better if we - # handled this here, and converted it to a -1 constant in the c++ output. - if ($conditional) { - my $conditionalString = $codeGenerator->GenerateConditionalStringFromAttributeValue($conditional); - push(@implContent, "#if ${conditionalString}\n"); - } - push(@implContent, <<END); - {"${name}", static_cast<signed int>($value)}, -END - push(@implContent, "#endif\n") if $conditional; - } - } - if ($has_constants) { - push(@implContent, "};\n\n"); - push(@implContent, $codeGenerator->GenerateCompileTimeCheckForEnumsIfNeeded($interface)); - } - - push(@implContentDecls, "} // namespace ${interfaceName}V8Internal\n\n"); - - if (HasCustomConstructor($interface)) { - GenerateCustomConstructorCallback($interface); - } elsif ($interface->extendedAttributes->{"NamedConstructor"}) { - GenerateNamedConstructorCallback(@{$interface->constructors}[0], $interface); - } elsif ($interface->extendedAttributes->{"Constructor"}) { - GenerateConstructorCallback($interface); - } elsif ($codeGenerator->IsConstructorTemplate($interface, "Event")) { - GenerateEventConstructorCallback($interface); - } elsif ($codeGenerator->IsConstructorTemplate($interface, "TypedArray")) { - GenerateTypedArrayConstructorCallback($interface); - } - - my $access_check = ""; - if ($interface->extendedAttributes->{"CheckSecurity"} && !($interfaceName eq "DOMWindow")) { - $access_check = "instance->SetAccessCheckCallbacks(${v8InterfaceName}::namedSecurityCheck, ${v8InterfaceName}::indexedSecurityCheck, v8::External::New(&${v8InterfaceName}::info));"; - } - - # For the DOMWindow interface, generate the shadow object template - # configuration method. - if ($interfaceName eq "DOMWindow") { - push(@implContent, <<END); -static v8::Persistent<v8::ObjectTemplate> ConfigureShadowObjectTemplate(v8::Persistent<v8::ObjectTemplate> templ) -{ - V8DOMConfiguration::batchConfigureAttributes(templ, v8::Handle<v8::ObjectTemplate>(), shadowAttrs, WTF_ARRAY_LENGTH(shadowAttrs)); - - // Install a security handler with V8. - templ->SetAccessCheckCallbacks(V8DOMWindow::namedSecurityCheck, V8DOMWindow::indexedSecurityCheck, v8::External::New(&V8DOMWindow::info)); - templ->SetInternalFieldCount(V8DOMWindow::internalFieldCount); - return templ; -} -END - } - - if (!$parentClassTemplate) { - $parentClassTemplate = "v8::Persistent<v8::FunctionTemplate>()"; - } - - # Generate the template configuration method - push(@implContent, <<END); -static v8::Persistent<v8::FunctionTemplate> Configure${v8InterfaceName}Template(v8::Persistent<v8::FunctionTemplate> desc) -{ - desc->ReadOnlyPrototype(); - - v8::Local<v8::Signature> defaultSignature; -END - if ($interface->extendedAttributes->{"V8EnabledAtRuntime"}) { - my $enable_function = GetRuntimeEnableFunctionName($interface); - push(@implContent, <<END); - if (!${enable_function}()) - defaultSignature = V8DOMConfiguration::configureTemplate(desc, \"\", $parentClassTemplate, ${v8InterfaceName}::internalFieldCount, 0, 0, 0, 0); - else -END - } - push(@implContent, <<END); - defaultSignature = V8DOMConfiguration::configureTemplate(desc, \"${visibleInterfaceName}\", $parentClassTemplate, ${v8InterfaceName}::internalFieldCount, -END - # Set up our attributes if we have them - if ($has_attributes) { - push(@implContent, <<END); - ${v8InterfaceName}Attrs, WTF_ARRAY_LENGTH(${v8InterfaceName}Attrs), -END - } else { - push(@implContent, <<END); - 0, 0, -END - } - - if ($has_callbacks) { - push(@implContent, <<END); - ${v8InterfaceName}Callbacks, WTF_ARRAY_LENGTH(${v8InterfaceName}Callbacks)); -END - } else { - push(@implContent, <<END); - 0, 0); -END - } - - AddToImplIncludes("wtf/UnusedParam.h"); - push(@implContent, <<END); - UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. -END - - if (IsConstructable($interface)) { - push(@implContent, <<END); - desc->SetCallHandler(${v8InterfaceName}::constructorCallback); -END - } - - if ($access_check or @enabledAtRuntimeAttributes or @normalFunctions or $has_constants) { - push(@implContent, <<END); - v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate(); - UNUSED_PARAM(instance); // In some cases, it will not be used. - UNUSED_PARAM(proto); // In some cases, it will not be used. -END - } - - push(@implContent, " $access_check\n"); - - # Setup the enable-at-runtime attrs if we have them - foreach my $runtime_attr (@enabledAtRuntimeAttributes) { - my $enable_function = GetRuntimeEnableFunctionName($runtime_attr->signature); - my $conditionalString = $codeGenerator->GenerateConditionalString($runtime_attr->signature); - push(@implContent, "\n#if ${conditionalString}\n") if $conditionalString; - push(@implContent, " if (${enable_function}()) {\n"); - push(@implContent, " static const V8DOMConfiguration::BatchedAttribute attrData =\\\n"); - GenerateSingleBatchedAttribute($interfaceName, $runtime_attr, ";", " "); - push(@implContent, <<END); - V8DOMConfiguration::configureAttribute(instance, proto, attrData); - } -END - push(@implContent, "\n#endif // ${conditionalString}\n") if $conditionalString; - } - - # Setup the enable-at-runtime constants if we have them - foreach my $runtime_const (@constantsEnabledAtRuntime) { - my $enable_function = GetRuntimeEnableFunctionName($runtime_const); - my $conditionalString = $codeGenerator->GenerateConditionalString($runtime_const); - my $name = $runtime_const->name; - my $value = $runtime_const->value; - push(@implContent, "\n#if ${conditionalString}\n") if $conditionalString; - push(@implContent, " if (${enable_function}()) {\n"); - push(@implContent, <<END); - static const V8DOMConfiguration::BatchedConstant constData = {"${name}", static_cast<signed int>(${value})}; - V8DOMConfiguration::batchConfigureConstants(desc, proto, &constData, 1); -END - push(@implContent, " }\n"); - push(@implContent, "\n#endif // ${conditionalString}\n") if $conditionalString; - } - - GenerateImplementationIndexer($interface, $indexer); - GenerateImplementationNamedPropertyGetter($interface, $namedPropertyGetter); - GenerateImplementationCustomCall($interface); - GenerateImplementationMasqueradesAsUndefined($interface); - - # Define our functions with Set() or SetAccessor() - my $total_functions = 0; - foreach my $function (@normalFunctions) { - # Only one accessor is needed for overloaded methods: - next if $function->{overloadIndex} > 1; - - $total_functions++; - next if IsStandardFunction($interface, $function); - GenerateNonStandardFunction($interface, $function); - $num_callbacks++; - } - - die "Wrong number of callbacks generated for $interfaceName ($num_callbacks, should be $total_functions)" if $num_callbacks != $total_functions; - - if ($has_constants) { - push(@implContent, <<END); - V8DOMConfiguration::batchConfigureConstants(desc, proto, ${v8InterfaceName}Consts, WTF_ARRAY_LENGTH(${v8InterfaceName}Consts)); -END - } - - # Special cases - if ($interfaceName eq "DOMWindow") { - push(@implContent, <<END); - - proto->SetInternalFieldCount(V8DOMWindow::internalFieldCount); - desc->SetHiddenPrototype(true); - instance->SetInternalFieldCount(V8DOMWindow::internalFieldCount); - // Set access check callbacks, but turned off initially. - // When a context is detached from a frame, turn on the access check. - // Turning on checks also invalidates inline caches of the object. - instance->SetAccessCheckCallbacks(V8DOMWindow::namedSecurityCheck, V8DOMWindow::indexedSecurityCheck, v8::External::New(&V8DOMWindow::info), false); -END - } - if ($interfaceName eq "HTMLDocument" or $interfaceName eq "DedicatedWorkerContext" or $interfaceName eq "SharedWorkerContext") { - push(@implContent, <<END); - desc->SetHiddenPrototype(true); -END - } - if ($interfaceName eq "Location") { - push(@implContent, <<END); - - // For security reasons, these functions are on the instance instead - // of on the prototype object to ensure that they cannot be overwritten. - instance->SetAccessor(v8::String::NewSymbol("reload"), V8Location::reloadAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly)); - instance->SetAccessor(v8::String::NewSymbol("replace"), V8Location::replaceAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly)); - instance->SetAccessor(v8::String::NewSymbol("assign"), V8Location::assignAccessorGetter, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly)); -END - } - - push(@implContent, <<END); - - // Custom toString template - desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate()); - return desc; -} - -v8::Persistent<v8::FunctionTemplate> ${v8InterfaceName}::GetRawTemplate() -{ - V8PerIsolateData* data = V8PerIsolateData::current(); - V8PerIsolateData::TemplateMap::iterator result = data->rawTemplateMap().find(&info); - if (result != data->rawTemplateMap().end()) - return result->value; - - v8::HandleScope handleScope; - v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(); - data->rawTemplateMap().add(&info, templ); - return templ; -} - -v8::Persistent<v8::FunctionTemplate> ${v8InterfaceName}::GetTemplate() -{ - V8PerIsolateData* data = V8PerIsolateData::current(); - V8PerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info); - if (result != data->templateMap().end()) - return result->value; - - v8::HandleScope handleScope; - v8::Persistent<v8::FunctionTemplate> templ = - Configure${v8InterfaceName}Template(GetRawTemplate()); - data->templateMap().add(&info, templ); - return templ; -} - -bool ${v8InterfaceName}::HasInstance(v8::Handle<v8::Value> value) -{ - return GetRawTemplate()->HasInstance(value); -} - -END - - if (@enabledPerContextAttributes) { - push(@implContent, <<END); -void ${v8InterfaceName}::installPerContextProperties(v8::Handle<v8::Object> instance, ${nativeType}* impl) -{ - v8::Local<v8::Object> proto = v8::Local<v8::Object>::Cast(instance->GetPrototype()); - // When building QtWebkit with V8 this variable is unused when none of the features are enabled. - UNUSED_PARAM(proto); -END - - # Setup the enable-by-settings attrs if we have them - foreach my $runtimeAttr (@enabledPerContextAttributes) { - my $enableFunction = GetContextEnableFunction($runtimeAttr->signature); - my $conditionalString = $codeGenerator->GenerateConditionalString($runtimeAttr->signature); - push(@implContent, "\n#if ${conditionalString}\n") if $conditionalString; - push(@implContent, " if (${enableFunction}(impl->document())) {\n"); - push(@implContent, " static const V8DOMConfiguration::BatchedAttribute attrData =\\\n"); - GenerateSingleBatchedAttribute($interfaceName, $runtimeAttr, ";", " "); - push(@implContent, <<END); - V8DOMConfiguration::configureAttribute(instance, proto, attrData); -END - push(@implContent, " }\n"); - push(@implContent, "#endif // ${conditionalString}\n") if $conditionalString; - } - push(@implContent, <<END); -} -END - } - - if (@enabledPerContextFunctions) { - push(@implContent, <<END); -void ${v8InterfaceName}::installPerContextPrototypeProperties(v8::Handle<v8::Object> proto) -{ - UNUSED_PARAM(proto); -END - # Setup the enable-by-settings functions if we have them - push(@implContent, <<END); - v8::Local<v8::Signature> defaultSignature = v8::Signature::New(GetTemplate()); - UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. - - ScriptExecutionContext* context = toScriptExecutionContext(proto->CreationContext()); -END - - foreach my $runtimeFunc (@enabledPerContextFunctions) { - my $enableFunction = GetContextEnableFunction($runtimeFunc->signature); - my $conditionalString = $codeGenerator->GenerateConditionalString($runtimeFunc->signature); - push(@implContent, "\n#if ${conditionalString}\n") if $conditionalString; - push(@implContent, " if (context && context->isDocument() && ${enableFunction}(static_cast<Document*>(context))) {\n"); - my $name = $runtimeFunc->signature->name; - my $callback = GetFunctionTemplateCallbackName($runtimeFunc, $interfaceName); - push(@implContent, <<END); - proto->Set(v8::String::NewSymbol("${name}"), v8::FunctionTemplate::New(${callback}, v8Undefined(), defaultSignature)->GetFunction()); -END - push(@implContent, " }\n"); - push(@implContent, "#endif // ${conditionalString}\n") if $conditionalString; - } - - push(@implContent, <<END); -} -END - } - - if ($interface->extendedAttributes->{"ActiveDOMObject"}) { - # MessagePort is handled like an active dom object even though it doesn't inherit - # from ActiveDOMObject, so don't try to cast it to ActiveDOMObject. - my $returnValue = $interfaceName eq "MessagePort" ? "0" : "toNative(object)"; - push(@implContent, <<END); -ActiveDOMObject* ${v8InterfaceName}::toActiveDOMObject(v8::Handle<v8::Object> object) -{ - return ${returnValue}; -} -END - } - - if ($interfaceName eq "DOMWindow") { - push(@implContent, <<END); -v8::Persistent<v8::ObjectTemplate> V8DOMWindow::GetShadowObjectTemplate() -{ - static v8::Persistent<v8::ObjectTemplate> V8DOMWindowShadowObjectCache; - if (V8DOMWindowShadowObjectCache.IsEmpty()) { - V8DOMWindowShadowObjectCache = v8::Persistent<v8::ObjectTemplate>::New(v8::ObjectTemplate::New()); - ConfigureShadowObjectTemplate(V8DOMWindowShadowObjectCache); - } - return V8DOMWindowShadowObjectCache; -} -END - } - - GenerateToV8Converters($interface, $v8InterfaceName, $nativeType); - - push(@implContent, <<END); - -void ${v8InterfaceName}::derefObject(void* object) -{ - static_cast<${nativeType}*>(object)->deref(); -} - -} // namespace WebCore -END - - my $conditionalString = $codeGenerator->GenerateConditionalString($interface); - push(@implContent, "\n#endif // ${conditionalString}\n") if $conditionalString; - - # We've already added the header for this file in implContentHeader, so remove - # it from implIncludes to ensure we don't #include it twice. - delete $implIncludes{"${v8InterfaceName}.h"}; -} - -sub GenerateHeaderContentHeader -{ - my $interface = shift; - my $v8InterfaceName = "V8" . $interface->name; - my $conditionalString = $codeGenerator->GenerateConditionalString($interface); - - my @headerContentHeader = split("\r", $headerTemplate); - - push(@headerContentHeader, "\n#if ${conditionalString}\n") if $conditionalString; - push(@headerContentHeader, "\n#ifndef ${v8InterfaceName}" . "_h"); - push(@headerContentHeader, "\n#define ${v8InterfaceName}" . "_h\n\n"); - return @headerContentHeader; -} - -sub GenerateImplementationContentHeader -{ - my $interface = shift; - my $v8InterfaceName = "V8" . $interface->name; - my $conditionalString = $codeGenerator->GenerateConditionalString($interface); - - my @implContentHeader = split("\r", $headerTemplate); - - push(@implContentHeader, "\n#include \"config.h\"\n"); - push(@implContentHeader, "#include \"${v8InterfaceName}.h\"\n\n"); - push(@implContentHeader, "#if ${conditionalString}\n\n") if $conditionalString; - return @implContentHeader; -} - -sub GenerateCallbackHeader -{ - my $object = shift; - my $interface = shift; - - my $interfaceName = $interface->name; - my $v8InterfaceName = "V8$interfaceName"; - - - # - Add default header template - push(@headerContent, GenerateHeaderContentHeader($interface)); - - my @unsortedIncludes = (); - push(@unsortedIncludes, "#include \"ActiveDOMCallback.h\""); - push(@unsortedIncludes, "#include \"$interfaceName.h\""); - push(@unsortedIncludes, "#include \"ScopedPersistent.h\""); - push(@unsortedIncludes, "#include \"WorldContextHandle.h\""); - push(@unsortedIncludes, "#include <v8.h>"); - push(@unsortedIncludes, "#include <wtf/Forward.h>"); - push(@headerContent, join("\n", sort @unsortedIncludes)); - - push(@headerContent, "\n\nnamespace WebCore {\n\n"); - push(@headerContent, "class ScriptExecutionContext;\n\n"); - push(@headerContent, "class $v8InterfaceName : public $interfaceName, public ActiveDOMCallback {\n"); - - push(@headerContent, <<END); -public: - static PassRefPtr<${v8InterfaceName}> create(v8::Handle<v8::Value> value, ScriptExecutionContext* context, v8::Handle<v8::Object> owner = v8::Handle<v8::Object>()) - { - ASSERT(value->IsObject()); - ASSERT(context); - return adoptRef(new ${v8InterfaceName}(v8::Handle<v8::Object>::Cast(value), context, owner)); - } - - virtual ~${v8InterfaceName}(); - -END - - # Functions - my $numFunctions = @{$interface->functions}; - if ($numFunctions > 0) { - push(@headerContent, " // Functions\n"); - foreach my $function (@{$interface->functions}) { - my @params = @{$function->parameters}; - if (!$function->signature->extendedAttributes->{"Custom"} && - !(GetNativeType($function->signature->type) eq "bool")) { - push(@headerContent, " COMPILE_ASSERT(false)"); - } - - push(@headerContent, " virtual " . GetNativeTypeForCallbacks($function->signature->type) . " " . $function->signature->name . "("); - - my @args = (); - foreach my $param (@params) { - push(@args, GetNativeTypeForCallbacks($param->type) . " " . $param->name); - } - push(@headerContent, join(", ", @args)); - push(@headerContent, ");\n"); - } - } - - push(@headerContent, <<END); - -private: - ${v8InterfaceName}(v8::Handle<v8::Object>, ScriptExecutionContext*, v8::Handle<v8::Object>); - - static void weakCallback(v8::Persistent<v8::Value> wrapper, void* parameter) - { - ${v8InterfaceName}* object = static_cast<${v8InterfaceName}*>(parameter); - object->m_callback.clear(); - } - - ScopedPersistent<v8::Object> m_callback; - WorldContextHandle m_worldContext; -}; - -END - - push(@headerContent, "}\n\n"); - push(@headerContent, "#endif // $v8InterfaceName" . "_h\n\n"); - - my $conditionalString = $codeGenerator->GenerateConditionalString($interface); - push(@headerContent, "#endif // ${conditionalString}\n") if $conditionalString; -} - -sub GenerateCallbackImplementation -{ - my $object = shift; - my $interface = shift; - my $interfaceName = $interface->name; - my $v8InterfaceName = "V8$interfaceName"; - - # - Add default header template - push(@implContentHeader, GenerateImplementationContentHeader($interface)); - - AddToImplIncludes("ScriptExecutionContext.h"); - AddToImplIncludes("V8Binding.h"); - AddToImplIncludes("V8Callback.h"); - - push(@implContent, "#include <wtf/Assertions.h>\n\n"); - push(@implContent, "namespace WebCore {\n\n"); - push(@implContent, <<END); -${v8InterfaceName}::${v8InterfaceName}(v8::Handle<v8::Object> callback, ScriptExecutionContext* context, v8::Handle<v8::Object> owner) - : ActiveDOMCallback(context) - , m_callback(callback) - , m_worldContext(UseCurrentWorld) -{ - if (owner.IsEmpty()) - return; - owner->SetHiddenValue(V8HiddenPropertyName::callback(), callback); - m_callback.get().MakeWeak(this, &${v8InterfaceName}::weakCallback); -} - -${v8InterfaceName}::~${v8InterfaceName}() -{ -} - -END - - # Functions - my $numFunctions = @{$interface->functions}; - if ($numFunctions > 0) { - push(@implContent, "// Functions\n"); - foreach my $function (@{$interface->functions}) { - my @params = @{$function->parameters}; - if ($function->signature->extendedAttributes->{"Custom"} || - !(GetNativeTypeForCallbacks($function->signature->type) eq "bool")) { - next; - } - - AddIncludesForType($function->signature->type); - push(@implContent, "\n" . GetNativeTypeForCallbacks($function->signature->type) . " ${v8InterfaceName}::" . $function->signature->name . "("); - - my @args = (); - my @argsCheck = (); - my $thisType = $function->signature->extendedAttributes->{"PassThisToCallback"}; - foreach my $param (@params) { - my $paramName = $param->name; - AddIncludesForType($param->type); - push(@args, GetNativeTypeForCallbacks($param->type) . " " . $paramName); - if ($thisType and $thisType eq $param->type) { - push(@argsCheck, <<END); - ASSERT(${paramName}); - -END - } - } - push(@implContent, join(", ", @args)); - - push(@implContent, ")\n"); - push(@implContent, "{\n"); - push(@implContent, @argsCheck) if @argsCheck; - push(@implContent, " if (!canInvokeCallback())\n"); - push(@implContent, " return true;\n\n"); - push(@implContent, " v8::HandleScope handleScope;\n\n"); - push(@implContent, " v8::Handle<v8::Context> v8Context = toV8Context(scriptExecutionContext(), m_worldContext);\n"); - push(@implContent, " if (v8Context.IsEmpty())\n"); - push(@implContent, " return true;\n\n"); - push(@implContent, " v8::Context::Scope scope(v8Context);\n\n"); - - @args = (); - foreach my $param (@params) { - my $paramName = $param->name; - push(@implContent, " v8::Handle<v8::Value> ${paramName}Handle = " . NativeToJSValue($param, $paramName) . ";\n"); - push(@implContent, " if (${paramName}Handle.IsEmpty()) {\n"); - push(@implContent, " if (!isScriptControllerTerminating())\n"); - push(@implContent, " CRASH();\n"); - push(@implContent, " return true;\n"); - push(@implContent, " }\n"); - push(@args, " ${paramName}Handle"); - } - - if (scalar(@args) > 0) { - push(@implContent, "\n v8::Handle<v8::Value> argv[] = {\n"); - push(@implContent, join(",\n", @args)); - push(@implContent, "\n };\n\n"); - } else { - push(@implContent, "\n v8::Handle<v8::Value> *argv = 0;\n\n"); - } - push(@implContent, " bool callbackReturnValue = false;\n"); - if ($thisType) { - foreach my $param (@params) { - next if $param->type ne $thisType; - my $paramName = $param->name; - push(@implContent, " return !invokeCallback(m_callback.get(), v8::Handle<v8::Object>::Cast(${paramName}Handle), " . scalar(@params) . ", argv, callbackReturnValue, scriptExecutionContext());\n"); - last; - } - } else { - push(@implContent, " return !invokeCallback(m_callback.get(), " . scalar(@params) . ", argv, callbackReturnValue, scriptExecutionContext());\n"); - } - push(@implContent, "}\n"); - } - } - - push(@implContent, "\n} // namespace WebCore\n\n"); - - my $conditionalString = $codeGenerator->GenerateConditionalString($interface); - push(@implContent, "#endif // ${conditionalString}\n") if $conditionalString; -} - -sub BaseInterfaceName -{ - my $interface = shift; - - while (@{$interface->parents}) { - $interface = $codeGenerator->ParseInterface(@{$interface->parents}[0], 1); - } - - return $interface->name; -} - -sub GenerateToV8Converters -{ - my $interface = shift; - my $v8InterfaceName = shift; - my $nativeType = shift; - my $interfaceName = $interface->name; - - if ($interface->extendedAttributes->{"V8NoWrapperCache"} || $interface->extendedAttributes->{"SuppressToJSObject"}) { - return; - } - - my $createWrapperArgumentType = GetPassRefPtrType($nativeType); - my $baseType = BaseInterfaceName($interface); - - push(@implContent, <<END); - -v8::Handle<v8::Object> ${v8InterfaceName}::createWrapper(${createWrapperArgumentType} impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) -{ - ASSERT(impl.get()); - ASSERT(DOMDataStore::getWrapper(impl.get(), isolate).IsEmpty()); -END - if ($baseType ne $interfaceName) { - push(@implContent, <<END); - ASSERT(static_cast<void*>(static_cast<${baseType}*>(impl.get())) == static_cast<void*>(impl.get())); -END - } - - AddToImplIncludes("Frame.h"); - - if ($codeGenerator->IsSubType($interface, "Document")) { - push(@implContent, <<END); - if (Frame* frame = impl->frame()) { - if (frame->script()->initializeMainWorld()) { - // initializeMainWorld may have created a wrapper for the object, retry from the start. - v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapper(impl.get(), isolate); - if (!wrapper.IsEmpty()) - return wrapper; - } - } -END - } - - push(@implContent, <<END); - - v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &info, impl.get()); - if (UNLIKELY(wrapper.IsEmpty())) - return wrapper; - - installPerContextProperties(wrapper, impl.get()); - v8::Persistent<v8::Object> wrapperHandle = V8DOMWrapper::associateObjectWithWrapper(impl, &info, wrapper, isolate); - if (!hasDependentLifetime) - wrapperHandle.MarkIndependent(); - return wrapper; -} -END -} - -sub GetNativeTypeForConversions -{ - my $interface = shift; - my $interfaceName = $interface->name; - - $interfaceName = $codeGenerator->GetSVGTypeNeedingTearOff($interfaceName) if $codeGenerator->IsSVGTypeNeedingTearOff($interfaceName); - return $interfaceName;; -} - -sub GenerateFunctionCallString() -{ - my $function = shift; - my $numberOfParameters = shift; - my $indent = shift; - my $interfaceName = shift; - my %replacements = @_; - - my $name = $function->signature->name; - my $returnType = $function->signature->type; - my $nativeReturnType = GetNativeType($returnType, 0); - my $result = ""; - - my $isSVGTearOffType = ($codeGenerator->IsSVGTypeNeedingTearOff($returnType) and not $interfaceName =~ /List$/); - $nativeReturnType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($returnType) if $isSVGTearOffType; - - if ($function->signature->extendedAttributes->{"ImplementedAs"}) { - $name = $function->signature->extendedAttributes->{"ImplementedAs"}; - } - - my $index = 0; - - my @arguments; - my $functionName; - my $implementedBy = $function->signature->extendedAttributes->{"ImplementedBy"}; - if ($implementedBy) { - AddToImplIncludes("${implementedBy}.h"); - unshift(@arguments, "imp") if !$function->isStatic; - $functionName = "${implementedBy}::${name}"; - } elsif ($function->isStatic) { - $functionName = "${interfaceName}::${name}"; - } else { - $functionName = "imp->${name}"; - } - - my $callWith = $function->signature->extendedAttributes->{"CallWith"}; - my @callWithOutput = (); - my @callWithArgs = GenerateCallWith($callWith, \@callWithOutput, $indent, 0, $function); - $result .= join("", @callWithOutput); - unshift(@arguments, @callWithArgs); - $index += @callWithArgs; - $numberOfParameters += @callWithArgs; - - foreach my $parameter (@{$function->parameters}) { - if ($index eq $numberOfParameters) { - last; - } - my $paramName = $parameter->name; - my $paramType = $parameter->type; - - if ($replacements{$paramName}) { - push @arguments, $replacements{$paramName}; - } elsif ($parameter->type eq "IDBKey" || $parameter->type eq "NodeFilter" || $parameter->type eq "XPathNSResolver") { - push @arguments, "$paramName.get()"; - } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($parameter->type) and not $interfaceName =~ /List$/) { - push @arguments, "$paramName->propertyReference()"; - $result .= $indent . "if (!$paramName)\n"; - $result .= $indent . " return setDOMException(WebCore::TYPE_MISMATCH_ERR, args.GetIsolate());\n"; - } elsif ($parameter->type eq "SVGMatrix" and $interfaceName eq "SVGTransformList") { - push @arguments, "$paramName.get()"; - } else { - push @arguments, $paramName; - } - $index++; - } - - if (@{$function->raisesExceptions}) { - push @arguments, "ec"; - } - - my $functionString = "$functionName(" . join(", ", @arguments) . ")"; - - my $return = "result"; - my $returnIsRef = $codeGenerator->IsRefPtrType($returnType); - - if ($returnType eq "void") { - $result .= $indent . "$functionString;\n"; - } elsif ($codeGenerator->ExtendedAttributeContains($callWith, "ScriptState") or @{$function->raisesExceptions}) { - $result .= $indent . $nativeReturnType . " result = $functionString;\n"; - } else { - # Can inline the function call into the return statement to avoid overhead of using a Ref<> temporary - $return = $functionString; - $returnIsRef = 0; - - if ($interfaceName eq "SVGTransformList" and $codeGenerator->IsRefPtrType($returnType)) { - $return = "WTF::getPtr(" . $return . ")"; - } - } - - if (@{$function->raisesExceptions}) { - $result .= $indent . "if (UNLIKELY(ec))\n"; - $result .= $indent . " goto fail;\n"; - } - - if ($codeGenerator->ExtendedAttributeContains($callWith, "ScriptState")) { - $result .= $indent . "if (state.hadException()) {\n"; - $result .= $indent . " v8::Local<v8::Value> exception = state.exception();\n"; - $result .= $indent . " state.clearException();\n"; - $result .= $indent . " return throwError(exception, args.GetIsolate());\n"; - $result .= $indent . "}\n"; - } - - if ($isSVGTearOffType) { - AddToImplIncludes("V8$returnType.h"); - AddToImplIncludes("SVGPropertyTearOff.h"); - my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($returnType); - # FIXME: Update for all ScriptWrappables. - if (IsDOMNodeType($interfaceName)) { - $result .= $indent . "return toV8Fast(WTF::getPtr(${svgNativeType}::create($return)), args, imp);\n"; - } else { - $result .= $indent . "return toV8(WTF::getPtr(${svgNativeType}::create($return)), args.Holder(), args.GetIsolate());\n"; - } - return $result; - } - - # If the implementing class is a POD type, commit changes - if ($codeGenerator->IsSVGTypeNeedingTearOff($interfaceName) and not $interfaceName =~ /List$/) { - $result .= $indent . "wrapper->commitChange();\n"; - } - - $return .= ".release()" if ($returnIsRef); - - my $nativeValue; - # FIXME: Update for all ScriptWrappables. - if (IsDOMNodeType($interfaceName)) { - $nativeValue = NativeToJSValue($function->signature, $return, "args.Holder()", "args.GetIsolate()", "args", "imp"); - } else { - $nativeValue = NativeToJSValue($function->signature, $return, "args.Holder()", "args.GetIsolate()"); - } - - $result .= $indent . "return " . $nativeValue . ";\n"; - - return $result; -} - -sub GetNativeTypeFromSignature -{ - my $signature = shift; - my $parameterIndex = shift; - - my $type = $signature->type; - - if ($type eq "unsigned long" and $signature->extendedAttributes->{"IsIndex"}) { - # Special-case index arguments because we need to check that they aren't < 0. - return "int"; - } - - $type = GetNativeType($type, $parameterIndex >= 0 ? 1 : 0); - - if ($parameterIndex >= 0 && $type eq "V8StringResource") { - # FIXME: This implements [TreatNullAs=NullString] and [TreatUndefinedAs=NullString], - # but the Web IDL spec requires [TreatNullAs=EmptyString] and [TreatUndefinedAs=EmptyString]. - my $mode = ""; - if (($signature->extendedAttributes->{"TreatNullAs"} and $signature->extendedAttributes->{"TreatNullAs"} eq "NullString") and ($signature->extendedAttributes->{"TreatUndefinedAs"} and $signature->extendedAttributes->{"TreatUndefinedAs"} eq "NullString")) { - $mode = "WithUndefinedOrNullCheck"; - } elsif (($signature->extendedAttributes->{"TreatNullAs"} and $signature->extendedAttributes->{"TreatNullAs"} eq "NullString") or $signature->extendedAttributes->{"Reflect"}) { - $mode = "WithNullCheck"; - } - # FIXME: Add the case for 'elsif ($signature->extendedAttributes->{"TreatUndefinedAs"} and $signature->extendedAttributes->{"TreatUndefinedAs"} eq "NullString"))'. - $type .= "<$mode>"; - } - - return $type; -} - -sub GetNativeType -{ - my $type = shift; - my $isParameter = shift; - - my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($type); - if ($svgNativeType) { - if ($svgNativeType =~ /List$/) { - return "${svgNativeType}*"; - } else { - return "RefPtr<${svgNativeType} >"; - } - } - - return "float" if $type eq "float"; - return "double" if $type eq "double"; - return "int" if $type eq "long" or $type eq "int" or $type eq "short" or $type eq "unsigned short"; - return "unsigned" if $type eq "unsigned long" or $type eq "unsigned int"; - return "long long" if $type eq "long long"; - return "unsigned long long" if $type eq "unsigned long long"; - return "bool" if $type eq "boolean"; - - return "V8StringResource" if $type eq "DOMString" and $isParameter; - return "String" if $type eq "DOMString"; - - return "Range::CompareHow" if $type eq "CompareHow"; - return "DOMTimeStamp" if $type eq "DOMTimeStamp"; - return "double" if $type eq "Date"; - - # FIXME: When EventTarget is an interface and not a mixin, fix this so that - # EventTarget can be passed as a parameter. - return "Node*" if $type eq "EventTarget" and $isParameter; - - return "ScriptValue" if $type eq "DOMObject" or $type eq "any"; - return "Dictionary" if $type eq "Dictionary"; - - # FIXME: Consider replacing DOMStringList with DOMString[] or sequence<DOMString>. - return "RefPtr<DOMStringList>" if $type eq "DOMString[]" or $type eq "DOMStringList"; - - return "RefPtr<IDBKey>" if $type eq "IDBKey"; - return "RefPtr<MediaQueryListListener>" if $type eq "MediaQueryListListener"; - return "RefPtr<NodeFilter>" if $type eq "NodeFilter"; - return "RefPtr<SerializedScriptValue>" if $type eq "SerializedScriptValue"; - return "RefPtr<XPathNSResolver>" if $type eq "XPathNSResolver"; - return "RefPtr<${type}>" if $codeGenerator->IsRefPtrType($type) and not $isParameter; - - my $arrayType = $codeGenerator->GetArrayType($type); - my $sequenceType = $codeGenerator->GetSequenceType($type); - my $arrayOrSequenceType = $arrayType || $sequenceType; - - if ($arrayOrSequenceType) { - my $nativeType = GetNativeType($arrayOrSequenceType); - $nativeType .= " " if ($nativeType =~ />$/); - return "Vector<${nativeType}>"; - } - - # Default, assume native type is a pointer with same type name as idl type - return "${type}*"; -} - -sub GetNativeTypeForCallbacks -{ - my $type = shift; - return "const String&" if $type eq "DOMString"; - return "SerializedScriptValue*" if $type eq "SerializedScriptValue"; - - # Callbacks use raw pointers, so pass isParameter = 1 - return GetNativeType($type, 1); -} - -sub TranslateParameter -{ - my $signature = shift; - - # The IDL uses some pseudo-types which don't really exist. - if ($signature->type eq "TimeoutHandler") { - $signature->type("DOMString"); - } -} - -sub TypeCanFailConversion -{ - my $signature = shift; - my $type = $signature->type; - - AddToImplIncludes("ExceptionCode.h") if $type eq "Attr"; - return 1 if $type eq "Attr"; - return 0; -} - -sub JSValueToNative -{ - my $signature = shift; - my $value = shift; - my $getIsolate = shift; - - my $type = $signature->type; - - return "$value" if $type eq "JSObject"; - return "$value->BooleanValue()" if $type eq "boolean"; - return "static_cast<$type>($value->NumberValue())" if $type eq "float" or $type eq "double"; - - return "toInt32($value)" if $type eq "long" or $type eq "short"; - return "toUInt32($value)" if $type eq "unsigned long" or $type eq "unsigned short"; - return "toInt64($value)" if $type eq "unsigned long long" or $type eq "long long"; - return "static_cast<Range::CompareHow>($value->Int32Value())" if $type eq "CompareHow"; - return "toWebCoreDate($value)" if $type eq "Date"; - return "toDOMStringList($value, $getIsolate)" if $type eq "DOMStringList"; - # FIXME: Consider replacing DOMStringList with DOMString[] or sequence<DOMString>. - return "toDOMStringList($value, $getIsolate)" if $type eq "DOMString[]"; - - if ($type eq "DOMString") { - return $value; - } - - if ($type eq "SerializedScriptValue") { - AddToImplIncludes("SerializedScriptValue.h"); - return "SerializedScriptValue::create($value, $getIsolate)"; - } - - if ($type eq "IDBKey") { - AddToImplIncludes("IDBBindingUtilities.h"); - AddToImplIncludes("IDBKey.h"); - return "createIDBKeyFromValue($value)"; - } - - if ($type eq "Dictionary") { - AddToImplIncludes("Dictionary.h"); - return "Dictionary($value, $getIsolate)"; - } - - if ($type eq "DOMObject" or $type eq "any") { - AddToImplIncludes("ScriptValue.h"); - return "ScriptValue($value)"; - } - - if ($type eq "NodeFilter") { - return "toNodeFilter($value)"; - } - - if ($type eq "MediaQueryListListener") { - AddToImplIncludes("MediaQueryListListener.h"); - return "MediaQueryListListener::create(" . $value . ")"; - } - - # Default, assume autogenerated type conversion routines - # FIXME: When EventTarget is an interface and not a mixin, fix this to use - # V8EventTarget::HasInstance etc. - if ($type eq "EventTarget") { - AddToImplIncludes("V8Node.h"); - - # EventTarget is not in DOM hierarchy, but all Nodes are EventTarget. - return "V8Node::HasInstance($value) ? V8Node::toNative(v8::Handle<v8::Object>::Cast($value)) : 0"; - } - - if ($type eq "XPathNSResolver") { - return "toXPathNSResolver($value)"; - } - - my $arrayType = $codeGenerator->GetArrayType($type); - my $sequenceType = $codeGenerator->GetSequenceType($type); - my $arrayOrSequenceType = $arrayType || $sequenceType; - - if ($arrayOrSequenceType) { - if ($codeGenerator->IsRefPtrType($arrayOrSequenceType)) { - AddToImplIncludes("V8${arrayOrSequenceType}.h"); - return "(toRefPtrNativeArray<${arrayOrSequenceType}, V8${arrayOrSequenceType}>($value))"; - } - return "toNativeArray<" . GetNativeType($arrayOrSequenceType) . ">($value)"; - } - - AddIncludesForType($type); - - AddToImplIncludes("V8${type}.h"); - return "V8${type}::HasInstance($value) ? V8${type}::toNative(v8::Handle<v8::Object>::Cast($value)) : 0"; -} - -sub GetV8HeaderName -{ - my $type = shift; - return "V8Event.h" if $type eq "DOMTimeStamp"; - return "EventListener.h" if $type eq "EventListener"; - return "SerializedScriptValue.h" if $type eq "SerializedScriptValue"; - return "ScriptValue.h" if $type eq "DOMObject" or $type eq "any"; - return "V8DOMStringList.h" if $type eq "DOMString[]"; - return "V8${type}.h"; -} - -sub CreateCustomSignature -{ - my $function = shift; - my $count = @{$function->parameters}; - my $name = $function->signature->name; - my $result = " const int ${name}Argc = ${count};\n" . - " v8::Handle<v8::FunctionTemplate> ${name}Argv[${name}Argc] = { "; - my $first = 1; - foreach my $parameter (@{$function->parameters}) { - if ($first) { $first = 0; } - else { $result .= ", "; } - if (IsWrapperType($parameter->type)) { - if ($parameter->type eq "XPathNSResolver") { - # Special case for XPathNSResolver. All other browsers accepts a callable, - # so, even though it's against IDL, accept objects here. - $result .= "v8::Handle<v8::FunctionTemplate>()"; - } else { - my $type = $parameter->type; - - my $arrayType = $codeGenerator->GetArrayType($type); - my $sequenceType = $codeGenerator->GetSequenceType($type); - my $arrayOrSequenceType = $arrayType || $sequenceType; - - if ($arrayOrSequenceType) { - if ($arrayType eq "DOMString") { - AddToImplIncludes("V8DOMStringList.h"); - AddToImplIncludes("DOMStringList.h"); - - } elsif ($codeGenerator->IsRefPtrType($arrayOrSequenceType)) { - AddToImplIncludes(GetV8HeaderName($arrayOrSequenceType)); - AddToImplIncludes("${arrayOrSequenceType}.h"); - } else { - $result .= "v8::Handle<v8::FunctionTemplate>()"; - next; - } - } else { - AddToImplIncludes(GetV8HeaderName($type)); - } - $result .= "V8${type}::GetRawTemplate()"; - } - } else { - $result .= "v8::Handle<v8::FunctionTemplate>()"; - } - } - $result .= " };\n"; - $result .= " v8::Handle<v8::Signature> ${name}Signature = v8::Signature::New(desc, ${name}Argc, ${name}Argv);\n"; - return $result; -} - - -sub RequiresCustomSignature -{ - my $function = shift; - # No signature needed for Custom function - if ($function->signature->extendedAttributes->{"Custom"} || - $function->signature->extendedAttributes->{"V8Custom"}) { - return 0; - } - # No signature needed for overloaded function - if (@{$function->{overloads}} > 1) { - return 0; - } - if ($function->isStatic) { - return 0; - } - # Type checking is performed in the generated code - if ($function->signature->extendedAttributes->{"StrictTypeChecking"}) { - return 0; - } - foreach my $parameter (@{$function->parameters}) { - my $optional = $parameter->extendedAttributes->{"Optional"}; - if (($optional && $optional ne "DefaultIsUndefined" && $optional ne "DefaultIsNullString") || $parameter->extendedAttributes->{"Callback"}) { - return 0; - } - } - - foreach my $parameter (@{$function->parameters}) { - if (IsWrapperType($parameter->type)) { - return 1; - } - } - return 0; -} - - -my %non_wrapper_types = ( - 'CompareHow' => 1, - 'DOMObject' => 1, - 'DOMString' => 1, - 'DOMString[]' => 1, - 'DOMTimeStamp' => 1, - 'Date' => 1, - 'Dictionary' => 1, - 'EventListener' => 1, - # FIXME: When EventTarget is an interface and not a mixin, fix this so that - # EventTarget is treated as a wrapper type. - 'EventTarget' => 1, - 'IDBKey' => 1, - 'JSObject' => 1, - 'MediaQueryListListener' => 1, - 'NodeFilter' => 1, - 'SerializedScriptValue' => 1, - 'any' => 1, - 'boolean' => 1, - 'double' => 1, - 'float' => 1, - 'int' => 1, - 'long long' => 1, - 'long' => 1, - 'short' => 1, - 'unsigned int' => 1, - 'unsigned long long' => 1, - 'unsigned long' => 1, - 'unsigned short' => 1 -); - - -sub IsWrapperType -{ - my $type = shift; - return !($non_wrapper_types{$type}); -} - -sub GetTypeNameOfExternalTypedArray -{ - my $interface = shift; - my $interfaceName = $interface->name; - my $viewType = $interface->extendedAttributes->{"TypedArray"}; - return "v8::kExternalByteArray" if $viewType eq "signed char" and $interfaceName eq "Int8Array"; - return "v8::kExternalPixelArray" if $viewType eq "unsigned char" and $interfaceName eq "Uint8ClampedArray"; - return "v8::kExternalUnsignedByteArray" if $viewType eq "unsigned char" and $interfaceName eq "Uint8Array"; - return "v8::kExternalShortArray" if $viewType eq "short" and $interfaceName eq "Int16Array"; - return "v8::kExternalUnsignedShortArray" if $viewType eq "unsigned short" and $interfaceName eq "Uint16Array"; - return "v8::kExternalIntArray" if $viewType eq "int" and $interfaceName eq "Int32Array"; - return "v8::kExternalUnsignedIntArray" if $viewType eq "unsigned int" and $interfaceName eq "Uint32Array"; - return "v8::kExternalFloatArray" if $viewType eq "float" and $interfaceName eq "Float32Array"; - return "v8::kExternalDoubleArray" if $viewType eq "double" and $interfaceName eq "Float64Array"; - - die "TypedArray of unknown type is found"; -} - -sub IsDOMNodeType -{ - my $type = shift; - - return 1 if $type eq 'Attr'; - return 1 if $type eq 'CDATASection'; - return 1 if $type eq 'CharacterData'; - return 1 if $type eq 'Comment'; - return 1 if $type eq 'Document'; - return 1 if $type eq 'DocumentFragment'; - return 1 if $type eq 'DocumentType'; - return 1 if $type eq 'Element'; - return 1 if $type eq 'Entity'; - return 1 if $type eq 'EntityReference'; - return 1 if $type eq 'HTMLDocument'; - return 1 if $type eq 'Node'; - return 1 if $type eq 'Notation'; - return 1 if $type eq 'ProcessingInstruction'; - return 1 if $type eq 'ShadowRoot'; - return 1 if $type eq 'SVGDocument'; - return 1 if $type eq 'Text'; - - return 1 if $type =~ /^HTML.*Element$/; - return 1 if $type =~ /^SVG.*Element$/; - - return 1 if $type eq 'TestNode'; - - return 0; -} - - -sub NativeToJSValue -{ - my $signature = shift; - my $value = shift; - my $getCreationContext = shift; - my $getCreationContextArg = $getCreationContext ? ", $getCreationContext" : ""; - my $getIsolate = shift; - my $getIsolateArg = $getIsolate ? ", $getIsolate" : ""; - my $getHolderContainer = shift; - my $getHolderContainerArg = $getHolderContainer ? ", $getHolderContainer" : ""; - my $getScriptWrappable = shift; - my $getScriptWrappableArg = $getScriptWrappable ? ", $getScriptWrappable" : ""; - my $type = $signature->type; - - return ($getIsolate ? "v8Boolean($value, $getIsolate)" : "v8Boolean($value)") if $type eq "boolean"; - return "v8Undefined()" if $type eq "void"; # equivalent to v8Undefined() - - # HTML5 says that unsigned reflected attributes should be in the range - # [0, 2^31). When a value isn't in this range, a default value (or 0) - # should be returned instead. - if ($signature->extendedAttributes->{"Reflect"} and ($type eq "unsigned long" or $type eq "unsigned short")) { - $value =~ s/getUnsignedIntegralAttribute/getIntegralAttribute/g; - return "v8UnsignedInteger(std::max(0, " . $value . ")$getIsolateArg)"; - } - - # For all the types where we use 'int' as the representation type, - # we use v8Integer() which has a fast small integer conversion check. - my $nativeType = GetNativeType($type); - return "v8Integer($value$getIsolateArg)" if $nativeType eq "int"; - return "v8UnsignedInteger($value$getIsolateArg)" if $nativeType eq "unsigned"; - - return "v8DateOrNull($value$getIsolateArg)" if $type eq "Date"; - # long long and unsigned long long are not representable in ECMAScript. - return "v8::Number::New(static_cast<double>($value))" if $type eq "long long" or $type eq "unsigned long long" or $type eq "DOMTimeStamp"; - return "v8::Number::New($value)" if $codeGenerator->IsPrimitiveType($type); - return "$value.v8Value()" if $nativeType eq "ScriptValue"; - - if ($codeGenerator->IsStringType($type)) { - my $conv = $signature->extendedAttributes->{"TreatReturnedNullStringAs"}; - if (defined $conv) { - return "v8StringOrNull($value$getIsolateArg)" if $conv eq "Null"; - return "v8StringOrUndefined($value$getIsolateArg)" if $conv eq "Undefined"; - - die "Unknown value for TreatReturnedNullStringAs extended attribute"; - } - return $getIsolate ? "v8String($value, $getIsolate)" : "deprecatedV8String($value)"; - } - - my $arrayType = $codeGenerator->GetArrayType($type); - my $sequenceType = $codeGenerator->GetSequenceType($type); - my $arrayOrSequenceType = $arrayType || $sequenceType; - - if ($arrayOrSequenceType) { - if ($arrayType eq "DOMString") { - AddToImplIncludes("V8DOMStringList.h"); - AddToImplIncludes("DOMStringList.h"); - - } elsif ($codeGenerator->IsRefPtrType($arrayOrSequenceType)) { - AddToImplIncludes(GetV8HeaderName($arrayOrSequenceType)); - AddToImplIncludes("${arrayOrSequenceType}.h"); - } - return "v8Array(${value}${getIsolateArg})"; - } - - AddIncludesForType($type); - - if (IsDOMNodeType($type) || $type eq "EventTarget") { - if ($getScriptWrappable) { - return "toV8Fast($value$getHolderContainerArg$getScriptWrappableArg)"; - } - return "toV8($value$getCreationContextArg$getIsolateArg)"; - } - - if ($type eq "EventListener") { - AddToImplIncludes("V8AbstractEventListener.h"); - return "${value} ? v8::Handle<v8::Value>(static_cast<V8AbstractEventListener*>(${value})->getListenerObject(imp->scriptExecutionContext())) : v8::Handle<v8::Value>(" . ($getIsolate ? "v8Null($getIsolate)" : "v8::Null()") . ")"; - } - - if ($type eq "SerializedScriptValue") { - AddToImplIncludes("$type.h"); - return "$value ? $value->deserialize() : v8::Handle<v8::Value>(" . ($getIsolate ? "v8Null($getIsolate)" : "v8::Null()") . ")"; - } - - AddToImplIncludes("wtf/RefCounted.h"); - AddToImplIncludes("wtf/RefPtr.h"); - AddToImplIncludes("wtf/GetPtr.h"); - - if ($getScriptWrappable) { - return "toV8Fast($value$getHolderContainerArg$getScriptWrappableArg)"; - } - return "toV8($value$getCreationContextArg$getIsolateArg)"; -} - -sub WriteData -{ - my $object = shift; - my $interface = shift; - my $outputDir = shift; - my $outputHeadersDir = shift; - - my $name = $interface->name; - my $prefix = FileNamePrefix; - my $headerFileName = "$outputHeadersDir/$prefix$name.h"; - my $implFileName = "$outputDir/$prefix$name.cpp"; - - # Update a .cpp file if the contents are changed. - my $contents = join "", @implContentHeader; - - my @includes = (); - my %implIncludeConditions = (); - foreach my $include (keys %implIncludes) { - my $condition = $implIncludes{$include}; - my $checkType = $include; - $checkType =~ s/\.h//; - next if $codeGenerator->IsSVGAnimatedType($checkType); - - if ($include =~ /wtf/) { - $include = "\<$include\>"; - } else { - $include = "\"$include\""; - } - - if ($condition eq 1) { - push @includes, $include; - } else { - push @{$implIncludeConditions{$condition}}, $include; - } - } - foreach my $include (sort @includes) { - $contents .= "#include $include\n"; - } - foreach my $condition (sort keys %implIncludeConditions) { - $contents .= "\n#if " . $codeGenerator->GenerateConditionalStringFromAttributeValue($condition) . "\n"; - foreach my $include (sort @{$implIncludeConditions{$condition}}) { - $contents .= "#include $include\n"; - } - $contents .= "#endif\n"; - } - - $contents .= "\n"; - $contents .= join "", @implContentDecls, @implContent; - $codeGenerator->UpdateFile($implFileName, $contents); - - %implIncludes = (); - @implContentHeader = (); - @implContentDecls = (); - @implContent = (); - - # Update a .h file if the contents are changed. - $contents = join "", @headerContent; - $codeGenerator->UpdateFile($headerFileName, $contents); - - @headerContent = (); -} - -sub ConvertToV8StringResource -{ - my $signature = shift; - my $nativeType = shift; - my $variableName = shift; - my $value = shift; - my $suffix = shift; - - die "Wrong native type passed: $nativeType" unless $nativeType =~ /^V8StringResource/; - if ($signature->type eq "DOMString") { - my $macro = "V8TRYCATCH_FOR_V8STRINGRESOURCE"; - $macro .= "_$suffix" if $suffix; - return "$macro($nativeType, $variableName, $value);" - } else { - return "$nativeType $variableName($value, true);"; - } -} - -# Returns the RuntimeEnabledFeatures function name that is hooked up to check if a method/attribute is enabled. -sub GetRuntimeEnableFunctionName -{ - my $signature = shift; - - # If a parameter is given (e.g. "V8EnabledAtRuntime=FeatureName") return the RuntimeEnabledFeatures::{FeatureName}Enabled() method. - return "RuntimeEnabledFeatures::" . $codeGenerator->WK_lcfirst($signature->extendedAttributes->{"V8EnabledAtRuntime"}) . "Enabled" if ($signature->extendedAttributes->{"V8EnabledAtRuntime"} && $signature->extendedAttributes->{"V8EnabledAtRuntime"} ne "VALUE_IS_MISSING"); - - # Otherwise return a function named RuntimeEnabledFeatures::{methodName}Enabled(). - return "RuntimeEnabledFeatures::" . $codeGenerator->WK_lcfirst($signature->name) . "Enabled"; -} - -sub GetContextEnableFunction -{ - my $signature = shift; - - # If a parameter is given (e.g. "V8EnabledPerContext=FeatureName") return the {FeatureName}Allowed() method. - if ($signature->extendedAttributes->{"V8EnabledPerContext"} && $signature->extendedAttributes->{"V8EnabledPerContext"} ne "VALUE_IS_MISSING") { - return "ContextFeatures::" . $codeGenerator->WK_lcfirst($signature->extendedAttributes->{"V8EnabledPerContext"}) . "Enabled"; - } - - # Or it fallbacks to the attribute name if the parameter value is missing. - return "ContextFeatures::" . $codeGenerator->WK_lcfirst($signature->name) . "Enabled"; -} - -sub GetPassRefPtrType -{ - my $v8InterfaceName = shift; - - my $angleBracketSpace = $v8InterfaceName =~ />$/ ? " " : ""; - return "PassRefPtr<${v8InterfaceName}${angleBracketSpace}>"; -} - -1; diff --git a/contrib/dom/scripts/deps.txt b/contrib/dom/scripts/deps.txt deleted file mode 100644 index f7db419..0000000 --- a/contrib/dom/scripts/deps.txt +++ /dev/null @@ -1,636 +0,0 @@ -../../bindings/scripts/test/TestCallback.idl -../../bindings/scripts/test/TestCustomNamedGetter.idl -../../bindings/scripts/test/TestDomainSecurity.idl -../../bindings/scripts/test/TestEventConstructor.idl -../../bindings/scripts/test/TestEventTarget.idl -../../bindings/scripts/test/TestException.idl -../../bindings/scripts/test/TestInterface.idl -../../bindings/scripts/test/TestMediaQueryListListener.idl -../../bindings/scripts/test/TestNamedConstructor.idl -../../bindings/scripts/test/TestNode.idl -../../bindings/scripts/test/TestObj.idl -../../bindings/scripts/test/TestOverloadedConstructors.idl -../../bindings/scripts/test/TestSerializedScriptValueInterface.idl -../../bindings/scripts/test/TestSupplemental.idl -../../bindings/scripts/test/TestTypedArray.idl -../../css/Counter.idl -../../css/CSSCharsetRule.idl -../../css/CSSFontFaceRule.idl -../../css/CSSImportRule.idl -../../css/CSSMediaRule.idl -../../css/CSSPageRule.idl -../../css/CSSPrimitiveValue.idl -../../css/CSSRule.idl -../../css/CSSRuleList.idl -../../css/CSSStyleDeclaration.idl -../../css/CSSStyleRule.idl -../../css/CSSStyleSheet.idl -../../css/CSSUnknownRule.idl -../../css/CSSValue.idl -../../css/CSSValueList.idl -../../css/MediaList.idl -../../css/MediaQueryList.idl -../../css/MediaQueryListListener.idl -../../css/Rect.idl -../../css/RGBColor.idl -../../css/StyleMedia.idl -../../css/StyleSheet.idl -../../css/StyleSheetList.idl -../../css/WebKitCSSFilterValue.idl -../../css/WebKitCSSKeyframeRule.idl -../../css/WebKitCSSKeyframesRule.idl -../../css/WebKitCSSMatrix.idl -../../css/WebKitCSSMixFunctionValue.idl -../../css/WebKitCSSRegionRule.idl -../../css/WebKitCSSTransformValue.idl -../../css/WebKitCSSViewportRule.idl -../../dom/Attr.idl -../../dom/BeforeLoadEvent.idl -../../dom/CDATASection.idl -../../dom/CharacterData.idl -../../dom/ClientRect.idl -../../dom/ClientRectList.idl -../../dom/Clipboard.idl -../../dom/Comment.idl -../../dom/CompositionEvent.idl -../../dom/CustomEvent.idl -../../dom/DataTransferItem.idl -../../dom/DataTransferItemList.idl -../../dom/DeviceMotionEvent.idl -../../dom/DeviceOrientationEvent.idl -../../dom/Document.idl -../../dom/DocumentFragment.idl -../../dom/DocumentType.idl -../../dom/DOMCoreException.idl -../../dom/DOMError.idl -../../dom/DOMImplementation.idl -../../dom/DOMNamedFlowCollection.idl -../../dom/DOMStringList.idl -../../dom/DOMStringMap.idl -../../dom/Element.idl -../../dom/Entity.idl -../../dom/EntityReference.idl -../../dom/ErrorEvent.idl -../../dom/Event.idl -../../dom/EventException.idl -../../dom/EventListener.idl -../../dom/EventTarget.idl -../../dom/HashChangeEvent.idl -../../dom/KeyboardEvent.idl -../../dom/MessageChannel.idl -../../dom/MessageEvent.idl -../../dom/MessagePort.idl -../../dom/MouseEvent.idl -../../dom/MutationCallback.idl -../../dom/MutationEvent.idl -../../dom/MutationObserver.idl -../../dom/MutationRecord.idl -../../dom/NamedNodeMap.idl -../../dom/Node.idl -../../dom/NodeFilter.idl -../../dom/NodeIterator.idl -../../dom/NodeList.idl -../../dom/Notation.idl -../../dom/OverflowEvent.idl -../../dom/PageTransitionEvent.idl -../../dom/PopStateEvent.idl -../../dom/ProcessingInstruction.idl -../../dom/ProgressEvent.idl -../../dom/PropertyNodeList.idl -../../dom/Range.idl -../../dom/RangeException.idl -../../dom/RequestAnimationFrameCallback.idl -../../dom/ShadowRoot.idl -../../dom/StringCallback.idl -../../dom/Text.idl -../../dom/TextEvent.idl -../../dom/Touch.idl -../../dom/TouchEvent.idl -../../dom/TouchList.idl -../../dom/TreeWalker.idl -../../dom/UIEvent.idl -../../dom/WebKitAnimationEvent.idl -../../dom/WebKitNamedFlow.idl -../../dom/WebKitTransitionEvent.idl -../../dom/WheelEvent.idl -../../fileapi/Blob.idl -../../fileapi/File.idl -../../fileapi/FileError.idl -../../fileapi/FileException.idl -../../fileapi/FileList.idl -../../fileapi/FileReader.idl -../../fileapi/FileReaderSync.idl -../../html/canvas/ArrayBuffer.idl -../../html/canvas/ArrayBufferView.idl -../../html/canvas/CanvasGradient.idl -../../html/canvas/CanvasPattern.idl -../../html/canvas/CanvasRenderingContext.idl -../../html/canvas/CanvasRenderingContext2D.idl -../../html/canvas/DataView.idl -../../html/canvas/EXTTextureFilterAnisotropic.idl -../../html/canvas/Float32Array.idl -../../html/canvas/Float64Array.idl -../../html/canvas/Int16Array.idl -../../html/canvas/Int32Array.idl -../../html/canvas/Int8Array.idl -../../html/canvas/OESElementIndexUint.idl -../../html/canvas/OESStandardDerivatives.idl -../../html/canvas/OESTextureFloat.idl -../../html/canvas/OESVertexArrayObject.idl -../../html/canvas/Uint16Array.idl -../../html/canvas/Uint32Array.idl -../../html/canvas/Uint8Array.idl -../../html/canvas/Uint8ClampedArray.idl -../../html/canvas/WebGLActiveInfo.idl -../../html/canvas/WebGLBuffer.idl -../../html/canvas/WebGLCompressedTextureS3TC.idl -../../html/canvas/WebGLContextAttributes.idl -../../html/canvas/WebGLContextEvent.idl -../../html/canvas/WebGLDebugRendererInfo.idl -../../html/canvas/WebGLDebugShaders.idl -../../html/canvas/WebGLDepthTexture.idl -../../html/canvas/WebGLFramebuffer.idl -../../html/canvas/WebGLLoseContext.idl -../../html/canvas/WebGLProgram.idl -../../html/canvas/WebGLRenderbuffer.idl -../../html/canvas/WebGLRenderingContext.idl -../../html/canvas/WebGLShader.idl -../../html/canvas/WebGLShaderPrecisionFormat.idl -../../html/canvas/WebGLTexture.idl -../../html/canvas/WebGLUniformLocation.idl -../../html/canvas/WebGLVertexArrayObjectOES.idl -../../html/DOMFormData.idl -../../html/DOMSettableTokenList.idl -../../html/DOMTokenList.idl -../../html/DOMURL.idl -../../html/HTMLAllCollection.idl -../../html/HTMLAnchorElement.idl -../../html/HTMLAppletElement.idl -../../html/HTMLAreaElement.idl -../../html/HTMLAudioElement.idl -../../html/HTMLBaseElement.idl -../../html/HTMLBaseFontElement.idl -../../html/HTMLBodyElement.idl -../../html/HTMLBRElement.idl -../../html/HTMLButtonElement.idl -../../html/HTMLCanvasElement.idl -../../html/HTMLCollection.idl -../../html/HTMLDataListElement.idl -../../html/HTMLDetailsElement.idl -../../html/HTMLDialogElement.idl -../../html/HTMLDirectoryElement.idl -../../html/HTMLDivElement.idl -../../html/HTMLDListElement.idl -../../html/HTMLDocument.idl -../../html/HTMLElement.idl -../../html/HTMLEmbedElement.idl -../../html/HTMLFieldSetElement.idl -../../html/HTMLFontElement.idl -../../html/HTMLFormControlsCollection.idl -../../html/HTMLFormElement.idl -../../html/HTMLFrameElement.idl -../../html/HTMLFrameSetElement.idl -../../html/HTMLHeadElement.idl -../../html/HTMLHeadingElement.idl -../../html/HTMLHRElement.idl -../../html/HTMLHtmlElement.idl -../../html/HTMLIFrameElement.idl -../../html/HTMLImageElement.idl -../../html/HTMLInputElement.idl -../../html/HTMLIntentElement.idl -../../html/HTMLKeygenElement.idl -../../html/HTMLLabelElement.idl -../../html/HTMLLegendElement.idl -../../html/HTMLLIElement.idl -../../html/HTMLLinkElement.idl -../../html/HTMLMapElement.idl -../../html/HTMLMarqueeElement.idl -../../html/HTMLMediaElement.idl -../../html/HTMLMenuElement.idl -../../html/HTMLMetaElement.idl -../../html/HTMLMeterElement.idl -../../html/HTMLModElement.idl -../../html/HTMLObjectElement.idl -../../html/HTMLOListElement.idl -../../html/HTMLOptGroupElement.idl -../../html/HTMLOptionElement.idl -../../html/HTMLOptionsCollection.idl -../../html/HTMLOutputElement.idl -../../html/HTMLParagraphElement.idl -../../html/HTMLParamElement.idl -../../html/HTMLPreElement.idl -../../html/HTMLProgressElement.idl -../../html/HTMLPropertiesCollection.idl -../../html/HTMLQuoteElement.idl -../../html/HTMLScriptElement.idl -../../html/HTMLSelectElement.idl -../../html/HTMLSourceElement.idl -../../html/HTMLSpanElement.idl -../../html/HTMLStyleElement.idl -../../html/HTMLTableCaptionElement.idl -../../html/HTMLTableCellElement.idl -../../html/HTMLTableColElement.idl -../../html/HTMLTableElement.idl -../../html/HTMLTableRowElement.idl -../../html/HTMLTableSectionElement.idl -../../html/HTMLTemplateElement.idl -../../html/HTMLTextAreaElement.idl -../../html/HTMLTitleElement.idl -../../html/HTMLTrackElement.idl -../../html/HTMLUListElement.idl -../../html/HTMLUnknownElement.idl -../../html/HTMLVideoElement.idl -../../html/ImageData.idl -../../html/MediaController.idl -../../html/MediaError.idl -../../html/MediaKeyError.idl -../../html/MediaKeyEvent.idl -../../html/MicroDataItemValue.idl -../../html/RadioNodeList.idl -../../html/shadow/HTMLContentElement.idl -../../html/shadow/HTMLShadowElement.idl -../../html/TextMetrics.idl -../../html/TimeRanges.idl -../../html/track/TextTrack.idl -../../html/track/TextTrackCue.idl -../../html/track/TextTrackCueList.idl -../../html/track/TextTrackList.idl -../../html/track/TrackEvent.idl -../../html/ValidityState.idl -../../html/VoidCallback.idl -../../inspector/InjectedScriptHost.idl -../../inspector/InspectorFrontendHost.idl -../../inspector/JavaScriptCallFrame.idl -../../inspector/ScriptProfile.idl -../../inspector/ScriptProfileNode.idl -../../loader/appcache/DOMApplicationCache.idl -../../Modules/battery/BatteryManager.idl -../../Modules/battery/NavigatorBattery.idl -../../Modules/filesystem/DataTransferItemFileSystem.idl -../../Modules/filesystem/DirectoryEntry.idl -../../Modules/filesystem/DirectoryEntrySync.idl -../../Modules/filesystem/DirectoryReader.idl -../../Modules/filesystem/DirectoryReaderSync.idl -../../Modules/filesystem/DOMFileSystem.idl -../../Modules/filesystem/DOMFileSystemSync.idl -../../Modules/filesystem/DOMWindowFileSystem.idl -../../Modules/filesystem/EntriesCallback.idl -../../Modules/filesystem/Entry.idl -../../Modules/filesystem/EntryArray.idl -../../Modules/filesystem/EntryArraySync.idl -../../Modules/filesystem/EntryCallback.idl -../../Modules/filesystem/EntrySync.idl -../../Modules/filesystem/ErrorCallback.idl -../../Modules/filesystem/FileCallback.idl -../../Modules/filesystem/FileEntry.idl -../../Modules/filesystem/FileEntrySync.idl -../../Modules/filesystem/FileSystemCallback.idl -../../Modules/filesystem/FileWriter.idl -../../Modules/filesystem/FileWriterCallback.idl -../../Modules/filesystem/FileWriterSync.idl -../../Modules/filesystem/HTMLInputElementFileSystem.idl -../../Modules/filesystem/Metadata.idl -../../Modules/filesystem/MetadataCallback.idl -../../Modules/filesystem/WorkerContextFileSystem.idl -../../Modules/gamepad/Gamepad.idl -../../Modules/gamepad/GamepadList.idl -../../Modules/gamepad/NavigatorGamepad.idl -../../Modules/geolocation/Geolocation.idl -../../Modules/geolocation/Geoposition.idl -../../Modules/geolocation/NavigatorGeolocation.idl -../../Modules/geolocation/PositionCallback.idl -../../Modules/geolocation/PositionError.idl -../../Modules/geolocation/PositionErrorCallback.idl -../../Modules/indexeddb/DOMWindowIndexedDatabase.idl -../../Modules/indexeddb/IDBAny.idl -../../Modules/indexeddb/IDBCursor.idl -../../Modules/indexeddb/IDBCursorWithValue.idl -../../Modules/indexeddb/IDBDatabase.idl -../../Modules/indexeddb/IDBFactory.idl -../../Modules/indexeddb/IDBIndex.idl -../../Modules/indexeddb/IDBKey.idl -../../Modules/indexeddb/IDBKeyRange.idl -../../Modules/indexeddb/IDBObjectStore.idl -../../Modules/indexeddb/IDBOpenDBRequest.idl -../../Modules/indexeddb/IDBRequest.idl -../../Modules/indexeddb/IDBTransaction.idl -../../Modules/indexeddb/IDBUpgradeNeededEvent.idl -../../Modules/indexeddb/IDBVersionChangeEvent.idl -../../Modules/indexeddb/IDBVersionChangeRequest.idl -../../Modules/indexeddb/WorkerContextIndexedDatabase.idl -../../Modules/intents/DeliveredIntent.idl -../../Modules/intents/DOMWindowIntents.idl -../../Modules/intents/Intent.idl -../../Modules/intents/IntentResultCallback.idl -../../Modules/intents/NavigatorIntents.idl -../../Modules/mediasource/MediaSource.idl -../../Modules/mediasource/SourceBuffer.idl -../../Modules/mediasource/SourceBufferList.idl -../../Modules/mediastream/DOMWindowMediaStream.idl -../../Modules/mediastream/LocalMediaStream.idl -../../Modules/mediastream/MediaStream.idl -../../Modules/mediastream/MediaStreamEvent.idl -../../Modules/mediastream/MediaStreamList.idl -../../Modules/mediastream/MediaStreamTrack.idl -../../Modules/mediastream/MediaStreamTrackEvent.idl -../../Modules/mediastream/MediaStreamTrackList.idl -../../Modules/mediastream/NavigatorMediaStream.idl -../../Modules/mediastream/NavigatorUserMediaError.idl -../../Modules/mediastream/NavigatorUserMediaErrorCallback.idl -../../Modules/mediastream/NavigatorUserMediaSuccessCallback.idl -../../Modules/mediastream/RTCDataChannel.idl -../../Modules/mediastream/RTCDataChannelEvent.idl -../../Modules/mediastream/RTCErrorCallback.idl -../../Modules/mediastream/RTCIceCandidate.idl -../../Modules/mediastream/RTCIceCandidateEvent.idl -../../Modules/mediastream/RTCPeerConnection.idl -../../Modules/mediastream/RTCSessionDescription.idl -../../Modules/mediastream/RTCSessionDescriptionCallback.idl -../../Modules/mediastream/RTCStatsCallback.idl -../../Modules/mediastream/RTCStatsElement.idl -../../Modules/mediastream/RTCStatsReport.idl -../../Modules/mediastream/RTCStatsResponse.idl -../../Modules/navigatorcontentutils/NavigatorContentUtils.idl -../../Modules/networkinfo/NavigatorNetworkInfoConnection.idl -../../Modules/networkinfo/NetworkInfoConnection.idl -../../Modules/notifications/DOMWindowNotifications.idl -../../Modules/notifications/Notification.idl -../../Modules/notifications/NotificationCenter.idl -../../Modules/notifications/NotificationPermissionCallback.idl -../../Modules/notifications/WorkerContextNotifications.idl -../../Modules/proximity/DeviceProximityEvent.idl -../../Modules/quota/DOMWindowQuota.idl -../../Modules/quota/StorageInfo.idl -../../Modules/quota/StorageInfoErrorCallback.idl -../../Modules/quota/StorageInfoQuotaCallback.idl -../../Modules/quota/StorageInfoUsageCallback.idl -../../Modules/speech/DOMWindowSpeech.idl -../../Modules/speech/SpeechGrammar.idl -../../Modules/speech/SpeechGrammarList.idl -../../Modules/speech/SpeechRecognition.idl -../../Modules/speech/SpeechRecognitionAlternative.idl -../../Modules/speech/SpeechRecognitionError.idl -../../Modules/speech/SpeechRecognitionEvent.idl -../../Modules/speech/SpeechRecognitionResult.idl -../../Modules/speech/SpeechRecognitionResultList.idl -../../Modules/vibration/NavigatorVibration.idl -../../Modules/webaudio/AnalyserNode.idl -../../Modules/webaudio/AudioBuffer.idl -../../Modules/webaudio/AudioBufferCallback.idl -../../Modules/webaudio/AudioBufferSourceNode.idl -../../Modules/webaudio/AudioContext.idl -../../Modules/webaudio/AudioDestinationNode.idl -../../Modules/webaudio/AudioGain.idl -../../Modules/webaudio/AudioListener.idl -../../Modules/webaudio/AudioNode.idl -../../Modules/webaudio/AudioParam.idl -../../Modules/webaudio/AudioProcessingEvent.idl -../../Modules/webaudio/AudioSourceNode.idl -../../Modules/webaudio/BiquadFilterNode.idl -../../Modules/webaudio/ChannelMergerNode.idl -../../Modules/webaudio/ChannelSplitterNode.idl -../../Modules/webaudio/ConvolverNode.idl -../../Modules/webaudio/DelayNode.idl -../../Modules/webaudio/DOMWindowWebAudio.idl -../../Modules/webaudio/DynamicsCompressorNode.idl -../../Modules/webaudio/GainNode.idl -../../Modules/webaudio/MediaElementAudioSourceNode.idl -../../Modules/webaudio/MediaStreamAudioDestinationNode.idl -../../Modules/webaudio/MediaStreamAudioSourceNode.idl -../../Modules/webaudio/OfflineAudioCompletionEvent.idl -../../Modules/webaudio/OfflineAudioContext.idl -../../Modules/webaudio/OscillatorNode.idl -../../Modules/webaudio/PannerNode.idl -../../Modules/webaudio/ScriptProcessorNode.idl -../../Modules/webaudio/WaveShaperNode.idl -../../Modules/webaudio/WaveTable.idl -../../Modules/webdatabase/Database.idl -../../Modules/webdatabase/DatabaseCallback.idl -../../Modules/webdatabase/DatabaseSync.idl -../../Modules/webdatabase/DOMWindowWebDatabase.idl -../../Modules/webdatabase/SQLError.idl -../../Modules/webdatabase/SQLException.idl -../../Modules/webdatabase/SQLResultSet.idl -../../Modules/webdatabase/SQLResultSetRowList.idl -../../Modules/webdatabase/SQLStatementCallback.idl -../../Modules/webdatabase/SQLStatementErrorCallback.idl -../../Modules/webdatabase/SQLTransaction.idl -../../Modules/webdatabase/SQLTransactionCallback.idl -../../Modules/webdatabase/SQLTransactionErrorCallback.idl -../../Modules/webdatabase/SQLTransactionSync.idl -../../Modules/webdatabase/SQLTransactionSyncCallback.idl -../../Modules/webdatabase/WorkerContextWebDatabase.idl -../../Modules/websockets/CloseEvent.idl -../../Modules/websockets/DOMWindowWebSocket.idl -../../Modules/websockets/WebSocket.idl -../../Modules/websockets/WorkerContextWebSocket.idl -../../page/AbstractView.idl -../../page/BarInfo.idl -../../page/Console.idl -../../page/Coordinates.idl -../../page/Crypto.idl -../../page/DOMSecurityPolicy.idl -../../page/DOMSelection.idl -../../page/DOMWindow.idl -../../page/DOMWindowPagePopup.idl -../../page/EventSource.idl -../../page/History.idl -../../page/Location.idl -../../page/MemoryInfo.idl -../../page/Navigator.idl -../../page/PagePopupController.idl -../../page/Performance.idl -../../page/PerformanceEntry.idl -../../page/PerformanceEntryList.idl -../../page/PerformanceMark.idl -../../page/PerformanceMeasure.idl -../../page/PerformanceNavigation.idl -../../page/PerformanceResourceTiming.idl -../../page/PerformanceTiming.idl -../../page/Screen.idl -../../page/SpeechInputEvent.idl -../../page/SpeechInputResult.idl -../../page/SpeechInputResultList.idl -../../page/WebKitPoint.idl -../../page/WorkerNavigator.idl -../../plugins/DOMMimeType.idl -../../plugins/DOMMimeTypeArray.idl -../../plugins/DOMPlugin.idl -../../plugins/DOMPluginArray.idl -../../storage/Storage.idl -../../storage/StorageEvent.idl -../../svg/ElementTimeControl.idl -../../svg/SVGAElement.idl -../../svg/SVGAltGlyphDefElement.idl -../../svg/SVGAltGlyphElement.idl -../../svg/SVGAltGlyphItemElement.idl -../../svg/SVGAngle.idl -../../svg/SVGAnimateColorElement.idl -../../svg/SVGAnimatedAngle.idl -../../svg/SVGAnimatedBoolean.idl -../../svg/SVGAnimatedEnumeration.idl -../../svg/SVGAnimatedInteger.idl -../../svg/SVGAnimatedLength.idl -../../svg/SVGAnimatedLengthList.idl -../../svg/SVGAnimatedNumber.idl -../../svg/SVGAnimatedNumberList.idl -../../svg/SVGAnimatedPreserveAspectRatio.idl -../../svg/SVGAnimatedRect.idl -../../svg/SVGAnimatedString.idl -../../svg/SVGAnimatedTransformList.idl -../../svg/SVGAnimateElement.idl -../../svg/SVGAnimateMotionElement.idl -../../svg/SVGAnimateTransformElement.idl -../../svg/SVGAnimationElement.idl -../../svg/SVGCircleElement.idl -../../svg/SVGClipPathElement.idl -../../svg/SVGColor.idl -../../svg/SVGComponentTransferFunctionElement.idl -../../svg/SVGCursorElement.idl -../../svg/SVGDefsElement.idl -../../svg/SVGDescElement.idl -../../svg/SVGDocument.idl -../../svg/SVGElement.idl -../../svg/SVGElementInstance.idl -../../svg/SVGElementInstanceList.idl -../../svg/SVGEllipseElement.idl -../../svg/SVGException.idl -../../svg/SVGExternalResourcesRequired.idl -../../svg/SVGFEBlendElement.idl -../../svg/SVGFEColorMatrixElement.idl -../../svg/SVGFEComponentTransferElement.idl -../../svg/SVGFECompositeElement.idl -../../svg/SVGFEConvolveMatrixElement.idl -../../svg/SVGFEDiffuseLightingElement.idl -../../svg/SVGFEDisplacementMapElement.idl -../../svg/SVGFEDistantLightElement.idl -../../svg/SVGFEDropShadowElement.idl -../../svg/SVGFEFloodElement.idl -../../svg/SVGFEFuncAElement.idl -../../svg/SVGFEFuncBElement.idl -../../svg/SVGFEFuncGElement.idl -../../svg/SVGFEFuncRElement.idl -../../svg/SVGFEGaussianBlurElement.idl -../../svg/SVGFEImageElement.idl -../../svg/SVGFEMergeElement.idl -../../svg/SVGFEMergeNodeElement.idl -../../svg/SVGFEMorphologyElement.idl -../../svg/SVGFEOffsetElement.idl -../../svg/SVGFEPointLightElement.idl -../../svg/SVGFESpecularLightingElement.idl -../../svg/SVGFESpotLightElement.idl -../../svg/SVGFETileElement.idl -../../svg/SVGFETurbulenceElement.idl -../../svg/SVGFilterElement.idl -../../svg/SVGFilterPrimitiveStandardAttributes.idl -../../svg/SVGFitToViewBox.idl -../../svg/SVGFontElement.idl -../../svg/SVGFontFaceElement.idl -../../svg/SVGFontFaceFormatElement.idl -../../svg/SVGFontFaceNameElement.idl -../../svg/SVGFontFaceSrcElement.idl -../../svg/SVGFontFaceUriElement.idl -../../svg/SVGForeignObjectElement.idl -../../svg/SVGGElement.idl -../../svg/SVGGlyphElement.idl -../../svg/SVGGlyphRefElement.idl -../../svg/SVGGradientElement.idl -../../svg/SVGHKernElement.idl -../../svg/SVGImageElement.idl -../../svg/SVGLangSpace.idl -../../svg/SVGLength.idl -../../svg/SVGLengthList.idl -../../svg/SVGLinearGradientElement.idl -../../svg/SVGLineElement.idl -../../svg/SVGLocatable.idl -../../svg/SVGMarkerElement.idl -../../svg/SVGMaskElement.idl -../../svg/SVGMatrix.idl -../../svg/SVGMetadataElement.idl -../../svg/SVGMissingGlyphElement.idl -../../svg/SVGMPathElement.idl -../../svg/SVGNumber.idl -../../svg/SVGNumberList.idl -../../svg/SVGPaint.idl -../../svg/SVGPathElement.idl -../../svg/SVGPathSeg.idl -../../svg/SVGPathSegArcAbs.idl -../../svg/SVGPathSegArcRel.idl -../../svg/SVGPathSegClosePath.idl -../../svg/SVGPathSegCurvetoCubicAbs.idl -../../svg/SVGPathSegCurvetoCubicRel.idl -../../svg/SVGPathSegCurvetoCubicSmoothAbs.idl -../../svg/SVGPathSegCurvetoCubicSmoothRel.idl -../../svg/SVGPathSegCurvetoQuadraticAbs.idl -../../svg/SVGPathSegCurvetoQuadraticRel.idl -../../svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl -../../svg/SVGPathSegCurvetoQuadraticSmoothRel.idl -../../svg/SVGPathSegLinetoAbs.idl -../../svg/SVGPathSegLinetoHorizontalAbs.idl -../../svg/SVGPathSegLinetoHorizontalRel.idl -../../svg/SVGPathSegLinetoRel.idl -../../svg/SVGPathSegLinetoVerticalAbs.idl -../../svg/SVGPathSegLinetoVerticalRel.idl -../../svg/SVGPathSegList.idl -../../svg/SVGPathSegMovetoAbs.idl -../../svg/SVGPathSegMovetoRel.idl -../../svg/SVGPatternElement.idl -../../svg/SVGPoint.idl -../../svg/SVGPointList.idl -../../svg/SVGPolygonElement.idl -../../svg/SVGPolylineElement.idl -../../svg/SVGPreserveAspectRatio.idl -../../svg/SVGRadialGradientElement.idl -../../svg/SVGRect.idl -../../svg/SVGRectElement.idl -../../svg/SVGRenderingIntent.idl -../../svg/SVGScriptElement.idl -../../svg/SVGSetElement.idl -../../svg/SVGStopElement.idl -../../svg/SVGStringList.idl -../../svg/SVGStylable.idl -../../svg/SVGStyleElement.idl -../../svg/SVGSVGElement.idl -../../svg/SVGSwitchElement.idl -../../svg/SVGSymbolElement.idl -../../svg/SVGTests.idl -../../svg/SVGTextContentElement.idl -../../svg/SVGTextElement.idl -../../svg/SVGTextPathElement.idl -../../svg/SVGTextPositioningElement.idl -../../svg/SVGTitleElement.idl -../../svg/SVGTransform.idl -../../svg/SVGTransformable.idl -../../svg/SVGTransformList.idl -../../svg/SVGTRefElement.idl -../../svg/SVGTSpanElement.idl -../../svg/SVGUnitTypes.idl -../../svg/SVGURIReference.idl -../../svg/SVGUseElement.idl -../../svg/SVGViewElement.idl -../../svg/SVGViewSpec.idl -../../svg/SVGVKernElement.idl -../../svg/SVGZoomAndPan.idl -../../svg/SVGZoomEvent.idl -../../testing/Internals.idl -../../testing/InternalSettings.idl -../../testing/MallocStatistics.idl -../../workers/AbstractWorker.idl -../../workers/DedicatedWorkerContext.idl -../../workers/SharedWorker.idl -../../workers/SharedWorkerContext.idl -../../workers/Worker.idl -../../workers/WorkerContext.idl -../../workers/WorkerLocation.idl -../../xml/DOMParser.idl -../../xml/XMLHttpRequest.idl -../../xml/XMLHttpRequestException.idl -../../xml/XMLHttpRequestProgressEvent.idl -../../xml/XMLHttpRequestUpload.idl -../../xml/XMLSerializer.idl -../../xml/XPathEvaluator.idl -../../xml/XPathException.idl -../../xml/XPathExpression.idl -../../xml/XPathNSResolver.idl -../../xml/XPathResult.idl -../../xml/XSLTProcessor.idl diff --git a/contrib/dom/scripts/gobject-generate-headers.pl b/contrib/dom/scripts/gobject-generate-headers.pl deleted file mode 100644 index 6955955..0000000 --- a/contrib/dom/scripts/gobject-generate-headers.pl +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/perl -w -# -# Copyright (C) 2009 Adam Dingle <adam@yorba.org> -# -# This file is part of WebKit -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library 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. See the GNU -# Library General Public License for more details. -# -# You should have received a copy of the GNU Library General Public License -# aint with this library; see the file COPYING.LIB. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# - -my $classlist = <STDIN>; -chomp($classlist); -my @classes = split / /, $classlist; -@classes = sort @classes; - -print <<EOF; -/* This file is part of the WebKit open source project. - This file has been generated by gobject-generate-headers.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -EOF - -my $outType = $ARGV[0]; -my $header; -if ($outType eq "defines") { - $header = "webkitdomdefines_h"; -} elsif ($outType eq "gdom") { - $header = "webkitdom_h"; -} else { - die "unknown output type"; -} - -print "#ifndef ${header}\n"; -print "#define ${header}\n"; -print "\n"; - -if ($outType eq "defines") { - print "#include <glib.h>\n\n"; - print "#ifdef G_OS_WIN32\n"; - print " #ifdef BUILDING_WEBKIT\n"; - print " #define WEBKIT_API __declspec(dllexport)\n"; - print " #else\n"; - print " #define WEBKIT_API __declspec(dllimport)\n"; - print " #endif\n"; - print " #define WEBKIT_OBSOLETE_API WEBKIT_API\n"; - print "#else\n"; - print " #define WEBKIT_API __attribute__((visibility(\"default\")))\n"; - print " #define WEBKIT_OBSOLETE_API WEBKIT_API __attribute__((deprecated))\n"; - print "#endif\n\n"; - print "#ifndef WEBKIT_API\n"; - print " #define WEBKIT_API\n"; - print "#endif\n"; - - foreach my $class (@classes) { - print "typedef struct _WebKitDOM${class} WebKitDOM${class};\n"; - print "typedef struct _WebKitDOM${class}Class WebKitDOM${class}Class;\n"; - print "\n"; - } -} elsif ($outType eq "gdom") { - foreach my $class (@classes) { - print "#include <webkitdom/WebKitDOM${class}.h>\n"; - } -} - -print "\n"; -print "#endif\n"; diff --git a/contrib/dom/scripts/preprocess-idls.pl b/contrib/dom/scripts/preprocess-idls.pl deleted file mode 100644 index 2f20c1a..0000000 --- a/contrib/dom/scripts/preprocess-idls.pl +++ /dev/null @@ -1,214 +0,0 @@ -#!/usr/bin/perl -w -# -# Copyright (C) 2011 Google Inc. All rights reserved. -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library 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. See the GNU -# Library General Public License for more details. -# -# You should have received a copy of the GNU Library General Public License -# along with this library; see the file COPYING.LIB. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# - -use strict; - -use File::Basename; -use Getopt::Long; -use Cwd; - -use IDLParser; - -my $defines; -my $preprocessor; -my $verbose; -my $idlFilesList; -my $idlAttributesFile; -my $supplementalDependencyFile; -my $supplementalMakefileDeps; - -GetOptions('defines=s' => \$defines, - 'preprocessor=s' => \$preprocessor, - 'verbose' => \$verbose, - 'idlFilesList=s' => \$idlFilesList, - 'idlAttributesFile=s' => \$idlAttributesFile, - 'supplementalDependencyFile=s' => \$supplementalDependencyFile, - 'supplementalMakefileDeps=s' => \$supplementalMakefileDeps); - -die('Must specify #define macros using --defines.') unless defined($defines); -die('Must specify an output file using --supplementalDependencyFile.') unless defined($supplementalDependencyFile); -die('Must specify the file listing all IDLs using --idlFilesList.') unless defined($idlFilesList); - -if ($verbose) { - print "Resolving [Supplemental=XXX] dependencies in all IDL files.\n"; -} - -open FH, "< $idlFilesList" or die "Cannot open $idlFilesList\n"; -my @idlFiles = <FH>; -chomp(@idlFiles); -close FH; - -# Parse all IDL files. -my %documents; -my %interfaceNameToIdlFile; -my %idlFileToInterfaceName; -foreach my $idlFile (@idlFiles) { - my $fullPath = Cwd::realpath($idlFile); - my $parser = IDLParser->new(!$verbose); - $documents{$fullPath} = $parser->Parse($idlFile, $defines, $preprocessor); - my $interfaceName = fileparse(basename($idlFile), ".idl"); - $interfaceNameToIdlFile{$interfaceName} = $fullPath; - $idlFileToInterfaceName{$fullPath} = $interfaceName; -} - -# Runs the IDL attribute checker. -my $idlAttributes = loadIDLAttributes($idlAttributesFile); -foreach my $idlFile (keys %documents) { - checkIDLAttributes($idlAttributes, $documents{$idlFile}, basename($idlFile)); -} - -# Resolves [Supplemental=XXX] dependencies. -my %supplementals; -foreach my $idlFile (keys %documents) { - $supplementals{$idlFile} = []; -} -foreach my $idlFile (keys %documents) { - foreach my $interface (@{$documents{$idlFile}->interfaces}) { - if ($interface->extendedAttributes->{"Supplemental"}) { - my $targetIdlFile = $interfaceNameToIdlFile{$interface->extendedAttributes->{"Supplemental"}}; - push(@{$supplementals{$targetIdlFile}}, $idlFile); - # Treats as if this IDL file does not exist. - delete $supplementals{$idlFile}; - } - } -} - -# Outputs the dependency. -# The format of a supplemental dependency file: -# -# DOMWindow.idl P.idl Q.idl R.idl -# Document.idl S.idl -# Event.idl -# ... -# -# The above indicates that DOMWindow.idl is supplemented by P.idl, Q.idl and R.idl, -# Document.idl is supplemented by S.idl, and Event.idl is supplemented by no IDLs. -# The IDL that supplements another IDL (e.g. P.idl) never appears in the dependency file. - -open FH, "> $supplementalDependencyFile" or die "Cannot open $supplementalDependencyFile\n"; - -foreach my $idlFile (sort keys %supplementals) { - print FH $idlFile, " @{$supplementals{$idlFile}}\n"; -} -close FH; - - -if ($supplementalMakefileDeps) { - open MAKE_FH, "> $supplementalMakefileDeps" or die "Cannot open $supplementalMakefileDeps\n"; - my @all_dependencies = []; - foreach my $idlFile (sort keys %supplementals) { - my $basename = $idlFileToInterfaceName{$idlFile}; - - my @dependencies = map { basename($_) } @{$supplementals{$idlFile}}; - - print MAKE_FH "JS${basename}.h: @{dependencies}\n"; - print MAKE_FH "DOM${basename}.h: @{dependencies}\n"; - print MAKE_FH "WebDOM${basename}.h: @{dependencies}\n"; - foreach my $dependency (@dependencies) { - print MAKE_FH "${dependency}:\n"; - } - } - - close MAKE_FH; -} - - -sub loadIDLAttributes -{ - my $idlAttributesFile = shift; - - my %idlAttributes; - open FH, "<", $idlAttributesFile or die "Couldn't open $idlAttributesFile: $!"; - while (my $line = <FH>) { - chomp $line; - next if $line =~ /^\s*#/; - next if $line =~ /^\s*$/; - - if ($line =~ /^\s*([^=\s]*)\s*=?\s*(.*)/) { - my $name = $1; - $idlAttributes{$name} = {}; - if ($2) { - foreach my $rightValue (split /\|/, $2) { - $rightValue =~ s/^\s*|\s*$//g; - $rightValue = "VALUE_IS_MISSING" unless $rightValue; - $idlAttributes{$name}{$rightValue} = 1; - } - } else { - $idlAttributes{$name}{"VALUE_IS_MISSING"} = 1; - } - } else { - die "The format of " . basename($idlAttributesFile) . " is wrong: line $.\n"; - } - } - close FH; - - return \%idlAttributes; -} - -sub checkIDLAttributes -{ - my $idlAttributes = shift; - my $document = shift; - my $idlFile = shift; - - foreach my $interface (@{$document->interfaces}) { - checkIfIDLAttributesExists($idlAttributes, $interface->extendedAttributes, $idlFile); - - foreach my $attribute (@{$interface->attributes}) { - checkIfIDLAttributesExists($idlAttributes, $attribute->signature->extendedAttributes, $idlFile); - } - - foreach my $function (@{$interface->functions}) { - checkIfIDLAttributesExists($idlAttributes, $function->signature->extendedAttributes, $idlFile); - foreach my $parameter (@{$function->parameters}) { - checkIfIDLAttributesExists($idlAttributes, $parameter->extendedAttributes, $idlFile); - } - } - } -} - -sub checkIfIDLAttributesExists -{ - my $idlAttributes = shift; - my $extendedAttributes = shift; - my $idlFile = shift; - - my $error; - OUTER: for my $name (keys %$extendedAttributes) { - if (!exists $idlAttributes->{$name}) { - $error = "Unknown IDL attribute [$name] is found at $idlFile."; - last OUTER; - } - if ($idlAttributes->{$name}{"*"}) { - next; - } - for my $rightValue (split /\s*\|\s*/, $extendedAttributes->{$name}) { - if (!exists $idlAttributes->{$name}{$rightValue}) { - $error = "Unknown IDL attribute [$name=" . $extendedAttributes->{$name} . "] is found at $idlFile."; - last OUTER; - } - } - } - if ($error) { - die "IDL ATTRIBUTE CHECKER ERROR: $error -If you want to add a new IDL attribute, you need to add it to WebCore/bindings/scripts/IDLAttributes.txt and add explanations to the WebKit IDL document (https://trac.webkit.org/wiki/WebKitIDL). -"; - } -} diff --git a/contrib/dom/webkit/dom/Attr.idl b/contrib/dom/webkit/dom/Attr.idl deleted file mode 100644 index bd3b50f..0000000 --- a/contrib/dom/webkit/dom/Attr.idl +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -[ - JSCustomMarkFunction, - JSGenerateToNativeObject -] interface Attr : Node { - - // DOM Level 1 - - [TreatReturnedNullStringAs=Null] readonly attribute DOMString name; - - readonly attribute boolean specified; - - [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString value - setter raises(DOMException); - - // DOM Level 2 - - readonly attribute Element ownerElement; - - // DOM Level 3 - - readonly attribute boolean isId; - -#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C - // This extension is no longer needed, but it has to remain available in Objective C, as it's public API. - readonly attribute CSSStyleDeclaration style; -#endif -}; - diff --git a/contrib/dom/webkit/dom/BeforeLoadEvent.idl b/contrib/dom/webkit/dom/BeforeLoadEvent.idl deleted file mode 100644 index 54b8501..0000000 --- a/contrib/dom/webkit/dom/BeforeLoadEvent.idl +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2009 Apple Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -[ - ConstructorTemplate=Event -] interface BeforeLoadEvent : Event { - [InitializedByEventConstructor] readonly attribute DOMString url; -}; - diff --git a/contrib/dom/webkit/dom/CDATASection.idl b/contrib/dom/webkit/dom/CDATASection.idl deleted file mode 100644 index 939fe27..0000000 --- a/contrib/dom/webkit/dom/CDATASection.idl +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -interface CDATASection : Text { -}; - diff --git a/contrib/dom/webkit/dom/CharacterData.idl b/contrib/dom/webkit/dom/CharacterData.idl deleted file mode 100644 index bd6265b..0000000 --- a/contrib/dom/webkit/dom/CharacterData.idl +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -interface CharacterData : Node { - - [TreatNullAs=NullString] attribute DOMString data - setter raises(DOMException); - - readonly attribute unsigned long length; - - [TreatReturnedNullStringAs=Null, ObjCLegacyUnnamedParameters] DOMString substringData(in [IsIndex,Optional=DefaultIsUndefined] unsigned long offset, - in [IsIndex,Optional=DefaultIsUndefined] unsigned long length) - raises(DOMException); - - void appendData(in [Optional=DefaultIsUndefined] DOMString data) - raises(DOMException); - - [ObjCLegacyUnnamedParameters] void insertData(in [IsIndex,Optional=DefaultIsUndefined] unsigned long offset, - in [Optional=DefaultIsUndefined] DOMString data) - raises(DOMException); - - [ObjCLegacyUnnamedParameters] void deleteData(in [IsIndex,Optional=DefaultIsUndefined] unsigned long offset, - in [IsIndex,Optional=DefaultIsUndefined] unsigned long length) - raises(DOMException); - - [ObjCLegacyUnnamedParameters] void replaceData(in [IsIndex,Optional=DefaultIsUndefined] unsigned long offset, - in [IsIndex,Optional=DefaultIsUndefined] unsigned long length, - in [Optional=DefaultIsUndefined] DOMString data) - raises(DOMException); - - // DOM 4 - void remove() - raises(DOMException); -}; - diff --git a/contrib/dom/webkit/dom/ClientRect.idl b/contrib/dom/webkit/dom/ClientRect.idl deleted file mode 100644 index ab5d170..0000000 --- a/contrib/dom/webkit/dom/ClientRect.idl +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2009 Apple Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -interface ClientRect { - readonly attribute float top; - readonly attribute float right; - readonly attribute float bottom; - readonly attribute float left; - readonly attribute float width; - readonly attribute float height; -}; - diff --git a/contrib/dom/webkit/dom/ClientRectList.idl b/contrib/dom/webkit/dom/ClientRectList.idl deleted file mode 100644 index 93513a4..0000000 --- a/contrib/dom/webkit/dom/ClientRectList.idl +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2009 Apple Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -[ - IndexedGetter -] interface ClientRectList { - readonly attribute unsigned long length; - ClientRect item(in [IsIndex,Optional=DefaultIsUndefined] unsigned long index); - // FIXME: Fix list behavior to allow custom exceptions to be thrown. -}; - diff --git a/contrib/dom/webkit/dom/Clipboard.idl b/contrib/dom/webkit/dom/Clipboard.idl deleted file mode 100644 index 43f3aaa..0000000 --- a/contrib/dom/webkit/dom/Clipboard.idl +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -interface Clipboard { - [TreatReturnedNullStringAs=Undefined] attribute DOMString dropEffect; - [TreatReturnedNullStringAs=Undefined] attribute DOMString effectAllowed; - [CustomGetter] readonly attribute Array types; - readonly attribute FileList files; - - [Custom] void clearData(in [Optional] DOMString type) - raises(DOMException); - DOMString getData(in DOMString type); - boolean setData(in DOMString type, in DOMString data); - [Custom] void setDragImage(in HTMLImageElement image, in long x, in long y) - raises(DOMException); - - [Conditional=DATA_TRANSFER_ITEMS, V8EnabledAtRuntime=DataTransferItems] readonly attribute DataTransferItemList items; -}; - diff --git a/contrib/dom/webkit/dom/Comment.idl b/contrib/dom/webkit/dom/Comment.idl deleted file mode 100644 index 5c07e2f..0000000 --- a/contrib/dom/webkit/dom/Comment.idl +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -interface Comment : CharacterData { -}; - diff --git a/contrib/dom/webkit/dom/CompositionEvent.idl b/contrib/dom/webkit/dom/CompositionEvent.idl deleted file mode 100644 index 9f12133..0000000 --- a/contrib/dom/webkit/dom/CompositionEvent.idl +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2009 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -// Introduced in DOM Level 3: -interface CompositionEvent : UIEvent { - - readonly attribute DOMString data; - - void initCompositionEvent(in [Optional=DefaultIsUndefined] DOMString typeArg, - in [Optional=DefaultIsUndefined] boolean canBubbleArg, - in [Optional=DefaultIsUndefined] boolean cancelableArg, - in [Optional=DefaultIsUndefined] DOMWindow viewArg, - in [Optional=DefaultIsUndefined] DOMString dataArg); - -}; - diff --git a/contrib/dom/webkit/dom/CustomEvent.idl b/contrib/dom/webkit/dom/CustomEvent.idl deleted file mode 100644 index 474f3c5..0000000 --- a/contrib/dom/webkit/dom/CustomEvent.idl +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP -// Introduced in DOM Level 3: -[ - ConstructorTemplate=Event -] interface CustomEvent : Event { - [InitializedByEventConstructor, V8Custom] readonly attribute DOMObject detail; - - void initCustomEvent(in [Optional=DefaultIsUndefined] DOMString typeArg, - in [Optional=DefaultIsUndefined] boolean canBubbleArg, - in [Optional=DefaultIsUndefined] boolean cancelableArg, - in [Optional=DefaultIsUndefined] DOMObject detailArg); -}; -#endif - diff --git a/contrib/dom/webkit/dom/DOMCoreException.idl b/contrib/dom/webkit/dom/DOMCoreException.idl deleted file mode 100644 index 419202c..0000000 --- a/contrib/dom/webkit/dom/DOMCoreException.idl +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - JSNoStaticTables, - DoNotCheckConstants, - InterfaceName=DOMException -] exception DOMCoreException { - - readonly attribute unsigned short code; - readonly attribute DOMString name; - readonly attribute DOMString message; - -#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT - // Override in a Mozilla compatible format - [NotEnumerable] DOMString toString(); -#endif - - // ExceptionCode - const unsigned short INDEX_SIZE_ERR = 1; - const unsigned short DOMSTRING_SIZE_ERR = 2; - const unsigned short HIERARCHY_REQUEST_ERR = 3; - const unsigned short WRONG_DOCUMENT_ERR = 4; - const unsigned short INVALID_CHARACTER_ERR = 5; - const unsigned short NO_DATA_ALLOWED_ERR = 6; - const unsigned short NO_MODIFICATION_ALLOWED_ERR = 7; - const unsigned short NOT_FOUND_ERR = 8; - const unsigned short NOT_SUPPORTED_ERR = 9; - const unsigned short INUSE_ATTRIBUTE_ERR = 10; - // Introduced in DOM Level 2: - const unsigned short INVALID_STATE_ERR = 11; - // Introduced in DOM Level 2: - const unsigned short SYNTAX_ERR = 12; - // Introduced in DOM Level 2: - const unsigned short INVALID_MODIFICATION_ERR = 13; - // Introduced in DOM Level 2: - const unsigned short NAMESPACE_ERR = 14; - // Introduced in DOM Level 2: - const unsigned short INVALID_ACCESS_ERR = 15; - // Introduced in DOM Level 3: - const unsigned short VALIDATION_ERR = 16; - // Introduced in DOM Level 3: - const unsigned short TYPE_MISMATCH_ERR = 17; - // Introduced as an XHR extension: - const unsigned short SECURITY_ERR = 18; - // Introduced in HTML5: - const unsigned short NETWORK_ERR = 19; - const unsigned short ABORT_ERR = 20; - const unsigned short URL_MISMATCH_ERR = 21; - const unsigned short QUOTA_EXCEEDED_ERR = 22; - // TIMEOUT_ERR is currently unused but was added for completeness. - const unsigned short TIMEOUT_ERR = 23; - // INVALID_NODE_TYPE_ERR is currently unused but was added for completeness. - const unsigned short INVALID_NODE_TYPE_ERR = 24; - const unsigned short DATA_CLONE_ERR = 25; -}; - diff --git a/contrib/dom/webkit/dom/DOMError.idl b/contrib/dom/webkit/dom/DOMError.idl deleted file mode 100644 index 7014e84..0000000 --- a/contrib/dom/webkit/dom/DOMError.idl +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - interface [ -] DOMError { - readonly attribute DOMString name; - }; - diff --git a/contrib/dom/webkit/dom/DOMImplementation.idl b/contrib/dom/webkit/dom/DOMImplementation.idl deleted file mode 100644 index 1b92054..0000000 --- a/contrib/dom/webkit/dom/DOMImplementation.idl +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -[ - GenerateIsReachable=ImplDocument, -] interface DOMImplementation { - - // DOM Level 1 - - [ObjCLegacyUnnamedParameters] boolean hasFeature(in [Optional=DefaultIsUndefined] DOMString feature, - in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString version); - - // DOM Level 2 - - [ObjCLegacyUnnamedParameters] DocumentType createDocumentType(in [TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] DOMString qualifiedName, - in [TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] DOMString publicId, - in [TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] DOMString systemId) - raises(DOMException); - [ObjCLegacyUnnamedParameters] Document createDocument(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI, - in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString qualifiedName, - in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DocumentType doctype) - raises(DOMException); - - // DOMImplementationCSS interface from DOM Level 2 CSS - - [ObjCLegacyUnnamedParameters] CSSStyleSheet createCSSStyleSheet(in [Optional=DefaultIsUndefined] DOMString title, - in [Optional=DefaultIsUndefined] DOMString media) - raises(DOMException); - - // HTMLDOMImplementation interface from DOM Level 2 HTML - - HTMLDocument createHTMLDocument(in [Optional=DefaultIsNullString] DOMString title); -}; - diff --git a/contrib/dom/webkit/dom/DOMNamedFlowCollection.idl b/contrib/dom/webkit/dom/DOMNamedFlowCollection.idl deleted file mode 100644 index 86757e8..0000000 --- a/contrib/dom/webkit/dom/DOMNamedFlowCollection.idl +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -[ - Conditional=CSS_REGIONS, - V8EnabledAtRuntime=cssRegions, - InterfaceName=WebKitNamedFlowCollection, - JSGenerateToJSObject, - IndexedGetter, - NamedGetter -] interface DOMNamedFlowCollection { - readonly attribute unsigned long length; - WebKitNamedFlow item(in unsigned long index); - WebKitNamedFlow namedItem(in DOMString name); -}; diff --git a/contrib/dom/webkit/dom/DOMStringList.idl b/contrib/dom/webkit/dom/DOMStringList.idl deleted file mode 100644 index aa643e6..0000000 --- a/contrib/dom/webkit/dom/DOMStringList.idl +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2010 Google Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - IndexedGetter, - JSCustomToNativeObject, - JSNoStaticTables -] interface DOMStringList { - readonly attribute unsigned long length; - [TreatReturnedNullStringAs=Null] DOMString item(in [Optional=DefaultIsUndefined] unsigned long index); - boolean contains(in [Optional=DefaultIsUndefined] DOMString string); -}; - diff --git a/contrib/dom/webkit/dom/DOMStringMap.idl b/contrib/dom/webkit/dom/DOMStringMap.idl deleted file mode 100644 index 732ab1c..0000000 --- a/contrib/dom/webkit/dom/DOMStringMap.idl +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - GenerateIsReachable=ImplElementRoot, - NamedGetter, - CustomDeleteProperty, - CustomEnumerateProperty, - CustomNamedSetter -] interface DOMStringMap { -}; - diff --git a/contrib/dom/webkit/dom/DataTransferItem.idl b/contrib/dom/webkit/dom/DataTransferItem.idl deleted file mode 100644 index a66656e..0000000 --- a/contrib/dom/webkit/dom/DataTransferItem.idl +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - Conditional=DATA_TRANSFER_ITEMS, -] interface DataTransferItem { - readonly attribute DOMString kind; - readonly attribute DOMString type; - - void getAsString(in [Callback,Optional=DefaultIsUndefined] StringCallback callback); - Blob getAsFile(); -}; - diff --git a/contrib/dom/webkit/dom/DataTransferItemList.idl b/contrib/dom/webkit/dom/DataTransferItemList.idl deleted file mode 100644 index 67956a1..0000000 --- a/contrib/dom/webkit/dom/DataTransferItemList.idl +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - Conditional=DATA_TRANSFER_ITEMS, - IndexedGetter, - JSGenerateToNativeObject, -#if defined(V8_BINDING) && V8_BINDING - CustomDeleteProperty, -#endif -] interface DataTransferItemList { - readonly attribute long length; - DataTransferItem item(in [Optional=DefaultIsUndefined] unsigned long index); - - void clear(); - void add(in File? file); - void add(in [Optional=DefaultIsUndefined] DOMString data, - in [Optional=DefaultIsUndefined] DOMString type) raises(DOMException); -}; - diff --git a/contrib/dom/webkit/dom/DeviceMotionEvent.idl b/contrib/dom/webkit/dom/DeviceMotionEvent.idl deleted file mode 100644 index 7c39c2f..0000000 --- a/contrib/dom/webkit/dom/DeviceMotionEvent.idl +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - Conditional=DEVICE_ORIENTATION, -] interface DeviceMotionEvent : Event { - [Custom] readonly attribute Acceleration acceleration; - [Custom] readonly attribute Acceleration accelerationIncludingGravity; - [Custom] readonly attribute RotationRate rotationRate; - [Custom] readonly attribute double interval; - [Custom] void initDeviceMotionEvent(in [Optional=DefaultIsUndefined] DOMString type, - in [Optional=DefaultIsUndefined] boolean bubbles, - in [Optional=DefaultIsUndefined] boolean cancelable, - in [Optional=DefaultIsUndefined] Acceleration acceleration, - in [Optional=DefaultIsUndefined] Acceleration accelerationIncludingGravity, - in [Optional=DefaultIsUndefined] RotationRate rotationRate, - in [Optional=DefaultIsUndefined] double interval); -}; - diff --git a/contrib/dom/webkit/dom/DeviceOrientationEvent.idl b/contrib/dom/webkit/dom/DeviceOrientationEvent.idl deleted file mode 100644 index e826503..0000000 --- a/contrib/dom/webkit/dom/DeviceOrientationEvent.idl +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2010, The Android Open Source Project - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - Conditional=DEVICE_ORIENTATION, -] interface DeviceOrientationEvent : Event { - [Custom] readonly attribute double alpha; - [Custom] readonly attribute double beta; - [Custom] readonly attribute double gamma; - [Custom] readonly attribute boolean absolute; - [Custom] void initDeviceOrientationEvent(in [Optional=DefaultIsUndefined] DOMString type, - in [Optional=DefaultIsUndefined] boolean bubbles, - in [Optional=DefaultIsUndefined] boolean cancelable, - in [Optional=DefaultIsUndefined] double alpha, - in [Optional=DefaultIsUndefined] double beta, - in [Optional=DefaultIsUndefined] double gamma, - in [Optional=DefaultIsUndefined] boolean absolute); -}; - diff --git a/contrib/dom/webkit/dom/Document.idl b/contrib/dom/webkit/dom/Document.idl deleted file mode 100644 index b706496..0000000 --- a/contrib/dom/webkit/dom/Document.idl +++ /dev/null @@ -1,372 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2011 Apple Inc. All rights reserved. - * Copyright (C) 2006, 2007 Samuel Weinig <sam@webkit.org> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -[ - CustomToJSObject, - JSGenerateToNativeObject, - JSInlineGetOwnPropertySlot -] interface Document : Node { - - // DOM Level 1 Core - readonly attribute DocumentType doctype; - readonly attribute DOMImplementation implementation; - readonly attribute Element documentElement; - - [ReturnNewObject] Element createElement(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString tagName) - raises (DOMException); - DocumentFragment createDocumentFragment(); - [ReturnNewObject] Text createTextNode(in [Optional=DefaultIsUndefined] DOMString data); - [ReturnNewObject] Comment createComment(in [Optional=DefaultIsUndefined] DOMString data); - [ReturnNewObject] CDATASection createCDATASection(in [Optional=DefaultIsUndefined] DOMString data) - raises(DOMException); - [ObjCLegacyUnnamedParameters, ReturnNewObject] ProcessingInstruction createProcessingInstruction(in [Optional=DefaultIsUndefined] DOMString target, - in [Optional=DefaultIsUndefined] DOMString data) - raises (DOMException); - [ReturnNewObject] Attr createAttribute(in [Optional=DefaultIsUndefined] DOMString name) - raises (DOMException); - [ReturnNewObject] EntityReference createEntityReference(in [Optional=DefaultIsUndefined] DOMString name) - raises(DOMException); - NodeList getElementsByTagName(in [Optional=DefaultIsUndefined] DOMString tagname); - - // Introduced in DOM Level 2: - - [ObjCLegacyUnnamedParameters, ReturnNewObject] Node importNode(in [Optional=DefaultIsUndefined] Node importedNode, - in [Optional] boolean deep) - raises (DOMException); - [ObjCLegacyUnnamedParameters, ReturnNewObject] Element createElementNS(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI, - in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString qualifiedName) - raises (DOMException); - [ObjCLegacyUnnamedParameters, ReturnNewObject] Attr createAttributeNS(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI, - in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString qualifiedName) - raises (DOMException); - [ObjCLegacyUnnamedParameters] NodeList getElementsByTagNameNS(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI, - in [Optional=DefaultIsUndefined] DOMString localName); - Element getElementById(in [Optional=DefaultIsUndefined] DOMString elementId); - - // DOM Level 3 Core - - [TreatReturnedNullStringAs=Null] readonly attribute DOMString inputEncoding; - - [TreatReturnedNullStringAs=Null] readonly attribute DOMString xmlEncoding; - [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString xmlVersion - setter raises (DOMException); - attribute boolean xmlStandalone - setter raises (DOMException); - - Node adoptNode(in [Optional=DefaultIsUndefined] Node source) - raises (DOMException); - -#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C || defined(LANGUAGE_GOBJECT) && LANGUAGE_GOBJECT - // document.documentURI was writable in DOM3 Core, but is read-only in DOM4 - // (see http://www.w3.org/TR/2011/WD-dom-20110915/#document). We need to keep - // the writable version around for Objective C clients, but are moving to - // read-only for other clients. - [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString documentURI; -#else - [TreatReturnedNullStringAs=Null] readonly attribute DOMString documentURI; -#endif - - // DOM Level 2 Events (DocumentEvents interface) - - Event createEvent(in [Optional=DefaultIsUndefined] DOMString eventType) - raises(DOMException); - - // DOM Level 2 Tranversal and Range (DocumentRange interface) - - Range createRange(); - - // DOM Level 2 Tranversal and Range (DocumentTraversal interface) - - [ObjCLegacyUnnamedParameters] NodeIterator createNodeIterator(in [Optional=DefaultIsUndefined] Node root, - in [Optional=DefaultIsUndefined] unsigned long whatToShow, - in [Optional=DefaultIsUndefined] NodeFilter filter, - in [Optional=DefaultIsUndefined] boolean expandEntityReferences) - raises(DOMException); - [ObjCLegacyUnnamedParameters] TreeWalker createTreeWalker(in [Optional=DefaultIsUndefined] Node root, - in [Optional=DefaultIsUndefined] unsigned long whatToShow, - in [Optional=DefaultIsUndefined] NodeFilter filter, - in [Optional=DefaultIsUndefined] boolean expandEntityReferences) - raises(DOMException); - - // DOM Level 2 Abstract Views (DocumentView interface) - - readonly attribute DOMWindow defaultView; - - // DOM Level 2 Style (DocumentStyle interface) - - readonly attribute StyleSheetList styleSheets; - - // DOM Level 2 Style (DocumentCSS interface) - - [ObjCLegacyUnnamedParameters] CSSStyleDeclaration getOverrideStyle(in [Optional=DefaultIsUndefined] Element element, - in [Optional=DefaultIsUndefined] DOMString pseudoElement); - - // DOM Level 3 XPath (XPathEvaluator interface) - [ObjCLegacyUnnamedParameters] XPathExpression createExpression(in [Optional=DefaultIsUndefined] DOMString expression, - in [Optional=DefaultIsUndefined] XPathNSResolver resolver) - raises(DOMException); - XPathNSResolver createNSResolver(in Node nodeResolver); - [ObjCLegacyUnnamedParameters, V8Custom] XPathResult evaluate(in [Optional=DefaultIsUndefined] DOMString expression, - in [Optional=DefaultIsUndefined] Node contextNode, - in [Optional=DefaultIsUndefined] XPathNSResolver resolver, - in [Optional=DefaultIsUndefined] unsigned short type, - in [Optional=DefaultIsUndefined] XPathResult inResult) - raises(DOMException); - - // Common extensions - - boolean execCommand(in [Optional=DefaultIsUndefined] DOMString command, - in [Optional=DefaultIsUndefined] boolean userInterface, - in [TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] DOMString value); - -#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C - // FIXME: remove the these two versions once [Optional] is implemented for Objective-C. - boolean execCommand(in DOMString command, - in boolean userInterface); - boolean execCommand(in DOMString command); -#endif - - boolean queryCommandEnabled(in [Optional=DefaultIsUndefined] DOMString command); - boolean queryCommandIndeterm(in [Optional=DefaultIsUndefined] DOMString command); - boolean queryCommandState(in [Optional=DefaultIsUndefined] DOMString command); - boolean queryCommandSupported(in [Optional=DefaultIsUndefined] DOMString command); - DOMString queryCommandValue(in [Optional=DefaultIsUndefined] DOMString command); - - // Moved down from HTMLDocument - - [TreatNullAs=NullString] attribute DOMString title; - readonly attribute DOMString referrer; -#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT - [TreatNullAs=NullString] attribute DOMString domain - setter raises (DOMException); -#else - readonly attribute DOMString domain; -#endif - readonly attribute DOMString URL; - - [TreatNullAs=NullString] attribute DOMString cookie - setter raises (DOMException), - getter raises (DOMException); - - attribute HTMLElement body - setter raises (DOMException); - - readonly attribute HTMLHeadElement head; - readonly attribute HTMLCollection images; - readonly attribute HTMLCollection applets; - readonly attribute HTMLCollection links; - readonly attribute HTMLCollection forms; - readonly attribute HTMLCollection anchors; - readonly attribute DOMString lastModified; - - NodeList getElementsByName(in [Optional=DefaultIsUndefined] DOMString elementName); - -#if defined(ENABLE_MICRODATA) && ENABLE_MICRODATA - NodeList getItems(in [TreatNullAs=NullString, TreatUndefinedAs=NullString, Optional=DefaultIsUndefined] DOMString typeNames); -#endif - -#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT - [Custom] attribute Location location; -#endif - - // IE extensions - - [TreatReturnedNullStringAs=Undefined, TreatNullAs=NullString] attribute DOMString charset; - [TreatReturnedNullStringAs=Undefined] readonly attribute DOMString defaultCharset; - [TreatReturnedNullStringAs=Undefined] readonly attribute DOMString readyState; - - Element elementFromPoint(in [Optional=DefaultIsUndefined] long x, - in [Optional=DefaultIsUndefined] long y); - Range caretRangeFromPoint(in [Optional=DefaultIsUndefined] long x, - in [Optional=DefaultIsUndefined] long y); - - // Mozilla extensions -#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT - DOMSelection getSelection(); -#endif - [TreatReturnedNullStringAs=Null] readonly attribute DOMString characterSet; - - // WebKit extensions - - [TreatReturnedNullStringAs=Null] readonly attribute DOMString preferredStylesheetSet; - [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString selectedStylesheetSet; - -#if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT - CSSStyleDeclaration createCSSStyleDeclaration(); -#endif - -#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C - // DOM Level 2 Style Interface - [ObjCLegacyUnnamedParameters, ObjCUseDefaultView] CSSStyleDeclaration getComputedStyle(in Element element, - in DOMString pseudoElement); - - // WebKit extension - // FIXME: remove the first version once [Optional] is implemented for Objective-C. - [ObjCUseDefaultView] CSSRuleList getMatchedCSSRules(in Element element, - in DOMString pseudoElement); - [ObjCUseDefaultView] CSSRuleList getMatchedCSSRules(in Element element, - in DOMString pseudoElement, - in [Optional] boolean authorOnly); - -#endif - -#if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP -#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C - CanvasRenderingContext getCSSCanvasContext(in DOMString contextId, in DOMString name, in long width, in long height); -#endif -#endif - - // HTML 5 - NodeList getElementsByClassName(in [Optional=DefaultIsUndefined] DOMString tagname); - - readonly attribute DOMString compatMode; - - // NodeSelector - Selector API - Element querySelector(in DOMString selectors) - raises(DOMException); - NodeList querySelectorAll(in DOMString selectors) - raises(DOMException); - -#if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API - // Mozilla version - [V8EnabledAtRuntime] readonly attribute boolean webkitIsFullScreen; - [V8EnabledAtRuntime] readonly attribute boolean webkitFullScreenKeyboardInputAllowed; - [V8EnabledAtRuntime] readonly attribute Element webkitCurrentFullScreenElement; - [V8EnabledAtRuntime] void webkitCancelFullScreen(); - - // W3C version - [V8EnabledAtRuntime] readonly attribute boolean webkitFullscreenEnabled; - [V8EnabledAtRuntime] readonly attribute Element webkitFullscreenElement; - [V8EnabledAtRuntime] void webkitExitFullscreen(); -#endif - - [Conditional=POINTER_LOCK] void webkitExitPointerLock(); - [Conditional=POINTER_LOCK] readonly attribute Element webkitPointerLockElement; - - [Conditional=CSS_REGIONS, V8EnabledAtRuntime=cssRegions] DOMNamedFlowCollection webkitGetNamedFlows(); - -#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C - // Event handler DOM attributes - [NotEnumerable] attribute EventListener onabort; - [NotEnumerable] attribute EventListener onblur; - [NotEnumerable] attribute EventListener onchange; - [NotEnumerable] attribute EventListener onclick; - [NotEnumerable] attribute EventListener oncontextmenu; - [NotEnumerable] attribute EventListener ondblclick; - [NotEnumerable] attribute EventListener ondrag; - [NotEnumerable] attribute EventListener ondragend; - [NotEnumerable] attribute EventListener ondragenter; - [NotEnumerable] attribute EventListener ondragleave; - [NotEnumerable] attribute EventListener ondragover; - [NotEnumerable] attribute EventListener ondragstart; - [NotEnumerable] attribute EventListener ondrop; - [NotEnumerable] attribute EventListener onerror; - [NotEnumerable] attribute EventListener onfocus; - [NotEnumerable] attribute EventListener oninput; - [NotEnumerable] attribute EventListener oninvalid; - [NotEnumerable] attribute EventListener onkeydown; - [NotEnumerable] attribute EventListener onkeypress; - [NotEnumerable] attribute EventListener onkeyup; - [NotEnumerable] attribute EventListener onload; - [NotEnumerable] attribute EventListener onmousedown; - [NotEnumerable] attribute EventListener onmousemove; - [NotEnumerable] attribute EventListener onmouseout; - [NotEnumerable] attribute EventListener onmouseover; - [NotEnumerable] attribute EventListener onmouseup; - [NotEnumerable] attribute EventListener onmousewheel; - [NotEnumerable] attribute EventListener onreadystatechange; - [NotEnumerable] attribute EventListener onscroll; - [NotEnumerable] attribute EventListener onselect; - [NotEnumerable] attribute EventListener onsubmit; - - // attribute [NotEnumerable] EventListener oncanplay; - // attribute [NotEnumerable] EventListener oncanplaythrough; - // attribute [NotEnumerable] EventListener ondurationchange; - // attribute [NotEnumerable] EventListener onemptied; - // attribute [NotEnumerable] EventListener onended; - // attribute [NotEnumerable] EventListener onloadeddata; - // attribute [NotEnumerable] EventListener onloadedmetadata; - // attribute [NotEnumerable] EventListener onloadstart; - // attribute [NotEnumerable] EventListener onpause; - // attribute [NotEnumerable] EventListener onplay; - // attribute [NotEnumerable] EventListener onplaying; - // attribute [NotEnumerable] EventListener onprogress; - // attribute [NotEnumerable] EventListener onratechange; - // attribute [NotEnumerable] EventListener onseeked; - // attribute [NotEnumerable] EventListener onseeking; - // attribute [NotEnumerable] EventListener onshow; - // attribute [NotEnumerable] EventListener onstalled; - // attribute [NotEnumerable] EventListener onsuspend; - // attribute [NotEnumerable] EventListener ontimeupdate; - // attribute [NotEnumerable] EventListener onvolumechange; - // attribute [NotEnumerable] EventListener onwaiting; - - // WebKit extensions - [NotEnumerable] attribute EventListener onbeforecut; - [NotEnumerable] attribute EventListener oncut; - [NotEnumerable] attribute EventListener onbeforecopy; - [NotEnumerable] attribute EventListener oncopy; - [NotEnumerable] attribute EventListener onbeforepaste; - [NotEnumerable] attribute EventListener onpaste; - [NotEnumerable] attribute EventListener onreset; - [NotEnumerable] attribute EventListener onsearch; - [NotEnumerable] attribute EventListener onselectstart; - [NotEnumerable] attribute EventListener onselectionchange; - [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchstart; - [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchmove; - [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchend; - [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchcancel; - [NotEnumerable, Conditional=FULLSCREEN_API] attribute EventListener onwebkitfullscreenchange; - [NotEnumerable, Conditional=FULLSCREEN_API] attribute EventListener onwebkitfullscreenerror; - [NotEnumerable, Conditional=POINTER_LOCK] attribute EventListener onwebkitpointerlockchange; - [NotEnumerable, Conditional=POINTER_LOCK] attribute EventListener onwebkitpointerlockerror; -#endif - -#if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS - [ReturnNewObject, V8EnabledAtRuntime] Touch createTouch(in [Optional=DefaultIsUndefined] DOMWindow window, - in [Optional=DefaultIsUndefined] EventTarget target, - in [Optional=DefaultIsUndefined] long identifier, - in [Optional=DefaultIsUndefined] long pageX, - in [Optional=DefaultIsUndefined] long pageY, - in [Optional=DefaultIsUndefined] long screenX, - in [Optional=DefaultIsUndefined] long screenY, - in [Optional=DefaultIsUndefined] long webkitRadiusX, - in [Optional=DefaultIsUndefined] long webkitRadiusY, - in [Optional=DefaultIsUndefined] float webkitRotationAngle, - in [Optional=DefaultIsUndefined] float webkitForce) - raises (DOMException); - [ReturnNewObject, V8EnabledAtRuntime, Custom] TouchList createTouchList() - raises (DOMException); -#endif - -#if defined(LANGUAGE_CPP) && LANGUAGE_CPP - // Extra WebCore methods exposed to allow compile-time casting in C++ - boolean isHTMLDocument(); -#endif - - // Page visibility API. - [Conditional=PAGE_VISIBILITY_API] readonly attribute DOMString webkitVisibilityState; - [Conditional=PAGE_VISIBILITY_API] readonly attribute boolean webkitHidden; - - // Security Policy API: http://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#script-interfaces - [Conditional=CSP_NEXT, V8EnabledAtRuntime=experimentalContentSecurityPolicyFeatures] readonly attribute DOMSecurityPolicy securityPolicy; - -}; - diff --git a/contrib/dom/webkit/dom/DocumentFragment.idl b/contrib/dom/webkit/dom/DocumentFragment.idl deleted file mode 100644 index bcf035c..0000000 --- a/contrib/dom/webkit/dom/DocumentFragment.idl +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -interface DocumentFragment : Node { - // NodeSelector - Selector API - Element querySelector(in DOMString selectors) - raises(DOMException); - NodeList querySelectorAll(in DOMString selectors) - raises(DOMException); -}; - diff --git a/contrib/dom/webkit/dom/DocumentType.idl b/contrib/dom/webkit/dom/DocumentType.idl deleted file mode 100644 index 0dbcdb8..0000000 --- a/contrib/dom/webkit/dom/DocumentType.idl +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -[ - JSGenerateToNativeObject -] interface DocumentType : Node { - - // DOM Level 1 - - readonly attribute DOMString name; - readonly attribute NamedNodeMap entities; - readonly attribute NamedNodeMap notations; - - // DOM Level 2 - - [TreatReturnedNullStringAs=Null] readonly attribute DOMString publicId; - [TreatReturnedNullStringAs=Null] readonly attribute DOMString systemId; - [TreatReturnedNullStringAs=Null] readonly attribute DOMString internalSubset; - - // DOM 4 - void remove() - raises(DOMException); -}; - diff --git a/contrib/dom/webkit/dom/Element.idl b/contrib/dom/webkit/dom/Element.idl deleted file mode 100644 index 93a66fb..0000000 --- a/contrib/dom/webkit/dom/Element.idl +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -[ - JSGenerateToNativeObject, - JSInlineGetOwnPropertySlot, - V8CustomToJSObject -] interface Element : Node { - - // DOM Level 1 Core - - [TreatReturnedNullStringAs=Null] readonly attribute DOMString tagName; - - [TreatReturnedNullStringAs=Null] DOMString getAttribute(in [Optional=DefaultIsUndefined] DOMString name); - [ObjCLegacyUnnamedParameters] void setAttribute(in [Optional=DefaultIsUndefined] DOMString name, - in [Optional=DefaultIsUndefined] DOMString value) - raises(DOMException); - void removeAttribute(in [Optional=DefaultIsUndefined] DOMString name); - Attr getAttributeNode(in [Optional=DefaultIsUndefined] DOMString name); - Attr setAttributeNode(in [Optional=DefaultIsUndefined] Attr newAttr) - raises(DOMException); - Attr removeAttributeNode(in [Optional=DefaultIsUndefined] Attr oldAttr) - raises(DOMException); - NodeList getElementsByTagName(in [Optional=DefaultIsUndefined] DOMString name); - - // DOM Level 2 Core - - [ObjCLegacyUnnamedParameters] DOMString getAttributeNS(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI, - in [Optional=DefaultIsUndefined] DOMString localName); - [ObjCLegacyUnnamedParameters] void setAttributeNS(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI, - in [Optional=DefaultIsUndefined] DOMString qualifiedName, - in [Optional=DefaultIsUndefined] DOMString value) - raises(DOMException); - [ObjCLegacyUnnamedParameters] void removeAttributeNS(in [TreatNullAs=NullString] DOMString namespaceURI, - in DOMString localName); - [ObjCLegacyUnnamedParameters] NodeList getElementsByTagNameNS(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI, - in [Optional=DefaultIsUndefined] DOMString localName); - [ObjCLegacyUnnamedParameters] Attr getAttributeNodeNS(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI, - in [Optional=DefaultIsUndefined] DOMString localName); - Attr setAttributeNodeNS(in [Optional=DefaultIsUndefined] Attr newAttr) - raises(DOMException); - boolean hasAttribute(in DOMString name); - [ObjCLegacyUnnamedParameters] boolean hasAttributeNS(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI, - in [Optional=DefaultIsUndefined] DOMString localName); - - readonly attribute CSSStyleDeclaration style; - - // Common extensions - - readonly attribute long offsetLeft; - readonly attribute long offsetTop; - readonly attribute long offsetWidth; - readonly attribute long offsetHeight; - readonly attribute Element offsetParent; - readonly attribute long clientLeft; - readonly attribute long clientTop; - readonly attribute long clientWidth; - readonly attribute long clientHeight; - attribute long scrollLeft; - attribute long scrollTop; - readonly attribute long scrollWidth; - readonly attribute long scrollHeight; - - void focus(); - void blur(); - void scrollIntoView(in [Optional] boolean alignWithTop); - - // WebKit extensions - - void scrollIntoViewIfNeeded(in [Optional] boolean centerIfNeeded); - void scrollByLines(in [Optional=DefaultIsUndefined] long lines); - void scrollByPages(in [Optional=DefaultIsUndefined] long pages); - - // HTML 5 - NodeList getElementsByClassName(in [Optional=DefaultIsUndefined] DOMString name); - - [Reflect=class] attribute DOMString className; - readonly attribute DOMTokenList classList; - -#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT - readonly attribute DOMStringMap dataset; -#endif - - // NodeSelector - Selector API - Element querySelector(in DOMString selectors) - raises(DOMException); - NodeList querySelectorAll(in DOMString selectors) - raises(DOMException); - - // WebKit extension, pending specification. - boolean webkitMatchesSelector(in [Optional=DefaultIsUndefined] DOMString selectors) - raises(DOMException); - - // ElementTraversal API - readonly attribute Element firstElementChild; - readonly attribute Element lastElementChild; - readonly attribute Element previousElementSibling; - readonly attribute Element nextElementSibling; - readonly attribute unsigned long childElementCount; - - // ShadowAware API -#if defined(ENABLE_SHADOW_DOM) && ENABLE_SHADOW_DOM - [Reflect=pseudo, V8EnabledAtRuntime=shadowDOM, ImplementedAs=pseudo] attribute DOMString webkitPseudo; - [V8EnabledAtRuntime=shadowDOM, ImplementedAs=createShadowRoot] ShadowRoot webkitCreateShadowRoot() raises(DOMException); - [V8EnabledAtRuntime=shadowDOM, ImplementedAs=shadowRoot] readonly attribute ShadowRoot webkitShadowRoot; -#endif - - // DOM 4 - void remove() - raises(DOMException); - -#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT - // CSSOM View Module API - ClientRectList getClientRects(); - ClientRect getBoundingClientRect(); -#endif - -#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C - // Objective-C extensions - readonly attribute DOMString innerText; -#endif - -#if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API - // Mozilla version - const unsigned short ALLOW_KEYBOARD_INPUT = 1; - [V8EnabledAtRuntime] void webkitRequestFullScreen(in [Optional=DefaultIsUndefined] unsigned short flags); - - // W3C version - [V8EnabledAtRuntime] void webkitRequestFullscreen(); -#endif - - [Conditional=POINTER_LOCK] void webkitRequestPointerLock(); - - // CSS Regions API - [Conditional=CSS_REGIONS, V8EnabledAtRuntime=cssRegions] readonly attribute DOMString webkitRegionOverset; - [Conditional=CSS_REGIONS, V8EnabledAtRuntime=cssRegions] sequence<Range> webkitGetRegionFlowRanges(); - -#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C - // Event handler DOM attributes - [NotEnumerable] attribute EventListener onabort; - [NotEnumerable] attribute EventListener onblur; - [NotEnumerable] attribute EventListener onchange; - [NotEnumerable] attribute EventListener onclick; - [NotEnumerable] attribute EventListener oncontextmenu; - [NotEnumerable] attribute EventListener ondblclick; - [NotEnumerable] attribute EventListener ondrag; - [NotEnumerable] attribute EventListener ondragend; - [NotEnumerable] attribute EventListener ondragenter; - [NotEnumerable] attribute EventListener ondragleave; - [NotEnumerable] attribute EventListener ondragover; - [NotEnumerable] attribute EventListener ondragstart; - [NotEnumerable] attribute EventListener ondrop; - [NotEnumerable] attribute EventListener onerror; - [NotEnumerable] attribute EventListener onfocus; - [NotEnumerable] attribute EventListener oninput; - [NotEnumerable] attribute EventListener oninvalid; - [NotEnumerable] attribute EventListener onkeydown; - [NotEnumerable] attribute EventListener onkeypress; - [NotEnumerable] attribute EventListener onkeyup; - [NotEnumerable] attribute EventListener onload; - [NotEnumerable] attribute EventListener onmousedown; - [NotEnumerable] attribute EventListener onmousemove; - [NotEnumerable] attribute EventListener onmouseout; - [NotEnumerable] attribute EventListener onmouseover; - [NotEnumerable] attribute EventListener onmouseup; - [NotEnumerable] attribute EventListener onmousewheel; - [NotEnumerable] attribute EventListener onscroll; - [NotEnumerable] attribute EventListener onselect; - [NotEnumerable] attribute EventListener onsubmit; - - // attribute [NotEnumerable] EventListener oncanplay; - // attribute [NotEnumerable] EventListener oncanplaythrough; - // attribute [NotEnumerable] EventListener ondurationchange; - // attribute [NotEnumerable] EventListener onemptied; - // attribute [NotEnumerable] EventListener onended; - // attribute [NotEnumerable] EventListener onloadeddata; - // attribute [NotEnumerable] EventListener onloadedmetadata; - // attribute [NotEnumerable] EventListener onloadstart; - // attribute [NotEnumerable] EventListener onpause; - // attribute [NotEnumerable] EventListener onplay; - // attribute [NotEnumerable] EventListener onplaying; - // attribute [NotEnumerable] EventListener onprogress; - // attribute [NotEnumerable] EventListener onratechange; - // attribute [NotEnumerable] EventListener onreadystatechange; - // attribute [NotEnumerable] EventListener onseeked; - // attribute [NotEnumerable] EventListener onseeking; - // attribute [NotEnumerable] EventListener onshow; - // attribute [NotEnumerable] EventListener onstalled; - // attribute [NotEnumerable] EventListener onsuspend; - // attribute [NotEnumerable] EventListener ontimeupdate; - // attribute [NotEnumerable] EventListener onvolumechange; - // attribute [NotEnumerable] EventListener onwaiting; - - // WebKit extensions - [NotEnumerable] attribute EventListener onbeforecut; - [NotEnumerable] attribute EventListener oncut; - [NotEnumerable] attribute EventListener onbeforecopy; - [NotEnumerable] attribute EventListener oncopy; - [NotEnumerable] attribute EventListener onbeforepaste; - [NotEnumerable] attribute EventListener onpaste; - [NotEnumerable] attribute EventListener onreset; - [NotEnumerable] attribute EventListener onsearch; - [NotEnumerable] attribute EventListener onselectstart; - [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchstart; - [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchmove; - [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchend; - [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchcancel; - [NotEnumerable, Conditional=FULLSCREEN_API] attribute EventListener onwebkitfullscreenchange; - [NotEnumerable, Conditional=FULLSCREEN_API] attribute EventListener onwebkitfullscreenerror; -#endif -}; - diff --git a/contrib/dom/webkit/dom/Entity.idl b/contrib/dom/webkit/dom/Entity.idl deleted file mode 100644 index f6c2247..0000000 --- a/contrib/dom/webkit/dom/Entity.idl +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -interface Entity : Node { - [TreatReturnedNullStringAs=Null] readonly attribute DOMString publicId; - [TreatReturnedNullStringAs=Null] readonly attribute DOMString systemId; - [TreatReturnedNullStringAs=Null] readonly attribute DOMString notationName; -}; - diff --git a/contrib/dom/webkit/dom/EntityReference.idl b/contrib/dom/webkit/dom/EntityReference.idl deleted file mode 100644 index 363554a..0000000 --- a/contrib/dom/webkit/dom/EntityReference.idl +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -interface EntityReference : Node { -}; - diff --git a/contrib/dom/webkit/dom/ErrorEvent.idl b/contrib/dom/webkit/dom/ErrorEvent.idl deleted file mode 100644 index 433e8d9..0000000 --- a/contrib/dom/webkit/dom/ErrorEvent.idl +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2009 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - JSNoStaticTables, - ConstructorTemplate=Event -] interface ErrorEvent : Event { - [InitializedByEventConstructor] readonly attribute DOMString message; - [InitializedByEventConstructor] readonly attribute DOMString filename; - [InitializedByEventConstructor] readonly attribute unsigned long lineno; -}; - diff --git a/contrib/dom/webkit/dom/Event.idl b/contrib/dom/webkit/dom/Event.idl deleted file mode 100644 index a9af046..0000000 --- a/contrib/dom/webkit/dom/Event.idl +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2009, 2011 Apple Inc. All rights reserved. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -// Introduced in DOM Level 2: -[ - CustomToJSObject, - ConstructorTemplate=Event, - JSNoStaticTables, - ObjCPolymorphic -] interface Event { - - // DOM PhaseType - const unsigned short NONE = 0; - const unsigned short CAPTURING_PHASE = 1; - const unsigned short AT_TARGET = 2; - const unsigned short BUBBLING_PHASE = 3; - -#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C - // Reverse-engineered from Netscape - const unsigned short MOUSEDOWN = 1; - const unsigned short MOUSEUP = 2; - const unsigned short MOUSEOVER = 4; - const unsigned short MOUSEOUT = 8; - const unsigned short MOUSEMOVE = 16; - const unsigned short MOUSEDRAG = 32; - const unsigned short CLICK = 64; - const unsigned short DBLCLICK = 128; - const unsigned short KEYDOWN = 256; - const unsigned short KEYUP = 512; - const unsigned short KEYPRESS = 1024; - const unsigned short DRAGDROP = 2048; - const unsigned short FOCUS = 4096; - const unsigned short BLUR = 8192; - const unsigned short SELECT = 16384; - const unsigned short CHANGE = 32768; -#endif - - readonly attribute DOMString type; - readonly attribute EventTarget target; - readonly attribute EventTarget currentTarget; - readonly attribute unsigned short eventPhase; - [InitializedByEventConstructor] readonly attribute boolean bubbles; - [InitializedByEventConstructor] readonly attribute boolean cancelable; - readonly attribute DOMTimeStamp timeStamp; - - void stopPropagation(); - void preventDefault(); - [ObjCLegacyUnnamedParameters] void initEvent(in [Optional=DefaultIsUndefined] DOMString eventTypeArg, - in [Optional=DefaultIsUndefined] boolean canBubbleArg, - in [Optional=DefaultIsUndefined] boolean cancelableArg); - - // DOM Level 3 Additions. - readonly attribute boolean defaultPrevented; - void stopImmediatePropagation(); - - // IE Extensions - readonly attribute EventTarget srcElement; - attribute boolean returnValue; - attribute boolean cancelBubble; - -#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT - [Custom] readonly attribute Clipboard clipboardData; -#endif - -#if defined(LANGUAGE_CPP) && LANGUAGE_CPP - // Extra WebCore methods exposed to allow compile-time casting in C++ - boolean isMouseEvent(); - boolean isUIEvent(); -#endif - -}; - diff --git a/contrib/dom/webkit/dom/EventException.idl b/contrib/dom/webkit/dom/EventException.idl deleted file mode 100644 index d9438a1..0000000 --- a/contrib/dom/webkit/dom/EventException.idl +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -// Introduced in DOM Level 2: -[ - JSNoStaticTables, - DoNotCheckConstants -] exception EventException { - - readonly attribute unsigned short code; - readonly attribute DOMString name; - readonly attribute DOMString message; - -#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT - // Override in a Mozilla compatible format - [NotEnumerable] DOMString toString(); -#endif - - // EventExceptionCode - const unsigned short UNSPECIFIED_EVENT_TYPE_ERR = 0; - const unsigned short DISPATCH_REQUEST_ERR = 1; -}; - diff --git a/contrib/dom/webkit/dom/EventListener.idl b/contrib/dom/webkit/dom/EventListener.idl deleted file mode 100644 index 3786408..0000000 --- a/contrib/dom/webkit/dom/EventListener.idl +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -// Introduced in DOM Level 2: -[ - JSNoStaticTables, - ObjCProtocol, - CPPPureInterface, - OmitConstructor -] interface EventListener { - void handleEvent(in Event evt); -}; - diff --git a/contrib/dom/webkit/dom/EventTarget.idl b/contrib/dom/webkit/dom/EventTarget.idl deleted file mode 100644 index 02799a8..0000000 --- a/contrib/dom/webkit/dom/EventTarget.idl +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -// Introduced in DOM Level 2: -[ - ObjCProtocol, - CPPPureInterface, - OmitConstructor, - CustomToJSObject, - JSCustomToNativeObject, - V8NoWrapperCache -] interface EventTarget { - [ObjCLegacyUnnamedParameters] void addEventListener(in DOMString type, - in EventListener listener, - in [Optional] boolean useCapture); - [ObjCLegacyUnnamedParameters] void removeEventListener(in DOMString type, - in EventListener listener, - in [Optional] boolean useCapture); - boolean dispatchEvent(in Event event) - raises(EventException); -}; - diff --git a/contrib/dom/webkit/dom/HashChangeEvent.idl b/contrib/dom/webkit/dom/HashChangeEvent.idl deleted file mode 100644 index da8f71b..0000000 --- a/contrib/dom/webkit/dom/HashChangeEvent.idl +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2010 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -// Introduced in http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#event-hashchange -[ - ConstructorTemplate=Event -] interface HashChangeEvent : Event { - void initHashChangeEvent(in [Optional=DefaultIsUndefined] DOMString type, - in [Optional=DefaultIsUndefined] boolean canBubble, - in [Optional=DefaultIsUndefined] boolean cancelable, - in [Optional=DefaultIsUndefined] DOMString oldURL, - in [Optional=DefaultIsUndefined] DOMString newURL); - [InitializedByEventConstructor] readonly attribute DOMString oldURL; - [InitializedByEventConstructor] readonly attribute DOMString newURL; -}; - diff --git a/contrib/dom/webkit/dom/KeyboardEvent.idl b/contrib/dom/webkit/dom/KeyboardEvent.idl deleted file mode 100644 index ff56cee..0000000 --- a/contrib/dom/webkit/dom/KeyboardEvent.idl +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -// Introduced in DOM Level 3: -interface KeyboardEvent : UIEvent { - -#if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT - // KeyLocationCode - const unsigned long KEY_LOCATION_STANDARD = 0x00; - const unsigned long KEY_LOCATION_LEFT = 0x01; - const unsigned long KEY_LOCATION_RIGHT = 0x02; - const unsigned long KEY_LOCATION_NUMPAD = 0x03; -#endif - - readonly attribute DOMString keyIdentifier; - readonly attribute unsigned long keyLocation; - readonly attribute boolean ctrlKey; - readonly attribute boolean shiftKey; - readonly attribute boolean altKey; - readonly attribute boolean metaKey; - readonly attribute boolean altGraphKey; - -#if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT - boolean getModifierState(in [Optional=DefaultIsUndefined] DOMString keyIdentifierArg); -#endif - - // FIXME: this does not match the version in the DOM spec. - void initKeyboardEvent(in [Optional=DefaultIsUndefined] DOMString type, - in [Optional=DefaultIsUndefined] boolean canBubble, - in [Optional=DefaultIsUndefined] boolean cancelable, - in [Optional=DefaultIsUndefined] DOMWindow view, - in [Optional=DefaultIsUndefined] DOMString keyIdentifier, - in [Optional=DefaultIsUndefined] unsigned long keyLocation, - in [Optional=DefaultIsUndefined] boolean ctrlKey, - in [Optional=DefaultIsUndefined] boolean altKey, - in [Optional=DefaultIsUndefined] boolean shiftKey, - in [Optional=DefaultIsUndefined] boolean metaKey, - in [Optional=DefaultIsUndefined] boolean altGraphKey); - - // WebKit Extensions -#if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT - readonly attribute long keyCode; - readonly attribute long charCode; - - void initKeyboardEvent(in [Optional=DefaultIsUndefined] DOMString type, - in [Optional=DefaultIsUndefined] boolean canBubble, - in [Optional=DefaultIsUndefined] boolean cancelable, - in [Optional=DefaultIsUndefined] DOMWindow view, - in [Optional=DefaultIsUndefined] DOMString keyIdentifier, - in [Optional=DefaultIsUndefined] unsigned long keyLocation, - in [Optional=DefaultIsUndefined] boolean ctrlKey, - in [Optional=DefaultIsUndefined] boolean altKey, - in [Optional=DefaultIsUndefined] boolean shiftKey, - in [Optional=DefaultIsUndefined] boolean metaKey); -#endif - -}; - diff --git a/contrib/dom/webkit/dom/MessageChannel.idl b/contrib/dom/webkit/dom/MessageChannel.idl deleted file mode 100644 index 00649f7..0000000 --- a/contrib/dom/webkit/dom/MessageChannel.idl +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -[ - Constructor, - CallWith=ScriptExecutionContext, - V8CustomConstructor, - JSCustomMarkFunction, - JSNoStaticTables -] interface MessageChannel { - - readonly attribute MessagePort port1; - readonly attribute MessagePort port2; - -}; - diff --git a/contrib/dom/webkit/dom/MessageEvent.idl b/contrib/dom/webkit/dom/MessageEvent.idl deleted file mode 100644 index 805997c..0000000 --- a/contrib/dom/webkit/dom/MessageEvent.idl +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2007 Henry Mason <hmason@mac.com> - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -[ - JSNoStaticTables, - ConstructorTemplate=Event -] interface MessageEvent : Event { - [InitializedByEventConstructor] readonly attribute DOMString origin; - [InitializedByEventConstructor] readonly attribute DOMString lastEventId; - [InitializedByEventConstructor] readonly attribute DOMWindow source; -#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT - [InitializedByEventConstructor, CachedAttribute, CustomGetter] readonly attribute DOMObject data; - [InitializedByEventConstructor, CustomGetter] readonly attribute Array ports; - - [Custom] void initMessageEvent(in [Optional=DefaultIsUndefined] DOMString typeArg, - in [Optional=DefaultIsUndefined] boolean canBubbleArg, - in [Optional=DefaultIsUndefined] boolean cancelableArg, - in [Optional=DefaultIsUndefined] DOMObject dataArg, - in [Optional=DefaultIsUndefined] DOMString originArg, - in [Optional=DefaultIsUndefined] DOMString lastEventIdArg, - in [Optional=DefaultIsUndefined] DOMWindow sourceArg, - in [Optional=DefaultIsUndefined] Array messagePorts); - - [Custom] void webkitInitMessageEvent(in [Optional=DefaultIsUndefined] DOMString typeArg, - in [Optional=DefaultIsUndefined] boolean canBubbleArg, - in [Optional=DefaultIsUndefined] boolean cancelableArg, - in [Optional=DefaultIsUndefined] DOMObject dataArg, - in [Optional=DefaultIsUndefined] DOMString originArg, - in [Optional=DefaultIsUndefined] DOMString lastEventIdArg, - in [Optional=DefaultIsUndefined] DOMWindow sourceArg, - in [Optional=DefaultIsUndefined] Array transferables); -#else - // Code generator for ObjC bindings does not support custom bindings, thus there is no good way to - // return a variant value. As workaround, expose the data attribute as SerializedScriptValue. - readonly attribute SerializedScriptValue data; - - // There's no good way to expose an array via the ObjC bindings, so for now just expose a single port. - readonly attribute MessagePort messagePort; - - void initMessageEvent(in [Optional=DefaultIsUndefined] DOMString typeArg, - in [Optional=DefaultIsUndefined] boolean canBubbleArg, - in [Optional=DefaultIsUndefined] boolean cancelableArg, - in [Optional=DefaultIsUndefined] SerializedScriptValue dataArg, - in [Optional=DefaultIsUndefined] DOMString originArg, - in [Optional=DefaultIsUndefined] DOMString lastEventIdArg, - in [Optional=DefaultIsUndefined] DOMWindow sourceArg, - in [Optional=DefaultIsUndefined] MessagePort messagePort); -#endif - -}; - diff --git a/contrib/dom/webkit/dom/MessagePort.idl b/contrib/dom/webkit/dom/MessagePort.idl deleted file mode 100644 index bbd48c0..0000000 --- a/contrib/dom/webkit/dom/MessagePort.idl +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All Rights Reserved. - * Copyright (C) 2011 Google Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -[ - JSCustomMarkFunction, - JSGenerateIsReachable=Impl, - ActiveDOMObject, - EventTarget, - JSNoStaticTables -] interface MessagePort { -// We need to have something as an ObjC binding, because MessagePort is used in MessageEvent, which already has one, -// but we don't want to actually expose the API while it is in flux. -#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT - [Custom] void postMessage(in any message, in [Optional] Array messagePorts) - raises(DOMException); - - void start(); - void close(); - - // event handler attributes - attribute EventListener onmessage; - - // EventTarget interface - void addEventListener(in DOMString type, - in EventListener listener, - in [Optional] boolean useCapture); - void removeEventListener(in DOMString type, - in EventListener listener, - in [Optional] boolean useCapture); - boolean dispatchEvent(in Event evt) - raises(EventException); -#endif -}; - diff --git a/contrib/dom/webkit/dom/MouseEvent.idl b/contrib/dom/webkit/dom/MouseEvent.idl deleted file mode 100644 index c0e2f01..0000000 --- a/contrib/dom/webkit/dom/MouseEvent.idl +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -// Introduced in DOM Level 2: -interface MouseEvent : UIEvent { - readonly attribute long screenX; - readonly attribute long screenY; - readonly attribute long clientX; - readonly attribute long clientY; - [Conditional=POINTER_LOCK] readonly attribute long webkitMovementX; - [Conditional=POINTER_LOCK] readonly attribute long webkitMovementY; - readonly attribute boolean ctrlKey; - readonly attribute boolean shiftKey; - readonly attribute boolean altKey; - readonly attribute boolean metaKey; - readonly attribute unsigned short button; - readonly attribute EventTarget relatedTarget; - - [ObjCLegacyUnnamedParameters] void initMouseEvent(in [Optional=DefaultIsUndefined] DOMString type, - in [Optional=DefaultIsUndefined] boolean canBubble, - in [Optional=DefaultIsUndefined] boolean cancelable, - in [Optional=DefaultIsUndefined] DOMWindow view, - in [Optional=DefaultIsUndefined] long detail, - in [Optional=DefaultIsUndefined] long screenX, - in [Optional=DefaultIsUndefined] long screenY, - in [Optional=DefaultIsUndefined] long clientX, - in [Optional=DefaultIsUndefined] long clientY, - in [Optional=DefaultIsUndefined] boolean ctrlKey, - in [Optional=DefaultIsUndefined] boolean altKey, - in [Optional=DefaultIsUndefined] boolean shiftKey, - in [Optional=DefaultIsUndefined] boolean metaKey, - in [Optional=DefaultIsUndefined] unsigned short button, - in [Optional=DefaultIsUndefined] EventTarget relatedTarget); - - // extensions - readonly attribute long offsetX; - readonly attribute long offsetY; - readonly attribute long x; - readonly attribute long y; - readonly attribute Node fromElement; - readonly attribute Node toElement; - -#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT - readonly attribute Clipboard dataTransfer; -#endif -}; - diff --git a/contrib/dom/webkit/dom/MutationCallback.idl b/contrib/dom/webkit/dom/MutationCallback.idl deleted file mode 100644 index 9c76e18..0000000 --- a/contrib/dom/webkit/dom/MutationCallback.idl +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - Conditional=MUTATION_OBSERVERS, - Callback -] interface MutationCallback { - [Custom] boolean handleEvent(in MutationRecordArray mutations, in MutationObserver observer); -}; diff --git a/contrib/dom/webkit/dom/MutationEvent.idl b/contrib/dom/webkit/dom/MutationEvent.idl deleted file mode 100644 index 0550cba..0000000 --- a/contrib/dom/webkit/dom/MutationEvent.idl +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -// Introduced in DOM Level 2: -interface MutationEvent : Event { - - // attrChangeType - const unsigned short MODIFICATION = 1; - const unsigned short ADDITION = 2; - const unsigned short REMOVAL = 3; - - readonly attribute Node relatedNode; - readonly attribute DOMString prevValue; - readonly attribute DOMString newValue; - readonly attribute DOMString attrName; - readonly attribute unsigned short attrChange; - - [ObjCLegacyUnnamedParameters] void initMutationEvent(in [Optional=DefaultIsUndefined] DOMString type, - in [Optional=DefaultIsUndefined] boolean canBubble, - in [Optional=DefaultIsUndefined] boolean cancelable, - in [Optional=DefaultIsUndefined] Node relatedNode, - in [Optional=DefaultIsUndefined] DOMString prevValue, - in [Optional=DefaultIsUndefined] DOMString newValue, - in [Optional=DefaultIsUndefined] DOMString attrName, - in [Optional=DefaultIsUndefined] unsigned short attrChange); - -}; - diff --git a/contrib/dom/webkit/dom/MutationObserver.idl b/contrib/dom/webkit/dom/MutationObserver.idl deleted file mode 100644 index cd400bb..0000000 --- a/contrib/dom/webkit/dom/MutationObserver.idl +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - Conditional=MUTATION_OBSERVERS, - CustomConstructor, - ConstructorParameters=1, - JSCustomIsReachable -] interface MutationObserver { - void observe(in Node target, in Dictionary options) - raises(DOMException); - sequence<MutationRecord> takeRecords(); - void disconnect(); -}; diff --git a/contrib/dom/webkit/dom/MutationRecord.idl b/contrib/dom/webkit/dom/MutationRecord.idl deleted file mode 100644 index c19618d..0000000 --- a/contrib/dom/webkit/dom/MutationRecord.idl +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - Conditional=MUTATION_OBSERVERS -] interface MutationRecord { - readonly attribute DOMString type; - readonly attribute Node target; - - readonly attribute NodeList addedNodes; - readonly attribute NodeList removedNodes; - readonly attribute Node previousSibling; - readonly attribute Node nextSibling; - - [TreatReturnedNullStringAs=Null] readonly attribute DOMString attributeName; - [TreatReturnedNullStringAs=Null] readonly attribute DOMString attributeNamespace; - - [TreatReturnedNullStringAs=Null] readonly attribute DOMString oldValue; -}; diff --git a/contrib/dom/webkit/dom/NamedNodeMap.idl b/contrib/dom/webkit/dom/NamedNodeMap.idl deleted file mode 100644 index e1791da..0000000 --- a/contrib/dom/webkit/dom/NamedNodeMap.idl +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -[ - GenerateIsReachable=ImplElementRoot, - IndexedGetter, - JSCustomMarkFunction, - NamedGetter -] interface NamedNodeMap { - - Node getNamedItem(in [Optional=DefaultIsUndefined] DOMString name); - - Node setNamedItem(in [Optional=DefaultIsUndefined] Node node) - raises(DOMException); - - Node removeNamedItem(in [Optional=DefaultIsUndefined] DOMString name) - raises(DOMException); - - Node item(in [Optional=DefaultIsUndefined] unsigned long index); - - readonly attribute unsigned long length; - - - // Introduced in DOM Level 2: - - [ObjCLegacyUnnamedParameters] Node getNamedItemNS(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI, - in [Optional=DefaultIsUndefined] DOMString localName) - // FIXME: the implementation does take an exceptioncode parameter. - /*raises(DOMException)*/; - - Node setNamedItemNS(in [Optional=DefaultIsUndefined] Node node) - raises(DOMException); - - [ObjCLegacyUnnamedParameters] Node removeNamedItemNS(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI, - in [Optional=DefaultIsUndefined] DOMString localName) - raises(DOMException); - -}; - diff --git a/contrib/dom/webkit/dom/Node.idl b/contrib/dom/webkit/dom/Node.idl deleted file mode 100644 index 3752641..0000000 --- a/contrib/dom/webkit/dom/Node.idl +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -[ - JSCustomHeader, - JSCustomMarkFunction, - JSCustomPushEventHandlerScope, - JSCustomIsReachable, - JSCustomFinalize, - CustomToJSObject, - EventTarget, - JSGenerateToNativeObject, - JSInlineGetOwnPropertySlot, - ObjCPolymorphic, - V8DependentLifetime -] interface Node -#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C - : Object, EventTarget -#endif /* defined(LANGUAGE_OBJECTIVE_C) */ - { - // NodeType - const unsigned short ELEMENT_NODE = 1; - const unsigned short ATTRIBUTE_NODE = 2; - const unsigned short TEXT_NODE = 3; - const unsigned short CDATA_SECTION_NODE = 4; - const unsigned short ENTITY_REFERENCE_NODE = 5; - const unsigned short ENTITY_NODE = 6; - const unsigned short PROCESSING_INSTRUCTION_NODE = 7; - const unsigned short COMMENT_NODE = 8; - const unsigned short DOCUMENT_NODE = 9; - const unsigned short DOCUMENT_TYPE_NODE = 10; - const unsigned short DOCUMENT_FRAGMENT_NODE = 11; - const unsigned short NOTATION_NODE = 12; - - readonly attribute [TreatReturnedNullStringAs=Null] DOMString nodeName; - - // FIXME: the spec says this can also raise on retrieval. - attribute [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] DOMString nodeValue - setter raises(DOMException); - - readonly attribute unsigned short nodeType; - readonly attribute Node parentNode; - readonly attribute NodeList childNodes; - readonly attribute Node firstChild; - readonly attribute Node lastChild; - readonly attribute Node previousSibling; - readonly attribute Node nextSibling; - readonly attribute NamedNodeMap attributes; - readonly attribute Document ownerDocument; - - [ObjCLegacyUnnamedParameters, Custom] Node insertBefore(in [CustomReturn] Node newChild, - in Node refChild) - raises(DOMException); - [ObjCLegacyUnnamedParameters, Custom] Node replaceChild(in Node newChild, - in [CustomReturn] Node oldChild) - raises(DOMException); - [Custom] Node removeChild(in [CustomReturn] Node oldChild) - raises(DOMException); - [Custom] Node appendChild(in [CustomReturn] Node newChild) - raises(DOMException); - - boolean hasChildNodes(); - Node cloneNode(in [Optional=DefaultIsUndefined] boolean deep); - void normalize(); - - // Introduced in DOM Level 2: - - [ObjCLegacyUnnamedParameters] boolean isSupported(in [Optional=DefaultIsUndefined] DOMString feature, - in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString version); - - readonly attribute [TreatReturnedNullStringAs=Null] DOMString namespaceURI; - attribute [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] DOMString prefix - setter raises(DOMException); - readonly attribute [TreatReturnedNullStringAs=Null] DOMString localName; - - boolean hasAttributes(); - - // Introduced in DOM Level 3: - - readonly attribute [TreatReturnedNullStringAs=Null] DOMString baseURI; - - // FIXME: the spec says this can also raise on retrieval. - attribute [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] DOMString textContent - setter raises(DOMException); - - boolean isSameNode(in [Optional=DefaultIsUndefined] Node other); - boolean isEqualNode(in [Optional=DefaultIsUndefined] Node other); - [TreatReturnedNullStringAs=Null] DOMString lookupPrefix(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI); - boolean isDefaultNamespace(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI); - [TreatReturnedNullStringAs=Null] DOMString lookupNamespaceURI(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString prefix); - - // DocumentPosition - const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01; - const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02; - const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04; - const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08; - const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10; - const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; - - unsigned short compareDocumentPosition(in [Optional=DefaultIsUndefined] Node other); - - // Introduced in DOM4 - boolean contains(in [Optional=DefaultIsUndefined] Node other); - - // IE extensions - readonly attribute Element parentElement; - -#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C - // Objective-C extensions - readonly attribute boolean isContentEditable; - - void inspect(); -#endif /* defined(LANGUAGE_OBJECTIVE_C) */ - -#if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP -#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C - void addEventListener(in DOMString type, - in EventListener listener, - in [Optional] boolean useCapture); - void removeEventListener(in DOMString type, - in EventListener listener, - in [Optional] boolean useCapture); - boolean dispatchEvent(in Event event) - raises(EventException); -#endif -#endif - -#if defined(LANGUAGE_CPP) && LANGUAGE_CPP - [Custom] void addEventListener(in DOMString type, - in EventListener listener, - in boolean useCapture); - [Custom] void removeEventListener(in DOMString type, - in EventListener listener, - in boolean useCapture); - boolean dispatchEvent(in Event event) - raises(EventException); -#endif - -}; - diff --git a/contrib/dom/webkit/dom/NodeFilter.idl b/contrib/dom/webkit/dom/NodeFilter.idl deleted file mode 100644 index abd5ce4..0000000 --- a/contrib/dom/webkit/dom/NodeFilter.idl +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -// Introduced in DOM Level 2: -[ - JSCustomMarkFunction, - JSCustomToNativeObject, - ObjCProtocol, - CPPPureInterface -] interface NodeFilter { - // Constants returned by acceptNode - const short FILTER_ACCEPT = 1; - const short FILTER_REJECT = 2; - const short FILTER_SKIP = 3; - - // Constants for whatToShow - const unsigned long SHOW_ALL = 0xFFFFFFFF; - const unsigned long SHOW_ELEMENT = 0x00000001; - const unsigned long SHOW_ATTRIBUTE = 0x00000002; - const unsigned long SHOW_TEXT = 0x00000004; - const unsigned long SHOW_CDATA_SECTION = 0x00000008; - const unsigned long SHOW_ENTITY_REFERENCE = 0x00000010; - const unsigned long SHOW_ENTITY = 0x00000020; - const unsigned long SHOW_PROCESSING_INSTRUCTION = 0x00000040; - const unsigned long SHOW_COMMENT = 0x00000080; - const unsigned long SHOW_DOCUMENT = 0x00000100; - const unsigned long SHOW_DOCUMENT_TYPE = 0x00000200; - const unsigned long SHOW_DOCUMENT_FRAGMENT = 0x00000400; - const unsigned long SHOW_NOTATION = 0x00000800; - - [CallWith=ScriptState] short acceptNode(in [Optional=DefaultIsUndefined] Node n); - -}; - diff --git a/contrib/dom/webkit/dom/NodeIterator.idl b/contrib/dom/webkit/dom/NodeIterator.idl deleted file mode 100644 index b360d05..0000000 --- a/contrib/dom/webkit/dom/NodeIterator.idl +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -// Introduced in DOM Level 2: -[ - JSCustomMarkFunction -] interface NodeIterator { - readonly attribute Node root; - readonly attribute unsigned long whatToShow; - readonly attribute NodeFilter filter; - readonly attribute boolean expandEntityReferences; - readonly attribute Node referenceNode; - readonly attribute boolean pointerBeforeReferenceNode; - - [CallWith=ScriptState] Node nextNode() - raises (DOMException); - [CallWith=ScriptState] Node previousNode() - raises (DOMException); - void detach(); -}; - diff --git a/contrib/dom/webkit/dom/NodeList.idl b/contrib/dom/webkit/dom/NodeList.idl deleted file mode 100644 index b69ed4d..0000000 --- a/contrib/dom/webkit/dom/NodeList.idl +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * Copyright (C) 2007 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -[ - CustomIsReachable, - IndexedGetter, - NamedGetter, - V8DependentLifetime -] interface NodeList { - - Node item(in [IsIndex,Optional=DefaultIsUndefined] unsigned long index); - - readonly attribute unsigned long length; - -}; - diff --git a/contrib/dom/webkit/dom/Notation.idl b/contrib/dom/webkit/dom/Notation.idl deleted file mode 100644 index 4ac628f..0000000 --- a/contrib/dom/webkit/dom/Notation.idl +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -interface Notation : Node { - [TreatReturnedNullStringAs=Null] readonly attribute DOMString publicId; - [TreatReturnedNullStringAs=Null] readonly attribute DOMString systemId; -}; - diff --git a/contrib/dom/webkit/dom/OverflowEvent.idl b/contrib/dom/webkit/dom/OverflowEvent.idl deleted file mode 100644 index cc52f3d..0000000 --- a/contrib/dom/webkit/dom/OverflowEvent.idl +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - ConstructorTemplate=Event -] interface OverflowEvent : Event { - const unsigned short HORIZONTAL = 0; - const unsigned short VERTICAL = 1; - const unsigned short BOTH = 2; - - [InitializedByEventConstructor] readonly attribute unsigned short orient; - [InitializedByEventConstructor] readonly attribute boolean horizontalOverflow; - [InitializedByEventConstructor] readonly attribute boolean verticalOverflow; - -#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C - void initOverflowEvent(in [Optional=DefaultIsUndefined] unsigned short orient, - in [Optional=DefaultIsUndefined] boolean horizontalOverflow, - in [Optional=DefaultIsUndefined] boolean verticalOverflow); -#endif -}; - diff --git a/contrib/dom/webkit/dom/PageTransitionEvent.idl b/contrib/dom/webkit/dom/PageTransitionEvent.idl deleted file mode 100644 index c8cea7f..0000000 --- a/contrib/dom/webkit/dom/PageTransitionEvent.idl +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2009 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - ConstructorTemplate=Event -] interface PageTransitionEvent : Event { - [InitializedByEventConstructor] readonly attribute boolean persisted; -}; - diff --git a/contrib/dom/webkit/dom/PopStateEvent.idl b/contrib/dom/webkit/dom/PopStateEvent.idl deleted file mode 100644 index 09dc786..0000000 --- a/contrib/dom/webkit/dom/PopStateEvent.idl +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2009 Apple Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP -[ - ConstructorTemplate=Event -] interface PopStateEvent : Event { - [InitializedByEventConstructor, CachedAttribute, CustomGetter] readonly attribute DOMObject state; -}; -#endif - diff --git a/contrib/dom/webkit/dom/ProcessingInstruction.idl b/contrib/dom/webkit/dom/ProcessingInstruction.idl deleted file mode 100644 index 55599de..0000000 --- a/contrib/dom/webkit/dom/ProcessingInstruction.idl +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -interface ProcessingInstruction : Node { - - // DOM Level 1 - - [TreatReturnedNullStringAs=Null] readonly attribute DOMString target; - [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString data - setter raises(DOMException); - - // interface LinkStyle from DOM Level 2 Style Sheets - readonly attribute StyleSheet sheet; -}; - diff --git a/contrib/dom/webkit/dom/ProgressEvent.idl b/contrib/dom/webkit/dom/ProgressEvent.idl deleted file mode 100644 index ae25a95..0000000 --- a/contrib/dom/webkit/dom/ProgressEvent.idl +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - ConstructorTemplate=Event, - JSNoStaticTables -] interface ProgressEvent : Event { - [InitializedByEventConstructor] readonly attribute boolean lengthComputable; - [InitializedByEventConstructor] readonly attribute unsigned long long loaded; - [InitializedByEventConstructor] readonly attribute unsigned long long total; -}; - diff --git a/contrib/dom/webkit/dom/PropertyNodeList.idl b/contrib/dom/webkit/dom/PropertyNodeList.idl deleted file mode 100644 index 5b2b484..0000000 --- a/contrib/dom/webkit/dom/PropertyNodeList.idl +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2012 Motorola Mobility, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation and/or - * other materials provided with the distribution. - * - * Neither the name of Motorola Mobility, Inc. nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - Conditional=MICRODATA, - IndexedGetter, - JSGenerateToJSObject -] interface PropertyNodeList : NodeList { - - sequence<MicroDataItemValue> getValues(); - Node item(in unsigned long index); - - readonly attribute unsigned long length; -}; diff --git a/contrib/dom/webkit/dom/Range.idl b/contrib/dom/webkit/dom/Range.idl deleted file mode 100644 index 05c6e2a..0000000 --- a/contrib/dom/webkit/dom/Range.idl +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -// Introduced in DOM Level 2: -interface Range { - - readonly attribute Node startContainer - getter raises(DOMException); - readonly attribute long startOffset - getter raises(DOMException); - readonly attribute Node endContainer - getter raises(DOMException); - readonly attribute long endOffset - getter raises(DOMException); - readonly attribute boolean collapsed - getter raises(DOMException); - readonly attribute Node commonAncestorContainer - getter raises(DOMException); - - [ObjCLegacyUnnamedParameters] void setStart(in [Optional=DefaultIsUndefined] Node refNode, - in [Optional=DefaultIsUndefined] long offset) - raises(RangeException, DOMException); - [ObjCLegacyUnnamedParameters] void setEnd(in [Optional=DefaultIsUndefined] Node refNode, - in [Optional=DefaultIsUndefined] long offset) - raises(RangeException, DOMException); - void setStartBefore(in [Optional=DefaultIsUndefined] Node refNode) - raises(RangeException, DOMException); - void setStartAfter(in [Optional=DefaultIsUndefined] Node refNode) - raises(RangeException, DOMException); - void setEndBefore(in [Optional=DefaultIsUndefined] Node refNode) - raises(RangeException, DOMException); - void setEndAfter(in [Optional=DefaultIsUndefined] Node refNode) - raises(RangeException, DOMException); - void collapse(in [Optional=DefaultIsUndefined] boolean toStart) - raises(DOMException); - void selectNode(in [Optional=DefaultIsUndefined] Node refNode) - raises(RangeException, DOMException); - void selectNodeContents(in [Optional=DefaultIsUndefined] Node refNode) - raises(RangeException, DOMException); - - // CompareHow - const unsigned short START_TO_START = 0; - const unsigned short START_TO_END = 1; - const unsigned short END_TO_END = 2; - const unsigned short END_TO_START = 3; - - [ObjCLegacyUnnamedParameters] short compareBoundaryPoints(in [Optional=DefaultIsUndefined] CompareHow how, - in [Optional=DefaultIsUndefined] Range sourceRange) - raises(DOMException); - - void deleteContents() - raises(DOMException); - DocumentFragment extractContents() - raises(DOMException); - DocumentFragment cloneContents() - raises(DOMException); - void insertNode(in [Optional=DefaultIsUndefined] Node newNode) - raises(DOMException, RangeException); - void surroundContents(in [Optional=DefaultIsUndefined] Node newParent) - raises(DOMException, RangeException); - Range cloneRange() - raises(DOMException); - DOMString toString() - raises(DOMException); - - void detach() - raises(DOMException); - -#if defined(LANGUAGE_JAVASCRIPT) || LANGUAGE_JAVASCRIPT - // CSSOM View Module API extensions - - ClientRectList getClientRects(); - ClientRect getBoundingClientRect(); -#endif - - // extensions - - DocumentFragment createContextualFragment(in [Optional=DefaultIsUndefined] DOMString html) - raises(DOMException); - - // WebKit extensions - - boolean intersectsNode(in [Optional=DefaultIsUndefined] Node refNode) - raises(RangeException, DOMException); - - short compareNode(in [Optional=DefaultIsUndefined] Node refNode) - raises(RangeException, DOMException); - - // CompareResults - const unsigned short NODE_BEFORE = 0; - const unsigned short NODE_AFTER = 1; - const unsigned short NODE_BEFORE_AND_AFTER = 2; - const unsigned short NODE_INSIDE = 3; - - short comparePoint(in [Optional=DefaultIsUndefined] Node refNode, - in [Optional=DefaultIsUndefined] long offset) - raises(RangeException, DOMException); - - boolean isPointInRange(in [Optional=DefaultIsUndefined] Node refNode, - in [Optional=DefaultIsUndefined] long offset) - raises(RangeException, DOMException); - - void expand(in [Optional=DefaultIsUndefined] DOMString unit) - raises(RangeException, DOMException); - -#if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT - readonly attribute DOMString text; -#endif -}; - diff --git a/contrib/dom/webkit/dom/RangeException.idl b/contrib/dom/webkit/dom/RangeException.idl deleted file mode 100644 index df92b42..0000000 --- a/contrib/dom/webkit/dom/RangeException.idl +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -[ - DoNotCheckConstants -] exception RangeException { - - readonly attribute unsigned short code; - readonly attribute DOMString name; - readonly attribute DOMString message; - -#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT - [NotEnumerable] DOMString toString(); -#endif - - // DOM Level 2 - - const unsigned short BAD_BOUNDARYPOINTS_ERR = 1; - const unsigned short INVALID_NODE_TYPE_ERR = 2; -}; - diff --git a/contrib/dom/webkit/dom/RequestAnimationFrameCallback.idl b/contrib/dom/webkit/dom/RequestAnimationFrameCallback.idl deleted file mode 100644 index b4347cf..0000000 --- a/contrib/dom/webkit/dom/RequestAnimationFrameCallback.idl +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - Callback, - Conditional=REQUEST_ANIMATION_FRAME, -] interface RequestAnimationFrameCallback{ - // highResTime is passed as high resolution timestamp, see - // http://www.w3.org/TR/hr-time/ for details. -#if defined(V8_BINDING) && V8_BINDING - boolean handleEvent(in double highResTime); -#else - [Custom] boolean handleEvent(in double highResTime); -#endif - -}; diff --git a/contrib/dom/webkit/dom/ShadowRoot.idl b/contrib/dom/webkit/dom/ShadowRoot.idl deleted file mode 100644 index a39ca92..0000000 --- a/contrib/dom/webkit/dom/ShadowRoot.idl +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - Conditional=SHADOW_DOM, - JSGenerateToJSObject -] interface ShadowRoot : DocumentFragment { - readonly attribute Element activeElement; - attribute boolean applyAuthorStyles; - attribute boolean resetStyleInheritance; - - [TreatNullAs=NullString] attribute DOMString innerHTML - setter raises(DOMException); - -#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT - Node cloneNode(in [Optional=DefaultIsUndefined] boolean deep) raises(DOMException); -#endif - DOMSelection getSelection(); - Element getElementById(in [Optional=DefaultIsUndefined] DOMString elementId); - NodeList getElementsByClassName(in [Optional=DefaultIsUndefined] DOMString className); - NodeList getElementsByTagName(in [Optional=DefaultIsUndefined] DOMString tagName); - NodeList getElementsByTagNameNS(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI, - in [Optional=DefaultIsUndefined] DOMString localName); - - Element elementFromPoint(in [Optional=DefaultIsUndefined] long x, - in [Optional=DefaultIsUndefined] long y); -}; diff --git a/contrib/dom/webkit/dom/StringCallback.idl b/contrib/dom/webkit/dom/StringCallback.idl deleted file mode 100644 index a26831b..0000000 --- a/contrib/dom/webkit/dom/StringCallback.idl +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - Callback -] interface StringCallback { - boolean handleEvent(in DOMString data); -}; diff --git a/contrib/dom/webkit/dom/Text.idl b/contrib/dom/webkit/dom/Text.idl deleted file mode 100644 index da243fc..0000000 --- a/contrib/dom/webkit/dom/Text.idl +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -interface Text : CharacterData { - - // DOM Level 1 - - Text splitText(in [IsIndex,Optional=DefaultIsUndefined] unsigned long offset) - raises (DOMException); - - // Introduced in DOM Level 3: - readonly attribute DOMString wholeText; - Text replaceWholeText(in [Optional=DefaultIsUndefined] DOMString content) - raises(DOMException); -}; - diff --git a/contrib/dom/webkit/dom/TextEvent.idl b/contrib/dom/webkit/dom/TextEvent.idl deleted file mode 100644 index 709500a..0000000 --- a/contrib/dom/webkit/dom/TextEvent.idl +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -// Introduced in DOM Level 3: -interface TextEvent : UIEvent { - - readonly attribute DOMString data; - - void initTextEvent(in [Optional=DefaultIsUndefined] DOMString typeArg, - in [Optional=DefaultIsUndefined] boolean canBubbleArg, - in [Optional=DefaultIsUndefined] boolean cancelableArg, - in [Optional=DefaultIsUndefined] DOMWindow viewArg, - in [Optional=DefaultIsUndefined] DOMString dataArg); - -}; - diff --git a/contrib/dom/webkit/dom/Touch.idl b/contrib/dom/webkit/dom/Touch.idl deleted file mode 100644 index 3a50e07..0000000 --- a/contrib/dom/webkit/dom/Touch.idl +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2008, The Android Open Source Project - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - Conditional=TOUCH_EVENTS -] interface Touch { - readonly attribute long clientX; - readonly attribute long clientY; - readonly attribute long screenX; - readonly attribute long screenY; - readonly attribute long pageX; - readonly attribute long pageY; - readonly attribute EventTarget target; - readonly attribute unsigned long identifier; - readonly attribute long webkitRadiusX; - readonly attribute long webkitRadiusY; - readonly attribute float webkitRotationAngle; - readonly attribute float webkitForce; -}; diff --git a/contrib/dom/webkit/dom/TouchEvent.idl b/contrib/dom/webkit/dom/TouchEvent.idl deleted file mode 100644 index 4712f9e..0000000 --- a/contrib/dom/webkit/dom/TouchEvent.idl +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2008, The Android Open Source Project - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - Conditional=TOUCH_EVENTS -] interface TouchEvent : UIEvent { - readonly attribute TouchList touches; - readonly attribute TouchList targetTouches; - readonly attribute TouchList changedTouches; - readonly attribute boolean ctrlKey; - readonly attribute boolean shiftKey; - readonly attribute boolean altKey; - readonly attribute boolean metaKey; - - void initTouchEvent(in [Optional=DefaultIsUndefined] TouchList touches, - in [Optional=DefaultIsUndefined] TouchList targetTouches, - in [Optional=DefaultIsUndefined] TouchList changedTouches, - in [Optional=DefaultIsUndefined] DOMString type, - in [Optional=DefaultIsUndefined] DOMWindow view, - in [Optional=DefaultIsUndefined] long screenX, - in [Optional=DefaultIsUndefined] long screenY, - in [Optional=DefaultIsUndefined] long clientX, - in [Optional=DefaultIsUndefined] long clientY, - in [Optional=DefaultIsUndefined] boolean ctrlKey, - in [Optional=DefaultIsUndefined] boolean altKey, - in [Optional=DefaultIsUndefined] boolean shiftKey, - in [Optional=DefaultIsUndefined] boolean metaKey); -}; diff --git a/contrib/dom/webkit/dom/TouchList.idl b/contrib/dom/webkit/dom/TouchList.idl deleted file mode 100644 index f66c6cc..0000000 --- a/contrib/dom/webkit/dom/TouchList.idl +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2008, The Android Open Source Project - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - Conditional=TOUCH_EVENTS, - IndexedGetter -] interface TouchList { - readonly attribute unsigned long length; - - Touch item(in unsigned long index); -}; diff --git a/contrib/dom/webkit/dom/TreeWalker.idl b/contrib/dom/webkit/dom/TreeWalker.idl deleted file mode 100644 index 52cf98f..0000000 --- a/contrib/dom/webkit/dom/TreeWalker.idl +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -// Introduced in DOM Level 2: -[ - JSCustomMarkFunction -] interface TreeWalker { - readonly attribute Node root; - readonly attribute unsigned long whatToShow; - readonly attribute NodeFilter filter; - readonly attribute boolean expandEntityReferences; - attribute Node currentNode - setter raises(DOMException); - - [CallWith=ScriptState] Node parentNode(); - [CallWith=ScriptState] Node firstChild(); - [CallWith=ScriptState] Node lastChild(); - [CallWith=ScriptState] Node previousSibling(); - [CallWith=ScriptState] Node nextSibling(); - [CallWith=ScriptState] Node previousNode(); - [CallWith=ScriptState] Node nextNode(); -}; - diff --git a/contrib/dom/webkit/dom/UIEvent.idl b/contrib/dom/webkit/dom/UIEvent.idl deleted file mode 100644 index 23a62de..0000000 --- a/contrib/dom/webkit/dom/UIEvent.idl +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -// Introduced in DOM Level 2: -interface UIEvent : Event { - readonly attribute DOMWindow view; - readonly attribute long detail; - - [ObjCLegacyUnnamedParameters] void initUIEvent(in [Optional=DefaultIsUndefined] DOMString type, - in [Optional=DefaultIsUndefined] boolean canBubble, - in [Optional=DefaultIsUndefined] boolean cancelable, - in [Optional=DefaultIsUndefined] DOMWindow view, - in [Optional=DefaultIsUndefined] long detail); - - // extensions - readonly attribute long keyCode; - readonly attribute long charCode; - readonly attribute long layerX; - readonly attribute long layerY; - readonly attribute long pageX; - readonly attribute long pageY; - readonly attribute long which; -}; - diff --git a/contrib/dom/webkit/dom/WebKitAnimationEvent.idl b/contrib/dom/webkit/dom/WebKitAnimationEvent.idl deleted file mode 100644 index 6f1844b..0000000 --- a/contrib/dom/webkit/dom/WebKitAnimationEvent.idl +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - ConstructorTemplate=Event -] interface WebKitAnimationEvent : Event { - [InitializedByEventConstructor] readonly attribute DOMString animationName; - [InitializedByEventConstructor] readonly attribute double elapsedTime; -}; - diff --git a/contrib/dom/webkit/dom/WebKitNamedFlow.idl b/contrib/dom/webkit/dom/WebKitNamedFlow.idl deleted file mode 100644 index 11ee4ad..0000000 --- a/contrib/dom/webkit/dom/WebKitNamedFlow.idl +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -[ - EventTarget, - JSGenerateToJSObject, - GenerateIsReachable=ImplOwnerNodeRoot -] interface WebKitNamedFlow { - readonly attribute DOMString name; - readonly attribute boolean overset; - readonly attribute long firstEmptyRegionIndex; - NodeList getRegionsByContent(in Node contentNode); - NodeList getRegions(); - NodeList getContent(); - - // EventTarget interface - void addEventListener(in DOMString type, - in EventListener listener, - in [Optional] boolean useCapture); - void removeEventListener(in DOMString type, - in EventListener listener, - in [Optional] boolean useCapture); - boolean dispatchEvent(in Event event) - raises(EventException); -}; diff --git a/contrib/dom/webkit/dom/WebKitTransitionEvent.idl b/contrib/dom/webkit/dom/WebKitTransitionEvent.idl deleted file mode 100644 index 218ccab..0000000 --- a/contrib/dom/webkit/dom/WebKitTransitionEvent.idl +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - ConstructorTemplate=Event -] interface WebKitTransitionEvent : Event { - [InitializedByEventConstructor] readonly attribute DOMString propertyName; - [InitializedByEventConstructor] readonly attribute double elapsedTime; -}; - diff --git a/contrib/dom/webkit/dom/WheelEvent.idl b/contrib/dom/webkit/dom/WheelEvent.idl deleted file mode 100644 index 1b4ed6f..0000000 --- a/contrib/dom/webkit/dom/WheelEvent.idl +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2010 Apple Inc. All rights reserved. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -// Based off http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-wheelevents -interface WheelEvent : MouseEvent -{ - readonly attribute long wheelDelta; - readonly attribute long wheelDeltaX; - readonly attribute long wheelDeltaY; - - // WebKit Extension - readonly attribute boolean webkitDirectionInvertedFromDevice; - -#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C - readonly attribute boolean isHorizontal; -#endif /* defined(LANGUAGE_OBJECTIVE_C) */ - -#if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT - void initWheelEvent(in [Optional=DefaultIsUndefined] long wheelDeltaX, - in [Optional=DefaultIsUndefined] long wheelDeltaY, - in [Optional=DefaultIsUndefined] DOMWindow view, - in [Optional=DefaultIsUndefined] long screenX, - in [Optional=DefaultIsUndefined] long screenY, - in [Optional=DefaultIsUndefined] long clientX, - in [Optional=DefaultIsUndefined] long clientY, - in [Optional=DefaultIsUndefined] boolean ctrlKey, - in [Optional=DefaultIsUndefined] boolean altKey, - in [Optional=DefaultIsUndefined] boolean shiftKey, - in [Optional=DefaultIsUndefined] boolean metaKey); -#endif /* !defined(LANGUAGE_JAVASCRIPT) */ - -#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT - void initWebKitWheelEvent(in [Optional=DefaultIsUndefined] long wheelDeltaX, - in [Optional=DefaultIsUndefined] long wheelDeltaY, - in [Optional=DefaultIsUndefined] DOMWindow view, - in [Optional=DefaultIsUndefined] long screenX, - in [Optional=DefaultIsUndefined] long screenY, - in [Optional=DefaultIsUndefined] long clientX, - in [Optional=DefaultIsUndefined] long clientY, - in [Optional=DefaultIsUndefined] boolean ctrlKey, - in [Optional=DefaultIsUndefined] boolean altKey, - in [Optional=DefaultIsUndefined] boolean shiftKey, - in [Optional=DefaultIsUndefined] boolean metaKey); -#endif /* defined(LANGUAGE_JAVASCRIPT) */ -}; diff --git a/contrib/dom/webkit/xml/DOMParser.idl b/contrib/dom/webkit/xml/DOMParser.idl deleted file mode 100644 index 2e67aa5..0000000 --- a/contrib/dom/webkit/xml/DOMParser.idl +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -[ - Constructor -] interface DOMParser { - Document parseFromString(in [Optional=DefaultIsUndefined] DOMString str, - in [Optional=DefaultIsUndefined] DOMString contentType); -}; diff --git a/contrib/dom/webkit/xml/XMLHttpRequest.idl b/contrib/dom/webkit/xml/XMLHttpRequest.idl deleted file mode 100644 index 244da04..0000000 --- a/contrib/dom/webkit/xml/XMLHttpRequest.idl +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (C) 2008, 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - ActiveDOMObject, - Constructor, - CallWith=ScriptExecutionContext, - V8CustomConstructor, - JSCustomMarkFunction, - EventTarget, - JSNoStaticTables -] interface XMLHttpRequest { - // From XMLHttpRequestEventTarget - // event handler attributes - attribute EventListener onabort; - attribute EventListener onerror; - attribute EventListener onload; - attribute EventListener onloadend; - attribute EventListener onloadstart; - attribute EventListener onprogress; - [Conditional=XHR_TIMEOUT] attribute EventListener ontimeout; - - // event handler attributes - attribute EventListener onreadystatechange; - - // state - const unsigned short UNSENT = 0; - const unsigned short OPENED = 1; - const unsigned short HEADERS_RECEIVED = 2; - const unsigned short LOADING = 3; - const unsigned short DONE = 4; - - [Conditional=XHR_TIMEOUT] attribute unsigned long timeout - setter raises(DOMException); - readonly attribute unsigned short readyState; - - attribute boolean withCredentials - setter raises(DOMException); - - [Custom] void open(in DOMString method, in DOMString url, in [Optional] boolean async, in [Optional] DOMString user, in [Optional] DOMString password) - raises(DOMException); - - void setRequestHeader(in DOMString header, in DOMString value) - raises(DOMException); - - [Custom] void send() - raises(DOMException); - [Custom] void send(in ArrayBuffer data) // FIXME: this should be eventually deprecated. - raises(DOMException); - [Custom] void send(in ArrayBufferView data) - raises(DOMException); - [Conditional=BLOB, Custom] void send(in Blob data) - raises(DOMException); - [Custom] void send(in Document data) - raises(DOMException); - [Custom] void send(in [StrictTypeChecking] DOMString data) - raises(DOMException); - [Custom] void send(in DOMFormData data) - raises(DOMException); - - void abort(); - - readonly attribute XMLHttpRequestUpload upload; - - // response - [TreatReturnedNullStringAs=Undefined] DOMString getAllResponseHeaders() - raises(DOMException); - [TreatReturnedNullStringAs=Null] DOMString getResponseHeader(in DOMString header) - raises(DOMException); - [CustomGetter] readonly attribute DOMString responseText // The custom getter implements TreatReturnedNullStringAs=Null - getter raises(DOMException); - readonly attribute Document responseXML - getter raises(DOMException); - - attribute DOMString responseType - setter raises(DOMException); - [CustomGetter] readonly attribute Object response - getter raises(DOMException); - - readonly attribute unsigned short status - getter raises(DOMException); - readonly attribute DOMString statusText - getter raises(DOMException); - - // Extension - void overrideMimeType(in DOMString override); - - // EventTarget interface - void addEventListener(in DOMString type, - in EventListener listener, - in [Optional] boolean useCapture); - void removeEventListener(in DOMString type, - in EventListener listener, - in [Optional] boolean useCapture); - boolean dispatchEvent(in Event evt) - raises(EventException); -}; diff --git a/contrib/dom/webkit/xml/XMLHttpRequestException.idl b/contrib/dom/webkit/xml/XMLHttpRequestException.idl deleted file mode 100644 index 4114292..0000000 --- a/contrib/dom/webkit/xml/XMLHttpRequestException.idl +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - JSNoStaticTables, - DoNotCheckConstants -] exception XMLHttpRequestException { - - readonly attribute unsigned short code; - readonly attribute DOMString name; - readonly attribute DOMString message; - -#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT - // Override in a Mozilla compatible format - [NotEnumerable] DOMString toString(); -#endif - - // XMLHttpRequestExceptionCode - const unsigned short NETWORK_ERR = 101; - const unsigned short ABORT_ERR = 102; -}; - diff --git a/contrib/dom/webkit/xml/XMLHttpRequestProgressEvent.idl b/contrib/dom/webkit/xml/XMLHttpRequestProgressEvent.idl deleted file mode 100644 index 5ed5c21..0000000 --- a/contrib/dom/webkit/xml/XMLHttpRequestProgressEvent.idl +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - JSNoStaticTables -// We should also inherit from LSProgressEvent when the idl is added. -] interface XMLHttpRequestProgressEvent : ProgressEvent { - readonly attribute unsigned long long position; - readonly attribute unsigned long long totalSize; -}; - diff --git a/contrib/dom/webkit/xml/XMLHttpRequestUpload.idl b/contrib/dom/webkit/xml/XMLHttpRequestUpload.idl deleted file mode 100644 index 61031df..0000000 --- a/contrib/dom/webkit/xml/XMLHttpRequestUpload.idl +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - JSGenerateIsReachable=Impl, - EventTarget, - JSNoStaticTables -] interface XMLHttpRequestUpload { - // From XMLHttpRequestEventTarget - // event handler attributes - attribute EventListener onabort; - attribute EventListener onerror; - attribute EventListener onload; - attribute EventListener onloadend; - attribute EventListener onloadstart; - attribute EventListener onprogress; - - // EventTarget interface - void addEventListener(in DOMString type, - in EventListener listener, - in [Optional] boolean useCapture); - void removeEventListener(in DOMString type, - in EventListener listener, - in [Optional] boolean useCapture); - boolean dispatchEvent(in Event evt) - raises(EventException); -}; - diff --git a/contrib/dom/webkit/xml/XMLSerializer.idl b/contrib/dom/webkit/xml/XMLSerializer.idl deleted file mode 100644 index 709fe1d..0000000 --- a/contrib/dom/webkit/xml/XMLSerializer.idl +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. - * Copyright (C) 2006 Samuel Weinig (sam@webkit.org) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -[ - Constructor -] interface XMLSerializer { - DOMString serializeToString(in [Optional=DefaultIsUndefined] Node node) - raises(DOMException); -}; - diff --git a/contrib/dom/webkit/xml/XPathEvaluator.idl b/contrib/dom/webkit/xml/XPathEvaluator.idl deleted file mode 100644 index 6cf4dc0..0000000 --- a/contrib/dom/webkit/xml/XPathEvaluator.idl +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -[ - Constructor -] interface XPathEvaluator { - XPathExpression createExpression(in [Optional=DefaultIsUndefined] DOMString expression, - in [Optional=DefaultIsUndefined] XPathNSResolver resolver) - raises(DOMException); - - XPathNSResolver createNSResolver(in [Optional=DefaultIsUndefined] Node nodeResolver); - - XPathResult evaluate(in [Optional=DefaultIsUndefined] DOMString expression, - in [Optional=DefaultIsUndefined] Node contextNode, - in [Optional=DefaultIsUndefined] XPathNSResolver resolver, - in [Optional=DefaultIsUndefined] unsigned short type, - in [Optional=DefaultIsUndefined] XPathResult inResult) - raises(DOMException); -}; diff --git a/contrib/dom/webkit/xml/XPathException.idl b/contrib/dom/webkit/xml/XPathException.idl deleted file mode 100644 index 2398187..0000000 --- a/contrib/dom/webkit/xml/XPathException.idl +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - DoNotCheckConstants -] exception XPathException { - - readonly attribute unsigned short code; - readonly attribute DOMString name; - readonly attribute DOMString message; - -#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT - // Override in a Mozilla compatible format - [NotEnumerable] DOMString toString(); -#endif - - // XPathExceptionCode - const unsigned short INVALID_EXPRESSION_ERR = 51; - const unsigned short TYPE_ERR = 52; -}; - diff --git a/contrib/dom/webkit/xml/XPathExpression.idl b/contrib/dom/webkit/xml/XPathExpression.idl deleted file mode 100644 index 1f3c8c4..0000000 --- a/contrib/dom/webkit/xml/XPathExpression.idl +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -interface XPathExpression { - [ObjCLegacyUnnamedParameters] XPathResult evaluate(in [Optional=DefaultIsUndefined] Node contextNode, - in [Optional=DefaultIsUndefined] unsigned short type, - in [Optional=DefaultIsUndefined] XPathResult inResult) - raises(DOMException); -}; - diff --git a/contrib/dom/webkit/xml/XPathNSResolver.idl b/contrib/dom/webkit/xml/XPathNSResolver.idl deleted file mode 100644 index 518e1da..0000000 --- a/contrib/dom/webkit/xml/XPathNSResolver.idl +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. - * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -[ - ObjCProtocol, - OmitConstructor -] interface XPathNSResolver { - [TreatReturnedNullStringAs=Null] DOMString lookupNamespaceURI(in [Optional=DefaultIsUndefined] DOMString prefix); -}; - diff --git a/contrib/dom/webkit/xml/XPathResult.idl b/contrib/dom/webkit/xml/XPathResult.idl deleted file mode 100644 index 51b7afd..0000000 --- a/contrib/dom/webkit/xml/XPathResult.idl +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -interface XPathResult { - const unsigned short ANY_TYPE = 0; - const unsigned short NUMBER_TYPE = 1; - const unsigned short STRING_TYPE = 2; - const unsigned short BOOLEAN_TYPE = 3; - const unsigned short UNORDERED_NODE_ITERATOR_TYPE = 4; - const unsigned short ORDERED_NODE_ITERATOR_TYPE = 5; - const unsigned short UNORDERED_NODE_SNAPSHOT_TYPE = 6; - const unsigned short ORDERED_NODE_SNAPSHOT_TYPE = 7; - const unsigned short ANY_UNORDERED_NODE_TYPE = 8; - const unsigned short FIRST_ORDERED_NODE_TYPE = 9; - - readonly attribute unsigned short resultType; - readonly attribute double numberValue - getter raises (DOMException); - - readonly attribute DOMString stringValue - getter raises (DOMException); - - readonly attribute boolean booleanValue - getter raises (DOMException); - - readonly attribute Node singleNodeValue - getter raises (DOMException); - - readonly attribute boolean invalidIteratorState; - readonly attribute unsigned long snapshotLength - getter raises (DOMException); - - Node iterateNext() - raises (DOMException); - Node snapshotItem(in [Optional=DefaultIsUndefined] unsigned long index) - raises (DOMException); -}; - diff --git a/contrib/dom/webkit/xml/XSLTProcessor.idl b/contrib/dom/webkit/xml/XSLTProcessor.idl deleted file mode 100644 index 0914e06..0000000 --- a/contrib/dom/webkit/xml/XSLTProcessor.idl +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -// Eventually we should implement XSLTException: -// http://lxr.mozilla.org/seamonkey/source/content/xsl/public/nsIXSLTException.idl -// http://bugs.webkit.org/show_bug.cgi?id=5446 - -[ - Conditional=XSLT, - Constructor -] interface XSLTProcessor { - - void importStylesheet(in [Optional=DefaultIsUndefined] Node stylesheet); - DocumentFragment transformToFragment(in [Optional=DefaultIsUndefined] Node source, in [Optional=DefaultIsUndefined] Document docVal); - Document transformToDocument(in [Optional=DefaultIsUndefined] Node source); - - [Custom] void setParameter(in DOMString namespaceURI, in DOMString localName, in DOMString value); - [Custom, TreatReturnedNullStringAs=Undefined] DOMString getParameter(in DOMString namespaceURI, in DOMString localName); - [Custom] void removeParameter(in DOMString namespaceURI, in DOMString localName); - void clearParameters(); - - void reset(); - -}; - diff --git a/docs/Ubuntu-LTS.md b/docs/Ubuntu-LTS.md index 15e58cc..4dbc0e2 100644 --- a/docs/Ubuntu-LTS.md +++ b/docs/Ubuntu-LTS.md @@ -2,17 +2,11 @@ Install Ubuntu LTS 12 For core functionality without fancy plugins: -$ sudo apt-get install cmake -$ sudo apt-get install build-essential -$ sudo apt-get install libxml2-dev -$ sudo apt-get install libcurl4-openssl-dev +$ sudo apt-get install cmake build-essential libxml2-dev libcurl4-openssl-dev For OpenSceneGraph invoker (version in repositories lacks vrml plugin): -$ sudo apt-get install libpng12-dev -$ sudo apt-get install libjpeg-dev -$ sudo apt-get install libboost-all-dev -$ sudo apt-get install libltdl-dev +$ sudo apt-get install libpng12-dev libjpeg-dev libboost-all-dev libltdl-dev $ sudo apt-get install libopenscenegraph-dev # just for the dependencies $ sudo apt-get remove libopenscenegraph-dev diff --git a/src/bindings/swig/java/uscxml.i b/src/bindings/swig/java/uscxml.i index d469498..4e7c3b7 100644 --- a/src/bindings/swig/java/uscxml.i +++ b/src/bindings/swig/java/uscxml.i @@ -160,6 +160,7 @@ using namespace Arabica::DOM; // Parse the header file to generate wrappers //*********************************************** +%include "../../../uscxml/Common.h" %include "../../../uscxml/Factory.h" %include "../../../uscxml/Message.h" %include "../../../uscxml/Interpreter.h" diff --git a/src/bindings/swig/php/uscxml.i b/src/bindings/swig/php/uscxml.i index fb7d370..348b713 100644 --- a/src/bindings/swig/php/uscxml.i +++ b/src/bindings/swig/php/uscxml.i @@ -173,6 +173,7 @@ void*** tsrm_ls; // Parse the header file to generate wrappers //*********************************************** +%include "../../../uscxml/Common.h" %include "../../../uscxml/Message.h" %include "../../../uscxml/Interpreter.h" %include "../../../uscxml/concurrency/BlockingQueue.h" diff --git a/src/uscxml.h b/src/uscxml.h index 792ba43..d52ed66 100644 --- a/src/uscxml.h +++ b/src/uscxml.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef USCXML_H_2WZ0PBQH #define USCXML_H_2WZ0PBQH diff --git a/src/uscxml/CMakeLists.txt b/src/uscxml/CMakeLists.txt index 9582112..b32eb81 100644 --- a/src/uscxml/CMakeLists.txt +++ b/src/uscxml/CMakeLists.txt @@ -80,3 +80,4 @@ SET(USCXML_LANGUAGE_BINDINGS ${USCXML_LANGUAGE_BINDINGS} PARENT_SCOPE) set(USCXML_INCLUDE_DIRS ${USCXML_INCLUDE_DIRS} PARENT_SCOPE) set(USCXML_OPT_LIBS ${USCXML_OPT_LIBS} PARENT_SCOPE) set(USCXML_FILES ${USCXML_FILES} PARENT_SCOPE) +SET(PLUMA ${PLUMA} PARENT_SCOPE)
\ No newline at end of file diff --git a/src/uscxml/Common.h b/src/uscxml/Common.h index 09785be..eaa1a2b 100644 --- a/src/uscxml/Common.h +++ b/src/uscxml/Common.h @@ -1,6 +1,35 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef COMMON_H_YZ3CIYP #define COMMON_H_YZ3CIYP +#if defined(_WIN32) && !defined(USCXML_STATIC) +# ifdef USCXML_EXPORT +# define USCXML_API __declspec(dllexport) +# else +# define USCXML_API __declspec(dllimport) +# endif +#else +# define USCXML_API +#endif + #ifdef _WIN32 #include <winsock2.h> // see http://stackoverflow.com/questions/1372480/c-redefinition-header-files @@ -28,6 +57,9 @@ #pragma warning (disable : 4240) #pragma warning (disable : 4250) +// dll interface +#pragma warning (disable : 4251) + #endif diff --git a/src/uscxml/Convenience.h b/src/uscxml/Convenience.h index ad45e2c..b2b437c 100644 --- a/src/uscxml/Convenience.h +++ b/src/uscxml/Convenience.h @@ -1,32 +1,51 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef CONVENIENCE_H_LU7GZ6CB #define CONVENIENCE_H_LU7GZ6CB namespace uscxml { - inline bool isnan(double x) { - return x != x; - } - - // see http://stackoverflow.com/questions/228005/alternative-to-itoa-for-converting-integer-to-string-c - template <typename T> std::string toStr(T tmp) { - std::ostringstream out; - out.precision(std::numeric_limits<double>::digits10 + 1); - out << tmp; - return out.str(); - } - - template <typename T> T strTo(std::string tmp) { - T output; - std::istringstream in(tmp); - in >> output; - return output; - } - - inline bool isNumeric( const char* pszInput, int nNumberBase) { - std::string base = ".-0123456789ABCDEF"; - std::string input = pszInput; - return (input.find_first_not_of(base.substr(0, nNumberBase + 2)) == std::string::npos); - } - +inline bool isnan(double x) { + return x != x; +} + +// see http://stackoverflow.com/questions/228005/alternative-to-itoa-for-converting-integer-to-string-c +template <typename T> std::string toStr(T tmp) { + std::ostringstream out; + out.precision(std::numeric_limits<double>::digits10 + 1); + out << tmp; + return out.str(); +} + +template <typename T> T strTo(std::string tmp) { + T output; + std::istringstream in(tmp); + in >> output; + return output; +} + +inline bool isNumeric( const char* pszInput, int nNumberBase) { + std::string base = ".-0123456789ABCDEF"; + std::string input = pszInput; + return (input.find_first_not_of(base.substr(0, nNumberBase + 2)) == std::string::npos); +} + } diff --git a/src/uscxml/Factory.cpp b/src/uscxml/Factory.cpp index 6758e19..f75cdd3 100644 --- a/src/uscxml/Factory.cpp +++ b/src/uscxml/Factory.cpp @@ -1,4 +1,22 @@ -#include "uscxml/Common.h" +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "uscxml/config.h" #include "uscxml/Factory.h" @@ -22,14 +40,15 @@ # include "uscxml/plugins/invoker/system/SystemInvoker.h" # include "uscxml/plugins/invoker/xhtml/XHTMLInvoker.h" + #ifdef PROTOBUF_FOUND -# include "uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.h" +//# include "uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.h" #endif -# ifdef UMUNDO_FOUND +# ifdef UMUNDO_FOUND # include "uscxml/plugins/invoker/umundo/UmundoInvoker.h" -# include "uscxml/plugins/invoker/vxml/VoiceXMLInvoker.h" -# endif +//# include "uscxml/plugins/invoker/vxml/VoiceXMLInvoker.h" +#endif # ifdef OPENSCENEGRAPH_FOUND # include "uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.h" @@ -38,7 +57,7 @@ # ifdef MILES_FOUND # include "uscxml/plugins/invoker/miles/MilesSessionInvoker.h" -# include "uscxml/plugins/invoker/miles/SpatialAudio.h" +//# include "uscxml/plugins/invoker/miles/SpatialAudio.h" # endif # ifdef FFMPEG_FOUND @@ -144,11 +163,13 @@ Factory::Factory() { UmundoInvoker* invoker = new UmundoInvoker(); registerInvoker(invoker); } +#if 0 { VoiceXMLInvoker* invoker = new VoiceXMLInvoker(); registerInvoker(invoker); } #endif +#endif #ifdef MILES_FOUND { @@ -156,10 +177,10 @@ Factory::Factory() { MilesSessionInvoker* invoker = new MilesSessionInvoker(); registerInvoker(invoker); } - { - SpatialAudio* invoker = new SpatialAudio(); - registerInvoker(invoker); - } + // { + // SpatialAudio* invoker = new SpatialAudio(); + // registerInvoker(invoker); + // } #endif #ifdef FFMPEG_FOUND @@ -231,8 +252,8 @@ Factory::Factory() { #ifdef PROTOBUF_FOUND { - MMIHTTPIOProcessor* ioProcessor = new MMIHTTPIOProcessor(); - registerIOProcessor(ioProcessor); + // MMIHTTPIOProcessor* ioProcessor = new MMIHTTPIOProcessor(); + // registerIOProcessor(ioProcessor); } #endif #endif diff --git a/src/uscxml/Factory.h b/src/uscxml/Factory.h index d4c7601..a463d5b 100644 --- a/src/uscxml/Factory.h +++ b/src/uscxml/Factory.h @@ -1,6 +1,26 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef FACTORY_H_5WKLGPRB #define FACTORY_H_5WKLGPRB +#include "uscxml/Common.h" #include "uscxml/Message.h" #include "uscxml/Convenience.h" @@ -17,7 +37,7 @@ namespace uscxml { class InterpreterImpl; -class ExecutableContentImpl { +class USCXML_API ExecutableContentImpl { public: ExecutableContentImpl() {}; virtual ~ExecutableContentImpl() {}; @@ -39,7 +59,7 @@ protected: InterpreterImpl* _interpreter; }; -class ExecutableContent { +class USCXML_API ExecutableContent { public: ExecutableContent() : _impl() {} ExecutableContent(boost::shared_ptr<ExecutableContentImpl> const impl) : _impl(impl) { } @@ -87,7 +107,7 @@ protected: }; -class EventHandlerImpl { +class USCXML_API EventHandlerImpl { public: virtual ~EventHandlerImpl() {} @@ -118,7 +138,7 @@ protected: }; -class EventHandler { +class USCXML_API EventHandler { public: EventHandler() : _impl() {} EventHandler(boost::shared_ptr<EventHandlerImpl> const impl) : _impl(impl) { } @@ -154,14 +174,14 @@ protected: friend class InterpreterImpl; }; -class IOProcessorImpl : public EventHandlerImpl { +class USCXML_API IOProcessorImpl : public EventHandlerImpl { public: IOProcessorImpl() {}; virtual ~IOProcessorImpl() {}; virtual boost::shared_ptr<IOProcessorImpl> create(InterpreterImpl* interpreter) = 0; }; -class IOProcessor : public EventHandler { +class USCXML_API IOProcessor : public EventHandler { public: IOProcessor() : _impl() {} IOProcessor(boost::shared_ptr<IOProcessorImpl> const impl) : EventHandler(impl), _impl(impl) { } @@ -191,14 +211,14 @@ protected: friend class InterpreterImpl; }; -class InvokerImpl : public EventHandlerImpl { +class USCXML_API InvokerImpl : public EventHandlerImpl { public: virtual ~InvokerImpl() {} virtual void invoke(const InvokeRequest& req) = 0; virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter) = 0; }; -class Invoker : public EventHandler { +class USCXML_API Invoker : public EventHandler { public: Invoker() : _impl() {} Invoker(boost::shared_ptr<InvokerImpl> const impl) : EventHandler(impl), _impl(impl) { } @@ -231,7 +251,7 @@ protected: boost::shared_ptr<InvokerImpl> _impl; }; -class DataModelImpl { +class USCXML_API DataModelImpl { public: virtual ~DataModelImpl() {} virtual boost::shared_ptr<DataModelImpl> create(InterpreterImpl* interpreter) = 0; @@ -278,7 +298,7 @@ public: InterpreterImpl* _interpreter; }; -class DataModel { +class USCXML_API DataModel { public: DataModel() : _impl() {} DataModel(const boost::shared_ptr<DataModelImpl> impl) : _impl(impl) { } @@ -377,7 +397,7 @@ protected: boost::shared_ptr<DataModelImpl> _impl; }; -class Factory { +class USCXML_API Factory { public: Factory(Factory* parentFactory); diff --git a/src/uscxml/Interpreter.cpp b/src/uscxml/Interpreter.cpp index b23ccd7..02e80f0 100644 --- a/src/uscxml/Interpreter.cpp +++ b/src/uscxml/Interpreter.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "uscxml/config.h" #include "uscxml/Common.h" #include "uscxml/Interpreter.h" @@ -62,10 +81,10 @@ unsigned int InterpreterOptions::getCapabilities() { unsigned int capabilities = CAN_NOTHING; if (withHTTP) capabilities = capabilities | CAN_GENERIC_HTTP | CAN_BASIC_HTTP; - + return capabilities; } - + InterpreterOptions InterpreterOptions::fromCmdLine(int argc, char** argv) { InterpreterOptions options; struct option longOptions[] = { @@ -81,15 +100,15 @@ InterpreterOptions InterpreterOptions::fromCmdLine(int argc, char** argv) { {"disable-http", no_argument, 0, 0}, {0, 0, 0, 0} }; - + opterr = 0; if (argc < 2) { options.error = "No SCXML document to evaluate"; return options; } - + InterpreterOptions* currOptions = &options; - + // parse global options int optionInd = 0; int option; @@ -103,86 +122,100 @@ InterpreterOptions InterpreterOptions::fromCmdLine(int argc, char** argv) { std::string url = argv[optind]; options.interpreters[url] = new InterpreterOptions(); currOptions = options.interpreters[url]; - + argc -= optind; argv += optind; optind = 0; - + if (argc <= 1) goto DONE_PARSING_CMD; - + } switch(option) { // cases without short option - case 0: { - if (boost::equals(longOptions[optionInd].name, "disable-http")) { - currOptions->withHTTP = false; - } else if (boost::equals(longOptions[optionInd].name, "private-key")) { - currOptions->privateKey = optarg; - } else if (boost::equals(longOptions[optionInd].name, "public-key")) { - currOptions->publicKey = optarg; - } - break; + case 0: { + if (boost::equals(longOptions[optionInd].name, "disable-http")) { + currOptions->withHTTP = false; + } else if (boost::equals(longOptions[optionInd].name, "private-key")) { + currOptions->privateKey = optarg; + } else if (boost::equals(longOptions[optionInd].name, "public-key")) { + currOptions->publicKey = optarg; } - // cases with short-hand options - case 'l': - currOptions->logLevel = strTo<unsigned int>(optarg); - break; - case 'p': - currOptions->pluginPath = optarg; - break; - case 'd': - currOptions->useDot = true; - break; - case 'c': - currOptions->certificate = optarg; - break; - case 't': - currOptions->httpPort = strTo<unsigned short>(optarg); - break; - case 's': - currOptions->httpsPort = strTo<unsigned short>(optarg); - break; - case 'v': - currOptions->verbose = true; - break; - case '?': { - std::string param = argv[optind - 1]; - if (boost::starts_with(param, "--")) { - param = param.substr(2, param.length() - 2); - } else if (boost::starts_with(param, "-")) { - param = param.substr(1, param.length() - 1); - } else { - break; - } - boost::trim(param); - - size_t equalPos = param.find("="); - if (equalPos != std::string::npos) { - std::string key = param.substr(0, equalPos); - std::string value = param.substr(equalPos + 1, param.length() - (equalPos + 1)); - currOptions->additionalParameters[key] = value; - } else { - currOptions->additionalParameters[param] = ""; - } + break; + } + // cases with short-hand options + case 'l': + currOptions->logLevel = strTo<unsigned int>(optarg); + break; + case 'p': + currOptions->pluginPath = optarg; + break; + case 'd': + currOptions->useDot = true; + break; + case 'c': + currOptions->certificate = optarg; + break; + case 't': + currOptions->httpPort = strTo<unsigned short>(optarg); + break; + case 's': + currOptions->httpsPort = strTo<unsigned short>(optarg); + break; + case 'v': + currOptions->verbose = true; + break; + case '?': { + std::string param = argv[optind - 1]; + if (boost::starts_with(param, "--")) { + param = param.substr(2, param.length() - 2); + } else if (boost::starts_with(param, "-")) { + param = param.substr(1, param.length() - 1); + } else { break; } - default: - break; + boost::trim(param); + + size_t equalPos = param.find("="); + if (equalPos != std::string::npos) { + std::string key = param.substr(0, equalPos); + std::string value = param.substr(equalPos + 1, param.length() - (equalPos + 1)); + currOptions->additionalParameters[key] = value; + } else { + currOptions->additionalParameters[param] = ""; + } + break; + } + default: + break; } } - + DONE_PARSING_CMD: - + if (options.interpreters.size() == 0) options.error = "No SCXML document to evaluate"; - + return options; } - + std::map<std::string, boost::weak_ptr<InterpreterImpl> > Interpreter::_instances; tthread::recursive_mutex Interpreter::_instanceMutex; +std::map<std::string, boost::weak_ptr<InterpreterImpl> > Interpreter::getInstances() { + tthread::lock_guard<tthread::recursive_mutex> lock(_instanceMutex); + std::map<std::string, boost::weak_ptr<InterpreterImpl> >::iterator instIter = _instances.begin(); + while(instIter != _instances.end()) { + if (!instIter->second.lock()) { + _instances.erase(instIter++); + } else { + instIter++; + } + } + return _instances; +} + + InterpreterImpl::InterpreterImpl() { _lastRunOnMainThread = 0; _nsURL = "*"; diff --git a/src/uscxml/Interpreter.h b/src/uscxml/Interpreter.h index b8093ab..25c89a2 100644 --- a/src/uscxml/Interpreter.h +++ b/src/uscxml/Interpreter.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef RUNTIME_H_SQ1MBKGN #define RUNTIME_H_SQ1MBKGN @@ -33,7 +52,7 @@ namespace uscxml { class HTTPServletInvoker; class InterpreterMonitor; -class NumAttr { +class USCXML_API NumAttr { public: NumAttr(const std::string& str) { size_t valueStart = str.find_first_of("0123456789."); @@ -64,7 +83,7 @@ enum Capabilities { CAN_GENERIC_HTTP = 2, }; -class InterpreterOptions { +class USCXML_API InterpreterOptions { public: bool useDot; bool verbose; @@ -85,11 +104,11 @@ public: operator bool() { return error.length() == 0; } - + static void printUsageAndExit(const char* progName); static InterpreterOptions fromCmdLine(int argc, char** argv); unsigned int getCapabilities(); - + protected: InterpreterOptions() : useDot(false), @@ -101,8 +120,8 @@ protected: httpsPort(8443) {} }; - -class InterpreterImpl : public boost::enable_shared_from_this<InterpreterImpl> { + +class USCXML_API InterpreterImpl : public boost::enable_shared_from_this<InterpreterImpl> { public: typedef std::set<InterpreterMonitor*>::iterator monIter_t; @@ -376,7 +395,7 @@ protected: friend class Interpreter; }; -class Interpreter { +class USCXML_API Interpreter { public: static Interpreter fromDOM(const Arabica::DOM::Document<std::string>& dom); static Interpreter fromXML(const std::string& xml); @@ -640,18 +659,7 @@ public: return _impl; } - static std::map<std::string, boost::weak_ptr<InterpreterImpl> > getInstances() { - tthread::lock_guard<tthread::recursive_mutex> lock(_instanceMutex); - std::map<std::string, boost::weak_ptr<InterpreterImpl> >::iterator instIter = _instances.begin(); - while(instIter != _instances.end()) { - if (!instIter->second.lock()) { - _instances.erase(instIter++); - } else { - instIter++; - } - } - return _instances; - } + static std::map<std::string, boost::weak_ptr<InterpreterImpl> > getInstances(); protected: boost::shared_ptr<InterpreterImpl> _impl; @@ -659,7 +667,7 @@ protected: static tthread::recursive_mutex _instanceMutex; }; -class InterpreterMonitor { +class USCXML_API InterpreterMonitor { public: virtual ~InterpreterMonitor() {} virtual void onStableConfiguration(Interpreter interpreter) {} diff --git a/src/uscxml/Message.cpp b/src/uscxml/Message.cpp index 0a686d5..38de602 100644 --- a/src/uscxml/Message.cpp +++ b/src/uscxml/Message.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "uscxml/config.h" #include "uscxml/Common.h" @@ -302,7 +321,7 @@ Data Data::fromJSON(const std::string& jsonString) { // std::cout << "------" << std::endl; // token++; // } - + std::list<Data*> dataStack; std::list<jsmntok_t> tokenStack; dataStack.push_back(&data); diff --git a/src/uscxml/Message.h b/src/uscxml/Message.h index 3008a99..59d3471 100644 --- a/src/uscxml/Message.h +++ b/src/uscxml/Message.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef EVENT_H_XZAQ4HR #define EVENT_H_XZAQ4HR @@ -14,6 +33,8 @@ #include <boost/lexical_cast.hpp> #include <inttypes.h> +#include "uscxml/Common.h" + #include "uscxml/Convenience.h" #include "uscxml/util/MD5.h" @@ -26,7 +47,7 @@ namespace uscxml { -class Blob { +class USCXML_API Blob { public: ~Blob(); Blob(size_t size); @@ -38,18 +59,18 @@ public: std::string md5() { return uscxml::md5(data, size); } - + std::string base64() { return base64_encode((char* const)data, size); } - + Blob* fromBase64(const std::string base64) { std::string decoded = base64_decode(base64); return new Blob((void*)decoded.c_str(), decoded.length()); } }; - -class Data { + +class USCXML_API Data { public: enum Type { VERBATIM, @@ -67,7 +88,7 @@ public: } } template <typename T> Data(T value) : atom(toStr(value)), type(INTERPRETED) {} - + explicit Data(const Arabica::DOM::Node<std::string>& dom); virtual ~Data() {} @@ -89,11 +110,11 @@ public: Data data; return data; } - + operator std::string() const { return atom; } - + operator std::map<std::string, Data>() { return compound; } @@ -101,7 +122,7 @@ public: operator std::list<Data>() { return array; } - + static Data fromJSON(const std::string& jsonString); static std::string toJSON(const Data& data); static Data fromXML(const std::string& xmlString); @@ -153,10 +174,10 @@ protected: protected: Arabica::DOM::Document<std::string> toNode(const Arabica::DOM::Document<std::string>& factory, const Data& data); - friend std::ostream& operator<< (std::ostream& os, const Data& data); + friend USCXML_API std::ostream& operator<< (std::ostream& os, const Data& data); }; -class Event { +class USCXML_API Event { public: enum Type { INTERNAL = 1, @@ -313,7 +334,7 @@ public: } return false; } - + #ifdef SWIGIMPORTED protected: @@ -334,10 +355,10 @@ protected: std::map<std::string, Data> namelist; std::multimap<std::string, Data> params; - friend std::ostream& operator<< (std::ostream& os, const Event& event); + friend USCXML_API std::ostream& operator<< (std::ostream& os, const Event& event); }; -class InvokeRequest : public Event { +class USCXML_API InvokeRequest : public Event { public: InvokeRequest(Event event) : Event(event) {} InvokeRequest() {} @@ -378,11 +399,11 @@ protected: std::string src; bool autoForward; - friend std::ostream& operator<< (std::ostream& os, const InvokeRequest& sendReq); + friend USCXML_API std::ostream& operator<< (std::ostream& os, const InvokeRequest& sendReq); }; -class SendRequest : public Event { +class USCXML_API SendRequest : public Event { public: SendRequest() {} SendRequest(Event event) : Event(event) {} @@ -424,10 +445,15 @@ protected: std::string type; uint32_t delayMs; - friend std::ostream& operator<< (std::ostream& os, const SendRequest& sendReq); + friend USCXML_API std::ostream& operator<< (std::ostream& os, const SendRequest& sendReq); }; +USCXML_API std::ostream& operator<< (std::ostream& os, const InvokeRequest& invokeReq); +USCXML_API std::ostream& operator<< (std::ostream& os, const SendRequest& sendReq); +USCXML_API std::ostream& operator<< (std::ostream& os, const Event& event); +USCXML_API std::ostream& operator<< (std::ostream& os, const Data& data); + } diff --git a/src/uscxml/NameSpacingParser.cpp b/src/uscxml/NameSpacingParser.cpp index 619d62c..beaae95 100644 --- a/src/uscxml/NameSpacingParser.cpp +++ b/src/uscxml/NameSpacingParser.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 <uscxml/Common.h> #include "NameSpacingParser.h" #include <glog/logging.h> diff --git a/src/uscxml/NameSpacingParser.h b/src/uscxml/NameSpacingParser.h index 726db7b..88933c6 100644 --- a/src/uscxml/NameSpacingParser.h +++ b/src/uscxml/NameSpacingParser.h @@ -1,6 +1,26 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef NAMESPACINGPARSER_H_1S91TNPM #define NAMESPACINGPARSER_H_1S91TNPM +#include "uscxml/Common.h" #include <DOM/SAX2DOM/SAX2DOM.hpp> #include <SAX/helpers/CatchErrorHandler.hpp> @@ -13,7 +33,7 @@ class ScriptEntityResolver : public Arabica::SAX::EntityResolver<std::string> { } }; -class NameSpacingParser : public Arabica::SAX2DOM::Parser<std::string> { +class USCXML_API NameSpacingParser : public Arabica::SAX2DOM::Parser<std::string> { public: NameSpacingParser(); NameSpacingParser(const NameSpacingParser& other) {} diff --git a/src/uscxml/URL.cpp b/src/uscxml/URL.cpp index 93d4c40..67b8999 100644 --- a/src/uscxml/URL.cpp +++ b/src/uscxml/URL.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 <glog/logging.h> #include "URL.h" #include "UUID.h" @@ -57,7 +76,7 @@ std::string URL::tmpDir() { } std::map<std::string, std::string> URL::mimeTypes; - std::string URL::getMimeType(const std::string extension, std::string magic) { +std::string URL::getMimeType(const std::string extension, std::string magic) { if (mimeTypes.empty()) { mimeTypes["txt"] = "text/plain"; mimeTypes["c"] = "text/plain"; @@ -77,19 +96,19 @@ std::map<std::string, std::string> URL::mimeTypes; mimeTypes["tif"] = "image/tiff"; mimeTypes["tiff"] = "image/tiff"; } - + if (mimeTypes.find(extension) != mimeTypes.end()) { return mimeTypes[extension]; } return ""; } - + std::string URL::getTmpFilename(const std::string& suffix) { std::string tmpFilename = tmpDir(); if (tmpFilename.find_last_of(PATH_SEPERATOR) != tmpFilename.length() - 1) tmpFilename += PATH_SEPERATOR; - + tmpFilename += UUID::getUUID(); if (suffix.length() > 0) { tmpFilename += "."; @@ -530,7 +549,7 @@ void URLFetcher::fetchURL(URL& url) { (curlError = curl_easy_setopt(handle, CURLOPT_URL, url.asString().c_str())) == CURLE_OK || LOG(ERROR) << "Cannot set url to " << url.asString() << ": " << curl_easy_strerror(curlError); - + // (curlError = curl_easy_setopt(handle, CURLOPT_NOSIGNAL, 1)) == CURLE_OK || // LOG(ERROR) << "Cannot set curl to ignore signals: " << curl_easy_strerror(curlError); diff --git a/src/uscxml/URL.h b/src/uscxml/URL.h index 26b9437..5f55454 100644 --- a/src/uscxml/URL.h +++ b/src/uscxml/URL.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef URL_H_9DAEGSMV #define URL_H_9DAEGSMV @@ -22,7 +41,7 @@ namespace uscxml { class URL; -class URLMonitor { +class USCXML_API URLMonitor { public: virtual void downloadStarted(const URL& url) {}; virtual void downloadCompleted(const URL& url) {}; @@ -31,7 +50,7 @@ public: virtual void contentChunkReceived(const URL& url, const std::string& contentChunk) {}; }; -class URLImpl : public boost::enable_shared_from_this<URLImpl> { +class USCXML_API URLImpl : public boost::enable_shared_from_this<URLImpl> { public: URLImpl(const std::string& url); ~URLImpl(); @@ -133,7 +152,7 @@ protected: typedef std::set<URLMonitor*>::iterator monIter_t; }; -class URL { +class USCXML_API URL { public: URL() : _impl() {} URL(const std::string url) : _impl(new URLImpl(url)) {} @@ -248,9 +267,9 @@ public: static std::string tmpDir(); static std::map<std::string, std::string> mimeTypes; static std::string getMimeType(const std::string extension, std::string magic = ""); - + friend class URLFetcher; - friend std::ostream & operator<<(std::ostream &stream, const URL& p); + friend USCXML_API std::ostream & operator<<(std::ostream &stream, const URL& p); operator Data() const { return _impl->operator Data(); @@ -270,7 +289,7 @@ protected: boost::shared_ptr<URLImpl> _impl; }; -class URLFetcher { +class USCXML_API URLFetcher { public: URLFetcher(); ~URLFetcher(); @@ -297,6 +316,8 @@ protected: CURLM* _multiHandle; }; +USCXML_API std::ostream& operator<< (std::ostream &stream, const URL& p); + } #endif /* end of include guard: URL_H_9DAEGSMV */ diff --git a/src/uscxml/URL.mm b/src/uscxml/URL.mm index e6dc9c5..3bd1607 100644 --- a/src/uscxml/URL.mm +++ b/src/uscxml/URL.mm @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "URL.h" #include "Foundation/Foundation.h" diff --git a/src/uscxml/UUID.cpp b/src/uscxml/UUID.cpp index eac4316..68f0d76 100644 --- a/src/uscxml/UUID.cpp +++ b/src/uscxml/UUID.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "UUID.h" #include <sstream> diff --git a/src/uscxml/UUID.h b/src/uscxml/UUID.h index 4a11285..d0dd50c 100644 --- a/src/uscxml/UUID.h +++ b/src/uscxml/UUID.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef UUID_H_8X65R2EI #define UUID_H_8X65R2EI @@ -13,7 +32,7 @@ public: static std::string getUUID(); static boost::uuids::random_generator uuidGen; }; - + } diff --git a/src/uscxml/concurrency/BlockingQueue.h b/src/uscxml/concurrency/BlockingQueue.h index 0826590..a77bfb7 100644 --- a/src/uscxml/concurrency/BlockingQueue.h +++ b/src/uscxml/concurrency/BlockingQueue.h @@ -1,6 +1,26 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef BLOCKINGQUEUE_H_4LEVMY0N #define BLOCKINGQUEUE_H_4LEVMY0N +#include "uscxml/Common.h" #include "uscxml/concurrency/tinythread.h" #include <list> diff --git a/src/uscxml/concurrency/eventqueue/DelayedEventQueue.cpp b/src/uscxml/concurrency/eventqueue/DelayedEventQueue.cpp index 28bd343..b29c9ca 100644 --- a/src/uscxml/concurrency/eventqueue/DelayedEventQueue.cpp +++ b/src/uscxml/concurrency/eventqueue/DelayedEventQueue.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "uscxml/Message.h" #include "DelayedEventQueue.h" #include <glog/logging.h> @@ -31,8 +50,12 @@ void DelayedEventQueue::run(void* instance) { DelayedEventQueue* INSTANCE = (DelayedEventQueue*)instance; int result; while(INSTANCE->_isStarted) { +#ifndef EVLOOP_NO_EXIT_ON_EMPTY + result = event_base_dispatch(INSTANCE->_eventLoop); +#else //result = event_base_dispatch(THIS->_eventLoop); result = event_base_loop(INSTANCE->_eventLoop, EVLOOP_NO_EXIT_ON_EMPTY); +#endif (void)result; } } @@ -53,7 +76,7 @@ void DelayedEventQueue::addEvent(std::string eventId, int fd, short opMask, void _callbackData[eventId].callback = callback; _callbackData[eventId].event = event; _callbackData[eventId].persist = false; - + event_add(event, NULL); } diff --git a/src/uscxml/concurrency/eventqueue/DelayedEventQueue.h b/src/uscxml/concurrency/eventqueue/DelayedEventQueue.h index fa76c3f..90ff819 100644 --- a/src/uscxml/concurrency/eventqueue/DelayedEventQueue.h +++ b/src/uscxml/concurrency/eventqueue/DelayedEventQueue.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef DELAYEDEVENTQUEUE_H_JA6WRBVP #define DELAYEDEVENTQUEUE_H_JA6WRBVP @@ -15,15 +34,15 @@ namespace uscxml { -class DelayedEventQueue { +class USCXML_API DelayedEventQueue { public: enum OpMask { - DEQ_READ = EV_READ, - DEQ_WRITE = EV_WRITE, - DEQ_SIGNAL = EV_SIGNAL + DEQ_READ = EV_READ, + DEQ_WRITE = EV_WRITE, + DEQ_SIGNAL = EV_SIGNAL }; - + struct callbackData { void *userData; void (*callback)(void*, const std::string eventId); diff --git a/src/uscxml/concurrency/tinythread.h b/src/uscxml/concurrency/tinythread.h index 71edf6c..0490e4d 100644 --- a/src/uscxml/concurrency/tinythread.h +++ b/src/uscxml/concurrency/tinythread.h @@ -24,6 +24,8 @@ freely, subject to the following restrictions: #ifndef _TINYTHREAD_H_ #define _TINYTHREAD_H_ +#include "uscxml/Common.h" + /// @file /// @mainpage TinyThread++ API Reference /// @@ -161,7 +163,8 @@ unsigned long long int timeStamp(); /// program may deadlock if the thread that owns a mutex object calls lock() /// on that object). /// @see recursive_mutex -class mutex { + +class USCXML_API mutex { public: /// Constructor. mutex() @@ -229,7 +232,7 @@ public: #endif } - _TTHREAD_DISABLE_ASSIGNMENT(mutex) + //_TTHREAD_DISABLE_ASSIGNMENT(mutex) private: #if defined(_TTHREAD_WIN32_) @@ -248,7 +251,7 @@ private: /// may lock the mutex several times, as long as it unlocks the mutex the same /// number of times). /// @see mutex -class recursive_mutex { +class USCXML_API recursive_mutex { public: /// Constructor. recursive_mutex() { @@ -307,7 +310,7 @@ public: #endif } - _TTHREAD_DISABLE_ASSIGNMENT(recursive_mutex) + //_TTHREAD_DISABLE_ASSIGNMENT(recursive_mutex) private: #if defined(_TTHREAD_WIN32_) @@ -335,7 +338,7 @@ private: /// @endcode template <class T> -class lock_guard { +class USCXML_API lock_guard { public: typedef T mutex_type; @@ -382,7 +385,7 @@ private: /// cond.notify_all(); /// } /// @endcode -class condition_variable { +class USCXML_API condition_variable { public: /// Constructor. #if defined(_TTHREAD_WIN32_) @@ -451,7 +454,7 @@ public: } #endif - _TTHREAD_DISABLE_ASSIGNMENT(condition_variable) + //_TTHREAD_DISABLE_ASSIGNMENT(condition_variable) private: #if defined(_TTHREAD_WIN32_) @@ -466,7 +469,7 @@ private: /// Thread class. -class thread { +class USCXML_API thread { public: #if defined(_TTHREAD_WIN32_) typedef HANDLE native_handle_type; @@ -535,7 +538,7 @@ public: /// @note If this value is not defined, the function returns zero (0). static unsigned hardware_concurrency(); - _TTHREAD_DISABLE_ASSIGNMENT(thread) + //_TTHREAD_DISABLE_ASSIGNMENT(thread) private: native_handle_type mHandle; ///< Thread handle. @@ -556,7 +559,7 @@ private: /// Thread ID. /// The thread ID is a unique identifier for each thread. /// @see thread::get_id() -class thread::id { +class USCXML_API thread::id { public: /// Default constructor. /// The default constructed ID is that of thread without a thread of @@ -623,7 +626,7 @@ public: namespace chrono { /// Duration template class. This class provides enough functionality to /// implement @c this_thread::sleep_for(). -template <class _Rep, class _Period = ratio<1> > class duration { +template <class _Rep, class _Period = ratio<1> > class USCXML_API duration { private: _Rep rep_; public: diff --git a/src/uscxml/debug/SCXMLDotWriter.cpp b/src/uscxml/debug/SCXMLDotWriter.cpp index d6a9a49..4c5b20b 100644 --- a/src/uscxml/debug/SCXMLDotWriter.cpp +++ b/src/uscxml/debug/SCXMLDotWriter.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "uscxml/Common.h" #include "SCXMLDotWriter.h" #include <boost/algorithm/string.hpp> // replace_all diff --git a/src/uscxml/debug/SCXMLDotWriter.h b/src/uscxml/debug/SCXMLDotWriter.h index 07b34b1..2d3625c 100644 --- a/src/uscxml/debug/SCXMLDotWriter.h +++ b/src/uscxml/debug/SCXMLDotWriter.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef SCXMLDOTWRITER_H_AOP0OHXX #define SCXMLDOTWRITER_H_AOP0OHXX @@ -32,7 +51,7 @@ class Interpreter; * # unflatten can be used to create more compact graphs * find . -name "*.dot" -exec unflatten -f -l2 -o {}.flat.dot {} \; */ -class SCXMLDotWriter : public InterpreterMonitor { +class USCXML_API SCXMLDotWriter : public InterpreterMonitor { public: struct ElemDetails { diff --git a/src/uscxml/interpreter/InterpreterDraft6.cpp b/src/uscxml/interpreter/InterpreterDraft6.cpp index 7ea09c2..5e12549 100644 --- a/src/uscxml/interpreter/InterpreterDraft6.cpp +++ b/src/uscxml/interpreter/InterpreterDraft6.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "InterpreterDraft6.h" #include <glog/logging.h> diff --git a/src/uscxml/interpreter/InterpreterDraft6.h b/src/uscxml/interpreter/InterpreterDraft6.h index 36dedce..7550124 100644 --- a/src/uscxml/interpreter/InterpreterDraft6.h +++ b/src/uscxml/interpreter/InterpreterDraft6.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef INTERPRETERDRAFT6_H_JAXK9FE1 #define INTERPRETERDRAFT6_H_JAXK9FE1 diff --git a/src/uscxml/interpreter/InterpreterDraft7.cpp b/src/uscxml/interpreter/InterpreterDraft7.cpp index fa578b3..a8544fa 100644 --- a/src/uscxml/interpreter/InterpreterDraft7.cpp +++ b/src/uscxml/interpreter/InterpreterDraft7.cpp @@ -1,3 +1,23 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "uscxml/Common.h" #include "InterpreterDraft7.h" #include <glog/logging.h> diff --git a/src/uscxml/interpreter/InterpreterDraft7.h b/src/uscxml/interpreter/InterpreterDraft7.h index c220c23..f1aeabd 100644 --- a/src/uscxml/interpreter/InterpreterDraft7.h +++ b/src/uscxml/interpreter/InterpreterDraft7.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef INTERPRETERDRAFT7_H_WLJEI019 #define INTERPRETERDRAFT7_H_WLJEI019 diff --git a/src/uscxml/pch.h b/src/uscxml/pch.h index e4ae2d1..c69abce 100644 --- a/src/uscxml/pch.h +++ b/src/uscxml/pch.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "uscxml/Common.h" #include <boost/algorithm/string.hpp> diff --git a/src/uscxml/plugins/Plugins.cpp b/src/uscxml/plugins/Plugins.cpp index 1f74a28..b2643f7 100644 --- a/src/uscxml/plugins/Plugins.cpp +++ b/src/uscxml/plugins/Plugins.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "Plugins.h" namespace uscxml { diff --git a/src/uscxml/plugins/Plugins.h b/src/uscxml/plugins/Plugins.h index 8b574b1..537d3fe 100644 --- a/src/uscxml/plugins/Plugins.h +++ b/src/uscxml/plugins/Plugins.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef PLUGINS_H_M6G1NF1E #define PLUGINS_H_M6G1NF1E diff --git a/src/uscxml/plugins/Pluma/PluginManager.cpp b/src/uscxml/plugins/Pluma/PluginManager.cpp index 60cb46e..22e0438 100644 --- a/src/uscxml/plugins/Pluma/PluginManager.cpp +++ b/src/uscxml/plugins/Pluma/PluginManager.cpp @@ -53,10 +53,10 @@ bool PluginManager::load(const std::string& path) { if (!lib) return false;
fnRegisterPlugin* registerFunction;
- registerFunction = reinterpret_cast<fnRegisterPlugin*>(lib->getSymbol("connect"));
+ registerFunction = reinterpret_cast<fnRegisterPlugin*>(lib->getSymbol("pluginConnect"));
if(!registerFunction) {
- fprintf(stderr, "Failed to initialize plugin \"%s\": connect function not found\n", plugName.c_str());
+ fprintf(stderr, "Failed to initialize plugin \"%s\": pluginConnect function not found\n", plugName.c_str());
delete lib;
return false;
}
diff --git a/src/uscxml/plugins/Pluma/Provider.hpp b/src/uscxml/plugins/Pluma/Provider.hpp index ea06497..d01e7f4 100755 --- a/src/uscxml/plugins/Pluma/Provider.hpp +++ b/src/uscxml/plugins/Pluma/Provider.hpp @@ -161,7 +161,7 @@ private: /// #include "Keyboard.hpp"
///
/// PLUMA_CONNECTOR
-/// bool connect(pluma::Host& host){
+/// bool pluginConnect(pluma::Host& host){
/// // add a keyboard provider to host
/// host.add( new KeyboardProvider() );
/// return true;
diff --git a/src/uscxml/plugins/datamodel/CMakeLists.txt b/src/uscxml/plugins/datamodel/CMakeLists.txt index 4811551..e23d534 100644 --- a/src/uscxml/plugins/datamodel/CMakeLists.txt +++ b/src/uscxml/plugins/datamodel/CMakeLists.txt @@ -19,7 +19,8 @@ if (BUILD_DM_ECMA) add_library( datamodel_jsc SHARED ${JSC_DATAMODEL} - ${JSC_DOM}) + ${JSC_DOM} + "../Plugins.cpp") target_link_libraries(datamodel_jsc uscxml ${JSC_LIBRARY}) set_target_properties(datamodel_jsc PROPERTIES FOLDER "Plugin DataModel") else() @@ -51,7 +52,8 @@ if (BUILD_DM_ECMA) add_library( datamodel_v8 SHARED ${V8_DATAMODEL} - ${V8_DOM}) + ${V8_DOM} + "../Plugins.cpp") target_link_libraries(datamodel_v8 uscxml ${V8_LIBRARY}) set_target_properties(datamodel_v8 PROPERTIES FOLDER "Plugin DataModel") else() @@ -72,9 +74,10 @@ file(GLOB NULL_DATAMODEL ) if (BUILD_AS_PLUGINS) source_group("" FILES ${NULL_DATAMODEL}) - add_library(datamodel_null SHARED ${NULL_DATAMODEL}) + add_library(datamodel_null SHARED ${NULL_DATAMODEL} "../Plugins.cpp") target_link_libraries(datamodel_null uscxml) set_target_properties(datamodel_null PROPERTIES FOLDER "Plugin DataModel") + set_target_properties(datamodel_null PROPERTIES COMPILE_FLAGS "-DPLUGIN_EXPORTS") else() list (APPEND USCXML_FILES ${NULL_DATAMODEL}) endif() @@ -90,7 +93,7 @@ if (BUILD_DM_XPATH) ) if (BUILD_AS_PLUGINS) source_group("" FILES ${XPATH_DATAMODEL}) - add_library(datamodel_xpath SHARED ${XPATH_DATAMODEL}) + add_library(datamodel_xpath SHARED ${XPATH_DATAMODEL} "../Plugins.cpp") target_link_libraries(datamodel_xpath uscxml) set_target_properties(datamodel_xpath PROPERTIES FOLDER "Plugin DataModel") else() @@ -118,7 +121,8 @@ if (SWI_FOUND AND BUILD_DM_PROLOG) source_group("" FILES ${SWI_DATAMODEL}) add_library( datamodel_swi SHARED - ${SWI_DATAMODEL}) + ${SWI_DATAMODEL} + "../Plugins.cpp") target_link_libraries(datamodel_swi uscxml ${GMP_LIBRARY} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.cpp index f2c3a8e..2a84c24 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "JSCDOM.h" namespace Arabica { diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h index 5953c0e..5a6bfea 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef JSCDOM_H_1RC5LCG8 #define JSCDOM_H_1RC5LCG8 diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp index b2f66b4..4a4a6e7 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "uscxml/Common.h" #include "uscxml/config.h" #include "JSCDataModel.h" @@ -47,7 +66,7 @@ using namespace Arabica::DOM; #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new JSCDataModelProvider() ); return true; } @@ -119,7 +138,7 @@ boost::shared_ptr<DataModelImpl> JSCDataModel::create(InterpreterImpl* interpret JSObjectRef jsPrint = JSObjectMake(dm->_ctx, jsPrintClassRef, dm.get()); JSStringRef printName = JSStringCreateWithUTF8CString("print"); JSObjectSetProperty(dm->_ctx, JSContextGetGlobalObject(dm->_ctx), printName, jsPrint, kJSPropertyAttributeNone, NULL); - JSStringRelease(inName); + JSStringRelease(printName); JSClassRef jsInvokerClassRef = JSClassCreate(&jsInvokersClassDef); JSObjectRef jsInvoker = JSObjectMake(dm->_ctx, jsInvokerClassRef, dm.get()); @@ -309,11 +328,11 @@ JSValueRef JSCDataModel::getDataAsValue(const Data& data) { } if (data.binary) { uscxml::ArrayBuffer* localInstance = new uscxml::ArrayBuffer(data.binary); - + JSClassRef retClass = JSCArrayBuffer::getTmpl(); struct JSCArrayBuffer::JSCArrayBufferPrivate* retPrivData = new JSCArrayBuffer::JSCArrayBufferPrivate(); retPrivData->nativeObj = localInstance; - + JSObjectRef retObj = JSObjectMake(_ctx, retClass, retPrivData); return retObj; } diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h index 9bb3034..fc35b46 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef JSCDATAMODEL_H_KN8TWG0V #define JSCDATAMODEL_H_KN8TWG0V diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBuffer.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBuffer.cpp index a7c27e1..64f7028 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBuffer.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBuffer.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCArrayBuffer.h" namespace Arabica { diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBuffer.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBuffer.h index 452b652..b7817f5 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBuffer.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBuffer.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCArrayBuffer_h #define JSCArrayBuffer_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBufferView.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBufferView.cpp index 031bed5..ad567e8 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBufferView.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBufferView.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCArrayBuffer.h" #include "JSCArrayBufferView.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBufferView.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBufferView.h index ab683c2..11f4ee4 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBufferView.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBufferView.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCArrayBufferView_h #define JSCArrayBufferView_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCAttr.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCAttr.cpp index e870216..31349cb 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCAttr.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCAttr.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCAttr.h" #include "JSCElement.h" #include "JSCNode.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCAttr.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCAttr.h index 3e98cab..3c4ff56 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCAttr.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCAttr.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCAttr_h #define JSCAttr_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCDATASection.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCDATASection.cpp index 4a6fd86..3969a92 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCDATASection.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCDATASection.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCCDATASection.h" #include "JSCText.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCDATASection.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCDATASection.h index f0ec864..3e642a2 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCDATASection.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCDATASection.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCCDATASection_h #define JSCCDATASection_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCharacterData.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCharacterData.cpp index 1b87bcc..cfb1720 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCharacterData.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCharacterData.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCCharacterData.h" #include "JSCNode.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCharacterData.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCharacterData.h index 1155a0a..7e9f672 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCharacterData.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCharacterData.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCCharacterData_h #define JSCCharacterData_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCComment.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCComment.cpp index 344e795..c8ae170 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCComment.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCComment.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCCharacterData.h" #include "JSCComment.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCComment.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCComment.h index 63bf840..d6f84c7 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCComment.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCComment.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCComment_h #define JSCComment_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDOMImplementation.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDOMImplementation.cpp index 81b3e46..7bdca82 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDOMImplementation.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDOMImplementation.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCDOMImplementation.h" #include "JSCDocument.h" #include "JSCDocumentType.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDOMImplementation.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDOMImplementation.h index 9169604..bfb691f 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDOMImplementation.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDOMImplementation.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCDOMImplementation_h #define JSCDOMImplementation_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDataView.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDataView.cpp index 530e157..958a2fe 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDataView.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDataView.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCArrayBuffer.h" #include "JSCArrayBufferView.h" #include "JSCDataView.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDataView.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDataView.h index e63805a..1b66076 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDataView.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDataView.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCDataView_h #define JSCDataView_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocument.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocument.cpp index a80bad8..1527884 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocument.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocument.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCAttr.h" #include "JSCCDATASection.h" #include "JSCComment.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocument.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocument.h index 7663d98..c4c0185 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocument.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocument.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCDocument_h #define JSCDocument_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentCustom.cpp index 52d6a88..6f15c72 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentCustom.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentCustom.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "JSCDocument.h" #include "JSCStorage.h" #include "JSCXPathResult.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentFragment.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentFragment.cpp index 4bcbb21..d52c923 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentFragment.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentFragment.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCDocumentFragment.h" #include "JSCNode.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentFragment.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentFragment.h index fbe47e9..6e8187e 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentFragment.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentFragment.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCDocumentFragment_h #define JSCDocumentFragment_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentType.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentType.cpp index b57424f..1c75dcd 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentType.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentType.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCDocumentType.h" #include "JSCNamedNodeMap.h" #include "JSCNode.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentType.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentType.h index 635f78d..4b98ca6 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentType.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentType.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCDocumentType_h #define JSCDocumentType_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCElement.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCElement.cpp index 5bf50cf..33f6f70 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCElement.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCElement.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCAttr.h" #include "JSCElement.h" #include "JSCNode.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCElement.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCElement.h index 43df02d..834ceb7 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCElement.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCElement.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCElement_h #define JSCElement_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntity.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntity.cpp index 6b51ad0..4dec699 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntity.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntity.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCEntity.h" #include "JSCNode.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntity.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntity.h index b952750..fe70846 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntity.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntity.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCEntity_h #define JSCEntity_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntityReference.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntityReference.cpp index ea6c41e..fe67b5d 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntityReference.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntityReference.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCEntityReference.h" #include "JSCNode.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntityReference.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntityReference.h index 2dddf57..89a7c44 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntityReference.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntityReference.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCEntityReference_h #define JSCEntityReference_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat32Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat32Array.cpp index 32f7929..924f40f 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat32Array.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat32Array.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCArrayBuffer.h" #include "JSCArrayBufferView.h" #include "JSCFloat32Array.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat32Array.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat32Array.h index 62fce52..567c673 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat32Array.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat32Array.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCFloat32Array_h #define JSCFloat32Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat64Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat64Array.cpp index ee9743d..a58bce9 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat64Array.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat64Array.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCArrayBuffer.h" #include "JSCArrayBufferView.h" #include "JSCFloat64Array.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat64Array.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat64Array.h index 3b8fb44..07b1b48 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat64Array.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat64Array.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCFloat64Array_h #define JSCFloat64Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt16Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt16Array.cpp index 2dbcce8..e887378 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt16Array.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt16Array.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCArrayBuffer.h" #include "JSCArrayBufferView.h" #include "JSCInt16Array.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt16Array.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt16Array.h index 992984e..232ae65 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt16Array.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt16Array.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCInt16Array_h #define JSCInt16Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt32Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt32Array.cpp index 3e10dfe..b868e9b 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt32Array.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt32Array.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCArrayBuffer.h" #include "JSCArrayBufferView.h" #include "JSCInt32Array.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt32Array.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt32Array.h index 0174759..2c86dde 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt32Array.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt32Array.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCInt32Array_h #define JSCInt32Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt8Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt8Array.cpp index 0cb1cb8..28bb6b4 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt8Array.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt8Array.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCArrayBuffer.h" #include "JSCArrayBufferView.h" #include "JSCInt8Array.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt8Array.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt8Array.h index 6d24a03..834ba1d 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt8Array.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt8Array.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCInt8Array_h #define JSCInt8Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNamedNodeMap.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNamedNodeMap.cpp index 4efde43..c0e53bf 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNamedNodeMap.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNamedNodeMap.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCNamedNodeMap.h" #include "JSCNode.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNamedNodeMap.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNamedNodeMap.h index 251ab72..aa4876f 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNamedNodeMap.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNamedNodeMap.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCNamedNodeMap_h #define JSCNamedNodeMap_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNode.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNode.cpp index 2abf023..7f9ddb0 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNode.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNode.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCDocument.h" #include "JSCNode.h" #include "JSCNodeList.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNode.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNode.h index 9849d72..ced6bc3 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNode.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNode.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCNode_h #define JSCNode_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeCustom.cpp index 159ff56..b135044 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeCustom.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeCustom.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "JSCNode.h" #include "JSCNamedNodeMap.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeList.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeList.cpp index 793e989..6a3acfb 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeList.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeList.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCNode.h" #include "JSCNodeList.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeList.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeList.h index feb9be5..ec6a73c 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeList.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeList.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCNodeList_h #define JSCNodeList_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeListCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeListCustom.cpp index 547288b..91c18e5 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeListCustom.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeListCustom.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "JSCNodeList.h" #include "JSCElement.h" #include "JSCNode.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSet.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSet.cpp index ea7e64b..cf4a8de 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSet.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSet.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCNodeSet.h" namespace Arabica { diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSet.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSet.h index 5db3af8..8b56cc2 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSet.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSet.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCNodeSet_h #define JSCNodeSet_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSetCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSetCustom.cpp index 98f563e..821f463 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSetCustom.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSetCustom.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "JSCNodeSet.h" #include "JSCElement.h" #include "JSCNode.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNotation.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNotation.cpp index 8ea57ff..6ff9079 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNotation.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNotation.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCNode.h" #include "JSCNotation.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNotation.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNotation.h index b043d14..1e68f30 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNotation.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNotation.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCNotation_h #define JSCNotation_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCProcessingInstruction.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCProcessingInstruction.cpp index 9ea0220..c712c60 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCProcessingInstruction.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCProcessingInstruction.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCNode.h" #include "JSCProcessingInstruction.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCProcessingInstruction.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCProcessingInstruction.h index 4ebdefb..2defbc5 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCProcessingInstruction.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCProcessingInstruction.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCProcessingInstruction_h #define JSCProcessingInstruction_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.cpp index 9a7b8bb..174b704 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCNode.h" #include "JSCSCXMLEvent.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.h index 5ac8ccb..1b3726a 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCSCXMLEvent_h #define JSCSCXMLEvent_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEventCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEventCustom.cpp index e197796..9d128b6 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEventCustom.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEventCustom.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "JSCSCXMLEvent.h" namespace Arabica { diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCStorage.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCStorage.cpp index 4ad6f74..9bd3d73 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCStorage.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCStorage.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCStorage.h" namespace Arabica { diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCStorage.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCStorage.h index afb9714..faa2f8b 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCStorage.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCStorage.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCStorage_h #define JSCStorage_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCText.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCText.cpp index 84ff887..be25753 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCText.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCText.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCCharacterData.h" #include "JSCText.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCText.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCText.h index 663124f..0b440a1 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCText.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCText.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCText_h #define JSCText_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCTypedArrayCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCTypedArrayCustom.cpp index 3c0f3d5..1738899 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCTypedArrayCustom.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCTypedArrayCustom.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "../../TypedArray.h" #include "JSCArrayBuffer.h" #include "JSCInt8Array.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint16Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint16Array.cpp index 3c5a588..d869d1e 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint16Array.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint16Array.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCArrayBuffer.h" #include "JSCArrayBufferView.h" #include "JSCUint16Array.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint16Array.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint16Array.h index 90b92f4..8f534ea 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint16Array.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint16Array.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCUint16Array_h #define JSCUint16Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint32Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint32Array.cpp index 28dde30..8fbefb3 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint32Array.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint32Array.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCArrayBuffer.h" #include "JSCArrayBufferView.h" #include "JSCUint32Array.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint32Array.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint32Array.h index 9516f5f..50d2c2f 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint32Array.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint32Array.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCUint32Array_h #define JSCUint32Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8Array.cpp index 5698b40..fbdbb14 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8Array.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8Array.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCArrayBuffer.h" #include "JSCArrayBufferView.h" #include "JSCUint8Array.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8Array.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8Array.h index 5510c99..10532e5 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8Array.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8Array.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCUint8Array_h #define JSCUint8Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8ClampedArray.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8ClampedArray.cpp index d0263ed..848a507 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8ClampedArray.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8ClampedArray.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCArrayBuffer.h" #include "JSCArrayBufferView.h" #include "JSCUint8ClampedArray.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8ClampedArray.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8ClampedArray.h index 36e7d8a..4a9b83f 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8ClampedArray.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8ClampedArray.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCUint8ClampedArray_h #define JSCUint8ClampedArray_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResult.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResult.cpp index a53585f..eb443f6 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResult.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResult.cpp @@ -1,3 +1,21 @@ +/** + * @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 "JSCNodeSet.h" #include "JSCXPathResult.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResult.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResult.h index 9686a2c..fe37edf 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResult.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResult.h @@ -1,22 +1,21 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ #ifndef JSCXPathResult_h #define JSCXPathResult_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResultCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResultCustom.cpp index 7ef2755..42b4ea1 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResultCustom.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResultCustom.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "JSCXPathResult.h" #include "JSCNode.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/Storage.cpp b/src/uscxml/plugins/datamodel/ecmascript/Storage.cpp index b3071ee..edab33c 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/Storage.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/Storage.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "Storage.h" #include <iostream> diff --git a/src/uscxml/plugins/datamodel/ecmascript/Storage.h b/src/uscxml/plugins/datamodel/ecmascript/Storage.h index 7caeb76..6ec62dd 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/Storage.h +++ b/src/uscxml/plugins/datamodel/ecmascript/Storage.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef STORAGE_H_L672TNX #define STORAGE_H_L672TNX diff --git a/src/uscxml/plugins/datamodel/ecmascript/TypedArray.cpp b/src/uscxml/plugins/datamodel/ecmascript/TypedArray.cpp index 8d126e9..6d5b415 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/TypedArray.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/TypedArray.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "TypedArray.h" #include <iostream> #include <boost/detail/endian.hpp> diff --git a/src/uscxml/plugins/datamodel/ecmascript/TypedArray.h b/src/uscxml/plugins/datamodel/ecmascript/TypedArray.h index e7d7e4c..56d2332 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/TypedArray.h +++ b/src/uscxml/plugins/datamodel/ecmascript/TypedArray.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef TYPEDARRAY_H_99815BLY #define TYPEDARRAY_H_99815BLY diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.cpp index be20bee..b09d670 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "V8DOM.h" namespace Arabica { diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h index f35b13f..2fa5b81 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef V8DOM_H_LKE1HKJK #define V8DOM_H_LKE1HKJK diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp index d479a63..b0ffcea 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "uscxml/Common.h" #include "uscxml/config.h" #include "V8DataModel.h" @@ -46,7 +65,7 @@ using namespace Arabica::DOM; #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new V8DataModelProvider() ); return true; } @@ -157,7 +176,7 @@ v8::Handle<v8::Value> V8DataModel::getIOProcessors(v8::Local<v8::String> propert while(ioProcIter != ioProcessors.end()) { // std::cout << ioProcIter->first << std::endl; dataModel->_ioProcessors->Set(v8::String::New(ioProcIter->first.c_str()), - dataModel->getDataAsValue(ioProcIter->second.getDataModelVariables())); + dataModel->getDataAsValue(ioProcIter->second.getDataModelVariables())); ioProcIter++; } return dataModel->_ioProcessors; @@ -165,7 +184,7 @@ v8::Handle<v8::Value> V8DataModel::getIOProcessors(v8::Local<v8::String> propert v8::Handle<v8::Value> V8DataModel::getInvokers(v8::Local<v8::String> property, const v8::AccessorInfo& info) { V8DataModel* dataModel = V8DOM::toClassPtr<V8DataModel>(info.Data()); - + dataModel->_invokers = v8::Persistent<v8::Object>::New(v8::Object::New()); //v8::Handle<v8::Object> ioProcessorObj = v8::Object::New(); std::map<std::string, Invoker> invokers = dataModel->_interpreter->getInvokers(); @@ -173,7 +192,7 @@ v8::Handle<v8::Value> V8DataModel::getInvokers(v8::Local<v8::String> property, c while(invokerIter != invokers.end()) { // std::cout << ioProcIter->first << std::endl; dataModel->_invokers->Set(v8::String::New(invokerIter->first.c_str()), - dataModel->getDataAsValue(invokerIter->second.getDataModelVariables())); + dataModel->getDataAsValue(invokerIter->second.getDataModelVariables())); invokerIter++; } return dataModel->_invokers; @@ -376,12 +395,12 @@ v8::Handle<v8::Value> V8DataModel::getDataAsValue(const Data& data) { } if (data.atom.length() > 0) { switch (data.type) { - case Data::VERBATIM: - return v8::String::New(data.atom.c_str()); - break; - case Data::INTERPRETED: - return evalAsValue(data.atom); - break; + case Data::VERBATIM: + return v8::String::New(data.atom.c_str()); + break; + case Data::INTERPRETED: + return evalAsValue(data.atom); + break; } } if (data.binary) { diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h index 1672919..17ca7bc 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef V8DATAMODEL_H_KN8TWG0V #define V8DATAMODEL_H_KN8TWG0V diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.cpp index ce51887..a4fc18a 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8ArrayBuffer.h" namespace Arabica { diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.h index 767d520..695947d 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8ArrayBuffer_h #define V8ArrayBuffer_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBufferView.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBufferView.cpp index 562b9f3..60a2530 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBufferView.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBufferView.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8ArrayBuffer.h" #include "V8ArrayBufferView.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBufferView.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBufferView.h index 1f4a75c..8ed542f 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBufferView.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBufferView.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8ArrayBufferView_h #define V8ArrayBufferView_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Attr.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Attr.cpp index efb9a75..9480cb6 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Attr.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Attr.cpp @@ -1,3 +1,22 @@ +/** + * @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" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Attr.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Attr.h index f216215..ca0c58b 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Attr.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Attr.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8Attr_h #define V8Attr_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CDATASection.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CDATASection.cpp index a348cd5..2d833fe 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CDATASection.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CDATASection.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8CDATASection.h" #include "V8Text.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CDATASection.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CDATASection.h index 5f936d2..b7d2a2e 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CDATASection.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CDATASection.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8CDATASection_h #define V8CDATASection_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CharacterData.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CharacterData.cpp index 673e6a8..217d035 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CharacterData.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CharacterData.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8CharacterData.h" #include "V8Node.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CharacterData.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CharacterData.h index d5846e4..bf21603 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CharacterData.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CharacterData.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8CharacterData_h #define V8CharacterData_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Comment.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Comment.cpp index 97cd948..9c7e0a7 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Comment.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Comment.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8CharacterData.h" #include "V8Comment.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Comment.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Comment.h index a19462d..e0ed9a7 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Comment.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Comment.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8Comment_h #define V8Comment_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DOMImplementation.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DOMImplementation.cpp index 00fe645..a9c3838 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DOMImplementation.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DOMImplementation.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8DOMImplementation.h" #include "V8Document.h" #include "V8DocumentType.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DOMImplementation.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DOMImplementation.h index 58d6f9a..5627a19 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DOMImplementation.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DOMImplementation.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8DOMImplementation_h #define V8DOMImplementation_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DataView.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DataView.cpp index 4611595..1eaca4f 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DataView.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DataView.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8ArrayBuffer.h" #include "V8ArrayBufferView.h" #include "V8DataView.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DataView.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DataView.h index e2d2351..aa19473 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DataView.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DataView.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8DataView_h #define V8DataView_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Document.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Document.cpp index c45039c..1e4a2dc 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Document.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Document.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8CDATASection.h" #include "V8Comment.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Document.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Document.h index a023ac9..cebc5d1 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Document.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Document.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8Document_h #define V8Document_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentCustom.cpp index cd7f942..2e4d7c4 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentCustom.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentCustom.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "V8Document.h" #include "V8XPathResult.h" #include "V8Storage.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentFragment.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentFragment.cpp index fa655ae..359f6e5 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentFragment.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentFragment.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8DocumentFragment.h" #include "V8Node.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentFragment.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentFragment.h index 641aacd..89d19d3 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentFragment.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentFragment.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8DocumentFragment_h #define V8DocumentFragment_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentType.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentType.cpp index 3b60da4..a8839a4 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentType.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentType.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8DocumentType.h" #include "V8NamedNodeMap.h" #include "V8Node.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentType.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentType.h index d1551a3..9aec676 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentType.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentType.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8DocumentType_h #define V8DocumentType_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Element.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Element.cpp index 87ea5be..15d4c94 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Element.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Element.cpp @@ -1,3 +1,22 @@ +/** + * @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" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Element.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Element.h index 7263ab1..ec87070 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Element.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Element.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8Element_h #define V8Element_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Entity.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Entity.cpp index 2cb07ae..e26bdb6 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Entity.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Entity.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8Entity.h" #include "V8Node.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Entity.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Entity.h index 88a284b..f6947b0 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Entity.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Entity.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8Entity_h #define V8Entity_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8EntityReference.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8EntityReference.cpp index 228ac79..eb12655 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8EntityReference.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8EntityReference.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8EntityReference.h" #include "V8Node.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8EntityReference.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8EntityReference.h index cc25213..47b4430 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8EntityReference.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8EntityReference.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8EntityReference_h #define V8EntityReference_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float32Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float32Array.cpp index 2e314b4..e49c2dc 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float32Array.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float32Array.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8ArrayBuffer.h" #include "V8ArrayBufferView.h" #include "V8Float32Array.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float32Array.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float32Array.h index 0eec20f..6684b58 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float32Array.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float32Array.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8Float32Array_h #define V8Float32Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float64Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float64Array.cpp index a08fdc9..3b844b5 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float64Array.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float64Array.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8ArrayBuffer.h" #include "V8ArrayBufferView.h" #include "V8Float64Array.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float64Array.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float64Array.h index bd7755e..0aa54a8 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float64Array.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float64Array.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8Float64Array_h #define V8Float64Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int16Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int16Array.cpp index 44eebb7..6a7e136 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int16Array.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int16Array.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8ArrayBuffer.h" #include "V8ArrayBufferView.h" #include "V8Int16Array.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int16Array.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int16Array.h index ea5cc21..0de8d89 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int16Array.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int16Array.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8Int16Array_h #define V8Int16Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int32Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int32Array.cpp index 7eeaef0..c4055ca 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int32Array.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int32Array.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8ArrayBuffer.h" #include "V8ArrayBufferView.h" #include "V8Int32Array.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int32Array.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int32Array.h index d3c5b71..431c355 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int32Array.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int32Array.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8Int32Array_h #define V8Int32Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int8Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int8Array.cpp index f9b5fdb..9698414 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int8Array.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int8Array.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8ArrayBuffer.h" #include "V8ArrayBufferView.h" #include "V8Int8Array.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int8Array.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int8Array.h index 2802c5f..396139d 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int8Array.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int8Array.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8Int8Array_h #define V8Int8Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NamedNodeMap.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NamedNodeMap.cpp index a405fd0..b55b9d1 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NamedNodeMap.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NamedNodeMap.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8NamedNodeMap.h" #include "V8Node.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NamedNodeMap.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NamedNodeMap.h index d918186..71e501b 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NamedNodeMap.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NamedNodeMap.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8NamedNodeMap_h #define V8NamedNodeMap_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Node.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Node.cpp index 9d0cd62..ec66b15 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Node.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Node.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8Document.h" #include "V8Node.h" #include "V8NodeList.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Node.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Node.h index b4fbad4..5a512ef 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Node.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Node.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8Node_h #define V8Node_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeCustom.cpp index 09f9e1d..af43e20 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeCustom.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeCustom.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "V8Node.h" #include "V8NamedNodeMap.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeList.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeList.cpp index 4f37d14..efe5fa8 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeList.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeList.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8Node.h" #include "V8NodeList.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeList.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeList.h index 341c63a..570ad66 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeList.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeList.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8NodeList_h #define V8NodeList_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeListCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeListCustom.cpp index c05c5a4..69af5b0 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeListCustom.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeListCustom.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "V8NodeList.h" #include "V8Element.h" #include "V8Node.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeSet.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeSet.cpp index 4580ef4..a011465 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeSet.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeSet.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8NodeSet.h" namespace Arabica { diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeSet.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeSet.h index b95f4c1..85254d5 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeSet.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeSet.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8NodeSet_h #define V8NodeSet_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeSetCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeSetCustom.cpp index ba84b75..31298f0 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeSetCustom.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeSetCustom.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "V8NodeSet.h" #include "V8Element.h" #include "V8Node.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Notation.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Notation.cpp index 6a53ba6..1ec9b88 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Notation.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Notation.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8Node.h" #include "V8Notation.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Notation.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Notation.h index 51f324b..9c574bd 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Notation.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Notation.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8Notation_h #define V8Notation_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ProcessingInstruction.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ProcessingInstruction.cpp index 1b819d8..06fdc7a 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ProcessingInstruction.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ProcessingInstruction.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8Node.h" #include "V8ProcessingInstruction.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ProcessingInstruction.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ProcessingInstruction.h index d31d5d9..20700d2 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ProcessingInstruction.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ProcessingInstruction.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8ProcessingInstruction_h #define V8ProcessingInstruction_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.cpp index 0f750ee..d459bc2 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8Node.h" #include "V8SCXMLEvent.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.h index 9cc4ad4..72f85c6 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8SCXMLEvent_h #define V8SCXMLEvent_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEventCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEventCustom.cpp index a8870cc..0876f81 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEventCustom.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEventCustom.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "V8SCXMLEvent.h" namespace Arabica { diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Storage.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Storage.cpp index 7cd90f9..f1fb9b6 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Storage.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Storage.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8Storage.h" namespace Arabica { diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Storage.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Storage.h index 4d6692d..b3d4c53 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Storage.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Storage.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8Storage_h #define V8Storage_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Text.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Text.cpp index c37970f..ec06237 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Text.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Text.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8CharacterData.h" #include "V8Text.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Text.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Text.h index 0604984..1151311 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Text.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Text.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8Text_h #define V8Text_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8TypedArrayCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8TypedArrayCustom.cpp index 95e86de..dc25a4f 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8TypedArrayCustom.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8TypedArrayCustom.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "../../TypedArray.h" #include "V8ArrayBuffer.h" #include "V8Int8Array.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint16Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint16Array.cpp index f39c4ac..1fbe1d5 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint16Array.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint16Array.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8ArrayBuffer.h" #include "V8ArrayBufferView.h" #include "V8Uint16Array.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint16Array.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint16Array.h index ca9a40a..3f94ab8 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint16Array.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint16Array.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8Uint16Array_h #define V8Uint16Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint32Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint32Array.cpp index 4054d5e..10f3b3c 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint32Array.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint32Array.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8ArrayBuffer.h" #include "V8ArrayBufferView.h" #include "V8Uint32Array.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint32Array.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint32Array.h index a119719..2ecaa9e 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint32Array.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint32Array.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8Uint32Array_h #define V8Uint32Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8Array.cpp index 9d387b6..3a8248a 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8Array.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8Array.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8ArrayBuffer.h" #include "V8ArrayBufferView.h" #include "V8Uint8Array.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8Array.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8Array.h index e32007f..9ecc219 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8Array.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8Array.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8Uint8Array_h #define V8Uint8Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8ClampedArray.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8ClampedArray.cpp index be470fa..e05c8a8 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8ClampedArray.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8ClampedArray.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8ArrayBuffer.h" #include "V8ArrayBufferView.h" #include "V8Uint8ClampedArray.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8ClampedArray.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8ClampedArray.h index 8e130f4..3fa08de 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8ClampedArray.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8ClampedArray.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8Uint8ClampedArray_h #define V8Uint8ClampedArray_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8XPathResult.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8XPathResult.cpp index 265bcfe..8bfd883 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8XPathResult.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8XPathResult.cpp @@ -1,3 +1,22 @@ +/** + * @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 "V8NodeSet.h" #include "V8XPathResult.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8XPathResult.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8XPathResult.h index b613b93..3aab7b0 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8XPathResult.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8XPathResult.h @@ -1,22 +1,22 @@ -/* - This file is part of the Wrapper open source project. - This file has been generated by generate-bindings.pl. DO NOT MODIFY! - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ +/** + * @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 + */ + #ifndef V8XPathResult_h #define V8XPathResult_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8XPathResultCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8XPathResultCustom.cpp index 6accfc7..3e4063f 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8XPathResultCustom.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8XPathResultCustom.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "V8XPathResult.h" #include "V8Node.h" diff --git a/src/uscxml/plugins/datamodel/null/NULLDataModel.cpp b/src/uscxml/plugins/datamodel/null/NULLDataModel.cpp index e351b1d..12f2a70 100644 --- a/src/uscxml/plugins/datamodel/null/NULLDataModel.cpp +++ b/src/uscxml/plugins/datamodel/null/NULLDataModel.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "uscxml/Common.h" #include "NULLDataModel.h" @@ -12,7 +31,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new NULLDataModelProvider() ); return true; } diff --git a/src/uscxml/plugins/datamodel/null/NULLDataModel.h b/src/uscxml/plugins/datamodel/null/NULLDataModel.h index 74d170f..781bb99 100644 --- a/src/uscxml/plugins/datamodel/null/NULLDataModel.h +++ b/src/uscxml/plugins/datamodel/null/NULLDataModel.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef NULLDATAMODEL_H_KN8TWG0V #define NULLDATAMODEL_H_KN8TWG0V diff --git a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp index 092426e..fe93213 100644 --- a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp +++ b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "uscxml/Common.h" #include "uscxml/config.h" #include "SWIDataModel.h" @@ -30,7 +49,7 @@ using namespace Arabica::DOM; #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new SWIDataModelProvider() ); return true; } @@ -106,8 +125,8 @@ boost::shared_ptr<DataModelImpl> SWIDataModel::create(InterpreterImpl* interpret int rc = PL_set_engine(engine, NULL); assert(rc == PL_ENGINE_SET); - (void)rc; - + (void)rc; + _plModule = boost::replace_all_copy(interpreter->getSessionId(), "-", ""); boost::replace_all(_plModule, "0", "g"); boost::replace_all(_plModule, "1", "h"); @@ -232,7 +251,7 @@ void SWIDataModel::setEvent(const Event& event) { } else if (event.content.size() > 0) { PlCall("assert", PlCompound("event", PlCompound("data", PlString(Interpreter::spaceNormalize(event.content).c_str())))); } else if (event.data) { - LOG(ERROR) << "No support for structured data from events in prolog datamodel yet"; + LOG(ERROR) << "No support for structured data from events in prolog datamodel yet"; } // event.params diff --git a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h index 0a26643..8e0a1b3 100644 --- a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h +++ b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef SWIDATAMODEL_H_KN8TWG0V #define SWIDATAMODEL_H_KN8TWG0V diff --git a/src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp b/src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp index c155644..e04271b 100644 --- a/src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp +++ b/src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "uscxml/Common.h" #include "XPathDataModel.h" @@ -15,7 +34,7 @@ using namespace Arabica::DOM; #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new XPathDataModelProvider() ); return true; } @@ -209,25 +228,25 @@ Data XPathDataModel::getStringAsData(const std::string& content) { std::stringstream ss; switch (result.type()) { - case ANY: - break; - case Arabica::XPath::BOOL: - ss << result.asBool(); - break; - case NUMBER: - ss << result.asNumber(); - break; - case STRING: - ss << result.asString(); - break; - case NODE_SET: - NodeSet<std::string> ns = result.asNodeSet(); - for (int i = 0; i < ns.size(); i++) { - ss << ns[i]; - } - break; + case ANY: + break; + case Arabica::XPath::BOOL: + ss << result.asBool(); + break; + case NUMBER: + ss << result.asNumber(); + break; + case STRING: + ss << result.asString(); + break; + case NODE_SET: + NodeSet<std::string> ns = result.asNodeSet(); + for (int i = 0; i < ns.size(); i++) { + ss << ns[i]; + } + break; } - + data.atom = ss.str(); data.type = Data::VERBATIM; return data; diff --git a/src/uscxml/plugins/datamodel/xpath/XPathDataModel.h b/src/uscxml/plugins/datamodel/xpath/XPathDataModel.h index 62ee439..55aca38 100644 --- a/src/uscxml/plugins/datamodel/xpath/XPathDataModel.h +++ b/src/uscxml/plugins/datamodel/xpath/XPathDataModel.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef XPATHDATAMODEL_H_KN8TWG0V #define XPATHDATAMODEL_H_KN8TWG0V diff --git a/src/uscxml/plugins/element/CMakeLists.txt b/src/uscxml/plugins/element/CMakeLists.txt index c0a7e15..aa85b97 100644 --- a/src/uscxml/plugins/element/CMakeLists.txt +++ b/src/uscxml/plugins/element/CMakeLists.txt @@ -9,7 +9,8 @@ if (BUILD_AS_PLUGINS) source_group("" FILES ${FETCH_ELEMENT}) add_library( element_fetch SHARED - ${FETCH_ELEMENT}) + ${FETCH_ELEMENT} + "../Plugins.cpp") target_link_libraries(element_fetch uscxml) set_target_properties(element_fetch PROPERTIES FOLDER "Plugin Element") else() @@ -26,7 +27,8 @@ endif() # source_group("" FILES ${MMI_ELEMENT}) # add_library( # element_mmi SHARED -# ${MMI_ELEMENT}) +# ${MMI_ELEMENT} +# "../Plugins.cpp") # target_link_libraries(element_mmi uscxml) # set_target_properties(element_mmi PROPERTIES FOLDER "Plugin Element") # else() @@ -45,7 +47,8 @@ if (BUILD_AS_PLUGINS) source_group("" FILES ${POSTPONE_ELEMENT}) add_library( element_postpone SHARED - ${POSTPONE_ELEMENT}) + ${POSTPONE_ELEMENT} + "../Plugins.cpp") target_link_libraries(element_postpone uscxml) set_target_properties(element_postpone PROPERTIES FOLDER "Plugin Element") else() @@ -64,7 +67,8 @@ if (BUILD_AS_PLUGINS) source_group("" FILES ${FILE_ELEMENT}) add_library( element_file SHARED - ${FILE_ELEMENT}) + ${FILE_ELEMENT} + "../Plugins.cpp") target_link_libraries(element_file uscxml) set_target_properties(element_file PROPERTIES FOLDER "Plugin Element") else() @@ -83,7 +87,8 @@ if (BUILD_AS_PLUGINS) source_group("" FILES ${RESPOND_ELEMENT}) add_library( element_respond SHARED - ${RESPOND_ELEMENT}) + ${RESPOND_ELEMENT} + "../Plugins.cpp") target_link_libraries(element_respond uscxml) set_target_properties(element_respond PROPERTIES FOLDER "Plugin Element") else() diff --git a/src/uscxml/plugins/element/fetch/FetchElement.cpp b/src/uscxml/plugins/element/fetch/FetchElement.cpp index f2f18fc..293fdf9 100644 --- a/src/uscxml/plugins/element/fetch/FetchElement.cpp +++ b/src/uscxml/plugins/element/fetch/FetchElement.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "FetchElement.h" #include <glog/logging.h> @@ -12,7 +31,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new FetchElementProvider() ); return true; } diff --git a/src/uscxml/plugins/element/fetch/FetchElement.h b/src/uscxml/plugins/element/fetch/FetchElement.h index e293afe..433f3f5 100644 --- a/src/uscxml/plugins/element/fetch/FetchElement.h +++ b/src/uscxml/plugins/element/fetch/FetchElement.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef FETCHELEMENT_H_R6GH94FV #define FETCHELEMENT_H_R6GH94FV diff --git a/src/uscxml/plugins/element/file/FileElement.cpp b/src/uscxml/plugins/element/file/FileElement.cpp index 2287eed..a630a8a 100644 --- a/src/uscxml/plugins/element/file/FileElement.cpp +++ b/src/uscxml/plugins/element/file/FileElement.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "FileElement.h" #include <glog/logging.h> #include <stdio.h> @@ -13,7 +32,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new FileElementProvider() ); return true; } @@ -34,11 +53,11 @@ void FileElement::enterElement(const Arabica::DOM::Node<std::string>& node) { } _givenUrl = (HAS_ATTR(node, "url") ? ATTR(node, "url") : _interpreter->getDataModel().evalAsString(ATTR(node, "urlexpr"))); - std::string sandBoxStr = (HAS_ATTR(node, "sandbox") ? ATTR(node, "sandbox") : "on"); - if (boost::iequals(sandBoxStr, "off") || boost::iequals(sandBoxStr, "false") || boost::iequals(sandBoxStr, "no")) { - _sandBoxed = false; - } - + std::string sandBoxStr = (HAS_ATTR(node, "sandbox") ? ATTR(node, "sandbox") : "on"); + if (boost::iequals(sandBoxStr, "off") || boost::iequals(sandBoxStr, "false") || boost::iequals(sandBoxStr, "no")) { + _sandBoxed = false; + } + if (HAS_ATTR(node, "operation")) { std::string operation = ATTR(node, "operation"); if (boost::iequals(operation, "read") || boost::iequals(operation, "load")) { @@ -54,7 +73,7 @@ void FileElement::enterElement(const Arabica::DOM::Node<std::string>& node) { } else { _operation = READ; } - + // callback is only needed for reading std::string callback; if (_operation == READ) { @@ -64,7 +83,7 @@ void FileElement::enterElement(const Arabica::DOM::Node<std::string>& node) { } callback = (HAS_ATTR(node, "callback") ? ATTR(node, "callback") : _interpreter->getDataModel().evalAsString(ATTR(node, "callbackexpr"))); } - + std::string contentStr; char* content = NULL; size_t contentSize = 0; @@ -110,111 +129,111 @@ void FileElement::enterElement(const Arabica::DOM::Node<std::string>& node) { LOG(ERROR) << "Given URL is absolute with sandboxing enabled."; return; } - + if (_sandBoxed) _actualUrl.toAbsolute(URL::getResourceDir()); - + _filename = _actualUrl.path(); - + std::string writeMode; switch (_operation) { - case APPEND: - writeMode = "a+"; - case WRITE: { - if (writeMode.length() == 0) - writeMode = "w+"; - - FILE *fp; - fp = fopen(_filename.c_str(), writeMode.c_str()); - if (fp == NULL) { - LOG(ERROR) << "Error opening '" << _filename << "' for writing: " << strerror(errno); + case APPEND: + writeMode = "a+"; + case WRITE: { + if (writeMode.length() == 0) + writeMode = "w+"; + + FILE *fp; + fp = fopen(_filename.c_str(), writeMode.c_str()); + if (fp == NULL) { + LOG(ERROR) << "Error opening '" << _filename << "' for writing: " << strerror(errno); + } + + if (content && contentSize > 0) { + size_t written = fwrite(content, 1, contentSize, fp); + if (written != contentSize) { + LOG(ERROR) << "Error writing to '" << _filename << "': " << strerror(errno); + return; } - - if (content && contentSize > 0) { - size_t written = fwrite(content, 1, contentSize, fp); - if (written != contentSize) { - LOG(ERROR) << "Error writing to '" << _filename << "': " << strerror(errno); - return; - } - } else if (contentStr.length() > 0) { - size_t written = fwrite(contentStr.c_str(), contentStr.length(), 1, fp); - if (written < 1) { - LOG(ERROR) << "Error writing to '" << _filename << "': " << strerror(errno); - } - } else { - LOG(WARNING) << "Nothing to write to '" << _filename; + } else if (contentStr.length() > 0) { + size_t written = fwrite(contentStr.c_str(), contentStr.length(), 1, fp); + if (written < 1) { + LOG(ERROR) << "Error writing to '" << _filename << "': " << strerror(errno); } - fclose(fp); - break; + } else { + LOG(WARNING) << "Nothing to write to '" << _filename; } - case READ: { - struct stat fileStat; - int err = stat(_filename.c_str(), &fileStat); - if (err < 0) { - LOG(ERROR) << "Cannot stat file '" << _filename << "': " << strerror(errno); + fclose(fp); + break; + } + case READ: { + struct stat fileStat; + int err = stat(_filename.c_str(), &fileStat); + if (err < 0) { + LOG(ERROR) << "Cannot stat file '" << _filename << "': " << strerror(errno); + return; + } + + Event event; + event.name = callback; + event.data.compound["file"].compound["name"] = Data(_filename, Data::VERBATIM); + event.data.compound["file"].compound["mtime"] = toStr(fileStat.st_mtime); + event.data.compound["file"].compound["ctime"] = toStr(fileStat.st_ctime); + event.data.compound["file"].compound["atime"] = toStr(fileStat.st_atime); + event.data.compound["file"].compound["size"] = toStr(fileStat.st_size); + + + FILE *fp; + fp = fopen(_filename.c_str(), "r"); + + fseek (fp, 0, SEEK_END); + size_t filesize = ftell(fp); + rewind (fp); + + char* fileContents = (char*)malloc(filesize); + size_t read = fread(fileContents, 1, filesize, fp); + fclose(fp); + if (read != filesize) { + LOG(ERROR) << "Error reading from '" << _filename << "': " << strerror(errno); + return; + } + + switch (_type) { + case BINARY: + event.data.compound["content"] = Data(fileContents, fileStat.st_size, 1); + break; + case TEXT: + event.data.compound["content"] = Data(fileContents, Data::VERBATIM); + free(fileContents); + break; + case JSON: { + Data json = Data::fromJSON(fileContents); + free(fileContents); + if (!json) { + LOG(ERROR) << "Cannot parse contents of " << _filename << " as JSON"; return; } - - Event event; - event.name = callback; - event.data.compound["file"].compound["name"] = Data(_filename, Data::VERBATIM); - event.data.compound["file"].compound["mtime"] = toStr(fileStat.st_mtime); - event.data.compound["file"].compound["ctime"] = toStr(fileStat.st_ctime); - event.data.compound["file"].compound["atime"] = toStr(fileStat.st_atime); - event.data.compound["file"].compound["size"] = toStr(fileStat.st_size); - - - FILE *fp; - fp = fopen(_filename.c_str(), "r"); - - fseek (fp, 0, SEEK_END); - size_t filesize = ftell(fp); - rewind (fp); - - char* fileContents = (char*)malloc(filesize); - size_t read = fread(fileContents, 1, filesize, fp); - fclose(fp); - if (read != filesize) { - LOG(ERROR) << "Error reading from '" << _filename << "': " << strerror(errno); + event.data.compound["content"] = json; + break; + } + case XML: { + NameSpacingParser parser = NameSpacingParser::fromXML(fileContents); + if (parser.errorsReported()) { + LOG(ERROR) << "Cannot parse contents of " << _filename << " as XML"; return; } - - switch (_type) { - case BINARY: - event.data.compound["content"] = Data(fileContents, fileStat.st_size, 1); - break; - case TEXT: - event.data.compound["content"] = Data(fileContents, Data::VERBATIM); - free(fileContents); - break; - case JSON: { - Data json = Data::fromJSON(fileContents); - free(fileContents); - if (!json) { - LOG(ERROR) << "Cannot parse contents of " << _filename << " as JSON"; - return; - } - event.data.compound["content"] = json; - break; - } - case XML: { - NameSpacingParser parser = NameSpacingParser::fromXML(fileContents); - if (parser.errorsReported()) { - LOG(ERROR) << "Cannot parse contents of " << _filename << " as XML"; - return; - } - event.dom = parser.getDocument().getDocumentElement(); - break; - } - } - _interpreter->receive(event); + event.dom = parser.getDocument().getDocumentElement(); break; } + } + _interpreter->receive(event); + break; + } } - - - - + + + + } void FileElement::exitElement(const Arabica::DOM::Node<std::string>& node) { diff --git a/src/uscxml/plugins/element/file/FileElement.h b/src/uscxml/plugins/element/file/FileElement.h index b9e43bc..987ae11 100644 --- a/src/uscxml/plugins/element/file/FileElement.h +++ b/src/uscxml/plugins/element/file/FileElement.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef FILEELEMENT_H_VJ3JIMEJ #define FILEELEMENT_H_VJ3JIMEJ @@ -13,16 +32,16 @@ namespace uscxml { class FileElement : public ExecutableContentImpl { public: enum Operation { - READ, - WRITE, - APPEND + READ, + WRITE, + APPEND }; enum Type { - XML, - JSON, - TEXT, - BINARY + XML, + JSON, + TEXT, + BINARY }; FileElement() { @@ -47,7 +66,7 @@ public: void exitElement(const Arabica::DOM::Node<std::string>& node); protected: - + bool _sandBoxed; std::string _givenUrl; URL _actualUrl; diff --git a/src/uscxml/plugins/element/mmi/MMIEvents.cpp b/src/uscxml/plugins/element/mmi/MMIEvents.cpp index f1110b7..e6d6954 100644 --- a/src/uscxml/plugins/element/mmi/MMIEvents.cpp +++ b/src/uscxml/plugins/element/mmi/MMIEvents.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "MMIEvents.h" namespace uscxml { diff --git a/src/uscxml/plugins/element/mmi/MMIEvents.h b/src/uscxml/plugins/element/mmi/MMIEvents.h index 5df48ec..82d0b22 100644 --- a/src/uscxml/plugins/element/mmi/MMIEvents.h +++ b/src/uscxml/plugins/element/mmi/MMIEvents.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef MMIEVENTS_H_QHO6VT3M #define MMIEVENTS_H_QHO6VT3M diff --git a/src/uscxml/plugins/element/postpone/PostponeElement.cpp b/src/uscxml/plugins/element/postpone/PostponeElement.cpp index 3c1d1b8..d2b20cb 100644 --- a/src/uscxml/plugins/element/postpone/PostponeElement.cpp +++ b/src/uscxml/plugins/element/postpone/PostponeElement.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "PostponeElement.h" #include "uscxml/plugins/invoker/http/HTTPServletInvoker.h" #include <glog/logging.h> @@ -10,7 +29,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new PostponeElementProvider() ); return true; } diff --git a/src/uscxml/plugins/element/postpone/PostponeElement.h b/src/uscxml/plugins/element/postpone/PostponeElement.h index f0c42c0..56464e2 100644 --- a/src/uscxml/plugins/element/postpone/PostponeElement.h +++ b/src/uscxml/plugins/element/postpone/PostponeElement.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef POSTPONEELEMENT_H_WN8EIYYI #define POSTPONEELEMENT_H_WN8EIYYI diff --git a/src/uscxml/plugins/element/respond/RespondElement.cpp b/src/uscxml/plugins/element/respond/RespondElement.cpp index 699a3a0..21d5907 100644 --- a/src/uscxml/plugins/element/respond/RespondElement.cpp +++ b/src/uscxml/plugins/element/respond/RespondElement.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "RespondElement.h" #include "uscxml/plugins/invoker/http/HTTPServletInvoker.h" #include <glog/logging.h> @@ -10,7 +29,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new RespondElementProvider() ); return true; } diff --git a/src/uscxml/plugins/element/respond/RespondElement.h b/src/uscxml/plugins/element/respond/RespondElement.h index c53d60a..71b7fec 100644 --- a/src/uscxml/plugins/element/respond/RespondElement.h +++ b/src/uscxml/plugins/element/respond/RespondElement.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef RESPONDELEMENT_H_I11KQ39Q #define RESPONDELEMENT_H_I11KQ39Q diff --git a/src/uscxml/plugins/invoker/CMakeLists.txt b/src/uscxml/plugins/invoker/CMakeLists.txt index 43dd683..6dd78ec 100644 --- a/src/uscxml/plugins/invoker/CMakeLists.txt +++ b/src/uscxml/plugins/invoker/CMakeLists.txt @@ -9,7 +9,8 @@ if (BUILD_AS_PLUGINS) source_group("" FILES ${SAMPLE_INVOKER}) add_library( invoker_sample SHARED - ${SAMPLE_INVOKER}) + ${SAMPLE_INVOKER} + "../Plugins.cpp") target_link_libraries(invoker_sample uscxml) set_target_properties(invoker_sample PROPERTIES FOLDER "Plugin Invoker") else() @@ -27,7 +28,8 @@ if (BUILD_AS_PLUGINS) source_group("" FILES ${DIRMON_INVOKER}) add_library( invoker_dirmon SHARED - ${DIRMON_INVOKER}) + ${DIRMON_INVOKER} + "../Plugins.cpp") target_link_libraries(invoker_dirmon uscxml) set_target_properties(invoker_dirmon PROPERTIES FOLDER "Plugin Invoker") else() @@ -45,7 +47,8 @@ endif() # source_group("" FILES ${LOCATION_INVOKER}) # add_library( # invoker_location SHARED -# ${LOCATION_INVOKER}) +# ${LOCATION_INVOKER} +# "../Plugins.cpp") # target_link_libraries(invoker_location uscxml) # set_target_properties(invoker_location PROPERTIES FOLDER "Plugin Invoker") # else() @@ -64,7 +67,8 @@ if (BUILD_AS_PLUGINS) source_group("" FILES ${XHTML_INVOKER}) add_library( invoker_xhtml SHARED - ${XHTML_INVOKER}) + ${XHTML_INVOKER} + "../Plugins.cpp") target_link_libraries(invoker_xhtml uscxml) set_target_properties(invoker_xhtml PROPERTIES FOLDER "Plugin Invoker") else() @@ -82,7 +86,8 @@ if (BUILD_AS_PLUGINS) source_group("" FILES ${SYSTEM_INVOKER}) add_library( invoker_system SHARED - ${SYSTEM_INVOKER}) + ${SYSTEM_INVOKER} + "../Plugins.cpp") target_link_libraries(invoker_system uscxml) set_target_properties(invoker_system PROPERTIES FOLDER "Plugin Invoker") else() @@ -101,7 +106,8 @@ if (SQLITE3_FOUND) source_group("" FILES ${SQLITE3_INVOKER}) add_library( invoker_sqlite3 SHARED - ${SQLITE3_INVOKER}) + ${SQLITE3_INVOKER} + "../Plugins.cpp") target_link_libraries(invoker_sqlite3 uscxml) set_target_properties(invoker_sqlite3 PROPERTIES FOLDER "Plugin Invoker") else() @@ -122,7 +128,8 @@ if (FFMPEG_FOUND) source_group("" FILES ${FFMPEG_INVOKER}) add_library( invoker_ffmpeg SHARED - ${FFMPEG_INVOKER}) + ${FFMPEG_INVOKER} + "../Plugins.cpp") target_link_libraries(invoker_ffmpeg uscxml ${FFMPEG_LIBRARIES}) set_target_properties(invoker_ffmpeg PROPERTIES FOLDER "Plugin Invoker") else() @@ -143,7 +150,8 @@ if (LIBPURPLE_FOUND) source_group("" FILES ${LIBPURPLE_INVOKER}) add_library( invoker_im SHARED - ${LIBPURPLE_INVOKER}) + ${LIBPURPLE_INVOKER} + "../Plugins.cpp") target_link_libraries(invoker_im uscxml ${LIBPURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${ICONV_LIBRARIES}) set_target_properties(invoker_im PROPERTIES FOLDER "Plugin Invoker") else() @@ -164,7 +172,8 @@ if (LIBICAL_FOUND) source_group("" FILES ${CALENDAR_INVOKER}) add_library( invoker_calendar SHARED - ${CALENDAR_INVOKER}) + ${CALENDAR_INVOKER} + "../Plugins.cpp") target_link_libraries(invoker_calendar uscxml ${LIBICAL_LIBRARIES}) set_target_properties(invoker_calendar PROPERTIES FOLDER "Plugin Invoker") else() @@ -186,7 +195,8 @@ if (CORELOCATION_LIBRARY AND OFF) source_group("" FILES ${LOCATION_INVOKER}) add_library( invoker_location SHARED - ${LOCATION_INVOKER}) + ${LOCATION_INVOKER} + "../Plugins.cpp") target_link_libraries(invoker_location uscxml) set_target_properties(invoker_location PROPERTIES FOLDER "Plugin Invoker") else() @@ -208,7 +218,8 @@ if (UMUNDO_FOUND) # message(FATAL_ERROR "UMUNDO_LIBRARIES: ${UMUNDO_LIBRARIES}") add_library( invoker_umundo SHARED - ${UMUNDO_INVOKER}) + ${UMUNDO_INVOKER} + "../Plugins.cpp") target_link_libraries(invoker_umundo uscxml optimized ${PROTOBUF_LIBRARY} debug ${PROTOBUF_LIBRARY_DEBUG} @@ -230,7 +241,8 @@ if (BUILD_AS_PLUGINS) source_group("" FILES ${USCXML_INVOKER}) add_library( invoker_uscxml SHARED - ${USCXML_INVOKER}) + ${USCXML_INVOKER} + "../Plugins.cpp") target_link_libraries(invoker_uscxml uscxml) set_target_properties(invoker_uscxml PROPERTIES FOLDER "Plugin Invoker") @@ -249,7 +261,8 @@ if (BUILD_AS_PLUGINS) source_group("" FILES ${HTTPSERVLET_INVOKER}) add_library( invoker_httpserver SHARED - ${HTTPSERVLET_INVOKER}) + ${HTTPSERVLET_INVOKER} + "../Plugins.cpp") target_link_libraries(invoker_httpserver uscxml) set_target_properties(invoker_httpserver PROPERTIES FOLDER "Plugin Invoker") @@ -269,7 +282,8 @@ if (BUILD_AS_PLUGINS) source_group("" FILES ${HEARTBEAT_INVOKER}) add_library( invoker_heartbeat SHARED - ${HEARTBEAT_INVOKER}) + ${HEARTBEAT_INVOKER} + "../Plugins.cpp") target_link_libraries(invoker_heartbeat uscxml) set_target_properties(invoker_heartbeat PROPERTIES FOLDER "Plugin Invoker") else() @@ -288,7 +302,8 @@ if (OPENSCENEGRAPH_FOUND AND OPENGL_FOUND) source_group("" FILES ${OPENSCENEGRAPH_INVOKER}) add_library( invoker_openscenegraph SHARED - ${OPENSCENEGRAPH_INVOKER}) + ${OPENSCENEGRAPH_INVOKER} + "../Plugins.cpp") target_link_libraries(invoker_openscenegraph ${OPENSCENEGRAPH_LIBRARIES} ${OPENGL_LIBRARIES} @@ -307,7 +322,8 @@ if (OPENSCENEGRAPH_FOUND AND OPENGL_FOUND) source_group("" FILES ${OPENSCENEGRAPH_CONVERTER_INVOKER}) add_library( invoker_openscenegraph_convert SHARED - ${OPENSCENEGRAPH_CONVERTER_INVOKER}) + ${OPENSCENEGRAPH_CONVERTER_INVOKER} + "../Plugins.cpp") target_link_libraries(invoker_openscenegraph_convert ${OPENSCENEGRAPH_LIBRARIES} ${OPENGL_LIBRARIES} @@ -343,7 +359,8 @@ if (OPENAL_FOUND AND (LIBSNDFILE_FOUND OR AUDIOTOOLBOX_FOUND)) source_group("" FILES ${OPENAL_INVOKER}) add_library( invoker_openal SHARED - ${OPENAL_INVOKER}) + ${OPENAL_INVOKER} + "../Plugins.cpp") if (LIBSNDFILE_FOUND) target_link_libraries(invoker_openal ${OPENAL_LIBRARY} @@ -375,7 +392,8 @@ if (MILES_FOUND) source_group("" FILES ${MILES_INVOKER}) add_library( invoker_miles SHARED - ${MILES_INVOKER}) + ${MILES_INVOKER} + "../Plugins.cpp") target_link_libraries(invoker_miles ${MILES_LIBRARIES} ${OPENAL_LIBRARY} @@ -401,7 +419,8 @@ if (UMUNDO_FOUND AND OFF) source_group("" FILES ${VXML_INVOKER}) add_library( invoker_voicexml SHARED - ${VXML_INVOKER}) + ${VXML_INVOKER} + "../Plugins.cpp") target_link_libraries(invoker_voicexml uscxml) set_target_properties(invoker_voicexml PROPERTIES FOLDER "Plugin Invoker") else() diff --git a/src/uscxml/plugins/invoker/audio/AudioToolbox.h b/src/uscxml/plugins/invoker/audio/AudioToolbox.h index 6ad7390..5834f34 100644 --- a/src/uscxml/plugins/invoker/audio/AudioToolbox.h +++ b/src/uscxml/plugins/invoker/audio/AudioToolbox.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef AUDIOTOOLBOX_H_GX4SW17C #define AUDIOTOOLBOX_H_GX4SW17C diff --git a/src/uscxml/plugins/invoker/audio/AudioToolbox.mm b/src/uscxml/plugins/invoker/audio/AudioToolbox.mm index 58e0224..ef99063 100644 --- a/src/uscxml/plugins/invoker/audio/AudioToolbox.mm +++ b/src/uscxml/plugins/invoker/audio/AudioToolbox.mm @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "AudioToolbox.h" #include <glog/logging.h> diff --git a/src/uscxml/plugins/invoker/audio/LibSoundFile.cpp b/src/uscxml/plugins/invoker/audio/LibSoundFile.cpp index 26d3328..b881e41 100644 --- a/src/uscxml/plugins/invoker/audio/LibSoundFile.cpp +++ b/src/uscxml/plugins/invoker/audio/LibSoundFile.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "LibSoundFile.h" namespace uscxml { diff --git a/src/uscxml/plugins/invoker/audio/LibSoundFile.h b/src/uscxml/plugins/invoker/audio/LibSoundFile.h index 0d740f6..0e0b304 100644 --- a/src/uscxml/plugins/invoker/audio/LibSoundFile.h +++ b/src/uscxml/plugins/invoker/audio/LibSoundFile.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef LIBSOUNDFILE_H_Q97OEKGG #define LIBSOUNDFILE_H_Q97OEKGG diff --git a/src/uscxml/plugins/invoker/audio/OpenALInvoker.cpp b/src/uscxml/plugins/invoker/audio/OpenALInvoker.cpp index 73f44ea..ed04ebd 100644 --- a/src/uscxml/plugins/invoker/audio/OpenALInvoker.cpp +++ b/src/uscxml/plugins/invoker/audio/OpenALInvoker.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + // see http://stackoverflow.com/questions/6563810/m-pi-works-with-math-h-but-not-with-cmath-in-visual-studio #define _USE_MATH_DEFINES #include <cmath> @@ -15,7 +34,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new OpenALInvokerProvider() ); return true; } diff --git a/src/uscxml/plugins/invoker/audio/OpenALInvoker.h b/src/uscxml/plugins/invoker/audio/OpenALInvoker.h index 81ced9b..9771f6b 100644 --- a/src/uscxml/plugins/invoker/audio/OpenALInvoker.h +++ b/src/uscxml/plugins/invoker/audio/OpenALInvoker.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef OPENALINVOKER_H_W09J90F0 #define OPENALINVOKER_H_W09J90F0 diff --git a/src/uscxml/plugins/invoker/audio/OpenALPlayer.cpp b/src/uscxml/plugins/invoker/audio/OpenALPlayer.cpp index 64fa70a..5833e2b 100644 --- a/src/uscxml/plugins/invoker/audio/OpenALPlayer.cpp +++ b/src/uscxml/plugins/invoker/audio/OpenALPlayer.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "OpenALPlayer.h" #include <assert.h> #include <stdexcept> diff --git a/src/uscxml/plugins/invoker/audio/OpenALPlayer.h b/src/uscxml/plugins/invoker/audio/OpenALPlayer.h index 7ea069d..db883a0 100644 --- a/src/uscxml/plugins/invoker/audio/OpenALPlayer.h +++ b/src/uscxml/plugins/invoker/audio/OpenALPlayer.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef OPENALPLAYER_H_3PORVJDU #define OPENALPLAYER_H_3PORVJDU diff --git a/src/uscxml/plugins/invoker/audio/PCMConverter.h b/src/uscxml/plugins/invoker/audio/PCMConverter.h index df367f8..1984600 100644 --- a/src/uscxml/plugins/invoker/audio/PCMConverter.h +++ b/src/uscxml/plugins/invoker/audio/PCMConverter.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef PCMCONVERTER_H_97Z8U7PA #define PCMCONVERTER_H_97Z8U7PA diff --git a/src/uscxml/plugins/invoker/calendar/CalendarInvoker.cpp b/src/uscxml/plugins/invoker/calendar/CalendarInvoker.cpp index 25cfafd..e129cd4 100644 --- a/src/uscxml/plugins/invoker/calendar/CalendarInvoker.cpp +++ b/src/uscxml/plugins/invoker/calendar/CalendarInvoker.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "CalendarInvoker.h" #include <glog/logging.h> @@ -9,7 +28,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new CalendarInvokerProvider() ); return true; } diff --git a/src/uscxml/plugins/invoker/calendar/CalendarInvoker.h b/src/uscxml/plugins/invoker/calendar/CalendarInvoker.h index 4766907..c9daaab 100644 --- a/src/uscxml/plugins/invoker/calendar/CalendarInvoker.h +++ b/src/uscxml/plugins/invoker/calendar/CalendarInvoker.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef CALENDARINVOKER_H_W09J90F0 #define CALENDARINVOKER_H_W09J90F0 diff --git a/src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.cpp b/src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.cpp index 36fcc1b..374c287 100644 --- a/src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.cpp +++ b/src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "FFMPEGInvoker.h" #include <glog/logging.h> @@ -16,7 +35,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new FFMPEGInvokerProvider() ); return true; } @@ -43,43 +62,43 @@ Data FFMPEGInvoker::getDataModelVariables() { AVCodec* codecInst = avcodec_find_encoder(codec->id); if (!codecInst) continue; - + switch (codec->type) { - case AVMEDIA_TYPE_VIDEO: { - Data codecData; - codecData.compound["name"] = Data(codec->name, Data::VERBATIM); - codecData.compound["longName"] = Data(codec->long_name, Data::VERBATIM); - data.compound["video"].compound[codec->name] = codecData; - break; - } - case AVMEDIA_TYPE_AUDIO: { - Data codecData; - codecData.compound["name"] = Data(codec->name, Data::VERBATIM); - codecData.compound["longName"] = Data(codec->long_name, Data::VERBATIM); - data.compound["audio"].compound[codec->name] = codecData; - break; - } - default: - break; + case AVMEDIA_TYPE_VIDEO: { + Data codecData; + codecData.compound["name"] = Data(codec->name, Data::VERBATIM); + codecData.compound["longName"] = Data(codec->long_name, Data::VERBATIM); + data.compound["video"].compound[codec->name] = codecData; + break; + } + case AVMEDIA_TYPE_AUDIO: { + Data codecData; + codecData.compound["name"] = Data(codec->name, Data::VERBATIM); + codecData.compound["longName"] = Data(codec->long_name, Data::VERBATIM); + data.compound["audio"].compound[codec->name] = codecData; + break; + } + default: + break; } } - + return data; } void FFMPEGInvoker::invoke(const InvokeRequest& req) { int nrThreads = 1; Event::getParam(req.params, "threads", nrThreads); - + _isRunning = true; for (int i = 0; i < nrThreads; i++) { _threads.insert(new tthread::thread(FFMPEGInvoker::run, this)); } } - + void FFMPEGInvoker::send(const SendRequest& req) { SendRequest reqCopy = req; - + if (boost::iequals(req.name, "render.start")) { // create a new encoding context int ret; @@ -97,52 +116,52 @@ void FFMPEGInvoker::send(const SendRequest& req) { if (!ctx->width || !ctx->height) return; - + ctx->filename = URL::getTmpFilename(); - - /* allocate the output media context */ - avformat_alloc_output_context2(&ctx->formatCtx, NULL, ctx->extension.c_str(), ctx->filename.c_str()); - if (!ctx->formatCtx) { + + /* allocate the output media context */ + avformat_alloc_output_context2(&ctx->formatCtx, NULL, ctx->extension.c_str(), ctx->filename.c_str()); + if (!ctx->formatCtx) { printf("Could not deduce output format from file extension: using MPEG.\n"); avformat_alloc_output_context2(&ctx->formatCtx, NULL, "mpeg", ctx->filename.c_str()); - } - if (!ctx->formatCtx) { + } + if (!ctx->formatCtx) { return; - } - ctx->format = ctx->formatCtx->oformat; - - /* Add the audio and video streams using the default format codecs - * and initialize the codecs. */ - ctx->videoStream = NULL; - - if (ctx->format->video_codec != AV_CODEC_ID_NONE) { + } + ctx->format = ctx->formatCtx->oformat; + + /* Add the audio and video streams using the default format codecs + * and initialize the codecs. */ + ctx->videoStream = NULL; + + if (ctx->format->video_codec != AV_CODEC_ID_NONE) { ctx->videoStream = addStream(ctx, ctx->formatCtx, &ctx->videoCodec, ctx->format->video_codec); - } - - /* Now that all the parameters are set, we can open the audio and - * video codecs and allocate the necessary encode buffers. */ - if (ctx->videoStream) + } + + /* Now that all the parameters are set, we can open the audio and + * video codecs and allocate the necessary encode buffers. */ + if (ctx->videoStream) openVideo(ctx, ctx->formatCtx, ctx->videoCodec, ctx->videoStream); - - /* open the output file, if needed */ - if (!(ctx->format->flags & AVFMT_NOFILE)) { + + /* open the output file, if needed */ + if (!(ctx->format->flags & AVFMT_NOFILE)) { ret = avio_open(&ctx->formatCtx->pb, ctx->filename.c_str(), AVIO_FLAG_WRITE); if (ret < 0) { - // fprintf(stderr, "Could not open '%s': %s\n", ctx->filename.c_str(), - // av_err2str(ret)); + // fprintf(stderr, "Could not open '%s': %s\n", ctx->filename.c_str(), + // av_err2str(ret)); return; } - } - - /* Write the stream header, if any. */ - ret = avformat_write_header(ctx->formatCtx, NULL); - if (ret < 0) { - // fprintf(stderr, "Error occurred when opening output file: %s\n", - // av_err2str(ret)); + } + + /* Write the stream header, if any. */ + ret = avformat_write_header(ctx->formatCtx, NULL); + if (ret < 0) { + // fprintf(stderr, "Error occurred when opening output file: %s\n", + // av_err2str(ret)); return; - } - - if (ctx->frame) + } + + if (ctx->frame) ctx->frame->pts = 0; _encoders[context] = ctx; @@ -170,33 +189,33 @@ void FFMPEGInvoker::run(void* instance) { void FFMPEGInvoker::finish(EncodingContext* ctx, const SendRequest& req) { av_write_trailer(ctx->formatCtx); - + /* Close each codec. */ if (ctx->videoStream) closeVideo(ctx, ctx->formatCtx, ctx->videoStream); - + if (!(ctx->formatCtx->oformat->flags & AVFMT_NOFILE)) - /* Close the output file. */ + /* Close the output file. */ avio_close(ctx->formatCtx->pb); - + /* free the stream */ avformat_free_context(ctx->formatCtx); - + // read file std::ifstream movieFile(ctx->filename.c_str()); movieFile.seekg(0, std::ios::end); size_t length = movieFile.tellg(); movieFile.seekg(0, std::ios::beg); - + char* movieBuffer = (char*)malloc(length); movieFile.read(movieBuffer, length); - + // move to desktop for checking // int err = rename(ctx->filename.c_str(), "/Users/sradomski/Desktop/foo.mpg"); // if (err) { // printf("%s", strerror(errno)); // } - + std::string context; Event::getParam(req.params, "context", context); @@ -206,7 +225,7 @@ void FFMPEGInvoker::finish(EncodingContext* ctx, const SendRequest& req) { event.data.compound["movie"] = Data(movieBuffer, length, true); event.data.compound["mimetype"] = Data("video/mpeg", Data::VERBATIM); event.data.compound["filename"] = Data(std::string("movie.") + ctx->extension, Data::VERBATIM); - + returnEvent(event); } @@ -217,7 +236,7 @@ void FFMPEGInvoker::process(const SendRequest& req) { if (_encoders.find(context) == _encoders.end()) { return; } - + EncodingContext* ctx = _encoders[context]; tthread::lock_guard<tthread::recursive_mutex> lock(ctx->mutex); @@ -227,7 +246,7 @@ void FFMPEGInvoker::process(const SendRequest& req) { delete _encoders[context]; _encoders.erase(context); } - + Data image; Event::getParam(req.params, "frame", image); if (!image) { @@ -236,25 +255,25 @@ void FFMPEGInvoker::process(const SendRequest& req) { std::string format = "bmp"; Event::getParam(req.params, "format", format); - + writeVideoFrame(ctx, ctx->formatCtx, ctx->videoStream, image.binary); ctx->frame->pts += av_rescale_q(1, ctx->videoStream->codec->time_base, ctx->videoStream->time_base); } - + AVStream* FFMPEGInvoker::addStream(EncodingContext* ctx, AVFormatContext *oc, AVCodec **codec, - enum AVCodecID codec_id) { + enum AVCodecID codec_id) { AVCodecContext *c; AVStream *st; - + /* find the encoder */ *codec = avcodec_find_encoder(codec_id); if (!(*codec)) { fprintf(stderr, "Could not find encoder for '%s'\n", - avcodec_get_name(codec_id)); + avcodec_get_name(codec_id)); return NULL; } - + st = avformat_new_stream(oc, *codec); ctx->videoPixFmt = (*codec)->pix_fmts[0]; if (!st) { @@ -263,50 +282,50 @@ AVStream* FFMPEGInvoker::addStream(EncodingContext* ctx, AVFormatContext *oc, AV } st->id = oc->nb_streams-1; c = st->codec; - + switch ((*codec)->type) { - case AVMEDIA_TYPE_AUDIO: - c->sample_fmt = AV_SAMPLE_FMT_FLTP; - c->bit_rate = 64000; - c->sample_rate = 44100; - c->channels = 2; - break; - - case AVMEDIA_TYPE_VIDEO: - c->codec_id = codec_id; - - c->bit_rate = 800000; - /* Resolution must be a multiple of two. */ - c->width = ctx->width; - c->height = ctx->height; - /* timebase: This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identical to 1. */ - c->time_base.den = STREAM_FRAME_RATE; - c->time_base.num = 1; - c->gop_size = 12; /* emit one intra frame every twelve frames at most */ - c->pix_fmt = ctx->videoPixFmt; - if (c->codec_id == AV_CODEC_ID_MPEG2VIDEO) { - /* just for testing, we also add B frames */ - c->max_b_frames = 2; - } - if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO) { - /* Needed to avoid using macroblocks in which some coeffs overflow. - * This does not happen with normal video, it just happens here as - * the motion of the chroma plane does not match the luma plane. */ - c->mb_decision = 2; - } - break; - - default: - break; + case AVMEDIA_TYPE_AUDIO: + c->sample_fmt = AV_SAMPLE_FMT_FLTP; + c->bit_rate = 64000; + c->sample_rate = 44100; + c->channels = 2; + break; + + case AVMEDIA_TYPE_VIDEO: + c->codec_id = codec_id; + + c->bit_rate = 800000; + /* Resolution must be a multiple of two. */ + c->width = ctx->width; + c->height = ctx->height; + /* timebase: This is the fundamental unit of time (in seconds) in terms + * of which frame timestamps are represented. For fixed-fps content, + * timebase should be 1/framerate and timestamp increments should be + * identical to 1. */ + c->time_base.den = STREAM_FRAME_RATE; + c->time_base.num = 1; + c->gop_size = 12; /* emit one intra frame every twelve frames at most */ + c->pix_fmt = ctx->videoPixFmt; + if (c->codec_id == AV_CODEC_ID_MPEG2VIDEO) { + /* just for testing, we also add B frames */ + c->max_b_frames = 2; + } + if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO) { + /* Needed to avoid using macroblocks in which some coeffs overflow. + * This does not happen with normal video, it just happens here as + * the motion of the chroma plane does not match the luma plane. */ + c->mb_decision = 2; + } + break; + + default: + break; } - + /* Some formats want stream headers to be separate. */ if (oc->oformat->flags & AVFMT_GLOBALHEADER) c->flags |= CODEC_FLAG_GLOBAL_HEADER; - + return st; } @@ -317,7 +336,7 @@ void FFMPEGInvoker::openVideo(EncodingContext* ctx, AVFormatContext *oc, AVCodec /* open the codec */ ret = avcodec_open2(c, codec, NULL); if (ret < 0) { - // fprintf(stderr, "Could not open video codec: %s\n", av_err2str(ret)); + // fprintf(stderr, "Could not open video codec: %s\n", av_err2str(ret)); return; } @@ -341,8 +360,8 @@ void FFMPEGInvoker::openVideo(EncodingContext* ctx, AVFormatContext *oc, AVCodec if (c->pix_fmt != BMP_FORMAT) { ret = avpicture_alloc(&ctx->src_picture, BMP_FORMAT, c->width, c->height); if (ret < 0) { - // fprintf(stderr, "Could not allocate temporary picture: %s\n", - // av_err2str(ret)); + // fprintf(stderr, "Could not allocate temporary picture: %s\n", + // av_err2str(ret)); return; } } @@ -350,7 +369,7 @@ void FFMPEGInvoker::openVideo(EncodingContext* ctx, AVFormatContext *oc, AVCodec /* copy data and linesize picture pointers to frame */ *((AVPicture *)ctx->frame) = ctx->dst_picture; } - + void FFMPEGInvoker::writeVideoFrame(EncodingContext* ctx, AVFormatContext *oc, AVStream *st, boost::shared_ptr<Blob> image) { int ret; AVCodecContext *c = st->codec; @@ -360,11 +379,11 @@ void FFMPEGInvoker::writeVideoFrame(EncodingContext* ctx, AVFormatContext *oc, A * to the codec pixel format if needed */ if (!ctx->sws_ctx) { ctx->sws_ctx = sws_getContext(c->width, c->height, BMP_FORMAT, - c->width, c->height, c->pix_fmt, - ctx->sws_flags, NULL, NULL, NULL); + c->width, c->height, c->pix_fmt, + ctx->sws_flags, NULL, NULL, NULL); if (!ctx->sws_ctx) { fprintf(stderr, - "Could not initialize the conversion context\n"); + "Could not initialize the conversion context\n"); return; } } @@ -376,15 +395,15 @@ void FFMPEGInvoker::writeVideoFrame(EncodingContext* ctx, AVFormatContext *oc, A headerOffset += image->data[13] << 24; // std::cout << headerOffset + (c->width * c->height) << " / " << image->_size << std::endl; - + ret = avpicture_fill(&ctx->src_picture, (uint8_t*)(image->data + headerOffset), BMP_FORMAT, c->width, c->height); if (ret < 0) { fprintf(stderr, - "Could not fill image from given bitmap\n"); + "Could not fill image from given bitmap\n"); } sws_scale(ctx->sws_ctx, - (const uint8_t * const *)ctx->src_picture.data, ctx->src_picture.linesize, - 0, c->height, ctx->dst_picture.data, ctx->dst_picture.linesize); + (const uint8_t * const *)ctx->src_picture.data, ctx->src_picture.linesize, + 0, c->height, ctx->dst_picture.data, ctx->dst_picture.linesize); } else { avpicture_fill(&ctx->dst_picture, (uint8_t*)image->data, c->pix_fmt, c->width, c->height); } @@ -408,7 +427,7 @@ void FFMPEGInvoker::writeVideoFrame(EncodingContext* ctx, AVFormatContext *oc, A /* encode the image */ ret = avcodec_encode_video2(c, &pkt, ctx->frame, &got_packet); if (ret < 0) { - // fprintf(stderr, "Error encoding video frame: %s\n", av_err2str(ret)); + // fprintf(stderr, "Error encoding video frame: %s\n", av_err2str(ret)); return; } /* If size is zero, it means the image was buffered. */ diff --git a/src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.h b/src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.h index ecce031..7725ec9 100644 --- a/src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.h +++ b/src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef FFMPEGINVOKER_H_VQD1V1C2 #define FFMPEGINVOKER_H_VQD1V1C2 @@ -53,7 +72,7 @@ protected: if (sws_ctx) sws_freeContext(sws_ctx); } - + tthread::recursive_mutex mutex; PixelFormat videoPixFmt; std::string filename; @@ -79,7 +98,7 @@ protected: static void run(void*); void finish(EncodingContext* ctx, const SendRequest& req); void process(const SendRequest& req); - + std::set<tthread::thread*> _threads; uscxml::concurrency::BlockingQueue<SendRequest> _workQueue; bool _isRunning; diff --git a/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.cpp b/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.cpp index 559e441..481071c 100644 --- a/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.cpp +++ b/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "DirMonInvoker.h" #include <glog/logging.h> @@ -18,7 +37,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new DirMonInvokerProvider() ); return true; } @@ -50,7 +69,7 @@ boost::shared_ptr<InvokerImpl> DirMonInvoker::create(InterpreterImpl* interprete Data DirMonInvoker::getDataModelVariables() { tthread::lock_guard<tthread::recursive_mutex> lock(_mutex); - + Data data; data.compound["dir"] = Data(_dir, Data::VERBATIM); @@ -59,7 +78,7 @@ Data DirMonInvoker::getDataModelVariables() { data.compound["suffixes"].array.push_back(Data(*suffixIter, Data::VERBATIM)); suffixIter++; } - + std::map<std::string, struct stat> entries = _watcher->getAllEntries(); std::map<std::string, struct stat>::iterator entryIter = entries.begin(); while(entryIter != entries.end()) { @@ -69,7 +88,7 @@ Data DirMonInvoker::getDataModelVariables() { data.compound["file"].compound[entryIter->first].compound["size"] = toStr(entryIter->second.st_mtime); entryIter++; } - + return data; } @@ -86,7 +105,7 @@ void DirMonInvoker::invoke(const InvokeRequest& req) { } if (req.params.find("reportexisting") != req.params.end() && - boost::iequals(req.params.find("reportexisting")->second.atom, "false")) + boost::iequals(req.params.find("reportexisting")->second.atom, "false")) _reportExisting = false; if (req.params.find("recurse") != req.params.end() && boost::iequals(req.params.find("recurse")->second.atom, "true")) @@ -256,7 +275,7 @@ DirectoryWatch::~DirectoryWatch() { } } - + void DirectoryWatch::reportAsDeleted() { std::map<std::string, struct stat>::iterator fileIter = _knownEntries.begin(); while(fileIter != _knownEntries.end()) { @@ -292,7 +311,7 @@ void DirectoryWatch::updateEntries(bool reportAsExisting) { if ((unsigned)dirStat.st_mtime >= (unsigned)_lastChecked) { // std::cout << "dirStat.st_mtime: " << dirStat.st_mtime << " / _lastChecked: " << _lastChecked << std::endl; - + // there are changes in the directory std::set<std::string> currEntries; diff --git a/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.h b/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.h index f5aa4bc..9c3f873 100644 --- a/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.h +++ b/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef DIRMONINVOKER_H_W09J90F0 #define DIRMONINVOKER_H_W09J90F0 diff --git a/src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.cpp b/src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.cpp index 6d2a8e2..bf4fac7 100644 --- a/src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.cpp +++ b/src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "CompositeDisplay.h" #if 0 #ifdef MACOSX diff --git a/src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.h b/src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.h index b524777..6c2adac 100644 --- a/src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.h +++ b/src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef COMPOSITEDISPLAY_H_W2MX9CXP #define COMPOSITEDISPLAY_H_W2MX9CXP diff --git a/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.cpp b/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.cpp index d732e63..e4db10a 100644 --- a/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.cpp +++ b/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "OSGInvoker.h" #include "uscxml/URL.h" #include "uscxml/UUID.h" @@ -37,7 +56,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new OSGInvokerProvider() ); return true; } @@ -47,8 +66,8 @@ bool connect(pluma::Host& host) { } else if (boost::iequals(LOCALNAME(childs.item(i)), tagName) && \ validChildren.find(tagName) != validChildren.end()) { \ procFunc(childs.item(i));\ + - OSGInvoker::OSGInvoker() { } @@ -68,7 +87,7 @@ Data OSGInvoker::getDataModelVariables() { void OSGInvoker::send(const SendRequest& req) { if (boost::iequals(req.name, "intersect")) { - + } } @@ -79,9 +98,9 @@ void OSGInvoker::invoke(const InvokeRequest& req) { tthread::lock_guard<tthread::recursive_mutex> lock(_mutex); setupColors(); - + std::cout << req.dom; - + // register default event handlers Arabica::DOM::Events::EventTarget<std::string> evTarget = Arabica::DOM::Events::EventTarget<std::string>(req.dom); evTarget.addEventListener("DOMSubtreeModified", *this, false); @@ -91,7 +110,7 @@ void OSGInvoker::invoke(const InvokeRequest& req) { std::set<std::string> validChilds; validChilds.insert("display"); - + // this is somewhat unfortunate, if content contains a single child, we will get that, otherwise its parent (<content>) if (boost::iequals(LOCALNAME(req.dom), "display")) { processChildren(validChilds, req.dom.getParentNode()); @@ -121,7 +140,7 @@ void OSGInvoker::setupColors() { _colors["green"] = osg::Vec4(0.0, 0.5, 0.0, 1.0); _colors["olive"] = osg::Vec4(0.5, 0.5, 0.0, 1.0); } - + void OSGInvoker::runOnMainThread() { _displays_t::iterator dispIter = _displays.begin(); if (_mutex.try_lock()) { @@ -184,7 +203,7 @@ void OSGInvoker::processViewport(const Arabica::DOM::Node<std::string>& element) unsigned int actualY = 0; unsigned int actualWidth = 0; unsigned int actualHeight = 0; - + getViewport(element, actualX, actualY, actualWidth, actualHeight, compDisp); osg::Viewport* viewPort = new osg::Viewport(actualX, actualY, actualWidth, actualHeight); compDisp->addView(name, viewPort, sceneView); @@ -196,7 +215,7 @@ void OSGInvoker::processViewport(const Arabica::DOM::Node<std::string>& element) } else { sceneView->getCamera()->setClearColor(_colors["white"]); } - + std::set<std::string> validChilds; validChilds.insert("camera"); validChilds.insert("translation"); @@ -391,11 +410,11 @@ void OSGInvoker::processSphere(const Arabica::DOM::Node<std::string>& element) { float radius = 1; osg::Vec3 center(0,0,0); - + if (HAS_ATTR(element, "radius")) { radius = strTo<float>(ATTR(element, "radius")); } - + osg::ref_ptr<osg::Sphere> sphere = new osg::Sphere(center, radius); osg::ref_ptr<osg::ShapeDrawable> drawable = new osg::ShapeDrawable(sphere); osg::ref_ptr<osg::Geode> geode = new osg::Geode(); @@ -415,26 +434,26 @@ void OSGInvoker::updateSphere(osg::ref_ptr<osg::Node> node, Arabica::DOM::Events void OSGInvoker::processBox(const Arabica::DOM::Node<std::string>& element) { assert(_nodes.find(element.getParentNode()) != _nodes.end()); osg::ref_ptr<osg::Node> parent = _nodes[element.getParentNode()]; - + float x = 1; float y = 1; float z = 1; osg::Vec3 center(0,0,0); - + if (HAS_ATTR(element, "x")) x = strTo<float>(ATTR(element, "x")); if (HAS_ATTR(element, "y")) y = strTo<float>(ATTR(element, "y")); if (HAS_ATTR(element, "z")) z = strTo<float>(ATTR(element, "z")); - + osg::ref_ptr<osg::Box> box = new osg::Box(center, x, y, z); osg::ref_ptr<osg::ShapeDrawable> drawable = new osg::ShapeDrawable(box); osg::ref_ptr<osg::Geode> geode = new osg::Geode(); geode->addDrawable(drawable); - + OSG_SET_COLOR; OSG_SET_MATERIAL; _nodes[element] = geode; - + parent->asGroup()->addChild(geode); } @@ -443,19 +462,19 @@ void OSGInvoker::updateBox(osg::ref_ptr<osg::Node> node, Arabica::DOM::Events::E void OSGInvoker::processCapsule(const Arabica::DOM::Node<std::string>& element) { assert(_nodes.find(element.getParentNode()) != _nodes.end()); osg::ref_ptr<osg::Node> parent = _nodes[element.getParentNode()]; - + float radius = 1; float height = 1; osg::Vec3 center(0,0,0); - + if (HAS_ATTR(element, "radius")) radius = strTo<float>(ATTR(element, "radius")); if (HAS_ATTR(element, "height")) height = strTo<float>(ATTR(element, "height")); - + osg::ref_ptr<osg::Capsule> capsule = new osg::Capsule(center, radius, height); osg::ref_ptr<osg::ShapeDrawable> drawable = new osg::ShapeDrawable(capsule); osg::ref_ptr<osg::Geode> geode = new osg::Geode(); geode->addDrawable(drawable); - + OSG_SET_COLOR; OSG_SET_MATERIAL; @@ -464,28 +483,28 @@ void OSGInvoker::processCapsule(const Arabica::DOM::Node<std::string>& element) } void OSGInvoker::updateCapsule(osg::ref_ptr<osg::Node> node, Arabica::DOM::Events::Event<std::string>& event) { } - + void OSGInvoker::processCone(const Arabica::DOM::Node<std::string>& element) { assert(_nodes.find(element.getParentNode()) != _nodes.end()); osg::ref_ptr<osg::Node> parent = _nodes[element.getParentNode()]; - + float radius = 1; float height = 1; osg::Vec3 center(0,0,0); - + if (HAS_ATTR(element, "radius")) radius = strTo<float>(ATTR(element, "radius")); if (HAS_ATTR(element, "height")) height = strTo<float>(ATTR(element, "height")); - + osg::ref_ptr<osg::Cone> cone = new osg::Cone(center, radius, height); osg::ref_ptr<osg::ShapeDrawable> drawable = new osg::ShapeDrawable(cone); osg::ref_ptr<osg::Geode> geode = new osg::Geode(); geode->addDrawable(drawable); - + OSG_SET_COLOR; OSG_SET_MATERIAL; _nodes[element] = geode; - + parent->asGroup()->addChild(geode); } @@ -495,24 +514,24 @@ void OSGInvoker::updateCone(osg::ref_ptr<osg::Node> node, Arabica::DOM::Events:: void OSGInvoker::processCylinder(const Arabica::DOM::Node<std::string>& element) { assert(_nodes.find(element.getParentNode()) != _nodes.end()); osg::ref_ptr<osg::Node> parent = _nodes[element.getParentNode()]; - + float radius = 1; float height = 1; osg::Vec3 center(0,0,0); - + if (HAS_ATTR(element, "radius")) radius = strTo<float>(ATTR(element, "radius")); if (HAS_ATTR(element, "height")) height = strTo<float>(ATTR(element, "height")); - + osg::ref_ptr<osg::Cylinder> cylinder = new osg::Cylinder(center, radius, height); osg::ref_ptr<osg::ShapeDrawable> drawable = new osg::ShapeDrawable(cylinder); osg::ref_ptr<osg::Geode> geode = new osg::Geode(); geode->addDrawable(drawable); - + OSG_SET_COLOR; OSG_SET_MATERIAL; _nodes[element] = geode; - + parent->asGroup()->addChild(geode); } @@ -528,14 +547,15 @@ osg::Vec4 OSGInvoker::getColor(const Arabica::DOM::Node<std::string>& element, c valid = true; return _colors[color]; } - + // otherwise try to parse as rgba values int i; osg::Vec4 colorVec = parseVec4(color, i); - + if (i == 1) { // only a single value was given, interpret as grey value - colorVec[1] = colorVec[2] = colorVec[0]; colorVec[3] = 1.0; + colorVec[1] = colorVec[2] = colorVec[0]; + colorVec[3] = 1.0; valid = true; return colorVec; } @@ -547,7 +567,7 @@ osg::Vec4 OSGInvoker::getColor(const Arabica::DOM::Node<std::string>& element, c return colorVec; } } - + // return empty reference valid = false; return osg::Vec4(); @@ -566,7 +586,7 @@ osg::ref_ptr<osg::Material> OSGInvoker::getMaterial(const Arabica::DOM::Node<std nodeMat->setDiffuse(osg::Material::FRONT, matColor); nodeMat->setDiffuse(osg::Material::BACK, matColor); } - + // translucency if (HAS_ATTR(element, "transparency")) { std::string transparency = ATTR(element, "transparency"); @@ -576,18 +596,18 @@ osg::ref_ptr<osg::Material> OSGInvoker::getMaterial(const Arabica::DOM::Node<std nodeMat->setTransparency(osg::Material::FRONT, trans); nodeMat->setTransparency(osg::Material::BACK, trans); } - + return nodeMat; } osg::Vec4 OSGInvoker::parseVec4(const std::string& coeffs, int& i) { - + // otherwise try to parse as rgba values std::string coeff; std::stringstream coeffSS(coeffs); - + osg::Vec4 vec; - + i = 0; while(std::getline(coeffSS, coeff, ',')) { boost::trim(coeff); @@ -595,13 +615,13 @@ osg::Vec4 OSGInvoker::parseVec4(const std::string& coeffs, int& i) { continue; if (!isNumeric(coeff.c_str(), 10)) continue; - + vec[i] = strTo<float>(coeff); i++; } return vec; } - + void OSGInvoker::processChildren(const std::set<std::string>& validChildren, const Arabica::DOM::Node<std::string>& element) { Arabica::DOM::NodeList<std::string> childs = element.getChildNodes(); for (int i = 0; i < childs.getLength(); ++i) { diff --git a/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.h b/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.h index 512eecb..cda0ad3 100644 --- a/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.h +++ b/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef OSGINVOKER_H_H6T4R8HU #define OSGINVOKER_H_H6T4R8HU @@ -115,7 +134,7 @@ protected: void setupColors(); std::map<std::string, osg::Vec4> _colors; typedef std::map<std::string, osg::Vec4> _colors_t; - + tthread::recursive_mutex _mutex; }; diff --git a/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.cpp b/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.cpp index a6f303a..3fbcc36 100644 --- a/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.cpp +++ b/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "OSGConverter.h" #include <glog/logging.h> #include "uscxml/config.h" @@ -34,7 +53,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new OSGConverterProvider() ); return true; } @@ -145,7 +164,7 @@ void OSGConverter::cancel(const std::string sendId) { void OSGConverter::invoke(const InvokeRequest& req) { int nrThreads = 1; - + if (req.params.find("threads") != req.params.end() && isNumeric(req.params.find("threads")->second.atom.c_str(), 10)) { nrThreads = strTo<int>(req.params.find("threads")->second); } @@ -194,8 +213,8 @@ void OSGConverter::process(const SendRequest& req) { bool autoRotate = true; if (req.params.find("autorotate") != req.params.end()) { if (boost::iequals(req.params.find("autorotate")->second.atom, "off") || - boost::iequals(req.params.find("autorotate")->second.atom, "0") || - boost::iequals(req.params.find("autorotate")->second.atom, "false")) { + boost::iequals(req.params.find("autorotate")->second.atom, "0") || + boost::iequals(req.params.find("autorotate")->second.atom, "false")) { autoRotate = false; } } @@ -210,7 +229,7 @@ void OSGConverter::process(const SendRequest& req) { sceneGraph->addChild(model); osgDB::ReaderWriter::WriteResult result; - + osg::ref_ptr<osgDB::ReaderWriter> writer = osgDB::Registry::instance()->getReaderWriterForExtension(format); if(writer.valid()) { std::stringstream ss; @@ -225,7 +244,7 @@ void OSGConverter::process(const SendRequest& req) { return; } } - + /** * If we failed to interpret the extension as another 3D file, try to make a screenshot. */ @@ -273,7 +292,7 @@ void OSGConverter::process(const SendRequest& req) { LOG(ERROR) << "Traits returned with zero dimensions"; return; } - + GLenum pbuffer = gc->getTraits()->doubleBuffer ? GL_BACK : GL_FRONT; viewer.setCameraManipulator(new osgGA::TrackballManipulator()); @@ -289,10 +308,10 @@ void OSGConverter::process(const SendRequest& req) { viewer.getCamera()->setClearColor(osg::Vec4f(1.0f,1.0f,1.0f,1.0f)); viewer.getCamera()->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); viewer.getCameraManipulator()->setByMatrix(osg::Matrix::lookAt(osg::Vec3d(0,0,bs.radius() * (-3.4 * zoom)), // eye - (osg::Vec3d)bs.center(), // center - osg::Vec3d(0,1,0))); // up + (osg::Vec3d)bs.center(), // center + osg::Vec3d(0,1,0))); // up - // viewer.home(); + // viewer.home(); // perform one viewer iteration viewer.realize(); @@ -310,9 +329,9 @@ void OSGConverter::reportSuccess(const SendRequest& req, const Data& content) { std::string format; Event::getParam(req.params, "format", format); - + event.data.compound["mimetype"] = Data(URL::getMimeType(format), Data::VERBATIM); - + if (event.name.length() == 0) event.name = "convert"; event.name += ".success"; @@ -530,11 +549,11 @@ void OSGConverter::dumpMatrix(const osg::Matrix& m) { } void OSGConverter::NameRespectingWriteToFile::operator()(const osg::Image& image, const unsigned int context_id) { - + // std::cout << "NameRespectingWriteToFile" << std::endl; // std::cout << image.s() << std::endl; // std::cout << image.t() << std::endl; - + // write to memory first std::string format; if (_req.params.find("format") != _req.params.end()) { @@ -552,21 +571,21 @@ void OSGConverter::NameRespectingWriteToFile::operator()(const osg::Image& image if (!osgDB::writeImageFile(image, tempFile, op)) { _converter->reportFailure(_req); } - + char* buffer = NULL; size_t length = 0; { std::ifstream file(tempFile.c_str()); - + file.seekg(0, std::ios::end); length = file.tellg(); file.seekg(0, std::ios::beg); buffer = (char*)malloc(length); file.read(buffer, length); } - - std::cout << tempFile << std::endl; - + + std::cout << tempFile << std::endl; + // remove(tempFile.c_str()); // osg::ref_ptr<osgDB::ReaderWriter> writerFormat = osgDB::Registry::instance()->getReaderWriterForExtension(format); // if(!writerFormat.valid()) @@ -577,7 +596,7 @@ void OSGConverter::NameRespectingWriteToFile::operator()(const osg::Image& image std::stringstream ssFormat; osgDB::ReaderWriter::WriteResult res = writerFormat->writeImage(image, ssFormat, op); - + if (_filename.length() > 0) { std::string tmpName = _filename; size_t pathSep = _filename.find_last_of(PATH_SEPERATOR); @@ -589,7 +608,7 @@ void OSGConverter::NameRespectingWriteToFile::operator()(const osg::Image& image std::ofstream outFile(tmpName.c_str()); outFile << ssFormat.str(); } - + if (pathSep != std::string::npos) { int err = rename(tmpName.c_str(), _filename.c_str()); if (err) { @@ -598,7 +617,7 @@ void OSGConverter::NameRespectingWriteToFile::operator()(const osg::Image& image } } #endif - + Data content; content.compound[format] = Data(buffer, length, false); diff --git a/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.h b/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.h index 2bc84a1..7164bb8 100644 --- a/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.h +++ b/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef OSGCONVERTER_H_W09J90F0 #define OSGCONVERTER_H_W09J90F0 diff --git a/src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.cpp b/src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.cpp index 5afbc66..ed528b2 100644 --- a/src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.cpp +++ b/src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "HeartbeatInvoker.h" #include <glog/logging.h> @@ -9,7 +28,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new HeartbeatInvokerProvider() ); return true; } diff --git a/src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.h b/src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.h index ea83db9..c44e362 100644 --- a/src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.h +++ b/src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef HEARTBEATINVOKER_H_W09J90F0 #define HEARTBEATINVOKER_H_W09J90F0 diff --git a/src/uscxml/plugins/invoker/http/HTTPServletInvoker.cpp b/src/uscxml/plugins/invoker/http/HTTPServletInvoker.cpp index 1a95396..d259e9a 100644 --- a/src/uscxml/plugins/invoker/http/HTTPServletInvoker.cpp +++ b/src/uscxml/plugins/invoker/http/HTTPServletInvoker.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "HTTPServletInvoker.h" #include <glog/logging.h> @@ -11,7 +30,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new HTTPServletInvokerProvider() ); return true; } diff --git a/src/uscxml/plugins/invoker/http/HTTPServletInvoker.h b/src/uscxml/plugins/invoker/http/HTTPServletInvoker.h index e2d3b2b..7fb2438 100644 --- a/src/uscxml/plugins/invoker/http/HTTPServletInvoker.h +++ b/src/uscxml/plugins/invoker/http/HTTPServletInvoker.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef HTTPSERVERINVOKER_H_OAAWX8NF #define HTTPSERVERINVOKER_H_OAAWX8NF diff --git a/src/uscxml/plugins/invoker/im/IMInvoker.cpp b/src/uscxml/plugins/invoker/im/IMInvoker.cpp index 1e12650..1624b49 100644 --- a/src/uscxml/plugins/invoker/im/IMInvoker.cpp +++ b/src/uscxml/plugins/invoker/im/IMInvoker.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "IMInvoker.h" #include <glog/logging.h> #include "uscxml/UUID.h" @@ -17,10 +36,10 @@ if (_accountInstances.find(account) == _accountInstances.end()) { \ namespace uscxml { - + #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new IMInvokerProvider() ); return true; } @@ -30,8 +49,7 @@ Data IMInvoker::_pluginData; GHashTable* IMInvoker::_uiInfo = NULL; GRand* IMInvoker::_gRand = NULL; -PurpleEventLoopUiOps IMInvoker::_uiEventLoopOps = -{ +PurpleEventLoopUiOps IMInvoker::_uiEventLoopOps = { purpleEventTimeoutAdd, purpleEventTimeoutRemove, purpleEventInputAdd, @@ -106,8 +124,7 @@ PurpleConnectionUiOps IMInvoker::_uiConnectOps = { }; //libpurple conversation operations -PurpleConversationUiOps IMInvoker::_uiConvOps = -{ +PurpleConversationUiOps IMInvoker::_uiConvOps = { NULL, //purpleCreateConversation, NULL, //purpleDestroyConversation, NULL, //purpleWriteChat, @@ -186,7 +203,7 @@ PurpleWhiteboardUiOps IMInvoker::_uiWhiteboardOps = { NULL, NULL }; - + PurpleCoreUiOps IMInvoker::_uiCoreOps = { purplePrefsInit, NULL, @@ -205,12 +222,12 @@ tthread::condition_variable IMInvoker::_initCond; tthread::recursive_mutex IMInvoker::_accountMutex; std::map<PurpleAccount*, IMInvoker*> IMInvoker::_accountInstances; - + void IMInvoker::setupPurpleSignals() { int handle; // connection signals purple_signal_connect(purple_connections_get_handle(), "signed-on", &handle, PURPLE_CALLBACK(signedOnCB), NULL); - + // conversation signals purple_signal_connect(purple_conversations_get_handle(), "conversation-created", &handle, PURPLE_CALLBACK(conversationCreatedCB), NULL); purple_signal_connect(purple_conversations_get_handle(), "chat-joined", &handle, PURPLE_CALLBACK(chatJoinedCB), NULL); @@ -218,7 +235,7 @@ void IMInvoker::setupPurpleSignals() { purple_signal_connect(purple_conversations_get_handle(), "buddy-typing", &handle, PURPLE_CALLBACK(buddyTypingCB), NULL); purple_signal_connect(purple_conversations_get_handle(), "buddy-typed", &handle, PURPLE_CALLBACK(buddyTypedCB), NULL); purple_signal_connect(purple_conversations_get_handle(), "buddy-typing-stopped", &handle, PURPLE_CALLBACK(buddyTypingStoppedCB), NULL); - + // buddy signals purple_signal_connect(purple_blist_get_handle(), "buddy-signed-on", &handle, PURPLE_CALLBACK(buddyEventCB), GINT_TO_POINTER(PURPLE_BUDDY_SIGNON)); purple_signal_connect(purple_blist_get_handle(), "buddy-signed-off", &handle, PURPLE_CALLBACK(buddyEventCB), GINT_TO_POINTER(PURPLE_BUDDY_SIGNOFF)); @@ -230,12 +247,12 @@ void IMInvoker::setupPurpleSignals() { purple_signal_connect(purple_blist_get_handle(), "buddy-removed", &handle, PURPLE_CALLBACK(buddyRemovedCB), NULL); purple_signal_connect(purple_blist_get_handle(), "blist-node-aliased", &handle, PURPLE_CALLBACK(blistNodeAliasedCB), NULL); purple_signal_connect(purple_blist_get_handle(), "buddy-caps-changed", &handle, PURPLE_CALLBACK(buddyCapsChangedCB), NULL); - + // xfer signals purple_signal_connect(purple_xfers_get_handle(), "file-recv-request", &handle, PURPLE_CALLBACK(fileRecvRequestCB), NULL); } - + void IMInvoker::initLibPurple(void *userdata, const std::string event) { _initMutex.lock(); @@ -247,34 +264,34 @@ void IMInvoker::initLibPurple(void *userdata, const std::string event) { // g_hash_table_insert(_uiInfo, "client_type", "pc"); _gRand = g_rand_new(); - + /* Set a custom user directory (optional) */ //purple_util_set_user_dir(CUSTOM_USER_DIRECTORY); /* We do not want any debugging for now to keep the noise to a minimum. */ purple_debug_set_enabled(false); - + purple_core_set_ui_ops(&_uiCoreOps); purple_eventloop_set_ui_ops(&_uiEventLoopOps); - + purple_plugins_add_search_path("/usr/local/lib/purple-3"); // purple_plugins_probe(G_MODULE_SUFFIX); - + if (!purple_core_init("uscxml")) { LOG(ERROR) << "libpurple initialization failed." << std::endl; return; } - + /* Load the preferences. */ purple_prefs_load(); purple_plugins_load_saved("/purple/uscxml/plugins/saved"); - + GList *l; PurplePlugin *plugin; - + for (l = purple_plugins_get_all(); l != NULL; l = l->next) { plugin = (PurplePlugin *)l->data; - + Data pluginData; if (plugin->info->id) pluginData.compound["id"] = Data(plugin->info->id, Data::VERBATIM); if (plugin->info->homepage) pluginData.compound["homepage"] = Data(plugin->info->homepage, Data::VERBATIM); @@ -285,10 +302,10 @@ void IMInvoker::initLibPurple(void *userdata, const std::string event) { if (plugin->info->version) pluginData.compound["version"] = Data(plugin->info->version, Data::VERBATIM); if (plugin->info->major_version) pluginData.compound["majorVersion"] = Data(toStr(plugin->info->major_version), Data::VERBATIM); if (plugin->info->minor_version) pluginData.compound["minorVersion"] = Data(toStr(plugin->info->minor_version), Data::VERBATIM); - + if (plugin->info->type == PURPLE_PLUGIN_PROTOCOL) _pluginData.compound["protocol"].compound[plugin->info->id] = pluginData; - + } _initMutex.unlock(); @@ -314,7 +331,7 @@ void IMInvoker::signedOnCB(PurpleConnection *gc, gpointer null) { // set my status to active PurpleSavedStatus* status = purple_savedstatus_new(NULL, PURPLE_STATUS_AVAILABLE); purple_savedstatus_activate(status); - + Event retEv("im.signed.on"); inst->returnEvent(retEv); } @@ -329,40 +346,40 @@ void IMInvoker::buddyTypingStoppedCB(PurpleAccount *account, const char *name, v void IMInvoker::buddyEventCB(PurpleBuddy *buddy, PurpleBuddyEvent event) { if (!buddy) return; - + PurpleAccount *account = purple_buddy_get_account(buddy); GET_INSTANCE_IN_CALLBACK(account); if (!inst) return; switch (event) { - case PURPLE_BUDDY_SIGNOFF: - case PURPLE_BUDDY_SIGNON: { - PurplePresence* presence = purple_buddy_get_presence(buddy); - PurpleStatus* status = purple_presence_get_active_status(presence); - buddyStatusChangedCB(buddy, NULL, status, event); - break; - } - case PURPLE_BUDDY_ICON: - break; + case PURPLE_BUDDY_SIGNOFF: + case PURPLE_BUDDY_SIGNON: { + PurplePresence* presence = purple_buddy_get_presence(buddy); + PurpleStatus* status = purple_presence_get_active_status(presence); + buddyStatusChangedCB(buddy, NULL, status, event); + break; + } + case PURPLE_BUDDY_ICON: + break; - default: - break; + default: + break; } - + } void IMInvoker::buddyIdleChangedCB(PurpleBuddy *buddy, gboolean old_idle, gboolean idle, PurpleBuddyEvent event) { } - + void IMInvoker::buddyStatusChangedCB(PurpleBuddy *buddy, PurpleStatus *old, PurpleStatus *newstatus, PurpleBuddyEvent event) { PurpleAccount *account = purple_buddy_get_account(buddy); GET_INSTANCE_IN_CALLBACK(account); - + std::string buddyName = purple_buddy_get_name(buddy); Data buddyData = buddyToData(buddy); inst->_dataModelVars.compound["buddies"].compound[buddyName] = buddyData; - + Event retEv("im.buddy.status.changed"); retEv.data = buddyData; inst->returnEvent(retEv); @@ -374,7 +391,7 @@ void IMInvoker::buddyAddedCB(PurpleBuddy* buddy) { GET_INSTANCE_IN_CALLBACK(account); if (!inst) return; - + std::string buddyName = purple_buddy_get_name(buddy); Event retEv("im.buddy.added"); @@ -389,11 +406,11 @@ void IMInvoker::buddyRemovedCB(PurpleBuddy* buddy) { PurpleAccount *account = purple_buddy_get_account(buddy); GET_INSTANCE_IN_CALLBACK(account); std::string buddyName = purple_buddy_get_name(buddy); - + Event retEv("im.buddy.removed"); retEv.data.compound["name"] = Data(buddyName, Data::VERBATIM); inst->returnEvent(retEv); - + inst->_dataModelVars.compound["buddies"].compound.erase(buddyName); } @@ -415,9 +432,9 @@ Data IMInvoker::statusToData(PurpleStatus *status) { Data data; const char* statusName = purple_status_get_name(status); if (statusName) data.compound["name"] = Data(statusName, Data::VERBATIM); - + PurpleStatusType* statusType = purple_status_get_type(status); - + GList *statusAttrElem; GList *statusAttrList = purple_status_type_get_attrs(statusType); PurpleStatusAttr* statusAttr; @@ -429,26 +446,26 @@ Data IMInvoker::statusToData(PurpleStatus *status) { data.compound[statusAttrId] = purpleValueToData(statusValue); } } - + data.compound["active"] = Data((bool)purple_status_is_active(status)); data.compound["available"] = Data((bool)purple_status_is_available(status)); data.compound["exclusive"] = Data((bool)purple_status_is_exclusive(status)); data.compound["active"] = Data((bool)purple_status_is_active(status)); data.compound["independent"] = Data((bool)purple_status_is_independent(status)); data.compound["online"] = Data((bool)purple_status_is_online(status)); - + return data; } Data IMInvoker::buddyToData(PurpleBuddy *buddy) { Data data; std::string buddyName = purple_buddy_get_name(buddy); - + if (purple_buddy_get_name(buddy)) data.compound["name"] = Data(purple_buddy_get_name(buddy), Data::VERBATIM); if (purple_buddy_get_alias(buddy)) data.compound["alias"] = Data(purple_buddy_get_alias(buddy), Data::VERBATIM); if (purple_buddy_get_alias_only(buddy)) data.compound["aliasOnly"] = Data(purple_buddy_get_alias_only(buddy), Data::VERBATIM); if (purple_buddy_get_server_alias(buddy)) data.compound["server"] = Data(purple_buddy_get_server_alias(buddy), Data::VERBATIM); - + PurpleGroup* group = purple_buddy_get_group(buddy); if (group) { if (purple_group_get_name(group)) data.compound["group"] = Data(purple_group_get_name(group), Data::VERBATIM); @@ -460,7 +477,7 @@ Data IMInvoker::buddyToData(PurpleBuddy *buddy) { gconstpointer iconData = purple_buddy_icon_get_data(icon, &iconSize); data.compound["icon"] = Data((char*)iconData, iconSize, false); } - + PurplePresence* presence = purple_buddy_get_presence(buddy); if (presence) { @@ -478,7 +495,7 @@ Data IMInvoker::buddyToData(PurpleBuddy *buddy) { continue; data.compound["status"].compound[statusId] = statusToData(status); } - + } return data; @@ -487,58 +504,58 @@ Data IMInvoker::buddyToData(PurpleBuddy *buddy) { Data IMInvoker::purpleValueToData(PurpleValue* value) { Data data; switch (purple_value_get_type(value)) { - case PURPLE_TYPE_BOOLEAN: - if (purple_value_get_boolean(value)) - data = Data("true"); - data = Data("false"); - break; - case PURPLE_TYPE_STRING: - if (purple_value_get_string(value)) { - data = Data(purple_value_get_string(value), Data::VERBATIM); - } - break; - case PURPLE_TYPE_CHAR: - Data(purple_value_get_char(value)); - break; - case PURPLE_TYPE_UCHAR: - Data(purple_value_get_uchar(value)); - break; - case PURPLE_TYPE_SHORT: - Data(purple_value_get_short(value)); - break; - case PURPLE_TYPE_USHORT: - Data(purple_value_get_ushort(value)); - break; - case PURPLE_TYPE_INT: - Data(purple_value_get_int(value)); - break; - case PURPLE_TYPE_UINT: - Data(purple_value_get_uint(value)); - break; - case PURPLE_TYPE_LONG: - Data(purple_value_get_long(value)); - break; - case PURPLE_TYPE_ULONG: - Data(purple_value_get_ulong(value)); - break; - case PURPLE_TYPE_INT64: - Data(purple_value_get_int64(value)); - break; - case PURPLE_TYPE_UINT64: - Data(purple_value_get_uint64(value)); - break; - case PURPLE_TYPE_OBJECT: - case PURPLE_TYPE_POINTER: - case PURPLE_TYPE_ENUM: - case PURPLE_TYPE_BOXED: - case PURPLE_TYPE_UNKNOWN: - case PURPLE_TYPE_SUBTYPE: - LOG(ERROR) << "purple thingy not supported"; - break; + case PURPLE_TYPE_BOOLEAN: + if (purple_value_get_boolean(value)) + data = Data("true"); + data = Data("false"); + break; + case PURPLE_TYPE_STRING: + if (purple_value_get_string(value)) { + data = Data(purple_value_get_string(value), Data::VERBATIM); + } + break; + case PURPLE_TYPE_CHAR: + Data(purple_value_get_char(value)); + break; + case PURPLE_TYPE_UCHAR: + Data(purple_value_get_uchar(value)); + break; + case PURPLE_TYPE_SHORT: + Data(purple_value_get_short(value)); + break; + case PURPLE_TYPE_USHORT: + Data(purple_value_get_ushort(value)); + break; + case PURPLE_TYPE_INT: + Data(purple_value_get_int(value)); + break; + case PURPLE_TYPE_UINT: + Data(purple_value_get_uint(value)); + break; + case PURPLE_TYPE_LONG: + Data(purple_value_get_long(value)); + break; + case PURPLE_TYPE_ULONG: + Data(purple_value_get_ulong(value)); + break; + case PURPLE_TYPE_INT64: + Data(purple_value_get_int64(value)); + break; + case PURPLE_TYPE_UINT64: + Data(purple_value_get_uint64(value)); + break; + case PURPLE_TYPE_OBJECT: + case PURPLE_TYPE_POINTER: + case PURPLE_TYPE_ENUM: + case PURPLE_TYPE_BOXED: + case PURPLE_TYPE_UNKNOWN: + case PURPLE_TYPE_SUBTYPE: + LOG(ERROR) << "purple thingy not supported"; + break; } return data; } - + IMInvoker::IMInvoker() { _account = NULL; if (!_eventQueue) { @@ -575,7 +592,7 @@ void IMInvoker::send(const SendRequest& req) { EventContext* ctx = new EventContext(); ctx->sendReq = req; ctx->instance = this; - + std::string eventId = UUID::getUUID(); _eventQueue->addEvent(eventId, IMInvoker::send, 0, ctx); return; @@ -592,21 +609,21 @@ void IMInvoker::send(void *userdata, const std::string event) { Data data; Event::getParam(ctx->sendReq.params, "data", data); - + // purple_conv_im_send PurpleConversation* conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, ctx->instance->_account, receiver.c_str()); purple_conv_im_send(purple_conversation_get_im_data(conv), ctx->sendReq.content.c_str()); - + if (data.binary) { PurpleConnection *gc = purple_account_get_connection(ctx->instance->_account); PurplePlugin *prpl; PurplePluginProtocolInfo *prpl_info; - + if (gc) { prpl = purple_connection_get_prpl(gc); prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); - + // if (prpl_info && prpl_info->new_xfer) { // PurpleXfer* xfer = (prpl_info->new_xfer)(purple_account_get_connection(ctx->instance->_account), receiver.c_str()); // purple_xfer_set_local_filename(xfer, "/Users/sradomski/Documents/W3C Standards.pdf"); @@ -614,7 +631,7 @@ void IMInvoker::send(void *userdata, const std::string event) { // purple_xfer_request(xfer); // purple_xfer_request_accepted(xfer, "/Users/sradomski/Documents/W3C Standards.pdf"); // } - + //Set the filename // purple_xfer_set_local_filename(xfer, [[fileTransfer localFilename] UTF8String]); // purple_xfer_set_filename(xfer, [[[fileTransfer localFilename] lastPathComponent] UTF8String]); @@ -638,7 +655,7 @@ void IMInvoker::cancel(const std::string sendId) { } void IMInvoker::invoke(const InvokeRequest& req) { - + EventContext* ctx = new EventContext(); ctx->invokeReq = req; ctx->instance = this; @@ -651,20 +668,20 @@ void IMInvoker::invoke(void *userdata, const std::string event) { EventContext* ctx = (EventContext*)userdata; IMInvoker* instance = ctx->instance; - + std::string username; Event::getParam(ctx->invokeReq.params, "username", username); std::string protocolId; Event::getParam(ctx->invokeReq.params, "protocol", protocolId); std::string password; Event::getParam(ctx->invokeReq.params, "password", password); - + instance->_account = purple_account_new(username.c_str(), protocolId.c_str()); _accountInstances[instance->_account] = instance; - + purple_account_set_password(instance->_account, password.c_str(), NULL, NULL); purple_account_set_enabled(instance->_account, "uscxml", true); - + delete(ctx); _accountMutex.unlock(); } @@ -696,13 +713,13 @@ guint IMInvoker::purpleEventInputAdd(int fd, PurpleInputCondition cond, PurpleIn ctx->inputFD = fd; ctx->cond = cond; ctx->data = data; - + short opMask = 0; if (cond & PURPLE_INPUT_READ) opMask |= DelayedEventQueue::DEQ_READ; if (cond & PURPLE_INPUT_WRITE) opMask |= DelayedEventQueue::DEQ_WRITE; - + guint eventId = g_rand_int(_gRand); // std::cout << "-- Input add " << eventId << " --------" << fd << std::endl; _eventQueue->addEvent(toStr(eventId), fd, opMask, purpleCallback, ctx, true); @@ -719,7 +736,7 @@ int IMInvoker::purpleEventInputGetError(int fd, int *error) { int ret; socklen_t len; len = sizeof(*error); - + ret = getsockopt(fd, SOL_SOCKET, SO_ERROR, error, &len); if (!ret && !(*error)) { /* @@ -732,23 +749,22 @@ int IMInvoker::purpleEventInputGetError(int fd, int *error) { * Any listening socket will select for reading, and any read will fail * So, select for writing, if you can write, and the write fails, not connected */ - + { fd_set thisfd; struct timeval timeout; - + FD_ZERO(&thisfd); FD_SET(fd, &thisfd); timeout.tv_sec = 0; timeout.tv_usec = 0; select(fd+1, NULL, &thisfd, NULL, &timeout); - if(FD_ISSET(fd, &thisfd)){ + if(FD_ISSET(fd, &thisfd)) { ssize_t length = 0; char buffer[4] = {0, 0, 0, 0}; - + length = write(fd, buffer, length); - if(length == -1) - { + if(length == -1) { /* Not connected */ ret = -1; *error = ENOTCONN; @@ -756,7 +772,7 @@ int IMInvoker::purpleEventInputGetError(int fd, int *error) { } } } - + return ret; } @@ -799,36 +815,36 @@ GHashTable* IMInvoker::purpleGetUIInfo(void) { } void IMInvoker::accountNotifyAdded(PurpleAccount *account, - const char *remote_user, - const char *id, - const char *alias, - const char *message) { + const char *remote_user, + const char *id, + const char *alias, + const char *message) { std::cout << "accountNotifyAdded" << std::endl; } void IMInvoker::accountStatusChanged(PurpleAccount *account, - PurpleStatus *status) { + PurpleStatus *status) { std::cout << "accountStatusChanged" << std::endl; } void IMInvoker::accountRequestAdd(PurpleAccount *account, - const char *remote_user, - const char *id, - const char *alias, - const char *message) { + const char *remote_user, + const char *id, + const char *alias, + const char *message) { std::cout << "accountRequestAdd" << std::endl; } void* IMInvoker::accountRequestAuthorize(PurpleAccount *account, - const char *remote_user, - const char *id, - const char *alias, - const char *message, - gboolean on_list, - PurpleAccountRequestAuthorizationCb authorize_cb, - PurpleAccountRequestAuthorizationCb deny_cb, - void *user_data) { + const char *remote_user, + const char *id, + const char *alias, + const char *message, + gboolean on_list, + PurpleAccountRequestAuthorizationCb authorize_cb, + PurpleAccountRequestAuthorizationCb deny_cb, + void *user_data) { // always accept all "may I add you as a buddy?" requests authorize_cb(message, user_data); return user_data; @@ -851,10 +867,10 @@ void IMInvoker::purpleWriteConv(PurpleConversation *conv, const char *name, cons who = name; else who = NULL; - + printf("(%s) %s %s: %s\n", purple_conversation_get_name(conv), - purple_utf8_strftime("(%H:%M:%S)", localtime(&mtime)), - who, message); + purple_utf8_strftime("(%H:%M:%S)", localtime(&mtime)), + who, message); } void IMInvoker::purpleChatAddUsers(PurpleConversation *conv, GList *cbuddies, gboolean new_arrivals) {} void IMInvoker::purpleChatRenameUser(PurpleConversation *conv, const char *old_name, const char *new_name, const char *new_alias) {} @@ -964,33 +980,33 @@ void IMInvoker::purplePermitRemoved(PurpleAccount *account, const char *name) {} void IMInvoker::purpleDebyAdded(PurpleAccount *account, const char *name) {} void IMInvoker::purpleDenyRemoved(PurpleAccount *account, const char *name) {} - + // request ui operations void* IMInvoker::purpleRequestInput(const char *title, const char *primary, - const char *secondary, const char *default_value, - gboolean multiline, gboolean masked, gchar *hint, - const char *ok_text, GCallback ok_cb, - const char *cancel_text, GCallback cancel_cb, - PurpleRequestCommonParameters *cpar, void *user_data) { + const char *secondary, const char *default_value, + gboolean multiline, gboolean masked, gchar *hint, + const char *ok_text, GCallback ok_cb, + const char *cancel_text, GCallback cancel_cb, + PurpleRequestCommonParameters *cpar, void *user_data) { return NULL; } void* IMInvoker::purpleRequestChoice(const char *title, const char *primary, - const char *secondary, gpointer default_value, - const char *ok_text, GCallback ok_cb, const char *cancel_text, - GCallback cancel_cb, PurpleRequestCommonParameters *cpar, - void *user_data, va_list choices) { + const char *secondary, gpointer default_value, + const char *ok_text, GCallback ok_cb, const char *cancel_text, + GCallback cancel_cb, PurpleRequestCommonParameters *cpar, + void *user_data, va_list choices) { return NULL; } void* IMInvoker::purpleRequestAction(const char *title, const char *primary, - const char *secondary, int default_action, - PurpleRequestCommonParameters *cpar, void *user_data, - size_t action_count, va_list actions) { + const char *secondary, int default_action, + PurpleRequestCommonParameters *cpar, void *user_data, + size_t action_count, va_list actions) { return NULL; } void* IMInvoker::purpleRequestWait(const char *title, const char *primary, - const char *secondary, gboolean with_progress, - PurpleRequestCancelCb cancel_cb, - PurpleRequestCommonParameters *cpar, void *user_data) { + const char *secondary, gboolean with_progress, + PurpleRequestCancelCb cancel_cb, + PurpleRequestCommonParameters *cpar, void *user_data) { return NULL; } @@ -998,15 +1014,15 @@ void IMInvoker::purpleRequestWaitUpdate(void *ui_handle, gboolean pulse, gfloat } void* IMInvoker::purpleRequestFields(const char *title, const char *primary, - const char *secondary, PurpleRequestFields *fields, - const char *ok_text, GCallback ok_cb, - const char *cancel_text, GCallback cancel_cb, - PurpleRequestCommonParameters *cpar, void *user_data) { + const char *secondary, PurpleRequestFields *fields, + const char *ok_text, GCallback ok_cb, + const char *cancel_text, GCallback cancel_cb, + PurpleRequestCommonParameters *cpar, void *user_data) { return NULL; } void* IMInvoker::purpleRequestFile(const char *title, const char *filename, - gboolean savedialog, GCallback ok_cb, GCallback cancel_cb, - PurpleRequestCommonParameters *cpar, void *user_data) { + gboolean savedialog, GCallback ok_cb, GCallback cancel_cb, + PurpleRequestCommonParameters *cpar, void *user_data) { // click ok PurpleXfer *xfer = (PurpleXfer *)user_data; PurpleXferType xferType = purple_xfer_get_type(xfer); @@ -1023,8 +1039,8 @@ void* IMInvoker::purpleRequestFile(const char *title, const char *filename, } void* IMInvoker::purpleRequestFolder(const char *title, const char *dirname, - GCallback ok_cb, GCallback cancel_cb, - PurpleRequestCommonParameters *cpar, void *user_data) { + GCallback ok_cb, GCallback cancel_cb, + PurpleRequestCommonParameters *cpar, void *user_data) { return NULL; } @@ -1060,5 +1076,5 @@ gboolean IMInvoker::purpleDebugIsEnabled(PurpleDebugLevel level, const char *cat return true; } - + }
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/im/IMInvoker.h b/src/uscxml/plugins/invoker/im/IMInvoker.h index 51af8f8..25cbdd3 100644 --- a/src/uscxml/plugins/invoker/im/IMInvoker.h +++ b/src/uscxml/plugins/invoker/im/IMInvoker.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef IMINVOKER_H_FNWG0XCQ #define IMINVOKER_H_FNWG0XCQ @@ -6,7 +25,7 @@ extern "C" { #include <libpurple/purple.h> } - + #ifdef BUILD_AS_PLUGINS #include "uscxml/plugins/Plugins.h" #endif @@ -14,17 +33,17 @@ extern "C" { namespace uscxml { typedef enum { - PURPLE_BUDDY_NONE = 0x00, /**< No events. */ - PURPLE_BUDDY_SIGNON = 0x01, /**< The buddy signed on. */ - PURPLE_BUDDY_SIGNOFF = 0x02, /**< The buddy signed off. */ - PURPLE_BUDDY_INFO_UPDATED = 0x10, /**< The buddy's information (profile) changed. */ - PURPLE_BUDDY_ICON = 0x40, /**< The buddy's icon changed. */ - PURPLE_BUDDY_MISCELLANEOUS = 0x80, /**< The buddy's service-specific miscalleneous info changed. */ - PURPLE_BUDDY_SIGNON_TIME = 0x11, /**< The buddy's signon time changed. */ - PURPLE_BUDDY_EVIL = 0x12, /**< The buddy's warning level changed. */ - PURPLE_BUDDY_DIRECTIM_CONNECTED = 0x14, /**< Connected to the buddy via DirectIM. */ - PURPLE_BUDDY_DIRECTIM_DISCONNECTED = 0x18, /**< Disconnected from the buddy via DirectIM. */ - PURPLE_BUDDY_NAME = 0x20 /**<Buddy name (UID) changed. */ + PURPLE_BUDDY_NONE = 0x00, /**< No events. */ + PURPLE_BUDDY_SIGNON = 0x01, /**< The buddy signed on. */ + PURPLE_BUDDY_SIGNOFF = 0x02, /**< The buddy signed off. */ + PURPLE_BUDDY_INFO_UPDATED = 0x10, /**< The buddy's information (profile) changed. */ + PURPLE_BUDDY_ICON = 0x40, /**< The buddy's icon changed. */ + PURPLE_BUDDY_MISCELLANEOUS = 0x80, /**< The buddy's service-specific miscalleneous info changed. */ + PURPLE_BUDDY_SIGNON_TIME = 0x11, /**< The buddy's signon time changed. */ + PURPLE_BUDDY_EVIL = 0x12, /**< The buddy's warning level changed. */ + PURPLE_BUDDY_DIRECTIM_CONNECTED = 0x14, /**< Connected to the buddy via DirectIM. */ + PURPLE_BUDDY_DIRECTIM_DISCONNECTED = 0x18, /**< Disconnected from the buddy via DirectIM. */ + PURPLE_BUDDY_NAME = 0x20 /**<Buddy name (UID) changed. */ } PurpleBuddyEvent; class IMInvoker : public InvokerImpl { @@ -34,7 +53,7 @@ public: SendRequest sendReq; IMInvoker* instance; }; - + IMInvoker(); virtual ~IMInvoker(); virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); @@ -55,13 +74,13 @@ public: private: static bool _libPurpleIsInitialized; static Data _pluginData; - + Data _dataModelVars; static Data buddyToData(PurpleBuddy *buddy); static Data statusToData(PurpleStatus *status); static Data purpleValueToData(PurpleValue* value); - + static PurpleAccountUiOps _uiAccountOps; static PurpleEventLoopUiOps _uiEventLoopOps; static PurpleCoreUiOps _uiCoreOps; @@ -74,7 +93,7 @@ private: static PurpleConnectionUiOps _uiConnectOps; static PurpleWhiteboardUiOps _uiWhiteboardOps; static PurpleDebugUiOps _uiDebugOps; - + static PurpleRequestFeature _features; static GHashTable* _uiInfo; static GRand* _gRand; @@ -84,7 +103,7 @@ private: static tthread::mutex _initMutex; static tthread::condition_variable _initCond; static DelayedEventQueue* _eventQueue; - + // libpurple event callbacks static void signedOnCB(PurpleConnection *gc, gpointer null); static void conversationCreatedCB(PurpleConversation *conv, void *data); @@ -101,7 +120,7 @@ private: static void buddyRemovedCB(PurpleBuddy* buddy); static void fileRecvRequestCB(PurpleXfer *xfer); static void buddyCapsChangedCB(PurpleBuddy* buddy, PurpleMediaCaps newcaps, PurpleMediaCaps oldcaps); - + // these are only being called from the delayed queue's thread static void initLibPurple(void *userdata, const std::string event); static void setupPurpleSignals(); @@ -126,12 +145,12 @@ private: gpointer data; }; static void purpleCallback(void *userdata, const std::string event); - + // libpurple debug static void purpleDebugPrint(PurpleDebugLevel level, const char *category, const char *arg_s); static gboolean purpleDebugIsEnabled(PurpleDebugLevel level, const char *category); - + // libpurple core operations static void purplePrefsInit(void); static void purpleDebugInit(void); @@ -155,7 +174,7 @@ private: static void purpleCustomSmileyWrite(PurpleConversation *conv, const char *smile, const guchar *data, gsize size); static void purpleCustomSmileyClose(PurpleConversation *conv, const char *smile); static void purpleSendConfirm(PurpleConversation *conv, const char *message); - + // buddy operations static void purpleNewList(PurpleBuddyList *list); static void purpleNewNode(PurpleBlistNode *node); @@ -193,7 +212,7 @@ private: static void* purpeNotifyUserInfo(PurpleConnection *gc, const char *who, PurpleNotifyUserInfo *user_info); static void* purpeNotifyURI(const char *uri); static void purpeNotifyClose(PurpleNotifyType type, void *ui_handle); - + // account operations static void accountNotifyAdded(PurpleAccount *account, const char *remote_user, const char *id, const char *alias, const char *message); static void accountStatusChanged(PurpleAccount *account, PurpleStatus *status); @@ -209,40 +228,40 @@ private: // request ui operations static void* purpleRequestInput(const char *title, const char *primary, - const char *secondary, const char *default_value, - gboolean multiline, gboolean masked, gchar *hint, - const char *ok_text, GCallback ok_cb, - const char *cancel_text, GCallback cancel_cb, - PurpleRequestCommonParameters *cpar, void *user_data); + const char *secondary, const char *default_value, + gboolean multiline, gboolean masked, gchar *hint, + const char *ok_text, GCallback ok_cb, + const char *cancel_text, GCallback cancel_cb, + PurpleRequestCommonParameters *cpar, void *user_data); static void* purpleRequestChoice(const char *title, const char *primary, - const char *secondary, gpointer default_value, - const char *ok_text, GCallback ok_cb, const char *cancel_text, - GCallback cancel_cb, PurpleRequestCommonParameters *cpar, - void *user_data, va_list choices); + const char *secondary, gpointer default_value, + const char *ok_text, GCallback ok_cb, const char *cancel_text, + GCallback cancel_cb, PurpleRequestCommonParameters *cpar, + void *user_data, va_list choices); static void* purpleRequestAction(const char *title, const char *primary, - const char *secondary, int default_action, - PurpleRequestCommonParameters *cpar, void *user_data, - size_t action_count, va_list actions); + const char *secondary, int default_action, + PurpleRequestCommonParameters *cpar, void *user_data, + size_t action_count, va_list actions); static void* purpleRequestWait(const char *title, const char *primary, - const char *secondary, gboolean with_progress, - PurpleRequestCancelCb cancel_cb, - PurpleRequestCommonParameters *cpar, void *user_data); + const char *secondary, gboolean with_progress, + PurpleRequestCancelCb cancel_cb, + PurpleRequestCommonParameters *cpar, void *user_data); static void purpleRequestWaitUpdate(void *ui_handle, gboolean pulse, gfloat fraction); static void* purpleRequestFields(const char *title, const char *primary, - const char *secondary, PurpleRequestFields *fields, - const char *ok_text, GCallback ok_cb, - const char *cancel_text, GCallback cancel_cb, - PurpleRequestCommonParameters *cpar, void *user_data); + const char *secondary, PurpleRequestFields *fields, + const char *ok_text, GCallback ok_cb, + const char *cancel_text, GCallback cancel_cb, + PurpleRequestCommonParameters *cpar, void *user_data); static void* purpleRequestFile(const char *title, const char *filename, - gboolean savedialog, GCallback ok_cb, GCallback cancel_cb, - PurpleRequestCommonParameters *cpar, void *user_data); + gboolean savedialog, GCallback ok_cb, GCallback cancel_cb, + PurpleRequestCommonParameters *cpar, void *user_data); static void* purpleRequestFolder(const char *title, const char *dirname, - GCallback ok_cb, GCallback cancel_cb, - PurpleRequestCommonParameters *cpar, void *user_data); + GCallback ok_cb, GCallback cancel_cb, + PurpleRequestCommonParameters *cpar, void *user_data); static void purpleRequestClose(PurpleRequestType type, void *ui_handle); - + // connection ui operations static void purpleConnectProgress(PurpleConnection *gc, const char *text, size_t step, size_t step_count); static void purpleConnected(PurpleConnection *gc); @@ -251,8 +270,8 @@ private: static void purpleNetworkConnected(void); static void purpleNetworkDisconnected(void); static void purpleReportDisconnect(PurpleConnection *gc, PurpleConnectionError reason, const char *text); - - + + // whiteboard ui operations static void purpleCreateWB(PurpleWhiteboard *wb); static void purpleDestroyWB(PurpleWhiteboard *wb); @@ -261,7 +280,7 @@ private: static void purpleDrawPont(PurpleWhiteboard *wb, int x, int y, int color, int size); static void purpleDrawLine(PurpleWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size); static void purpleClearWB(PurpleWhiteboard *wb); - + PurpleAccount* _account; }; diff --git a/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.cpp b/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.cpp index 3a3354a..196211a 100644 --- a/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.cpp +++ b/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "MilesSessionInvoker.h" #include <glog/logging.h> @@ -11,7 +30,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new MilesSessionInvokerProvider() ); return true; } @@ -41,10 +60,10 @@ void MilesSessionInvoker::send(const SendRequest& req) { if (boost::iequals(req.name, "disconnect")) { std::string reflectorIP = "127.0.0.1"; Event::getParam(req.params, "reflectorip", reflectorIP); - + std::string problemName = "Generic"; Event::getParam(req.params, "problemname", problemName); - + int rv; rv = miles_disconnect_reflector_session((char*)reflectorIP.c_str(), (char*)problemName.c_str()); if (!rv) { @@ -60,31 +79,31 @@ void MilesSessionInvoker::send(const SendRequest& req) { imageURL2.toAbsolute(_interpreter->getBaseURI()); std::stringstream ssImage; - + if (alternate) { ssImage << imageURL1; } else { ssImage << imageURL2; } alternate = !alternate; - + std::string imageContent = ssImage.str(); - + Event retEv; retEv.data.compound["base64"] = Data(base64_encode(imageContent.data(), imageContent.size()), Data::VERBATIM); std::string origin; Event::getParam(req.params, "origin", origin); retEv.data.compound["origin"] = origin; - + tthread::this_thread::sleep_for(tthread::chrono::milliseconds(20)); - + returnEvent(retEv); - + } else if (boost::iequals(req.name, "connect")) { std::string email = "someSaneDefault"; Event::getParam(req.params, "email", email); - + std::string reflectorIP = "127.0.0.1"; Event::getParam(req.params, "reflectorip", reflectorIP); diff --git a/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.h b/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.h index c28f2cc..bd86c5b 100644 --- a/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.h +++ b/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef MILESSESIONINVOKER_H_W09J90F0 #define MILESSESIONINVOKER_H_W09J90F0 @@ -40,7 +59,7 @@ public: protected: bool alternate; // this is to alternate test1 an test2.jpeg and has no other use! remove me later .. - + int video_rtp_in_socket, audio_rtp_in_socket; int video_rtp_out_socket, audio_rtp_out_socket; int video_rtcp_in_socket, audio_rtcp_in_socket; diff --git a/src/uscxml/plugins/invoker/miles/SpatialAudio.cpp.old b/src/uscxml/plugins/invoker/miles/SpatialAudio.cpp.old index 9a26960..2f8e032 100644 --- a/src/uscxml/plugins/invoker/miles/SpatialAudio.cpp.old +++ b/src/uscxml/plugins/invoker/miles/SpatialAudio.cpp.old @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "uscxml/Common.h" #include "SpatialAudio.h" #include "uscxml/Interpreter.h" @@ -14,7 +33,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new SpatialAudioProvider() ); return true; } diff --git a/src/uscxml/plugins/invoker/miles/SpatialAudio.h.old b/src/uscxml/plugins/invoker/miles/SpatialAudio.h.old index e7ab830..d6ca285 100644 --- a/src/uscxml/plugins/invoker/miles/SpatialAudio.h.old +++ b/src/uscxml/plugins/invoker/miles/SpatialAudio.h.old @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef SPATIALAUDIO_H_EH11SAQC #define SPATIALAUDIO_H_EH11SAQC diff --git a/src/uscxml/plugins/invoker/sample/SampleInvoker.cpp b/src/uscxml/plugins/invoker/sample/SampleInvoker.cpp index bb17370..0777c62 100644 --- a/src/uscxml/plugins/invoker/sample/SampleInvoker.cpp +++ b/src/uscxml/plugins/invoker/sample/SampleInvoker.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "SampleInvoker.h" #include <glog/logging.h> @@ -9,7 +28,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new SampleInvokerProvider() ); return true; } diff --git a/src/uscxml/plugins/invoker/sample/SampleInvoker.h b/src/uscxml/plugins/invoker/sample/SampleInvoker.h index 30297b2..16e4df1 100644 --- a/src/uscxml/plugins/invoker/sample/SampleInvoker.h +++ b/src/uscxml/plugins/invoker/sample/SampleInvoker.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef SAMPLEINVOKER_H_W09J90F0 #define SAMPLEINVOKER_H_W09J90F0 diff --git a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp index 85c4b9c..05ea460 100644 --- a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp +++ b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "USCXMLInvoker.h" #include <glog/logging.h> @@ -9,13 +28,14 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new USCXMLInvokerProvider() ); return true; } #endif USCXMLInvoker::USCXMLInvoker() : _cancelled(false) { + _parentQueue._invoker = this; } @@ -62,7 +82,7 @@ void USCXMLInvoker::invoke(const InvokeRequest& req) { if (dataModel) { } - _invokedInterpreter.getImpl()->setParentQueue(this); + _invokedInterpreter.getImpl()->setParentQueue(&_parentQueue); // transfer namespace prefixes _invokedInterpreter.getImpl()->_nsURL = _parentInterpreter->_nsURL; _invokedInterpreter.getImpl()->_xpathPrefix = _parentInterpreter->_xpathPrefix; @@ -86,13 +106,13 @@ void USCXMLInvoker::invoke(const InvokeRequest& req) { } } -void USCXMLInvoker::push(const SendRequest& event) { +void USCXMLInvoker::ParentQueue::push(const SendRequest& event) { // test 252 - if (_cancelled) + if (_invoker->_cancelled) return; SendRequest copyEvent(event); - copyEvent.invokeid = _invokeId; - _parentInterpreter->receive(copyEvent); + copyEvent.invokeid = _invoker->_invokeId; + _invoker->_parentInterpreter->receive(copyEvent); } }
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h index 896eaa3..7c0e217 100644 --- a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h +++ b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef USCXMLINVOKER_H_OQFA21IO #define USCXMLINVOKER_H_OQFA21IO @@ -12,12 +31,19 @@ namespace uscxml { class Interpreter; - +class USCXMLInvoker; + class USCXMLInvoker : public InvokerImpl, - public uscxml::concurrency::BlockingQueue<SendRequest>, public boost::enable_shared_from_this<USCXMLInvoker> { public: + class ParentQueue : public concurrency::BlockingQueue<SendRequest> { + public: + ParentQueue() {} + virtual void push(const SendRequest& event); + USCXMLInvoker* _invoker; + }; + USCXMLInvoker(); virtual ~USCXMLInvoker(); virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); @@ -34,11 +60,10 @@ public: virtual void send(const SendRequest& req); virtual void cancel(const std::string sendId); virtual void invoke(const InvokeRequest& req); - - virtual void push(const SendRequest& event); - + protected: bool _cancelled; + ParentQueue _parentQueue; Interpreter _invokedInterpreter; InterpreterImpl* _parentInterpreter; }; diff --git a/src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.cpp b/src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.cpp index db65ab8..debe371 100644 --- a/src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.cpp +++ b/src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "Sqlite3Invoker.h" #include <glog/logging.h> @@ -9,7 +28,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new Sqlite3InvokerProvider() ); return true; } diff --git a/src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.h b/src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.h index b3a9fd7..e024fd7 100644 --- a/src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.h +++ b/src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef SQLITE3INVOKER_H_W09J90F0 #define SQLITE3INVOKER_H_W09J90F0 diff --git a/src/uscxml/plugins/invoker/system/SystemInvoker.cpp b/src/uscxml/plugins/invoker/system/SystemInvoker.cpp index d306cb9..c5f574f 100644 --- a/src/uscxml/plugins/invoker/system/SystemInvoker.cpp +++ b/src/uscxml/plugins/invoker/system/SystemInvoker.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "SystemInvoker.h" #include <glog/logging.h> @@ -9,7 +28,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add(new SystemInvokerProvider()); return true; } diff --git a/src/uscxml/plugins/invoker/system/SystemInvoker.h b/src/uscxml/plugins/invoker/system/SystemInvoker.h index 78903f6..5be04eb 100644 --- a/src/uscxml/plugins/invoker/system/SystemInvoker.h +++ b/src/uscxml/plugins/invoker/system/SystemInvoker.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef SYSTEMINVOKER_H_W09J90F0 #define SYSTEMINVOKER_H_W09J90F0 diff --git a/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp b/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp index 6845280..b1776d9 100644 --- a/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp +++ b/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "UmundoInvoker.h" #include <glog/logging.h> #include "uscxml/URL.h" @@ -10,7 +29,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new UmundoInvokerProvider() ); return true; } diff --git a/src/uscxml/plugins/invoker/umundo/UmundoInvoker.h b/src/uscxml/plugins/invoker/umundo/UmundoInvoker.h index c013a52..4b28bfe 100644 --- a/src/uscxml/plugins/invoker/umundo/UmundoInvoker.h +++ b/src/uscxml/plugins/invoker/umundo/UmundoInvoker.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef UMUNDOINVOKER_H_77YXQGU7 #define UMUNDOINVOKER_H_77YXQGU7 diff --git a/src/uscxml/plugins/invoker/vxml/VoiceXMLInvoker.cpp b/src/uscxml/plugins/invoker/vxml/VoiceXMLInvoker.cpp index c0d3329..573920f 100644 --- a/src/uscxml/plugins/invoker/vxml/VoiceXMLInvoker.cpp +++ b/src/uscxml/plugins/invoker/vxml/VoiceXMLInvoker.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "VoiceXMLInvoker.h" #include <glog/logging.h> @@ -9,7 +28,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new VoiceXMLInvokerProvider() ); return true; } diff --git a/src/uscxml/plugins/invoker/vxml/VoiceXMLInvoker.h b/src/uscxml/plugins/invoker/vxml/VoiceXMLInvoker.h index d89382e..f354927 100644 --- a/src/uscxml/plugins/invoker/vxml/VoiceXMLInvoker.h +++ b/src/uscxml/plugins/invoker/vxml/VoiceXMLInvoker.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef VOICEXMLINVOKER_H_W09J90F0 #define VOICEXMLINVOKER_H_W09J90F0 diff --git a/src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.cpp b/src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.cpp index acbf085..0952b13 100644 --- a/src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.cpp +++ b/src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 <uscxml/config.h> #include "XHTMLInvoker.h" #include <glog/logging.h> @@ -20,7 +39,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new XHTMLInvokerProvider() ); return true; } diff --git a/src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.h b/src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.h index e94c4fd..03b9116 100644 --- a/src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.h +++ b/src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef XHTMLINVOKER_H_W09J90F0 #define XHTMLINVOKER_H_W09J90F0 diff --git a/src/uscxml/plugins/ioprocessor/CMakeLists.txt b/src/uscxml/plugins/ioprocessor/CMakeLists.txt index bcab37c..7480b6b 100644 --- a/src/uscxml/plugins/ioprocessor/CMakeLists.txt +++ b/src/uscxml/plugins/ioprocessor/CMakeLists.txt @@ -7,7 +7,8 @@ if (BUILD_AS_PLUGINS) source_group("" FILES ${SAMPLE_IOPROCESSOR}) add_library( ioprocessor_sample SHARED - ${SAMPLE_IOPROCESSOR}) + ${SAMPLE_IOPROCESSOR} + "../Plugins.cpp") target_link_libraries(ioprocessor_sample uscxml) set_target_properties(ioprocessor_sample PROPERTIES FOLDER "Plugin IOProcessor") else() @@ -23,7 +24,8 @@ if (BUILD_AS_PLUGINS) source_group("" FILES ${COMET_IOPROCESSOR}) add_library( ioprocessor_comet SHARED - ${COMET_IOPROCESSOR}) + ${COMET_IOPROCESSOR} + "../Plugins.cpp") target_link_libraries(ioprocessor_comet uscxml) set_target_properties(ioprocessor_comet PROPERTIES FOLDER "Plugin IOProcessor") else() @@ -42,7 +44,8 @@ if (BUILD_AS_PLUGINS) source_group("" FILES ${BASICHTTP_IOPROCESSOR}) add_library( ioprocessor_basichttp SHARED - ${BASICHTTP_IOPROCESSOR}) + ${BASICHTTP_IOPROCESSOR} + "../Plugins.cpp") target_link_libraries(ioprocessor_basichttp uscxml) set_target_properties(ioprocessor_basichttp PROPERTIES FOLDER "Plugin IOProcessor") else() @@ -61,7 +64,8 @@ if (BUILD_AS_PLUGINS) source_group("" FILES ${SCXML_IOPROCESSOR}) add_library( ioprocessor_scxml SHARED - ${SCXML_IOPROCESSOR}) + ${SCXML_IOPROCESSOR} + "../Plugins.cpp") # scxml ioprocessor is a basichttp ioprocessor target_link_libraries(ioprocessor_scxml ioprocessor_basichttp uscxml) set_target_properties(ioprocessor_scxml PROPERTIES FOLDER "Plugin IOProcessor") @@ -99,7 +103,8 @@ if (PROTOBUF_FOUND AND OFF) source_group("" FILES ${MMI_IOPROCESSOR}) add_library( ioprocessor_mmi SHARED - ${MMI_IOPROCESSOR}) + ${MMI_IOPROCESSOR} + "../Plugins.cpp") target_link_libraries(ioprocessor_mmi uscxml mmi_proto) set_target_properties(ioprocessor_mmi PROPERTIES FOLDER "Plugin IOProcessor") else() diff --git a/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp index b5aa985..08cc749 100644 --- a/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp +++ b/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp @@ -1,7 +1,23 @@ -#ifdef _WIN32 -#include <winsock2.h> -#include <windows.h> -#endif +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "uscxml/Common.h" #include "uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.h" #include "uscxml/Message.h" @@ -15,6 +31,11 @@ #include <io/uri.hpp> #include <glog/logging.h> +#ifdef _WIN32 +#include <winsock2.h> +#include <windows.h> +#endif + #ifndef _WIN32 #include <netdb.h> #include <arpa/inet.h> @@ -28,7 +49,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new BasicHTTPIOProcessorProvider() ); return true; } diff --git a/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.h b/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.h index c0fddc1..20369d7 100644 --- a/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.h +++ b/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.h @@ -1,6 +1,40 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef BASICHTTPIOPROCESSOR_H_2CUY93KU #define BASICHTTPIOPROCESSOR_H_2CUY93KU +extern "C" { +#include <event2/http.h> +#include <event2/http_struct.h> +} + +#if defined(_WIN32) && !defined(USCXML_STATIC) +# if (defined ioprocessor_basichttp_EXPORTS || defined USCXML_EXPORT) +# define USCXML_PLUGIN_API __declspec(dllexport) +# else +# define USCXML_PLUGIN_API __declspec(dllimport) +# endif +#else +# define USCXML_PLUGIN_API +#endif + #include "uscxml/concurrency/eventqueue/DelayedEventQueue.h" #include "uscxml/server/HTTPServer.h" #include "uscxml/Interpreter.h" @@ -9,16 +43,13 @@ #include <sys/time.h> #endif -#include <event2/http.h> -#include <event2/http_struct.h> - #ifdef BUILD_AS_PLUGINS #include "uscxml/plugins/Plugins.h" #endif namespace uscxml { -class BasicHTTPIOProcessor : public IOProcessorImpl, public HTTPServlet, public URLMonitor { +class USCXML_PLUGIN_API BasicHTTPIOProcessor : public IOProcessorImpl, public HTTPServlet, public URLMonitor { public: BasicHTTPIOProcessor(); virtual ~BasicHTTPIOProcessor(); diff --git a/src/uscxml/plugins/ioprocessor/comet/CometIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/comet/CometIOProcessor.cpp index 8fd1172..5633f0e 100644 --- a/src/uscxml/plugins/ioprocessor/comet/CometIOProcessor.cpp +++ b/src/uscxml/plugins/ioprocessor/comet/CometIOProcessor.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 <uscxml/Common.h> #include "uscxml/plugins/ioprocessor/comet/CometIOProcessor.h" #include "uscxml/Message.h" @@ -13,7 +32,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new CometIOProcessorProvider() ); return true; } diff --git a/src/uscxml/plugins/ioprocessor/comet/CometIOProcessor.h b/src/uscxml/plugins/ioprocessor/comet/CometIOProcessor.h index 05a3798..8acbac0 100644 --- a/src/uscxml/plugins/ioprocessor/comet/CometIOProcessor.h +++ b/src/uscxml/plugins/ioprocessor/comet/CometIOProcessor.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef COMETIOPROCESSOR_H_2CUY93KU #define COMETIOPROCESSOR_H_2CUY93KU diff --git a/src/uscxml/plugins/ioprocessor/dom/DOMIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/dom/DOMIOProcessor.cpp index e69de29..1a3417a 100644 --- a/src/uscxml/plugins/ioprocessor/dom/DOMIOProcessor.cpp +++ b/src/uscxml/plugins/ioprocessor/dom/DOMIOProcessor.cpp @@ -0,0 +1,19 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + diff --git a/src/uscxml/plugins/ioprocessor/dom/DOMIOProcessor.h b/src/uscxml/plugins/ioprocessor/dom/DOMIOProcessor.h index e69de29..1a3417a 100644 --- a/src/uscxml/plugins/ioprocessor/dom/DOMIOProcessor.h +++ b/src/uscxml/plugins/ioprocessor/dom/DOMIOProcessor.h @@ -0,0 +1,19 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + diff --git a/src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.cpp index 0009cc0..15c05c0 100644 --- a/src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.cpp +++ b/src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.h" #include "uscxml/Message.h" @@ -9,7 +28,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new MMIHTTPIOProcessorProvider() ); return true; } diff --git a/src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.h b/src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.h index 3c0a9a9..2763cc2 100644 --- a/src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.h +++ b/src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef MMIHTTPIOPROCESSOR_H_P1FN0YPL #define MMIHTTPIOPROCESSOR_H_P1FN0YPL diff --git a/src/uscxml/plugins/ioprocessor/modality/MMIMessages.cpp b/src/uscxml/plugins/ioprocessor/modality/MMIMessages.cpp index 006b9e0..8ab95ea 100644 --- a/src/uscxml/plugins/ioprocessor/modality/MMIMessages.cpp +++ b/src/uscxml/plugins/ioprocessor/modality/MMIMessages.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "MMIMessages.h" #include <DOM/Simple/DOMImplementation.hpp> diff --git a/src/uscxml/plugins/ioprocessor/modality/MMIMessages.h b/src/uscxml/plugins/ioprocessor/modality/MMIMessages.h index aedd88c..981410e 100644 --- a/src/uscxml/plugins/ioprocessor/modality/MMIMessages.h +++ b/src/uscxml/plugins/ioprocessor/modality/MMIMessages.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef MMIEVENT_H_OS0SE7H5 #define MMIEVENT_H_OS0SE7H5 diff --git a/src/uscxml/plugins/ioprocessor/modality/MMIProtoBridge.cpp b/src/uscxml/plugins/ioprocessor/modality/MMIProtoBridge.cpp index 9e8b5c2..c649a17 100644 --- a/src/uscxml/plugins/ioprocessor/modality/MMIProtoBridge.cpp +++ b/src/uscxml/plugins/ioprocessor/modality/MMIProtoBridge.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "MMIProtoBridge.h" #define INIT_PROTO_LIFE_CYCLE_EVENT(type) \ diff --git a/src/uscxml/plugins/ioprocessor/modality/MMIProtoBridge.h b/src/uscxml/plugins/ioprocessor/modality/MMIProtoBridge.h index af6c720..60ba824 100644 --- a/src/uscxml/plugins/ioprocessor/modality/MMIProtoBridge.h +++ b/src/uscxml/plugins/ioprocessor/modality/MMIProtoBridge.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef MMIPROTOBRIDGE_H_T6VXUX69 #define MMIPROTOBRIDGE_H_T6VXUX69 diff --git a/src/uscxml/plugins/ioprocessor/sample/SampleIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/sample/SampleIOProcessor.cpp index da36a17..bca2344 100644 --- a/src/uscxml/plugins/ioprocessor/sample/SampleIOProcessor.cpp +++ b/src/uscxml/plugins/ioprocessor/sample/SampleIOProcessor.cpp @@ -1,4 +1,22 @@ -#include <uscxml/Common.h> +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "uscxml/plugins/ioprocessor/sample/SampleIOProcessor.h" #include "uscxml/Message.h" #include <iostream> @@ -13,7 +31,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new SampleIOProcessorProvider() ); return true; } diff --git a/src/uscxml/plugins/ioprocessor/sample/SampleIOProcessor.h b/src/uscxml/plugins/ioprocessor/sample/SampleIOProcessor.h index 3a58c13..1cbe922 100644 --- a/src/uscxml/plugins/ioprocessor/sample/SampleIOProcessor.h +++ b/src/uscxml/plugins/ioprocessor/sample/SampleIOProcessor.h @@ -1,17 +1,44 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef SAMPLEIOPROCESSOR_H_2CUY93KU #define SAMPLEIOPROCESSOR_H_2CUY93KU -#include "uscxml/concurrency/eventqueue/DelayedEventQueue.h" -#include "uscxml/Interpreter.h" #include "uscxml/Factory.h" #ifdef BUILD_AS_PLUGINS #include "uscxml/plugins/Plugins.h" #endif +#if defined(_WIN32) && !defined(USCXML_STATIC) +# if (defined ioprocessor_sample_EXPORTS || defined USCXML_EXPORT) +# define USCXML_PLUGIN_API __declspec(dllexport) +# else +# define USCXML_PLUGIN_API __declspec(dllimport) +# endif +#else +# define USCXML_PLUGIN_API +#endif + namespace uscxml { -class SampleIOProcessor : public IOProcessorImpl { +class USCXML_PLUGIN_API SampleIOProcessor : public IOProcessorImpl { public: SampleIOProcessor(); virtual ~SampleIOProcessor(); diff --git a/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp index dcf1d4e..d83ea59 100644 --- a/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp +++ b/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifdef _WIN32 #include <winsock2.h> #include <windows.h> @@ -28,7 +47,7 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR -bool connect(pluma::Host& host) { +bool pluginConnect(pluma::Host& host) { host.add( new SCXMLIOProcessorProvider() ); return true; } diff --git a/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.h b/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.h index a4f3f7c..c4fa677 100644 --- a/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.h +++ b/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef SCXMLIOProcessor_H_2CUY93KU #define SCXMLIOProcessor_H_2CUY93KU diff --git a/src/uscxml/server/HTTPServer.cpp b/src/uscxml/server/HTTPServer.cpp index 58a614e..9432c56 100644 --- a/src/uscxml/server/HTTPServer.cpp +++ b/src/uscxml/server/HTTPServer.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "uscxml/config.h" #ifdef _WIN32 @@ -11,6 +30,8 @@ #include <string> #include <iostream> + +extern "C" { #include <event2/dns.h> #include <event2/event.h> #include <event2/buffer.h> @@ -18,6 +39,7 @@ #include <event2/keyvalq_struct.h> #include <event2/http_struct.h> #include <event2/thread.h> +} #include <glog/logging.h> #include <boost/algorithm/string.hpp> @@ -46,18 +68,18 @@ HTTPServer::HTTPServer(unsigned short port, SSLConfig* sslConf) { _base = event_base_new(); _http = evhttp_new(_base); _thread = NULL; - + unsigned int allowedMethods = - EVHTTP_REQ_GET | - EVHTTP_REQ_POST | - EVHTTP_REQ_HEAD | - EVHTTP_REQ_PUT | - EVHTTP_REQ_DELETE | - EVHTTP_REQ_OPTIONS | - EVHTTP_REQ_TRACE | - EVHTTP_REQ_CONNECT | - EVHTTP_REQ_PATCH; - + EVHTTP_REQ_GET | + EVHTTP_REQ_POST | + EVHTTP_REQ_HEAD | + EVHTTP_REQ_PUT | + EVHTTP_REQ_DELETE | + EVHTTP_REQ_OPTIONS | + EVHTTP_REQ_TRACE | + EVHTTP_REQ_CONNECT | + EVHTTP_REQ_PATCH; + evhttp_set_allowed_methods(_http, allowedMethods); // allow all methods _handle = NULL; @@ -73,7 +95,7 @@ HTTPServer::HTTPServer(unsigned short port, SSLConfig* sslConf) { _sslPort = 0; } else { _sslPort = sslConf->port; - + // Initialize OpenSSL SSL_library_init(); ERR_load_crypto_strings(); @@ -85,9 +107,9 @@ HTTPServer::HTTPServer(unsigned short port, SSLConfig* sslConf) { SSL_CTX* ctx = SSL_CTX_new (SSLv23_server_method ()); SSL_CTX_set_options(ctx, - SSL_OP_SINGLE_DH_USE | - SSL_OP_SINGLE_ECDH_USE | - SSL_OP_NO_SSLv2); + SSL_OP_SINGLE_DH_USE | + SSL_OP_SINGLE_ECDH_USE | + SSL_OP_NO_SSLv2); EC_KEY* ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); SSL_CTX_set_tmp_ecdh (ctx, ecdh); @@ -145,10 +167,10 @@ struct bufferevent* HTTPServer::sslBufferEventCallback(struct event_base *base, struct bufferevent* r; SSL_CTX *ctx = (SSL_CTX *) arg; r = bufferevent_openssl_socket_new (base, - -1, - SSL_new (ctx), - BUFFEREVENT_SSL_ACCEPTING, - BEV_OPT_CLOSE_ON_FREE); + -1, + SSL_new (ctx), + BUFFEREVENT_SSL_ACCEPTING, + BEV_OPT_CLOSE_ON_FREE); return r; } @@ -157,60 +179,60 @@ void HTTPServer::sslGeneralBufferEventCallback (struct evhttp_request *req, void struct evbuffer *evb = NULL; const char *uri = evhttp_request_get_uri (req); struct evhttp_uri *decoded = NULL; - + /* We only handle POST requests. */ - if (evhttp_request_get_command (req) != EVHTTP_REQ_POST) - { evhttp_send_reply (req, 200, "OK", NULL); + if (evhttp_request_get_command (req) != EVHTTP_REQ_POST) { + evhttp_send_reply (req, 200, "OK", NULL); return; } - + printf ("Got a POST request for <%s>\n", uri); - + /* Decode the URI */ decoded = evhttp_uri_parse (uri); - if (! decoded) - { printf ("It's not a good URI. Sending BADREQUEST\n"); + if (! decoded) { + printf ("It's not a good URI. Sending BADREQUEST\n"); evhttp_send_error (req, HTTP_BADREQUEST, 0); return; } - + /* Decode the payload */ struct evkeyvalq kv; memset (&kv, 0, sizeof (kv)); struct evbuffer *buf = evhttp_request_get_input_buffer (req); evbuffer_add (buf, "", 1); /* NUL-terminate the buffer */ char *payload = (char *) evbuffer_pullup (buf, -1); - if (0 != evhttp_parse_query_str (payload, &kv)) - { printf ("Malformed payload. Sending BADREQUEST\n"); + if (0 != evhttp_parse_query_str (payload, &kv)) { + printf ("Malformed payload. Sending BADREQUEST\n"); evhttp_send_error (req, HTTP_BADREQUEST, 0); return; } - + /* Determine peer */ char *peer_addr; ev_uint16_t peer_port; struct evhttp_connection *con = evhttp_request_get_connection (req); evhttp_connection_get_peer (con, &peer_addr, &peer_port); - + /* Extract passcode */ const char *passcode = evhttp_find_header (&kv, "passcode"); char response[256]; evutil_snprintf (response, sizeof (response), - "Hi %s! I %s your passcode.\n", peer_addr, - (0 == strcmp (passcode, "R23") - ? "liked" - : "didn't like")); + "Hi %s! I %s your passcode.\n", peer_addr, + (0 == strcmp (passcode, "R23") + ? "liked" + : "didn't like")); evhttp_clear_headers (&kv); /* to free memory held by kv */ - + /* This holds the content we're sending. */ evb = evbuffer_new (); - + evhttp_add_header (evhttp_request_get_output_headers (req), - "Content-Type", "application/x-yaml"); + "Content-Type", "application/x-yaml"); evbuffer_add (evb, response, strlen (response)); - + evhttp_send_reply (req, 200, "OK", evb); - + if (decoded) evhttp_uri_free (decoded); if (evb) @@ -267,7 +289,7 @@ void HTTPServer::httpRecvReqCallback(struct evhttp_request *req, void *callbackD request.data.compound["httpMajor"] = Data(toStr((unsigned short)req->major), Data::VERBATIM); request.data.compound["httpMinor"] = Data(toStr((unsigned short)req->minor), Data::VERBATIM); request.data.compound["uri"] = Data(HTTPServer::getBaseURL() + req->uri, Data::VERBATIM); - + char* pathCStr = evhttp_decode_uri(evhttp_uri_get_path(evhttp_request_get_evhttp_uri(req))); request.data.compound["path"] = Data(pathCStr, Data::VERBATIM); free(pathCStr); @@ -350,7 +372,7 @@ void HTTPServer::httpRecvReqCallback(struct evhttp_request *req, void *callbackD size_t equalPos = item.find('='); if (equalPos == std::string::npos) continue; - + key = item.substr(0, equalPos); value = item.substr(equalPos + 1, item.length() - (equalPos + 1)); char* keyCStr = evhttp_decode_uri(key.c_str()); diff --git a/src/uscxml/server/HTTPServer.h b/src/uscxml/server/HTTPServer.h index 141ce7e..0b82947 100644 --- a/src/uscxml/server/HTTPServer.h +++ b/src/uscxml/server/HTTPServer.h @@ -1,10 +1,33 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef HTTPSERVER_H_AIH108EG #define HTTPSERVER_H_AIH108EG #include <string> #include <map> +#include "uscxml/Common.h" + +extern "C" { #include <event2/http.h> +} #include "uscxml/concurrency/tinythread.h" #include "uscxml/Message.h" @@ -13,7 +36,7 @@ namespace uscxml { class HTTPServlet; -class HTTPServer { +class USCXML_API HTTPServer { public: class Request : public Event { public: @@ -33,7 +56,7 @@ public: std::string publicKey; unsigned short port; }; - + class Reply { public: Reply(Request req) : status(200), type(req.data.compound["type"].atom), curlReq(req.curlReq) {} @@ -98,10 +121,10 @@ private: bool _isRunning; friend class HTTPServlet; - + #if (defined EVENT_SSL_FOUND && defined OPENSSL_FOUND) struct evhttp* _https; - struct evhttp_bound_socket* _sslHandle; + struct evhttp_bound_socket* _sslHandle; unsigned short _sslPort; static struct bufferevent* sslBufferEventCallback(struct event_base *base, void *arg); @@ -109,7 +132,7 @@ private: #endif }; -class HTTPServlet { +class USCXML_API HTTPServlet { public: virtual bool httpRecvRequest(const HTTPServer::Request& request) = 0; virtual void setURL(const std::string& url) = 0; /// Called by the server with the actual URL diff --git a/src/uscxml/server/InterpreterServlet.cpp b/src/uscxml/server/InterpreterServlet.cpp index 49f6677..beaa364 100644 --- a/src/uscxml/server/InterpreterServlet.cpp +++ b/src/uscxml/server/InterpreterServlet.cpp @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 "InterpreterServlet.h" #include "uscxml/Interpreter.h" #include <glog/logging.h> @@ -50,7 +69,7 @@ bool InterpreterServlet::httpRecvRequest(const HTTPServer::Request& req) { } } } - + _interpreter->receive(event); return true; } diff --git a/src/uscxml/server/InterpreterServlet.h b/src/uscxml/server/InterpreterServlet.h index c00bd11..55b97bd 100644 --- a/src/uscxml/server/InterpreterServlet.h +++ b/src/uscxml/server/InterpreterServlet.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @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 + */ + #ifndef INTERPRETERSERVLET_H_XQLWNMH4 #define INTERPRETERSERVLET_H_XQLWNMH4 diff --git a/src/uscxml/util/Base64.h b/src/uscxml/util/Base64.h index eaa7cfc..0102046 100644 --- a/src/uscxml/util/Base64.h +++ b/src/uscxml/util/Base64.h @@ -3,11 +3,12 @@ #define BASE64_H_5FKG12HF #include <string> +#include "uscxml/Common.h" namespace uscxml { -std::string base64_encode(char const* , unsigned int len); -std::string base64_decode(std::string const& s); +USCXML_API std::string base64_encode(char const* , unsigned int len); +USCXML_API std::string base64_decode(std::string const& s); } diff --git a/src/uscxml/util/MD5.h b/src/uscxml/util/MD5.h index aebac78..c842e51 100644 --- a/src/uscxml/util/MD5.h +++ b/src/uscxml/util/MD5.h @@ -54,11 +54,12 @@ * C++ convinience */ #include <string> +#include "uscxml/Common.h" namespace uscxml { -extern std::string md5(const char* data, size_t length); -extern std::string md5(const std::string& data); +extern USCXML_API std::string md5(const char* data, size_t length); +extern USCXML_API std::string md5(const std::string& data); /* * This package supports both compile-time and run-time determination of CPU diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 261817b..eff801c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -118,9 +118,9 @@ set_target_properties(scxml-test-framework-client PROPERTIES FOLDER "Tests") # add_test(test-curl-multi-api ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-completion) # set_target_properties(test-curl-multi-api PROPERTIES FOLDER "Tests") - add_executable(test-w3c src/test-w3c.cpp) - target_link_libraries(test-w3c uscxml) - set_target_properties(test-w3c PROPERTIES FOLDER "Tests") +add_executable(test-w3c src/test-w3c.cpp) +target_link_libraries(test-w3c uscxml) +set_target_properties(test-w3c PROPERTIES FOLDER "Tests") file(GLOB_RECURSE W3C_TESTS samples/w3c/*.scxml diff --git a/test/src/test-cmdline-parsing.cpp b/test/src/test-cmdline-parsing.cpp index 9ff094a..a610248 100644 --- a/test/src/test-cmdline-parsing.cpp +++ b/test/src/test-cmdline-parsing.cpp @@ -33,8 +33,6 @@ int main(int argc, char** argv) { assert(options.logLevel == 10); assert(!options.withHTTP); assert(!options); // invalid as no SCXML document is given - - optind = 0; } if (true) { @@ -50,8 +48,6 @@ int main(int argc, char** argv) { assert(options.verbose); assert(options.interpreters.size() == 1); assert(options.interpreters.find("/foo/bar.scxml") != options.interpreters.end()); - - optind = 0; } if (true) { @@ -76,8 +72,6 @@ int main(int argc, char** argv) { assert(!options.interpreters["/foo/bar1.scxml"]->withHTTP); assert(options.interpreters["/foo/bar2.scxml"]->withHTTP); assert(!options.interpreters["/foo/bar3.scxml"]->withHTTP); - - optind = 0; } if (true) { @@ -97,8 +91,6 @@ int main(int argc, char** argv) { assert(options.interpreters.find("/foo/bar1.scxml") != options.interpreters.end()); assert(options.interpreters["/foo/bar1.scxml"]->additionalParameters.find("vrml-path") != options.interpreters["/foo/bar1.scxml"]->additionalParameters.end()); assert(options.interpreters["/foo/bar1.scxml"]->additionalParameters.find("tmp-path") != options.interpreters["/foo/bar1.scxml"]->additionalParameters.end()); - - optind = 0; } return EXIT_SUCCESS; diff --git a/test/src/test-ffmpeg.cpp b/test/src/test-ffmpeg.cpp index c9dcfe1..a8660e5 100644 --- a/test/src/test-ffmpeg.cpp +++ b/test/src/test-ffmpeg.cpp @@ -53,71 +53,70 @@ static int sws_flags = SWS_BICUBIC; /* Add an output stream. */ static AVStream *add_stream(AVFormatContext *oc, AVCodec **codec, - enum AVCodecID codec_id) -{ - AVCodecContext *c; - AVStream *st; - - /* find the encoder */ - *codec = avcodec_find_encoder(codec_id); - if (!(*codec)) { - fprintf(stderr, "Could not find encoder for '%s'\n", - avcodec_get_name(codec_id)); - exit(1); - } - - st = avformat_new_stream(oc, *codec); - if (!st) { - fprintf(stderr, "Could not allocate stream\n"); - exit(1); - } - st->id = oc->nb_streams-1; - c = st->codec; - - switch ((*codec)->type) { - case AVMEDIA_TYPE_AUDIO: - c->sample_fmt = AV_SAMPLE_FMT_FLTP; - c->bit_rate = 64000; - c->sample_rate = 44100; - c->channels = 2; - break; - - case AVMEDIA_TYPE_VIDEO: - c->codec_id = codec_id; - - c->bit_rate = 400000; - /* Resolution must be a multiple of two. */ - c->width = 352; - c->height = 288; - /* timebase: This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identical to 1. */ - c->time_base.den = STREAM_FRAME_RATE; - c->time_base.num = 1; - c->gop_size = 12; /* emit one intra frame every twelve frames at most */ - c->pix_fmt = STREAM_PIX_FMT; - if (c->codec_id == AV_CODEC_ID_MPEG2VIDEO) { - /* just for testing, we also add B frames */ - c->max_b_frames = 2; - } - if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO) { - /* Needed to avoid using macroblocks in which some coeffs overflow. - * This does not happen with normal video, it just happens here as - * the motion of the chroma plane does not match the luma plane. */ - c->mb_decision = 2; - } - break; - - default: - break; - } - - /* Some formats want stream headers to be separate. */ - if (oc->oformat->flags & AVFMT_GLOBALHEADER) - c->flags |= CODEC_FLAG_GLOBAL_HEADER; - - return st; + enum AVCodecID codec_id) { + AVCodecContext *c; + AVStream *st; + + /* find the encoder */ + *codec = avcodec_find_encoder(codec_id); + if (!(*codec)) { + fprintf(stderr, "Could not find encoder for '%s'\n", + avcodec_get_name(codec_id)); + exit(1); + } + + st = avformat_new_stream(oc, *codec); + if (!st) { + fprintf(stderr, "Could not allocate stream\n"); + exit(1); + } + st->id = oc->nb_streams-1; + c = st->codec; + + switch ((*codec)->type) { + case AVMEDIA_TYPE_AUDIO: + c->sample_fmt = AV_SAMPLE_FMT_FLTP; + c->bit_rate = 64000; + c->sample_rate = 44100; + c->channels = 2; + break; + + case AVMEDIA_TYPE_VIDEO: + c->codec_id = codec_id; + + c->bit_rate = 400000; + /* Resolution must be a multiple of two. */ + c->width = 352; + c->height = 288; + /* timebase: This is the fundamental unit of time (in seconds) in terms + * of which frame timestamps are represented. For fixed-fps content, + * timebase should be 1/framerate and timestamp increments should be + * identical to 1. */ + c->time_base.den = STREAM_FRAME_RATE; + c->time_base.num = 1; + c->gop_size = 12; /* emit one intra frame every twelve frames at most */ + c->pix_fmt = STREAM_PIX_FMT; + if (c->codec_id == AV_CODEC_ID_MPEG2VIDEO) { + /* just for testing, we also add B frames */ + c->max_b_frames = 2; + } + if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO) { + /* Needed to avoid using macroblocks in which some coeffs overflow. + * This does not happen with normal video, it just happens here as + * the motion of the chroma plane does not match the luma plane. */ + c->mb_decision = 2; + } + break; + + default: + break; + } + + /* Some formats want stream headers to be separate. */ + if (oc->oformat->flags & AVFMT_GLOBALHEADER) + c->flags |= CODEC_FLAG_GLOBAL_HEADER; + + return st; } @@ -128,60 +127,58 @@ static AVFrame *frame; static AVPicture src_picture, dst_picture; static int frame_count; -static void open_video(AVFormatContext *oc, AVCodec *codec, AVStream *st) -{ - int ret; - AVCodecContext *c = st->codec; - - /* open the codec */ - ret = avcodec_open2(c, codec, NULL); - if (ret < 0) { - fprintf(stderr, "Could not open video codec: %s\n", av_err2str(ret)); - exit(1); - } - - /* allocate and init a re-usable frame */ - frame = avcodec_alloc_frame(); - if (!frame) { - fprintf(stderr, "Could not allocate video frame\n"); - exit(1); - } - - /* Allocate the encoded raw picture. */ - ret = avpicture_alloc(&dst_picture, c->pix_fmt, c->width, c->height); - if (ret < 0) { - fprintf(stderr, "Could not allocate picture: %s\n", av_err2str(ret)); - exit(1); - } - - /* If the output format is not YUV420P, then a temporary YUV420P - * picture is needed too. It is then converted to the required - * output format. */ - if (c->pix_fmt != BMP_FORMAT) { - ret = avpicture_alloc(&src_picture, BMP_FORMAT, c->width, c->height); - if (ret < 0) { - fprintf(stderr, "Could not allocate temporary picture: %s\n", - av_err2str(ret)); - exit(1); - } - } - - /* copy data and linesize picture pointers to frame */ - *((AVPicture *)frame) = dst_picture; +static void open_video(AVFormatContext *oc, AVCodec *codec, AVStream *st) { + int ret; + AVCodecContext *c = st->codec; + + /* open the codec */ + ret = avcodec_open2(c, codec, NULL); + if (ret < 0) { + fprintf(stderr, "Could not open video codec: %s\n", av_err2str(ret)); + exit(1); + } + + /* allocate and init a re-usable frame */ + frame = avcodec_alloc_frame(); + if (!frame) { + fprintf(stderr, "Could not allocate video frame\n"); + exit(1); + } + + /* Allocate the encoded raw picture. */ + ret = avpicture_alloc(&dst_picture, c->pix_fmt, c->width, c->height); + if (ret < 0) { + fprintf(stderr, "Could not allocate picture: %s\n", av_err2str(ret)); + exit(1); + } + + /* If the output format is not YUV420P, then a temporary YUV420P + * picture is needed too. It is then converted to the required + * output format. */ + if (c->pix_fmt != BMP_FORMAT) { + ret = avpicture_alloc(&src_picture, BMP_FORMAT, c->width, c->height); + if (ret < 0) { + fprintf(stderr, "Could not allocate temporary picture: %s\n", + av_err2str(ret)); + exit(1); + } + } + + /* copy data and linesize picture pointers to frame */ + *((AVPicture *)frame) = dst_picture; } /* Prepare a dummy image. */ static void fill_rgba_image(AVPicture *pict, int frame_index, - int width, int height) -{ + int width, int height) { int x, y, i; - + i = frame_index; - + std::stringstream ssFilename; ssFilename << "/Users/sradomski/Desktop/ctrl/" << (i % 125) << ".bmp"; - + std::ifstream file(ssFilename.str().c_str()); file.seekg(0, std::ios::end); @@ -190,7 +187,7 @@ static void fill_rgba_image(AVPicture *pict, int frame_index, char* buffer = (char*)malloc(length); file.read(buffer, length); - + uint32_t offset = 0; offset += buffer[10] << 0; offset += buffer[11] << 8; @@ -205,167 +202,164 @@ static void fill_rgba_image(AVPicture *pict, int frame_index, pict->data[0][y * pict->linesize[0] + x * 3 + 2] = buffer[offset++]; } } - + free(buffer); } -static void write_video_frame(AVFormatContext *oc, AVStream *st) -{ - int ret; - static struct SwsContext *sws_ctx; - AVCodecContext *c = st->codec; - - if (c->pix_fmt != BMP_FORMAT) { - /* as we only generate a YUV420P picture, we must convert it - * to the codec pixel format if needed */ - if (!sws_ctx) { - sws_ctx = sws_getContext(c->width, c->height, BMP_FORMAT, - c->width, c->height, c->pix_fmt, - sws_flags, NULL, NULL, NULL); - if (!sws_ctx) { - fprintf(stderr, - "Could not initialize the conversion context\n"); - exit(1); - } - } - fill_rgba_image(&src_picture, frame_count, c->width, c->height); - sws_scale(sws_ctx, - (const uint8_t * const *)src_picture.data, src_picture.linesize, - 0, c->height, dst_picture.data, dst_picture.linesize); - } else { - fill_rgba_image(&dst_picture, frame_count, c->width, c->height); +static void write_video_frame(AVFormatContext *oc, AVStream *st) { + int ret; + static struct SwsContext *sws_ctx; + AVCodecContext *c = st->codec; + + if (c->pix_fmt != BMP_FORMAT) { + /* as we only generate a YUV420P picture, we must convert it + * to the codec pixel format if needed */ + if (!sws_ctx) { + sws_ctx = sws_getContext(c->width, c->height, BMP_FORMAT, + c->width, c->height, c->pix_fmt, + sws_flags, NULL, NULL, NULL); + if (!sws_ctx) { + fprintf(stderr, + "Could not initialize the conversion context\n"); + exit(1); } + } + fill_rgba_image(&src_picture, frame_count, c->width, c->height); + sws_scale(sws_ctx, + (const uint8_t * const *)src_picture.data, src_picture.linesize, + 0, c->height, dst_picture.data, dst_picture.linesize); + } else { + fill_rgba_image(&dst_picture, frame_count, c->width, c->height); + } - if (oc->oformat->flags & AVFMT_RAWPICTURE) { - /* Raw video case - directly store the picture in the packet */ - AVPacket pkt; - av_init_packet(&pkt); - - pkt.flags |= AV_PKT_FLAG_KEY; - pkt.stream_index = st->index; - pkt.data = dst_picture.data[0]; - pkt.size = sizeof(AVPicture); - - ret = av_interleaved_write_frame(oc, &pkt); - } else { - AVPacket pkt = { 0 }; - int got_packet; - av_init_packet(&pkt); - - /* encode the image */ - ret = avcodec_encode_video2(c, &pkt, frame, &got_packet); - if (ret < 0) { - fprintf(stderr, "Error encoding video frame: %s\n", av_err2str(ret)); - exit(1); - } - /* If size is zero, it means the image was buffered. */ - - if (!ret && got_packet && pkt.size) { - pkt.stream_index = st->index; - - /* Write the compressed frame to the media file. */ - ret = av_interleaved_write_frame(oc, &pkt); - } else { - ret = 0; - } - } - if (ret != 0) { - fprintf(stderr, "Error while writing video frame: %s\n", av_err2str(ret)); - exit(1); - } - frame_count++; + if (oc->oformat->flags & AVFMT_RAWPICTURE) { + /* Raw video case - directly store the picture in the packet */ + AVPacket pkt; + av_init_packet(&pkt); + + pkt.flags |= AV_PKT_FLAG_KEY; + pkt.stream_index = st->index; + pkt.data = dst_picture.data[0]; + pkt.size = sizeof(AVPicture); + + ret = av_interleaved_write_frame(oc, &pkt); + } else { + AVPacket pkt = { 0 }; + int got_packet; + av_init_packet(&pkt); + + /* encode the image */ + ret = avcodec_encode_video2(c, &pkt, frame, &got_packet); + if (ret < 0) { + fprintf(stderr, "Error encoding video frame: %s\n", av_err2str(ret)); + exit(1); + } + /* If size is zero, it means the image was buffered. */ + + if (!ret && got_packet && pkt.size) { + pkt.stream_index = st->index; + + /* Write the compressed frame to the media file. */ + ret = av_interleaved_write_frame(oc, &pkt); + } else { + ret = 0; + } + } + if (ret != 0) { + fprintf(stderr, "Error while writing video frame: %s\n", av_err2str(ret)); + exit(1); + } + frame_count++; } -static void close_video(AVFormatContext *oc, AVStream *st) -{ - avcodec_close(st->codec); - av_free(src_picture.data[0]); - av_free(dst_picture.data[0]); - av_free(frame); +static void close_video(AVFormatContext *oc, AVStream *st) { + avcodec_close(st->codec); + av_free(src_picture.data[0]); + av_free(dst_picture.data[0]); + av_free(frame); } /**************************************************************/ /* media file output */ -int main(int argc, char **argv) -{ - const char *filename; - AVOutputFormat *fmt; - AVFormatContext *oc; - AVStream *video_st; - AVCodec *video_codec; - int ret; - - /* Initialize libavcodec, and register all codecs and formats. */ - av_register_all(); - - filename = "/Users/sradomski/Desktop/test.mpg"; - - /* allocate the output media context */ - avformat_alloc_output_context2(&oc, NULL, NULL, filename); - if (!oc) { - printf("Could not deduce output format from file extension: using MPEG.\n"); - avformat_alloc_output_context2(&oc, NULL, "mpeg", filename); - } - if (!oc) { - return 1; - } - fmt = oc->oformat; - - /* Add the audio and video streams using the default format codecs - * and initialize the codecs. */ - video_st = NULL; - - if (fmt->video_codec != AV_CODEC_ID_NONE) { - video_st = add_stream(oc, &video_codec, fmt->video_codec); - } - - /* Now that all the parameters are set, we can open the audio and - * video codecs and allocate the necessary encode buffers. */ - if (video_st) - open_video(oc, video_codec, video_st); - - /* open the output file, if needed */ - if (!(fmt->flags & AVFMT_NOFILE)) { - ret = avio_open(&oc->pb, filename, AVIO_FLAG_WRITE); - if (ret < 0) { - fprintf(stderr, "Could not open '%s': %s\n", filename, - av_err2str(ret)); - return 1; - } - } - - /* Write the stream header, if any. */ - ret = avformat_write_header(oc, NULL); - if (ret < 0) { - fprintf(stderr, "Error occurred when opening output file: %s\n", - av_err2str(ret)); - return 1; - } - - if (frame) - frame->pts = 0; - for (int i = 0; i < 125; i++) { - write_video_frame(oc, video_st); - frame->pts += av_rescale_q(1, video_st->codec->time_base, video_st->time_base); - } - - /* Write the trailer, if any. The trailer must be written before you - * close the CodecContexts open when you wrote the header; otherwise - * av_write_trailer() may try to use memory that was freed on - * av_codec_close(). */ - av_write_trailer(oc); - - /* Close each codec. */ - if (video_st) - close_video(oc, video_st); - - if (!(fmt->flags & AVFMT_NOFILE)) - /* Close the output file. */ - avio_close(oc->pb); - - /* free the stream */ - avformat_free_context(oc); - - return 0; +int main(int argc, char **argv) { + const char *filename; + AVOutputFormat *fmt; + AVFormatContext *oc; + AVStream *video_st; + AVCodec *video_codec; + int ret; + + /* Initialize libavcodec, and register all codecs and formats. */ + av_register_all(); + + filename = "/Users/sradomski/Desktop/test.mpg"; + + /* allocate the output media context */ + avformat_alloc_output_context2(&oc, NULL, NULL, filename); + if (!oc) { + printf("Could not deduce output format from file extension: using MPEG.\n"); + avformat_alloc_output_context2(&oc, NULL, "mpeg", filename); + } + if (!oc) { + return 1; + } + fmt = oc->oformat; + + /* Add the audio and video streams using the default format codecs + * and initialize the codecs. */ + video_st = NULL; + + if (fmt->video_codec != AV_CODEC_ID_NONE) { + video_st = add_stream(oc, &video_codec, fmt->video_codec); + } + + /* Now that all the parameters are set, we can open the audio and + * video codecs and allocate the necessary encode buffers. */ + if (video_st) + open_video(oc, video_codec, video_st); + + /* open the output file, if needed */ + if (!(fmt->flags & AVFMT_NOFILE)) { + ret = avio_open(&oc->pb, filename, AVIO_FLAG_WRITE); + if (ret < 0) { + fprintf(stderr, "Could not open '%s': %s\n", filename, + av_err2str(ret)); + return 1; + } + } + + /* Write the stream header, if any. */ + ret = avformat_write_header(oc, NULL); + if (ret < 0) { + fprintf(stderr, "Error occurred when opening output file: %s\n", + av_err2str(ret)); + return 1; + } + + if (frame) + frame->pts = 0; + for (int i = 0; i < 125; i++) { + write_video_frame(oc, video_st); + frame->pts += av_rescale_q(1, video_st->codec->time_base, video_st->time_base); + } + + /* Write the trailer, if any. The trailer must be written before you + * close the CodecContexts open when you wrote the header; otherwise + * av_write_trailer() may try to use memory that was freed on + * av_codec_close(). */ + av_write_trailer(oc); + + /* Close each codec. */ + if (video_st) + close_video(oc, video_st); + + if (!(fmt->flags & AVFMT_NOFILE)) + /* Close the output file. */ + avio_close(oc->pb); + + /* free the stream */ + avformat_free_context(oc); + + return 0; } diff --git a/test/src/test-instant-messaging.cpp b/test/src/test-instant-messaging.cpp index 0bf2898..a63df34 100644 --- a/test/src/test-instant-messaging.cpp +++ b/test/src/test-instant-messaging.cpp @@ -51,13 +51,11 @@ typedef struct _PurpleGLibIOClosure { gpointer data; } PurpleGLibIOClosure; -static void purple_glib_io_destroy(gpointer data) -{ +static void purple_glib_io_destroy(gpointer data) { g_free(data); } -static gboolean purple_glib_io_invoke(GIOChannel *source, GIOCondition condition, gpointer data) -{ +static gboolean purple_glib_io_invoke(GIOChannel *source, GIOCondition condition, gpointer data) { PurpleGLibIOClosure *closure = (PurpleGLibIOClosure*)data; int purple_cond = 0; @@ -67,14 +65,13 @@ static gboolean purple_glib_io_invoke(GIOChannel *source, GIOCondition condition purple_cond |= PURPLE_INPUT_WRITE; closure->function(closure->data, g_io_channel_unix_get_fd(source), - (PurpleInputCondition)purple_cond); + (PurpleInputCondition)purple_cond); return TRUE; } static guint glib_input_add(gint fd, PurpleInputCondition condition, PurpleInputFunction function, - gpointer data) -{ + gpointer data) { PurpleGLibIOClosure *closure = g_new0(PurpleGLibIOClosure, 1); GIOChannel *channel; int cond = 0; @@ -93,14 +90,13 @@ static guint glib_input_add(gint fd, PurpleInputCondition condition, PurpleInput channel = g_io_channel_unix_new(fd); #endif closure->result = g_io_add_watch_full(channel, G_PRIORITY_DEFAULT, (GIOCondition)cond, - purple_glib_io_invoke, closure, purple_glib_io_destroy); + purple_glib_io_invoke, closure, purple_glib_io_destroy); g_io_channel_unref(channel); return closure->result; } -static PurpleEventLoopUiOps glib_eventloops = -{ +static PurpleEventLoopUiOps glib_eventloops = { g_timeout_add, g_source_remove, glib_input_add, @@ -118,8 +114,7 @@ static PurpleEventLoopUiOps glib_eventloops = /*** Conversation uiops ***/ static void null_write_conv(PurpleConversation *conv, const char *who, const char *alias, - const char *message, PurpleMessageFlags flags, time_t mtime) -{ + const char *message, PurpleMessageFlags flags, time_t mtime) { const char *name; if (alias && *alias) name = alias; @@ -129,12 +124,11 @@ null_write_conv(PurpleConversation *conv, const char *who, const char *alias, name = NULL; printf("(%s) %s %s: %s\n", purple_conversation_get_name(conv), - purple_utf8_strftime("(%H:%M:%S)", localtime(&mtime)), - name, message); + purple_utf8_strftime("(%H:%M:%S)", localtime(&mtime)), + name, message); } -static PurpleConversationUiOps null_conv_uiops = -{ +static PurpleConversationUiOps null_conv_uiops = { NULL, /* create_conversation */ NULL, /* destroy_conversation */ NULL, /* write_chat */ @@ -157,8 +151,7 @@ static PurpleConversationUiOps null_conv_uiops = }; static void -null_ui_init(void) -{ +null_ui_init(void) { /** * This should initialize the UI components for all the modules. Here we * just initialize the UI for conversations. @@ -166,8 +159,7 @@ null_ui_init(void) purple_conversations_set_ui_ops(&null_conv_uiops); } -static PurpleCoreUiOps null_core_uiops = -{ +static PurpleCoreUiOps null_core_uiops = { NULL, NULL, null_ui_init, @@ -181,8 +173,7 @@ static PurpleCoreUiOps null_core_uiops = }; static void -init_libpurple(void) -{ +init_libpurple(void) { /* Set a custom user directory (optional) */ purple_util_set_user_dir(CUSTOM_USER_DIRECTORY); @@ -212,8 +203,8 @@ init_libpurple(void) if (!purple_core_init(UI_ID)) { /* Initializing the core failed. Terminate. */ fprintf(stderr, - "libpurple initialization failed. Dumping core.\n" - "Please report this!\n"); + "libpurple initialization failed. Dumping core.\n" + "Please report this!\n"); abort(); } @@ -226,8 +217,7 @@ init_libpurple(void) } static void -signed_on(PurpleConnection *gc, gpointer null) -{ +signed_on(PurpleConnection *gc, gpointer null) { PurpleAccount *account = purple_connection_get_account(gc); printf("Account connected: %s %s\n", purple_account_get_username(account), purple_account_get_protocol_id(account)); } @@ -245,17 +235,15 @@ buddy_signed_on(PurpleBuddy *buddy) { } static void -connect_to_signals_for_demonstration_purposes_only(void) -{ +connect_to_signals_for_demonstration_purposes_only(void) { static int handle; purple_signal_connect(purple_connections_get_handle(), "signed-on", &handle, - PURPLE_CALLBACK(signed_on), NULL); + PURPLE_CALLBACK(signed_on), NULL); purple_signal_connect(purple_blist_get_handle(), "buddy-signed-on", &handle, - PURPLE_CALLBACK(buddy_signed_on), NULL); + PURPLE_CALLBACK(buddy_signed_on), NULL); } -int main(int argc, char *argv[]) -{ +int main(int argc, char *argv[]) { GList *iter; GMainLoop *loop = g_main_loop_new(NULL, FALSE); PurpleAccount *account; diff --git a/test/src/test-url.cpp b/test/src/test-url.cpp index ed892b8..e0f8343 100644 --- a/test/src/test-url.cpp +++ b/test/src/test-url.cpp @@ -47,7 +47,7 @@ int main(int argc, char** argv) { WSADATA wsaData;
WSAStartup(MAKEWORD(2, 2), &wsaData);
#endif
-
+
std::string exeName = argv[0];
exeName = exeName.substr(exeName.find_last_of("\\/") + 1);
diff --git a/test/src/test-w3c.cpp b/test/src/test-w3c.cpp index db8c764..768f6be 100644 --- a/test/src/test-w3c.cpp +++ b/test/src/test-w3c.cpp @@ -139,7 +139,7 @@ int main(int argc, char** argv) { // if (interpreter.getDataModel().getNames().find("ecmascript") != interpreter.getDataModel().getNames().end()) { // } - + interpreter.start(); while(interpreter.runOnMainThread(25)); } |