... and a corresponding gimp_projectable_bounds_changed() function.
This signal can be emitted by implementers of GimpProjectable,
instead of the GimpProjectable::structure-changed signal, when the
projectable's bounds change, but its content does not -- i.e., the
old content simply gets cropped to the new bounds.
In pass-through mode, the group layer-stack's input is connected to
the backdrop. However, when rendering the group's projection, we
want to render the stack independently of the backdrop.
Unfortunately, we can't use the stack's graph as a subgraph of two
different graphs.
To work around that, the next few commits add a mechanism for a
projectable to be notified before and after its graph is being
rendered. We use this mechanism to disconnect the stack's graph
from the backdrop before rendering the projection, and reconnect
it afterwards. Yep, it's ugly, but it's better than having to
maintain n copies of (each node of) the graph (each nesting level
requires an extra copy.)
This commit adds {begin,end}_render() functions to GimpProjectable.
These functions should be called right before/after rendering the
projectable's graph.
which currently all end in a call to gimp_color_managed_get_color_profile()
except for channels and masks. This is currently unused infrastructure but
will be used for things like layer previews, and return NULL if called
on a mask or channel, or if color management is disabled, or whatever.
- don't include <gdk-pixbuf/gdk-pixbuf.h> in headers in app/
- instead, include it in many .c files instead of <glib-object.h>,
finally acknowledging the fact that app/ depends on gdk-pixbuf almost
globally
- fix up includes as if libgimpbase depended in GIO, which it soon will
Needed because a group layer's projection can have a different type
than its image, at least at some pathologic moment during image type
conversion. But even if it didn't, it's cleaner this way anyway.
* app/core/gimpprojectable.[ch]: add the new vfunc plus public API.
* app/core/gimpprojection.c: use it instead of using the type of the
image returned by gimp_projectable_get_image(). The get_image()
function is now unused in the projection and only needs to stay
because the projection is also a GimpPickable.
* app/core/gimpgrouplayer.c: implement GimpProjectable::get_image_type().
The only purpose of this change is to avoid having the "update"
signal twice on GimpGroupLayer (from GimpDrawable and from
GimpProjectable). Switch back to normal g_signal_connect()
in the projection.
Add GimpProjectable::get_offset() and gimp_projectable_get_offset()
which returns the offset of the projectable in image coordinates, so
we can have projections that act as a viewport onto things that live
in image coordinates.
2009-01-17 Michael Natterer <mitch@gimp.org>
* all files with a GPL header and all COPYING files:
Change licence to GPLv3 (and to LGPLv3 for libgimp).
Cleaned up some copyright headers and regenerated the parsers in
the ImageMap plugin.
svn path=/trunk/; revision=27913
2008-11-08 Michael Natterer <mitch@gimp.org>
Abstract the legacy projection code away into a virtual function
of GimpDrawable:
* app/core/gimpdrawable.[ch]: add new virtual function
GimpDrawable::project_region() which projects an area of a
drawable onto a passed in PixelRegion.
* app/core/Makefile.am
* app/core/gimpchannel-project.[ch]
* app/core/gimplayer-project.[ch]: new files which implement it.
* app/core/gimpchannel.c
* app/core/gimplayer.c: hook it in.
* app/core/gimpprojection-construct.c: get rid all the projection
code moved to above new files and project all drawables in one
loop.
* app/core/gimpprojectable.[ch]: remove the legacy methods
get_colormap() and get_components(), they are not needed any
longer.
* app/core/gimpimage.c: changed accordingly.
svn path=/trunk/; revision=27571
2008-11-05 Michael Natterer <mitch@gimp.org>
This should remove any image or viewable dependency from the
projection (apart from the projectable's get_image() method, but
that one is not supposed to return the projection's model but
rather the image the projection is part of).
* app/core/gimpprojectable.[ch]: add vfunc get_size() which
completes the API needed for GEGL projection.
Add vfuncs get_layers(), get_channels(), get_components() and
get_colormap() which are needed for the legacy projection code.
* app/core/gimpimage.c: implement the new methods.
* app/core/gimpprojection.c
* app/core/gimpprojection-construct.c: use them and remove all
calls to image and viewable API.
svn path=/trunk/; revision=27558
2008-11-05 Michael Natterer <mitch@gimp.org>
* app/core/gimpprojectable.[ch]: add signal "structure-changed"
and API to emit it.
* app/core/gimpimage.c: emit it when the image emits
"mode-changed" and "size-changed".
* app/core/gimpprojection.c: connect to the new signal instead of
"mode-changed" and "size-changed" to get rid of one more image
dependency.
svn path=/trunk/; revision=27556
2008-11-04 Michael Natterer <mitch@gimp.org>
* app/core/gimpprojectable.[ch]: add vitrual function
invalidate_preview().
* app/core/gimpimage.c: implement it and redirect to
gimp_viewable_invalidate_preview().
* app/core/gimpprojection.c: call the new API instead of
gimp_viewable_invalidate_preview(). Some cleanup in the disabled
cow-projection code.
svn path=/trunk/; revision=27553
2008-11-04 Michael Natterer <mitch@gimp.org>
Unfinished first step to make the projection independent of
GimpImage, also one step closer to layer grouping.
* app/core/Makefile.am
* app/core/core-types.h
* app/core/gimpprojectable.[ch]: add new interface which abstracts
something that can have a projection attached to it. Has "update"
and "flush" signals and get_graph() and get_image()
vfuncs. get_image() is temporary until the hack is finishes.
* app/core/gimpimage.[ch]: implement GimpProjectableInterface,
remove "update" and "flush" signals and made get_graph() a private
implementation of the interface method. Moved interface method
implementations after virtual function implementations.
* app/core/gimpprojection.[ch]: change member "image" to
"projectable" and use the projectable API as often as
possible. Still some implicit dependencies on the projectable
being an image left but it's getting close.
* app/core/gimpprojection-construct.c: same here.
svn path=/trunk/; revision=27552