[java-gnome-hackers] Progress on 'cairo' branch
Brought to you by:
afcowie
|
From: Andrew C. <an...@op...> - 2007-12-09 12:55:27
|
Srichand, I spent the afternoon cleaning up the patches I had lying about on the 'cairo' branch and committing them. What I'd been working on when I last hacked on this was working out what internals would be necessary to make the Plumbing.proxyFor() equivalent work for the Cairo types. With Surface and now Pattern we've got concrete subtypes for each of the various cairo_surface_t and now cairo_pattern_t that you can have. The trick is that there's no g_type_name() equivalent to figure out the type for an arbitrary pointer, so we have to do a bit of switching Java side to figure out which of the base Cairo types it is, then hand off to the C side to do a switch over the various type constants to finally know which Class to actually instantiate. Luckily I think we know enough between generation (for the resultant Class constant being requested in entityFor()) at runtime (the various _get_type() functions to make the right calls. After doing all that for Pattern and being fairly satisfied with it, I attempted to start testing it only to not be able to find a Cairo function that returns a cairo_pattern_t that's not a constructor [If someone can suggest one, I'd be grateful] so I couldn't actually write a test to exercise this code. Grumble. Nevertheless, the real point of the work was to figure out the design pattern that would be used for getting Proxies for arbitrary pointers in the Cairo library, and I think that's more or less sorted. Let me know what you think as you poke away at whichever bit of Cairo interested you. AfC Bangalore |