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

Clean up around hosts #614

Merged
merged 15 commits into from
Oct 15, 2024
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/Bloc/BlEvent.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,9 @@ BlEvent >> canBePropagated [
]

{ #category : #'private - accessing' }
BlEvent >> canBePropagated: anObject [
canBePropagated := anObject
BlEvent >> canBePropagated: aBoolean [

canBePropagated := aBoolean
]

{ #category : #'private - steps' }
Expand Down Expand Up @@ -355,6 +356,16 @@ BlEvent >> newCopyFor: aTarget [
yourself
]

{ #category : #printing }
BlEvent >> printOn: aStream [

aStream
nextPutAll: self className;
nextPutAll: '(timestamp: ';
print: timestamp;
nextPut: $)
]

{ #category : #sending }
BlEvent >> sendTo: anObject [

Expand Down
18 changes: 0 additions & 18 deletions src/Bloc/BlEventTraversalBubblingStep.class.st

This file was deleted.

18 changes: 0 additions & 18 deletions src/Bloc/BlEventTraversalCapturingStep.class.st

This file was deleted.

16 changes: 0 additions & 16 deletions src/Bloc/BlEventTraversalForwardingStep.class.st

This file was deleted.

51 changes: 0 additions & 51 deletions src/Bloc/BlEventTraversalStep.class.st

This file was deleted.

16 changes: 0 additions & 16 deletions src/Bloc/BlEventTraversalTargetStep.class.st

This file was deleted.

2 changes: 0 additions & 2 deletions src/Bloc/BlHost.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ A Host can be compared to a driver that communicates with the native multimedia
Class {
#name : #BlHost,
#superclass : #Object,
#traits : 'TBlDebug',
#classTraits : 'TBlDebug classTrait',
#classVars : [
'PreferableHostClass'
],
Expand Down
13 changes: 5 additions & 8 deletions src/Bloc/BlParallelUniverse.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ BlParallelUniverse >> closeSpaceSynchronously: aSpace [
aSpace dispatchRemovedFromSceneGraph.

"Raise an event indicating that the space is no longer attached to a universe"
aSpace dispatchEvent: (BlSpaceDetachedEvent new space: aSpace).
aSpace dispatchEventWithTimestamp: BlSpaceDetachedEvent new.

"Send space closed event.
Note: a new space may be spawned as a reaction to the event, that is why
we send it before stopping host and universe"
aSpace dispatchEvent: (BlSpaceClosedEvent new space: aSpace).
aSpace dispatchEventWithTimestamp: BlSpaceClosedEvent new.

self
assert: [ aSpace hasHostSpace not ]
Expand All @@ -204,7 +204,7 @@ BlParallelUniverse >> closeSpaceSynchronously: aSpace [
"Raise an event indicating that all normal event for closing a space have been completed.
This event is used by the debugger to stop the UI process. Users should not normally rely
on this event, as there is no guarantee that the process will not be terminated."
aSpace dispatchEvent: (BlSpaceDestroyedEvent new space: aSpace).
aSpace dispatchEventWithTimestamp: BlSpaceDestroyedEvent new
]

{ #category : #'api - spaces' }
Expand Down Expand Up @@ -278,7 +278,7 @@ BlParallelUniverse >> detachSpaceSynchronously: aSpace [
ifTrue: [ self stopUniverse ] ] ].

"Raise an event indicating that the space is no longer attached to a universe"
aSpace dispatchEvent: (BlSpaceDetachedEvent new space: aSpace).
aSpace dispatchEventWithTimestamp: BlSpaceDetachedEvent new
]

{ #category : #testing }
Expand Down Expand Up @@ -400,10 +400,7 @@ BlParallelUniverse >> openSpaceSynchronously: aSpace [

"Note: we should send shown event after everything else is done, because
theoretically, that only space could be closed as a reaction to the event"
aSpace dispatchEvent:
(BlSpaceShownEvent new
space: aSpace;
yourself).
aSpace dispatchEventWithTimestamp: BlSpaceShownEvent new.

"Notify root element that it is now visible to the user"
aSpace becomeVisible.
Expand Down
19 changes: 13 additions & 6 deletions src/Bloc/BlSpace.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,13 @@ BlSpace >> dispatchAddedToSceneGraph [

]

{ #category : #'event handling' }
BlSpace >> dispatchEventWithTimestamp: aBlEvent [

aBlEvent timestamp ifNil: [ aBlEvent timestamp: self time now ].
self dispatchEvent: aBlEvent
]

{ #category : #'event handling' }
BlSpace >> dispatchMousePickedOutside: aMouseOutsideEvent [

Expand All @@ -675,16 +682,16 @@ BlSpace >> dispatchRemovedFromSceneGraph [
]

{ #category : #pulse }
BlSpace >> dispatchTimeEvent: aSpaceStepEventClass during: aBlock [
BlSpace >> dispatchTimeEvent: aSpacePhaseEventClass during: aBlock [

| aStartTime |

aStartTime := self time now.
aBlock cull: self.
self eventDispatcher dispatchEvent:
(aSpaceStepEventClass new
start: aStartTime;
end: self time now;
yourself)
(aSpacePhaseEventClass new
start: aStartTime;
end: self time now;
yourself)
]

{ #category : #'change - layout' }
Expand Down
14 changes: 0 additions & 14 deletions src/Bloc/BlSpaceClosedEvent.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,10 @@ space close
Class {
#name : #BlSpaceClosedEvent,
#superclass : #BlSpaceEvent,
#instVars : [
'space'
],
#category : #'Bloc-Events-Type-Space'
}

{ #category : #sending }
BlSpaceClosedEvent >> sendTo: anObject [
anObject spaceClosedEvent: self
]

{ #category : #accessing }
BlSpaceClosedEvent >> space [

^ space
]

{ #category : #accessing }
BlSpaceClosedEvent >> space: aSpace [
space := aSpace
]
14 changes: 0 additions & 14 deletions src/Bloc/BlSpaceDestroyedEvent.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,5 @@ This event is used by the debugger to stop the UI process so it should be used w
Class {
#name : #BlSpaceDestroyedEvent,
#superclass : #BlSpaceEvent,
#instVars : [
'space'
],
#category : #'Bloc-Events-Type-Space'
}

{ #category : #accessing }
BlSpaceDestroyedEvent >> space [

^ space
]

{ #category : #accessing }
BlSpaceDestroyedEvent >> space: aSpace [
space := aSpace
]
13 changes: 0 additions & 13 deletions src/Bloc/BlSpaceDetachedEvent.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,5 @@ Is sent by the space after is it detached from the universe.
Class {
#name : #BlSpaceDetachedEvent,
#superclass : #BlSpaceEvent,
#instVars : [
'space'
],
#category : #'Bloc-Events-Type-Space'
}

{ #category : #accessing }
BlSpaceDetachedEvent >> space [
^ space
]

{ #category : #accessing }
BlSpaceDetachedEvent >> space: anObject [
space := anObject
]
2 changes: 1 addition & 1 deletion src/Bloc/BlSpaceEventsProcessedEvent.class.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Class {
#name : #BlSpaceEventsProcessedEvent,
#superclass : #BlSpaceStepEvent,
#superclass : #BlSpacePhaseEvent,
#category : #'Bloc-Events-Type-Space'
}

Expand Down
4 changes: 3 additions & 1 deletion src/Bloc/BlSpaceFrameDrawingPhase.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ BlSpaceFrameDrawingPhase >> name [

{ #category : #actions }
BlSpaceFrameDrawingPhase >> runOn: aSpace [

aSpace
dispatchTimeEvent: BlSpaceRenderEndEvent
during: [ :theSpace | BlSpaceRenderSignal for: theSpace block: [ theSpace render ] ]
during: [ :theSpace |
BlSpaceRenderSignal for: theSpace block: [ theSpace render ] ]
]
3 changes: 2 additions & 1 deletion src/Bloc/BlSpaceFrameLayoutPhase.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ BlSpaceFrameLayoutPhase >> name [

{ #category : #actions }
BlSpaceFrameLayoutPhase >> runOn: aSpace [

aSpace
dispatchTimeEvent: BlSpaceLayoutEndEvent
during: [ :theSpace | theSpace doLayout ].
during: [ :theSpace | theSpace doLayout ]
]
3 changes: 2 additions & 1 deletion src/Bloc/BlSpaceFrameTaskPhase.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ BlSpaceFrameTaskPhase >> name [

{ #category : #actions }
BlSpaceFrameTaskPhase >> runOn: aSpace [
"process animations and other runnable tasks"
"Process animations and other runnable tasks"

aSpace
dispatchTimeEvent: BlSpaceTasksEndEvent
during: [ :theSpace | theSpace runTasks ]
Expand Down
2 changes: 1 addition & 1 deletion src/Bloc/BlSpaceLayoutEndEvent.class.st
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Class {
#name : #BlSpaceLayoutEndEvent,
#superclass : #BlSpaceStepEvent,
#superclass : #BlSpacePhaseEvent,
#category : #'Bloc-Events-Type-Space'
}
Loading