Chris Muller uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-cmm.1188.mcz
==================== Summary ====================
Name: Morphic-cmm.1188
Author: cmm
Time: 30 June 2016, 4:37:17.550411 pm
UUID: dbffb365-18a5-414e-8584-48756b1592b3
Ancestors: Morphic-mt.1187
Update the key for #bringWindowUnderHandToFront to Cmd+/ (forward slash). This not only avoids the conflict with Ubuntu and Mac OS keys (sigh), but is a more sensible counterpart to the key which sends windows to the back (backward slash).
=============== Diff against Morphic-mt.1187 ===============
Item was changed:
----- Method: SystemWindow>>filterEvent:for: (in category 'events') -----
filterEvent: aKeyboardEvent for: anObject
"Provide keyboard shortcuts."
aKeyboardEvent isKeystroke
ifFalse: [^ aKeyboardEvent].
aKeyboardEvent commandKeyPressed ifTrue: [
aKeyboardEvent keyCharacter caseOf: {
[$\] -> [self class sendTopWindowToBack].
[Character escape] -> [self class deleteTopWindow].
+ [$/] -> [self class bringWindowUnderHandToFront].
- [$`] -> [self class bringWindowUnderHandToFront].
} otherwise: [^ aKeyboardEvent "no hit"].
^ aKeyboardEvent ignore "hit!!"].
aKeyboardEvent controlKeyPressed ifTrue: [
aKeyboardEvent keyCharacter caseOf: {
[Character escape] -> [self world findWindow: aKeyboardEvent].
} otherwise: [^ aKeyboardEvent "no hit"].
^ aKeyboardEvent ignore "hit!!"].
^ aKeyboardEvent "no hit"!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1187.mcz
==================== Summary ====================
Name: Morphic-mt.1187
Author: mt
Time: 29 June 2016, 9:36:32.707121 am
UUID: 9ec766fe-db1a-cd4f-957e-b95afcb2f8ff
Ancestors: Morphic-mt.1186
Fixes a bug with the Morphic main loop when the serverMode is enabled.
We still should double-check if we still need this 50-ms-hack to keep servers responsive. It should be the duty of the caller of #interCyclePause: to provide the 50 for servers.
=============== Diff against Morphic-mt.1186 ===============
Item was changed:
----- Method: WorldState>>interCyclePause: (in category 'update cycle') -----
interCyclePause: milliSecs
"delay enough that the previous cycle plus the amount of delay will equal milliSecs. If the cycle is already expensive, then no delay occurs. However, if the system is idly waiting for interaction from the user, the method will delay for a proportionally long time and cause the overall CPU usage of Squeak to be low.
If the preference #serverMode is enabled, always do a complete delay of 50ms, independant of my argument. This prevents the freezing problem described in Mantis #6581"
| millisecondsToWait |
millisecondsToWait := Preferences serverMode
ifTrue: [ 50 ]
ifFalse: [
(lastCycleTime isNil or: [ CanSurrenderToOS == false ])
ifTrue: [ 0 ]
ifFalse: [ milliSecs - (Time millisecondsSince: lastCycleTime) ] ].
+ (Preferences serverMode or: [millisecondsToWait > 0 and: [millisecondsToWait <= milliSecs]])
+ ifTrue: [
+ (interCycleDelay isNil or: [ interCycleDelay beingWaitedOn ])
+ ifTrue: [ interCycleDelay := Delay forMilliseconds: millisecondsToWait ]
+ ifFalse: [ interCycleDelay delayDuration: millisecondsToWait ].
+ interCycleDelay wait ].
- (millisecondsToWait > 0 and: [millisecondsToWait <= milliSecs]) ifTrue: [
- (interCycleDelay isNil or: [ interCycleDelay beingWaitedOn ])
- ifTrue: [ interCycleDelay := Delay forMilliseconds: millisecondsToWait ]
- ifFalse: [ interCycleDelay delayDuration: millisecondsToWait ].
- interCycleDelay wait ].
lastCycleTime := Time millisecondClockValue.
CanSurrenderToOS := true.!
Chris Muller uploaded a new version of Chronology-Core to project The Trunk:
http://source.squeak.org/trunk/Chronology-Core-cmm.6.mcz
==================== Summary ====================
Name: Chronology-Core-cmm.6
Author: cmm
Time: 28 June 2016, 9:38:09.069292 pm
UUID: 29a5a2b4-59f0-4bb4-a3d4-56fe680d31ec
Ancestors: Chronology-Core-bf.5
Fix Date class comment. Add Date>>#@ shortcut for constructing DateAndTime's.
=============== Diff against Chronology-Core-bf.5 ===============
Item was changed:
Timespan subclass: #Date
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: 'ChronologyConstants'
category: 'Chronology-Core'!
+ !Date commentStamp: 'cmm 6/28/2016 21:36' prior: 0!
+ Instances of Date are Timespans with duration of 1 day. As with all Chronology Timespan sub-instances, Dates can be instantiated as position values which compare equally to any other instance of the same Date, irregardless of the timezone in which either is created.
- !Date commentStamp: 'cmm 2/3/2012 17:30' prior: 0!
- Instances of Date are Timespans with duration of 1 day.
+ However, like the other Timespan subInstances, there are rare cases where it may be desirable to use instances of Date to represent a particular 1-day span of time at a particular locality on the globe. All Timespans, including Dates, may specify a particular timezone offset for this purpose.!
- Their default creation assumes a start of midnight of UTC to provide the fast, globalized Dates out of the box. The legacy behavior that creates Timezone-sensitive Dates can be used by sending #localizedDates.
- !
Item was added:
+ ----- Method: Date>>@ (in category 'squeak protocol') -----
+ @ aTime
+ ^ DateAndTime
+ date: self
+ time: aTime!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1186.mcz
==================== Summary ====================
Name: Morphic-mt.1186
Author: mt
Time: 28 June 2016, 11:39:43.639008 am
UUID: 471c6534-59eb-c84c-8742-e4fa50706ebb
Ancestors: Morphic-mt.1185
Account for broken morphs in the Object Explorer by catching in-computable icons. (Icons for morphs are usually their own graphical representation scaled down.) Comparable to error handling in ObjectExplorerWrapper >> #asString.
Fixes a bug with columns cache invalidation in tree morphs.
=============== Diff against Morphic-mt.1185 ===============
Item was changed:
----- Method: ObjectExplorerWrapper>>icon (in category 'accessing') -----
icon
"Answer a form to be used as icon"
^ Preferences visualExplorer
+ ifTrue: [([self object iconOrThumbnailOfSize: 12] on: Error do: [nil])
- ifTrue: [(self object iconOrThumbnailOfSize: 12)
ifNil: [self class showContentsInColumns
ifTrue: [ToolIcons iconNamed: #blank]
ifFalse: [nil]]]
ifFalse: [nil]!
Item was changed:
----- Method: SimpleHierarchicalListMorph>>columns: (in category 'accessing') -----
columns: anArray
"You can specify columns or specs for columns. This depends on the actual morph that is used as item. ObjectExplorers produce items that support exact numbers, blocks, and nil for max width."
+ columns := anArray.
+ self clearColumnsCache.!
- columns := anArray!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1185.mcz
==================== Summary ====================
Name: Morphic-mt.1185
Author: mt
Time: 25 June 2016, 8:51:08.59647 am
UUID: 05385b8c-0ff4-6443-9c57-52be6dc91bbb
Ancestors: Morphic-mt.1184
Fixes several bugs with selection and hovering in menus and docking-bar menus and their sub-menus.
=============== Diff against Morphic-mt.1184 ===============
Item was changed:
----- Method: DockingBarItemMorph>>mouseEnter: (in category 'events') -----
mouseEnter: evt
+ "Do not hover docking bar items directory. Mouse-down required. But if you already see a submenu, support hovering."
- "The mouse entered the receiver"
+ owner selectedItem ifNotNil: [owner selectItem: self event: evt]!
- super mouseEnter: evt.
- (owner selectedItem notNil and: [ owner selectedItem ~~ self ]) ifTrue: [
- owner selectItem: self event: evt. ]!
Item was removed:
- ----- Method: DockingBarItemMorph>>mouseLeaveDragging: (in category 'events') -----
- mouseLeaveDragging: evt !
Item was changed:
StringMorph subclass: #MenuItemMorph
+ instanceVariableNames: 'isEnabled subMenu isSelected target selector arguments icon'
- instanceVariableNames: 'isEnabled subMenu isSelected target selector arguments icon lastMousePosition'
classVariableNames: 'SubMenuMarker'
poolDictionaries: ''
category: 'Morphic-Menus'!
!MenuItemMorph commentStamp: '<historical>' prior: 0!
I represent an item in a menu.
Instance variables:
isEnabled <Boolean> True if the menu item can be executed.
subMenu <MenuMorph | nil> The submenu to activate automatically when the user mouses over the item.
isSelected <Boolean> True if the item is currently selected.
target <Object> The target of the associated action.
selector <Symbol> The associated action.
arguments <Array> The arguments for the associated action.
icon <Form | nil> An optional icon form to be displayed to my left.
If I have a dynamic marker, created by strings like <yes> or <no> in my contents, it will be installed as a submorph.!
Item was changed:
----- Method: MenuItemMorph>>activateSubmenu: (in category 'events') -----
activateSubmenu: evt
"Activate our submenu; e.g., pass control to it"
subMenu ifNil:[^false]. "not applicable"
(subMenu fullContainsPoint: evt position) ifFalse:[^false].
subMenu activate: evt.
- self removeAlarm: #deselectTimeOut:.
^true!
Item was changed:
----- Method: MenuItemMorph>>deselect: (in category 'selecting') -----
deselect: evt
self isSelected: false.
- lastMousePosition := nil.
subMenu ifNotNil: [
owner ifNotNil: [ owner activeSubmenu: nil ] ].!
Item was removed:
- ----- Method: MenuItemMorph>>deselectTimeOut: (in category 'events') -----
- deselectTimeOut: evt
- "Deselect timout. Now really deselect"
- owner selectedItem == self
- ifTrue:[
- evt hand newMouseFocus: nil.
- owner selectItem: nil event: evt].
- !
Item was changed:
----- Method: MenuItemMorph>>mouseEnter: (in category 'events') -----
mouseEnter: evt
"The mouse entered the receiver"
+ owner ifNotNil: [ owner selectItem: self event: evt ]!
- owner ifNotNil: [ owner stayUp ifFalse: [ self mouseEnterDragging: evt ] ]!
Item was changed:
----- Method: MenuItemMorph>>mouseEnterDragging: (in category 'events') -----
mouseEnterDragging: evt
+
+ self mouseEnter: evt.!
- "The mouse entered the receiver. Do nothing if we're not in a 'valid menu transition', meaning that the current hand focus must be aimed at the owning menu."
- evt hand mouseFocus == owner ifTrue:[owner selectItem: self event: evt]!
Item was removed:
- ----- Method: MenuItemMorph>>mouseLeave: (in category 'events') -----
- mouseLeave: evt
- "The mouse has left the interior of the receiver..."
-
- owner ifNotNil: [owner stayUp ifFalse: [self mouseLeaveDragging: evt]]!
Item was removed:
- ----- Method: MenuItemMorph>>mouseLeaveDragging: (in category 'events') -----
- mouseLeaveDragging: evt
- "The mouse left the receiver. Do nothing if we're not in a 'valid menu transition', meaning that the current hand focus must be aimed at the owning menu."
-
- owner ifNil: [^self].
- evt hand mouseFocus == owner ifFalse: [ ^self ].
- lastMousePosition := evt position.
- owner selectItem: nil event: evt!
Item was removed:
- ----- Method: MenuItemMorph>>releasesSelection: (in category 'events') -----
- releasesSelection: evt
- " Returns a boolean indicating that this menu item is ready to go deselected.
- It answers false if the mouse is moving towards its submenu.
- We check this by testing that the current mouse position lays in the triangle of
- the last mouse position and the two corners of the submenu facing our menu item. "
-
- | triangle submenuIsOnTheRightSide |
- self hasSubMenu ifFalse: [
- lastMousePosition := nil.
- ^true ].
- lastMousePosition ifNil: [
- lastMousePosition := evt position.
- ^false ].
- submenuIsOnTheRightSide := self left < subMenu left.
- triangle := {
- lastMousePosition.
- submenuIsOnTheRightSide
- ifTrue: [ subMenu topLeft ]
- ifFalse: [ subMenu topRight ].
- submenuIsOnTheRightSide
- ifTrue: [ subMenu bottomLeft ]
- ifFalse: [ subMenu bottomRight ] }.
- lastMousePosition := evt position.
- (self triangle: triangle containsPoint: evt position)
- ifTrue: [ ^false ]
- ifFalse: [
- lastMousePosition := nil.
- ^true ]!
Item was changed:
----- Method: MenuItemMorph>>veryDeepInner: (in category 'copying') -----
veryDeepInner: deepCopier
"Copy all of my instance variables. Some need to be not copied
at all, but shared. Warning!!!! Every instance variable defined in
this class must be handled. We must also implement
veryDeepFixupWith:. See DeepCopier class comment."
super veryDeepInner: deepCopier.
isEnabled := isEnabled veryDeepCopyWith: deepCopier.
subMenu := subMenu veryDeepCopyWith: deepCopier.
isSelected := isSelected veryDeepCopyWith: deepCopier.
icon := icon veryDeepCopyWith: deepCopier.
"target := target. Weakly copied"
"selector := selector. a Symbol"
+ arguments := arguments.!
- arguments := arguments.
- lastMousePosition := nil!
Item was added:
+ ----- Method: MenuMorph>>handlesMouseOver: (in category 'events') -----
+ handlesMouseOver: evt
+ ^ true!
Item was added:
+ ----- Method: MenuMorph>>mouseLeave: (in category 'events') -----
+ mouseLeave: evt
+ self selectItem: nil event: evt.!
Item was removed:
- ----- Method: MenuMorph>>releasesSelection: (in category 'events') -----
- releasesSelection: evt
- " The MenuMorph releases its selection if the selected item releases it.
- Used in #selectItem:event: "
-
- self selectedItem ifNil: [ ^true ].
- evt ifNil: [ ^true ].
- evt isKeyboard ifTrue: [ ^true ].
- (self selectedItem containsPoint: evt position) ifTrue: [ ^true ].
- ^self selectedItem releasesSelection: evt!
Item was changed:
----- Method: MenuMorph>>selectItem:event: (in category 'control') -----
selectItem: aMenuItem event: anEvent
+ "Change the selected item."
+
-
- " Change the selected item, but first ask the currently selected item
- if it want to release it. "
- (self releasesSelection: anEvent) ifFalse: [ ^self ].
selectedItem ifNotNil:[selectedItem deselect: anEvent].
selectedItem := aMenuItem.
selectedItem ifNotNil:[selectedItem select: anEvent].!
Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.834.mcz
==================== Summary ====================
Name: System-eem.834
Author: eem
Time: 23 June 2016, 4:30:25.198834 pm
UUID: d42d7b14-27ee-49c9-9469-b7f7d1b48395
Ancestors: System-mt.833
More accurately comment the semantics of the growMemoryByAtLeast: primitive on Spur.
=============== Diff against System-mt.833 ===============
Item was changed:
----- Method: SmalltalkImage>>growMemoryByAtLeast: (in category 'memory space') -----
growMemoryByAtLeast: numBytes
"Grow memory by at least the requested number of bytes.
+ Primitive. Fail if no memory is available. Essential.
+ N.B. In Spur, the heap is composed of segments. Growing memory adds a new
+ segment; it does not extend existing segments. Growth is by at least that
+ established by SmalltalkImage current vmParameterAt: 25, which defaults to 16Mb."
- Primitive. Essential. Fail if no memory is available."
<primitive: 180>
+ ^(numBytes isInteger and: [numBytes > 0])
+ ifTrue: [OutOfMemory signal]
+ ifFalse: [self primitiveFailed]!
- (numBytes isInteger and: [numBytes > 0]) ifTrue:
- [OutOfMemory signal].
- ^self primitiveFailed!
Item was changed:
----- Method: SystemDictionary>>growMemoryByAtLeast: (in category 'memory space') -----
growMemoryByAtLeast: numBytes
"Grow memory by at least the requested number of bytes.
+ Primitive. Fail if no memory is available. Essential.
+ N.B. In Spur, the heap is composed of segments. Growing memory adds a new
+ segment; it does not extend existing segments. Growth is by at least that
+ established by SmalltalkImage current vmParameterAt: 25, which defaults to 16Mb."
- Primitive. Fail if no memory is available. Essential."
<primitive: 180>
^(numBytes isInteger and: [numBytes > 0])
ifTrue: [OutOfMemory signal]
ifFalse: [self primitiveFailed]!
Eliot Miranda uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-eem.699.mcz
==================== Summary ====================
Name: Collections-eem.699
Author: eem
Time: 23 June 2016, 4:28:17.428149 pm
UUID: b82a57a1-a212-4ebe-a738-59abebf9a380
Ancestors: Collections-ul.698
Fix growth on become failure due to insufficient memory.
=============== Diff against Collections-ul.698 ===============
Item was changed:
----- Method: Array>>elementsExchangeIdentityWith: (in category 'converting') -----
elementsExchangeIdentityWith: otherArray
"This primitive performs a bulk mutation, causing all pointers to the elements of the
receiver to be replaced by pointers to the corresponding elements of otherArray.
At the same time, all pointers to the elements of otherArray are replaced by
pointers to the corresponding elements of this array. The identityHashes remain
with the pointers rather than with the objects so that objects in hashed structures
should still be properly indexed after the mutation."
<primitive: 128 error: ec>
ec == #'bad receiver' ifTrue:
[^self error: 'receiver must be of class Array'].
ec == #'bad argument' ifTrue:
[^self error: (otherArray class == Array
ifTrue: ['arg must be of class Array']
ifFalse: ['receiver and argument must have the same size'])].
ec == #'inappropriate operation' ifTrue:
[^self error: 'can''t become immediates such as SmallIntegers or Characters'].
ec == #'no modification' ifTrue:
[^self error: 'can''t become immutable objects'].
ec == #'object is pinned' ifTrue:
[^self error: 'can''t become pinned objects'].
ec == #'insufficient object memory' ifTrue:
+ [| maxRequired |
+ "In Spur, two-way become may involve making each pair of objects into a forwarder into a copy of the other.
+ So if become fails with #'insufficient object memory', garbage collect, and if necessary, grow memory."
+ maxRequired := (self detectSum: [:obj | obj class byteSizeOfInstanceOfSize: obj basicSize])
+ + (otherArray detectSum: [:obj | obj class byteSizeOfInstanceOfSize: obj basicSize]).
+ (Smalltalk garbageCollectMost < maxRequired
+ and: [Smalltalk garbageCollect < maxRequired]) ifTrue:
+ [Smalltalk growMemoryByAtLeast: maxRequired].
- [Smalltalk garbageCollect < 1048576 ifTrue:
- [Smalltalk growMemoryByAtLeast: 1048576].
^self elementsExchangeIdentityWith: otherArray].
self primitiveFailed!
Item was changed:
----- Method: Array>>elementsForwardIdentityTo: (in category 'converting') -----
elementsForwardIdentityTo: otherArray
"This primitive performs a bulk mutation, causing all pointers to the elements of the
receiver to be replaced by pointers to the corresponding elements of otherArray.
The identityHashes remain with the pointers rather than with the objects so that
the objects in this array should still be properly indexed in any existing hashed
structures after the mutation."
<primitive: 72 error: ec>
ec == #'bad receiver' ifTrue:
[^self error: 'receiver must be of class Array'].
ec == #'bad argument' ifTrue:
[^self error: (otherArray class == Array
ifTrue: ['arg must be of class Array']
ifFalse: ['receiver and argument must have the same size'])].
ec == #'inappropriate operation' ifTrue:
[^self error: 'can''t become immediates such as SmallIntegers or Characters'].
ec == #'no modification' ifTrue:
[^self error: 'can''t become immutable objects'].
ec == #'object is pinned' ifTrue:
[^self error: 'can''t become pinned objects'].
ec == #'insufficient object memory' ifTrue:
+ [self error: 'The virtual machine is out-of-date. Please upgrade.'].
- [Smalltalk garbageCollect < 1048576 ifTrue:
- [Smalltalk growMemoryByAtLeast: 1048576].
- ^self elementsForwardIdentityTo: otherArray].
self primitiveFailed!