Skip to content

Commit

Permalink
Merge branch 'Pharo12' into Pharo11
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanlm authored Apr 12, 2024
2 parents bffc819 + d585a91 commit 57a0256
Show file tree
Hide file tree
Showing 1,421 changed files with 25,100 additions and 15,746 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/spec-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ env:

on:
push:
branches: [ Pharo11 ]
branches: [ Pharo12 ]
pull_request:
branches: [ Pharo11 ]
branches: [ Pharo12 ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -19,15 +19,15 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest ]
smalltalk: [ Pharo64-11 ]
smalltalk: [ Pharo64-12 ]
runs-on: ${{ matrix.os }}
name: ${{ matrix.smalltalk }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup smalltalkCI
uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-version: ${{ matrix.smalltalk }}
smalltalk-image: ${{ matrix.smalltalk }}
- name: Load Image and Run Release Tests
run: smalltalkci -s ${{ matrix.smalltalk }} .smalltalk.release.ston
timeout-minutes: 10
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ env:

on:
push:
branches: [ Pharo11, dev-1.0 ]
branches: [ Pharo12, dev-3.0 ]
pull_request:
branches: [ Pharo11, dev-1.0 ]
branches: [ Pharo12, dev-3.0 ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -19,7 +19,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest ]
smalltalk: [ Pharo64-11 ]
smalltalk: [ Pharo64-12 ]
runs-on: ${{ matrix.os }}
name: ${{ matrix.smalltalk }} on ${{ matrix.os }}
steps:
Expand Down
1 change: 1 addition & 0 deletions .smalltalk.all.ston
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ SmalltalkCISpec {
'Monticello.*',
'Metacello.*',
'System-Settings-Tests.*',
'RPackage.*',
'ReleaseTests.*' ],
#classes : [
#OutOfMemoryTest,
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ Spec is a framework in Pharo for describing user interfaces.

## Install Spec

It is possible to load the latest version of Spec in Pharo 10 with following script:
Spec is included in any regular Pharo image.
It is possible to load the latest version executing following script:


```Smalltalk
Metacello new
repository: 'github://pharo-spec/Spec:Pharo10';
repository: 'github://pharo-spec/Spec';
baseline: 'Spec2';
onConflict: [ :e | e useIncoming ];
onUpgrade: [ :e | e useIncoming ];
Expand Down
50 changes: 19 additions & 31 deletions src/BaselineOfSpec2/BaselineOfSpec2.class.st
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Class {
#name : #BaselineOfSpec2,
#superclass : #BaselineOf,
#category : #BaselineOfSpec2
#name : 'BaselineOfSpec2',
#superclass : 'BaselineOf',
#category : 'BaselineOfSpec2',
#package : 'BaselineOfSpec2'
}

{ #category : #baseline }
{ #category : 'baseline' }
BaselineOfSpec2 >> baseline: spec [
<baseline>

Expand Down Expand Up @@ -49,7 +50,7 @@ BaselineOfSpec2 >> baseline: spec [
spec group: 'default' with: #('Base' 'Tests' 'Code' 'CodeTests').
]

{ #category : #'external projects' }
{ #category : 'external projects' }
BaselineOfSpec2 >> defaultRepositoryURL [

^ self class environment
Expand All @@ -58,22 +59,7 @@ BaselineOfSpec2 >> defaultRepositoryURL [
ifAbsent: [ 'github://pharo-spec/Spec' ]
]

{ #category : #'external projects' }
BaselineOfSpec2 >> packageRepository [

" Tries to determine a repository from which the baseline is being loaded. Useful for
refering other baselines in the same repository. "

^ (self class package mcWorkingCopy repositoryGroup repositories
reject: [:each | each = MCCacheRepository uniqueInstance])
ifNotEmpty: [ :repositories |
repositories
detect: [ :each | each description beginsWith: 'tonel://' ]
ifNone: [ repositories anyOne ] ]
ifEmpty: [ nil ]
]

{ #category : #accessing }
{ #category : 'accessing' }
BaselineOfSpec2 >> project [
"Atomic loading is needed for Spec because we are moving classes of package and it breaks their subclasses.
Expand All @@ -99,21 +85,23 @@ We need to use atomic loading only during update of existing Spec upgrade"

]

{ #category : #'external projects' }
{ #category : 'external projects' }
BaselineOfSpec2 >> specCore: spec [

spec baseline: 'SpecCore' with: [
spec
repository: (self packageRepositoryURL ifEmpty: [ self defaultRepositoryURL ]);
loads: #('Base' 'Tests') ]
spec baseline: 'SpecCore' with: [
spec
repository: ((self packageRepositoryURLForSpec: spec) ifEmpty: [
self defaultRepositoryURL ]);
loads: #( 'Base' 'Tests' ) ]
]

{ #category : #'external projects' }
{ #category : 'external projects' }
BaselineOfSpec2 >> specCoreCode: spec [

spec baseline: 'SpecCoreCode' with: [
spec
repository: (self packageRepositoryURL ifEmpty: [ self defaultRepositoryURL ]);
spec baseline: 'SpecCoreCode' with: [
spec
repository: ((self packageRepositoryURLForSpec: spec) ifEmpty: [
self defaultRepositoryURL ]);
className: 'BaselineOfSpecCore';
loads: #('Code' 'CodeTests') ]
loads: #( 'Code' 'CodeTests' ) ]
]
2 changes: 1 addition & 1 deletion src/BaselineOfSpec2/package.st
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Package { #name : #BaselineOfSpec2 }
Package { #name : 'BaselineOfSpec2' }
26 changes: 15 additions & 11 deletions src/BaselineOfSpecCore/BaselineOfSpecCore.class.st
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Class {
#name : #BaselineOfSpecCore,
#superclass : #BaselineOf,
#category : #BaselineOfSpecCore
#name : 'BaselineOfSpecCore',
#superclass : 'BaselineOf',
#category : 'BaselineOfSpecCore',
#package : 'BaselineOfSpecCore'
}

{ #category : #baseline }
{ #category : 'baseline' }
BaselineOfSpecCore >> baseline: spec [
<baseline>

Expand All @@ -13,15 +14,19 @@ BaselineOfSpecCore >> baseline: spec [

spec
"Core"
package: 'Spec2-ObservableSlot';
package: 'Spec2-Layout' with: [ spec requires: #('Spec2-ObservableSlot') ];
package: 'Spec2-Core' with: [ spec requires: #('Spec2-ObservableSlot' 'Spec2-Layout') ];
package: 'Spec2-Layout';
package: 'Spec2-Core' with: [ spec requires: #('Spec2-Layout') ];
package: 'Spec2-Dialogs' with: [ spec requires: #('Spec2-Core') ];
package: 'Spec2-Dialogs-Tests' with: [ spec requires: #('Spec2-Dialogs') ];
package: 'Spec2-CommandLine' with: [ spec requires: #('Spec2-Core') ];
package: 'Spec2-Commands';
package: 'Spec2-Transmission' with: [ spec requires: #('Spec2-Core') ];
package: 'Spec2-Interactions' with: [ spec requires: #('Spec2-Core') ];
package: 'Spec2-Commander2' with: [ spec requires: #('Spec2-Core' 'Spec2-Interactions') ];
"ListView"
package: 'Spec2-ListView' with: [ spec requires: #('Spec2-Core') ];
package: 'Spec2-Adapters-Morphic-ListView' with: [ spec requires: #('Spec2-ListView') ];
package: 'Spec2-ListView-Tests' with: [ spec requires: #('Spec2-ListView') ];
"Code"
package: 'Spec2-Code' with: [ spec requires: #('Spec2-Core' 'Spec2-Commands') ];
package: 'Spec2-Code-Commands' with: [ spec requires: #('Spec2-Core' 'Spec2-Commands') ];
Expand All @@ -32,7 +37,7 @@ BaselineOfSpecCore >> baseline: spec [
"Tests"
package: 'Spec2-Adapters-Stub' with: [ spec requires: #('Spec2-Core') ];
package: 'Spec2-Commander2-Tests' with: [ spec requires: #('Spec2-Commander2') ];
package: 'Spec2-Tests' with: [ spec requires: #('Spec2-Core' 'Spec2-Examples') ];
package: 'Spec2-Tests' with: [ spec requires: #('Spec2-Core' 'Spec2-Examples' 'Spec2-Dialogs-Tests') ];
package: 'Spec2-Code-Tests' with: [ spec requires: #('Spec2-Tests' 'Spec2-Code') ];
package: 'Spec2-Code-Diff-Tests' with: [ spec requires: #('Spec2-Tests' 'Spec2-Code-Diff') ];
"Examples"
Expand All @@ -44,7 +49,6 @@ BaselineOfSpecCore >> baseline: spec [
].

spec group: 'Core' with: #(
'Spec2-ObservableSlot'
'Spec2-Layout'
'Spec2-Transmission'
'Spec2-Commands'
Expand All @@ -66,14 +70,14 @@ BaselineOfSpecCore >> baseline: spec [
spec group: 'default' with: #('Base' 'BaseTests' 'Code' 'CodeTests').
]

{ #category : #'external projects' }
{ #category : 'external projects' }
BaselineOfSpecCore >> pillar: spec [
spec
baseline: 'PillarCore'
with: [ spec repository: 'github://pillar-markup/pillar:dev-8/src' ]
]

{ #category : #accessing }
{ #category : 'accessing' }
BaselineOfSpecCore >> project [
"Atomic loading is needed for Spec because we are moving classes of package and it breaks their subclasses.
Expand Down
2 changes: 1 addition & 1 deletion src/BaselineOfSpecCore/package.st
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Package { #name : #BaselineOfSpecCore }
Package { #name : 'BaselineOfSpecCore' }
43 changes: 43 additions & 0 deletions src/Spec2-Adapters-Morphic-Alexandrie/SpAlexandrieMorph.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Class {
#name : #SpAlexandrieMorph,
#superclass : #Morph,
#instVars : [
'surface',
'drawBlock',
'lastExtent'
],
#category : #'Spec2-Adapters-Morphic-Alexandrie-Base'
}

{ #category : #accessing }
SpAlexandrieMorph >> drawBlock: aBlock [

drawBlock := aBlock
]

{ #category : #drawing }
SpAlexandrieMorph >> drawOn: aMorphicCanvas [

self redraw.
self surface
displayOnMorphicCanvas: aMorphicCanvas
at: bounds origin
]

{ #category : #drawing }
SpAlexandrieMorph >> redraw [

self surface drawDuring: [ :canvas |
drawBlock
cull: canvas
cull: (0@0 extent: self extent) ]
]

{ #category : #accessing }
SpAlexandrieMorph >> surface [

lastExtent = self extent ifFalse: [ surface := nil ].
^ surface ifNil: [
lastExtent := self extent.
surface := AthensCairoSurface extent: self extent ]
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Class {
#name : #SpMorphicAlexandrieAdapter,
#superclass : #SpAbstractMorphicAdapter,
#category : #'Spec2-Adapters-Morphic-Alexandrie-Base'
}

{ #category : #factory }
SpMorphicAlexandrieAdapter >> buildWidget [

| instance |
instance := SpAthensMorph new.
self presenter whenDrawBlockChangedDo: [ :newBlock |
instance drawBlock: newBlock ].
self presenter whenExtentChangedDo: [ :newExtent |
instance extent: newExtent ].
instance extent: self presenter surfaceExtent.
instance drawBlock: self presenter drawBlock.
instance setBalloonText: self model help.
self presenter whenHelpChangedDo: [
instance setBalloonText: self model help ].
^ instance
]

{ #category : #drawing }
SpMorphicAlexandrieAdapter >> redraw [

widget redraw
]

{ #category : #accessing }
SpMorphicAlexandrieAdapter >> surface [

^ widget surface
]
1 change: 1 addition & 0 deletions src/Spec2-Adapters-Morphic-Alexandrie/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : #'Spec2-Adapters-Morphic-Alexandrie' }
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
"
A morphic adapter for `SpListViewPresenter`
"
Class {
#name : 'SpMorphicListViewAdapter',
#superclass : 'SpMorphicListAdapter',
#category : 'Spec2-Adapters-Morphic-ListView',
#package : 'Spec2-Adapters-Morphic-ListView'
}

{ #category : 'factory' }
SpMorphicListViewAdapter >> buildWidget [
| datasource |

datasource := self newDataSource.
datasource model: self model.
widget := self newTableWith: datasource.

self presenter whenModelChangedDo: [ widget refresh ].
self presenter whenSelectionChangedDo: [ self refreshWidgetSelection ].
self presenter selection whenChangedDo: [ self refreshWidgetSelection ].

self refreshWidgetSelection.
self configureScrolling.

^ widget
]

{ #category : 'factory' }
SpMorphicListViewAdapter >> newDataSource [

^ SpMorphicListViewDataSource new
]

{ #category : 'factory' }
SpMorphicListViewAdapter >> newTableWith: datasource [

^ SpFTTableMorph new
disableFunction;
dataSource: datasource;
hideColumnHeaders;
beResizable;
setMultipleSelection: self model isMultipleSelection;
dragEnabled: self dragEnabled;
dropEnabled: self dropEnabled;
setBalloonText: self help;
hResizing: #spaceFill;
vResizing: #spaceFill;
onAnnouncement: FTSelectionChanged send: #selectionChanged: to: self;
onAnnouncement: FTStrongSelectionChanged send: #strongSelectionChanged: to: self;
yourself
]
Loading

0 comments on commit 57a0256

Please sign in to comment.