FFI / Primitive question

John M McIntosh johnmci at smalltalkconsulting.com
Mon Jun 11 05:48:09 UTC 2007


On Jun 10, 2007, at 10:35 PM, Joshua Gargus wrote:

> Hi John,
>
> Thanks for the pointers.  I had looked at the QuickTime code  
> before, and checking again I still can't see any cases where  
> primitives are invoked with an instance of an FFI type as an  
> argument (this was the topic of my original question).
>
> In fact, it seems like  
> #primitiveSetGWorldPtrOntoSurface:width:height:rowBytes:depth:movie: m 
> ight be intentionally avoiding passing a MacRect; it's sole sender  
> first extracts the height and width from a MacRect.  This isn't  
> surprising, since I now think that it's not such a bright idea to  
> try to mix FFI types with primitive invocations.

SophieImageReadWriter>>buildComponentAndDrawCGContextUsing:osType:

uses MacRect

We use Quicktime's image reader/writer logic to read arbitrary image  
data into Sophie and transform them into PNG data, or bitmaps via  
GCContexts (os-x) or QuickDraw surfaces (Window). Or I'm afraid under  
linux or deprived Windows machines we fallback to Squeak's limited  
set of graphics imports.

>
> You referred to "navigation services"... are you talking about the  
> Sophie-MacServices package?  If so, I'll take a close look at that  
> code.  The ServicesPlugin code isn't in SophieSource; should I be  
> looking in the squeakvm.org svn repository, or elsewhere?

ServicesPlugin is in SVN since it's not Sophe specific, more like mac  
specific. Mind I've not heard of anyone actually exploiting it.

You want to look at the class MacNavigationDialogServices, somehow I  
thought we broke that out into a different MC package, but I see it's  
in Sophie-FFI-Mac

>
> (BTW, I'm not particularly interested in MacRects, I just wanted to  
> base my example on a simple FFI type that already exists in the  
> image.  I don't plan to do much frobulating, either ;-)  )
>
> Thanks again,
> Josh

--
======================================================================== 
===
John M. McIntosh <johnmci at smalltalkconsulting.com>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
======================================================================== 
===





More information about the Squeak-dev mailing list