From 0c1502c1771ad5f0f3ebbbc7d99e98c2da66a338 Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Wed, 5 Jan 2022 15:24:17 -0300 Subject: [PATCH 01/24] clean package dependencies --- .../MABlockDescription.extension.st | 6 ++++++ .../MACompositeAccessor.extension.st | 15 +++++++++++++++ source/Magritte-Model/MABlockDescription.class.st | 5 ----- .../Magritte-Model/MACompositeAccessor.class.st | 14 -------------- source/Magritte-Model/MAFileDescription.class.st | 13 ------------- .../MAFileDescription.extension.st | 14 ++++++++++++++ 6 files changed, 35 insertions(+), 32 deletions(-) create mode 100644 source/Magritte-Deprecated3dot7/MABlockDescription.extension.st create mode 100644 source/Magritte-GToolkit/MACompositeAccessor.extension.st create mode 100644 source/Magritte-Pharo7-Model/MAFileDescription.extension.st diff --git a/source/Magritte-Deprecated3dot7/MABlockDescription.extension.st b/source/Magritte-Deprecated3dot7/MABlockDescription.extension.st new file mode 100644 index 00000000..80103b97 --- /dev/null +++ b/source/Magritte-Deprecated3dot7/MABlockDescription.extension.st @@ -0,0 +1,6 @@ +Extension { #name : #MABlockDescription } + +{ #category : #'*Magritte-Deprecated3dot7' } +MABlockDescription class >> defaultMorphClasses [ + ^ Array with: MAMorphicMemo +] diff --git a/source/Magritte-GToolkit/MACompositeAccessor.extension.st b/source/Magritte-GToolkit/MACompositeAccessor.extension.st new file mode 100644 index 00000000..d02151fc --- /dev/null +++ b/source/Magritte-GToolkit/MACompositeAccessor.extension.st @@ -0,0 +1,15 @@ +Extension { #name : #MACompositeAccessor } + +{ #category : #'*Magritte-GToolkit' } +MACompositeAccessor class >> sampleContainer [ + + | desc | + desc := MAContainer samplePersonDescription + blocClass: MACompositeElementBuilder; + yourself. + desc children do: [ :e | + | acc prefixAccessor | + prefixAccessor := MADictionaryAccessor key: #people. + acc := MACompositeAccessor via: prefixAccessor using: e ]. + ^ desc +] diff --git a/source/Magritte-Model/MABlockDescription.class.st b/source/Magritte-Model/MABlockDescription.class.st index f25b5978..96535c59 100644 --- a/source/Magritte-Model/MABlockDescription.class.st +++ b/source/Magritte-Model/MABlockDescription.class.st @@ -14,11 +14,6 @@ MABlockDescription class >> defaultLineCount [ ^ 3 ] -{ #category : #'as yet unclassified' } -MABlockDescription class >> defaultMorphClasses [ - ^ Array with: MAMorphicMemo -] - { #category : #testing } MABlockDescription class >> isAbstract [ ^ false diff --git a/source/Magritte-Model/MACompositeAccessor.class.st b/source/Magritte-Model/MACompositeAccessor.class.st index 0b96651d..b626d84f 100644 --- a/source/Magritte-Model/MACompositeAccessor.class.st +++ b/source/Magritte-Model/MACompositeAccessor.class.st @@ -13,20 +13,6 @@ Class { #category : #'Magritte-Model-Accessor' } -{ #category : #'example support' } -MACompositeAccessor class >> sampleContainer [ - - | desc | - desc := MAContainer samplePersonDescription - blocClass: MACompositeElementBuilder; - yourself. - desc children do: [ :e | - | acc prefixAccessor | - prefixAccessor := MADictionaryAccessor key: #people. - acc := MACompositeAccessor via: prefixAccessor using: e ]. - ^ desc -] - { #category : #'instance creation' } MACompositeAccessor class >> via: anAccessor using: aDescription [ | result | diff --git a/source/Magritte-Model/MAFileDescription.class.st b/source/Magritte-Model/MAFileDescription.class.st index f47f14cf..16a1f126 100644 --- a/source/Magritte-Model/MAFileDescription.class.st +++ b/source/Magritte-Model/MAFileDescription.class.st @@ -31,16 +31,3 @@ MAFileDescription class >> label [ MAFileDescription >> acceptMagritte: aVisitor [ aVisitor visitFileDescription: self ] - -{ #category : #accessing } -MAFileDescription >> defaultDirectory [ - - ^ self propertyAt: #defaultDirectory ifAbsent: [ MAFileSystem imageDirectory ]. -] - -{ #category : #accessing } -MAFileDescription >> defaultDirectory: fileReference [ - "fileReference - a FileSystem FileReference, or an MAFileReference if FileSystem is not installed" - - self propertyAt: #defaultDirectory put: fileReference -] diff --git a/source/Magritte-Pharo7-Model/MAFileDescription.extension.st b/source/Magritte-Pharo7-Model/MAFileDescription.extension.st new file mode 100644 index 00000000..594608e5 --- /dev/null +++ b/source/Magritte-Pharo7-Model/MAFileDescription.extension.st @@ -0,0 +1,14 @@ +Extension { #name : #MAFileDescription } + +{ #category : #'*Magritte-Pharo7-Model' } +MAFileDescription >> defaultDirectory [ + + ^ self propertyAt: #defaultDirectory ifAbsent: [ MAFileSystem imageDirectory ]. +] + +{ #category : #'*Magritte-Pharo7-Model' } +MAFileDescription >> defaultDirectory: fileReference [ + "fileReference - a FileSystem FileReference, or an MAFileReference if FileSystem is not installed" + + self propertyAt: #defaultDirectory put: fileReference +] From 2dec5cbc01c746cfa65c3210a5f3284c6077aecf Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Wed, 5 Jan 2022 18:07:53 -0300 Subject: [PATCH 02/24] add `BaselineOfMagritteForGt` --- .../BaselineOfMagritteForGt.class.st | 32 +++++++++++++++++++ source/BaselineOfMagritteForGt/package.st | 1 + 2 files changed, 33 insertions(+) create mode 100644 source/BaselineOfMagritteForGt/BaselineOfMagritteForGt.class.st create mode 100644 source/BaselineOfMagritteForGt/package.st diff --git a/source/BaselineOfMagritteForGt/BaselineOfMagritteForGt.class.st b/source/BaselineOfMagritteForGt/BaselineOfMagritteForGt.class.st new file mode 100644 index 00000000..07109867 --- /dev/null +++ b/source/BaselineOfMagritteForGt/BaselineOfMagritteForGt.class.st @@ -0,0 +1,32 @@ +Class { + #name : #BaselineOfMagritteForGt, + #superclass : #BaselineOf, + #category : #BaselineOfMagritteForGt +} + +{ #category : #baseline } +BaselineOfMagritteForGt >> baseline: spec [ + + + spec for: #common do: [ + spec + baseline: 'Grease' + with: [ + spec repository: 'github://SeasideSt/Grease:v1.7.x/repository' ]. + + spec + package: 'Magritte-Model' + with: [ spec requires: #( 'Grease' ) ]. + + spec + package: 'Magritte-Pharo-Model' + with: [ spec requires: #( 'Magritte-Model' ) ]. + + spec + package: 'Magritte-UI' + with: [ spec requires: #( 'Magritte-Model' ) ]. + + spec + package: 'Magritte-GToolkit' + with: [ spec requires: #( 'Magritte-Model' 'Magritte-UI' ) ] ] +] diff --git a/source/BaselineOfMagritteForGt/package.st b/source/BaselineOfMagritteForGt/package.st new file mode 100644 index 00000000..d0c728c5 --- /dev/null +++ b/source/BaselineOfMagritteForGt/package.st @@ -0,0 +1 @@ +Package { #name : #BaselineOfMagritteForGt } From 64033756de3abe29aed799ed566f9d04cca1d699 Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Mon, 24 Jan 2022 12:42:13 -0300 Subject: [PATCH 03/24] add `Magritte-Pharo7-PlainPharo` --- source/BaselineOfMagritte/BaselineOfMagritte.class.st | 3 +++ source/Magritte-Model/Symbol.extension.st | 5 ----- .../ManifestMagrittePharo7PlainPharo.class.st | 10 ++++++++++ source/Magritte-Pharo7-PlainPharo/Symbol.extension.st | 6 ++++++ source/Magritte-Pharo7-PlainPharo/package.st | 1 + 5 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 source/Magritte-Pharo7-PlainPharo/ManifestMagrittePharo7PlainPharo.class.st create mode 100644 source/Magritte-Pharo7-PlainPharo/Symbol.extension.st create mode 100644 source/Magritte-Pharo7-PlainPharo/package.st diff --git a/source/BaselineOfMagritte/BaselineOfMagritte.class.st b/source/BaselineOfMagritte/BaselineOfMagritte.class.st index 077c4cb7..e83e0323 100644 --- a/source/BaselineOfMagritte/BaselineOfMagritte.class.st +++ b/source/BaselineOfMagritte/BaselineOfMagritte.class.st @@ -80,6 +80,9 @@ BaselineOfMagritte >> baseline330ForPharo: spec [ " create a temporary alias " spec package: 'Magritte-Pharo-Model' with: 'Magritte-Pharo3-Model' ]. + spec for: #notGToolkit do: [ + spec package: 'Magritte-Model' with: [ spec requires: #('Magritte-Pharo7-Plain') ] ]. + spec for: #GToolkit do: [ spec package: 'Magritte-UI' with: [ spec requires: #('Magritte-Model') ]; diff --git a/source/Magritte-Model/Symbol.extension.st b/source/Magritte-Model/Symbol.extension.st index ec70a406..72a42ebf 100644 --- a/source/Magritte-Model/Symbol.extension.st +++ b/source/Magritte-Model/Symbol.extension.st @@ -5,11 +5,6 @@ Symbol >> asAccessor [ ^ MASelectorAccessor selector: self ] -{ #category : #'*Magritte-Model' } -Symbol >> cull: receiverObject cull: argumentObject [ - ^ receiverObject perform: self withEnoughArguments: { argumentObject } -] - { #category : #'*Magritte-Model' } Symbol >> optionFor: anObject ifPresent: aBlock [ aBlock value: (anObject perform: self) diff --git a/source/Magritte-Pharo7-PlainPharo/ManifestMagrittePharo7PlainPharo.class.st b/source/Magritte-Pharo7-PlainPharo/ManifestMagrittePharo7PlainPharo.class.st new file mode 100644 index 00000000..4b3a8f44 --- /dev/null +++ b/source/Magritte-Pharo7-PlainPharo/ManifestMagrittePharo7PlainPharo.class.st @@ -0,0 +1,10 @@ +" +I include code that should be loaded only in a Plain Pharo. + +In other words, if Magritte is loaded in Glamorous Toolkit, the package should not be loaded as the same code (e.g., methods) is already present in Glamorous Toolkit. +" +Class { + #name : #ManifestMagrittePharo7PlainPharo, + #superclass : #PackageManifest, + #category : #'Magritte-Pharo7-PlainPharo-Manifest' +} diff --git a/source/Magritte-Pharo7-PlainPharo/Symbol.extension.st b/source/Magritte-Pharo7-PlainPharo/Symbol.extension.st new file mode 100644 index 00000000..15414743 --- /dev/null +++ b/source/Magritte-Pharo7-PlainPharo/Symbol.extension.st @@ -0,0 +1,6 @@ +Extension { #name : #Symbol } + +{ #category : #'*Magritte-Pharo7-PlainPharo' } +Symbol >> cull: receiverObject cull: argumentObject [ + ^ receiverObject perform: self withEnoughArguments: { argumentObject } +] diff --git a/source/Magritte-Pharo7-PlainPharo/package.st b/source/Magritte-Pharo7-PlainPharo/package.st new file mode 100644 index 00000000..ff3df1b3 --- /dev/null +++ b/source/Magritte-Pharo7-PlainPharo/package.st @@ -0,0 +1 @@ +Package { #name : #'Magritte-Pharo7-PlainPharo' } From ede88dc37e8f8cce0cbdbcde04eb2f1c05281bf0 Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Mon, 24 Jan 2022 12:50:16 -0300 Subject: [PATCH 04/24] fix the `Magritte-Pharo7-PlainPharo` name and reference --- source/BaselineOfMagritte/BaselineOfMagritte.class.st | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/BaselineOfMagritte/BaselineOfMagritte.class.st b/source/BaselineOfMagritte/BaselineOfMagritte.class.st index e83e0323..a2eba1e0 100644 --- a/source/BaselineOfMagritte/BaselineOfMagritte.class.st +++ b/source/BaselineOfMagritte/BaselineOfMagritte.class.st @@ -81,7 +81,8 @@ BaselineOfMagritte >> baseline330ForPharo: spec [ spec package: 'Magritte-Pharo-Model' with: 'Magritte-Pharo3-Model' ]. spec for: #notGToolkit do: [ - spec package: 'Magritte-Model' with: [ spec requires: #('Magritte-Pharo7-Plain') ] ]. + spec package: 'Magritte-Pharo7-PlainPharo'. + spec package: 'Magritte-Model' with: [ spec requires: #('Magritte-Pharo7-PlainPharo') ] ]. spec for: #GToolkit do: [ spec From e7abe381fb17c0ec30bb4ed13bd374e90bfa3882 Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Mon, 24 Jan 2022 17:31:23 -0300 Subject: [PATCH 05/24] move Morphic code into the Morph package --- .../MorphicUIManager.extension.st | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename source/{Magritte-Pharo7-Model => Magritte-Morph}/MorphicUIManager.extension.st (89%) diff --git a/source/Magritte-Pharo7-Model/MorphicUIManager.extension.st b/source/Magritte-Morph/MorphicUIManager.extension.st similarity index 89% rename from source/Magritte-Pharo7-Model/MorphicUIManager.extension.st rename to source/Magritte-Morph/MorphicUIManager.extension.st index d53ee212..653afe23 100644 --- a/source/Magritte-Pharo7-Model/MorphicUIManager.extension.st +++ b/source/Magritte-Morph/MorphicUIManager.extension.st @@ -1,6 +1,6 @@ Extension { #name : #MorphicUIManager } -{ #category : #'*Magritte-Pharo7-Model' } +{ #category : #'*Magritte-Morph' } MorphicUIManager >> chooseFile: windowTitle in: directoryString [ | chooser | chooser := FileDialogWindow newWithTheme: Smalltalk ui theme. From 2c685289a5a639cad31d6a2eb962bbf1322d5c2e Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Mon, 24 Jan 2022 17:34:34 -0300 Subject: [PATCH 06/24] add `BaselineOfMagritteForGToolkit` --- .../BaselineOfMagritteForGToolkit.class.st | 20 +++++++++++++++++++ .../BaselineOfMagritteForGToolkit/package.st | 1 + 2 files changed, 21 insertions(+) create mode 100644 source/BaselineOfMagritteForGToolkit/BaselineOfMagritteForGToolkit.class.st create mode 100644 source/BaselineOfMagritteForGToolkit/package.st diff --git a/source/BaselineOfMagritteForGToolkit/BaselineOfMagritteForGToolkit.class.st b/source/BaselineOfMagritteForGToolkit/BaselineOfMagritteForGToolkit.class.st new file mode 100644 index 00000000..17b0f3c1 --- /dev/null +++ b/source/BaselineOfMagritteForGToolkit/BaselineOfMagritteForGToolkit.class.st @@ -0,0 +1,20 @@ +Class { + #name : #BaselineOfMagritteForGToolkit, + #superclass : #BaselineOf, + #category : #BaselineOfMagritteForGToolkit +} + +{ #category : #baselines } +BaselineOfMagritteForGToolkit >> baseline: spec [ + + + spec for: #common do: [ + spec + baseline: 'Grease' + with: [ + spec repository: 'github://feenkcom/Grease:feenk/repository' ]. + + spec + package: 'Magritte-Model' + with: [ spec requires: #( 'Grease' ) ] ] +] diff --git a/source/BaselineOfMagritteForGToolkit/package.st b/source/BaselineOfMagritteForGToolkit/package.st new file mode 100644 index 00000000..b4f4db9a --- /dev/null +++ b/source/BaselineOfMagritteForGToolkit/package.st @@ -0,0 +1 @@ +Package { #name : #BaselineOfMagritteForGToolkit } From 9501ba4b4d82206b58292a18402e6efe961e46fb Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Mon, 24 Jan 2022 17:42:38 -0300 Subject: [PATCH 07/24] remove `BaselineOfMagritteForGt` --- .../BaselineOfMagritteForGt.class.st | 32 ------------------- source/BaselineOfMagritteForGt/package.st | 1 - 2 files changed, 33 deletions(-) delete mode 100644 source/BaselineOfMagritteForGt/BaselineOfMagritteForGt.class.st delete mode 100644 source/BaselineOfMagritteForGt/package.st diff --git a/source/BaselineOfMagritteForGt/BaselineOfMagritteForGt.class.st b/source/BaselineOfMagritteForGt/BaselineOfMagritteForGt.class.st deleted file mode 100644 index 07109867..00000000 --- a/source/BaselineOfMagritteForGt/BaselineOfMagritteForGt.class.st +++ /dev/null @@ -1,32 +0,0 @@ -Class { - #name : #BaselineOfMagritteForGt, - #superclass : #BaselineOf, - #category : #BaselineOfMagritteForGt -} - -{ #category : #baseline } -BaselineOfMagritteForGt >> baseline: spec [ - - - spec for: #common do: [ - spec - baseline: 'Grease' - with: [ - spec repository: 'github://SeasideSt/Grease:v1.7.x/repository' ]. - - spec - package: 'Magritte-Model' - with: [ spec requires: #( 'Grease' ) ]. - - spec - package: 'Magritte-Pharo-Model' - with: [ spec requires: #( 'Magritte-Model' ) ]. - - spec - package: 'Magritte-UI' - with: [ spec requires: #( 'Magritte-Model' ) ]. - - spec - package: 'Magritte-GToolkit' - with: [ spec requires: #( 'Magritte-Model' 'Magritte-UI' ) ] ] -] diff --git a/source/BaselineOfMagritteForGt/package.st b/source/BaselineOfMagritteForGt/package.st deleted file mode 100644 index d0c728c5..00000000 --- a/source/BaselineOfMagritteForGt/package.st +++ /dev/null @@ -1 +0,0 @@ -Package { #name : #BaselineOfMagritteForGt } From 42893f8b3ec54f995352611fe20284539eee05c6 Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Tue, 25 Jan 2022 11:45:29 -0300 Subject: [PATCH 08/24] remove a class reference that resides in a package that we do not load in GToolkit --- source/Magritte-Model/MACompositeAccessor.class.st | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Magritte-Model/MACompositeAccessor.class.st b/source/Magritte-Model/MACompositeAccessor.class.st index b626d84f..e8afe4ba 100644 --- a/source/Magritte-Model/MACompositeAccessor.class.st +++ b/source/Magritte-Model/MACompositeAccessor.class.st @@ -1,5 +1,5 @@ " -When you have a ""to-many"" relationship, I describe the flattened collection of its items - something like {{gtMethod:Collection>>#flatCollect:}} meets {{gtClass:MAChainAccessor}}. Here's a usage example {{gtExample:MACompositeElementBuilder class>>#example}}: +When you have a ""to-many"" relationship, I describe the flattened collection of its items - something like {{gtMethod:Collection>>#flatCollect:}} meets {{gtClass:MAChainAccessor}}. Here's a usage example `MACompositeElementBuilder class>>#example`: " Class { #name : #MACompositeAccessor, From 75f8af2a67b9f7c1add5dbcc1f8e998e14b00c0c Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Mon, 14 Feb 2022 13:52:14 -0300 Subject: [PATCH 09/24] add `MAFileDescription >> #pharoFileReferenceFor:` to convert `MAFileModel` into `FileReference` --- source/Magritte-Model/MAFileDescription.class.st | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/Magritte-Model/MAFileDescription.class.st b/source/Magritte-Model/MAFileDescription.class.st index 16a1f126..7d4cb613 100644 --- a/source/Magritte-Model/MAFileDescription.class.st +++ b/source/Magritte-Model/MAFileDescription.class.st @@ -31,3 +31,9 @@ MAFileDescription class >> label [ MAFileDescription >> acceptMagritte: aVisitor [ aVisitor visitFileDescription: self ] + +{ #category : #accessing } +MAFileDescription >> pharoFileReferenceFor: aFileModel [ + + ^ aFileModel filename asFileReference +] From 391bd0bb3f427889ca578edb29966d23a9d1455e Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Tue, 15 Feb 2022 13:57:30 -0300 Subject: [PATCH 10/24] add `MAFileDescription >> #pharoFileReferenceFor:` --- source/Magritte-Model/MAFileDescription.class.st | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/Magritte-Model/MAFileDescription.class.st b/source/Magritte-Model/MAFileDescription.class.st index 7d4cb613..6231aeb5 100644 --- a/source/Magritte-Model/MAFileDescription.class.st +++ b/source/Magritte-Model/MAFileDescription.class.st @@ -33,7 +33,7 @@ MAFileDescription >> acceptMagritte: aVisitor [ ] { #category : #accessing } -MAFileDescription >> pharoFileReferenceFor: aFileModel [ +MAFileDescription >> pharoFileReferenceFor: aValue [ - ^ aFileModel filename asFileReference + ^ aValue asFileReference ] From 851233032c9250f7c4ae955f4a2b532b2adaa92f Mon Sep 17 00:00:00 2001 From: Veit Heller Date: Tue, 17 May 2022 14:30:06 +0200 Subject: [PATCH 11/24] Add `blocStencil`to number description [feenkcom/gtoolkit#2543] --- source/Magritte-Model/MANumberDescription.class.st | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/source/Magritte-Model/MANumberDescription.class.st b/source/Magritte-Model/MANumberDescription.class.st index 5af1f1ae..e35f4e58 100644 --- a/source/Magritte-Model/MANumberDescription.class.st +++ b/source/Magritte-Model/MANumberDescription.class.st @@ -4,7 +4,7 @@ I am a description of numbers, possible values are instances of ==Number== and a Class { #name : #MANumberDescription, #superclass : #MAMagnitudeDescription, - #category : 'Magritte-Model-Description' + #category : #'Magritte-Model-Description' } { #category : #'accessing-defaults' } @@ -41,3 +41,14 @@ MANumberDescription >> beNegative [ MANumberDescription >> bePositive [ self addCondition: (MACondition selector: #positive) labelled: 'No positive number was entered' ] + +{ #category : #accessing } +MANumberDescription >> blocStencil [ + + ^ self propertyAt: #blocStencil ifAbsent: [ nil ] +] + +{ #category : #accessing } +MANumberDescription >> blocStencil: aBlock [ + self propertyAt: #blocStencil put: aBlock +] From 13e118efb54b3e66ec43dcbb902b7ea3209487ee Mon Sep 17 00:00:00 2001 From: Andrei Chis Date: Thu, 30 Jun 2022 10:14:38 +0200 Subject: [PATCH 12/24] Depend on GreaseForGToolkit --- .../BaselineOfMagritteForGToolkit.class.st | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/BaselineOfMagritteForGToolkit/BaselineOfMagritteForGToolkit.class.st b/source/BaselineOfMagritteForGToolkit/BaselineOfMagritteForGToolkit.class.st index 17b0f3c1..4bb681f1 100644 --- a/source/BaselineOfMagritteForGToolkit/BaselineOfMagritteForGToolkit.class.st +++ b/source/BaselineOfMagritteForGToolkit/BaselineOfMagritteForGToolkit.class.st @@ -10,11 +10,11 @@ BaselineOfMagritteForGToolkit >> baseline: spec [ spec for: #common do: [ spec - baseline: 'Grease' + baseline: 'GreaseForGToolkit' with: [ - spec repository: 'github://feenkcom/Grease:feenk/repository' ]. + spec repository: 'github://feenkcom/Grease:feenk/repository' ]. spec package: 'Magritte-Model' - with: [ spec requires: #( 'Grease' ) ] ] + with: [ spec requires: #( 'GreaseForGToolkit' ) ] ] ] From 04008a3d86df6238ada874a190a536ac6ea4377a Mon Sep 17 00:00:00 2001 From: Veit Heller Date: Thu, 15 Dec 2022 16:54:43 +0100 Subject: [PATCH 13/24] Revert 85123303 --- source/Magritte-Model/MANumberDescription.class.st | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/source/Magritte-Model/MANumberDescription.class.st b/source/Magritte-Model/MANumberDescription.class.st index e35f4e58..fa592f75 100644 --- a/source/Magritte-Model/MANumberDescription.class.st +++ b/source/Magritte-Model/MANumberDescription.class.st @@ -41,14 +41,3 @@ MANumberDescription >> beNegative [ MANumberDescription >> bePositive [ self addCondition: (MACondition selector: #positive) labelled: 'No positive number was entered' ] - -{ #category : #accessing } -MANumberDescription >> blocStencil [ - - ^ self propertyAt: #blocStencil ifAbsent: [ nil ] -] - -{ #category : #accessing } -MANumberDescription >> blocStencil: aBlock [ - self propertyAt: #blocStencil put: aBlock -] From a63ecf86bff1ecf21b0ecf5b51fe851749b4fad3 Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Fri, 24 Mar 2023 11:36:20 -0600 Subject: [PATCH 14/24] `asGlmAction` includes inexistent class references --- .../MAActionDescription.class.st | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/source/Magritte-Model/MAActionDescription.class.st b/source/Magritte-Model/MAActionDescription.class.st index 48c45b19..8bc5fe42 100644 --- a/source/Magritte-Model/MAActionDescription.class.st +++ b/source/Magritte-Model/MAActionDescription.class.st @@ -49,25 +49,6 @@ MAActionDescription >> action: aValuable [ action := aValuable. ] -{ #category : #converting } -MAActionDescription >> asGlmAction [ - | result | - result := GLMGenericAction new - action: [ :pres :receiver | - self performOn: receiver. - self isMutator ifTrue: [ pres update ] ]; - enabledCondition: self enableBlock; - help: self comment; - shortcut: self shortcut; - title: self label; - yourself. - - "Glamour doesn't like setting a nil icon!" - self icon ifNotNil: [ :i | result icon: i ]. - ^ result - -] - { #category : #accessing } MAActionDescription >> comment [ From d11e0d9b112be5d13842bc436f2190ea8feeb48c Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Tue, 28 Mar 2023 16:00:09 -0600 Subject: [PATCH 15/24] Magritte descriptions have `#definingSource` [feenkcom/gtoolkit#3190] --- .../MAActionDescription.class.st | 11 +++ source/Magritte-Model/MADescription.class.st | 11 +++ .../MADescriptionMethodSource.class.st | 85 +++++++++++++++++++ .../Magritte-Model/MAPragmaBuilder.class.st | 15 ++++ 4 files changed, 122 insertions(+) create mode 100644 source/Magritte-Model/MADescriptionMethodSource.class.st diff --git a/source/Magritte-Model/MAActionDescription.class.st b/source/Magritte-Model/MAActionDescription.class.st index 8bc5fe42..c6808532 100644 --- a/source/Magritte-Model/MAActionDescription.class.st +++ b/source/Magritte-Model/MAActionDescription.class.st @@ -61,6 +61,17 @@ MAActionDescription >> comment: aString [ comment := aString. ] +{ #category : #accessing } +MAActionDescription >> definingSource [ + + ^ self propertyAt: #definingSource ifAbsent: [ nil ] +] + +{ #category : #accessing } +MAActionDescription >> definingSource: aSource [ + ^ self propertyAt: #definingSource put: aSource +] + { #category : #accessing } MAActionDescription >> enableBlock [ ^ enableBlock ifNil: [ true ] diff --git a/source/Magritte-Model/MADescription.class.st b/source/Magritte-Model/MADescription.class.st index fd4de01b..469fd9a4 100644 --- a/source/Magritte-Model/MADescription.class.st +++ b/source/Magritte-Model/MADescription.class.st @@ -308,6 +308,17 @@ MADescription >> defaultLabel [ ^ self accessor defaultLabelFor: self ] +{ #category : #'as yet unclassified' } +MADescription >> definingSource [ + + ^ self propertyAt: #definingSource ifAbsent: [ nil ] +] + +{ #category : #'as yet unclassified' } +MADescription >> definingSource: aSource [ + ^ self propertyAt: #definingSource put: aSource +] + { #category : #'owning object' } MADescription >> describedObject [ ^ MADynamicDescribedObject value diff --git a/source/Magritte-Model/MADescriptionMethodSource.class.st b/source/Magritte-Model/MADescriptionMethodSource.class.st new file mode 100644 index 00000000..6bf31260 --- /dev/null +++ b/source/Magritte-Model/MADescriptionMethodSource.class.st @@ -0,0 +1,85 @@ +Class { + #name : #MADescriptionMethodSource, + #superclass : #MABasicObject, + #instVars : [ + 'modelClass', + 'methodSelector' + ], + #category : #'Magritte-Model-Utility' +} + +{ #category : #comparing } +MADescriptionMethodSource >> = anObject [ + self == anObject + ifTrue: [ ^ true ]. + + self class = anObject class + ifFalse: [ ^ false ]. + + ^ self methodSelector = anObject methodSelector + and: [ self modelClass = anObject modelClass ] +] + +{ #category : #accessing } +MADescriptionMethodSource >> compiledMethod [ + ^ self methodClass + ifNotNil: [ :aClass | aClass >> self methodSelector asSymbol ] +] + +{ #category : #comparing } +MADescriptionMethodSource >> hash [ + ^ self methodSelector hash + bitXor: (self modelClass hash) +] + +{ #category : #accessing } +MADescriptionMethodSource >> methodClass [ + ^ self modelClass whichClassIncludesSelector: self methodSelector +] + +{ #category : #accessing } +MADescriptionMethodSource >> methodSelector [ + ^ methodSelector +] + +{ #category : #accessing } +MADescriptionMethodSource >> methodSelector: anObject [ + methodSelector := anObject +] + +{ #category : #accessing } +MADescriptionMethodSource >> modelClass [ + ^ modelClass +] + +{ #category : #accessing } +MADescriptionMethodSource >> modelClass: anObject [ + modelClass := anObject +] + +{ #category : #accessing } +MADescriptionMethodSource >> printOn: aStream [ + | aMethodClass | + super printOn: aStream. + + self modelClass ifNil: [ ^ self ]. + self methodSelector ifNil: [ ^ self ]. + aMethodClass := self methodClass. + + aStream nextPut: $(. + + aMethodClass ifNil: [ aStream nextPutAll: 'Missing method ' ]. + + aStream print: self modelClass. + + self modelClass = aMethodClass + ifFalse: [ aStream + nextPut: $(; + print: aMethodClass; + nextPut: $) ]. + + aStream + nextPutAll: '>>#'; + nextPutAll: self methodSelector asString; + nextPut: $) +] diff --git a/source/Magritte-Model/MAPragmaBuilder.class.st b/source/Magritte-Model/MAPragmaBuilder.class.st index 37ef6ea8..a93bd053 100644 --- a/source/Magritte-Model/MAPragmaBuilder.class.st +++ b/source/Magritte-Model/MAPragmaBuilder.class.st @@ -91,6 +91,9 @@ MAPragmaBuilder >> buildDescriptions: anObject [ collect: [ :descSel | | initialDescription | initialDescription := anObject perform: descSel. + + self object: anObject description: initialDescription definedAt: descSel. + self description: initialDescription extendedBy: descriptionExtensions for: descSel of: anObject ]. ^ extendedDescriptions select: #notNil. @@ -140,6 +143,18 @@ MAPragmaBuilder >> for: anObject [ ^ cache at: anObject ifAbsentPut: [ self build: anObject cache: cache ] ] ] +{ #category : #private } +MAPragmaBuilder >> object: anObject description: aDescription definedAt: aSelector [ + | aSource | + aDescription ifNil: [ ^ nil ]. + + aSource := MADescriptionMethodSource new + modelClass: anObject class; + methodSelector: aSelector. + + aDescription definingSource: aSource. +] + { #category : #private } MAPragmaBuilder >> uniqueDescriptionSelectors: anObject [ | descriptionPragmas selectors | From cd4a27d2860ecd792d0be090ad1721477ea76f40 Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Thu, 30 Mar 2023 07:05:10 -0600 Subject: [PATCH 16/24] move `MAFileDescription>>#pharoFileReferenceFor:` into `gt4magritte` repository --- source/Magritte-Model/MAFileDescription.class.st | 6 ------ 1 file changed, 6 deletions(-) diff --git a/source/Magritte-Model/MAFileDescription.class.st b/source/Magritte-Model/MAFileDescription.class.st index 6231aeb5..16a1f126 100644 --- a/source/Magritte-Model/MAFileDescription.class.st +++ b/source/Magritte-Model/MAFileDescription.class.st @@ -31,9 +31,3 @@ MAFileDescription class >> label [ MAFileDescription >> acceptMagritte: aVisitor [ aVisitor visitFileDescription: self ] - -{ #category : #accessing } -MAFileDescription >> pharoFileReferenceFor: aValue [ - - ^ aValue asFileReference -] From cec4e487c5cfb0a688f67065bfe747b87c69fb16 Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Fri, 28 Jul 2023 12:13:11 -0400 Subject: [PATCH 17/24] Magritte descriptions announce property value changes [feenkcom/gtoolkit#3371] - add `MAPropertyChangedAnnouncement` - currently we support all properties and `MAActionDescription >> #label:` (which stored as an instance variable) --- .../MAActionDescription.class.st | 4 + .../MAPropertyChangedAnnouncement.class.st | 40 +++++++++ .../Magritte-Model/MATPropertyOwner.trait.st | 81 ++++++++++++++++++- 3 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 source/Magritte-Model/MAPropertyChangedAnnouncement.class.st diff --git a/source/Magritte-Model/MAActionDescription.class.st b/source/Magritte-Model/MAActionDescription.class.st index c6808532..30de370e 100644 --- a/source/Magritte-Model/MAActionDescription.class.st +++ b/source/Magritte-Model/MAActionDescription.class.st @@ -146,7 +146,11 @@ MAActionDescription >> label [ { #category : #accessing } MAActionDescription >> label: aString [ + | anOldLabel | + anOldLabel := label. label := aString. + + self propertyAnnounceKey: #label oldValue: anOldLabel newValue: aString ] { #category : #private } diff --git a/source/Magritte-Model/MAPropertyChangedAnnouncement.class.st b/source/Magritte-Model/MAPropertyChangedAnnouncement.class.st new file mode 100644 index 00000000..618cbb7d --- /dev/null +++ b/source/Magritte-Model/MAPropertyChangedAnnouncement.class.st @@ -0,0 +1,40 @@ +Class { + #name : #MAPropertyChangedAnnouncement, + #superclass : #Announcement, + #instVars : [ + 'key', + 'value', + 'owner' + ], + #category : #'Magritte-Model-Core' +} + +{ #category : #accessing } +MAPropertyChangedAnnouncement >> key [ + ^ key +] + +{ #category : #accessing } +MAPropertyChangedAnnouncement >> key: anObject [ + key := anObject +] + +{ #category : #accessing } +MAPropertyChangedAnnouncement >> owner [ + ^ owner +] + +{ #category : #accessing } +MAPropertyChangedAnnouncement >> owner: anObject [ + owner := anObject +] + +{ #category : #accessing } +MAPropertyChangedAnnouncement >> value [ + ^ value +] + +{ #category : #accessing } +MAPropertyChangedAnnouncement >> value: anObject [ + value := anObject +] diff --git a/source/Magritte-Model/MATPropertyOwner.trait.st b/source/Magritte-Model/MATPropertyOwner.trait.st index 3fc92ac4..5253fb72 100644 --- a/source/Magritte-Model/MATPropertyOwner.trait.st +++ b/source/Magritte-Model/MATPropertyOwner.trait.st @@ -73,6 +73,28 @@ MATPropertyOwner >> propertiesSearchOn: aSearch [ send: [ :anObject | anObject value ] ] +{ #category : #subscriptions } +MATPropertyOwner >> propertyAnnounceKey: aPropertyKey oldValue: anOldValue newValue: aNewValue [ + "Announce a property change if there are subscriptions." + + self propertyAnnouncerDo: [ :anAnnouncer | + anOldValue = aNewValue ifFalse: [ + anAnnouncer announce: (MAPropertyChangedAnnouncement new + owner: self; + key: aPropertyKey; + value: aNewValue) ] ] +] + +{ #category : #subscriptions } +MATPropertyOwner >> propertyAnnouncerDo: aBlock [ + "Announce a property change if there are subscriptions." + + self properties + at: #propertyAnnouncer + ifPresent: aBlock + ifAbsent: [ "ignore" ] +] + { #category : #accessing } MATPropertyOwner >> propertyAt: aKey [ "Answer the value of the property ==aKey==, raises an error if the property doesn't exist." @@ -91,7 +113,19 @@ MATPropertyOwner >> propertyAt: aKey ifAbsent: aBlock [ MATPropertyOwner >> propertyAt: aKey ifAbsentPut: aBlock [ "Answer the value of the property ==aKey==, or if the property doesn't exist adds and answers the result of evaluating ==aBlock==." - ^ self properties at: aKey ifAbsentPut: aBlock + | aValue shouldAnnounce | + shouldAnnounce := false. + + aValue := self properties + at: aKey + ifAbsentPut: [ + shouldAnnounce := true. + aBlock value ]. + + shouldAnnounce ifTrue: [ + self propertyAnnounceKey: aKey oldValue: nil newValue: aValue ]. + + ^ aValue ] { #category : #accessing } @@ -107,20 +141,61 @@ MATPropertyOwner >> propertyAt: aKey ifPresent: oneArgBlock ifAbsent: absentBloc ^ self properties at: aKey ifPresent: oneArgBlock ifAbsent: absentBlock ] +{ #category : #accessing } +MATPropertyOwner >> propertyAt: aKey ifPresent: oneArgBlock ifAbsentPut: absentBlock [ + "Lookup ==aKey==, if it is present, answer the value of evaluating the oneArgBlock with the value associated with the key, otherwise answer the value of absentBlock." + | anOldValue aNewValue | + anOldValue := nil. + aNewValue := self properties + at: aKey + ifPresent: [ :aValue | + anOldValue := aValue. + oneArgBlock value ] + ifAbsentPut: absentBlock. + + self propertyAnnounceKey: aKey oldValue: anOldValue newValue: aNewValue. + + ^ aNewValue +] + { #category : #accessing } MATPropertyOwner >> propertyAt: aKey put: aValue [ "Adds or replaces the property ==aKey== with ==aValue==." - ^ self properties at: aKey put: aValue + | anOldValue aNewValue | + anOldValue := self properties at: aKey ifAbsent: [ nil ]. + aNewValue := self properties at: aKey put: aValue. + + self propertyAnnounceKey: aKey oldValue: anOldValue newValue: aNewValue. + + ^ aNewValue ] { #category : #accessing } MATPropertyOwner >> propertyAt: aSymbol putRemovingNil: aValue [ + | anOldValue | aValue ifNotNil: [ ^ self propertyAt: aSymbol put: aValue ]. - ^ (self hasProperty: aSymbol) + anOldValue := (self hasProperty: aSymbol) ifTrue: [ self properties removeKey: aSymbol ] ifFalse: [ aValue ]. + + self propertyAnnounceKey: aSymbol oldValue: anOldValue newValue: aValue. + + ^ anOldValue +] + +{ #category : #subscriptions } +MATPropertyOwner >> whenPropertyChangedSend: aSelector to: aReceiver [ + | anAnnouncer | + anAnnouncer := self properties + at: #propertyAnnouncer + ifAbsentPut: [ Announcer new ]. + + ^ anAnnouncer weak + when: MAPropertyChangedAnnouncement + send: aSelector + to: aReceiver ] From a1f025cc0cd39f54b463e78f1fbf1b53eb2fc3e4 Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Fri, 28 Jul 2023 21:43:59 -0400 Subject: [PATCH 18/24] add `MAElementDescription>>#autoAccept` [feenkcom/gtoolkit#3371] --- .../MAElementDescription.class.st | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/source/Magritte-Model/MAElementDescription.class.st b/source/Magritte-Model/MAElementDescription.class.st index 6b31e32a..576a8c79 100644 --- a/source/Magritte-Model/MAElementDescription.class.st +++ b/source/Magritte-Model/MAElementDescription.class.st @@ -7,6 +7,11 @@ Class { #category : #'Magritte-Model-Description' } +{ #category : #'accessing-defaults' } +MAElementDescription class >> defaultAutoAccept [ + ^ false +] + { #category : #'instance creation' } MAElementDescription class >> new [ "override #new so that we can create an object without adding it to the collection returned by: MAElementDescription withAllConcreteClasses, @@ -25,6 +30,20 @@ MAElementDescription >> asContainer [ ^ MAContainer with: self ] +{ #category : #accessing } +MAElementDescription >> autoAccept [ + "Test whether new mement values should be automatically propagated to the model." + + ^ self + propertyAt: #autoAccept + ifAbsent: [ self class defaultAutoAccept ] +] + +{ #category : #accessing } +MAElementDescription >> autoAccept: aBoolean [ + self propertyAt: #autoAccept put: aBoolean +] + { #category : #accessing } MAElementDescription >> default [ ^ self propertyAt: #default ifAbsent: [ self class defaultDefault ] From 6c23fcbe3993c06b0e4fdcc85a779e624fa403f8 Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Mon, 31 Jul 2023 13:26:54 -0400 Subject: [PATCH 19/24] improve method comments [feenkcom/gtoolkit#3371] --- source/Magritte-Model/MAElementDescription.class.st | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/Magritte-Model/MAElementDescription.class.st b/source/Magritte-Model/MAElementDescription.class.st index 576a8c79..b6ff68d6 100644 --- a/source/Magritte-Model/MAElementDescription.class.st +++ b/source/Magritte-Model/MAElementDescription.class.st @@ -32,7 +32,9 @@ MAElementDescription >> asContainer [ { #category : #accessing } MAElementDescription >> autoAccept [ - "Test whether new mement values should be automatically propagated to the model." + "Define whether new memento values should be automatically propagated to a model. + + New values are propagated to the model only if successfully validated. See {{gtMethod: GtMagritteMemento >> #autoAcceptValue: }} for more details." ^ self propertyAt: #autoAccept @@ -41,6 +43,10 @@ MAElementDescription >> autoAccept [ { #category : #accessing } MAElementDescription >> autoAccept: aBoolean [ + "Set whether new memento values should be automatically propagated to a model. + + New values are propagated to the model only if successfully validated. See {{gtMethod: GtMagritteMemento >> #autoAcceptValue: }} for more details." + self propertyAt: #autoAccept put: aBoolean ] From 710e291b4dac0c7135394529dbe9b2c5967c77dd Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Tue, 1 Aug 2023 18:53:34 -0400 Subject: [PATCH 20/24] remove `#definingSource` as it is replaced by `#definingContext` [feenkcom/gtoolkit#3377] --- .../MAActionDescription.class.st | 11 --- source/Magritte-Model/MADescription.class.st | 11 --- .../MADescriptionMethodSource.class.st | 85 ------------------- .../Magritte-Model/MAPragmaBuilder.class.st | 14 +-- 4 files changed, 1 insertion(+), 120 deletions(-) delete mode 100644 source/Magritte-Model/MADescriptionMethodSource.class.st diff --git a/source/Magritte-Model/MAActionDescription.class.st b/source/Magritte-Model/MAActionDescription.class.st index 3791963a..7296257f 100644 --- a/source/Magritte-Model/MAActionDescription.class.st +++ b/source/Magritte-Model/MAActionDescription.class.st @@ -73,17 +73,6 @@ MAActionDescription >> definingContext: anMADefiningContext [ ^ self propertyAt: #definingContext put: anMADefiningContext ] -{ #category : #accessing } -MAActionDescription >> definingSource [ - - ^ self propertyAt: #definingSource ifAbsent: [ nil ] -] - -{ #category : #accessing } -MAActionDescription >> definingSource: aSource [ - ^ self propertyAt: #definingSource put: aSource -] - { #category : #accessing } MAActionDescription >> enableBlock [ ^ enableBlock ifNil: [ true ] diff --git a/source/Magritte-Model/MADescription.class.st b/source/Magritte-Model/MADescription.class.st index 469fd9a4..fd4de01b 100644 --- a/source/Magritte-Model/MADescription.class.st +++ b/source/Magritte-Model/MADescription.class.st @@ -308,17 +308,6 @@ MADescription >> defaultLabel [ ^ self accessor defaultLabelFor: self ] -{ #category : #'as yet unclassified' } -MADescription >> definingSource [ - - ^ self propertyAt: #definingSource ifAbsent: [ nil ] -] - -{ #category : #'as yet unclassified' } -MADescription >> definingSource: aSource [ - ^ self propertyAt: #definingSource put: aSource -] - { #category : #'owning object' } MADescription >> describedObject [ ^ MADynamicDescribedObject value diff --git a/source/Magritte-Model/MADescriptionMethodSource.class.st b/source/Magritte-Model/MADescriptionMethodSource.class.st deleted file mode 100644 index 6bf31260..00000000 --- a/source/Magritte-Model/MADescriptionMethodSource.class.st +++ /dev/null @@ -1,85 +0,0 @@ -Class { - #name : #MADescriptionMethodSource, - #superclass : #MABasicObject, - #instVars : [ - 'modelClass', - 'methodSelector' - ], - #category : #'Magritte-Model-Utility' -} - -{ #category : #comparing } -MADescriptionMethodSource >> = anObject [ - self == anObject - ifTrue: [ ^ true ]. - - self class = anObject class - ifFalse: [ ^ false ]. - - ^ self methodSelector = anObject methodSelector - and: [ self modelClass = anObject modelClass ] -] - -{ #category : #accessing } -MADescriptionMethodSource >> compiledMethod [ - ^ self methodClass - ifNotNil: [ :aClass | aClass >> self methodSelector asSymbol ] -] - -{ #category : #comparing } -MADescriptionMethodSource >> hash [ - ^ self methodSelector hash - bitXor: (self modelClass hash) -] - -{ #category : #accessing } -MADescriptionMethodSource >> methodClass [ - ^ self modelClass whichClassIncludesSelector: self methodSelector -] - -{ #category : #accessing } -MADescriptionMethodSource >> methodSelector [ - ^ methodSelector -] - -{ #category : #accessing } -MADescriptionMethodSource >> methodSelector: anObject [ - methodSelector := anObject -] - -{ #category : #accessing } -MADescriptionMethodSource >> modelClass [ - ^ modelClass -] - -{ #category : #accessing } -MADescriptionMethodSource >> modelClass: anObject [ - modelClass := anObject -] - -{ #category : #accessing } -MADescriptionMethodSource >> printOn: aStream [ - | aMethodClass | - super printOn: aStream. - - self modelClass ifNil: [ ^ self ]. - self methodSelector ifNil: [ ^ self ]. - aMethodClass := self methodClass. - - aStream nextPut: $(. - - aMethodClass ifNil: [ aStream nextPutAll: 'Missing method ' ]. - - aStream print: self modelClass. - - self modelClass = aMethodClass - ifFalse: [ aStream - nextPut: $(; - print: aMethodClass; - nextPut: $) ]. - - aStream - nextPutAll: '>>#'; - nextPutAll: self methodSelector asString; - nextPut: $) -] diff --git a/source/Magritte-Model/MAPragmaBuilder.class.st b/source/Magritte-Model/MAPragmaBuilder.class.st index 7333c7a0..7c5c5adf 100644 --- a/source/Magritte-Model/MAPragmaBuilder.class.st +++ b/source/Magritte-Model/MAPragmaBuilder.class.st @@ -92,7 +92,7 @@ MAPragmaBuilder >> buildDescriptions: anObject [ | initialDescription | initialDescription := anObject perform: descSel. - self object: anObject description: initialDescription definedAt: descSel. + self setDefiningContextOf: initialDescription to: descSel in: anObject class. self description: initialDescription extendedBy: descriptionExtensions for: descSel of: anObject ]. @@ -143,18 +143,6 @@ MAPragmaBuilder >> for: anObject [ ^ cache at: anObject ifAbsentPut: [ self build: anObject cache: cache ] ] ] -{ #category : #private } -MAPragmaBuilder >> object: anObject description: aDescription definedAt: aSelector [ - | aSource | - aDescription ifNil: [ ^ nil ]. - - aSource := MADescriptionMethodSource new - modelClass: anObject class; - methodSelector: aSelector. - - aDescription definingSource: aSource. -] - { #category : #private } MAPragmaBuilder >> setDefiningContextOf: aDescription to: aSelector in: aClass [ | aSource | From 7bdfa5ea02083caf4b1257492f936bf1855f46b5 Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Wed, 2 Aug 2023 16:41:58 -0400 Subject: [PATCH 21/24] add `MATPropertyOwner >> #unsubscribel:` [feenkcom/gtoolkit#3378] --- source/Magritte-Model/MAActionDescription.class.st | 4 ++++ source/Magritte-Model/MATPropertyOwner.trait.st | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/source/Magritte-Model/MAActionDescription.class.st b/source/Magritte-Model/MAActionDescription.class.st index 7296257f..3face951 100644 --- a/source/Magritte-Model/MAActionDescription.class.st +++ b/source/Magritte-Model/MAActionDescription.class.st @@ -46,7 +46,11 @@ MAActionDescription >> action [ { #category : #accessing } MAActionDescription >> action: aValuable [ + | anOldAction | + anOldAction := action. action := aValuable. + + self propertyAnnounceKey: #action oldValue: anOldAction newValue: aValuable ] { #category : #accessing } diff --git a/source/Magritte-Model/MATPropertyOwner.trait.st b/source/Magritte-Model/MATPropertyOwner.trait.st index 15346f51..1929f0d4 100644 --- a/source/Magritte-Model/MATPropertyOwner.trait.st +++ b/source/Magritte-Model/MATPropertyOwner.trait.st @@ -193,6 +193,15 @@ MATPropertyOwner >> propertyAt: aSymbol putRemovingNil: aValue [ ^ anOldValue ] +{ #category : #subscriptions } +MATPropertyOwner >> unsubscribe: aSubscriber [ + self properties + at: #propertyAnnouncer + ifPresent: [ :anAnnouncer | + anAnnouncer unsubscribe: aSubscriber ] + ifAbsent: [ "ignore" ] +] + { #category : #uuid } MATPropertyOwner >> uuid [ From ba0eb1ff9046091e138bf12974f247555a6b2471 Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Wed, 2 Aug 2023 22:45:29 -0400 Subject: [PATCH 22/24] remove `source/Magritte-Deprecated3dot7/MABlockDescription.extension.st` [feenkcom/gtoolkit#3378] https://github.com/magritte-metamodel/magritte/pull/331#discussion_r1282550975 --- .../MABlockDescription.extension.st | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 source/Magritte-Deprecated3dot7/MABlockDescription.extension.st diff --git a/source/Magritte-Deprecated3dot7/MABlockDescription.extension.st b/source/Magritte-Deprecated3dot7/MABlockDescription.extension.st deleted file mode 100644 index 80103b97..00000000 --- a/source/Magritte-Deprecated3dot7/MABlockDescription.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #MABlockDescription } - -{ #category : #'*Magritte-Deprecated3dot7' } -MABlockDescription class >> defaultMorphClasses [ - ^ Array with: MAMorphicMemo -] From d020e606fdb7eeccc3564d03283934538ee46020 Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Wed, 2 Aug 2023 22:49:00 -0400 Subject: [PATCH 23/24] remove `source/Magritte-Pharo7-Model/MAFileDescription.extension.st` [feenkcom/gtoolkit#3378] https://github.com/magritte-metamodel/magritte/pull/331/files/7bdfa5ea02083caf4b1257492f936bf1855f46b5#r1282553171 --- .../MAFileDescription.extension.st | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 source/Magritte-Pharo7-Model/MAFileDescription.extension.st diff --git a/source/Magritte-Pharo7-Model/MAFileDescription.extension.st b/source/Magritte-Pharo7-Model/MAFileDescription.extension.st deleted file mode 100644 index 594608e5..00000000 --- a/source/Magritte-Pharo7-Model/MAFileDescription.extension.st +++ /dev/null @@ -1,14 +0,0 @@ -Extension { #name : #MAFileDescription } - -{ #category : #'*Magritte-Pharo7-Model' } -MAFileDescription >> defaultDirectory [ - - ^ self propertyAt: #defaultDirectory ifAbsent: [ MAFileSystem imageDirectory ]. -] - -{ #category : #'*Magritte-Pharo7-Model' } -MAFileDescription >> defaultDirectory: fileReference [ - "fileReference - a FileSystem FileReference, or an MAFileReference if FileSystem is not installed" - - self propertyAt: #defaultDirectory put: fileReference -] From 24a481b157069d9b6024dac66d82526bf972e9c6 Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Wed, 2 Aug 2023 22:58:29 -0400 Subject: [PATCH 24/24] remove `source/Magritte-Pharo7-PlainPharo` [feenkcom/gtoolkit#3378] - https://github.com/magritte-metamodel/magritte/pull/331#discussion_r1282553994 - https://github.com/magritte-metamodel/magritte/pull/331#discussion_r1282554255 - https://github.com/magritte-metamodel/magritte/pull/331#discussion_r1282554397 --- .../ManifestMagrittePharo7PlainPharo.class.st | 10 ---------- source/Magritte-Pharo7-PlainPharo/Symbol.extension.st | 6 ------ source/Magritte-Pharo7-PlainPharo/package.st | 1 - 3 files changed, 17 deletions(-) delete mode 100644 source/Magritte-Pharo7-PlainPharo/ManifestMagrittePharo7PlainPharo.class.st delete mode 100644 source/Magritte-Pharo7-PlainPharo/Symbol.extension.st delete mode 100644 source/Magritte-Pharo7-PlainPharo/package.st diff --git a/source/Magritte-Pharo7-PlainPharo/ManifestMagrittePharo7PlainPharo.class.st b/source/Magritte-Pharo7-PlainPharo/ManifestMagrittePharo7PlainPharo.class.st deleted file mode 100644 index 4b3a8f44..00000000 --- a/source/Magritte-Pharo7-PlainPharo/ManifestMagrittePharo7PlainPharo.class.st +++ /dev/null @@ -1,10 +0,0 @@ -" -I include code that should be loaded only in a Plain Pharo. - -In other words, if Magritte is loaded in Glamorous Toolkit, the package should not be loaded as the same code (e.g., methods) is already present in Glamorous Toolkit. -" -Class { - #name : #ManifestMagrittePharo7PlainPharo, - #superclass : #PackageManifest, - #category : #'Magritte-Pharo7-PlainPharo-Manifest' -} diff --git a/source/Magritte-Pharo7-PlainPharo/Symbol.extension.st b/source/Magritte-Pharo7-PlainPharo/Symbol.extension.st deleted file mode 100644 index 15414743..00000000 --- a/source/Magritte-Pharo7-PlainPharo/Symbol.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #Symbol } - -{ #category : #'*Magritte-Pharo7-PlainPharo' } -Symbol >> cull: receiverObject cull: argumentObject [ - ^ receiverObject perform: self withEnoughArguments: { argumentObject } -] diff --git a/source/Magritte-Pharo7-PlainPharo/package.st b/source/Magritte-Pharo7-PlainPharo/package.st deleted file mode 100644 index ff3df1b3..00000000 --- a/source/Magritte-Pharo7-PlainPharo/package.st +++ /dev/null @@ -1 +0,0 @@ -Package { #name : #'Magritte-Pharo7-PlainPharo' }