Changeset 175995 in webkit
- Timestamp:
- Nov 11, 2014, 5:20:30 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
bindings/scripts/CodeGeneratorObjC.pm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r175992 r175995 1 2014-11-11 David Kilzer <ddkilzer@apple.com> 2 3 Modernize $buildingForIPhone in CodeGeneratorObjC.pm 4 <http://webkit.org/b/138640> 5 6 Reviewed by Daniel Bates. 7 8 Mac OS X is the only platform that supports NSColor, so rename 9 $buildingForIPhone to $shouldUseCGColor (which is actually what 10 the variable represents) and define it in terms of the "macosx" 11 platform name. 12 13 * bindings/scripts/CodeGeneratorObjC.pm: 14 ($buildingForIPhone): Rename to $shouldUseCGColor. 15 ($shouldUseCGColor): False if PLATFORM_NAME is not defined, 16 which is the case on older Xcodes when building for Mac OS X, or 17 if PLATFORM_NAME is equal to "macosx". True otherwise. 18 (GetClassName): Switch to use new variable name. 19 (AddIncludesForType): Ditto. 20 (GenerateHeader): Remove dead code. The 21 $buildingForTigerOrEarlier variable was accidentally 22 re-introduced in r161638, but was originally removed in r127032! 23 (GenerateImplementation): Switch to use new variable name. 24 1 25 2014-11-11 Tim Horton <timothy_horton@apple.com> 2 26 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm
r173220 r175995 105 105 106 106 # Constants 107 my $ buildingForIPhone = defined $ENV{PLATFORM_NAME} && ($ENV{PLATFORM_NAME} eq "iphoneos" or $ENV{PLATFORM_NAME} eq "iphonesimulator");107 my $shouldUseCGColor = defined $ENV{PLATFORM_NAME} && $ENV{PLATFORM_NAME} ne "macosx"; 108 108 my $nullableInit = "bool isNull = false;"; 109 109 my $exceptionInit = "WebCore::ExceptionCode ec = 0;"; … … 393 393 # special cases 394 394 return "NSString" if $codeGenerator->IsStringType($name) or $name eq "SerializedScriptValue"; 395 return "CGColorRef" if $name eq "Color" and $ buildingForIPhone;395 return "CGColorRef" if $name eq "Color" and $shouldUseCGColor; 396 396 return "NS$name" if IsNativeObjCType($name); 397 397 return "BOOL" if $name eq "boolean"; … … 660 660 if (IsNativeObjCType($type)) { 661 661 if ($type eq "Color") { 662 if ($ buildingForIPhone) {662 if ($shouldUseCGColor) { 663 663 $implIncludes{"ColorSpace.h"} = 1; 664 664 } else { … … 864 864 865 865 # FIXME: This only works for the getter, but not the setter. Need to refactor this code. 866 if ( $buildingForTigerOrEarlier && !$buildingForIPhone ||IsCoreFoundationType($attributeType)) {866 if (IsCoreFoundationType($attributeType)) { 867 867 $publicInterfaceKey = "- (" . $attributeType . ")" . $attributeName . ";"; 868 868 } … … 1330 1330 $getterContentTail .= ")"; 1331 1331 } elsif ($idlType eq "Color") { 1332 if ($ buildingForIPhone) {1332 if ($shouldUseCGColor) { 1333 1333 $getterContentHead = "WebCore::cachedCGColor($getterContentHead"; 1334 1334 $getterContentTail .= ", WebCore::ColorSpaceDeviceRGB)";
Note:
See TracChangeset
for help on using the changeset viewer.