Re: Automatic paragraph direction and BiDirection layouts in Gtk+



Hi Behdad,

Thank you for your very clear write-up. It is as shame that this great 
summary was not available at the design stages of gtk+-2 as I think that 
a few mistakes may have been made that are not reversible.

I'm still not ready to answer the question of how far gtk+ currently is 
from the view that you describe, but here are a few comments from reading 
your message and peaking at the gtk+ source code:

* About "widget direction": gtk+ currently is employing a two layer scheme, 
called direction, and default direction. Both of these may take on the values 
LTR and RTL. The default direction is propagated, wheras the direction is not. 
This is not as good as what you proposed, but it may be good enough.

* Align: gtk+ here uses a floating point value where 0 indicates 
align according to widget direction (which is determined by the contents), 0.5 
means center, and 1.0 means align in direction opposite to the layout direction. 
Here is the translation table between your description and gtk+'s:

	Behdad                  Gtk-xalign
	------                  ----------
	align                   0
	align-opposite		1.0
	center			0.5
	inherit			n/a
	opposite		n/a
	left			n/a
	right			n/a

The problem with the current gtk+ API is that since it was the choice
of using a float instead of an enum, makes it very ugly to extend it and 
add the missing choices! The only way I see is to create floating point 
constants that are outside the 0.0-1.0 range.

* Regarding "paragraph direction" - couldn't this be overloaded with the 
"widget direction". I'm not sure if you intend this to be a paragraph property 
or a widget property. As a widget property it seems that "the default widget 
paragraph direction" and the "widget direction" are close enough to be 
overloaded. As individual paragraphs I wonder why you chose "strong" 
instead of "rtl" and "ltr"? In any case gtk+ currently does not define this,
and with the latest BiDi patch, the paragraph direction is always according
to the resolved direction of the contents.

I have a few ideas of what may be done, but I'd prefer to send this away
as soon as possible.

Thanks again for your great summary.

Regards,
Dov




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]