Skip to content

Commit

Permalink
Merge branch 'dev-1.0' into pr352
Browse files Browse the repository at this point in the history
  • Loading branch information
Enzo-Demeulenaere committed Dec 4, 2023
2 parents 2ec2430 + 11fb55b commit 98a6d1f
Show file tree
Hide file tree
Showing 229 changed files with 3,281 additions and 2,919 deletions.
10 changes: 6 additions & 4 deletions src/Bloc-Alexandrie-Tests/BAHitFormFactory.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
My only purpose is creating a Form from a BlSpace, where each pixel tells what BlElement (or nil) would be hitted by the mouse pointer.
"
Class {
#name : #BAHitFormFactory,
#superclass : #Object,
#category : #'Bloc-Alexandrie-Tests-Utilities'
#name : 'BAHitFormFactory',
#superclass : 'Object',
#category : 'Bloc-Alexandrie-Tests-Utilities',
#package : 'Bloc-Alexandrie-Tests',
#tag : 'Utilities'
}

{ #category : #'instance creation' }
{ #category : 'instance creation' }
BAHitFormFactory class >> newFormFor: aSpace [

| allElements colors colorByElement aForm |
Expand Down
24 changes: 13 additions & 11 deletions src/Bloc-Alexandrie-Tests/BAHitTest.class.st
Original file line number Diff line number Diff line change
@@ -1,57 +1,59 @@
Class {
#name : #BAHitTest,
#superclass : #AePixelMatchTest,
#category : #'Bloc-Alexandrie-Tests-Base'
#name : 'BAHitTest',
#superclass : 'AePixelMatchTest',
#category : 'Bloc-Alexandrie-Tests-Base',
#package : 'Bloc-Alexandrie-Tests',
#tag : 'Base'
}

{ #category : #exporting }
{ #category : 'exporting' }
BAHitTest class >> allFormSelectors [

^ BlSpaceFixture allFixtureSelectors
]

{ #category : #convenience }
{ #category : 'convenience' }
BAHitTest class >> exportAll [
<script: 'super exportAll' >

super exportAll
]

{ #category : #convenience }
{ #category : 'convenience' }
BAHitTest class >> inspectAll [
<script: 'super inspectAll'>

super inspectAll
]

{ #category : #convenience }
{ #category : 'convenience' }
BAHitTest class >> inspectMismatches [
<script: 'super inspectMismatches'>

super inspectMismatches
]

{ #category : #tests }
{ #category : 'tests' }
BAHitTest >> actualForm [

^ self hitFormFor: formSelector host: BlOSWindowSDL2Host new
]

{ #category : #tests }
{ #category : 'tests' }
BAHitTest >> expectedFormsDirectory [

| repo |
repo := IceRepository registry detect: [ :each | each name asLowercase = 'bloc' ].
^ repo location / 'tests' / 'hit'
]

{ #category : #tests }
{ #category : 'tests' }
BAHitTest >> formBehavior [

^ BlSpaceFixture new
]

{ #category : #tests }
{ #category : 'tests' }
BAHitTest >> hitFormFor: aSymbol host: aHost [

| aSpace |
Expand Down
22 changes: 12 additions & 10 deletions src/Bloc-Alexandrie-Tests/BARenderTest.class.st
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
Class {
#name : #BARenderTest,
#superclass : #AePixelMatchTest,
#category : #'Bloc-Alexandrie-Tests-Base'
#name : 'BARenderTest',
#superclass : 'AePixelMatchTest',
#category : 'Bloc-Alexandrie-Tests-Base',
#package : 'Bloc-Alexandrie-Tests',
#tag : 'Base'
}

{ #category : #exporting }
{ #category : 'exporting' }
BARenderTest class >> allFormSelectors [

^ BlSpaceFixture allFixtureSelectors
]

{ #category : #convenience }
{ #category : 'convenience' }
BARenderTest class >> exportAll [
<script: 'super exportAll' >

super exportAll
]

{ #category : #convenience }
{ #category : 'convenience' }
BARenderTest class >> inspectAll [
<script: 'super inspectAll'>

super inspectAll
]

{ #category : #convenience }
{ #category : 'convenience' }
BARenderTest class >> inspectMismatches [
<script: 'super inspectMismatches'>

super inspectMismatches
]

{ #category : #hooks }
{ #category : 'hooks' }
BARenderTest >> actualForm [

| aSpace |
Expand All @@ -42,15 +44,15 @@ BARenderTest >> actualForm [
^ aSpace aeAsForm
]

{ #category : #tests }
{ #category : 'tests' }
BARenderTest >> expectedFormsDirectory [

| repo |
repo := IceRepository registry detect: [ :each | each name asLowercase = 'bloc' ].
^ repo location / 'tests' / 'render'
]

{ #category : #tests }
{ #category : 'tests' }
BARenderTest >> formBehavior [

^ BlSpaceFixture new
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #BlCompositeBackgroundTest }
Extension { #name : 'BlCompositeBackgroundTest' }

{ #category : #'*Bloc-Alexandrie-Tests' }
{ #category : '*Bloc-Alexandrie-Tests' }
BlCompositeBackgroundTest >> testAeApplyTo [

| space background blElement backgroundList |
Expand Down
46 changes: 24 additions & 22 deletions src/Bloc-Alexandrie-Tests/BlSpaceBuilder.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,35 @@
My purpose is making easier to create BlSpaces with elements.
"
Class {
#name : #BlSpaceBuilder,
#superclass : #Object,
#name : 'BlSpaceBuilder',
#superclass : 'Object',
#instVars : [
'space',
'random',
'spaceExtent',
'host',
'alphabetGenerator'
],
#category : #'Bloc-Alexandrie-Tests-Utilities'
#category : 'Bloc-Alexandrie-Tests-Utilities',
#package : 'Bloc-Alexandrie-Tests',
#tag : 'Utilities'
}

{ #category : #convenience }
{ #category : 'convenience' }
BlSpaceBuilder class >> newSpaceWith: aUnaryBlockClosure [

^ self new newSpaceWith: aUnaryBlockClosure
]

{ #category : #'adding elements' }
{ #category : 'adding elements' }
BlSpaceBuilder >> addCircle [

^ self addToRoot
geometry: BlCircleGeometry new;
yourself
]

{ #category : #'adding elements' }
{ #category : 'adding elements' }
BlSpaceBuilder >> addHexagonalPolygon [
"Answer an hexagon polygon."

Expand All @@ -47,7 +49,7 @@ BlSpaceBuilder >> addHexagonalPolygon [
yourself
]

{ #category : #'adding elements' }
{ #category : 'adding elements' }
BlSpaceBuilder >> addPolyline [
"Answer a simple polyline of 3 vertices. Polylines are open, then don't look good with other outskirts than centered."

Expand All @@ -58,7 +60,7 @@ BlSpaceBuilder >> addPolyline [
yourself
]

{ #category : #'adding elements' }
{ #category : 'adding elements' }
BlSpaceBuilder >> addText: aBlRopedText to: parentElement [

| anElement |
Expand All @@ -71,13 +73,13 @@ BlSpaceBuilder >> addText: aBlRopedText to: parentElement [

]

{ #category : #'adding elements' }
{ #category : 'adding elements' }
BlSpaceBuilder >> addTextToRoot: aBlRopedText [

^ self addText: aBlRopedText to: space root
]

{ #category : #'adding elements' }
{ #category : 'adding elements' }
BlSpaceBuilder >> addTo: parentElement [

| anElement |
Expand All @@ -90,21 +92,21 @@ BlSpaceBuilder >> addTo: parentElement [

]

{ #category : #'adding elements' }
{ #category : 'adding elements' }
BlSpaceBuilder >> addToRoot [

^ self addTo: space root
]

{ #category : #'adding elements' }
{ #category : 'adding elements' }
BlSpaceBuilder >> addTriangle [

^ self addToRoot
geometry: BlTriangleGeometry new;
yourself
]

{ #category : #building }
{ #category : 'building' }
BlSpaceBuilder >> buildSpace [
"Make last set up before user can use the space."

Expand All @@ -118,19 +120,19 @@ BlSpaceBuilder >> buildSpace [
forceLayout.
]

{ #category : #accessing }
{ #category : 'accessing' }
BlSpaceBuilder >> host [

^ host
]

{ #category : #accessing }
{ #category : 'accessing' }
BlSpaceBuilder >> host: aBlHost [

host := aBlHost
]

{ #category : #initialization }
{ #category : 'initialization' }
BlSpaceBuilder >> initialize [

super initialize.
Expand All @@ -143,7 +145,7 @@ BlSpaceBuilder >> initialize [
alphabetGenerator := self newAlphabetGenerator
]

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

^ Generator on: [ :generator |
Expand All @@ -159,7 +161,7 @@ BlSpaceBuilder >> newAlphabetGenerator [
index := index + 1 ] repeat ]
]

{ #category : #'instance creation' }
{ #category : 'instance creation' }
BlSpaceBuilder >> newSpaceWith: aUnaryBlockClosure [

aUnaryBlockClosure value: self.
Expand All @@ -168,25 +170,25 @@ BlSpaceBuilder >> newSpaceWith: aUnaryBlockClosure [
space
]

{ #category : #accessing }
{ #category : 'accessing' }
BlSpaceBuilder >> nextColor [

^ Color random: random
]

{ #category : #accessing }
{ #category : 'accessing' }
BlSpaceBuilder >> space [

^ space
]

{ #category : #accessing }
{ #category : 'accessing' }
BlSpaceBuilder >> spaceExtent [

^ spaceExtent
]

{ #category : #accessing }
{ #category : 'accessing' }
BlSpaceBuilder >> spaceExtent: aPoint [

spaceExtent := aPoint
Expand Down
Loading

0 comments on commit 98a6d1f

Please sign in to comment.