Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass on references to BlOSpace (removing them) #346

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Extension { #name : #BlCompositeBackgroundTest }
BlCompositeBackgroundTest >> testAeApplyTo [

| space background blElement backgroundList |
space := BlOSpace new.
space := BlSpace new.

backgroundList := OrderedCollection with: (BlBackground paint: Color blue).
background := BlCompositeBackground withAll: backgroundList.
blElement := BlElement new background: background.
blElement := BlElement new background: background; yourself.
space root addChild: blElement.

space aeAsForm. "check no errors"
Expand Down
13 changes: 9 additions & 4 deletions src/Bloc-Alexandrie-Tests/BlSpaceBuilder.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,18 @@ BlSpaceBuilder >> initialize [

super initialize.

space := BlOSpace new.
space := BlSpace new.
spaceExtent := 100 asPoint.
host := BlOSWindowSDL2Host new.

random := Random seed: 7.
alphabetGenerator := Generator on: [ :generator |
alphabetGenerator := self newAlphabetGenerator
]

{ #category : #initialization }
BlSpaceBuilder >> newAlphabetGenerator [

^ Generator on: [ :generator |
| index |
index := 1.
[ Character alphabet do: [ :each |
Expand All @@ -150,8 +156,7 @@ BlSpaceBuilder >> initialize [
ifTrue: [ '' ]
ifFalse: [ index asString ].
generator yield: next, suffix ].
index := index + 1 ] repeat ].

index := index + 1 ] repeat ]
]

{ #category : #'instance creation' }
Expand Down
3 changes: 2 additions & 1 deletion src/Bloc-Alexandrie/BAAxisAlignedCompositionLayer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Class {
'element',
'pattern'
],
#category : 'Bloc-Alexandrie-Utility',
#package : 'Bloc',
#tag : 'Alexandrie-Utility',
#package : 'Bloc-Alexandrie',
#tag : 'Utility'
}
Expand Down
3 changes: 2 additions & 1 deletion src/Bloc-Alexandrie/BABufferSpaceRenderer.class.st
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Class {
#name : 'BABufferSpaceRenderer',
#superclass : 'BASpaceRenderer',
#category : 'Bloc-Alexandrie-Renderer',
#package : 'Bloc',
#tag : 'Alexandrie-Renderer',
#package : 'Bloc-Alexandrie',
#tag : 'Renderer'
}
Expand Down
3 changes: 2 additions & 1 deletion src/Bloc-Alexandrie/BACanvasTextMeasurer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Class {
#instVars : [
'aeCanvas'
],
#category : 'Bloc-Alexandrie-Text',
#package : 'Bloc',
#tag : 'Alexandrie-Text',
#package : 'Bloc-Alexandrie',
#tag : 'Text'
}
Expand Down
3 changes: 2 additions & 1 deletion src/Bloc-Alexandrie/BAFontConverter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Class {
#classInstVars : [
'uniqueInstance'
],
#category : 'Bloc-Alexandrie-Fonts',
#package : 'Bloc',
#tag : 'Alexandrie-Fonts',
#package : 'Bloc-Alexandrie',
#tag : 'Fonts'
}
Expand Down
3 changes: 2 additions & 1 deletion src/Bloc-Alexandrie/BAFormSpaceRenderer.class.st
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Class {
#name : 'BAFormSpaceRenderer',
#superclass : 'BASpaceRenderer',
#category : 'Bloc-Alexandrie-Renderer',
#package : 'Bloc',
#tag : 'Alexandrie-Renderer',
#package : 'Bloc-Alexandrie',
#tag : 'Renderer'
}
Expand Down
3 changes: 2 additions & 1 deletion src/Bloc-Alexandrie/BAMockedTextMeasurer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Class {
'measuredHeight',
'textOffset'
],
#category : 'Bloc-Alexandrie-Text-Mocked',
#package : 'Bloc',
#tag : 'Alexandrie-Text-Mocked',
#package : 'Bloc-Alexandrie',
#tag : 'Text-Mocked'
}
Expand Down
3 changes: 2 additions & 1 deletion src/Bloc-Alexandrie/BAMockedTextParagraphSpan.class.st
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Class {
#name : 'BAMockedTextParagraphSpan',
#superclass : 'BATextParagraphLeaf',
#category : 'Bloc-Alexandrie-Text-Mocked',
#package : 'Bloc',
#tag : 'Alexandrie-Text-Mocked',
#package : 'Bloc-Alexandrie',
#tag : 'Text-Mocked'
}
Expand Down
3 changes: 2 additions & 1 deletion src/Bloc-Alexandrie/BAOffscreen.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Class {
#classInstVars : [
'instance'
],
#category : 'Bloc-Alexandrie-Utility',
#package : 'Bloc',
#tag : 'Alexandrie-Utility',
#package : 'Bloc-Alexandrie',
#tag : 'Utility'
}
Expand Down
3 changes: 2 additions & 1 deletion src/Bloc-Alexandrie/BARenderer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Both buffer and form host-spaces are supported.
Class {
#name : 'BARenderer',
#superclass : 'BlHostRenderer',
#category : 'Bloc-Alexandrie-Renderer',
#package : 'Bloc',
#tag : 'Alexandrie-Renderer',
#package : 'Bloc-Alexandrie',
#tag : 'Renderer'
}
Expand Down
3 changes: 2 additions & 1 deletion src/Bloc-Alexandrie/BASpaceRenderer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Class {
#instVars : [
'aeCanvas'
],
#category : 'Bloc-Alexandrie-Renderer',
#package : 'Bloc',
#tag : 'Alexandrie-Renderer',
#package : 'Bloc-Alexandrie',
#tag : 'Renderer'
}
Expand Down
3 changes: 2 additions & 1 deletion src/Bloc-Alexandrie/BASpaceTextMeasurer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Class {
#instVars : [
'spaceRenderer'
],
#category : 'Bloc-Alexandrie-Text',
#package : 'Bloc',
#tag : 'Alexandrie-Text',
#package : 'Bloc-Alexandrie',
#tag : 'Text'
}
Expand Down
3 changes: 2 additions & 1 deletion src/Bloc-Alexandrie/BATextElementMockedMeasurer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Class {
#instVars : [
'measurer'
],
#category : 'Bloc-Alexandrie-Text-Mocked',
#package : 'Bloc',
#tag : 'Alexandrie-Text-Mocked',
#package : 'Bloc-Alexandrie',
#tag : 'Text-Mocked'
}
Expand Down
3 changes: 2 additions & 1 deletion src/Bloc-Alexandrie/BATextMeasurer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Class {
#instVars : [
'lineAdvance'
],
#category : 'Bloc-Alexandrie-Text',
#package : 'Bloc',
#tag : 'Alexandrie-Text',
#package : 'Bloc-Alexandrie',
#tag : 'Text'
}
Expand Down
3 changes: 2 additions & 1 deletion src/Bloc-Alexandrie/BATextParagraphLeaf.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Class {
#classVars : [
'TabStopWidth'
],
#category : 'Bloc-Alexandrie-Text',
#package : 'Bloc',
#tag : 'Alexandrie-Text',
#package : 'Bloc-Alexandrie',
#tag : 'Text'
}
Expand Down
3 changes: 2 additions & 1 deletion src/Bloc-Alexandrie/BATextParagraphSpan.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ I represent an Alexandrie specific measured span
Class {
#name : 'BATextParagraphSpan',
#superclass : 'BATextParagraphLeaf',
#category : 'Bloc-Alexandrie-Text',
#package : 'Bloc',
#tag : 'Alexandrie-Text',
#package : 'Bloc-Alexandrie',
#tag : 'Text'
}
Expand Down
8 changes: 4 additions & 4 deletions src/Bloc-DevTool/BlDevHalosEventListenerExample.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ BlDevHalosEventListenerExample >> activatedHalos [
anEvent modifiers
alt: true;
shift: true.
BlOSpace simulateEvent: anEvent on: (aContainer childAt: 1).
BlSpace simulateEvent: anEvent on: (aContainer childAt: 1).

theNewElements := aSpace children asArray.
"self assert: theNewElements size equals: thePriorElements size + 1."
Expand Down Expand Up @@ -86,7 +86,7 @@ BlDevHalosEventListenerExample >> newSpace [

<sampleInstance>
| aSpace |
aSpace := BlOSpace new.
aSpace := BlSpace new.
aSpace host: BlHeadlessHost new.
aSpace title: 'Async Element Examples'.
aSpace extent: 600 @ 400.
Expand All @@ -96,14 +96,14 @@ BlDevHalosEventListenerExample >> newSpace [

{ #category : #utility }
BlDevHalosEventListenerExample >> putInSpace: aBlElement [

<sampleInstance>

| aSpace |
self
assert: [ aBlElement isNotNil ]
description: [ 'Element must be non-nil' ].
aSpace := self newSpace.
aSpace addChild: aBlElement.
aSpace root addChild: aBlElement.
^ aSpace
]

Expand Down
4 changes: 2 additions & 2 deletions src/Bloc-Examples/BlAnimationExamples.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ BlAnimationExamples class >> ballsAnim [
alp }.
els add: el ].

space := BlOSpace new.
space := BlSpace new.
space root addChildren: els.
space show.

Expand Down Expand Up @@ -88,7 +88,7 @@ BlAnimationExamples class >> sequential [
position: 100 @ 100.
element addAnimation: sequential.

space := BlOSpace new.
space := BlSpace new.
space root addChild: element.
space show
]
Expand Down
4 changes: 2 additions & 2 deletions src/Bloc-Examples/BlErrorHandlingExamples.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ BlErrorHandlingExamples >> sceneWith: aFaultyElement [

aContainer addChildren: { aLeftChild . aRightChild }.

aSpace := BlOSpace new.
aSpace := BlSpace new.
aSpace host: BlMorphicWindowHost new.
aSpace addChild: aContainer.
aSpace root addChild: aContainer.
aSpace show.
aSpace pulse.
aSpace close.
Expand Down
2 changes: 1 addition & 1 deletion src/Bloc-Examples/BlMouseProcessorExamples.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ BlMouseProcessorExamples >> mouseProcessor [
| aMouseProcessor aSpace |
<gtExample>

aSpace := BlOSpace new.
aSpace := BlSpace new.
aMouseProcessor := BlMouseProcessor space: aSpace.

self assert: aMouseProcessor space equals: aSpace.
Expand Down
15 changes: 11 additions & 4 deletions src/Bloc-Examples/BlSharedEventDistributorExamples.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ BlSharedEventDistributorExamples >> mouseEnterEventOneOutOfTwoElements [
anElementOne when: BlMouseEnterEvent do: [ aMouseEnterOne := aMouseEnterOne + 1 ].
anElementTwo when: BlMouseEnterEvent do: [ aMouseEnterTwo := aMouseEnterTwo + 1 ].

BlOSpace simulateMouseMoveInside: anElementOne.
BlSpace simulateMouseMoveInside: anElementOne.

self assert: aMouseEnterOne equals: 1.
self assert: aMouseEnterTwo equals: 1.
Expand All @@ -105,6 +105,7 @@ BlSharedEventDistributorExamples >> mouseEnterEventOneOutOfTwoElements [
{ #category : #'examples - sharing events' }
BlSharedEventDistributorExamples >> mouseLeaveEventOneOutOfTwoElements [
<gtExample>

| aHandler anElements aContainer aMouseLeaveTwo aMouseLeaveOne anElementOne anElementTwo |
aMouseLeaveOne := aMouseLeaveTwo := 0.
aHandler := self installTwoElements.
Expand All @@ -118,10 +119,16 @@ BlSharedEventDistributorExamples >> mouseLeaveEventOneOutOfTwoElements [
anElementOne when: BlMouseLeaveEvent do: [ aMouseLeaveOne := aMouseLeaveOne + 1 ].
anElementTwo when: BlMouseLeaveEvent do: [ aMouseLeaveTwo := aMouseLeaveTwo + 1 ].

BlOSpace
BlSpace
simulateEvents: {
BlMouseMoveEvent new position: (BlOSpace locationInside: anElementOne); screenPosition: 0@0.
BlMouseMoveEvent new position: (BlOSpace locationOutside: aContainer); screenPosition: 0@0 }
BlMouseMoveEvent new
position: (BlSpace locationInside: anElementOne);
screenPosition: 0@0;
yourself.
BlMouseMoveEvent new
position: (BlSpace locationOutside: aContainer);
screenPosition: 0@0;
yourself }
on: aContainer.

self assert: aMouseLeaveOne equals: 1.
Expand Down
6 changes: 4 additions & 2 deletions src/Bloc-Examples/BlSpaceEventExamples.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ BlSpaceEventExamples >> ignoreSpaceEventsAfterCloseRequest [
{ #category : #'instance creation' }
BlSpaceEventExamples >> space [
<gtExample>

^ BlOSpace new host: BlHeadlessHost new

^ BlSpace new
host: BlHeadlessHost new;
yourself
]

{ #category : #'show / close' }
Expand Down
2 changes: 1 addition & 1 deletion src/Bloc-Examples/BlTaskTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ BlTaskTest >> testAddElementWithTaskToSpace [

| anElement aSpace aTask |
anElement := self testAddTaskToTheElementWithoutSpace.
aSpace := BlOSpace new.
aSpace := BlSpace new.
aSpace root addChild: anElement.
"task were moved to the space"
self assert: anElement taskQueue tasks isEmpty.
Expand Down
6 changes: 4 additions & 2 deletions src/Bloc-Examples/TBlExample.trait.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ Trait {
{ #category : #opening }
TBlExample classSide >> openInWindow: anElement named: aTitleString extent: aPoint [
"Open a given element in a window of a provided extent and specified title"

| aSpace |
aSpace := BlOSpace new
aSpace := BlSpace new
extent: aPoint;
title: aTitleString.
title: aTitleString;
yourself.

aSpace root background: self spaceBackground.
aSpace root addChild: anElement.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Class {
#name : 'BlLayoutHorizontalExactResizerState',
#superclass : 'BlLayoutHorizontalResizerState',
#category : 'Bloc-Layout-Resizer',
#package : 'Bloc',
#tag : 'Layout-Resizer',
#package : 'Bloc-Layout-Resizer'
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Class {
#name : 'BlLayoutHorizontalFitContentLimitedResizerState',
#superclass : 'BlLayoutHorizontalResizerState',
#category : 'Bloc-Layout-Resizer',
#package : 'Bloc',
#tag : 'Layout-Resizer',
#package : 'Bloc-Layout-Resizer'
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Class {
#name : 'BlLayoutHorizontalFitContentResizerState',
#superclass : 'BlLayoutHorizontalResizerState',
#category : 'Bloc-Layout-Resizer',
#package : 'Bloc',
#tag : 'Layout-Resizer',
#package : 'Bloc-Layout-Resizer'
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Class {
#name : 'BlLayoutHorizontalLocalResizerState',
#superclass : 'BlLayoutHorizontalResizerState',
#category : 'Bloc-Layout-Resizer',
#package : 'Bloc',
#tag : 'Layout-Resizer',
#package : 'Bloc-Layout-Resizer'
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Class {
#name : 'BlLayoutHorizontalMatchParentResizerState',
#superclass : 'BlLayoutHorizontalResizerState',
#category : 'Bloc-Layout-Resizer',
#package : 'Bloc',
#tag : 'Layout-Resizer',
#package : 'Bloc-Layout-Resizer'
}

Expand Down
Loading
Loading