On Wed, 24 Nov 1999, Marc Lehmann <[EMAIL PROTECTED]> wrote:
> On Wed, Nov 24, 1999 at 12:13:56AM +0100, Raphael Quinet <[EMAIL PROTECTED]> wrote:
> > How to make these scripts undo-aware?  The problem is not really
> 
> I'd say the obvious way would be to make gimp_undo_push_group_start just
> "work", rather than adding another kludge no user will ever understand.

I agree, that would be the right way to do it.  However, after looking
for a while at undo.c, undo_cmds.c and related files, I thought that
I'd better refrain from fixing the undo groups because I might break
too many things while trying to fix that.  If a developer who is more
familiar with this code could help me a bit or add some documentation
to the undo code, then I will attempt to fix gimp_undo_push_group_start.

> If you must, name it something different, but adding multiple lines to a
> plug-in *just* to make it work together with other plug-ins seems a large
> step backwards.

I agree that it is not an elegant solution (I said so in my message)
but at least this is a solution that would work for 1.2, taking the
feature freeze into account.  I can re-modify the scripts later, when
a better undo system is included in version 1.3.  If necessary, these
"undo kludges" in the scripts can be marked with a comment saying that
future versions of the GIMP will use a nicer solution.

> I mean, the semantics of bracketing scripts with these calls is obvious, and
> does not include "is very slow". This is an implementation detail that should
> be optimized away.
> 
> If your solution can be implemented as two pdb calls (start and stop) then
> this would be fine.

I thought about this for a while, but I prefered to put the code
directly in the scripts because several scripts will use this method
in slightly different ways: some of them will only modify one layer,
some others will modify/add several layers, some others will modify
everything in the current image, and so on.  I prefer to let each
script do exactly what it wants to do, instead of copying the whole
image every time.

On the other hand, wrapping this into two PDB calls would indeed look
much cleaner (even if the internals are still ugly) and it would be
easier to implement this in a better way later.

So... errr...  I don't know what to do.  Does anybody have strong
preferences for one solution (several calls in each script) or the
other (two PDB calls hiding the gory details)?  Or a third one (fixing
gimp_undo_push_group_start)?

-Raphael

Reply via email to