Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toplo dev support #4

Merged
merged 12 commits into from
Jul 19, 2024
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
Class {
#name : 'BaselineOfStashSerialization',
#superclass : 'BaselineOf',
#category : 'BaselineOfStashSerialization',
#package : 'BaselineOfStashSerialization'
#name : #BaselineOfStashSerialization,
#superclass : #BaselineOf,
#category : #BaselineOfStashSerialization
}

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

<baseline>
Expand All @@ -22,13 +21,13 @@ BaselineOfStashSerialization >> baseline: spec [
#Toplo ) ] ]
]

{ #category : 'baselines' }
{ #category : #baselines }
BaselineOfStashSerialization >> dependencies: spec [

spec
baseline: #Bloc
with: [ spec repository: 'github://pharo-graphics/Bloc:master/src' ].
spec
baseline: 'Toplo'
with: [ spec repository: 'github://pharo-graphics/Toplo:master/src' ].
with: [ spec repository: 'github://pharo-graphics/Toplo:dev/src' ].
]
2 changes: 1 addition & 1 deletion src/BaselineOfStashSerialization/package.st
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Package { #name : 'BaselineOfStashSerialization' }
Package { #name : #BaselineOfStashSerialization }
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : 'BlAffineCompositeTransformation' }
Extension { #name : #BlAffineCompositeTransformation }

{ #category : '*Stash-Serialization-Bloc' }
{ #category : #'*Stash-Serialization-Bloc' }
BlAffineCompositeTransformation >> allSetterAndGettersForMyStash [

^ self transformations flatCollect: [ :each | each allSetterAndGettersForMyStash ]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : 'BlAffineTransformationCenterOrigin' }
Extension { #name : #BlAffineTransformationCenterOrigin }

{ #category : '*Stash-Serialization-Bloc' }
{ #category : #'*Stash-Serialization-Bloc' }
BlAffineTransformationCenterOrigin >> asStashMethodForTransformationBloc [

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

{ #category : '*Stash-Serialization-Bloc' }
{ #category : #'*Stash-Serialization-Bloc' }
BlAffineTransformationLeftCenterOrigin >> asStashMethodForTransformationBloc [

^ 'origin: <1s> new' expandMacrosWith: self class printString.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : 'BlAffineTransformationNormalizedPositionOrigin' }
Extension { #name : #BlAffineTransformationNormalizedPositionOrigin }

{ #category : '*Stash-Serialization-Bloc' }
{ #category : #'*Stash-Serialization-Bloc' }
BlAffineTransformationNormalizedPositionOrigin >> asStashMethodForTransformationBloc [

^ 'normalizedOrigin: <1p> @ <2p>' expandMacrosWith: self position x with: self position y
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : 'BlAffineTransformationPositionOrigin' }
Extension { #name : #BlAffineTransformationPositionOrigin }

{ #category : '*Stash-Serialization-Bloc' }
{ #category : #'*Stash-Serialization-Bloc' }
BlAffineTransformationPositionOrigin >> asStashMethodForTransformationBloc [

^ 'origin: (<1s> new position: <2s> @ <3s>; yourself)' expandMacrosWith: self class printString with: self position x with: self position y
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : 'BlAffineTransformationRightCenterOrigin' }
Extension { #name : #BlAffineTransformationRightCenterOrigin }

{ #category : '*Stash-Serialization-Bloc' }
{ #category : #'*Stash-Serialization-Bloc' }
BlAffineTransformationRightCenterOrigin >> asStashMethodForTransformationBloc [

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

{ #category : '*Stash-Serialization-Bloc' }
{ #category : #'*Stash-Serialization-Bloc' }
BlAffineTransformationTopLeftOrigin >> asStashMethodForTransformationBloc [
^ #topLeftOrigin
]
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Extension { #name : 'BlAnnulusSectorGeometry' }
Extension { #name : #BlAnnulusSectorGeometry }

{ #category : '*Stash-Serialization-Bloc' }
BlAnnulusSectorGeometry >> allSetterAndGettersForMyStash [
{ #category : #'*Stash-Serialization-Bloc' }
BlAnnulusSectorGeometry >> stashAccessors [

<stashAccessors>
^ {#startAngle .#endAngle .#innerRadius .#outerRadius}
]
23 changes: 12 additions & 11 deletions src/Stash-Serialization-Bloc/BlAttributeRope.extension.st
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
Extension { #name : 'BlAttributeRope' }
Extension { #name : #BlAttributeRope }

{ #category : '*Stash-Serialization-Bloc' }
BlAttributeRope >> allSetterAndGettersForMyStash [

^ {
#attributes.
#rope }
]

{ #category : '*Stash-Serialization-Bloc' }
{ #category : #'*Stash-Serialization-Bloc' }
BlAttributeRope >> asStashContructor [

^ self class printString
]

{ #category : '*Stash-Serialization-Bloc' }
{ #category : #'*Stash-Serialization-Bloc' }
BlAttributeRope >> asStashObject [

^ StashBlAttributeRope new
Expand All @@ -23,3 +15,12 @@ BlAttributeRope >> asStashObject [
attributes: self attributes;
yourself
]

{ #category : #'*Stash-Serialization-Bloc' }
BlAttributeRope >> stashAccessors [

<stashAccessors>
^ {
#attributes.
#rope }
]
7 changes: 4 additions & 3 deletions src/Stash-Serialization-Bloc/BlBackground.extension.st
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Extension { #name : 'BlBackground' }
Extension { #name : #BlBackground }

{ #category : '*Stash-Serialization-Bloc' }
BlBackground >> allSetterAndGettersForMyStash [
{ #category : #'*Stash-Serialization-Bloc' }
BlBackground >> stashBackgroundOpacity [

<stashAccessors>
^ { (#opacity) }
]
6 changes: 3 additions & 3 deletions src/Stash-Serialization-Bloc/BlBasicLayout.extension.st
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Extension { #name : 'BlBasicLayout' }
Extension { #name : #BlBasicLayout }

{ #category : '*Stash-Serialization-Bloc' }
{ #category : #'*Stash-Serialization-Bloc' }
BlBasicLayout >> asStashContructor [

^ 'BlBasicLayout uniqueInstance'
]

{ #category : '*Stash-Serialization-Bloc' }
{ #category : #'*Stash-Serialization-Bloc' }
BlBasicLayout >> shouldBeTagged [

^ false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Extension { #name : 'BlBezierCurveGeometry' }
Extension { #name : #BlBezierCurveGeometry }

{ #category : '*Stash-Serialization-Bloc' }
BlBezierCurveGeometry >> allSetterAndGettersForMyStash [
{ #category : #'*Stash-Serialization-Bloc' }
BlBezierCurveGeometry >> stashAccessors [

<stashAccessors>
^ { #controlPoints }
]
27 changes: 14 additions & 13 deletions src/Stash-Serialization-Bloc/BlBorder.extension.st
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
Extension { #name : 'BlBorder' }
Extension { #name : #BlBorder }

{ #category : '*Stash-Serialization-Bloc' }
BlBorder >> allSetterAndGettersForMyStash [
{ #category : #'*Stash-Serialization-Bloc' }
BlBorder >> asStashObject [

^ StashObjectWithBuilder new
builder: BlBorderBuilder new;
methodToBuild: #build;
object: self;
yourself
]

{ #category : #'*Stash-Serialization-Bloc' }
BlBorder >> stashAccessors [

<stashAccessors>
| defaults settersAndGetters |
settersAndGetters := OrderedCollection new.
defaults := BlBorderBuilder new.
Expand Down Expand Up @@ -30,13 +41,3 @@ BlBorder >> allSetterAndGettersForMyStash [

^ settersAndGetters
]

{ #category : '*Stash-Serialization-Bloc' }
BlBorder >> asStashObject [

^ StashObjectWithBuilder new
builder: BlBorderBuilder new;
methodToBuild: #build;
object: self;
yourself
]
4 changes: 2 additions & 2 deletions src/Stash-Serialization-Bloc/BlBottomAlignment.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : 'BlBottomAlignment' }
Extension { #name : #BlBottomAlignment }

{ #category : '*Stash-Serialization-Bloc' }
{ #category : #'*Stash-Serialization-Bloc' }
BlBottomAlignment >> asStashSelector [

^ #alignBottom
Expand Down
7 changes: 4 additions & 3 deletions src/Stash-Serialization-Bloc/BlCollectionRope.extension.st
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Extension { #name : 'BlCollectionRope' }
Extension { #name : #BlCollectionRope }

{ #category : '*Stash-Serialization-Bloc' }
BlCollectionRope >> allSetterAndGettersForMyStash [
{ #category : #'*Stash-Serialization-Bloc' }
BlCollectionRope >> stashAccessors [

<stashAccessors>
^ { #collection }
]
9 changes: 5 additions & 4 deletions src/Stash-Serialization-Bloc/BlColorPaint.extension.st
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Extension { #name : 'BlColorPaint' }
Extension { #name : #BlColorPaint }

{ #category : '*Stash-Serialization-Bloc' }
BlColorPaint >> allSetterAndGettersForMyStash [
{ #category : #'*Stash-Serialization-Bloc' }
BlColorPaint >> stashAccessors [

^ { (#color) }
<stashAccessors>
^ { #color }
]
7 changes: 4 additions & 3 deletions src/Stash-Serialization-Bloc/BlCornerRadii.extension.st
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Extension { #name : 'BlCornerRadii' }
Extension { #name : #BlCornerRadii }

{ #category : '*Stash-Serialization-Bloc' }
BlCornerRadii >> allSetterAndGettersForMyStash [
{ #category : #'*Stash-Serialization-Bloc' }
BlCornerRadii >> stashAccessors [

<stashAccessors>
^ { #topLeft .#topRight .#bottomLeft .#bottomRight }
]
82 changes: 40 additions & 42 deletions src/Stash-Serialization-Bloc/BlElement.extension.st
Original file line number Diff line number Diff line change
@@ -1,65 +1,62 @@
Extension { #name : 'BlElement' }
Extension { #name : #BlElement }

{ #category : '*Stash-Serialization-Bloc' }
BlElement >> allSetterAndGettersForMyStash [
{ #category : #'*Stash-Serialization-Bloc' }
BlElement >> allSetterAndGettersForMyStashChildren [

| settersAndGetters |
settersAndGetters := OrderedCollection new.

self allSetterAndGettersForMyStashChildren: settersAndGetters.
self allSetterAndGettersForMyStashUserData: settersAndGetters.
self allSetterAndGettersForMyStashVisuals: settersAndGetters.
self allSetterAndGettersForMyStashLayout: settersAndGetters.
self allSetterAndGettersForMyStashConstraints: settersAndGetters.
self allSetterAndGettersForMyStashTransformation: settersAndGetters.

settersAndGetters addAll: self allSetterAndGettersForMyStashForMyTraits.

^ settersAndGetters
]

{ #category : '*Stash-Serialization-Bloc' }
BlElement >> allSetterAndGettersForMyStashChildren: settersAndGetters [

self shouldSerializedChildren ifFalse: [ ^ self ].
<stashAccessors>
self shouldSerializedChildren ifFalse: [ ^ { } ].
self children ifNotEmpty: [
settersAndGetters add: #addChildren: -> #children ]
^ { #addChildren: -> #children } ].
^ { }
]

{ #category : '*Stash-Serialization-Bloc' }
BlElement >> allSetterAndGettersForMyStashConstraints: settersAndGetters [
{ #category : #'*Stash-Serialization-Bloc' }
BlElement >> allSetterAndGettersForMyStashConstraints [

<stashAccessors>
(constraints allSetterAndGettersForMyStash) ifNotEmpty: [
settersAndGetters add: #constraintsDo: -> #constraints ]
^ { #constraintsDo: -> #constraints } ].
^ { }
]

{ #category : '*Stash-Serialization-Bloc' }
BlElement >> allSetterAndGettersForMyStashLayout: settersAndGetters [
{ #category : #'*Stash-Serialization-Bloc' }
BlElement >> allSetterAndGettersForMyStashIdentifier [

self layout == self defaultLayout ifFalse: [
settersAndGetters add: #layout ].
<stashAccessors>
| elementId |
self userData at: #elementId ifAbsent: [ ^ { } ].
elementId := self userData at: #elementId.
elementId class = BlElementNoId ifTrue: [ ^ { } ].
elementId class = BlElementNamedId ifTrue: [ ^ { #id } ].
^ { #elementId }

]

{ #category : '*Stash-Serialization-Bloc' }
BlElement >> allSetterAndGettersForMyStashTransformation: settersAndGetters [
{ #category : #'*Stash-Serialization-Bloc' }
BlElement >> allSetterAndGettersForMyStashLayout [

self transformation isIdentity ifFalse: [
settersAndGetters add: #transformDo: -> #transformation ]
<stashAccessors>
self layout == self defaultLayout ifFalse: [
^ { #layout } ].
^ { }

]

{ #category : '*Stash-Serialization-Bloc' }
BlElement >> allSetterAndGettersForMyStashUserData: settersAndGetters [
{ #category : #'*Stash-Serialization-Bloc' }
BlElement >> allSetterAndGettersForMyStashTransformation [

self userData associationsDo: [ :asso |
(StashBlElementUserData uniqueInstance setterAndGetterBlockFor:
asso key) ifNotNil: [ :block |
settersAndGetters addAll: (block value: asso value) ] ]
<stashAccessors>
self transformation isIdentity ifFalse: [
^ { #transformDo: -> #transformation } ].
^ { }
]

{ #category : '*Stash-Serialization-Bloc' }
BlElement >> allSetterAndGettersForMyStashVisuals: settersAndGetters [
{ #category : #'*Stash-Serialization-Bloc' }
BlElement >> allSetterAndGettersForMyStashVisuals [

<stashAccessors>
| settersAndGetters |
settersAndGetters := OrderedCollection new.
self background == BlElementVisuals defaultBackground ifFalse: [
settersAndGetters add: #background ].
self border == BlElementVisuals defaultBorder ifFalse: [
Expand Down Expand Up @@ -88,5 +85,6 @@ BlElement >> allSetterAndGettersForMyStashVisuals: settersAndGetters [
self mouseCursor
== (BlElementVisuals classPool at: #DefaultMouseCursor) ifFalse: [
settersAndGetters add: #mouseCursor ].
^ settersAndGetters

]
Loading