Skip to content

Commit

Permalink
Merge pull request #182 from OpenSmock/Nyan11-patch-1
Browse files Browse the repository at this point in the history
Update .smalltalk.ston
  • Loading branch information
labordep authored Jun 21, 2024
2 parents 484d7a0 + c29f428 commit 312b36e
Show file tree
Hide file tree
Showing 47 changed files with 1,645 additions and 360 deletions.
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.*' ]
}
}
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
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
]
13 changes: 6 additions & 7 deletions src/Pyramid-Bloc/PyramidSaveModelVerifier.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ PyramidSaveModelVerifier class >> classPackageIsEqual [

^ self new
verifyBlock: [ :model |
self class environment
Smalltalk globals
at: model savingClassName asSymbol
ifPresent: [ :class | "
Model = class package >> OK
Expand All @@ -35,12 +35,11 @@ PyramidSaveModelVerifier class >> classPackageIsEqual [
class package name = model savingPackageName
ifTrue: [ true ]
ifFalse: [
class package tags
detect: [ :tag | tag includesClass: class ]
ifFound: [ :tag |
class package name , '-' , tag name
= model savingPackageName ]
ifNone: [ false ] ] ]
(model savingPackageName endsWith: class packageTag name)
ifFalse: [ false ]
ifTrue: [
model savingPackageName = (class package name , '-'
, class packageTag name) ] ] ]
ifAbsent: [ true ] ];
showBlock: [ :view | view showClassPackageIsNotEqualError ];
yourself
Expand Down
3 changes: 2 additions & 1 deletion src/Pyramid-Bloc/PyramidSavePlugin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ PyramidSavePlugin >> connectOn: aPyramidEditor [

self projectModel: aPyramidEditor projectModel.
self saveModel projectModel: aPyramidEditor projectModel.
aPyramidEditor projectModel addObserver: self inputsController
self inputsController projectModel: aPyramidEditor projectModel.

]

{ #category : 'initialization' }
Expand Down
28 changes: 16 additions & 12 deletions src/Pyramid-Bloc/PyramidSaveProjectConfigurationController.class.st
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
Class {
#name : 'PyramidSaveProjectConfigurationController',
#superclass : 'Object',
#traits : 'TPyramidProjectModelObserver',
#classTraits : 'TPyramidProjectModelObserver classTrait',
#instVars : [
'view',
'saveModel',
Expand Down Expand Up @@ -55,17 +53,16 @@ PyramidSaveProjectConfigurationController >> isSaved [
]

{ #category : 'as yet unclassified' }
PyramidSaveProjectConfigurationController >> pyramidElementsChanged [
PyramidSaveProjectConfigurationController >> projectModel: aProjectModel [

self saveModel isSaved: false.
self updateWindowTitle
]

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

self saveModel isSaved: false.
self updateWindowTitle
aProjectModel announcer
when: PyramidElementsChangedEvent
do: [ :evt | self updateSaveState: evt ]
for: self.
aProjectModel announcer
when: PyramidFirstLevelElementsChangedEvent
do: [ :evt | self updateSaveState: evt ]
for: self.
]

{ #category : 'as yet unclassified' }
Expand Down Expand Up @@ -116,6 +113,13 @@ PyramidSaveProjectConfigurationController >> textUpdatedFromPackage: aString [
self updateView
]

{ #category : 'as yet unclassified' }
PyramidSaveProjectConfigurationController >> updateSaveState: anEvent [

self saveModel isSaved: false.
self updateWindowTitle
]

{ #category : 'as yet unclassified' }
PyramidSaveProjectConfigurationController >> updateView [

Expand Down
23 changes: 10 additions & 13 deletions src/Pyramid-Bloc/PyramidSelectionWidgetExtension.class.st
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Class {
#name : 'PyramidSelectionWidgetExtension',
#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 : [
'projectModel',
'widgetElement',
Expand Down Expand Up @@ -193,14 +193,18 @@ PyramidSelectionWidgetExtension >> projectModel [
PyramidSelectionWidgetExtension >> projectModel: aProjectModel [

projectModel := aProjectModel.
projectModel addObserver: self.
self makeNewSelection.
projectModel announcer
when: PyramidSelectionChangedEvent
do: [ :evt | self pyramidSelectionChanged: evt ]
for: self.
self makeNewSelection
]

{ #category : 'events' }
PyramidSelectionWidgetExtension >> pyramidSelectionChanged [
PyramidSelectionWidgetExtension >> pyramidSelectionChanged: anEvent [

self updateSelection
self removeSelection.
self makeNewSelection
]

{ #category : 'selection element' }
Expand All @@ -225,13 +229,6 @@ PyramidSelectionWidgetExtension >> removeSelection [
self widgetElement removeChildren.
]

{ #category : 'selection' }
PyramidSelectionWidgetExtension >> updateSelection [

self removeSelection.
self makeNewSelection
]

{ #category : 'as yet unclassified' }
PyramidSelectionWidgetExtension >> usePositionOffsetCommand: aPosition [

Expand Down
Loading

0 comments on commit 312b36e

Please sign in to comment.