Skip to content

Commit

Permalink
Merge pull request #687 from pharo-graphics/686-Implement-some-explic…
Browse files Browse the repository at this point in the history
…itRequirements-on-Morphic-host

Implement some explicit requirements on Morphic host & fix some space properties for all hosts
  • Loading branch information
tinchodias authored Feb 5, 2025
2 parents 476b29a + 9b7cb52 commit 8d97b4d
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Bloc/BlSpace.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,7 @@ BlSpace >> isFullscreen [
"Return true if an underlying window is in fullscreen mode, false otherwise."

^ self
hostSpaceDo: [ :aHostSpace | aHostSpace fullscreen ]
hostSpaceDo: [ :aHostSpace | aHostSpace isFullscreen ]
ifAbsent: [ fullscreen ]
]

Expand Down Expand Up @@ -1246,7 +1246,7 @@ BlSpace >> isResizable [
"Return true if underlying window is resizable, false otherwise"

^ self
hostSpaceDo: [ :aHostSpace | aHostSpace resizable ]
hostSpaceDo: [ :aHostSpace | aHostSpace isResizable ]
ifAbsent: [ resizable ]
]

Expand Down
15 changes: 15 additions & 0 deletions src/BlocHost-Morphic/BlMorphicHostSpace.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,21 @@ BlMorphicHostSpace >> isFullsize [
^ true
]

{ #category : #testing }
BlMorphicHostSpace >> isValid [

^ spaceHostMorph isNotNil
]

{ #category : #'host space - testing' }
BlMorphicHostSpace >> isVisible [
"Return true if underlying window is shown, false otherwise.
Note: If window was shown and then minimized it is still considered to be visible.
Window can become invisible by asking it to hide"

^ spaceHostMorph visible
]

{ #category : #'host space - geometry' }
BlMorphicHostSpace >> logicalSize [
"Returns the logical size of the host's client area.
Expand Down
51 changes: 51 additions & 0 deletions src/BlocHost-Morphic/BlMorphicWindowHostSpace.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ BlMorphicWindowHostSpace >> densityDpi [
^ 96.0
]

{ #category : #'window - properties' }
BlMorphicWindowHostSpace >> fullscreen: aBoolean [
"Ignore. A Morphic space can't be fullscreen."

]

{ #category : #'window - properties' }
BlMorphicWindowHostSpace >> fullsize: aBoolean [
"Switch underlying window to fullsize if true is given
Expand Down Expand Up @@ -95,6 +101,13 @@ BlMorphicWindowHostSpace >> isBorderless [
^ isBorderless
]

{ #category : #'window - properties' }
BlMorphicWindowHostSpace >> isFullscreen [
"Return false, as a Morphic space doesn't support fullscreen."

^ false
]

{ #category : #'window - properties' }
BlMorphicWindowHostSpace >> isFullsize [
"Return true if an underlying window is in fullsize mode, false otherwise.
Expand All @@ -103,6 +116,13 @@ BlMorphicWindowHostSpace >> isFullsize [
^ isFullSize
]

{ #category : #'window - properties' }
BlMorphicWindowHostSpace >> isResizable [
"Return true if underlying window is resizable, false otherwise"

^ morphicWindow isResizeable
]

{ #category : #'text input' }
BlMorphicWindowHostSpace >> isTextInputActive [
"Check whether or not Unicode text input events are enabled"
Expand Down Expand Up @@ -130,6 +150,30 @@ BlMorphicWindowHostSpace >> logicalSize [
^ morphicWindow spaceExtent asLogicalSize
]

{ #category : #'host space - displaying' }
BlMorphicWindowHostSpace >> maximize [

morphicWindow maximize
]

{ #category : #'host space - displaying' }
BlMorphicWindowHostSpace >> maximized [

^ morphicWindow isMaximized
]

{ #category : #'host space - displaying' }
BlMorphicWindowHostSpace >> minimize [

morphicWindow minimize
]

{ #category : #'host space - displaying' }
BlMorphicWindowHostSpace >> minimized [

^ morphicWindow isMinimized
]

{ #category : #'private - accessing' }
BlMorphicWindowHostSpace >> morphicWindow [
^ morphicWindow
Expand Down Expand Up @@ -182,6 +226,13 @@ BlMorphicWindowHostSpace >> position: aPoint [
morphicWindow position: aPoint
]

{ #category : #'window - properties' }
BlMorphicWindowHostSpace >> resizable: aBoolean [
"Make underlying window resizable if true is given"

morphicWindow isResizeable: aBoolean
]

{ #category : #'host space - displaying' }
BlMorphicWindowHostSpace >> show [

Expand Down

0 comments on commit 8d97b4d

Please sign in to comment.