Andreas Raab uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-ar.128.mcz
==================== Summary ====================
Name: Graphics-ar.128
Author: ar
Time: 28 March 2010, 3:38:28.691 pm
UUID: 1dbdb38d-01ac-ca44-b388-8f451290286e
Ancestors: Graphics-laza.127
Generalize #lighter, #darker, #dimmed into #collectColors: and #collectPixels: which now also ensures that the form is unhibernated (this could cause problems during/after image same) and that we only do this for depth 32 as the other form depths are currently not implemented.
=============== Diff against Graphics-laza.127 ===============
Item was changed:
----- Method: Form>>lighter (in category 'converting') -----
lighter
"Answer a lighter variant of this form"
+ ^self collectColors:[:color| color lighter lighter].!
-
- ^ Form
- extent: self extent
- depth: self depth
- bits: (self bits collect: [:bit |
- (Color colorFromPixelValue: bit depth: self depth)
- lighter lighter
- pixelValueForDepth: self depth])!
Item was added:
+ ----- Method: Form>>collectColors: (in category 'converting') -----
+ collectColors: aBlock
+ "Create a new copy of the receiver with all the colors transformed by aBlock"
+ ^self collectPixels:[:pv|
+ (aBlock value: (Color colorFromPixelValue: pv depth: self depth))
+ pixelValueForDepth: self depth.
+ ].!
Item was changed:
----- Method: Form>>dimmed (in category 'converting') -----
dimmed
"Answer a dimmed variant of this form."
+ ^self collectColors:[:color| (color alpha: (color alpha min: 0.2)) ]!
-
- ^ Form
- extent: self extent
- depth: self depth
- bits: (self bits collect: [:bit | | color |
- color := Color colorFromPixelValue: bit depth: self depth.
- (color alpha: (color alpha min: 0.2)) pixelValueForDepth: self depth])!
Item was added:
+ ----- Method: Form>>collectPixels: (in category 'converting') -----
+ collectPixels: aBlock
+ "Create a new copy of the receiver with all the pixels transformed by aBlock"
+ self depth = 32 ifFalse:[^self error: 'Not implemented for depth ', self depth].
+ self unhibernate. "ensure unhibernated before touching bits"
+ ^Form
+ extent: self extent
+ depth: self depth
+ bits: (self bits collect: aBlock)!
Item was changed:
----- Method: Form>>darker (in category 'converting') -----
darker
"Answer a darker variant of this form."
+ ^self collectColors:[:color| color darker darker]!
-
- ^ Form
- extent: self extent
- depth: self depth
- bits: (self bits collect: [:bit |
- (Color colorFromPixelValue: bit depth: self depth)
- darker darker
- pixelValueForDepth: self depth])!
Andreas Raab uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-ar.128.mcz
==================== Summary ====================
Name: Graphics-ar.128
Author: ar
Time: 28 March 2010, 3:38:28.691 pm
UUID: 1dbdb38d-01ac-ca44-b388-8f451290286e
Ancestors: Graphics-laza.127
Generalize #lighter, #darker, #dimmed into #collectColors: and #collectPixels: which now also ensures that the form is unhibernated (this could cause problems during/after image same) and that we only do this for depth 32 as the other form depths are currently not implemented.
=============== Diff against Graphics-laza.127 ===============
Item was changed:
----- Method: Form>>lighter (in category 'converting') -----
lighter
"Answer a lighter variant of this form"
+ ^self collectColors:[:color| color lighter lighter].!
-
- ^ Form
- extent: self extent
- depth: self depth
- bits: (self bits collect: [:bit |
- (Color colorFromPixelValue: bit depth: self depth)
- lighter lighter
- pixelValueForDepth: self depth])!
Item was added:
+ ----- Method: Form>>collectColors: (in category 'converting') -----
+ collectColors: aBlock
+ "Create a new copy of the receiver with all the colors transformed by aBlock"
+ ^self collectPixels:[:pv|
+ (aBlock value: (Color colorFromPixelValue: pv depth: self depth))
+ pixelValueForDepth: self depth.
+ ].!
Item was changed:
----- Method: Form>>dimmed (in category 'converting') -----
dimmed
"Answer a dimmed variant of this form."
+ ^self collectColors:[:color| (color alpha: (color alpha min: 0.2)) ]!
-
- ^ Form
- extent: self extent
- depth: self depth
- bits: (self bits collect: [:bit | | color |
- color := Color colorFromPixelValue: bit depth: self depth.
- (color alpha: (color alpha min: 0.2)) pixelValueForDepth: self depth])!
Item was added:
+ ----- Method: Form>>collectPixels: (in category 'converting') -----
+ collectPixels: aBlock
+ "Create a new copy of the receiver with all the pixels transformed by aBlock"
+ self depth = 32 ifFalse:[^self error: 'Not implemented for depth ', self depth].
+ self unhibernate. "ensure unhibernated before touching bits"
+ ^Form
+ extent: self extent
+ depth: self depth
+ bits: (self bits collect: aBlock)!
Item was changed:
----- Method: Form>>darker (in category 'converting') -----
darker
"Answer a darker variant of this form."
+ ^self collectColors:[:color| color darker darker]!
-
- ^ Form
- extent: self extent
- depth: self depth
- bits: (self bits collect: [:bit |
- (Color colorFromPixelValue: bit depth: self depth)
- darker darker
- pixelValueForDepth: self depth])!
Andreas Raab uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-ar.128.mcz
==================== Summary ====================
Name: Graphics-ar.128
Author: ar
Time: 28 March 2010, 3:38:28.691 pm
UUID: 1dbdb38d-01ac-ca44-b388-8f451290286e
Ancestors: Graphics-laza.127
Generalize #lighter, #darker, #dimmed into #collectColors: and #collectPixels: which now also ensures that the form is unhibernated (this could cause problems during/after image same) and that we only do this for depth 32 as the other form depths are currently not implemented.
=============== Diff against Graphics-laza.127 ===============
Item was changed:
----- Method: Form>>lighter (in category 'converting') -----
lighter
"Answer a lighter variant of this form"
+ ^self collectColors:[:color| color lighter lighter].!
-
- ^ Form
- extent: self extent
- depth: self depth
- bits: (self bits collect: [:bit |
- (Color colorFromPixelValue: bit depth: self depth)
- lighter lighter
- pixelValueForDepth: self depth])!
Item was added:
+ ----- Method: Form>>collectColors: (in category 'converting') -----
+ collectColors: aBlock
+ "Create a new copy of the receiver with all the colors transformed by aBlock"
+ ^self collectPixels:[:pv|
+ (aBlock value: (Color colorFromPixelValue: pv depth: self depth))
+ pixelValueForDepth: self depth.
+ ].!
Item was changed:
----- Method: Form>>dimmed (in category 'converting') -----
dimmed
"Answer a dimmed variant of this form."
+ ^self collectColors:[:color| (color alpha: (color alpha min: 0.2)) ]!
-
- ^ Form
- extent: self extent
- depth: self depth
- bits: (self bits collect: [:bit | | color |
- color := Color colorFromPixelValue: bit depth: self depth.
- (color alpha: (color alpha min: 0.2)) pixelValueForDepth: self depth])!
Item was added:
+ ----- Method: Form>>collectPixels: (in category 'converting') -----
+ collectPixels: aBlock
+ "Create a new copy of the receiver with all the pixels transformed by aBlock"
+ self depth = 32 ifFalse:[^self error: 'Not implemented for depth ', self depth].
+ self unhibernate. "ensure unhibernated before touching bits"
+ ^Form
+ extent: self extent
+ depth: self depth
+ bits: (self bits collect: aBlock)!
Item was changed:
----- Method: Form>>darker (in category 'converting') -----
darker
"Answer a darker variant of this form."
+ ^self collectColors:[:color| color darker darker]!
-
- ^ Form
- extent: self extent
- depth: self depth
- bits: (self bits collect: [:bit |
- (Color colorFromPixelValue: bit depth: self depth)
- darker darker
- pixelValueForDepth: self depth])!
Andreas Raab uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-ar.218.mcz
==================== Summary ====================
Name: Tools-ar.218
Author: ar
Time: 28 March 2010, 3:15:19.983 pm
UUID: 34dd8be7-79b1-fb41-9589-56e10f2f6c7d
Ancestors: Tools-cmm.217
Add a defaultBrowserTitle for MessageNames.
=============== Diff against Tools-cmm.217 ===============
Item was added:
+ ----- Method: MessageNames>>defaultBrowserTitle (in category 'initialization') -----
+ defaultBrowserTitle
+ ^ 'Message Names'!
Andreas Raab uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-ar.218.mcz
==================== Summary ====================
Name: Tools-ar.218
Author: ar
Time: 28 March 2010, 3:15:19.983 pm
UUID: 34dd8be7-79b1-fb41-9589-56e10f2f6c7d
Ancestors: Tools-cmm.217
Add a defaultBrowserTitle for MessageNames.
=============== Diff against Tools-cmm.217 ===============
Item was added:
+ ----- Method: MessageNames>>defaultBrowserTitle (in category 'initialization') -----
+ defaultBrowserTitle
+ ^ 'Message Names'!
Andreas Raab uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-ar.218.mcz
==================== Summary ====================
Name: Tools-ar.218
Author: ar
Time: 28 March 2010, 3:15:19.983 pm
UUID: 34dd8be7-79b1-fb41-9589-56e10f2f6c7d
Ancestors: Tools-cmm.217
Add a defaultBrowserTitle for MessageNames.
=============== Diff against Tools-cmm.217 ===============
Item was added:
+ ----- Method: MessageNames>>defaultBrowserTitle (in category 'initialization') -----
+ defaultBrowserTitle
+ ^ 'Message Names'!
Andreas Raab uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ar.404.mcz
==================== Summary ====================
Name: Morphic-ar.404
Author: ar
Time: 28 March 2010, 3:13:44.42 pm
UUID: 5ef067a6-55f8-4f4e-8aa1-f5d73a6430fa
Ancestors: Morphic-ar.403
MessageNames to the rescue!
=============== Diff against Morphic-ar.403 ===============
Item was changed:
----- Method: SearchBarMorph>>smartSearch (in category 'search') -----
smartSearch
"Take the user input and perform an appropriate search"
| input |
input := self contents asString ifEmpty:[^self].
(Smalltalk bindingOf: input) ifNotNil:[:assoc|
"It's a global or a class"
^ToolSet browse: assoc value class selector: nil.
].
(SystemNavigation new allImplementorsOf: input asSymbol) ifNotEmpty:[:list|
^SystemNavigation new
browseMessageList: list
name: 'Implementors of ' , input
].
input first isUppercase ifTrue:[
(Utilities classFromPattern: input withCaption: '') ifNotNil:[:aClass|
^ToolSet browse: aClass selector: nil.
].
] ifFalse:[
+ ^ToolSet default browseMessageNames: input
- "Should offer a list of selectors or so"
].
"Not found"
Beeper beepPrimitive.!
Andreas Raab uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ar.404.mcz
==================== Summary ====================
Name: Morphic-ar.404
Author: ar
Time: 28 March 2010, 3:13:44.42 pm
UUID: 5ef067a6-55f8-4f4e-8aa1-f5d73a6430fa
Ancestors: Morphic-ar.403
MessageNames to the rescue!
=============== Diff against Morphic-ar.403 ===============
Item was changed:
----- Method: SearchBarMorph>>smartSearch (in category 'search') -----
smartSearch
"Take the user input and perform an appropriate search"
| input |
input := self contents asString ifEmpty:[^self].
(Smalltalk bindingOf: input) ifNotNil:[:assoc|
"It's a global or a class"
^ToolSet browse: assoc value class selector: nil.
].
(SystemNavigation new allImplementorsOf: input asSymbol) ifNotEmpty:[:list|
^SystemNavigation new
browseMessageList: list
name: 'Implementors of ' , input
].
input first isUppercase ifTrue:[
(Utilities classFromPattern: input withCaption: '') ifNotNil:[:aClass|
^ToolSet browse: aClass selector: nil.
].
] ifFalse:[
+ ^ToolSet default browseMessageNames: input
- "Should offer a list of selectors or so"
].
"Not found"
Beeper beepPrimitive.!