| OLD | NEW |
| 1 | 1 |
| 2 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 # Copyright (C) 2005, 2006 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 Samuel Weinig <sam.weinig@gmail.com> | 4 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> |
| 5 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> | 5 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> |
| 6 # Copyright (C) 2006 Apple Computer, Inc. | 6 # Copyright (C) 2006 Apple Computer, Inc. |
| 7 # Copyright (C) 2007 Google Inc. | 7 # Copyright (C) 2007 Google Inc. |
| 8 # | 8 # |
| 9 # This file is part of the KDE project | 9 # This file is part of the KDE project |
| 10 # | 10 # |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 $attrIsPodType = 0; | 418 $attrIsPodType = 0; |
| 419 } | 419 } |
| 420 | 420 |
| 421 my $creatorType = ""; | 421 my $creatorType = ""; |
| 422 if ($attrIsPodType) { | 422 if ($attrIsPodType) { |
| 423 if ($codeGenerator->IsSVGAnimatedType($implClassName)) { | 423 if ($codeGenerator->IsSVGAnimatedType($implClassName)) { |
| 424 $creatorType = $implClassName; | 424 $creatorType = $implClassName; |
| 425 } | 425 } |
| 426 } | 426 } |
| 427 | 427 |
| 428 my $getterStringUsesImp = $implClassName ne "double"; |
| 429 |
| 428 # Getter | 430 # Getter |
| 429 push(@implContentDecls, <<END); | 431 push(@implContentDecls, <<END); |
| 430 static v8::Handle<v8::Value> ${attrName}AttrGetter(v8::Local<v8::String> name,
const v8::AccessorInfo& info) { | 432 static v8::Handle<v8::Value> ${attrName}AttrGetter(v8::Local<v8::String> name,
const v8::AccessorInfo& info) { |
| 431 INC_STATS(L\"DOM.$implClassName.$attrName._get\"); | 433 INC_STATS(L\"DOM.$implClassName.$attrName._get\"); |
| 432 END | 434 END |
| 433 | 435 |
| 434 if ($isPodType) { | 436 if ($isPodType) { |
| 435 push(@implContentDecls, <<END); | 437 push(@implContentDecls, <<END); |
| 436 V8SVGPODTypeWrapper<$implClassName>* imp_wrapper = V8Proxy::FastToNativeObje
ct<V8SVGPODTypeWrapper<$implClassName> >(V8ClassIndex::$classIndex, info.Holder(
)); | 438 V8SVGPODTypeWrapper<$implClassName>* imp_wrapper = V8Proxy::FastToNativeObje
ct<V8SVGPODTypeWrapper<$implClassName> >(V8ClassIndex::$classIndex, info.Holder(
)); |
| 437 $implClassName imp_instance = *imp_wrapper; | 439 $implClassName imp_instance = *imp_wrapper; |
| 440 END |
| 441 if ($getterStringUsesImp) { |
| 442 push(@implContentDecls, <<END); |
| 438 $implClassName* imp = &imp_instance; | 443 $implClassName* imp = &imp_instance; |
| 439 END | 444 END |
| 445 } |
| 440 | 446 |
| 441 } elsif ($attrExt->{"v8OnProto"}) { | 447 } elsif ($attrExt->{"v8OnProto"}) { |
| 442 # perform lookup first | 448 # perform lookup first |
| 443 push(@implContentDecls, <<END); | 449 push(@implContentDecls, <<END); |
| 444 v8::Handle<v8::Object> holder = V8Proxy::LookupDOMWrapper(V8ClassIndex::$cla
ssIndex, info.This()); | 450 v8::Handle<v8::Object> holder = V8Proxy::LookupDOMWrapper(V8ClassIndex::$cla
ssIndex, info.This()); |
| 445 if (holder.IsEmpty()) return v8::Undefined(); | 451 if (holder.IsEmpty()) return v8::Undefined(); |
| 446 | 452 |
| 447 $implClassName* imp = V8Proxy::FastToNativeObject<$implClassName>(V8ClassInd
ex::$classIndex, holder); | 453 $implClassName* imp = V8Proxy::FastToNativeObject<$implClassName>(V8ClassInd
ex::$classIndex, holder); |
| 448 END | 454 END |
| 449 | 455 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 466 | 472 |
| 467 if ($attribute->signature->extendedAttributes->{"v8referenceattr"}) { | 473 if ($attribute->signature->extendedAttributes->{"v8referenceattr"}) { |
| 468 $attrName = $attribute->signature->extendedAttributes->{"v8referenceattr"}; | 474 $attrName = $attribute->signature->extendedAttributes->{"v8referenceattr"}; |
| 469 } | 475 } |
| 470 | 476 |
| 471 my $getterFunc = WK_lcfirst($attrName); | 477 my $getterFunc = WK_lcfirst($attrName); |
| 472 $getterFunc .= "Animated" if $codeGenerator->IsSVGAnimatedType($attribute->sig
nature->type); | 478 $getterFunc .= "Animated" if $codeGenerator->IsSVGAnimatedType($attribute->sig
nature->type); |
| 473 | 479 |
| 474 my $returnType = $codeGenerator->StripModule($attribute->signature->type); | 480 my $returnType = $codeGenerator->StripModule($attribute->signature->type); |
| 475 | 481 |
| 476 my $getterString = "imp->$getterFunc("; | 482 my $getterString; |
| 477 $getterString .= "ec" if $useExceptions; | 483 if ($getterStringUsesImp) { |
| 478 $getterString .= ")"; | 484 $getterString = "imp->$getterFunc("; |
| 479 if (IsRefPtrType($returnType)) { | 485 $getterString .= "ec" if $useExceptions; |
| 480 $implIncludes{"wtf/GetPtr.h"} = 1; | 486 $getterString .= ")"; |
| 481 $getterString = "WTF::getPtr(" . $getterString . ")"; | 487 if (IsRefPtrType($returnType)) { |
| 482 } | 488 $implIncludes{"wtf/GetPtr.h"} = 1; |
| 483 if ($nativeType eq "int" and $attribute->signature->extendedAttributes->{"Conv
ertFromString"}) { | 489 $getterString = "WTF::getPtr(" . $getterString . ")"; |
| 484 $getterString .= ".toInt()"; | 490 } |
| 485 } | 491 if ($nativeType eq "int" and |
| 486 if ($implClassName eq "double") { | 492 $attribute->signature->extendedAttributes->{"ConvertFromString"}) { |
| 493 $getterString .= ".toInt()"; |
| 494 } |
| 495 } else { |
| 487 $getterString = "imp_instance"; | 496 $getterString = "imp_instance"; |
| 488 } | 497 } |
| 489 | 498 |
| 490 my $result; | 499 my $result; |
| 491 my $wrapper; | 500 my $wrapper; |
| 492 | 501 |
| 493 if ($attrIsPodType) { | 502 if ($attrIsPodType) { |
| 494 $wrapper = GeneratePodTypeWrapper($attribute->signature, $getterString, $cre
atorType); | 503 $wrapper = GeneratePodTypeWrapper($attribute->signature, $getterString, $cre
atorType); |
| 495 push(@implContentDecls, " Peerable* wrapper = $wrapper;\n"); | 504 push(@implContentDecls, " Peerable* wrapper = $wrapper;\n"); |
| 496 } elsif ($nativeType ne "RGBColor") { | 505 } elsif ($nativeType ne "RGBColor") { |
| (...skipping 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1882 return 0; | 1891 return 0; |
| 1883 } | 1892 } |
| 1884 | 1893 |
| 1885 sub DebugPrint | 1894 sub DebugPrint |
| 1886 { | 1895 { |
| 1887 my $output = shift; | 1896 my $output = shift; |
| 1888 | 1897 |
| 1889 print $output; | 1898 print $output; |
| 1890 print "\n"; | 1899 print "\n"; |
| 1891 } | 1900 } |
| OLD | NEW |