On Mon, 15 May 2000, Garry R. Osgood wrote:

> pixel fairy wrote:
> 
> > 2000-05-12  Sven Neumann  <[EMAIL PROTECTED]>
> >         * gimpdrawable.c: enabled the (commented out)
> > signal
> >         "invalidate_preview".
> >
> > does this mean theres a way for a plug-in to know if
> > a certain drawable or image or whatever has changed?
> 
> No, Sven is referring to a GTK signal that GimpDrawables
> emit. Typical listeners may include Layer, Channels, and Path
> widgets that need to update previews of the layers
> they represent. This is internal to Gimp core logic and is
> not related to UNIX interprocess communication.
> 
> Havoc Pennington's "GTK/Gnome Application Development
> (1999 New Riders) discusses the signalling mechanism that
> GTK objects (like GimpDrawable) uses.
> 
> Be good, be well

<delurk>

Um, is there currently a nice, clean, preferrably non-periodic way of
determining (from a plug-in) if a drawable has changed? If not, are
there plans to add one? It would be very useful...

Like pixel fairy, I've written a plug-in which needs to learn when
the image it "owns" (the plug-in creates the image and its initial
content, then lets the user paint on top of it) has changed.
Currently, I do this by using a g_timeout_add() function, that
compares the pixels in the GIMP image, one-by-one, with an internal
copy held in the plug-in itself. I will probably need to keep this
comparison mechanics, but it would be great to trigger a comparison
not from a time-out, but from a proper signal callback from GIMP
itself...

Without having any deep understanding of the GIMP's internals, but a
rather hefty amount of GTK+ application development experience, it
feels like what I want is a signal on the image, letting the GIMP
notify my code when the image changes. Optimally, it should be
possible to control how often this signal gets emitted, and perhaps
the callback should even include information (x,y,width,height)
identifiying the region of the image that changed. Hm, considering
the tiled nature of GIMP's internal image storage model, perhaps it
would make sense to trigger the signal once for each changed tile?
That'd certainly be wonderful for my plug-in...

Just some thoughts... Further comments from actual GIMP developers on
this topic would be very interesting.

Oh, and please forgive me for being semi-secretive about the plug-in
mentioned above. It's part of a project I'm working on, and will be
released under the GPL, but before the entire project is closer to
its release, I prefer to keep a low profile. :)

/Emil

</delurk>

Reply via email to