[squeak-dev] The Trunk: Graphics-mt.332.mcz

commits at source.squeak.org commits at source.squeak.org
Sat May 7 07:49:28 UTC 2016


Marcel Taeumel uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-mt.332.mcz

==================== Summary ====================

Name: Graphics-mt.332
Author: mt
Time: 7 May 2016, 9:48:30.374081 am
UUID: 7fc10c6a-d146-584d-8e94-7153042d37d9
Ancestors: Graphics-nice.331

Cherry-pick and adapt eToys' way to set the screen size programmatically via HostWindowPlugin.

=============== Diff against Graphics-nice.331 ===============

Item was changed:
  Form subclass: #DisplayScreen
  	instanceVariableNames: 'clippingBox extraRegions'
+ 	classVariableNames: 'DeferringUpdates DisplayChangeSignature DisplayIsFullScreen ScreenSave'
- 	classVariableNames: 'DeferringUpdates DisplayChangeSignature ScreenSave'
  	poolDictionaries: ''
  	category: 'Graphics-Display Objects'!
  
  !DisplayScreen commentStamp: '<historical>' prior: 0!
  There is only one instance of me, Display. It is a global and is used to handle general user requests to deal with the whole display screen. 
  	Although I offer no protocol, my name provides a way to distinguish this special instance from all other Forms. This is useful, for example, in dealing with saving and restoring the system.
  	To change the depth of your Display...
  		Display newDepth: 16.
  		Display newDepth: 8.
  		Display newDepth: 1.
  Valid display depths are 1, 2, 4, 8, 16 and 32.  It is suggested that you run with your monitors setting the same, for better speed and color fidelity.  Note that this can add up to 4Mb for the Display form.  Finally, note that newDepth: ends by executing a 'ControlManager restore' which currently terminates the active process, so nothing that follows in the doit will get executed.
  
  Depths 1, 2, 4 and 8 bits go through a color map to put color on the screen, but 16 and 32-bit color use the pixel values directly for RGB color (5 and 8 bits per, respectivlely).  The color choice an be observed by executing Color fromUser in whatever depth you are using.
  !

Item was removed:
- ----- Method: DisplayScreen class>>depth:width:height:fullscreen: (in category 'display box access') -----
- depth: depthInteger width: widthInteger height: heightInteger fullscreen: aBoolean
- 	"Force Squeak's window (if there's one) into a new size and depth."
- 	"DisplayScreen depth: 8 width: 1024 height: 768 fullscreen: false"
- 
- 	<primitive: 92>
- 	self primitiveFailed!

Item was added:
+ ----- Method: DisplayScreen class>>displayIsFullScreen (in category 'screen modes') -----
+ displayIsFullScreen
+ 
+ 	^ DisplayIsFullScreen ifNil: [DisplayIsFullScreen := false]!

Item was added:
+ ----- Method: DisplayScreen class>>fullScreenOff (in category 'screen modes') -----
+ fullScreenOff
+ 
+ 	Display fullScreenMode: (DisplayIsFullScreen := false).
+ 	self checkForNewScreenSize.
+ !

Item was added:
+ ----- Method: DisplayScreen class>>fullScreenOn (in category 'screen modes') -----
+ fullScreenOn
+ 
+ 	Display fullScreenMode: (DisplayIsFullScreen := true).
+ 	self checkForNewScreenSize.!

Item was added:
+ ----- Method: DisplayScreen class>>hostWindowExtent: (in category 'host window access') -----
+ hostWindowExtent: aPoint
+ 	
+ 	^ self
+ 		primitiveWindow: self hostWindowIndex
+ 		width: aPoint x
+ 		height: aPoint y!

Item was added:
+ ----- Method: DisplayScreen class>>hostWindowIndex (in category 'host window access') -----
+ hostWindowIndex
+ 
+ 	^ 1!

Item was added:
+ ----- Method: DisplayScreen class>>hostWindowTitle: (in category 'host window access') -----
+ hostWindowTitle: aString
+ 
+ 	^ self
+ 		primitiveWindow: self hostWindowIndex
+ 		title: aString squeakToUtf8!

Item was added:
+ ----- Method: DisplayScreen class>>primitiveWindow:title: (in category 'host window access') -----
+ primitiveWindow: id title: titleString
+ 
+ 	<primitive: 'primitiveHostWindowTitle' module: 'HostWindowPlugin'>
+ 	^self primitiveFailed!

Item was added:
+ ----- Method: DisplayScreen class>>primitiveWindow:width:height: (in category 'host window access') -----
+ primitiveWindow: id width: width height: height
+ 
+ 	<primitive: 'primitiveHostWindowSizeSet' module: 'HostWindowPlugin'>
+ 	^self primitiveFailed!

Item was added:
+ ----- Method: DisplayScreen class>>setNewScreenSize: (in category 'display box access') -----
+ setNewScreenSize: aPoint
+ 	"Ensure that the Display is set to the given extent. Due to the behavior of host-window plugin, this may need two attempts because the plugin tends to account for host window shadows and title bars."
+ 	
+ 	self hostWindowExtent: aPoint.
+ 	self checkForNewScreenSize.
+ 	
+ 	Display extent < aPoint ifTrue: [
+ 		self hostWindowExtent: 2*aPoint - Display extent.
+ 		self checkForNewScreenSize].!

Item was added:
+ ----- Method: DisplayScreen class>>toggleFullScreen (in category 'screen modes') -----
+ toggleFullScreen
+ 	"Toggle between full screen and windowed mode."
+ 	
+ 	self displayIsFullScreen
+ 		ifTrue: [self fullScreenOff]
+ 		ifFalse: [self fullScreenOn].!



More information about the Squeak-dev mailing list