* properly update the current enum value ("auto_increment") in case it

is assigned a particular value in the C header

git-svn-id: trunk@16963 -
This commit is contained in:
Jonas Maebe 2011-02-21 19:43:27 +00:00
parent 9ca12c0377
commit 11d780e62f
24 changed files with 185 additions and 177 deletions

View File

@ -25,7 +25,7 @@ const
const
NSNoUnderlineStyle = 0;
NSSingleUnderlineStyle = 0;
NSSingleUnderlineStyle = 1;
{$endif}
{$endif}

View File

@ -50,9 +50,9 @@ const
const
NSImageScaleProportionallyDown = 0;
NSImageScaleAxesIndependently = 0;
NSImageScaleNone = 1;
NSImageScaleProportionallyUpOrDown = 2;
NSImageScaleAxesIndependently = 1;
NSImageScaleNone = 2;
NSImageScaleProportionallyUpOrDown = 3;
const
NSMixedState = -1;
@ -85,14 +85,14 @@ const
const
NSBackgroundStyleLight = 0;
NSBackgroundStyleDark = 0;
NSBackgroundStyleRaised = 1;
NSBackgroundStyleLowered = 2;
NSBackgroundStyleDark = 1;
NSBackgroundStyleRaised = 2;
NSBackgroundStyleLowered = 3;
const
NSScaleProportionally = 0;
NSScaleToFit = 0;
NSScaleNone = 1;
NSScaleToFit = 1;
NSScaleNone = 2;
{ Types }
type

View File

@ -8,21 +8,21 @@
const
NSImageAlignCenter = 0;
NSImageAlignTop = 0;
NSImageAlignTopLeft = 1;
NSImageAlignTopRight = 2;
NSImageAlignLeft = 3;
NSImageAlignBottom = 4;
NSImageAlignBottomLeft = 5;
NSImageAlignBottomRight = 6;
NSImageAlignRight = 7;
NSImageAlignTop = 1;
NSImageAlignTopLeft = 2;
NSImageAlignTopRight = 3;
NSImageAlignLeft = 4;
NSImageAlignBottom = 5;
NSImageAlignBottomLeft = 6;
NSImageAlignBottomRight = 7;
NSImageAlignRight = 8;
const
NSImageFrameNone = 0;
NSImageFramePhoto = 0;
NSImageFrameGrayBezel = 1;
NSImageFrameGroove = 2;
NSImageFrameButton = 3;
NSImageFramePhoto = 1;
NSImageFrameGrayBezel = 2;
NSImageFrameGroove = 3;
NSImageFrameButton = 4;
{ Types }
type

View File

@ -8,17 +8,17 @@
const
NSLeftTabStopType = 0;
NSRightTabStopType = 0;
NSCenterTabStopType = 1;
NSDecimalTabStopType = 2;
NSRightTabStopType = 1;
NSCenterTabStopType = 2;
NSDecimalTabStopType = 3;
const
NSLineBreakByWordWrapping = 0;
NSLineBreakByCharWrapping = 0;
NSLineBreakByClipping = 1;
NSLineBreakByTruncatingHead = 2;
NSLineBreakByTruncatingTail = 3;
NSLineBreakByTruncatingMiddle = 4;
NSLineBreakByCharWrapping = 1;
NSLineBreakByClipping = 2;
NSLineBreakByTruncatingHead = 3;
NSLineBreakByTruncatingTail = 4;
NSLineBreakByTruncatingMiddle = 5;
{ Types }
type

View File

@ -8,8 +8,8 @@
const
NSSpeechImmediateBoundary = 0;
NSSpeechWordBoundary = 0;
NSSpeechSentenceBoundary = 1;
NSSpeechWordBoundary = 1;
NSSpeechSentenceBoundary = 2;
{ Types }
type

View File

@ -12,11 +12,11 @@ const
const
NSTableViewNoColumnAutoresizing = 0;
NSTableViewUniformColumnAutoresizingStyle = 0;
NSTableViewSequentialColumnAutoresizingStyle = 1;
NSTableViewReverseSequentialColumnAutoresizingStyle = 2;
NSTableViewLastColumnOnlyAutoresizingStyle = 3;
NSTableViewFirstColumnOnlyAutoresizingStyle = 4;
NSTableViewUniformColumnAutoresizingStyle = 1;
NSTableViewSequentialColumnAutoresizingStyle = 2;
NSTableViewReverseSequentialColumnAutoresizingStyle = 3;
NSTableViewLastColumnOnlyAutoresizingStyle = 4;
NSTableViewFirstColumnOnlyAutoresizingStyle = 5;
const
NSTableViewGridNone = 0;

View File

@ -61,8 +61,8 @@ const
const
NSDirectSelection = 0;
NSSelectingNext = 0;
NSSelectingPrevious = 1;
NSSelectingNext = 1;
NSSelectingPrevious = 2;
const
NSWindowCloseButton = 0;

View File

@ -12,24 +12,24 @@ const
const
NSDirectPredicateModifier = 0;
NSAllPredicateModifier = 0;
NSAnyPredicateModifier = 1;
NSAllPredicateModifier = 1;
NSAnyPredicateModifier = 2;
const
NSLessThanPredicateOperatorType = 0;
NSLessThanOrEqualToPredicateOperatorType = 0;
NSGreaterThanPredicateOperatorType = 1;
NSGreaterThanOrEqualToPredicateOperatorType = 2;
NSEqualToPredicateOperatorType = 3;
NSNotEqualToPredicateOperatorType = 4;
NSMatchesPredicateOperatorType = 5;
NSLikePredicateOperatorType = 6;
NSBeginsWithPredicateOperatorType = 7;
NSEndsWithPredicateOperatorType = 8;
NSInPredicateOperatorType = 9;
NSCustomSelectorPredicateOperatorType = 10;
NSLessThanOrEqualToPredicateOperatorType = 1;
NSGreaterThanPredicateOperatorType = 2;
NSGreaterThanOrEqualToPredicateOperatorType = 3;
NSEqualToPredicateOperatorType = 4;
NSNotEqualToPredicateOperatorType = 5;
NSMatchesPredicateOperatorType = 6;
NSLikePredicateOperatorType = 7;
NSBeginsWithPredicateOperatorType = 8;
NSEndsWithPredicateOperatorType = 9;
NSInPredicateOperatorType = 10;
NSCustomSelectorPredicateOperatorType = 11;
NSContainsPredicateOperatorType = 99;
NSBetweenPredicateOperatorType = 11;
NSBetweenPredicateOperatorType = 100;
{ Types }
type

View File

@ -8,8 +8,8 @@
const
NSNotPredicateType = 0;
NSAndPredicateType = 0;
NSOrPredicateType = 1;
NSAndPredicateType = 1;
NSOrPredicateType = 2;
{ Types }
type

View File

@ -14,10 +14,10 @@ const
const
NSCalculationNoError = 0;
NSCalculationLossOfPrecision = 0;
NSCalculationUnderflow = 1;
NSCalculationOverflow = 2;
NSCalculationDivideByZero = 3;
NSCalculationLossOfPrecision = 1;
NSCalculationUnderflow = 2;
NSCalculationOverflow = 3;
NSCalculationDivideByZero = 4;
{ Types }
type

View File

@ -8,15 +8,15 @@
const
NSConstantValueExpressionType = 0;
NSEvaluatedObjectExpressionType = 0;
NSVariableExpressionType = 1;
NSKeyPathExpressionType = 2;
NSFunctionExpressionType = 3;
NSUnionSetExpressionType = 4;
NSIntersectSetExpressionType = 5;
NSMinusSetExpressionType = 6;
NSEvaluatedObjectExpressionType = 1;
NSVariableExpressionType = 2;
NSKeyPathExpressionType = 3;
NSFunctionExpressionType = 4;
NSUnionSetExpressionType = 5;
NSIntersectSetExpressionType = 6;
NSMinusSetExpressionType = 7;
NSSubqueryExpressionType = 13;
NSAggregateExpressionType = 7;
NSAggregateExpressionType = 14;
NSBlockExpressionType = 19;
{ Types }

View File

@ -8,15 +8,15 @@
const
NSApplicationDirectory = 1;
NSDemoApplicationDirectory = 0;
NSDeveloperApplicationDirectory = 1;
NSAdminApplicationDirectory = 2;
NSLibraryDirectory = 3;
NSDeveloperDirectory = 4;
NSUserDirectory = 5;
NSDocumentationDirectory = 6;
NSDocumentDirectory = 7;
NSCoreServiceDirectory = 8;
NSDemoApplicationDirectory = 2;
NSDeveloperApplicationDirectory = 3;
NSAdminApplicationDirectory = 4;
NSLibraryDirectory = 5;
NSDeveloperDirectory = 6;
NSUserDirectory = 7;
NSDocumentationDirectory = 8;
NSDocumentDirectory = 9;
NSCoreServiceDirectory = 10;
NSAutosavedInformationDirectory = 11;
NSDesktopDirectory = 12;
NSCachesDirectory = 13;

View File

@ -8,12 +8,12 @@
const
NSWindowsNTOperatingSystem = 1;
NSWindows95OperatingSystem = 0;
NSSolarisOperatingSystem = 1;
NSHPUXOperatingSystem = 2;
NSMACHOperatingSystem = 3;
NSSunOSOperatingSystem = 4;
NSOSF1OperatingSystem = 5;
NSWindows95OperatingSystem = 2;
NSSolarisOperatingSystem = 3;
NSHPUXOperatingSystem = 4;
NSMACHOperatingSystem = 5;
NSSunOSOperatingSystem = 6;
NSOSF1OperatingSystem = 7;
{$endif}
{$endif}

View File

@ -8,16 +8,16 @@
const
NSNoScriptError = 0;
NSReceiverEvaluationScriptError = 0;
NSKeySpecifierEvaluationScriptError = 1;
NSArgumentEvaluationScriptError = 2;
NSReceiversCantHandleCommandScriptError = 3;
NSRequiredArgumentsMissingScriptError = 4;
NSArgumentsWrongScriptError = 5;
NSUnknownKeyScriptError = 6;
NSInternalScriptError = 7;
NSOperationNotSupportedForKeyScriptError = 8;
NSCannotCreateScriptCommandError = 9;
NSReceiverEvaluationScriptError = 1;
NSKeySpecifierEvaluationScriptError = 2;
NSArgumentEvaluationScriptError = 3;
NSReceiversCantHandleCommandScriptError = 4;
NSRequiredArgumentsMissingScriptError = 5;
NSArgumentsWrongScriptError = 6;
NSUnknownKeyScriptError = 7;
NSInternalScriptError = 8;
NSOperationNotSupportedForKeyScriptError = 9;
NSCannotCreateScriptCommandError = 10;
{$endif}
{$endif}

View File

@ -8,12 +8,12 @@
const
NSNoSpecifierError = 0;
NSNoTopLevelContainersSpecifierError = 0;
NSContainerSpecifierError = 1;
NSUnknownKeySpecifierError = 2;
NSInvalidIndexSpecifierError = 3;
NSInternalSpecifierError = 4;
NSOperationNotSupportedForKeySpecifierError = 5;
NSNoTopLevelContainersSpecifierError = 1;
NSContainerSpecifierError = 2;
NSUnknownKeySpecifierError = 3;
NSInvalidIndexSpecifierError = 4;
NSInternalSpecifierError = 5;
NSOperationNotSupportedForKeySpecifierError = 6;
const
NSPositionAfter = 0;
@ -24,7 +24,7 @@ const
const
NSRelativeAfter = 0;
NSRelativeBefore = 0;
NSRelativeBefore = 1;
const
NSIndexSubelement = 0;

View File

@ -8,8 +8,8 @@
const
NSSaveOptionsYes = 0;
NSSaveOptionsNo = 0;
NSSaveOptionsAsk = 1;
NSSaveOptionsNo = 1;
NSSaveOptionsAsk = 2;
{ Types }
type

View File

@ -8,13 +8,13 @@
const
NSEqualToComparison = 0;
NSLessThanOrEqualToComparison = 0;
NSLessThanComparison = 1;
NSGreaterThanOrEqualToComparison = 2;
NSGreaterThanComparison = 3;
NSBeginsWithComparison = 4;
NSEndsWithComparison = 5;
NSContainsComparison = 6;
NSLessThanOrEqualToComparison = 1;
NSLessThanComparison = 2;
NSGreaterThanOrEqualToComparison = 3;
NSGreaterThanComparison = 4;
NSBeginsWithComparison = 5;
NSEndsWithComparison = 6;
NSContainsComparison = 7;
{ Types }
type

View File

@ -8,9 +8,9 @@
const
NSURLHandleNotLoaded = 0;
NSURLHandleLoadSucceeded = 0;
NSURLHandleLoadInProgress = 1;
NSURLHandleLoadFailed = 2;
NSURLHandleLoadSucceeded = 1;
NSURLHandleLoadInProgress = 2;
NSURLHandleLoadFailed = 3;
{ Types }
type

View File

@ -8,25 +8,25 @@
const
NSXMLEntityGeneralKind = 1;
NSXMLEntityParsedKind = 0;
NSXMLEntityUnparsedKind = 1;
NSXMLEntityParameterKind = 2;
NSXMLEntityPredefined = 3;
NSXMLAttributeCDATAKind = 4;
NSXMLAttributeIDKind = 5;
NSXMLAttributeIDRefKind = 6;
NSXMLAttributeIDRefsKind = 7;
NSXMLAttributeEntityKind = 8;
NSXMLAttributeEntitiesKind = 9;
NSXMLAttributeNMTokenKind = 10;
NSXMLAttributeNMTokensKind = 11;
NSXMLAttributeEnumerationKind = 12;
NSXMLAttributeNotationKind = 13;
NSXMLElementDeclarationUndefinedKind = 14;
NSXMLElementDeclarationEmptyKind = 15;
NSXMLElementDeclarationAnyKind = 16;
NSXMLElementDeclarationMixedKind = 17;
NSXMLElementDeclarationElementKind = 18;
NSXMLEntityParsedKind = 2;
NSXMLEntityUnparsedKind = 3;
NSXMLEntityParameterKind = 4;
NSXMLEntityPredefined = 5;
NSXMLAttributeCDATAKind = 6;
NSXMLAttributeIDKind = 7;
NSXMLAttributeIDRefKind = 8;
NSXMLAttributeIDRefsKind = 9;
NSXMLAttributeEntityKind = 10;
NSXMLAttributeEntitiesKind = 11;
NSXMLAttributeNMTokenKind = 12;
NSXMLAttributeNMTokensKind = 13;
NSXMLAttributeEnumerationKind = 14;
NSXMLAttributeNotationKind = 15;
NSXMLElementDeclarationUndefinedKind = 16;
NSXMLElementDeclarationEmptyKind = 17;
NSXMLElementDeclarationAnyKind = 18;
NSXMLElementDeclarationMixedKind = 19;
NSXMLElementDeclarationElementKind = 20;
{ Types }
type

View File

@ -8,9 +8,9 @@
const
NSXMLDocumentXMLKind = 0;
NSXMLDocumentXHTMLKind = 0;
NSXMLDocumentHTMLKind = 1;
NSXMLDocumentTextKind = 2;
NSXMLDocumentXHTMLKind = 1;
NSXMLDocumentHTMLKind = 2;
NSXMLDocumentTextKind = 3;
{ Types }
type

View File

@ -8,18 +8,18 @@
const
NSXMLInvalidKind = 0;
NSXMLDocumentKind = 0;
NSXMLElementKind = 1;
NSXMLAttributeKind = 2;
NSXMLNamespaceKind = 3;
NSXMLProcessingInstructionKind = 4;
NSXMLCommentKind = 5;
NSXMLTextKind = 6;
NSXMLDTDKind = 7;
NSXMLEntityDeclarationKind = 8;
NSXMLAttributeDeclarationKind = 9;
NSXMLElementDeclarationKind = 10;
NSXMLNotationDeclarationKind = 11;
NSXMLDocumentKind = 1;
NSXMLElementKind = 2;
NSXMLAttributeKind = 3;
NSXMLNamespaceKind = 4;
NSXMLProcessingInstructionKind = 5;
NSXMLCommentKind = 6;
NSXMLTextKind = 7;
NSXMLDTDKind = 8;
NSXMLEntityDeclarationKind = 9;
NSXMLAttributeDeclarationKind = 10;
NSXMLElementDeclarationKind = 11;
NSXMLNotationDeclarationKind = 12;
{ Types }
type

View File

@ -8,37 +8,37 @@
const
WebMenuItemTagOpenLinkInNewWindow = 1;
WebMenuItemTagDownloadLinkToDisk = 0;
WebMenuItemTagCopyLinkToClipboard = 1;
WebMenuItemTagOpenImageInNewWindow = 2;
WebMenuItemTagDownloadImageToDisk = 3;
WebMenuItemTagCopyImageToClipboard = 4;
WebMenuItemTagOpenFrameInNewWindow = 5;
WebMenuItemTagCopy = 6;
WebMenuItemTagGoBack = 7;
WebMenuItemTagGoForward = 8;
WebMenuItemTagStop = 9;
WebMenuItemTagReload = 10;
WebMenuItemTagCut = 11;
WebMenuItemTagPaste = 12;
WebMenuItemTagSpellingGuess = 13;
WebMenuItemTagNoGuessesFound = 14;
WebMenuItemTagIgnoreSpelling = 15;
WebMenuItemTagLearnSpelling = 16;
WebMenuItemTagOther = 17;
WebMenuItemTagSearchInSpotlight = 18;
WebMenuItemTagSearchWeb = 19;
WebMenuItemTagLookUpInDictionary = 20;
WebMenuItemTagOpenWithDefaultApplication = 21;
WebMenuItemPDFActualSize = 22;
WebMenuItemPDFZoomIn = 23;
WebMenuItemPDFZoomOut = 24;
WebMenuItemPDFAutoSize = 25;
WebMenuItemPDFSinglePage = 26;
WebMenuItemPDFFacingPages = 27;
WebMenuItemPDFContinuous = 28;
WebMenuItemPDFNextPage = 29;
WebMenuItemPDFPreviousPage = 30;
WebMenuItemTagDownloadLinkToDisk = 2;
WebMenuItemTagCopyLinkToClipboard = 3;
WebMenuItemTagOpenImageInNewWindow = 4;
WebMenuItemTagDownloadImageToDisk = 5;
WebMenuItemTagCopyImageToClipboard = 6;
WebMenuItemTagOpenFrameInNewWindow = 7;
WebMenuItemTagCopy = 8;
WebMenuItemTagGoBack = 9;
WebMenuItemTagGoForward = 10;
WebMenuItemTagStop = 11;
WebMenuItemTagReload = 12;
WebMenuItemTagCut = 13;
WebMenuItemTagPaste = 14;
WebMenuItemTagSpellingGuess = 15;
WebMenuItemTagNoGuessesFound = 16;
WebMenuItemTagIgnoreSpelling = 17;
WebMenuItemTagLearnSpelling = 18;
WebMenuItemTagOther = 19;
WebMenuItemTagSearchInSpotlight = 20;
WebMenuItemTagSearchWeb = 21;
WebMenuItemTagLookUpInDictionary = 22;
WebMenuItemTagOpenWithDefaultApplication = 23;
WebMenuItemPDFActualSize = 24;
WebMenuItemPDFZoomIn = 25;
WebMenuItemPDFZoomOut = 26;
WebMenuItemPDFAutoSize = 27;
WebMenuItemPDFSinglePage = 28;
WebMenuItemPDFFacingPages = 29;
WebMenuItemPDFContinuous = 30;
WebMenuItemPDFNextPage = 31;
WebMenuItemPDFPreviousPage = 32;
const
WebDragDestinationActionNone = 0;

View File

@ -4,7 +4,7 @@
NSWorkspaceLaunchNewInstance = $00080000;
NSWorkspaceLaunchAndHide = $00100000;
NSWorkspaceLaunchAndHideOthers = $00200000;
- NSWorkspaceLaunchAllowingClassicStartup = 0;
- NSWorkspaceLaunchAllowingClassicStartup = 2097153;
+ NSWorkspaceLaunchDefault = NSWorkspaceLaunchAsync or NSWorkspaceLaunchAllowingClassicStartup;
const

View File

@ -2458,8 +2458,10 @@ class ObjectivePParser extends ObjectivePParserBase {
} elseif (ereg("^[[:space:]]*[,]*[[:space:]]*([a-zA-Z0-9_]+)[[:space:]]*=[[:space:]]*[(]*([0-9-]+)[)]*[,]*[[:space:]]*$", $line, $captures)) { // integer value
$captures[2] = trim($captures[2], ", ");
$this->dump[$file_name]["types"]["enums"][$block_count][] = $captures[1]." = ".$captures[2].";".$this->AppendEOLComment();
$auto_increment = $captures[2] + 1;
} elseif (ereg("^[[:space:]]*[,]*[[:space:]]*([a-zA-Z0-9_]+)[[:space:]]*=[[:space:]]*[(]*([0-9]+[xX]+[a-fA-F0-9]+)[)]*", $line, $captures)) { // hexadecimal value
$captures[2] = trim($captures[2], ", ");
$auto_increment = $captures[2] + 1;
$captures[2] = eregi_replace("^0x", "$", $captures[2]);
$this->dump[$file_name]["types"]["enums"][$block_count][] = $captures[1]." = ".$captures[2].";".$this->AppendEOLComment();
} elseif (ereg("^[[:space:]]*[,]*[[:space:]]*([a-zA-Z0-9_]+)[[:space:]]*=[[:space:]]*([a-zA-Z0-9]+[[:space:]]*<<[[:space:]]*[a-zA-Z0-9]+)", $line, $captures)) { // << shl value, no ()
@ -2470,6 +2472,9 @@ class ObjectivePParser extends ObjectivePParserBase {
$captures[2] = ereg_replace("([[:space:]])shl([[:space:]]+)([0-9]+)[UL]+", "\\1shl\\2\\3", $captures[2]);
$this->dump[$file_name]["types"]["enums"][$block_count][] = $captures[1]." = ".$captures[2].";".$this->AppendEOLComment();
$operands = preg_split("/\s*shl\s*/", $captures[2]);
$auto_increment = ($operands[0] << $operands[1]) + 1;
} elseif (ereg("^[[:space:]]*[,]*[[:space:]]*([a-zA-Z0-9_]+)[[:space:]]*=[[:space:]]*\(([a-zA-Z0-9]+[[:space:]]*<<[[:space:]]*[a-zA-Z0-9]+)\)", $line, $captures)) { // << shl value
$captures[2] = trim($captures[2], ", ");
$captures[2] = ereg_replace("[[:space:]]?<<[[:space:]]?", " shl ", $captures[2]);
@ -2479,6 +2484,9 @@ class ObjectivePParser extends ObjectivePParserBase {
$captures[2] = ereg_replace("([[:space:]])shl([[:space:]]+)([0-9]+)[UL]+", "\\1shl\\2\\3", $captures[2]);
$this->dump[$file_name]["types"]["enums"][$block_count][] = $captures[1]." = ".$captures[2].";".$this->AppendEOLComment();
$operands = preg_split("/\s*shl\s*/", $captures[2]);
$auto_increment = ($operands[0] << $operands[1]) + 1;
} elseif (ereg("^[[:space:]]*[,]*[[:space:]]*([a-zA-Z0-9_]+)[[:space:]]*[,}]*[[:space:]]*$", $line, $captures)) { // non-value
// omit lines which started nested structures.
@ -2657,7 +2665,7 @@ class ObjectivePParser extends ObjectivePParserBase {
// parse enum fields
if (($got_enum) || ($got_named_enum)) {
// print($line."\n");
// print($line.", auto_inc = $auto_increment\n");
$this->ParseEnumFields($line, $file_name, &$block_count, &$auto_increment);