Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def bootstrapImage(){
isoTesters['SUnit'] = { defineIsoTestStage("SUnit", "SUnit", "Tests", "\'SUnit-Tests\' \'SUnit-Visitor-Tests\' \'SUnit-MockObjects-Tests\'") }
isoTesters['Kernel'] = { defineIsoTestStage("Kernel", "Kernel", "Tests", "\'Kernel-Tests\' \'Kernel-CodeModel-Tests\'") }
isoTesters['Compiler'] = { defineIsoTestStage("Compiler", "Compiler", "Tests", "\'OpalCompiler-Tests\' \'DebugInfo-Tests\' \'Kernel-Extended-Tests\' \'Kernel-Tests-WithCompiler\'") }
isoTesters['OSWindow'] = { defineIsoTestStage("OSWindow", "OSWindow", "Tests", "\'OSWindow-Tests\'") }
parallel isoTesters

stage ("Full Image") {
Expand Down
9 changes: 5 additions & 4 deletions src/BaselineOfOSWindow/BaselineOfOSWindow.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ BaselineOfOSWindow >> baseline: spec [
spec for: #'common' do: [
spec
package: 'OSWindow-Core';
package: 'OSWindow-SDL2';
package: 'OSWindow-SDL2-Examples';
package: 'OSWindow-Tests'.
package: 'OSWindow-Morphic' with: [ spec requires: #( 'OSWindow-Core' ) ];
package: 'OSWindow-SDL2' with: [ spec requires: #( 'OSWindow-Core' ) ];
package: 'OSWindow-SDL2-Examples' with: [ spec requires: #( 'OSWindow-Core' 'OSWindow-SDL2' ) ];
package: 'OSWindow-Tests' with: [ spec requires: #( 'OSWindow-Core' 'OSWindow-SDL2' ) ].
spec
group: 'Core' with: #('OSWindow-Core' 'OSWindow-SDL2' 'OSWindow-SDL2-Examples');
group: 'Tests' with: #('OSWindow-Tests');
group: 'default' with: #('Core' 'Tests') ]
group: 'default' with: #('Core' 'OSWindow-Morphic' 'Tests') ]
]
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,10 @@ Class {
#classVars : [
'FormMapping'
],
#category : 'OSWindow-Core-Utilities',
#package : 'OSWindow-Core',
#tag : 'Utilities'
#category : 'Graphics-Canvas',
#package : 'Graphics-Canvas'
}

{ #category : 'examples' }
ScalingCanvas class >> example [

| morph |

(morph := MenuMorph new)
addTitle: 'Lorem ipsum'.
(morph add: 'Dolor sit amet' target: nil selector: #yourself) keyText: 'x';
icon: (self iconNamed: #smallConfiguration).
(morph add: 'Consectetur adipiscing elit' target: nil selector: #yourself) keyText: 'y'.
morph addLine.
(morph add: 'Sed do eiusmod' target: nil selector: #yourself) keyText: 'z'.

^ self privateExampleWithMorph: morph
]

{ #category : 'examples' }
ScalingCanvas class >> exampleDrawPolygon [

Expand Down Expand Up @@ -157,49 +140,6 @@ ScalingCanvas class >> exampleFrameAndFillRectangle2 [
borderWidth: 1.9 borderColor: Color green translucent ] ]
]

{ #category : 'examples' }
ScalingCanvas class >> exampleImageMorph1 [

^ self privateExampleWithMorph: (Morph new
color: Color veryVeryLightGray;
addMorph: ((ImageMorph withForm: (self iconNamed: #search))
position: 4@4;
yourself);
addMorph: ((ImageMorph withForm: (self iconNamed: #search) copy)
position: 24@4;
yourself);
extent: 44@24;
yourself)
]

{ #category : 'examples' }
ScalingCanvas class >> exampleImageMorph2 [

| forms imageMorph |

forms := (1 to: 2) collect: [ :scale |
(FormCanvas extent: 100 asPoint * scale depth: 1)
fillOval: ((0 asPoint extent: 100 asPoint * scale) insetBy: 5 * scale) fillStyle: Color green;
form ].
(imageMorph := ImageMorph withFormSet: (FormSet forms: forms))
color: Color blue.
^ self privateExampleWithMorph: imageMorph
]

{ #category : 'examples' }
ScalingCanvas class >> exampleImageMorph3 [

| forms imageMorph |

forms := (1 to: 2) collect: [ :scale |
(FormCanvas extent: 10 asPoint * scale)
fillOval: ((0 asPoint extent: 10 asPoint * scale) insetBy: 1 * scale) fillStyle: Color black;
form ].
(imageMorph := ImageMorph withFormSet: (FormSet forms: forms))
resize: 200@100.
^ self privateExampleWithMorph: imageMorph
]

{ #category : 'examples' }
ScalingCanvas class >> exampleLine1 [

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ Class {
'form',
'scale'
],
#category : 'Morphic-Core-Kernel',
#package : 'Morphic-Core',
#tag : 'Kernel'
#category : 'Graphics-Canvas',
#package : 'Graphics-Canvas'
}

{ #category : 'instance creation' }
Expand Down
22 changes: 0 additions & 22 deletions src/Morphic-Core/Morph.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,6 @@ Morph >> addYellowButtonMenuItemsTo: aMenu event: evt [
aMenu addLine.
self isWorldMorph
ifFalse: [aMenu add: 'copy to paste buffer' selector: #copyToPasteBuffer:].
(self allStringsAfter: nil) isEmpty ifFalse: [aMenu add: 'copy text' selector: #clipText].
self addExportMenuItems: aMenu hand: evt hand.
aMenu addLine.
aMenu add: 'adhere to edge...' selector: #adhereToEdge.
Expand Down Expand Up @@ -1481,8 +1480,6 @@ Morph >> buildMetaMenu: evt [
self maybeAddCollapseItemTo: menu.
menu add: 'delete' selector: #dismissMorph:.
menu addLine.
menu add: 'copy text' selector: #clipText.
menu addLine.
menu add: 'go behind' selector: #goBehind.
menu add: 'add halo' selector: #addHalo:.
menu add: 'duplicate' selector: #maybeDuplicateMorph:.
Expand Down Expand Up @@ -1861,25 +1858,6 @@ Morph >> clipSubmorphs: aBool [
self invalidRect: self fullBounds]
]

{ #category : 'printing' }
Morph >> clipText [
"Copy the text in the receiver or in its submorphs to the clipboard"
| content |
"My own text"
content := self userString.
"Or in my submorphs"
content ifNil: [
| list |
list := self allStringsAfter: nil.
list notEmpty ifTrue: [
content := String streamContents: [:stream |
list do: [:each | stream nextPutAll: each; cr]]]].
"Did we find something?"
content
ifNil: [self flash "provide feedback"]
ifNotNil: [Clipboard clipboardText: content]
]

{ #category : 'drawing' }
Morph >> clippingBounds [
"Return the bounds to which any submorphs should be clipped if the property is set"
Expand Down
17 changes: 0 additions & 17 deletions src/Morphic-Widgets-Pluggable/PluggableListMorph.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -288,23 +288,6 @@ PluggableListMorph >> commandKeyTypedIntoMenu: evt [
^ self modifierKeyPressed: evt
]

{ #category : 'menus' }
PluggableListMorph >> copyListToClipboard [
"Copy my items to the clipboard as a multi-line string"

| stream |
stream := (String new: self getList size * 40) writeStream.
list do: [:ea | stream nextPutAll: ea asString] separatedBy: [stream nextPut: Character cr].
Clipboard clipboardText: stream contents
]

{ #category : 'menus' }
PluggableListMorph >> copySelectionToClipboard [
"Copy my selected item to the clipboard as a string"

self selection ifNotNil: [ Clipboard clipboardText: self selection asString ] ifNil: [ self flash ]
]

{ #category : 'multi-selection' }
PluggableListMorph >> defaultMultipleSelectionValue [

Expand Down
10 changes: 0 additions & 10 deletions src/Morphic-Widgets-Windows/SystemWindow.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,6 @@ SystemWindow class >> windowMenuOn: aBuilder [
iconName: #smallHelp;
withSeparatorAfter.
(aBuilder item: #'Change title') action: [ aBuilder model relabel ].
(aBuilder item: #'Copy title')
action: [ aBuilder model copyTitle ];
withSeparatorAfter.
(aBuilder item: #'Send to back') action: [ aBuilder model sendToBack ].
(aBuilder item: #'Make next-to-topmost')
action: [ aBuilder model makeSecondTopmost ];
Expand Down Expand Up @@ -1281,13 +1278,6 @@ SystemWindow >> configureForUnembedding [
self attachKeymapCategory: #WindowShortcuts.
]

{ #category : 'accessing' }
SystemWindow >> copyTitle [

Clipboard clipboardText: self label.
InformativeNotification signal: 'Window title copied.'
]

{ #category : 'initialization' }
SystemWindow >> createBox [
"create a button with default to be used in the label area"
Expand Down
7 changes: 0 additions & 7 deletions src/OSWindow-Core/ManifestOSWindowCore.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,3 @@ Class {
#package : 'OSWindow-Core',
#tag : 'Manifest'
}

{ #category : 'meta-data - dependency analyser' }
ManifestOSWindowCore class >> manuallyResolvedDependencies [

<ignoreForCoverage>
^ #(#'Tool-Profilers')
]
22 changes: 0 additions & 22 deletions src/OSWindow-Core/OSKeyboardEvent.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,6 @@ Class {
#tag : 'Events'
}

{ #category : 'keymapping' }
OSKeyboardEvent >> asKeyCombination [
| modifier control command shift alt char |

control := self modifiers ctrl.
command := self modifiers cmd.
shift := self modifiers shift.
alt := self modifiers alt.
char := self modifiedCharacter.

(shift | command | control | alt)
ifFalse: [^ KMSingleKeyCombination from: char ].

modifier := KMNoShortcut new.
control ifTrue: [ modifier := modifier + KMModifier ctrl ].
command ifTrue: [ modifier := modifier + KMModifier command ].
shift ifTrue: [ modifier := modifier + KMModifier shift ].
alt ifTrue: [ modifier := modifier + KMModifier alt ].

^ modifier + char
]

{ #category : 'accessing' }
OSKeyboardEvent >> character [

Expand Down
5 changes: 2 additions & 3 deletions src/OSWindow-Core/OSWindow.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,10 @@ OSWindow >> deliverGlobalEvent: aGlobalEvent [

{ #category : 'private' }
OSWindow >> destroy [
announcer announce: DeleteWindowByCrossAnnouncement .

self validHandle destroy.
backendWindow := nil.
eventHandler := nil.

eventHandler := nil
]

{ #category : 'accessing' }
Expand Down
28 changes: 0 additions & 28 deletions src/OSWindow-Core/OSWindowDriver.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -118,38 +118,10 @@ You will need to restart the image to make this changes take effect.';
domainValues: (self allSubclasses select: [ :each | each isSuitable ]) ]
]

{ #category : 'system startup' }
OSWindowDriver class >> shutDown: quitting [

quitting ifFalse: [ ^ self ].

Current ifNil: [ ^ self ].

"Clean driver"
Current shutDown: quitting.
Current := nil.

"clean OSWindow worlds"
WorldMorph extraWorldList copy
select: [ :each | each isKindOf: OSWindowWorldMorph ]
thenDo: [ :each | WorldMorph removeExtraWorld: each ].
"Clean also active world"
(ActiveWorld isKindOf: OSWindowWorldMorph)
ifTrue: [ ActiveWorld := nil ]
]

{ #category : 'events' }
OSWindowDriver >> afterMainPharoWindowCreated: aWindow [
]

{ #category : 'events' }
OSWindowDriver >> afterSetWindowTitle: windowTitle onWindow: osWindow [
]

{ #category : 'events' }
OSWindowDriver >> beforeMainPharoWindowClosed: aWindow [
]

{ #category : 'window creation' }
OSWindowDriver >> createWindowWithAttributes: anOSWindowAttributes osWindow: osWindow [
self subclassResponsibility
Expand Down
50 changes: 49 additions & 1 deletion src/OSWindow-Core/OSWindowFormRenderer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,63 @@ Class {
#instVars : [
'form'
],
#classInstVars : [
'canvasScaleFactor',
'autoSetCanvasScaleFactor'
],
#category : 'OSWindow-Core-Renderer',
#package : 'OSWindow-Core',
#tag : 'Renderer'
}

{ #category : 'accessing' }
OSWindowFormRenderer class >> autoSetCanvasScaleFactor [

^ autoSetCanvasScaleFactor ifNil: [ autoSetCanvasScaleFactor := true ]
]

{ #category : 'accessing' }
OSWindowFormRenderer class >> autoSetCanvasScaleFactor: boolean [

autoSetCanvasScaleFactor := boolean
]

{ #category : 'accessing' }
OSWindowFormRenderer class >> canvasScaleFactor [

^ canvasScaleFactor ifNil: [ canvasScaleFactor := 1 ]
]

{ #category : 'accessing' }
OSWindowFormRenderer class >> canvasScaleFactor: newScale [

canvasScaleFactor := 1 max: newScale asInteger
]

{ #category : 'accessing' }
OSWindowFormRenderer class >> settingsOn: aBuilder [

<systemsettings>

(aBuilder group: #canvasScaleFactorGroup)
parent: #appearance;
label: 'World renderer canvas scaling';
with: [
(aBuilder pickOne: #canvasScaleFactor)
label: 'Canvas scale factor';
target: self;
domainValues: (1 to: 5);
default: 1.
(aBuilder setting: #autoSetCanvasScaleFactor)
label: 'Set canvas scale factor automatically';
target: self;
default: true ]
]

{ #category : 'private' }
OSWindowFormRenderer >> canvasScaleFactor [

^ OSWorldRenderer canvasScaleFactor
^ self class canvasScaleFactor
]

{ #category : 'morphic integration' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : 'Morph' }

{ #category : '*OSWindow-Core' }
{ #category : '*OSWindow-Morphic' }
Morph >> openInExternalWindow [
| world |
world := OSWindowWorldMorph new extent: self fullBounds extent.
Expand All @@ -19,7 +19,7 @@ Morph >> openInExternalWindow [
^ world open
]

{ #category : '*OSWindow-Core' }
{ #category : '*OSWindow-Morphic' }
Morph >> openInExternalWindowModalCallback: aBlock [
| world |
world := OSWindowWorldMorph new extent: self extent.
Expand Down
Loading