[squeak-dev] The Trunk: Graphics-tfel.356.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Jul 28 15:07:35 UTC 2016


Tim Felgentreff uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-tfel.356.mcz

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

Name: Graphics-tfel.356
Author: tfel
Time: 28 July 2016, 5:07:03.284263 pm
UUID: 563a9dfa-5c42-b44a-8122-dbb5f553f5c4
Ancestors: Graphics-tfel.355

add a preference for bigger cursors (from etoys) and fix fallback for CursorWithAlpha for systems that do not support 32-bit cursors with alpha

=============== Diff against Graphics-tfel.355 ===============

Item was changed:
  Form subclass: #Cursor
  	instanceVariableNames: ''
+ 	classVariableNames: 'BlankCursor BottomLeftCursor BottomRightCursor CornerCursor CrossHairCursor CurrentCursor DownCursor MarkerCursor MenuCursor MoveCursor NormalCursor OriginCursor ReadCursor ResizeLeftCursor ResizeTopCursor ResizeTopLeftCursor ResizeTopRightCursor RightArrowCursor SquareCursor TargetCursor TopLeftCursor TopRightCursor UpCursor UseBiggerCursors WaitCursor WebLinkCursor WriteCursor XeqCursor'
- 	classVariableNames: 'BlankCursor BottomLeftCursor BottomRightCursor CornerCursor CrossHairCursor CurrentCursor DownCursor MarkerCursor MenuCursor MoveCursor NormalCursor OriginCursor ReadCursor ResizeLeftCursor ResizeTopCursor ResizeTopLeftCursor ResizeTopRightCursor RightArrowCursor SquareCursor TargetCursor TopLeftCursor TopRightCursor UpCursor WaitCursor WebLinkCursor WriteCursor XeqCursor'
  	poolDictionaries: ''
  	category: 'Graphics-Display Objects'!
  
  !Cursor commentStamp: '<historical>' prior: 0!
  I am a Form that is a possible appearance for a mouse cursor.  My size is always 16x16, ever since the original implementation on the Alto.
  
  There are many examples available in the "current cursor" category of class methods.  For example, "Cursor normal" and "Cursor wait".  For example:
  
  	Cursor wait show
  
  !

Item was changed:
  ----- Method: Cursor class>>currentCursor: (in category 'current cursor') -----
  currentCursor: aCursor 
  	"Make the instance of cursor, aCursor, be the current cursor. Display it. 
  	Create an error if the argument is not a Cursor."
  
  	(aCursor isKindOf: self)
  		ifTrue: [CurrentCursor := aCursor.
+ 				self useBiggerCursors
+ 					ifTrue: [[^ aCursor asBigCursor beCursor]
+ 						on: Error do: ["fall through"]].
  				aCursor beCursor]
  		ifFalse: [self error: 'The new cursor must be an instance of class Cursor']!

Item was added:
+ ----- Method: Cursor class>>useBiggerCursors (in category 'preferences') -----
+ useBiggerCursors
+ 
+ 	<preference: 'Use bigger mouse cursors'
+ 		category: 'mouse'
+ 		description: 'If true, mouse cursors are scaled up'
+ 		type: #Boolean>
+ 	^ UseBiggerCursors ifNil: [false]!

Item was added:
+ ----- Method: Cursor class>>useBiggerCursors: (in category 'preferences') -----
+ useBiggerCursors: aBool
+ 
+ 	UseBiggerCursors := aBool!

Item was added:
+ ----- Method: Cursor>>asBigCursor (in category 'converting') -----
+ asBigCursor
+ 	"Big cursors are 32 bits deep (ARGB premultiplied)"
+ 	depth = 32
+ 		ifFalse: [^self enlargedBy: 2].
+ 	^self!

Item was added:
+ ----- Method: Cursor>>enlargedBy: (in category 'converting') -----
+ enlargedBy: scale
+ 	"Big cursors are 32 bits deep (ARGB premultiplied)"
+ 	| big |
+ 	scale = 1 ifTrue: [^self].
+ 	big := CursorWithAlpha extent: self extent * scale depth: 32.
+ 	(self asCursorForm magnifyBy: scale) displayOn: big.
+ 	big offset: (self offset - 0.5 * scale min: 0 at 0 max: big extent negated) asIntegerPoint.
+ 	big fallback: self.
+ 	^big!

Item was added:
+ ----- Method: CursorWithAlpha>>beCursor (in category 'primitives') -----
+ beCursor
+ 	<primitive: 101>
+ 	self fallback beCursor!

Item was removed:
- ----- Method: CursorWithAlpha>>primBeCursor (in category 'primitives') -----
- primBeCursor
- 	<primitive: 101>
- 	self fallback primBeCursor!



More information about the Squeak-dev mailing list