[Cuis-dev] VectorEnginePlugin (was Re: UK Smalltalk User Group meeting - Wednesday March 31st)

Juan Vuletich juan at jvuletich.org
Tue Mar 23 10:53:42 PDT 2021


Hi Bernhard!

It is great to see you around!

I gosh. And I thought I wrote detailed and complete instructions.

I forgot to say this in the instructions. After starting Cuis, the 
_first_ thing to do is to install updates.

Cheers,
Juan Vuletich

On 3/23/2021 1:39 PM, Bernhard Pieber via Cuis-dev wrote:
> Hi Juan,
>
> You know I have been waiting for this announcement. ;-) So I could not wait to try.
>
> I am running macOS Big Sur 11.2.3.
>
> I used Cuis5.0-4526.image. The other images don’t start.
>
> I set ComputerModernSans as the system font. That’s a TrueType font, right?
>
> When I evaluate M3Exp01Morph new openInWorld Cuis asks if I want to install and activate VectorGraphics support.
>
> I answer yes. A morph appears near the top left of the screen. When I try moving it Cuis freezes and CuisDebug.log files appear, see below.
>
> I tried the same with all packages loaded with the same result.
>
> Any idea?
>
> Cheers,
> Bernhard
>
> Error: MessageNotUnderstood: Array>>offset
> 23 March 2021 5:11:39.776127 pm
>
> VM: Mac OS - Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.2945] 5.0.202103010116
> Image: Cuis 5.0 [latest update: #4526]
>
> Array(Object)>>error:
> 	Receiver: #(Form(135x114x32) Form(135x114x32))
> 	Arguments and temporary variables:
> 		aString: 	'MessageNotUnderstood: Array>>offset'
> 	Receiver's instance variables:
> #(Form(135x114x32) Form(135x114x32))
> [] in WorldMorph>>displayWorldSafely
> 	Receiver:  [world]
> 	Arguments and temporary variables:
> 		err: 	'MessageNotUnderstood: Array>>offset'
> 		rcvr: 	#(Form(135x114x32) Form(135x114x32))
> 	Receiver's instance variables:
> 		owner: 	nil
> 		submorphs: 	#(Workspace System Browser Transcript a TaskbarMorph(3157524))
> 		properties: 	nil
> 		id: 	267
> 		privateDisplayBounds: 	nil
> 		location: 	MorphicTranslation(translation 0.0 at 0.0)
> 		layoutSpec: 	nil
> 		extent: 	2560 at 1540
> 		color: 	(Color r: 0.800 g: 1.000 b: 0.600)
> 		backgroundImage: 	Form(2560x1540x-32)
> 		backgroundImageData: 	#[255 216 255 236 0 17 68 117 99 107 121 0 1 0 4 0 0 0 81 [..]
> 		activeHand: 	a HandMorph(3748314)
> 		hands: 	#(a HandMorph(3748314))
> 		canvas: 	a HybridCanvas on: DisplayScreen(2560x1540x32)
> 		damageRecorder: 	a DamageRecorder
> 		stepList: 	a Heap(StepMessage(#stepAt: ->  an UpdatingLabelMorph(148227)'17:11:39[..]
> 		lastCycleTime: 	3793972299555
> 		alarms: 	a Heap()
> 		lastAlarmTime: 	0
> 		deferredUIMessages: 	a SharedQueue(1)
> 		drawingFailingMorphs: 	a WeakIdentitySet( [world])
> 		waitDelay: 	a Delay(50 msecs)
> 		pause: 	20
> 		lastCycleHadAnyEvent: 	true
> 		taskbar: 	a TaskbarMorph(3157524)
>
> BlockClosure>>valueWithPossibleArgument:and:
> 	Receiver: [closure] in WorldMorph>>displayWorldSafely
> 	Arguments and temporary variables:
> 		anArg: 	'MessageNotUnderstood: Array>>offset'
> 		secondArg: 	#(Form(135x114x32) Form(135x114x32))
> 	Receiver's instance variables:
> 		outerContext: 	WorldMorph>>displayWorldSafely
> 		startpc: 	76
> 		numArgs: 	2
>
> [] in BlockClosure>>ifError:
> 	Receiver: [closure] in WorldMorph>>displayWorldSafely
> 	Arguments and temporary variables:
> 		errorHandlerBlock: 	MessageNotUnderstood: Array>>offset
> 		ex: 	[closure] in WorldMorph>>displayWorldSafely
> 	Receiver's instance variables:
> 		outerContext: 	WorldMorph>>displayWorldSafely
> 		startpc: 	69
> 		numArgs: 	0
>
> BlockClosure>>valueWithPossibleArgument:
> 	Receiver: [closure] in BlockClosure>>ifError:
> 	Arguments and temporary variables:
> 		anArg: 	MessageNotUnderstood: Array>>offset
> 	Receiver's instance variables:
> 		outerContext: 	BlockClosure>>ifError:
> 		startpc: 	72
> 		numArgs: 	1
>
> [] in [] in MessageNotUnderstood(Exception)>>evaluateHandlerBlock:
> 	Receiver: MessageNotUnderstood: Array>>offset
> 	Arguments and temporary variables:
> <<error during printing>
> 	Receiver's instance variables:
> 		messageText: 	nil
> 		tag: 	nil
> 		signalContext: 	MessageNotUnderstood(Exception)>>signal
> 		handlerContexts: 	an OrderedCollection(BlockClosure>>on:do:)
> 		outerContext: 	nil
> 		handlerBlockNotCurtailed: 	false
> 		message: 	offset
> 		receiver: 	#(Form(135x114x32) Form(135x114x32))
> 		reachedDefaultHandler: 	false
>
> BlockClosure>>on:do:
> 	Receiver: [closure] in [] in MessageNotUnderstood(Exception)>>evaluateHandlerBlock:
> 	Arguments and temporary variables:
> 		exception: 	Exception
> 		handlerAction: 	[closure] in [] in MessageNotUnderstood(Exception)>>evaluateHand[..]
> 	Receiver's instance variables:
> 		outerContext: 	[] in MessageNotUnderstood(Exception)>>evaluateHandlerBlock:
> 		startpc: 	202
> 		numArgs: 	0
>
> [] in MessageNotUnderstood(Exception)>>evaluateHandlerBlock:
> 	Receiver: MessageNotUnderstood: Array>>offset
> 	Arguments and temporary variables:
> 		aBlock: 	[closure] in BlockClosure>>ifError:
> 		handlerEx: 	#(UnhandledError)
> 		answer: 	nil
> 	Receiver's instance variables:
> 		messageText: 	nil
> 		tag: 	nil
> 		signalContext: 	MessageNotUnderstood(Exception)>>signal
> 		handlerContexts: 	an OrderedCollection(BlockClosure>>on:do:)
> 		outerContext: 	nil
> 		handlerBlockNotCurtailed: 	false
> 		message: 	offset
> 		receiver: 	#(Form(135x114x32) Form(135x114x32))
> 		reachedDefaultHandler: 	false
>
> BlockClosure>>ifCurtailed:
> 	Receiver: [closure] in MessageNotUnderstood(Exception)>>evaluateHandlerBlock:
> 	Arguments and temporary variables:
> 		aBlock: 	[closure] in MessageNotUnderstood(Exception)>>evaluateHandlerBlock:
> 		complete: 	nil
> 		result: 	nil
> 	Receiver's instance variables:
> 		outerContext: 	MessageNotUnderstood(Exception)>>evaluateHandlerBlock:
> 		startpc: 	196
> 		numArgs: 	0
>
> MessageNotUnderstood(Exception)>>evaluateHandlerBlock:
> 	Receiver: MessageNotUnderstood: Array>>offset
> 	Arguments and temporary variables:
> 		aBlock: 	[closure] in BlockClosure>>ifError:
> 		handlerEx: 	#(UnhandledError)
> 	Receiver's instance variables:
> 		messageText: 	nil
> 		tag: 	nil
> 		signalContext: 	MessageNotUnderstood(Exception)>>signal
> 		handlerContexts: 	an OrderedCollection(BlockClosure>>on:do:)
> 		outerContext: 	nil
> 		handlerBlockNotCurtailed: 	false
> 		message: 	offset
> 		receiver: 	#(Form(135x114x32) Form(135x114x32))
> 		reachedDefaultHandler: 	false
>
> MethodContext(ContextPart)>>evaluateSignal:
> 	Receiver: BlockClosure>>on:do:
> 	Arguments and temporary variables:
> 		exception: 	MessageNotUnderstood: Array>>offset
> 		value: 	nil
> 	Receiver's instance variables:
> 		sender: 	BlockClosure>>ifError:
> 		pc: 	30
> 		stackp: 	2
> 		method: 	(BlockClosure>>#on:do: "a CompiledMethod(1623573)")
> 		closureOrNil: 	nil
> 		receiver: 	[closure] in WorldMorph>>displayWorldSafely
>
> MethodContext(ContextPart)>>handleSignal:
> 	Receiver: BlockClosure>>on:do:
> 	Arguments and temporary variables:
> 		exception: 	MessageNotUnderstood: Array>>offset
> 	Receiver's instance variables:
> 		sender: 	BlockClosure>>ifError:
> 		pc: 	30
> 		stackp: 	2
> 		method: 	(BlockClosure>>#on:do: "a CompiledMethod(1623573)")
> 		closureOrNil: 	nil
> 		receiver: 	[closure] in WorldMorph>>displayWorldSafely
>
> MessageNotUnderstood(Exception)>>signalIn:
> 	Receiver: MessageNotUnderstood: Array>>offset
> 	Arguments and temporary variables:
> 		aContext: 	MessageNotUnderstood(Exception)>>signal
> 	Receiver's instance variables:
> 		messageText: 	nil
> 		tag: 	nil
> 		signalContext: 	MessageNotUnderstood(Exception)>>signal
> 		handlerContexts: 	an OrderedCollection(BlockClosure>>on:do:)
> 		outerContext: 	nil
> 		handlerBlockNotCurtailed: 	false
> 		message: 	offset
> 		receiver: 	#(Form(135x114x32) Form(135x114x32))
> 		reachedDefaultHandler: 	false
>
> MessageNotUnderstood(Exception)>>signal
> 	Receiver: MessageNotUnderstood: Array>>offset
> 	Arguments and temporary variables:
>
> 	Receiver's instance variables:
> 		messageText: 	nil
> 		tag: 	nil
> 		signalContext: 	MessageNotUnderstood(Exception)>>signal
> 		handlerContexts: 	an OrderedCollection(BlockClosure>>on:do:)
> 		outerContext: 	nil
> 		handlerBlockNotCurtailed: 	false
> 		message: 	offset
> 		receiver: 	#(Form(135x114x32) Form(135x114x32))
> 		reachedDefaultHandler: 	false
>
> Array(Object)>>doesNotUnderstand: #offset
> 	Receiver: #(Form(135x114x32) Form(135x114x32))
> 	Arguments and temporary variables:
> 		aMessage: 	offset
> 		exception: 	MessageNotUnderstood: Array>>offset
> 		resumeValue: 	nil
> 	Receiver's instance variables:
> #(Form(135x114x32) Form(135x114x32))
> HybridCanvas(MorphicCanvas)>>restorePatch:
> 	Receiver: a HybridCanvas on: DisplayScreen(2560x1540x32)
> 	Arguments and temporary variables:
> 		savedPatch: 	#(Form(135x114x32) Form(135x114x32))
> 	Receiver's instance variables:
> 		world: 	 [world]
> 		form: 	DisplayScreen(2560x1540x32)
> 		clipRect: 	0 at 0 corner: 2560 at 1540
> 		transformations: 	an OrderedCollection(MorphicTranslation(translation 0.0 at 0.0)  [..]
> 		currentTransformation: 	MorphicTranslation(translation 0.0 at 0.0)
> 		cti: 	2
> 		currentMorph: 	 [world]
> 		drawingMorphStack: 	an OrderedCollection(nil  [world] nil nil nil nil nil nil)
> 		engine: 	a BitBltCanvasEngine
> 		clippingMorphDisplayBounds: 	nil
> 		vectorCanvas: 	a VectorCanvas on: DisplayScreen(2560x1540x32)
> 		morphIDsForm: 	Form(2560x1540x32)
> 		drawingOnMorphIDs: 	false
>
> HandMorph>>restoreSavedPatchOn:
> 	Receiver: a HandMorph(3748314)
> 	Arguments and temporary variables:
> 		aCanvas: 	a HybridCanvas on: DisplayScreen(2560x1540x32)
> 	Receiver's instance variables:
> 		owner: 	 [world]
> 		submorphs: 	#(a M3Exp01Morph(4145143))
> 		properties: 	nil
> 		id: 	26634
> 		privateDisplayBounds: 	nil
> 		location: 	MorphicTranslation(translation 95.0 at 81.0)
> 		layoutSpec: 	nil
> 		extent: 	16 at 16
> 		color: 	(Color r: 0.976 g: 0.451 b: 0.024)
> 		mouseFocus: 	nil
> 		keyboardFocus: 	nil
> 		mouseClickState: 	nil
> 		mouseOverHandler: 	a MouseOverHandler
> 		lastMouseEvent: 	a MouseMoveEvent
> 		hasChanged: 	false
> 		savedPatch: 	#(Form(135x114x32) Form(135x114x32))
> 		lastEventBuffer: 	#(1 47791 95 81 4 0 0 1)
> 		lastKeyDownValue: 	2
> 		lastMouseEventTime: 	3793972299391
> 		prevFullBounds: 	39 at 40 corner: 174 at 154
> 		grabMorphData: 	an IdentityDictionary(a M3Exp01Morph(4145143)->#( [world] 50.0 at 5[..]
> 		lastPosition: 	95.0 at 81.0
>
> [] in WorldMorph>>displayWorld
> 	Receiver:  [world]
> 	Arguments and temporary variables:
> <<error during printing>
> 	Receiver's instance variables:
> 		owner: 	nil
> 		submorphs: 	#(Workspace System Browser Transcript a TaskbarMorph(3157524))
> 		properties: 	nil
> 		id: 	267
> 		privateDisplayBounds: 	nil
> 		location: 	MorphicTranslation(translation 0.0 at 0.0)
> 		layoutSpec: 	nil
> 		extent: 	2560 at 1540
> 		color: 	(Color r: 0.800 g: 1.000 b: 0.600)
> 		backgroundImage: 	Form(2560x1540x-32)
> 		backgroundImageData: 	#[255 216 255 236 0 17 68 117 99 107 121 0 1 0 4 0 0 0 81 [..]
> 		activeHand: 	a HandMorph(3748314)
> 		hands: 	#(a HandMorph(3748314))
> 		canvas: 	a HybridCanvas on: DisplayScreen(2560x1540x32)
> 		damageRecorder: 	a DamageRecorder
> 		stepList: 	a Heap(StepMessage(#stepAt: ->  an UpdatingLabelMorph(148227)'17:11:39[..]
> 		lastCycleTime: 	3793972299555
> 		alarms: 	a Heap()
> 		lastAlarmTime: 	0
> 		deferredUIMessages: 	a SharedQueue(1)
> 		drawingFailingMorphs: 	a WeakIdentitySet( [world])
> 		waitDelay: 	a Delay(50 msecs)
> 		pause: 	20
> 		lastCycleHadAnyEvent: 	true
> 		taskbar: 	a TaskbarMorph(3157524)
>
> OrderedCollection>>do:
> 	Receiver: an OrderedCollection(a HandMorph(3748314))
> 	Arguments and temporary variables:
> 		aBlock: 	[closure] in WorldMorph>>displayWorld
> 		index: 	3
> 	Receiver's instance variables:
> 		array: 	#(nil nil a HandMorph(3748314) nil nil nil nil nil nil nil)
> 		firstIndex: 	3
> 		lastIndex: 	3
>
>
> --- The full stack ---
> Array(Object)>>error:
> [] in WorldMorph>>displayWorldSafely
> BlockClosure>>valueWithPossibleArgument:and:
> [] in BlockClosure>>ifError:
> BlockClosure>>valueWithPossibleArgument:
> [] in [] in MessageNotUnderstood(Exception)>>evaluateHandlerBlock:
> BlockClosure>>on:do:
> [] in MessageNotUnderstood(Exception)>>evaluateHandlerBlock:
> BlockClosure>>ifCurtailed:
> MessageNotUnderstood(Exception)>>evaluateHandlerBlock:
> MethodContext(ContextPart)>>evaluateSignal:
> MethodContext(ContextPart)>>handleSignal:
> MessageNotUnderstood(Exception)>>signalIn:
> MessageNotUnderstood(Exception)>>signal
> Array(Object)>>doesNotUnderstand: #offset
> HybridCanvas(MorphicCanvas)>>restorePatch:
> HandMorph>>restoreSavedPatchOn:
> [] in WorldMorph>>displayWorld
> OrderedCollection>>do:
>   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> WorldMorph>>displayWorld
> [] in WorldMorph>>displayWorldSafely
> BlockClosure>>on:do:
> BlockClosure>>ifError:
> WorldMorph>>displayWorldSafely
> WorldMorph>>doOneCycleNow
> WorldMorph>>doOneCycle
> WorldMorph>>mainLoop
> [] in WorldMorph>>runProcess
> [] in BlockClosure>>newProcess
>
>
>
>
>> Am 23.03.2021 um 00:48 schrieb Juan Vuletich via Cuis-dev<cuis-dev at lists.cuis.st>:
>>
>> On 3/22/2021 5:55 PM, David T. Lewis via Cuis-dev wrote:
>>> Hello Juan,
>>>
>>> I recall from previous presentations that development of a VM plugin
>>> was on the to-do list for your vector graphics package. Could you
>>> please say a few words about what is needed? If it is something that
>>> I could help with, I would be happy to assist.
>>>
>>> Dave
>>>
>> Hello David, Eliot,
>>
>> I've been working on it for a couple of weeks, and it is starting to
>> take off! So, David, you just triggered an announcement.
>>
>> I have just pushed the relevant files to GitHub. There are several ways
>> to explore this.
>>
>> A - You want to see it running. Experimental. I only buit it for MacOS.
>> 1) Grab VM including the plugin from
>> https://www.dropbox.com/sh/rhkt4ayq24t2xbf/AACDb3mrjMUDB8Mptd-Bi6Zsa?dl=0
>> 2) Pull Cuis repo.
>> 3) Start Cuis with the VM above
>> 4) Evaluate: Feature require: 'VectorGraphics'.
>> 5) Set a TT Font (Stuff will break with StrikeFonts and you'll need to
>> kill the image)
>> 6) Evaluate: M3Exp01Morph new openInWorld.
>> 7) Play with the halo. Very slow! Still running the Smalltalk code for
>> VectorEngine
>> 8) Evaluate: (self runningWorld canvas instVarNamed: 'vectorCanvas')
>> usePlugin.
>> 9) Play with the halo. Rotate (bottom left handle) and Zool (bottom
>> right handle) Now it is very fast! The plugin is working.
>> 10) Hide the taskbar
>> 11) redefine WidgetMorph>>requiresVectorCanvas to answer true,
>> 12) refresh the display. Now every window and window element, including
>> all the text, is drawn by VectorEngine. You might notice that all the
>> appareances of any glyph, for example $a are no longer identical. Text
>> layout and Glyph placement is done with Float arithmetic, using subpixel
>> locations!
>> 13) redefine WidgetMorph>>hasVariableExtent to answer false.
>> 14) Open the halo on any window. Use the rotate and zoom handles.
>> 15) Yes. We can do high quality, subpixel antialiased text at _any_
>> scale and rotation angle! I don't know of any other Smalltalk or
>> windowing system that can do this. It is like pdf scaling, but for _all_
>> the UI!
>>
>> B - You want to look at the generated C code for the plugin, or build it
>> for another platform. You need a working setup to build the
>> OpenSmalltalk VM. The dropbox opensmalltalk-vm includes the files needed
>> to build the VM with the plugin.
>>
>> C - You want to experiment with the Slang plugin source code. I have
>> only done this in Cuis, not yet in the official Squeak VMMaker image.
>> 1) Clone / pull VMMaker repo
>> 2) Feature require: 'VMMaker'.
>> 3) FileIn 'IntegerArrayWordArray-stdint-VMMaker-jmv.006.cs.st'
>> 4) Feature require: 'VectorEnginePlugin'
>> 5) VectorEnginePlugin translateInDirectory: DirectoryEntry
>> currentDirectory doInlining: true
>> I wanted to use stdint.h C types. The file
>> IntegerArrayWordArray-stdint-VMMaker-jmv.006.cs.st includes changes to
>> VMMaker to generate the proper declarations.
>>
>> David, Eliot, do you think this is a sensible way to enable the use of
>> stdint.h? It would affect any uses of IntegerArray and WordArray. I
>> think we'd use stdint.h as much as possible. But I'm not certain if
>> these changes could break other things.
>>
>> Feedback is most welcome.
>>
>> Cheers,
>>
>> --
>> Juan Vuletich
>> www.cuis-smalltalk.org
>> https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
>> https://github.com/jvuletich
>> https://www.linkedin.com/in/juan-vuletich-75611b3
>> @JuanVuletich
>>
>> --
>> Cuis-dev mailing list
>> Cuis-dev at lists.cuis.st
>> https://lists.cuis.st/mailman/listinfo/cuis-dev
>


-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich



More information about the Cuis-dev mailing list