[Pkg] The Trunk: Morphic-nice.687.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Sep 24 20:42:03 UTC 2013


Nicolas Cellier uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-nice.687.mcz

==================== Summary ====================

Name: Morphic-nice.687
Author: nice
Time: 24 September 2013, 10:40:04.266 pm
UUID: a0a8b7f9-f0a3-4071-b95b-06124aa146a4
Ancestors: Morphic-nice.686

Expunge presentation* from MultiNewParagraph & MultiTextComposer.
Also remove those methods same as super.
Note the small difference in displaying method: NewPragraph has offset truncated.
Prepare MultiNewParagraph funerals by mutating its instances -> NewParagraph

=============== Diff against Morphic-nice.686 ===============

Item was changed:
  NewParagraph subclass: #MultiNewParagraph
+ 	instanceVariableNames: ''
- 	instanceVariableNames: 'presentationText presentationLines'
  	classVariableNames: ''
  	poolDictionaries: 'TextConstants'
  	category: 'Morphic-Multilingual'!

Item was added:
+ ----- Method: MultiNewParagraph class>>initialize (in category 'class initialization') -----
+ initialize
+ 	"Prepare our own funeral"
+ 	
+ 	MultiNewParagraph allInstancesDo:[:mnp| mnp becomeForward: (mnp as: NewParagraph)]!

Item was removed:
- ----- Method: MultiNewParagraph>>multiComposeLinesFrom:to:delta:into:priorLines:atY: (in category 'composition') -----
- multiComposeLinesFrom: start to: stop delta: delta into: lineColl priorLines: priorLines
- 	atY: startingY
- 	"While the section from start to stop has changed, composition may ripple all the way to the end of the text.  However in a rectangular container, if we ever find a line beginning with the same character as before (ie corresponding to delta in the old lines), then we can just copy the old lines from there to the end of the container, with adjusted indices and y-values"
- 
- 	| newResult composer presentationInfo |
- 
- 	composer := MultiTextComposer new.
- 	presentationLines := nil.
- 	presentationText := nil.
- 	newResult := composer
- 		multiComposeLinesFrom: start 
- 		to: stop 
- 		delta: delta 
- 		into: lineColl 
- 		priorLines: priorLines
- 		atY: startingY
- 		textStyle: textStyle 
- 		text: text 
- 		container: container
- 		wantsColumnBreaks: wantsColumnBreaks == true.
- 	lines := newResult first asArray.
- 	maxRightX := newResult second.
- 	presentationInfo := composer getPresentationInfo.
- 	presentationLines := presentationInfo first asArray.
- 	presentationText := presentationInfo second.
- 	"maxRightX printString displayAt: 0 at 0."
- 	^maxRightX
- !

Item was removed:
- ----- Method: MultiNewParagraph>>presentationLines (in category 'accessing') -----
- presentationLines
- 
- 	^ presentationLines.
- !

Item was removed:
- ----- Method: MultiNewParagraph>>presentationText (in category 'accessing') -----
- presentationText
- 
- 	^ presentationText.
- !

Item was changed:
  TextComposer subclass: #MultiTextComposer
+ 	instanceVariableNames: ''
- 	instanceVariableNames: 'presentation presentationLines'
  	classVariableNames: ''
  	poolDictionaries: 'TextConstants'
  	category: 'Morphic-Multilingual'!

Item was removed:
- ----- Method: MultiTextComposer>>composeEachRectangleIn: (in category 'as yet unclassified') -----
- composeEachRectangleIn: rectangles
- 
- 	| myLine lastChar |
- 
- 	1 to: rectangles size do: [:i | 
- 		currCharIndex <= theText size ifFalse: [^false].
- 		myLine := scanner 
- 			composeFrom: currCharIndex 
- 			inRectangle: (rectangles at: i)				
- 			firstLine: isFirstLine 
- 			leftSide: i=1 
- 			rightSide: i=rectangles size.
- 		lines addLast: myLine.
- 		presentationLines addLast: scanner getPresentationLine.
- 		presentation ifNil: [presentation := scanner getPresentation]
- 			ifNotNil: [presentation := presentation, scanner getPresentation].
- 		actualHeight := actualHeight max: myLine lineHeight.  "includes font changes"
- 		currCharIndex := myLine last + 1.
- 		lastChar := theText at: myLine last.
- 		(CharacterSet crlf includes: lastChar) ifTrue: [^#cr].
- 		wantsColumnBreaks ifTrue: [
- 			lastChar = TextComposer characterForColumnBreak ifTrue: [^#columnBreak].
- 		].
- 	].
- 	^false!

Item was removed:
- ----- Method: MultiTextComposer>>getPresentationInfo (in category 'as yet unclassified') -----
- getPresentationInfo
- 
- 	^ Array with: presentationLines with: presentation.
- !

Item was changed:
  ----- Method: MultiTextComposer>>multiComposeLinesFrom:to:delta:into:priorLines:atY:textStyle:text:container:wantsColumnBreaks: (in category 'as yet unclassified') -----
  multiComposeLinesFrom: argStart to: argStop delta: argDelta into: argLinesCollection priorLines: argPriorLines atY: argStartY textStyle: argTextStyle text: argText container: argContainer wantsColumnBreaks: argWantsColumnBreaks
  
  	wantsColumnBreaks := argWantsColumnBreaks.
  	lines := argLinesCollection.
- 	presentationLines := argLinesCollection copy.
  	theTextStyle := argTextStyle.
  	theText := argText.
  	theContainer := argContainer.
  	deltaCharIndex := argDelta.
  	currCharIndex := startCharIndex := argStart.
  	stopCharIndex := argStop.
  	prevLines := argPriorLines.
  	currentY := argStartY.
  	defaultLineHeight := theTextStyle lineGrid.
  	maxRightX := theContainer left.
  	possibleSlide := stopCharIndex < theText size and: [theContainer isMemberOf: Rectangle].
  	nowSliding := false.
  	prevIndex := 1.
  	scanner := MultiCompositionScanner new text: theText textStyle: theTextStyle.
  	scanner wantsColumnBreaks: wantsColumnBreaks.
  	isFirstLine := true.
  	self composeAllLines.
  	isFirstLine ifTrue: ["No space in container or empty text"
  		self 
  			addNullLineWithIndex: startCharIndex
  			andRectangle: (theContainer topLeft extent: 0 at defaultLineHeight)
  	] ifFalse: [
  		self fixupLastLineIfCR
  	].
  	^{lines asArray. maxRightX}
  
  !

Item was removed:
- ----- Method: NewParagraph>>testNewComposeAll3 (in category 'composition') -----
- testNewComposeAll3
- 	| newResult |
- 	newResult := TextComposer new
- 		multiComposeLinesFrom: firstCharacterIndex 
- 		to: text size 
- 		delta: 0
- 		into: OrderedCollection new 
- 		priorLines: Array new 
- 		atY: container top
- 		textStyle: textStyle 
- 		text: text 
- 		container: (0 at 0 extent: 31 at 60)
- 		wantsColumnBreaks: false.
- 	^{newResult. {lines. maxRightX}}
- !



More information about the Packages mailing list