Marcel Taeumel uploaded a new version of 46Deprecated to project The Trunk:
http://source.squeak.org/trunk/46Deprecated-mt.2.mcz
==================== Summary ====================
Name: 46Deprecated-mt.2
Author: mt
Time: 3 May 2015, 2:43:14.241 pm
UUID: a45140cf-2faa-8642-a1b8-2f81eaea8990
Ancestors: 46Deprecated-mt.1
Added a widget that was once used for showing message category lists.
=============== Diff against 46Deprecated-mt.1 ===============
Item was added:
+ SystemOrganization addCategory: #'46Deprecated-Morphic-Pluggable Widgets'!
Item was added:
+ PluggableListMorph subclass: #PluggableMessageCategoryListMorph
+ instanceVariableNames: 'getRawListSelector priorRawList'
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: '46Deprecated-Morphic-Pluggable Widgets'!
+
+ !PluggableMessageCategoryListMorph commentStamp: '<historical>' prior: 0!
+ A variant of PluggableListMorph designed specially for efficient handling of the --all-- feature in message-list panes. In order to be able *quickly* to check whether there has been an external change to the list, we cache the raw list for identity comparison (the actual list is a combination of the --all-- element and the the actual list).!
Item was added:
+ ----- Method: PluggableMessageCategoryListMorph class>>on:list:selected:changeSelected:menu:keystroke:getRawListSelector: (in category 'as yet unclassified') -----
+ on: anObject list: getListSel selected: getSelectionSel changeSelected: setSelectionSel menu: getMenuSel keystroke: keyActionSel getRawListSelector: getRawSel
+ ^ self new on: anObject list: getListSel selected: getSelectionSel changeSelected: setSelectionSel menu: getMenuSel keystroke: keyActionSel getRawListSelector: getRawSel!
Item was added:
+ ----- Method: PluggableMessageCategoryListMorph>>getList (in category 'model access') -----
+ getList
+ "Differs from the generic in that here we obtain and cache the raw list, then cons it together with the special '-- all --' item to produce the list to be used in the browser. This special handling is done in order to avoid excessive and unnecessary reformulation of the list in the step method"
+
+ getRawListSelector == nil ifTrue: ["should not happen!!" priorRawList := nil. ^ #()].
+ model classListIndex = 0 ifTrue: [^ priorRawList := list := Array new].
+ priorRawList := model perform: getRawListSelector.
+ list := (Array with: ClassOrganizer allCategory), priorRawList.
+ ^list!
Item was added:
+ ----- Method: PluggableMessageCategoryListMorph>>on:list:selected:changeSelected:menu:keystroke:getRawListSelector: (in category 'as yet unclassified') -----
+ on: anObject list: getListSel selected: getSelectionSel changeSelected: setSelectionSel menu: getMenuSel keystroke: keyActionSel getRawListSelector: getRawSel
+ self model: anObject.
+ getListSelector := getListSel.
+ getIndexSelector := getSelectionSel.
+ setIndexSelector := setSelectionSel.
+ getMenuSelector := getMenuSel.
+ keystrokeActionSelector := keyActionSel.
+ autoDeselect := true.
+ self borderWidth: 1.
+ getRawListSelector := getRawSel.
+ self updateList.
+ self selectionIndex: self getCurrentSelectionIndex.
+ self initForKeystrokes!
Item was added:
+ ----- Method: PluggableMessageCategoryListMorph>>verifyContents (in category 'updating') -----
+ verifyContents
+ | newList existingSelection anIndex newRawList |
+ (model editSelection == #editComment) ifTrue: [^ self].
+ model classListIndex = 0 ifTrue: [^ self].
+ newRawList := model perform: getRawListSelector.
+ newRawList == priorRawList ifTrue: [^ self]. "The usual case; very fast"
+ priorRawList := newRawList.
+ newList := (Array with: ClassOrganizer allCategory), priorRawList.
+ list = newList ifTrue: [^ self].
+ existingSelection := self selection.
+ self updateList.
+ (anIndex := newList indexOf: existingSelection ifAbsent: [nil])
+ ifNotNil:
+ [model noteSelectionIndex: anIndex for: getListSelector.
+ self selectionIndex: anIndex]
+ ifNil:
+ [self changeModelSelection: 0]!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.964.mcz
==================== Summary ====================
Name: Morphic-mt.964
Author: mt
Time: 3 May 2015, 2:41:32.279 pm
UUID: 99fbd4f1-a84a-b344-90f2-9f28f14f5e4a
Ancestors: Morphic-mt.963
Moved specialized list morph for message categories into deprecation. All browsers have regular lists morphs--even for message category lists.
=============== Diff against Morphic-mt.963 ===============
Item was removed:
- PluggableListMorph subclass: #PluggableMessageCategoryListMorph
- instanceVariableNames: 'getRawListSelector priorRawList'
- classVariableNames: ''
- poolDictionaries: ''
- category: 'Morphic-Pluggable Widgets'!
-
- !PluggableMessageCategoryListMorph commentStamp: '<historical>' prior: 0!
- A variant of PluggableListMorph designed specially for efficient handling of the --all-- feature in message-list panes. In order to be able *quickly* to check whether there has been an external change to the list, we cache the raw list for identity comparison (the actual list is a combination of the --all-- element and the the actual list).!
Item was removed:
- ----- Method: PluggableMessageCategoryListMorph class>>on:list:selected:changeSelected:menu:keystroke:getRawListSelector: (in category 'as yet unclassified') -----
- on: anObject list: getListSel selected: getSelectionSel changeSelected: setSelectionSel menu: getMenuSel keystroke: keyActionSel getRawListSelector: getRawSel
- ^ self new on: anObject list: getListSel selected: getSelectionSel changeSelected: setSelectionSel menu: getMenuSel keystroke: keyActionSel getRawListSelector: getRawSel!
Item was removed:
- ----- Method: PluggableMessageCategoryListMorph>>getList (in category 'model access') -----
- getList
- "Differs from the generic in that here we obtain and cache the raw list, then cons it together with the special '-- all --' item to produce the list to be used in the browser. This special handling is done in order to avoid excessive and unnecessary reformulation of the list in the step method"
-
- getRawListSelector == nil ifTrue: ["should not happen!!" priorRawList := nil. ^ #()].
- model classListIndex = 0 ifTrue: [^ priorRawList := list := Array new].
- priorRawList := model perform: getRawListSelector.
- list := (Array with: ClassOrganizer allCategory), priorRawList.
- ^list!
Item was removed:
- ----- Method: PluggableMessageCategoryListMorph>>on:list:selected:changeSelected:menu:keystroke:getRawListSelector: (in category 'as yet unclassified') -----
- on: anObject list: getListSel selected: getSelectionSel changeSelected: setSelectionSel menu: getMenuSel keystroke: keyActionSel getRawListSelector: getRawSel
- self model: anObject.
- getListSelector := getListSel.
- getIndexSelector := getSelectionSel.
- setIndexSelector := setSelectionSel.
- getMenuSelector := getMenuSel.
- keystrokeActionSelector := keyActionSel.
- autoDeselect := true.
- self borderWidth: 1.
- getRawListSelector := getRawSel.
- self updateList.
- self selectionIndex: self getCurrentSelectionIndex.
- self initForKeystrokes!
Item was removed:
- ----- Method: PluggableMessageCategoryListMorph>>verifyContents (in category 'updating') -----
- verifyContents
- | newList existingSelection anIndex newRawList |
- (model editSelection == #editComment) ifTrue: [^ self].
- model classListIndex = 0 ifTrue: [^ self].
- newRawList := model perform: getRawListSelector.
- newRawList == priorRawList ifTrue: [^ self]. "The usual case; very fast"
- priorRawList := newRawList.
- newList := (Array with: ClassOrganizer allCategory), priorRawList.
- list = newList ifTrue: [^ self].
- existingSelection := self selection.
- self updateList.
- (anIndex := newList indexOf: existingSelection ifAbsent: [nil])
- ifNotNil:
- [model noteSelectionIndex: anIndex for: getListSelector.
- self selectionIndex: anIndex]
- ifNil:
- [self changeModelSelection: 0]!
Levente Uzonyi uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ul.627.mcz
==================== Summary ====================
Name: Collections-ul.627
Author: ul
Time: 3 May 2015, 2:23:44.317 pm
UUID: 6562bd09-b06e-436f-8771-a7cf2ecf6a25
Ancestors: Collections-mt.626, Collections-ul.624
Merged Collections-ul.624.
Updated #initializeClassificationTable to save only the fully initialized table to the class variable.
Reinitialize String in postscript to update the lower/uppercasing tables there too.
=============== Diff against Collections-mt.626 ===============
Item was changed:
Magnitude subclass: #Character
instanceVariableNames: 'value'
+ classVariableNames: 'AlphaNumericMask CharacterTable ClassificationTable DigitBit DigitValues LetterMask LowercaseBit UppercaseBit'
- classVariableNames: 'CharacterTable ClassificationTable DigitValues LetterBits LowercaseBit UppercaseBit'
poolDictionaries: ''
category: 'Collections-Strings'!
!Character commentStamp: 'ar 4/9/2005 22:35' prior: 0!
I represent a character by storing its associated Unicode. The first 256 characters are created uniquely, so that all instances of latin1 characters ($R, for example) are identical.
The code point is based on Unicode. Since Unicode is 21-bit wide character set, we have several bits available for other information. As the Unicode Standard states, a Unicode code point doesn't carry the language information. This is going to be a problem with the languages so called CJK (Chinese, Japanese, Korean. Or often CJKV including Vietnamese). Since the characters of those languages are unified and given the same code point, it is impossible to display a bare Unicode code point in an inspector or such tools. To utilize the extra available bits, we use them for identifying the languages. Since the old implementation uses the bits to identify the character encoding, the bits are sometimes called "encoding tag" or neutrally "leading char", but the bits rigidly denotes the concept of languages.
The other languages can have the language tag if you like. This will help to break the large default font (font set) into separately loadable chunk of fonts. However, it is open to the each native speakers and writers to decide how to define the character equality, since the same Unicode code point may have different language tag thus simple #= comparison may return false.
I represent a character by storing its associated ASCII code (extended to 256 codes). My instances are created uniquely, so that all instances of a character ($R, for example) are identical.!
Item was changed:
----- Method: Character class>>initializeClassificationTable (in category 'class initialization') -----
initializeClassificationTable
+ "Initialize the classification table.
+ The classification table is a compact encoding of upper and lower cases and digits of characters with
+ - bits 0-7: The lower case value of this character or 0, if its greater than 255.
+ - bits 8-15: The upper case value of this character or 0, if its greater than 255.
+ - bit 16: lowercase bit (isLowercase == true)
+ - bit 17: uppercase bit (isUppercase == true)
+ - bit 18: digit bit (isDigit == true)"
+ " self initializeClassificationTable "
- "
- Initialize the classification table. The classification table is a
- compact encoding of upper and lower cases of characters with
+ | encodedCharSet newClassificationTable |
+ "Base the table on the EncodedCharset of these characters' leadingChar - 0."
+ encodedCharSet := EncodedCharSet charsetAt: 0.
- - bits 0-7: The lower case value of this character.
- - bits 8-15: The upper case value of this character.
- - bit 16: lowercase bit (e.g., isLowercase == true)
- - bit 17: uppercase bit (e.g., isUppercase == true)
- "
- | ch1 |
-
LowercaseBit := 1 bitShift: 16.
UppercaseBit := 1 bitShift: 17.
+ DigitBit := 1 bitShift: 18.
+ "Initialize the letter mask (e.g., isLetter == true)"
+ LetterMask := LowercaseBit bitOr: UppercaseBit.
- "Initialize the letter bits (e.g., isLetter == true)"
- LetterBits := LowercaseBit bitOr: UppercaseBit.
+ "Initialize the alphanumeric mask (e.g. isAlphaNumeric == true)"
+ AlphaNumericMask := LetterMask bitOr: DigitBit.
- ClassificationTable := Array new: 256.
- "Initialize the defaults (neither lower nor upper case)"
- 0 to: 255 do:[:i|
- ClassificationTable at: i+1 put: (i bitShift: 8) + i.
- ].
+ "Initialize the table based on encodedCharSet."
+ newClassificationTable := Array new: 256.
+ 0 to: 255 do: [ :code |
+ | isLowercase isUppercase isDigit lowercaseCode uppercaseCode value |
+ isLowercase := encodedCharSet isLowercaseCode: code.
+ isUppercase := encodedCharSet isUppercaseCode: code.
+ isDigit := encodedCharSet isDigitCode: code.
+ lowercaseCode := encodedCharSet toLowercaseCode: code.
+ lowercaseCode > 255 ifTrue: [ lowercaseCode := 0 ].
+ uppercaseCode := encodedCharSet toUppercaseCode: code.
+ uppercaseCode > 255 ifTrue: [ uppercaseCode := 0 ].
+ value := (uppercaseCode bitShift: 8) + lowercaseCode.
+ isLowercase ifTrue: [ value := value bitOr: LowercaseBit ].
+ isUppercase ifTrue: [ value := value bitOr: UppercaseBit ].
+ isDigit ifTrue: [ value := value bitOr: DigitBit ].
+ newClassificationTable at: code + 1 put: value ].
+ ClassificationTable := newClassificationTable!
- "Initialize character pairs (upper-lower case)"
- #(
- "Basic roman"
- ($A $a) ($B $b) ($C $c) ($D $d)
- ($E $e) ($F $f) ($G $g) ($H $h)
- ($I $i) ($J $j) ($K $k) ($L $l)
- ($M $m) ($N $n) ($O $o) ($P $p)
- ($Q $q) ($R $r) ($S $s) ($T $t)
- ($U $u) ($V $v) ($W $w) ($X $x)
- ($Y $y) ($Z $z)
- "International"
- ($Ä $ä) ($Å $å) ($Ç $ç) ($É $é)
- ($Ñ $ñ) ($Ö $ö) ($Ü $ü) ($À $à)
- ($Ã $ã) ($Õ $õ) ($ $) ($Æ $æ)
- "International - Spanish"
- ($Á $á) ($Í $í) ($Ó $ó) ($Ú $ú)
- "International - PLEASE CHECK"
- ($È $è) ($Ì $ì) ($Ò $ò) ($Ù $ù)
- ($Ë $ë) ($Ï $ï)
- ($Â $â) ($Ê $ê) ($Î $î) ($Ô $ô) ($Û $û)
- ) do:[:pair| | ch2 |
- ch1 := pair first asciiValue.
- ch2 := pair last asciiValue.
- ClassificationTable at: ch1+1 put: (ch1 bitShift: 8) + ch2 + UppercaseBit.
- ClassificationTable at: ch2+1 put: (ch1 bitShift: 8) + ch2 + LowercaseBit.
- ].
-
- "Initialize a few others for which we only have lower case versions."
- #($ß $Ø $ø $ÿ) do:[:char|
- ch1 := char asciiValue.
- ClassificationTable at: ch1+1 put: (ch1 bitShift: 8) + ch1 + LowercaseBit.
- ].
- !
Item was changed:
----- Method: Character>>encodedCharSet (in category 'accessing') -----
encodedCharSet
+
+ value < 16r400000 ifTrue: [ ^Unicode ]. "Shortcut"
-
^EncodedCharSet charsetAt: self leadingChar
!
Item was changed:
----- Method: Character>>tokenish (in category 'testing') -----
tokenish
+ "Answer whether the receiver is a valid token-character--letter, digit, or colon."
- "Answer whether the receiver is a valid token-character--letter, digit, or
- colon."
+ self == $_ ifTrue: [ ^Scanner prefAllowUnderscoreSelectors ].
+ ^self == $: or: [ self isAlphaNumeric ]!
- ^ self == $_
- ifTrue: [ Scanner prefAllowUnderscoreSelectors ]
- ifFalse: [ self == $: or: [ self isLetter or: [ self isDigit ] ] ]!
Item was changed:
----- Method: String>>withoutLineEndings (in category 'converting') -----
withoutLineEndings
+ ^self withLineEndings: ' '!
- ^ self withSqueakLineEndings
- copyReplaceAll: String cr
- with: ' '
- asTokens: false!
Item was changed:
----- Method: Symbol>>numArgs: (in category 'system primitives') -----
numArgs: n
"Answer a string that can be used as a selector with n arguments.
TODO: need to be extended to support shrinking and for selectors like #+ "
+ | numArgs offset |.
+ (numArgs := self numArgs) >= n ifTrue: [ ^self ].
+ numArgs = 0
+ ifTrue: [ offset := 1 ]
+ ifFalse: [ offset := 0 ].
+ ^(String new: n - numArgs + offset * 5 + offset + self size streamContents: [ :stream |
+ stream nextPutAll: self.
+ numArgs = 0 ifTrue: [ stream nextPut: $:. ].
+ numArgs + offset + 1 to: n do: [ :i | stream nextPutAll: 'with:' ] ]) asSymbol!
- | numArgs aStream offs |.
- (numArgs := self numArgs) >= n ifTrue: [^self].
- aStream := WriteStream on: (String new: 16).
- aStream nextPutAll: self.
-
- (numArgs = 0) ifTrue: [aStream nextPutAll: ':'. offs := 0] ifFalse: [offs := 1].
- 2 to: n - numArgs + offs do: [:i | aStream nextPutAll: 'with:'].
- ^aStream contents asSymbol!
Item was changed:
+ (PackageInfo named: 'Collections') postscript: 'Character initializeClassificationTable.
+ String initialize'!
- (PackageInfo named: 'Collections') postscript: 'LRUCache allInstances do: [ :each | each reset ]'!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.962.mcz
==================== Summary ====================
Name: Morphic-mt.962
Author: mt
Time: 3 May 2015, 10:56:28.091 am
UUID: 7e9a02a2-169b-9d44-8450-3e0074dead2c
Ancestors: Morphic-mt.961
Never share the text instance between text morph and model. Change handling can break otherwise if that text instance will be referenced in the model.
=============== Diff against Morphic-mt.961 ===============
Item was changed:
----- Method: PluggableTextMorph>>acceptTextInModel (in category 'menu commands') -----
acceptTextInModel
"Inform the model that the receiver's textMorph's text should be accepted.
Answer true if the model accepted ok, false otherwise"
| textToAccept |
+ textToAccept := textMorph contents copy.
- textToAccept := textMorph asText.
^setTextSelector isNil or:
[setTextSelector numArgs = 2
ifTrue: [model perform: setTextSelector with: textToAccept with: self]
ifFalse: [model perform: setTextSelector with: textToAccept]]
!