Re: A proposal for units in GTK+



Hi,

Havoc Pennington <hp redhat com> writes:

> I'm not sure how useful physical-screen units are; font-size-dependent
> units seem much more useful.  If you're on a large/small screen you
> will adjust the font, and the padding can just follow that.

ack, having physical units can be a major pain. We definitely need to
support them in The GIMP but there are various places where we don't
know the (monitor/image) resolution beforehand. If this happens, the
code always becomes complex and the user interface confusing. I expect
that similar situations would arise in GTK+.

> How does this relate to the units we end up using for a vector
> drawing API?
> 
> Users will doubtless want a "user-configurable unit" so they can go
> on anti-chubby campaigns.

perhaps you want to check how units are handled in The GIMP. We have a
working units subsystem that allows for user-definable units for quite
some time now. The code is a bit scattered around the source tree, so
here are a few pointers:

 libgimpbase/gimpunit.h     defines the basic GimpUnit API

 libgimp/gimpunit.c         plug-in side of GimpUnit implementation, a
                            wrapper around the PDB interface defined below

 libgimp/gimpunit_pdb.[ch]
 app/pdb/unit_cmds.c        communicate units between the core and plug-ins,
                            probably not of interest

 app/core/gimpunit.[ch]     core side of GimpUnit implementation

 app/core/gimpunits.[ch]    load and save the unitrc


Salut, Sven



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