Skip to content

Commit

Permalink
Merge 5187f7e
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyan11 committed Jun 24, 2024
2 parents cd6ec10 + 5187f7e commit 6bc246a
Show file tree
Hide file tree
Showing 52 changed files with 2,573 additions and 1,610 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/Pharo11CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ on:
- 'main'
pull_request:
types: [assigned, opened, synchronize, reopened]
schedule:
- cron: '0 12 * * 0'

jobs:
build:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/Pharo13CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 'Pharo 13 CI'

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

on:
push:
branches:
- 'master'
pull_request:
types: [assigned, opened, synchronize, reopened]
schedule:
- cron: '0 12 * * 0'

jobs:
build:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
smalltalk: [ Pharo64-13 ]
runs-on: ${{ matrix.os }}
name: ${{ matrix.smalltalk }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-image: ${{ matrix.smalltalk }}
- name: Load in New Image and Run Tests
run: smalltalkci -s ${{ matrix.smalltalk }} ${{ matrix.ston }}
shell: bash
timeout-minutes: 15
2 changes: 1 addition & 1 deletion .smalltalk.ston
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SmalltalkCISpec {
}
],
#testing : {
#packages : [ 'Pyramid.*' ],
#categories : [ 'Pyramid*' ],
#packages : [ 'Bloc-Serialization.*' ]
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[![License](https://img.shields.io/github/license/openSmock/Pyramid.svg)](./LICENSE)
[![Pharo 11 CI](https://github.com/OpenSmock/Pyramid/actions/workflows/Pharo11CI.yml/badge.svg)](https://github.com/OpenSmock/Pyramid/actions/workflows/Pharo11CI.yml)
[![Pharo 12 CI](https://github.com/OpenSmock/Pyramid/actions/workflows/Pharo12CI.yml/badge.svg)](https://github.com/OpenSmock/Pyramid/actions/workflows/Pharo12CI.yml)
[![Pharo 13 CI](https://github.com/OpenSmock/Pyramid/actions/workflows/Pharo13CI.yml/badge.svg)](https://github.com/OpenSmock/Pyramid/actions/workflows/Pharo13CI.yml)

# Pyramid

Expand Down
32 changes: 17 additions & 15 deletions src/BaselineOfPyramid/BaselineOfPyramid.class.st
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
Class {
#name : #BaselineOfPyramid,
#superclass : #BaselineOf,
#category : #BaselineOfPyramid
#name : 'BaselineOfPyramid',
#superclass : 'BaselineOf',
#category : 'BaselineOfPyramid',
#package : 'BaselineOfPyramid'
}

{ #category : #baselines }
{ #category : 'baselines' }
BaselineOfPyramid >> baseline: spec [

<baseline>
"Common baseline for all Pharo versions"
spec for: #common do: [ self baselineForCommon: spec ]
]

{ #category : #baselines }
{ #category : 'baselines' }
BaselineOfPyramid >> baselineForCommon: spec [

<baseline>
Expand All @@ -34,7 +35,7 @@ BaselineOfPyramid >> baselineForCommon: spec [
spec group: 'ToploUI' with: self toploPackagesNames "only Bloc and Toplo"
]

{ #category : #dependencies }
{ #category : 'dependencies' }
BaselineOfPyramid >> blocDependencies: spec [

spec
Expand All @@ -46,7 +47,7 @@ BaselineOfPyramid >> blocDependencies: spec [
spec repository: 'github://OpenSmock/Bloc-Serialization:main/src' ]
]

{ #category : #packages }
{ #category : 'packages' }
BaselineOfPyramid >> blocPackages: spec [

spec
Expand All @@ -60,24 +61,24 @@ BaselineOfPyramid >> blocPackages: spec [
with: [ spec requires: #( 'Pyramid-Bloc' ) ]
]

{ #category : #packages }
{ #category : 'packages' }
BaselineOfPyramid >> blocPackagesNames [

^ #( 'Pyramid' 'Pyramid-Bloc' 'Pyramid-Tests' 'Pyramid-IDE' 'Pyramid-Examples' )
]

{ #category : #actions }
{ #category : 'actions' }
BaselineOfPyramid >> postload: loader package: packageSpec [

PyramidPluginManager reset
]

{ #category : #actions }
{ #category : 'actions' }
BaselineOfPyramid >> preload: loader package: packageSpec [

]

{ #category : #packages }
{ #category : 'packages' }
BaselineOfPyramid >> pyramidPackages: spec [

spec package: 'Pyramid'.
Expand All @@ -87,18 +88,19 @@ BaselineOfPyramid >> pyramidPackages: spec [

]

{ #category : #dependencies }
{ #category : 'dependencies' }
BaselineOfPyramid >> toploDependencies: spec [

spec
baseline: 'Toplo'
with: [ spec repository: 'github://pharo-graphics/Toplo:master/src' ].
spec
baseline: 'ToploSerialization'
with: [ spec repository: 'github://OpenSmock/Toplo-Serialization:main/src' ]
with: [
spec repository: 'github://OpenSmock/Toplo-Serialization:main/src' ]
]

{ #category : #packages }
{ #category : 'packages' }
BaselineOfPyramid >> toploPackages: spec [

spec
Expand All @@ -112,7 +114,7 @@ BaselineOfPyramid >> toploPackages: spec [
with: [ spec requires: #( 'Pyramid-Toplo' ) ]
]

{ #category : #packages }
{ #category : 'packages' }
BaselineOfPyramid >> toploPackagesNames [

| packages |
Expand Down
2 changes: 1 addition & 1 deletion src/BaselineOfPyramid/package.st
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Package { #name : #BaselineOfPyramid }
Package { #name : 'BaselineOfPyramid' }
19 changes: 19 additions & 0 deletions src/Pyramid-Bloc/BlElement.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,22 @@ BlElement >> asIcon [

^ self layout asIcon
]

{ #category : '*Pyramid-Bloc' }
BlElement >> editWithPyramid [

| editor oldParent |
editor := PyramidEditor buildEditor.

self flag:
'labordep: the code below is too complicated, we need to have a more simple API to edit a BlElement, for example editElement:'.
oldParent := self parent.
self hasParent ifTrue: [ oldParent removeChild: self ].

editor projectModel firstLevelElements add: self.
editor window whenClosedDo: [
oldParent ifNotNil: [ oldParent addChild: self ] ].

editor window open.
^ editor
]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : 'BlSpace' }

{ #category : '*Pyramid' }
{ #category : '*Pyramid-Bloc' }
BlSpace >> editWithPyramid [

| editor elements spacePlaceholder openFromSpacePlugin |
Expand Down
6 changes: 4 additions & 2 deletions src/Pyramid-Bloc/PyramidBackgroundOpacityCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ PyramidBackgroundOpacityCommand >> getValueFor: aBlElement [
{ #category : 'as yet unclassified' }
PyramidBackgroundOpacityCommand >> setValueFor: aBlElement with: anArgument [

aBlElement background: aBlElement background paint asBlBackground.
aBlElement background opacity: anArgument
| background |
background := aBlElement background paint asBlBackground.
background opacity: anArgument.
aBlElement background: background
]
5 changes: 4 additions & 1 deletion src/Pyramid-Bloc/PyramidBlocPlugin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,16 @@ PyramidBlocPlugin >> addPanelsOn: aPyramidSimpleWindow [
{ #category : 'connecting' }
PyramidBlocPlugin >> connectOn: aPyramidEditor [

"Configure the sort function."
aPyramidEditor projectModel firstLevelElements sortFunction: PyramidElevationSortFunction new.

self editor: aPyramidEditor.
aPyramidEditor propertiesManager addProperty: self class elementId.
aPyramidEditor propertiesManager addProperty: self class visibility.
aPyramidEditor propertiesManager addProperty: self class zIndex.
aPyramidEditor propertiesManager addProperty: self class clipChildren.
aPyramidEditor propertiesManager addProperty: self class geometry.
aPyramidEditor propertiesManager addProperty: self class cornerRadii.
aPyramidEditor propertiesManager addProperty: self class cornerRadii
]

{ #category : 'accessing' }
Expand Down
77 changes: 77 additions & 0 deletions src/Pyramid-Bloc/PyramidCopyPastePlugin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Class {
#superclass : 'Object',
#traits : 'TPyramidPlugin',
#classTraits : 'TPyramidPlugin classTrait',
#instVars : [
'projectModel'
],
#category : 'Pyramid-Bloc-plugin-copy-paste',
#package : 'Pyramid-Bloc',
#tag : 'plugin-copy-paste'
Expand All @@ -16,6 +19,12 @@ PyramidCopyPastePlugin >> addPanelsOn: aPyramidSimpleWindow [
addItem: [ :builder | self copyAsStonMenu: builder ]
]

{ #category : 'connecting' }
PyramidCopyPastePlugin >> connectOn: aPyramidEditor [

self projectModel: aPyramidEditor projectModel
]

{ #category : 'copying' }
PyramidCopyPastePlugin >> copyAsStonInClipboard: aCollection [

Expand All @@ -25,6 +34,24 @@ PyramidCopyPastePlugin >> copyAsStonInClipboard: aCollection [
{ #category : 'copying' }
PyramidCopyPastePlugin >> copyAsStonMenu: aBuilder [

aBuilder
addGroupEmptySelection: [ :group :empty |
group
addItem: [ :item |
item
icon: (Smalltalk ui icons iconNamed: #smallCopy);
name: 'Copy (select only one element)';
enabled: false;
yourself ];
addItem: [ :item |
item
icon: (Smalltalk ui icons iconNamed: #smallPaste);
name: 'Paste';
action: [ self pasteAsStonInClipboardOnRoots ];
yourself ];
yourself ]
order: 20.

aBuilder
addGroupSingleSelection: [ :group :single |
group
Expand All @@ -34,6 +61,12 @@ PyramidCopyPastePlugin >> copyAsStonMenu: aBuilder [
name: 'Copy';
action: [ self copyAsStonInClipboard: { single } ];
yourself ];
addItem: [ :item |
item
icon: (Smalltalk ui icons iconNamed: #smallPaste);
name: 'Paste';
action: [ self pasteAsStonInClipboard: single ];
yourself ];
yourself ]
order: 20.

Expand All @@ -46,6 +79,50 @@ PyramidCopyPastePlugin >> copyAsStonMenu: aBuilder [
name: 'Copy (select only one element)';
enabled: false;
yourself ];
addItem: [ :item |
item
icon: (Smalltalk ui icons iconNamed: #smallPaste);
name: 'Paste (select only one element)';
enabled: false;
yourself ];
yourself ]
order: 20
]

{ #category : 'copying' }
PyramidCopyPastePlugin >> pasteAsStonInClipboard: aBlElement [

| copiedElement |
[ copiedElement := BlSerializer materialize: Clipboard clipboardText ]
on: BlocMaterializationError
do: [
UIManager default inform: 'Cannot paste the clipboard.'.
^ self ].
aBlElement addChildren: copiedElement.
self projectModel informElementsChanged
]

{ #category : 'copying' }
PyramidCopyPastePlugin >> pasteAsStonInClipboardOnRoots [

| copiedElement |
[ copiedElement := BlSerializer materialize: Clipboard clipboardText ]
on: BlocMaterializationError
do: [
UIManager default inform: 'Cannot paste the clipboard.'.
^ self ].
self projectModel firstLevelElements addAll: copiedElement.
self projectModel informFirstLevelElementsChanged
]

{ #category : 'accessing' }
PyramidCopyPastePlugin >> projectModel [

^ projectModel
]

{ #category : 'accessing' }
PyramidCopyPastePlugin >> projectModel: anObject [

projectModel := anObject
]
21 changes: 8 additions & 13 deletions src/Pyramid-Bloc/PyramidMainExtension.class.st
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
Class {
#name : 'PyramidMainExtension',
#superclass : 'Object',
#traits : 'TPyramidSpaceExtension + TPyramidEditorExtension + TPyramidProjectModelObserver + TPyramidEditorTransformationObserver',
#classTraits : 'TPyramidSpaceExtension classTrait + TPyramidEditorExtension classTrait + TPyramidProjectModelObserver classTrait + TPyramidEditorTransformationObserver classTrait',
#traits : 'TPyramidSpaceExtension + TPyramidEditorExtension + TPyramidEditorTransformationObserver',
#classTraits : 'TPyramidSpaceExtension classTrait + TPyramidEditorExtension classTrait + TPyramidEditorTransformationObserver classTrait',
#instVars : [
'containerElement',
'projectModel',
'borderElement',
'sizeElement',
'extentButton',
Expand Down Expand Up @@ -143,24 +142,20 @@ PyramidMainExtension >> offsetTranslation [
^ 50 @ 50
]

{ #category : 'accessing' }
PyramidMainExtension >> projectModel [

^ projectModel
]

{ #category : 'accessing' }
PyramidMainExtension >> projectModel: aProjectModel [

projectModel:= aProjectModel.
aProjectModel addObserver: self.
aProjectModel announcer
when: PyramidFirstLevelElementsChangedEvent
do: [ :evt | self pyramidFirstLevelElementsChanged: evt ]
for: self
]

{ #category : 'as yet unclassified' }
PyramidMainExtension >> pyramidFirstLevelElementsChanged [
PyramidMainExtension >> pyramidFirstLevelElementsChanged: anEvent [

self containerElement removeChildren.
(self projectModel firstLevelElements asArray sorted:
(anEvent firstLevelElements asArray sorted:
PyramidElevationSortFunction new) do: [ :each |
each parent ifNotNil: [ :p | p removeChild: each ].
self containerElement addChild: each ]
Expand Down
8 changes: 8 additions & 0 deletions src/Pyramid-Bloc/PyramidProjectModel.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Extension { #name : 'PyramidProjectModel' }

{ #category : '*Pyramid-Bloc' }
PyramidProjectModel >> allElements [

^ PyramidElementsManipulationHelper flattenChildrenOfCollection:
self firstLevelElements
]
Loading

0 comments on commit 6bc246a

Please sign in to comment.