[Vm-dev] Bigger cursors needed

Bert Freudenberg bert at freudenbergs.de
Tue Mar 20 17:48:10 UTC 2007


Hi Ian,

I implemented ioSetCursorARGB() on X11 using the XRender extension,  
see attachment. It's a stand-alone test program that uses  
ioSetCursorARGB() to show a nicely colored cursor. This is not hooked  
up to the new primitive yet - can you do this soonish or should I  
work on a more complete patch?

- Bert -

On Mar 4, 2007, at 16:54 , Bert Freudenberg wrote:

> On Mar 4, 2007, at 13:18 , Bert Freudenberg wrote:
>
>> On Mar 3, 2007, at 22:31 , John M McIntosh wrote:
>>
>>> 10.2 has a restriction of 16x16, but that is lifted in 10.3
>>> I'll need to convert to the new NSCursor model. so will do that  
>>> soon in  3.8.16 mac carbon vm.
>>>
>>> If you can point to a image that enables the large cursor  
>>> functionality so I can do testing that would be good.
>>
>> Well, I can't test it without a real implementation. But this  
>> should work if the primitive works:
>>
>> | form cursor |
>> form := Cursor normal asCursorForm as8BitColorForm.
>> form replaceColor: Color white with: (Color green alpha: 0.25).
>> form replaceColor: Color black with: (Color blue alpha: 0.5).
>> form := form asFormOfDepth: 32.
>> form := form magnify: (0 at 0 extent: 9 at 16) by: 3.
>> cursor := Cursor extent: form extent depth: 32.
>> form displayOn: cursor at: 0 at 0 rule: Form blend. "pre-multiply alpha"
>> form asMorph openInHand.
>> cursor show
>>
>> The cursor rendering should match the morph (provided your world  
>> is set to 32 bpp). In particular, the green border should not  
>> appear grayish, if it is, your system does not use pre-multiplied  
>> alpha. We can still change the spec if this is the case.
>
> Err, forgot the offset. Also, much more configurable. Special! Only  
> today! Choose your own source, scale, and colors! ;-)
>
> | source scale colors form cursor |
> source := Cursor read.
> scale := 3.
> colors := {Color blue alpha: 0.5. Color green alpha: 0.25}.
> form := source asCursorForm as8BitColorForm.
> form replaceColor: Color black with: colors first.
> form replaceColor: Color white with: colors second.
> form := form asFormOfDepth: 32.
> form := form magnify: (source innerPixelRectFor: 0 orNot: false)  
> by: scale.
> form asMorph openInHand.
> cursor := Cursor extent: form extent depth: 32.
> form displayOn: cursor at: 0 at 0 rule: Form blend. "pre-multiply alpha"
> cursor offset: (source offset - 0.5 * scale min: 0 at 0 max: cursor  
> extent negated) asIntegerPoint.
> cursor show
>
> For testing the offset, "Cursor crossHair" might work best.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ioSetCursorARGB.c
Type: application/octet-stream
Size: 2821 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20070320/a0cc45de/ioSetCursorARGB.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bigCursor-bf.1.cs
Type: application/octet-stream
Size: 3894 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20070320/a0cc45de/bigCursor-bf.1.obj
-------------- next part --------------




More information about the Vm-dev mailing list