OLD | NEW |
1 # | 1 # |
2 # Copyright (C) 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 # Copyright (C) 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> | 3 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> |
4 # Copyright (C) 2006, 2007 Samuel Weinig <sam@webkit.org> | 4 # Copyright (C) 2006, 2007 Samuel Weinig <sam@webkit.org> |
5 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> | 5 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> |
6 # Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 6 # Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
7 # | 7 # |
8 # This library is free software; you can redistribute it and/or | 8 # This library is free software; you can redistribute it and/or |
9 # modify it under the terms of the GNU Library General Public | 9 # modify it under the terms of the GNU Library General Public |
10 # License as published by the Free Software Foundation; either | 10 # License as published by the Free Software Foundation; either |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 push(@headerContentHeader, "\n#if ${conditionalString}\n\n"); | 379 push(@headerContentHeader, "\n#if ${conditionalString}\n\n"); |
380 } | 380 } |
381 | 381 |
382 if ($hasParent) { | 382 if ($hasParent) { |
383 push(@headerContentHeader, "#include \"$parentClassName.h\"\n"); | 383 push(@headerContentHeader, "#include \"$parentClassName.h\"\n"); |
384 } else { | 384 } else { |
385 push(@headerContentHeader, "#include \"JSDOMBinding.h\"\n"); | 385 push(@headerContentHeader, "#include \"JSDOMBinding.h\"\n"); |
386 push(@headerContentHeader, "#include <runtime/JSGlobalObject.h>\n"); | 386 push(@headerContentHeader, "#include <runtime/JSGlobalObject.h>\n"); |
387 push(@headerContentHeader, "#include <runtime/ObjectPrototype.h>\n"); | 387 push(@headerContentHeader, "#include <runtime/ObjectPrototype.h>\n"); |
388 } | 388 } |
| 389 if ($interfaceName eq "Node") { |
| 390 push(@headerContentHeader, "#include \"EventTargetNode.h\"\n"); |
| 391 } |
389 | 392 |
390 if ($dataNode->extendedAttributes->{"CustomCall"}) { | 393 if ($dataNode->extendedAttributes->{"CustomCall"}) { |
391 push(@headerContentHeader, "#include <runtime/CallData.h>\n"); | 394 push(@headerContentHeader, "#include <runtime/CallData.h>\n"); |
392 } | 395 } |
393 | 396 |
394 if ($dataNode->extendedAttributes->{"InlineGetOwnPropertySlot"}) { | 397 if ($dataNode->extendedAttributes->{"InlineGetOwnPropertySlot"}) { |
395 push(@headerContentHeader, "#include <runtime/Lookup.h>\n"); | 398 push(@headerContentHeader, "#include <runtime/Lookup.h>\n"); |
396 push(@headerContentHeader, "#include <wtf/AlwaysInline.h>\n"); | 399 push(@headerContentHeader, "#include <wtf/AlwaysInline.h>\n"); |
397 } | 400 } |
398 | 401 |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 } | 629 } |
627 | 630 |
628 if (!$hasParent || $dataNode->extendedAttributes->{"GenerateToJS"}) { | 631 if (!$hasParent || $dataNode->extendedAttributes->{"GenerateToJS"}) { |
629 if ($podType) { | 632 if ($podType) { |
630 push(@headerContent, "JSC::JSValuePtr toJS(JSC::ExecState*, JSSVGPOD
TypeWrapper<$podType>*, SVGElement* context);\n"); | 633 push(@headerContent, "JSC::JSValuePtr toJS(JSC::ExecState*, JSSVGPOD
TypeWrapper<$podType>*, SVGElement* context);\n"); |
631 } elsif (IsSVGTypeNeedingContextParameter($implClassName)) { | 634 } elsif (IsSVGTypeNeedingContextParameter($implClassName)) { |
632 push(@headerContent, "JSC::JSValuePtr toJS(JSC::ExecState*, $implTyp
e*, SVGElement* context);\n"); | 635 push(@headerContent, "JSC::JSValuePtr toJS(JSC::ExecState*, $implTyp
e*, SVGElement* context);\n"); |
633 } else { | 636 } else { |
634 push(@headerContent, "JSC::JSValuePtr toJS(JSC::ExecState*, $implTyp
e*);\n"); | 637 push(@headerContent, "JSC::JSValuePtr toJS(JSC::ExecState*, $implTyp
e*);\n"); |
635 } | 638 } |
| 639 |
| 640 # Resolve ambiguity with EventTarget that otherwise exists. |
| 641 if ($interfaceName eq "Node") { |
| 642 push(@headerContent, "inline JSC::JSValuePtr toJS(JSC::ExecState* ex
ec, EventTargetNode* node) { return toJS(exec, static_cast<Node*>(node)); }\n"); |
| 643 } |
636 } | 644 } |
637 if (!$hasParent || $dataNode->extendedAttributes->{"GenerateNativeConverter"
}) { | 645 if (!$hasParent || $dataNode->extendedAttributes->{"GenerateNativeConverter"
}) { |
638 if ($podType) { | 646 if ($podType) { |
639 push(@headerContent, "$podType to${interfaceName}(JSC::JSValuePtr);\
n"); | 647 push(@headerContent, "$podType to${interfaceName}(JSC::JSValuePtr);\
n"); |
640 } elsif ($interfaceName eq "NodeFilter") { | 648 } elsif ($interfaceName eq "NodeFilter") { |
641 push(@headerContent, "PassRefPtr<NodeFilter> toNodeFilter(JSC::JSVal
uePtr);\n"); | 649 push(@headerContent, "PassRefPtr<NodeFilter> toNodeFilter(JSC::JSVal
uePtr);\n"); |
642 } else { | 650 } else { |
643 push(@headerContent, "$implClassName* to${interfaceName}(JSC::JSValu
ePtr);\n"); | 651 push(@headerContent, "$implClassName* to${interfaceName}(JSC::JSValu
ePtr);\n"); |
644 } | 652 } |
645 } | 653 } |
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1542 # Special-case index arguments because we need to check that they aren't
< 0. | 1550 # Special-case index arguments because we need to check that they aren't
< 0. |
1543 return "int"; | 1551 return "int"; |
1544 } | 1552 } |
1545 | 1553 |
1546 return GetNativeType($type); | 1554 return GetNativeType($type); |
1547 } | 1555 } |
1548 | 1556 |
1549 my %nativeType = ( | 1557 my %nativeType = ( |
1550 "CompareHow" => "Range::CompareHow", | 1558 "CompareHow" => "Range::CompareHow", |
1551 "DOMString" => "const UString&", | 1559 "DOMString" => "const UString&", |
| 1560 "EventTarget" => "EventTargetNode*", |
1552 "NodeFilter" => "RefPtr<NodeFilter>", | 1561 "NodeFilter" => "RefPtr<NodeFilter>", |
1553 "SVGLength" => "SVGLength", | 1562 "SVGLength" => "SVGLength", |
1554 "SVGMatrix" => "TransformationMatrix", | 1563 "SVGMatrix" => "TransformationMatrix", |
1555 "SVGNumber" => "float", | 1564 "SVGNumber" => "float", |
1556 "SVGPaintType" => "SVGPaint::SVGPaintType", | 1565 "SVGPaintType" => "SVGPaint::SVGPaintType", |
1557 "SVGPoint" => "FloatPoint", | 1566 "SVGPoint" => "FloatPoint", |
1558 "SVGRect" => "FloatRect", | 1567 "SVGRect" => "FloatRect", |
1559 "SVGTransform" => "SVGTransform", | 1568 "SVGTransform" => "SVGTransform", |
1560 "boolean" => "bool", | 1569 "boolean" => "bool", |
1561 "double" => "double", | 1570 "double" => "double", |
(...skipping 27 matching lines...) Expand all Loading... |
1589 | 1598 |
1590 return "static_cast<Range::CompareHow>($value.toInt32(exec))" if $type eq "C
ompareHow"; | 1599 return "static_cast<Range::CompareHow>($value.toInt32(exec))" if $type eq "C
ompareHow"; |
1591 return "static_cast<SVGPaint::SVGPaintType>($value.toInt32(exec))" if $type
eq "SVGPaintType"; | 1600 return "static_cast<SVGPaint::SVGPaintType>($value.toInt32(exec))" if $type
eq "SVGPaintType"; |
1592 | 1601 |
1593 if ($type eq "DOMString") { | 1602 if ($type eq "DOMString") { |
1594 return "valueToStringWithNullCheck(exec, $value)" if $signature->extende
dAttributes->{"ConvertNullToNullString"}; | 1603 return "valueToStringWithNullCheck(exec, $value)" if $signature->extende
dAttributes->{"ConvertNullToNullString"}; |
1595 return "valueToStringWithUndefinedOrNullCheck(exec, $value)" if $signatu
re->extendedAttributes->{"ConvertUndefinedOrNullToNullString"}; | 1604 return "valueToStringWithUndefinedOrNullCheck(exec, $value)" if $signatu
re->extendedAttributes->{"ConvertUndefinedOrNullToNullString"}; |
1596 return "$value.toString(exec)"; | 1605 return "$value.toString(exec)"; |
1597 } | 1606 } |
1598 | 1607 |
| 1608 if ($type eq "EventTarget") { |
| 1609 $implIncludes{"JSEventTargetNode.h"} = 1; |
| 1610 return "toEventTargetNode($value)"; |
| 1611 } |
| 1612 |
1599 $implIncludes{"FloatPoint.h"} = 1 if $type eq "SVGPoint"; | 1613 $implIncludes{"FloatPoint.h"} = 1 if $type eq "SVGPoint"; |
1600 $implIncludes{"FloatRect.h"} = 1 if $type eq "SVGRect"; | 1614 $implIncludes{"FloatRect.h"} = 1 if $type eq "SVGRect"; |
1601 $implIncludes{"HTMLOptionElement.h"} = 1 if $type eq "HTMLOptionElement"; | 1615 $implIncludes{"HTMLOptionElement.h"} = 1 if $type eq "HTMLOptionElement"; |
1602 $implIncludes{"JSCustomVoidCallback.h"} = 1 if $type eq "VoidCallback"; | 1616 $implIncludes{"JSCustomVoidCallback.h"} = 1 if $type eq "VoidCallback"; |
1603 $implIncludes{"Event.h"} = 1 if $type eq "Event"; | 1617 $implIncludes{"Event.h"} = 1 if $type eq "Event"; |
1604 | 1618 |
1605 # Default, assume autogenerated type conversion routines | 1619 # Default, assume autogenerated type conversion routines |
1606 $implIncludes{"JS$type.h"} = 1; | 1620 $implIncludes{"JS$type.h"} = 1; |
1607 return "to$type($value)"; | 1621 return "to$type($value)"; |
1608 } | 1622 } |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2005 | 2019 |
2006 EOF | 2020 EOF |
2007 | 2021 |
2008 $implKJSInclude{"JSNumberCell.h"} = 1; | 2022 $implKJSInclude{"JSNumberCell.h"} = 1; |
2009 | 2023 |
2010 return $implContent; | 2024 return $implContent; |
2011 } | 2025 } |
2012 | 2026 |
2013 1; | 2027 1; |
2014 | 2028 |
OLD | NEW |