Skip to content

Commit

Permalink
Merge pull request #502 from pharo-graphics/fixLogUndeclaredDependency
Browse files Browse the repository at this point in the history
Fix most log undeclared dependencies
  • Loading branch information
tinchodias committed May 10, 2024
2 parents a491b9d + 7b9f22e commit 37d782f
Show file tree
Hide file tree
Showing 21 changed files with 217 additions and 318 deletions.
2 changes: 1 addition & 1 deletion src/BaselineOfBloc/BaselineOfBloc.class.st
Expand Up @@ -87,7 +87,7 @@ BaselineOfBloc >> baseline: spec [
package: #'Bloc-Alexandrie-Tests' with: [
spec requires: #('Bloc-Alexandrie' 'Bloc-Text-Examples') ];
package: #'Bloc-Text-Alexandrie-Examples' with: [
spec requires: #('Bloc-Alexandrie') ].
spec requires: #('Bloc-Alexandrie' 'Bloc-Layout') ].
"Exporters depend on Alexandrie"
spec
package: #'Bloc-Alexandrie-Exporter' with: [
Expand Down
44 changes: 44 additions & 0 deletions src/Bloc-Examples/BlMorphicHostExamples.class.st
@@ -0,0 +1,44 @@
Class {
#name : #BlMorphicHostExamples,
#superclass : #BlExamplesTest,
#instVars : [
'containerMorph'
],
#category : #'Bloc-Examples-Host - Morph'
}

{ #category : #examples }
BlMorphicHostExamples >> squares [
<sampleInstance>
<demo>

| aMorph aHost aSpace |
aMorph := Morph new.
"container morph could also have #spaceFill resizing"
aMorph extent: 400 asPoint.
"Specify a layout policy so the Bloc space fills the whole
extent (including Morph resizing)."
aMorph layoutPolicy: TableLayout new.
aMorph openInWindowLabeled: 'Resize window to layout. Hover squares to color.'.

aHost := BlMorphicHost new.
aHost containerMorph: aMorph.

aSpace := BlSpace new.
aSpace host: aHost.
aSpace show.

aSpace root
background: Color paleBlue;
layout: BlFlowLayout horizontal.

50 timesRepeat: [
aSpace root addChild:
(BlElement new
background: Color random translucent;
addEventHandlerOn: BlMouseEnterEvent
do: [ :evt | evt target background: Color random ];
yourself) ].

^ aSpace
]
19 changes: 19 additions & 0 deletions src/Bloc-Infinite/BlElement.extension.st
@@ -0,0 +1,19 @@
Extension { #name : #BlElement }

{ #category : #'*Bloc-Infinite' }
BlElement >> asScrollableElement [
| scrollable |
self removeFromParent.
scrollable := self newScrollableParent.
scrollable constraintsDo: [ :c |
c horizontal matchParent.
c vertical matchParent ].
scrollable addChild: self.
^ scrollable
]

{ #category : #'*Bloc-Infinite' }
BlElement >> newScrollableParent [

^ BlScrollableElement new
]
6 changes: 6 additions & 0 deletions src/Bloc-Infinite/BlLayoutCommonConstraints.extension.st
@@ -0,0 +1,6 @@
Extension { #name : #BlLayoutCommonConstraints }

{ #category : #'*Bloc-Infinite' }
BlLayoutCommonConstraints >> infinite [
^ self at: BlInfiniteLayout
]
Expand Up @@ -4,7 +4,7 @@ A BlLayoutTest is a test class for testing the behavior of BlLayout
Class {
#name : #BlLayoutTest,
#superclass : #TestCase,
#category : #'Bloc-Tests-Layouts-Basic'
#category : #'Bloc-Layout-Tests'
}

{ #category : #tests }
Expand Down
6 changes: 6 additions & 0 deletions src/Bloc-Layout/BlLayoutCommonConstraints.extension.st
Expand Up @@ -20,6 +20,12 @@ BlLayoutCommonConstraints >> linear [
^ self at: BlLinearLayout
]

{ #category : #'*Bloc-Layout' }
BlLayoutCommonConstraints >> proportional [

^ self at: BlProportionalLayout
]

{ #category : #'*Bloc-Layout' }
BlLayoutCommonConstraints >> relative [
^ self at: BlRelativeLayout
Expand Down
33 changes: 0 additions & 33 deletions src/Bloc-Tests/BlElementAlignableTest.class.st

This file was deleted.

2 changes: 1 addition & 1 deletion src/Bloc-Tests/BlEventDispatcherTest.class.st
Expand Up @@ -5,7 +5,7 @@ I have been automatically converted and probably manually tweaked from BlEventDi
Class {
#name : #BlEventDispatcherTest,
#superclass : #TestCase,
#category : #'Bloc-Tests'
#category : #'Bloc-Tests-Events'
}

{ #category : #tests }
Expand Down
16 changes: 8 additions & 8 deletions src/Bloc-Tests/BlEventTest.class.st
Expand Up @@ -5,7 +5,7 @@ I have been automatically converted and probably manually tweaked from BlEventEx
Class {
#name : #BlEventTest,
#superclass : #TestCase,
#category : #'Bloc-Tests'
#category : #'Bloc-Tests-Events'
}

{ #category : #tests }
Expand All @@ -19,7 +19,7 @@ BlEventTest >> newBlueElement [
{ #category : #tests }
BlEventTest >> newCustomEvent [

^ BlExampleCustomEvent new
^ BlMockedEvent new
payload: 'Hello world!';
yourself
]
Expand All @@ -28,14 +28,14 @@ BlEventTest >> newCustomEvent [
BlEventTest >> newCustomEventListener [

^ BlEventHandler
on: BlExampleCustomEvent
on: BlMockedEvent
do: [ :aCustomEvent | aCustomEvent consume ]
]

{ #category : #tests }
BlEventTest >> newCustomEventTarget [

^ BlExampleCustomEventTarget new
^ BlMockedEventTarget new
]

{ #category : #tests }
Expand Down Expand Up @@ -160,19 +160,19 @@ BlEventTest >> testRemoveEventHandlerAnsweredByAddEventHandlerOnDo [
"Add two handlers that increase a counter on each handled event."
handlerA :=
target
addEventHandlerOn: BlExampleCustomEvent
addEventHandlerOn: BlMockedEvent
do: [ :_ | countA := countA + 1 ].
handlerB :=
target
addEventHandlerOn: BlExampleCustomEvent
addEventHandlerOn: BlMockedEvent
do: [ :_ | countB := countB + 1 ].
target dispatchEvent: BlExampleCustomEvent new.
target dispatchEvent: BlMockedEvent new.
self assert: countA equals: 1.
self assert: countB equals: 1.

"After removing handlerA, countA doesn't increase."
target removeEventHandler: handlerA.
target dispatchEvent: BlExampleCustomEvent new.
target dispatchEvent: BlMockedEvent new.
self assert: countA equals: 1.
self assert: countB equals: 2
]
Expand Down
7 changes: 0 additions & 7 deletions src/Bloc-Tests/BlLayoutExactResizerTest.class.st
Expand Up @@ -14,13 +14,6 @@ BlLayoutExactResizerTest >> setUp [
resizer := BlLayoutExactResizer new size: 100.0
]

{ #category : #initialization }
BlLayoutExactResizerTest >> tearDown [
super tearDown.

resizer := nil
]

{ #category : #tests }
BlLayoutExactResizerTest >> testEquals [

Expand Down
38 changes: 38 additions & 0 deletions src/Bloc-Tests/BlMockAlignableElement.class.st
@@ -0,0 +1,38 @@
"
I'm a mock element for unit-testing `TBlAlignable`.
"
Class {
#name : #BlMockAlignableElement,
#superclass : #BlElement,
#traits : 'TBlAlignable',
#classTraits : 'TBlAlignable classTrait',
#instVars : [
'horizontalAlignment',
'verticalAlignment'
],
#category : #'Bloc-Tests-Layouts-Alignment'
}

{ #category : #accessing }
BlMockAlignableElement >> horizontalAlignment [

^ horizontalAlignment
]

{ #category : #accessing }
BlMockAlignableElement >> horizontalAlignment: aBlElementAlignment [

horizontalAlignment := aBlElementAlignment
]

{ #category : #accessing }
BlMockAlignableElement >> verticalAlignment [

^ verticalAlignment
]

{ #category : #accessing }
BlMockAlignableElement >> verticalAlignment: aBlElementAlignment [

verticalAlignment := aBlElementAlignment
]
Expand Up @@ -3,20 +3,22 @@ I am an example of a custom bloc event
"
Class {
#name : #BlExampleCustomEvent,
#name : #BlMockedEvent,
#superclass : #BlEvent,
#instVars : [
'payload'
],
#category : #'Bloc-Examples-Event'
#category : #'Bloc-Tests-Events'
}

{ #category : #accessing }
BlExampleCustomEvent >> payload [
BlMockedEvent >> payload [

^ payload
]

{ #category : #accessing }
BlExampleCustomEvent >> payload: anObject [
BlMockedEvent >> payload: anObject [

payload := anObject
]
Expand Up @@ -3,26 +3,25 @@ I am an example of a custom non-element event target that can be nicely integrat
"
Class {
#name : #BlExampleCustomEventTarget,
#name : #BlMockedEventTarget,
#superclass : #Object,
#traits : 'TBlEventTarget',
#classTraits : 'TBlEventTarget classTrait',
#instVars : [
'eventDispatcher'
],
#category : #'Bloc-Examples-Event'
#category : #'Bloc-Tests-Events'
}

{ #category : #accessing }
BlExampleCustomEventTarget >> eventDispatcher [
BlMockedEventTarget >> eventDispatcher [
"Return an object responsible for event dispatching"
<return: #BlDirectEventDispatcher>

^ eventDispatcher
]

{ #category : #initialization }
BlExampleCustomEventTarget >> initialize [
BlMockedEventTarget >> initialize [
super initialize.

eventDispatcher := BlDirectEventDispatcher on: self
Expand Down

0 comments on commit 37d782f

Please sign in to comment.