Laurent Sansonetti
lsans****@apple*****
Thu Jan 25 05:11:14 JST 2007
Hey guys (& Jacob), Short update of what I just added to the SVN: 1/ a important issue with Ruby methods returning structures has been fixed. This was a Libffi problem and the solution is to compile both RubyCocoa and Libffi with -O3. Using another optimization flag produces some weird behavior with Libffi closures meant to return C structures and the GCC generated ObjC code. 2/ I refactored the ocdata_conv routines to make it simpler and more extendable. 3/ I added support for pointer to boxed type arguments. Example: [NSView -knowsPageRange:(NSRange *)rangePtr] Can be implemented in Ruby: def knowsPageRange(range) # The range is passed by reference. range.location = 1 range.length = 1 true end 4/ The PathDemo example has now printing capabilities. To try it you just have to do File/Print, click Preview and you will see something. I didn't test with a real printer but it should work :) Just one more thing, the Cocoa printing system assumes that the graphic context object (CGContextRef) is released after the drawing, or RubyCocoa still retains it (the garbage collector didn't collect it yet). If the object is not released the generated PDF data is invalid. A solution is to manually release the object (which I did in PathDemo). Hopefully this is no longer necessary on systems > 10.4 (the Cocoa printing system has been improved to not rely on this anymore). Laurent