'From Squeak3.8gamma of ''24 November 2004'' [latest update: #6590] on 2 March 2005 at 2:51:41 pm'! "Change Set: nilTrueFalse-gk Date: 1 March 2005 Author: Göran Krampe More fixes relative to the Compiler change regarding compilation of #(true false nil) (from 3.7 this doesn't produce symbols). I went through *all* senders of nil, true and false (as Andreas suggested) in a 6590 Basic image and this changeset has all the fixes I could find (a few of them had fixes already in). Note that the preferences code handles both #true and true, so the long arrays with preferences don't have to be changed. Regarding FFI - Andreas notes that possibly more changes are needed - I am not sure what he means. I did nil out the instvar compiledSpec in ExternalStructure class, just to see that it was properly compiled again (which happens if you run the examples). It seemed to work fine."! !ClassBuilder methodsFor: 'private' stamp: 'gk 2/28/2005 16:35'! reservedNames "Return a list of names that must not be used for variables" ^#('self' 'super' 'thisContext' 'true' 'false' 'nil' self super thisContext #true #false #nil).! ! !ExternalStructure methodsFor: 'printing' stamp: 'gk 3/1/2005 12:07'! longPrintOn: aStream "Append to the argument, aStream, the names and values of all the record's variables." | fields | fields _ self class fields. (fields isEmpty or: [fields first isNil]) ifTrue: [fields _ #()] ifFalse: [(fields first isKindOf: Array) ifFalse: [fields _ Array with: fields]]. fields do: [ :field | field first notNil ifTrue: [ aStream nextPutAll: field first; nextPut: $:; space; tab. (self perform: field first) printOn: aStream. aStream cr]].! ! !ExternalStructure class methodsFor: 'field definition' stamp: 'gk 3/1/2005 12:06'! compileAlias: spec withAccessors: aBool "Define all the fields in the receiver. Return the newly compiled spec." | fieldName fieldType isPointerField externalType | fieldName _ spec first. fieldType _ spec second. isPointerField _ fieldType last = $*. fieldType _ fieldType copyWithout: $*. externalType _ ExternalType atomicTypeNamed: fieldType. externalType == nil ifTrue:["non-atomic" Symbol hasInterned: fieldType ifTrue:[:sym| externalType _ ExternalType structTypeNamed: sym]]. externalType == nil ifTrue:[ Transcript show:'(', fieldType,' is void)'. externalType _ ExternalType void]. isPointerField ifTrue:[externalType _ externalType asPointerType]. (fieldName notNil and:[aBool]) ifTrue:[ self defineAliasAccessorsFor: fieldName type: externalType]. isPointerField ifTrue:[compiledSpec _ WordArray with: (ExternalType structureSpec bitOr: ExternalType pointerSpec)] ifFalse:[compiledSpec _ externalType compiledSpec]. ExternalType noticeModificationOf: self. ^compiledSpec! ! !ExternalStructure class methodsFor: 'field definition' stamp: 'gk 3/1/2005 12:07'! compileFields: specArray withAccessors: aBool "Define all the fields in the receiver. Return the newly compiled spec." | fieldName fieldType isPointerField externalType byteOffset typeSize typeSpec selfRefering | (specArray size > 0 and: [specArray first class ~~ Array]) ifTrue: [^ self compileAlias: specArray withAccessors: aBool]. byteOffset _ 1. typeSpec _ WriteStream on: (WordArray new: 10). typeSpec nextPut: FFIFlagStructure. "dummy for size" specArray do: [:spec | fieldName _ spec first. fieldType _ spec second. isPointerField _ fieldType last = $*. fieldType _ (fieldType findTokens: ' *') first. externalType _ ExternalType atomicTypeNamed: fieldType. selfRefering _ externalType == nil and: fieldType = self asString and: isPointerField. selfRefering ifTrue: [externalType _ ExternalType void asPointerType] ifFalse: [externalType == nil ifTrue: ["non-atomic" Symbol hasInterned: fieldType ifTrue: [:sym | externalType _ ExternalType structTypeNamed: sym]]. externalType == nil ifTrue: [Transcript show: '(' , fieldType , ' is void)'. externalType _ ExternalType void]. isPointerField ifTrue: [externalType _ externalType asPointerType]]. typeSize _ externalType byteSize. spec size > 2 ifTrue: ["extra size" spec third < typeSize ifTrue: [^ self error: 'Explicit type size is less than expected']. typeSize _ spec third]. (fieldName notNil and: [aBool]) ifTrue: [self defineFieldAccessorsFor: fieldName startingAt: byteOffset type: externalType]. typeSpec nextPutAll: (externalType embeddedSpecWithSize: typeSize). byteOffset _ byteOffset + typeSize]. compiledSpec _ typeSpec contents. compiledSpec at: 1 put: (byteOffset - 1 bitOr: FFIFlagStructure). ExternalType noticeModificationOf: self. ^ compiledSpec! ! !ExternalStructureInspector methodsFor: 'accessing' stamp: 'gk 3/1/2005 12:07'! recordFieldList | fields | fields _ object class fields. (fields first isKindOf: Array) ifFalse: [fields _ Array with: fields]. ^fields collect: [ :field | field first ] thenSelect: [:name | name notNil]! ! !FormMenuView class methodsFor: 'class initialization' stamp: 'gk 2/28/2005 16:38'! initialize "The icons for the menu are typically stored on files. In order to avoid reading them every time, they are stored in a collection in a class variable, along with their offset, tool value, and initial visual state (on or off)." "FormMenuView initialize" | offsets keys states names button | offsets _ OrderedCollection new: 21. #(0 64 96 128 160 192 256 288 320 352 420) do: [:i | offsets addLast: i@0]. "First row" #(0 64 96 128 160 192 256 304 352 420) do: [:i | offsets addLast: i@48]. "Second row" offsets _ offsets asArray. keys _ #($a $s $d $f $g $h $j $k $l $; $' $z $x $c $v $b $n $m $, $. $/ ). "Keyboard" states _ #( #false #false #true #false #false #false #true #false #false #false #false #false #false #false #false #false #true #false #false #false #false). "Initial button states" names _ #('select.form' 'singlecopy.form' 'repeatcopy.form' 'line.form' 'curve.form' 'block.form' 'over.form' 'under.form' 'reverse.form' 'erase.form' 'in.form' 'magnify.form' 'white.form' 'lightgray.form' 'gray.form' 'darkgray.form' 'black.form' 'xgrid.form' 'ygrid.form' 'togglegrids.form' 'out.form'). "Files of button images" FormButtons _ OrderedCollection new. 1 to: 21 do: [:index | button _ FormButtonCache new. button form: (Form fromFileNamed: (names at: index)). button offset: (offsets at: index). button value: (keys at: index). button initialState: (states at: index). FormButtons addLast: button]. SpecialBorderForm _ Form fromFileNamed: 'specialborderform.form'. BorderForm _ Form fromFileNamed: 'borderform.form'. ! ! !MethodInterface class methodsFor: 'utilities' stamp: 'gk 3/1/2005 10:43'! isNullMarker: aMarker "Answer true if aMarker is nil or is one of the symbols in #(none #nil unused missing) -- to service a variety of historical conventions" ^ aMarker isNil or: [#(none #nil unused missing) includes: aMarker] " MethodInterface isNullMarker: nil MethodInterface isNullMarker: #nil MethodInterface isNullMarker: #none MethodInterface isNullMarker: #znak "! ! !Preferences class methodsFor: 'misc' stamp: 'gk 2/28/2005 16:42'! defaultValueTableForCurrentRelease "Answer a table defining default values for all the preferences in the release. Returns a list of (pref-symbol, boolean-symbol) pairs" ^ #( (abbreviatedBrowserButtons false) (allowCelesteTell true) (alternativeBrowseIt false) (alternativeScrollbarLook true) (alternativeWindowLook true) (annotationPanes false) (areaFillsAreTolerant false) (areaFillsAreVeryTolerant false) (autoAccessors false) (automaticFlapLayout true) (automaticKeyGeneration false) (automaticPlatformSettings true) (automaticViewerPlacement true) (balloonHelpEnabled true) (balloonHelpInMessageLists false) (batchPenTrails false) (browseWithDragNDrop false) (browseWithPrettyPrint false) (browserShowsPackagePane false) (canRecordWhilePlaying false) (capitalizedReferences true) (caseSensitiveFinds false) (cautionBeforeClosing false) (celesteHasStatusPane false) (celesteShowsAttachmentsFlag false) (changeSetVersionNumbers true) (checkForSlips true) (checkForUnsavedProjects true) (classicNavigatorEnabled false) (classicNewMorphMenu false) (clickOnLabelToEdit false) (cmdDotEnabled true) (collapseWindowsInPlace false) (colorWhenPrettyPrinting false) (compactViewerFlaps false) (compressFlashImages false) (confirmFirstUseOfStyle true) (conversionMethodsAtFileOut false) (cpuWatcherEnabled false) (debugHaloHandle true) (debugPrintSpaceLog false) (debugShowDamage false) (decorateBrowserButtons true) (diffsInChangeList true) (diffsWithPrettyPrint false) (dismissAllOnOptionClose false) (dragNDropWithAnimation false) (eToyFriendly false) (eToyLoginEnabled false) (enableLocalSave true) (extractFlashInHighQuality true) (extractFlashInHighestQuality false) (fastDragWindowForMorphic true) (fenceEnabled true) (fullScreenLeavesDeskMargins true) (haloTransitions false) (hiddenScrollBars false) (higherPerformance false) (honorDesktopCmdKeys true) (ignoreStyleIfOnlyBold true) (inboardScrollbars true) (includeSoundControlInNavigator false) (infiniteUndo false) (logDebuggerStackToFile true) (magicHalos false) (menuButtonInToolPane false) (menuColorFromWorld false) (menuKeyboardControl false) (modalColorPickers true) (mouseOverForKeyboardFocus false) (mouseOverHalos false) (mvcProjectsAllowed true) (navigatorOnLeftEdge true) (noviceMode false) (okToReinitializeFlaps true) (optionalButtons true) (passwordsOnPublish false) (personalizedWorldMenu true) (postscriptStoredAsEPS false) (preserveTrash true) (printAlternateSyntax false) (projectViewsInWindows true) (projectZoom true) (projectsSentToDisk false) (promptForUpdateServer true) (propertySheetFromHalo false) (readDocumentAtStartup true) (restartAlsoProceeds false) (reverseWindowStagger true) (roundedMenuCorners true) (roundedWindowCorners true) (scrollBarsNarrow false) (scrollBarsOnRight true) (scrollBarsWithoutMenuButton false) (securityChecksEnabled false) (selectiveHalos false) (showBoundsInHalo false) (showDirectionForSketches false) (showDirectionHandles false) (showFlapsWhenPublishing false) (showProjectNavigator false) (showSecurityStatus true) (showSharedFlaps true) (signProjectFiles true) (simpleMenus false) (slideDismissalsToTrash true) (smartUpdating true) (soundQuickStart false) (soundStopWhenDone false) (soundsEnabled true) (startInUntrustedDirectory false) (systemWindowEmbedOK false) (thoroughSenders true) (tileTranslucentDrag true) (timeStampsInMenuTitles true) (turnOffPowerManager false) (twentyFourHourFileStamps true) (twoSidedPoohTextures true) (typeCheckingInTileScripting true) (uniTilesClassic true) (uniqueNamesInHalos false) (universalTiles false) (unlimitedPaintArea false) (updateSavesFile false) (useButtonProprtiesToFire false) (useUndo true) (viewersInFlaps true) (warnAboutInsecureContent true) (warnIfNoChangesFile true) (warnIfNoSourcesFile true)) " Preferences defaultValueTableForCurrentRelease do: [:pair | (Preferences preferenceAt: pair first ifAbsent: [nil]) ifNotNilDo: [:pref | pref defaultValue: (pair last == true)]]. Preferences chooseInitialSettings. "! !