From: Panayotis K. <pan...@pa...> - 2011-09-11 19:45:08
|
On 11 Σεπ 2011, at 10:38 μ.μ., Markus Heberling wrote: > I have removed the "extends NSObject" for the CG* stuff in this patch: http://xmlvm-reviews.appspot.com/155001/ > > The patch is not yet complete, but I'd like to have some feedback if that is the right direction before I continue. > > In CoreFoundation there exists a CFTypeRef type, which is something like the super type of all the CGImageRef,CGContextRef... stuff > > Would it make sense to create a new CFType java class, and have the CGImage... classes extend that? That would make the wrapping code easier, since the storage of the wrapped C-Reference could all be done in the CFType wrapping code. Additionally there are the C functions CFRelease and CFRetain which you can use with any XXXRef type instead of the more specific CGImageRelease, CGContextRelease functions. Currently it would be very hard to implement the generic functions, since all CGXXX classes store the wrapped C reference in different members. > > Does that make sense, or am I talking gibberish here? :D > > Markus From my part, I agree. Just the line Derived from CFType Reference is enough to convince me that this is the way to go. |