Re: [java-gnome-hackers] Layout size related methods
Brought to you by:
afcowie
|
From: Andrew C. <an...@op...> - 2008-09-25 01:48:50
|
On Tue, 2008-09-16 at 11:46 -0400, Owen Taylor wrote:
> Without looking at your code, it's hard for me to say where you are
> getting confused. Some points that may be helpful.
I replied quickly to Owen thanking him for his input. Furthermore this
background info was fantastic and really helpful.
Before delving into the specifics, I just wanted to quickly write the
part that was implicit in the work that Vreixo and I have been doing,
but perhaps missing from this thread.
The path we've been following is the following:
* Drawing is done with Cairo (and indeed the only drawing API
we're interested in).
* While there is a "toy" font API in Cairo, real text rendering in
GNOME is done with Pango, of course (and so, again that's what
we have chosen to expose for when you need to write text when
doing manual drawing).
From there, someone made the observation that when you're busy drawing
away with Cairo in an Widget.ExposeEvent handler, it seemed *really*
awkward to have to keep switching from the doubles that you're working
in with Cairo the the huge fixed point ints that you have to feed Pango
functions.
So, it wasn't a huge leap for suggest that we normalize the Pango
methods to be in the same units as the rest of one's Cairo drawing. I
liked that idea very much, and it certainly made the test code I was
trying all this out with look *WAY* nicer. So, {shrug} away we went.
Owen wrote,
> How does this map to Java? It's partly a question about how much you are
> deviating from the Pango API. If you want to stick close...
So, really, it wasn't about sticking to the underlying API (which we
otherwise do rather rigorously modulo the stylistic things we have
adopted to make completion spaces better, type safety, etc) as it was
trying to make the overall drawing experience a bit more coherent.
I think I'll stop there; if people want to bitch they can, but that's
the direction we were heading. It seemed to make good sense. Meanwhile
I'm going to re-read what Owen wrote and see how that information
illuminates what we were doing.
People who are actually using java-gnome (and especially doing any
drawing) are welcome to chime in.
AfC
Sydney
|