Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.542.mcz
==================== Summary ====================
Name: Kernel-nice.542
Author: nice
Time: 4 February 2011, 1:00:46.508 am
UUID: ea1d8beb-aa2d-4cf3-8389-2072df48f6e3
Ancestors: Kernel-ul.541
thu shalt not invoke super in vain
=============== Diff against Kernel-ul.541 ===============
Item was changed:
Dictionary variableSubclass: #MethodDictionary
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Kernel-Methods'!
+ !MethodDictionary commentStamp: 'nice 2/1/2011 02:47' prior: 0!
+ I am a special dictionary holding methods. I am just like a normal Dictionary, except that I am implemented differently. Each Class has an instance of MethodDictionary to hold the correspondence between selectors (names of methods) and methods themselves.
- !MethodDictionary commentStamp: 'ul 10/30/2009 04:43' prior: 0!
- I am just like a normal Dictionary, except that I am implemented differently. Each Class has an instances of MethodDictionary to hold the correspondence between selectors (names of methods) and methods themselves.
In a normal Dictionary, the instance variable 'array' holds an array of Associations. Since there are thousands of methods in the system, these Associations waste space.
Each MethodDictionary is a variable object, with the list of keys (selector Symbols) in the variable part of the instance. The variable 'array' holds the values, which are CompiledMethods.
I also maintain the following invariant: (self basicAt: index) isNil = (array at: index) isNil.!
Item was changed:
----- Method: MethodDictionary>>includesKey: (in category 'accessing') -----
includesKey: aSymbol
+ "This override assumes that instVarsInclude: uses a fast primitive"
- "This override assumes that pointsTo is a fast primitive"
aSymbol ifNil: [^ false].
+ ^ self instVarsInclude: aSymbol!
- ^ super instVarsInclude: aSymbol!
Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.542.mcz
==================== Summary ====================
Name: Kernel-nice.542
Author: nice
Time: 4 February 2011, 1:00:46.508 am
UUID: ea1d8beb-aa2d-4cf3-8389-2072df48f6e3
Ancestors: Kernel-ul.541
thu shalt not invoke super in vain
=============== Diff against Kernel-ul.541 ===============
Item was changed:
Dictionary variableSubclass: #MethodDictionary
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Kernel-Methods'!
+ !MethodDictionary commentStamp: 'nice 2/1/2011 02:47' prior: 0!
+ I am a special dictionary holding methods. I am just like a normal Dictionary, except that I am implemented differently. Each Class has an instance of MethodDictionary to hold the correspondence between selectors (names of methods) and methods themselves.
- !MethodDictionary commentStamp: 'ul 10/30/2009 04:43' prior: 0!
- I am just like a normal Dictionary, except that I am implemented differently. Each Class has an instances of MethodDictionary to hold the correspondence between selectors (names of methods) and methods themselves.
In a normal Dictionary, the instance variable 'array' holds an array of Associations. Since there are thousands of methods in the system, these Associations waste space.
Each MethodDictionary is a variable object, with the list of keys (selector Symbols) in the variable part of the instance. The variable 'array' holds the values, which are CompiledMethods.
I also maintain the following invariant: (self basicAt: index) isNil = (array at: index) isNil.!
Item was changed:
----- Method: MethodDictionary>>includesKey: (in category 'accessing') -----
includesKey: aSymbol
+ "This override assumes that instVarsInclude: uses a fast primitive"
- "This override assumes that pointsTo is a fast primitive"
aSymbol ifNil: [^ false].
+ ^ self instVarsInclude: aSymbol!
- ^ super instVarsInclude: aSymbol!
Nicolas Cellier uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-nice.176.mcz
==================== Summary ====================
Name: Graphics-nice.176
Author: nice
Time: 4 February 2011, 12:52:27.728 am
UUID: ddd38c78-5d87-4fc0-b547-f9a991cf4167
Ancestors: Graphics-ul.175
Add an inst var charIndexCompatibilitySlot in order to let the japanese locale test pass.
Some old .sar are using ReferenceStream binary format for saving some objets.
Unfortunately, ReferenceStream - unlike SmartRefStream - can't cope with modification of Object structure.
This is a backward compatibility workaround with these .sar. In the future, StrikeFont should use SmartRefStream and these .sar should be converted.
=============== Diff against Graphics-ul.175 ===============
Item was changed:
AbstractFont subclass: #StrikeFont
+ instanceVariableNames: 'characterToGlyphMap xTable glyphs name type minAscii maxAscii maxWidth strikeLength ascent descent xOffset raster subscript superscript emphasis derivativeFonts pointSize fallbackFont charIndexCompatibilitySlot'
- instanceVariableNames: 'characterToGlyphMap xTable glyphs name type minAscii maxAscii maxWidth strikeLength ascent descent xOffset raster subscript superscript emphasis derivativeFonts pointSize fallbackFont'
classVariableNames: 'DefaultStringScanner'
poolDictionaries: 'TextConstants'
category: 'Graphics-Fonts'!
!StrikeFont commentStamp: '<historical>' prior: 0!
I represent a compact encoding of a set of Forms corresponding to characters in the ASCII character set. All the forms are placed side by side in a large form whose height is the font height, and whose width is the sum of all the character widths. The xTable variable gives the left-x coordinates of the subforms corresponding to the glyphs. Characters are mapped to glyphs by using the characterToGyphMap.
Subclasses can have non-trivial mapping rules as well as different representations for glyphs sizes (e.g., not using an xTable). If so, these classes should return nil when queried for xTable and/or the characterToGlyphMap. This will cause the CharacterScanner primitive to fail and query the font for the width of a character (so that a more programatical approach can be implemented).
For display, fonts need to implement two messages:
#installOn: aDisplayContext foregroundColor: foregroundColor backgroundColor: backgroundColor
This method installs the receiver (a font) on the given DisplayContext (which may be an instance of BitBlt or Canvas (or any of it's subclasses). The font should take the appropriate action to initialize the display context so that further display operations can be optimized.
#displayString: aString on: aDisplayContext from: startIndex to: stopIndex at: aPoint kern: kernDelta
This method is called for each subsequent run of characters in aString which is to be displayed with the (previously installed) settings.
!
Item was changed:
----- Method: WarpBlt>>cellSize: (in category 'setup') -----
cellSize: s
"Set the number of samples used for averaging"
cellSize := s.
cellSize = 1 ifTrue: [^ self].
"Install the colorMap to used for mapping the averaged RGBA 32bit pixels to the
destination depth. Note that we need to install the 32->32 color map explicitly because
the VM will substitute a colorMap derived from sourceForm->destForm mapping which
is just plain wrong for <32 source and 32bit dest depth"
+ (destForm depth = 32 and: [sourceForm notNil and: [sourceForm depth < 32]])
- (destForm depth = 32 and: [sourceForm notNil] and: [sourceForm depth < 32])
ifTrue:[colorMap := ColorMap shifts: #(0 0 0 0) masks:#(16rFF0000 16rFF00 16rFF 16rFF000000) colors: nil]
ifFalse:[colorMap := Color colorMapIfNeededFrom: 32 to: destForm depth].
!
Nicolas Cellier uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-nice.176.mcz
==================== Summary ====================
Name: Graphics-nice.176
Author: nice
Time: 4 February 2011, 12:52:27.728 am
UUID: ddd38c78-5d87-4fc0-b547-f9a991cf4167
Ancestors: Graphics-ul.175
Add an inst var charIndexCompatibilitySlot in order to let the japanese locale test pass.
Some old .sar are using ReferenceStream binary format for saving some objets.
Unfortunately, ReferenceStream - unlike SmartRefStream - can't cope with modification of Object structure.
This is a backward compatibility workaround with these .sar. In the future, StrikeFont should use SmartRefStream and these .sar should be converted.
=============== Diff against Graphics-ul.175 ===============
Item was changed:
AbstractFont subclass: #StrikeFont
+ instanceVariableNames: 'characterToGlyphMap xTable glyphs name type minAscii maxAscii maxWidth strikeLength ascent descent xOffset raster subscript superscript emphasis derivativeFonts pointSize fallbackFont charIndexCompatibilitySlot'
- instanceVariableNames: 'characterToGlyphMap xTable glyphs name type minAscii maxAscii maxWidth strikeLength ascent descent xOffset raster subscript superscript emphasis derivativeFonts pointSize fallbackFont'
classVariableNames: 'DefaultStringScanner'
poolDictionaries: 'TextConstants'
category: 'Graphics-Fonts'!
!StrikeFont commentStamp: '<historical>' prior: 0!
I represent a compact encoding of a set of Forms corresponding to characters in the ASCII character set. All the forms are placed side by side in a large form whose height is the font height, and whose width is the sum of all the character widths. The xTable variable gives the left-x coordinates of the subforms corresponding to the glyphs. Characters are mapped to glyphs by using the characterToGyphMap.
Subclasses can have non-trivial mapping rules as well as different representations for glyphs sizes (e.g., not using an xTable). If so, these classes should return nil when queried for xTable and/or the characterToGlyphMap. This will cause the CharacterScanner primitive to fail and query the font for the width of a character (so that a more programatical approach can be implemented).
For display, fonts need to implement two messages:
#installOn: aDisplayContext foregroundColor: foregroundColor backgroundColor: backgroundColor
This method installs the receiver (a font) on the given DisplayContext (which may be an instance of BitBlt or Canvas (or any of it's subclasses). The font should take the appropriate action to initialize the display context so that further display operations can be optimized.
#displayString: aString on: aDisplayContext from: startIndex to: stopIndex at: aPoint kern: kernDelta
This method is called for each subsequent run of characters in aString which is to be displayed with the (previously installed) settings.
!
Item was changed:
----- Method: WarpBlt>>cellSize: (in category 'setup') -----
cellSize: s
"Set the number of samples used for averaging"
cellSize := s.
cellSize = 1 ifTrue: [^ self].
"Install the colorMap to used for mapping the averaged RGBA 32bit pixels to the
destination depth. Note that we need to install the 32->32 color map explicitly because
the VM will substitute a colorMap derived from sourceForm->destForm mapping which
is just plain wrong for <32 source and 32bit dest depth"
+ (destForm depth = 32 and: [sourceForm notNil and: [sourceForm depth < 32]])
- (destForm depth = 32 and: [sourceForm notNil] and: [sourceForm depth < 32])
ifTrue:[colorMap := ColorMap shifts: #(0 0 0 0) masks:#(16rFF0000 16rFF00 16rFF 16rFF000000) colors: nil]
ifFalse:[colorMap := Color colorMapIfNeededFrom: 32 to: destForm depth].
!
Nicolas Cellier uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-nice.176.mcz
==================== Summary ====================
Name: Graphics-nice.176
Author: nice
Time: 4 February 2011, 12:52:27.728 am
UUID: ddd38c78-5d87-4fc0-b547-f9a991cf4167
Ancestors: Graphics-ul.175
Add an inst var charIndexCompatibilitySlot in order to let the japanese locale test pass.
Some old .sar are using ReferenceStream binary format for saving some objets.
Unfortunately, ReferenceStream - unlike SmartRefStream - can't cope with modification of Object structure.
This is a backward compatibility workaround with these .sar. In the future, StrikeFont should use SmartRefStream and these .sar should be converted.
=============== Diff against Graphics-ul.175 ===============
Item was changed:
AbstractFont subclass: #StrikeFont
+ instanceVariableNames: 'characterToGlyphMap xTable glyphs name type minAscii maxAscii maxWidth strikeLength ascent descent xOffset raster subscript superscript emphasis derivativeFonts pointSize fallbackFont charIndexCompatibilitySlot'
- instanceVariableNames: 'characterToGlyphMap xTable glyphs name type minAscii maxAscii maxWidth strikeLength ascent descent xOffset raster subscript superscript emphasis derivativeFonts pointSize fallbackFont'
classVariableNames: 'DefaultStringScanner'
poolDictionaries: 'TextConstants'
category: 'Graphics-Fonts'!
!StrikeFont commentStamp: '<historical>' prior: 0!
I represent a compact encoding of a set of Forms corresponding to characters in the ASCII character set. All the forms are placed side by side in a large form whose height is the font height, and whose width is the sum of all the character widths. The xTable variable gives the left-x coordinates of the subforms corresponding to the glyphs. Characters are mapped to glyphs by using the characterToGyphMap.
Subclasses can have non-trivial mapping rules as well as different representations for glyphs sizes (e.g., not using an xTable). If so, these classes should return nil when queried for xTable and/or the characterToGlyphMap. This will cause the CharacterScanner primitive to fail and query the font for the width of a character (so that a more programatical approach can be implemented).
For display, fonts need to implement two messages:
#installOn: aDisplayContext foregroundColor: foregroundColor backgroundColor: backgroundColor
This method installs the receiver (a font) on the given DisplayContext (which may be an instance of BitBlt or Canvas (or any of it's subclasses). The font should take the appropriate action to initialize the display context so that further display operations can be optimized.
#displayString: aString on: aDisplayContext from: startIndex to: stopIndex at: aPoint kern: kernDelta
This method is called for each subsequent run of characters in aString which is to be displayed with the (previously installed) settings.
!
Item was changed:
----- Method: WarpBlt>>cellSize: (in category 'setup') -----
cellSize: s
"Set the number of samples used for averaging"
cellSize := s.
cellSize = 1 ifTrue: [^ self].
"Install the colorMap to used for mapping the averaged RGBA 32bit pixels to the
destination depth. Note that we need to install the 32->32 color map explicitly because
the VM will substitute a colorMap derived from sourceForm->destForm mapping which
is just plain wrong for <32 source and 32bit dest depth"
+ (destForm depth = 32 and: [sourceForm notNil and: [sourceForm depth < 32]])
- (destForm depth = 32 and: [sourceForm notNil] and: [sourceForm depth < 32])
ifTrue:[colorMap := ColorMap shifts: #(0 0 0 0) masks:#(16rFF0000 16rFF00 16rFF 16rFF000000) colors: nil]
ifFalse:[colorMap := Color colorMapIfNeededFrom: 32 to: destForm depth].
!
Alexander Lazarević uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-laza.294.mcz
==================== Summary ====================
Name: Tools-laza.294
Author: laza
Time: 3 February 2011, 9:21:19.739 pm
UUID: 1b6fdc16-3cdf-3f45-bb5b-520c65f1e983
Ancestors: Tools-cmm.293
Display DependencyBrowsers class comment in it's code pane while no method is selected, to give a clue about what is being shown in the list
views
=============== Diff against Tools-cmm.293 ===============
Item was changed:
----- Method: DependencyBrowser>>aboutToStyle: (in category 'contents') -----
aboutToStyle: aStyler
"This is a notification that aStyler is about to re-style its text.
Set the classOrMetaClass in aStyler, so that identifiers
will be resolved correctly.
Answer true to allow styling to proceed, or false to veto the styling"
| selectedClass |
selectedClass := self classListSelection ifNil:[^false].
+ self messageListSelection ifNil:[^false].
aStyler classOrMetaClass: ((self messageListSelection == #Definition) ifFalse:[Smalltalk classNamed: selectedClass]).
^true!
Item was changed:
----- Method: DependencyBrowser>>selectedMessage (in category 'contents') -----
selectedMessage
"Source code for currently selected message"
| className methodName mref |
className := self classListSelection.
methodName := self messageListSelection.
mref := (classDeps at: self classDepsSelection ifAbsent:[#()])
detect:[:mr| mr classSymbol = className
and:[mr methodSymbol = methodName]]
ifNone:[nil].
+ mref ifNil:[^self class comment].
- mref ifNil:[^''].
mref methodSymbol == #Definition ifTrue:[^mref actualClass definition].
^mref sourceCode!
Alexander Lazarević uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-laza.294.mcz
==================== Summary ====================
Name: Tools-laza.294
Author: laza
Time: 3 February 2011, 9:21:19.739 pm
UUID: 1b6fdc16-3cdf-3f45-bb5b-520c65f1e983
Ancestors: Tools-cmm.293
Display DependencyBrowsers class comment in it's code pane while no method is selected, to give a clue about what is being shown in the list
views
=============== Diff against Tools-cmm.293 ===============
Item was changed:
----- Method: DependencyBrowser>>aboutToStyle: (in category 'contents') -----
aboutToStyle: aStyler
"This is a notification that aStyler is about to re-style its text.
Set the classOrMetaClass in aStyler, so that identifiers
will be resolved correctly.
Answer true to allow styling to proceed, or false to veto the styling"
| selectedClass |
selectedClass := self classListSelection ifNil:[^false].
+ self messageListSelection ifNil:[^false].
aStyler classOrMetaClass: ((self messageListSelection == #Definition) ifFalse:[Smalltalk classNamed: selectedClass]).
^true!
Item was changed:
----- Method: DependencyBrowser>>selectedMessage (in category 'contents') -----
selectedMessage
"Source code for currently selected message"
| className methodName mref |
className := self classListSelection.
methodName := self messageListSelection.
mref := (classDeps at: self classDepsSelection ifAbsent:[#()])
detect:[:mr| mr classSymbol = className
and:[mr methodSymbol = methodName]]
ifNone:[nil].
+ mref ifNil:[^self class comment].
- mref ifNil:[^''].
mref methodSymbol == #Definition ifTrue:[^mref actualClass definition].
^mref sourceCode!