Skip to content

Commit 9ad3324

Browse files
committed
Merge branch 'Pharo9.0' of github.com:pharo-project/pharo into Pharo9.0
2 parents bbcdf97 + 9d8d7bf commit 9ad3324

56 files changed

Lines changed: 635 additions & 118 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Athens-Cairo/AthensCairoSurface.class.st

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,12 @@ AthensCairoSurface class >> primImage: aFormat width: aWidth height: aHeight [
342342

343343
{ #category : #private }
344344
AthensCairoSurface class >> primImageFromData: data width: width height: height pitch: stride [
345+
346+
"CAIRO_FORMAT_ARGB32 -> 0"
347+
345348
^ self ffiCall: #(AthensCairoSurface cairo_image_surface_create_for_data (
346349
void *data,
347-
CAIRO_FORMAT_ARGB32,
350+
0,
348351
int width,
349352
int height,
350353
int stride) )
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
Class {
2+
#name : #ClyInstallMetaLinkPresenterTest,
3+
#superclass : #TestCase,
4+
#instVars : [
5+
'node',
6+
'metalink',
7+
'metalink2',
8+
'breakpoint',
9+
'executionCounter',
10+
'watchpoint'
11+
],
12+
#category : #'Calypso-SystemPlugins-Reflectivity-Browser-Tests-Metalinks'
13+
}
14+
15+
{ #category : #'helper methods' }
16+
ClyInstallMetaLinkPresenterTest >> dummyMethod [
17+
self
18+
]
19+
20+
{ #category : #'helper methods' }
21+
ClyInstallMetaLinkPresenterTest >> nodeInRealMethod [
22+
^(self class >> #dummyMethod) ast statements first
23+
]
24+
25+
{ #category : #running }
26+
ClyInstallMetaLinkPresenterTest >> presenterForMetalinkInstallation [
27+
^ClyMetaLinkInstallationPresenter onNode: node forInstallation: true
28+
]
29+
30+
{ #category : #running }
31+
ClyInstallMetaLinkPresenterTest >> presenterForMetalinkUninstallation [
32+
^ ClyMetaLinkInstallationPresenter onNode: node forInstallation: false
33+
]
34+
35+
{ #category : #running }
36+
ClyInstallMetaLinkPresenterTest >> setUp [
37+
super setUp.
38+
MetaLink uninstallAll.
39+
node := RBTemporaryNode named: 'test'.
40+
metalink := MetaLink new.
41+
metalink2 := MetaLink new.
42+
breakpoint := MetaLink new metaObject: Break; yourself.
43+
executionCounter := MetaLink new metaObject: ExecutionCounter new; yourself.
44+
watchpoint := MetaLink new metaObject: Watchpoint new; yourself.
45+
node propertyAt: #links put: {metalink. breakpoint. executionCounter. watchpoint} asOrderedCollection
46+
47+
]
48+
49+
{ #category : #running }
50+
ClyInstallMetaLinkPresenterTest >> tearDown [
51+
metalink uninstall.
52+
metalink2 uninstall.
53+
super tearDown
54+
]
55+
56+
{ #category : #tests }
57+
ClyInstallMetaLinkPresenterTest >> testInstallSelectedMetalink [
58+
|presenter list|
59+
presenter := ClyMetaLinkInstallationPresenter onNode: self nodeInRealMethod forInstallation: true.
60+
list := presenter metalinkListPresenter.
61+
list clickItem: 1.
62+
self deny: self nodeInRealMethod hasLinks.
63+
presenter installSelectedMetalink.
64+
self assert: self nodeInRealMethod hasLinks.
65+
self assert: self nodeInRealMethod links asArray first identicalTo: list items first
66+
]
67+
68+
{ #category : #tests }
69+
ClyInstallMetaLinkPresenterTest >> testInstallSelectedMetalinkActionButton [
70+
|presenter list|
71+
presenter := ClyMetaLinkInstallationPresenter onNode: self nodeInRealMethod forInstallation: true.
72+
list := presenter metalinkListPresenter.
73+
list clickItem: 1.
74+
self deny: self nodeInRealMethod hasLinks.
75+
presenter toolbarButtons first execute.
76+
self assert: self nodeInRealMethod hasLinks.
77+
self assert: self nodeInRealMethod links asArray first identicalTo: list items first
78+
]
79+
80+
{ #category : #tests }
81+
ClyInstallMetaLinkPresenterTest >> testRelevantMetalinksForInstallation [
82+
|links|
83+
links := self presenterForMetalinkInstallation allRelevantMetaLinks.
84+
self assert: links size >= 2.
85+
self assertCollection: links includesAll: { metalink. metalink2 }.
86+
self denyCollection: links includesAll: { breakpoint. watchpoint. executionCounter }.
87+
88+
]
89+
90+
{ #category : #tests }
91+
ClyInstallMetaLinkPresenterTest >> testRelevantMetalinksForUninstallation [
92+
| links |
93+
links := self presenterForMetalinkUninstallation allRelevantMetaLinks.
94+
self assert: links size equals: 1.
95+
self assertCollection: links hasSameElements: { metalink }
96+
]
97+
98+
{ #category : #tests }
99+
ClyInstallMetaLinkPresenterTest >> testToolbarButtonsCollectionSize [
100+
self assert: self presenterForMetalinkInstallation toolbarButtons size equals: 2.
101+
self assert: self presenterForMetalinkUninstallation toolbarButtons size equals: 2.
102+
]
103+
104+
{ #category : #tests }
105+
ClyInstallMetaLinkPresenterTest >> testToolbarButtonsForMetalinkInstallation [
106+
|toolbarButtons|
107+
toolbarButtons := self presenterForMetalinkInstallation toolbarButtons.
108+
self assert: toolbarButtons first label equals: 'Install'.
109+
self assert: toolbarButtons last label equals: 'Cancel'.
110+
]
111+
112+
{ #category : #tests }
113+
ClyInstallMetaLinkPresenterTest >> testToolbarButtonsForMetalinkUninstallation [
114+
|toolbarButtons|
115+
toolbarButtons := self presenterForMetalinkUninstallation toolbarButtons.
116+
self assert: toolbarButtons first label equals: 'Uninstall'.
117+
self assert: toolbarButtons last label equals: 'Cancel'.
118+
]
119+
120+
{ #category : #tests }
121+
ClyInstallMetaLinkPresenterTest >> testUninstallSelectedMetalink [
122+
|presenter list|
123+
self nodeInRealMethod link: metalink.
124+
presenter := ClyMetaLinkInstallationPresenter onNode: self nodeInRealMethod forInstallation: false.
125+
list := presenter metalinkListPresenter.
126+
list clickItem: 1.
127+
self assert: self nodeInRealMethod hasLinks.
128+
presenter uninstallSelectedMetalink.
129+
self deny: self nodeInRealMethod hasLinks
130+
]
131+
132+
{ #category : #tests }
133+
ClyInstallMetaLinkPresenterTest >> testUninstallSelectedMetalinkActionButton [
134+
|presenter list|
135+
self nodeInRealMethod link: metalink.
136+
presenter := ClyMetaLinkInstallationPresenter onNode: self nodeInRealMethod forInstallation: false.
137+
list := presenter metalinkListPresenter.
138+
list clickItem: 1.
139+
self assert: self nodeInRealMethod hasLinks.
140+
presenter toolbarButtons first execute.
141+
self deny: self nodeInRealMethod hasLinks
142+
]

src/Calypso-SystemPlugins-Reflectivity-Browser/ClyAddBreakpointCommand.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ My subclasses should implement single method:
77
"
88
Class {
99
#name : #ClyAddBreakpointCommand,
10-
#superclass : #ClyMetalinkCommand,
10+
#superclass : #ClyDebuggingCommand,
1111
#category : #'Calypso-SystemPlugins-Reflectivity-Browser-Breakpoints'
1212
}
1313

src/Calypso-SystemPlugins-Reflectivity-Browser/ClyAddExecutionCounterCommand.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ I am a command to install execution counter into given method or source node
33
"
44
Class {
55
#name : #ClyAddExecutionCounterCommand,
6-
#superclass : #ClyMetalinkCommand,
6+
#superclass : #ClyDebuggingCommand,
77
#category : #'Calypso-SystemPlugins-Reflectivity-Browser-ExecutionCounters'
88
}
99

src/Calypso-SystemPlugins-Reflectivity-Browser/ClyAddWatchpointCommand.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ I am a command to install watchpoint into the given method or source node
33
"
44
Class {
55
#name : #ClyAddWatchpointCommand,
6-
#superclass : #ClyMetalinkCommand,
6+
#superclass : #ClyDebuggingCommand,
77
#category : #'Calypso-SystemPlugins-Reflectivity-Browser-Watchpoints'
88
}
99

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
"
2+
I am a base class for commands which add/remove metalinks into given method or source node
3+
"
4+
Class {
5+
#name : #ClyDebuggingCommand,
6+
#superclass : #SycSourceCodeCommand,
7+
#category : #'Calypso-SystemPlugins-Reflectivity-Browser-Commands'
8+
}
9+
10+
{ #category : #activation }
11+
ClyDebuggingCommand class >> contextMenuOrder [
12+
<classAnnotationDependency>
13+
self subclassResponsibility
14+
]
15+
16+
{ #category : #testing }
17+
ClyDebuggingCommand class >> isAbstract [
18+
^self = ClyDebuggingCommand
19+
]
20+
21+
{ #category : #activation }
22+
ClyDebuggingCommand class >> methodContextMenuActivation [
23+
<classAnnotation>
24+
25+
^CmdContextMenuActivation
26+
byItemOf: ClyDebuggingMenuGroup order: self contextMenuOrder for: ClyMethod asCalypsoItemContext
27+
]
28+
29+
{ #category : #activation }
30+
ClyDebuggingCommand class >> methodEditorLeftBarMenuActivation [
31+
<classAnnotation>
32+
33+
^CmdTextLeftBarMenuActivation
34+
byItemOf: ClyDebuggingMenuGroup order: self contextMenuOrder for: ClyMethodSourceCodeContext
35+
]
36+
37+
{ #category : #activation }
38+
ClyDebuggingCommand class >> sourceCodeMenuActivation [
39+
<classAnnotation>
40+
41+
^SycDebuggingMenuActivation
42+
byItemOf: ClyDebuggingMenuGroup order: self contextMenuOrder for: ClyMethodSourceCodeContext
43+
]

src/Calypso-SystemPlugins-Reflectivity-Browser/ClyMetalinkMenuGroup.class.st renamed to src/Calypso-SystemPlugins-Reflectivity-Browser/ClyDebuggingMenuGroup.class.st

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
I am menu group to arrange together all metalink related commands (breakpoints, counters, watchpoints)
33
"
44
Class {
5-
#name : #ClyMetalinkMenuGroup,
5+
#name : #ClyDebuggingMenuGroup,
66
#superclass : #CmdMenuGroup,
77
#category : #'Calypso-SystemPlugins-Reflectivity-Browser-Commands'
88
}
99

1010
{ #category : #testing }
11-
ClyMetalinkMenuGroup >> isInlined [
11+
ClyDebuggingMenuGroup >> isInlined [
1212
^true
1313
]
1414

1515
{ #category : #accessing }
16-
ClyMetalinkMenuGroup >> order [
16+
ClyDebuggingMenuGroup >> order [
1717
^1.5
1818
]
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"
2+
I am a command to install metalinks on the selected method or one of its ast nodes.
3+
I open a small browser to choose which metalink to install among existing metalink instances.
4+
"
5+
Class {
6+
#name : #ClyInstallMetaLinkCommand,
7+
#superclass : #ClyDebuggingCommand,
8+
#category : #'Calypso-SystemPlugins-Reflectivity-Browser-Metalinks'
9+
}
10+
11+
{ #category : #activation }
12+
ClyInstallMetaLinkCommand class >> contextMenuOrder [
13+
^100
14+
]
15+
16+
{ #category : #accessing }
17+
ClyInstallMetaLinkCommand >> defaultMenuIconName [
18+
^#smallObjects
19+
]
20+
21+
{ #category : #accessing }
22+
ClyInstallMetaLinkCommand >> defaultMenuItemName [
23+
^'Install MetaLink...'
24+
]
25+
26+
{ #category : #execution }
27+
ClyInstallMetaLinkCommand >> execute [
28+
ClyMetaLinkInstallationPresenter openInstallerOnNode: sourceNode
29+
]

0 commit comments

Comments
 (0)