⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 175995 in webkit


Ignore:
Timestamp:
Nov 11, 2014, 5:20:30 PM (12 years ago)
Author:
ddkilzer@apple.com
Message:

Modernize $buildingForIPhone in CodeGeneratorObjC.pm
<http://webkit.org/b/138640>

Reviewed by Daniel Bates.

Mac OS X is the only platform that supports NSColor, so rename
$buildingForIPhone to $shouldUseCGColor (which is actually what
the variable represents) and define it in terms of the "macosx"
platform name.

  • bindings/scripts/CodeGeneratorObjC.pm:

($buildingForIPhone): Rename to $shouldUseCGColor.
($shouldUseCGColor): False if PLATFORM_NAME is not defined,
which is the case on older Xcodes when building for Mac OS X, or
if PLATFORM_NAME is equal to "macosx". True otherwise.
(GetClassName): Switch to use new variable name.
(AddIncludesForType): Ditto.
(GenerateHeader): Remove dead code. The
$buildingForTigerOrEarlier variable was accidentally
re-introduced in r161638, but was originally removed in r127032!
(GenerateImplementation): Switch to use new variable name.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r175992 r175995  
     12014-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
    1252014-11-11  Tim Horton  <timothy_horton@apple.com>
    226
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm

    r173220 r175995  
    105105
    106106# Constants
    107 my $buildingForIPhone = defined $ENV{PLATFORM_NAME} && ($ENV{PLATFORM_NAME} eq "iphoneos" or $ENV{PLATFORM_NAME} eq "iphonesimulator");
     107my $shouldUseCGColor = defined $ENV{PLATFORM_NAME} && $ENV{PLATFORM_NAME} ne "macosx";
    108108my $nullableInit = "bool isNull = false;";
    109109my $exceptionInit = "WebCore::ExceptionCode ec = 0;";
     
    393393    # special cases
    394394    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;
    396396    return "NS$name" if IsNativeObjCType($name);
    397397    return "BOOL" if $name eq "boolean";
     
    660660    if (IsNativeObjCType($type)) {
    661661        if ($type eq "Color") {
    662             if ($buildingForIPhone) {
     662            if ($shouldUseCGColor) {
    663663                $implIncludes{"ColorSpace.h"} = 1;
    664664            } else {
     
    864864
    865865            # 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)) {
    867867                $publicInterfaceKey = "- (" . $attributeType . ")" . $attributeName . ";";
    868868            }
     
    13301330                $getterContentTail .= ")";
    13311331            } elsif ($idlType eq "Color") {
    1332                 if ($buildingForIPhone) {
     1332                if ($shouldUseCGColor) {
    13331333                    $getterContentHead = "WebCore::cachedCGColor($getterContentHead";
    13341334                    $getterContentTail .= ", WebCore::ColorSpaceDeviceRGB)";
Note: See TracChangeset for help on using the changeset viewer.