Skip to content

Commit

Permalink
Merge pull request #3 from OpenSmock/dev
Browse files Browse the repository at this point in the history
update main to test the current CI
  • Loading branch information
Nyan11 authored Jun 28, 2023
2 parents 09d8ffe + dc36ca5 commit 7cc6455
Show file tree
Hide file tree
Showing 347 changed files with 13,798 additions and 17,323 deletions.
5 changes: 3 additions & 2 deletions .project
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
'srcDirectory' : 'src'
}
'srcDirectory' : 'src',
'tags' : [ #opensmock ]
}
24 changes: 18 additions & 6 deletions src/BaselineOfPyramid/BaselineOfPyramid.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ BaselineOfPyramid >> baseline: spec [

<baseline>
spec for: #common do: [
spec postLoadDoIt: #postload:package:.
self dependencies: spec.
spec
package: #Pyramid
with: [ spec requires: #( #BlocSerialization ) ];
package: #'Pyramid-Bloc' with: [ spec requires: #( #Pyramid #Bloc ) ];
package: #'Pyramid-Tests' with: [ spec requires: #( #Pyramid ) ] ]
]

{ #category : #baselines }
BaselineOfPyramid >> dependencies: spec [

spec
baseline: #Bloc
with: [
Expand All @@ -17,10 +29,10 @@ BaselineOfPyramid >> baseline: spec [
baseline: #BlocSerialization
with: [
spec repository: 'github://OpenSmock/Bloc-Serialization:main/src' ].
spec package: #'Pyramid-Commands'.
spec package: #'Pyramid-Spec'.
spec
package: #Pyramid
with: [
spec requires: #( #BlocSerialization #Bloc #'Pyramid-Spec' #'Pyramid-Commands' ) ] ]
]

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

PyramidPluginManager reset
]
14 changes: 14 additions & 0 deletions src/Pyramid-Bloc/BlColorPaint.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Extension { #name : #BlColorPaint }

{ #category : #'*Pyramid-Bloc' }
BlColorPaint >> pyramidBackgroundPreview [

^ PyramidPaintPreviewSolidColor new color: self color
]

{ #category : #'*Pyramid-Bloc' }
BlColorPaint >> pyramidModalDefaultPaint: aPyramidPaintInput [

aPyramidPaintInput buttonColor click.
aPyramidPaintInput inputSolid defaultColor: self color
]
13 changes: 13 additions & 0 deletions src/Pyramid-Bloc/BlCompositeBackground.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Extension { #name : #BlCompositeBackground }

{ #category : #'*Pyramid-Bloc' }
BlCompositeBackground >> pyramidBackgroundStrategy [

^ PyramidBackgroundPropertyInputUnknownStrategy new
]

{ #category : #'*Pyramid-Bloc' }
BlCompositeBackground >> pyramidSelectMenuOnModal: aModal [

aModal buttonComposite click
]
11 changes: 11 additions & 0 deletions src/Pyramid-Bloc/BlElementGeometry.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Extension { #name : #BlElementGeometry }

{ #category : #'*Pyramid-Bloc' }
BlElementGeometry >> pyramidSelectOnPresenter: aPresenter [

| selection |
aPresenter model: PyramidGeometryModel default.
selection := aPresenter model select: [ :each |
each isSelectableWith: self ].
selection ifNotEmpty: [ selection first selectModelWith: self ]
]
8 changes: 8 additions & 0 deletions src/Pyramid-Bloc/BlGradientPaint.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Extension { #name : #BlGradientPaint }

{ #category : #'*Pyramid-Bloc' }
BlGradientPaint >> pyramidModalDefaultPaint: aPyramidPaintInput [

aPyramidPaintInput buttonGradient click.
aPyramidPaintInput inputGradient stopsColor stopManager from: self stops.
]
20 changes: 20 additions & 0 deletions src/Pyramid-Bloc/BlImageBackground.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Extension { #name : #BlImageBackground }

{ #category : #'*Pyramid-Bloc' }
BlImageBackground >> pyramidBackgroundStrategy [

(self image respondsTo: #pyramidExternalRessourceSource) ifTrue: [
^ PyramidBackgroundPropertyInputImage new
ressource: self image pyramidExternalRessourceSource;
yourself ].
^ PyramidBackgroundPropertyInputImage new
ressource: nil;
yourself
]

{ #category : #'*Pyramid-Bloc' }
BlImageBackground >> pyramidSelectMenuOnModal: aModal [

aModal buttonImage click.
aModal currentPresenter setImage: self image
]
7 changes: 7 additions & 0 deletions src/Pyramid-Bloc/BlLayoutCommonConstraintsAxis.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : #BlLayoutCommonConstraintsAxis }

{ #category : #'*Pyramid-Bloc' }
BlLayoutCommonConstraintsAxis >> pyramidSelectConstraintsOn: aPyramidConstraintsPresenter [

self resizer pyramidSelectConstraintsResizerOn: aPyramidConstraintsPresenter
]
12 changes: 12 additions & 0 deletions src/Pyramid-Bloc/BlLayoutExactResizer.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Extension { #name : #BlLayoutExactResizer }

{ #category : #'*Pyramid-Bloc' }
BlLayoutExactResizer >> pyramidSelectConstraintsResizerOn: aPyramidConstraintsPresenter [

| item |
item := (aPyramidConstraintsPresenter selectorInputs select: [ :each |
each value targetClass = self class ]) first.
item key click.
aPyramidConstraintsPresenter submit: item value.
item value associatedPresenter number: self size.
]
11 changes: 11 additions & 0 deletions src/Pyramid-Bloc/BlLayoutResizer.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Extension { #name : #BlLayoutResizer }

{ #category : #'*Pyramid-Bloc' }
BlLayoutResizer >> pyramidSelectConstraintsResizerOn: aPyramidConstraintsPresenter [

| item |
item := (aPyramidConstraintsPresenter selectorInputs select: [ :each |
each value targetClass = self class ]) first.
item key click.
aPyramidConstraintsPresenter submit: item value
]
17 changes: 17 additions & 0 deletions src/Pyramid-Bloc/BlLinearGradientPaint.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Extension { #name : #BlLinearGradientPaint }

{ #category : #'*Pyramid-Bloc' }
BlLinearGradientPaint >> pyramidBackgroundPreview [

^ PyramidPaintPreviewGradientColor new
stops: self stops;
yourself
]

{ #category : #'*Pyramid-Bloc' }
BlLinearGradientPaint >> pyramidModalDefaultPaint: aPyramidPaintInput [

super pyramidModalDefaultPaint: aPyramidPaintInput.
aPyramidPaintInput inputGradient modeSelector buttonLinear click.
aPyramidPaintInput inputGradient modeSelector linearDirection point: self end - self start
]
14 changes: 14 additions & 0 deletions src/Pyramid-Bloc/BlPaintBackground.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Extension { #name : #BlPaintBackground }

{ #category : #'*Pyramid-Bloc' }
BlPaintBackground >> pyramidBackgroundStrategy [

^ PyramidBackgroundPropertyInputPaint new paint: self paint; yourself
]

{ #category : #'*Pyramid-Bloc' }
BlPaintBackground >> pyramidSelectMenuOnModal: aModal [

aModal buttonPaint click.
aModal currentPresenter setDefaultPaint: self paint
]
22 changes: 22 additions & 0 deletions src/Pyramid-Bloc/BlRadialGradientPaint.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Extension { #name : #BlRadialGradientPaint }

{ #category : #'*Pyramid-Bloc' }
BlRadialGradientPaint >> pyramidBackgroundPreview [

^ PyramidPaintPreviewGradientColor new
stops: self stops;
yourself
]

{ #category : #'*Pyramid-Bloc' }
BlRadialGradientPaint >> pyramidModalDefaultPaint: aPyramidPaintInput [

super pyramidModalDefaultPaint: aPyramidPaintInput.
aPyramidPaintInput inputGradient modeSelector buttonRadial click.
aPyramidPaintInput inputGradient modeSelector linearDirection point:
self center.
aPyramidPaintInput inputGradient modeSelector radialPosition point:
self center.
aPyramidPaintInput inputGradient modeSelector radialRadius number:
self radius
]
13 changes: 13 additions & 0 deletions src/Pyramid-Bloc/BlTransparentBackground.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Extension { #name : #BlTransparentBackground }

{ #category : #'*Pyramid-Bloc' }
BlTransparentBackground >> pyramidBackgroundStrategy [

^ PyramidBackgroundPropertyInputTransparent new
]

{ #category : #'*Pyramid-Bloc' }
BlTransparentBackground >> pyramidSelectMenuOnModal: aModal [

aModal buttonTransparent click.
]
11 changes: 11 additions & 0 deletions src/Pyramid-Bloc/PyramidBackgroundAbstractBackgroundInput.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Class {
#name : #PyramidBackgroundAbstractBackgroundInput,
#superclass : #SpPresenter,
#category : #'Pyramid-Bloc-custom-specs-background'
}

{ #category : #accessing }
PyramidBackgroundAbstractBackgroundInput >> background [

^ self shouldBeImplemented
]
127 changes: 127 additions & 0 deletions src/Pyramid-Bloc/PyramidBackgroundInputImage.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
Class {
#name : #PyramidBackgroundInputImage,
#superclass : #PyramidBackgroundAbstractBackgroundInput,
#instVars : [
'form',
'classMethodPresenter',
'pathInput',
'exploreButton'
],
#category : #'Pyramid-Bloc-custom-specs-background'
}

{ #category : #'as yet unclassified' }
PyramidBackgroundInputImage >> actionOpenFileExplorer [

| dialog result |
dialog := FileDialogWindow onFileSystem: FileSystem disk.
result := dialog openModal answer.
result
ifNil: [ self pathInput text: '' ]
ifNotNil: [ self pathInput text: result ].
]

{ #category : #accessing }
PyramidBackgroundInputImage >> background [

self submitFormFromText: self pathInput text.
self form ifNil: [ ^ BlBackground transparent ].
^ BlBackground image: self form
]

{ #category : #layout }
PyramidBackgroundInputImage >> defaultLayout [

^ SpBoxLayout newHorizontal
add: self pathInput expand: true;
add: self exploreButton expand: false;
yourself
]

{ #category : #accessing }
PyramidBackgroundInputImage >> exploreButton [
^ exploreButton
]

{ #category : #accessing }
PyramidBackgroundInputImage >> form [

^ form
]

{ #category : #accessing }
PyramidBackgroundInputImage >> form: anObject [

form := anObject
]

{ #category : #'as yet unclassified' }
PyramidBackgroundInputImage >> formFromClass: class andSelector: selector [

self form: (PyramidExternalRessourceProxy fromSource:
(PyramidExternalRessourceSource target: class selector: selector))
]

{ #category : #initialization }
PyramidBackgroundInputImage >> initializePresenters [

pathInput := SpTextInputFieldPresenter new whenSubmitDo: [ :text |
self submitFormFromText: text ].
exploreButton := SpButtonPresenter new
icon: (self iconNamed: #configNew);
action: [ self actionOpenFileExplorer ];
yourself
]

{ #category : #accessing }
PyramidBackgroundInputImage >> pathInput [

^ pathInput
]

{ #category : #initialization }
PyramidBackgroundInputImage >> previewPresenterFrom: model [

| object |
model targetClass ifNil: [
^ SpLabelPresenter new
label: 'No class selected.';
yourself ].
(model targetClass canUnderstand: model methodSelector) ifFalse: [
^ SpLabelPresenter new
label: 'Can not perform method.';
yourself ].
object := model targetClass perform: model methodSelector.
(object isKindOf: Form) ifFalse: [ ^ SpLabelPresenter new
label: 'Image is not a Form. Will be remplaced by a BlTransparentBackground.';
yourself ].
^ SpImagePresenter new
image: object;
yourself
]

{ #category : #initialization }
PyramidBackgroundInputImage >> setImage: anImage [

(anImage respondsTo: #pyramidExternalRessourceSource) ifTrue: [
self pathInput text: anImage pyramidExternalRessourceSource arguments first fullName ]
]

{ #category : #'as yet unclassified' }
PyramidBackgroundInputImage >> submitFormFromText: aString [

aString asFileReference exists ifFalse: [ self pathInput text: '' ].
self form: (PyramidExternalRessourceProxy fromSource:
(PyramidExternalRessourceSource formFromFileNamed:
(aString)))
]

{ #category : #'as yet unclassified' }
PyramidBackgroundInputImage >> validateSelection: model [

model targetClass ifNil: [ ^ false ].
model methodSelector ifNil: [ ^ false ].
(model targetClass class canUnderstand: model methodSelector) ifFalse: [ ^ false ].
^ (model targetClass perform: model methodSelector withArguments: model methodArguments) isKindOf: Form

]
17 changes: 17 additions & 0 deletions src/Pyramid-Bloc/PyramidBackgroundInputTransparent.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Class {
#name : #PyramidBackgroundInputTransparent,
#superclass : #PyramidBackgroundAbstractBackgroundInput,
#category : #'Pyramid-Bloc-custom-specs-background'
}

{ #category : #accessing }
PyramidBackgroundInputTransparent >> background [

^ BlBackground transparent
]

{ #category : #layout }
PyramidBackgroundInputTransparent >> defaultLayout [

^ SpBoxLayout newHorizontal add: 'Transparent. Nothing to see here.'; yourself
]
Loading

0 comments on commit 7cc6455

Please sign in to comment.