[Gimp-developer] Size entry widgets could use some simple math (from Bug: 76616)

2008-01-27 Thread Fredrik Alstromer
As requested, I'm moving this discussion to the mailing list... for the 
history, see the bugzilla entry 76616.

Just to get a few things straight, I've stumbled on the fact the you 
can't do simple arithmetic expressions in any widget whatsoever (most 
prominently, boundary measurements), and I figured, since this bug had 
been open since 2002, there probably wasn't much going on, so just to 
get the pot stirring a little I hacked together a little recursive 
descent parser / evaluator.

I realize that, for one, i18n considerations must be taken into account, 
it's more or less prepared for this, although the hardcoded inch/mm 
relationship could be taken from Gimps unit system, so this is more or 
less a matter of cutting away code. However, more importantly, the 
numeric parsing must be fitting to the locale, so I'll fix that. I've 
also seen in the GtkSpinButton implementation that + and - signs are not 
universal, probably * and / too, that had to be corrected as well. 
Brackets too? Given the use case, the parser doesn't have to be 
extremely fast, so a dynamic comparison should be perfectly ok.

Furthermore, just to not throw everyone off again, the feature is 
regarding arithmetic. Not units. :) I see there's a close relationship, 
especially if you want to do conversions (e.g. 2mm + 4in). A little bit 
of dimension analysis won't hurt the user either. The discussion about 
units seems to be almost older than me (ok, not THAT old...) though, so 
I figured I'd go with what's there and not wait much longer, just do a 
little arithmetic.

Any thoughts?

Any pointers what to base a potential widget on is also greatly 
appreciated. I came down with gastroentritis last week, and it blossomed 
up a little bit yesterday too, so I haven't really gotten around to it yet.

Fredrik.
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


[Gimp-developer] New feature inquiry.

2004-07-11 Thread Fredrik Alstromer
Hi all!
I've had this idea going around my head for a while, and I was just 
going to ask if someone already had this idea (most probably), and if 
any work has been done or planned regarding this. I haven't been 
monitoring this list for very long, so this might be an old and already 
discarded idea. If that's the case, I apologize, and will withdraw to 
the rock from under which I came.. :)

The idea has been inspired by photoshop's effect layers, and the basic 
concept would be plugins that registers a new layer type. When sampled, 
the plugin is more or less simply executed, and the results are cached 
until any layer below the programmable layer has been modified. Layer 
modes and opacity are applied as if it was a normal layer, along with 
any layer mask.

Im not really familiar with the gimp source, and have mostly been doing 
script-fu stuff up until now. Perhaps this could be accomplished using a 
plugin? Or maybe it needs to be done in the core gimp source.

Does any one have any ideas or suggestions, as to why this might or 
might not work? Or possibly better solutions?

Thanks for your time.
--
Fredrik Alstromer.
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer