[squeak-dev] The Trunk: Morphic-nice.687.mcz

Chris Muller asqueaker at gmail.com
Mon Sep 30 21:01:37 UTC 2013


Yea, I was getting caught up after a week absent the list, saw your
other commits and figured they were related.

These paragraph bits are really complicated, yet crucial.  It feels a
bit aggressive to go straight into trunk, as I agree with Tim's
comment about peer review and peer testing.

In any case, bravo to you two for braving this code and supporting the issues.

On Mon, Sep 30, 2013 at 2:52 PM, Nicolas Cellier
<nicolas.cellier.aka.nice at gmail.com> wrote:
> Ah yes, but it's a multiple .mcz saga whose goal is to:
> Remove the Multilingual specific classes for composing text layout.
>
> And this episode is specifically about removal of presentation as said...
> What is a presentation/presentationText/presentationLines ?
> It is an artifact containing precomposed unicode produced by some
> Multi*Scanner.
> Why to remove it?
> Because we can compose/display/scan decomposed unicode and recompose on the
> fly without exhibiting the artifact.
> But it yet remains to be implemented...
> Anyway, the feature was broken and deconnected some years ago, so it seems
> that we have time to re-think how to implement it.
>
> Generally it's a good thing to have self sufficient comments, so you are
> absolutely right.
> But sometimes there are long discussions associated in the mailing list
> which are hard to transcribe.
> A reference to a bug report containing some discussion could be a good thing
> in this case, ...
> ... but we're getting lazy and have a lighter trunk process for some years.
> Can we have the cake and eat it too?
> I know this is not a good excuse, but you must also consider that after 10
> commits on the same subject, the saturated commiter's mind is getting
> facetious ;)
> That's my case at least.
>
>
>
> 2013/9/30 Chris Muller <asqueaker at gmail.com>
>>
>> These version comments are redundant with the code-diff; we can see
>> that 'presenatation' vars are being removed, so could you also please
>> explain _why_ changes are being made in version comments?
>>
>> Is this a cleanup?  And may we expect no impact to any paragraph /
>> text-editor behaviors?
>>
>> On Tue, Sep 24, 2013 at 3:40 PM,  <commits at source.squeak.org> wrote:
>> > 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 Squeak-dev mailing list