2004-07-07 Michael Natterer <mitch@gimp.org>
Made the undo system robust against the currently pushed undo
being too large according to prefs settings. Fixes bug #145379.
* app/core/gimpimage-undo.[ch] (gimp_image_undo_push_undo)
(gimp_image_undo_group_end): emit "undo-event" *before* calling
gimp_image_undo_free_space() so the undo history doesn't try to
remove an item that has never been added.
(gimp_image_undo_push_undo): added boolean return value indicating
if the undo could be pushed (FALSE means the undo was to large
and was discarded right away).
(gimp_image_undo_push_item): return NULL if the above returned
FALSE.
* app/core/gimpimage-undo-push.c (gimp_image_undo_push_text_layer):
changed accordingly.
2004-04-01 Michael Natterer <mitch@gimp.org>
* app/core/core-enums.[ch] (enum GimpUndoType): added undo type
GIMP_UNDO_TEXT_LAYER_MODIFIED and undo group types
GIMP_UNDO_GROUP_DRAWABLE and GIMP_UNDO_GROUP_DRAWABLE_MOD.
* app/core/gimpimage-undo-push.[ch]: added new new function
gimp_image_undo_push_text_layer_modified() which makes
modifications of the text_layer's "modified" boolean undoable.
* app/core/gimpdrawable.[ch]: added new virtual function
GimpDrawable::push_undo() and moved the actual undo pushing into
the default implementation gimp_drawable_real_push_undo().
* app/text/gimptextlayer.c (gimp_text_layer_push_undo): new
function. Pushes the text_layer's modified state to the undo stack
after upchaining and sets modified to TRUE.
(gimp_text_layer_set_tiles): ditto.
(gimp_lext_layer_apply_region)
(gimp_text_layer_replace_region): removed because their default
implementations already call gimp_drawable_push_undo().
(gimp_text_layer_swap_pixels): removed because swap_pixels() is
used by undo only and doesn't need to care about the text_layer's
modified state.
(gimp_text_layer_render): don't set modified to FALSE here because
we can't push an undo step here.
(gimp_text_layer_set): push the modified state to the undo stack
and set it to FALSE here. Also push the layer's tiles if the
layer was modified.
* app/tools/gimptexttool.c (gimp_text_tool_apply): push "modified"
to the undo stack and set it to FALSE here, too.
Fixes bug #137767.
2004-03-28 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-undo-push.c (undo_pop_layer): when re-adding
a layer with mask, don't forget to set layer->mask->removed to FALSE.
2004-03-28 Michael Natterer <mitch@gimp.org>
* app/core/gimpitem.[ch]: added "gboolean removed" to the GimpItem
struct. Defaults to FALSE. Set it to TRUE in gimp_item_removed().
Added public function gimp_item_is_removed().
* app/core/gimpimage-undo-push.c (undo_pop_layer)
(undo_pop_layer_mask) (undo_pop_channel) (undo_pop_vectors):
set it to FALSE manually when re-adding something from the
undo stack.
* tools/pdbgen/app.pl
* tools/pdbgen/pdb.pl: don't allow any operation on items which
are removed from the image (and exist on the undo stack only).
Fixes bug #138311.
* app/pdb/channel_cmds.c
* app/pdb/color_cmds.c
* app/pdb/drawable_cmds.c
* app/pdb/edit_cmds.c
* app/pdb/floating_sel_cmds.c
* app/pdb/image_cmds.c
* app/pdb/layer_cmds.c
* app/pdb/paint_tools_cmds.c
* app/pdb/parasite_cmds.c
* app/pdb/selection_cmds.c
* app/pdb/selection_tools_cmds.c
* app/pdb/transform_tools_cmds.c: regenerated.
2004-03-21 Sven Neumann <sven@gimp.org>
* app/core/gimpundo.[ch]: added gimp_undo_type_to_name() a similar
function used to live in gimpimage-undo.[ch].
* app/core/gimpitemundo.c (gimp_item_undo_new): allow NULL as name
and generate it from the undo_type then.
* app/core/gimpimage-undo.[ch]: added gimp_image_undo_push_undu(),
new function that allows to push an undo on the image.
* app/text/Makefile.am
* app/text/text-types.h
* app/text/gimptextundo.[ch]: added GimpTextUndo, derived from
GimpItemUndo.
* app/core/gimpimage-undo-push.c (gimp_image_undo_push_text_layer):
use the new code and simply push a text undo here.
* app/tools/gimptexttool.c: compress text undos by peeking at the
undo stack. Fixes bug #137766.
2004-03-20 Sven Neumann <sven@gimp.org>
* app/tools/gimptexttool.c (gimp_text_tool_create_vectors): don't
take the image from tool->gdisp, this might be a NULL pointer.
* app/core/gimpimage-undo-push.c: removed debugging output.
2004-03-20 Sven Neumann <sven@gimp.org>
* app/widgets/gimppropwidgets.c (gimp_prop_size_entry_callback):
avoid to set the unit property with every size change; only set it
if it actually changed.
* app/core/gimpimage-undo-push.c (gimp_image_undo_push_text_layer):
allow to pass a GParamSpec that identifies a single text property
to be changed. In this case, don't store a GimpText object on the
undo stack but only the changed value.
* app/tools/gimptexttool.c: use the new undo feature to reduce the
memory footprint of text undo for the common case.
* app/text/gimptextlayer.c: changed accordingly.
2004-03-20 Sven Neumann <sven@gimp.org>
* app/core/gimpimage-undo-push.c (undo_pop_text_layer): don't
exchange the text_layer's text object but sync it with the text
object from the undo step.
* app/text/gimptextlayer.c (gimp_text_layer_set): in case the
layer has a mask, push an undo group around the text modifications.
* app/tools/gimptexttool.c (gimp_text_tool_idle_apply): push a
text layer undo before applying the text changes.
2004-03-15 Michael Natterer <mitch@gimp.org>
* app/core/core-enums.[ch] (enum GimpUndoType): replaced
GIMP_UNDO_LAYER_MOD and GIMP_UNDO_CHANNEL_MOD by
GIMP_UNDO_DRAWABLE_MOD.
* app/core/gimpimage-undo-push.[ch]: ditto: replaced
gimp_image_undo_push_layer_mod() and
gimp_image_undo_push_channel_mod() by
gimp_image_undo_push_drawable_mod().
* app/core/gimpdrawable.[ch]: added undo_desc strings for "resize"
and "scale" to the GimpDrawableClass struct.
(gimp_drawable_scale)
(gimp_drawable_resize): pass push_undo = TRUE to
gimp_drawable_set_tiles_full() and use the undo_desc from the
class.
(gimp_drawable_real_set_tiles): push a GIMP_UNDO_DRAWABLE_MOD here...
* app/core/gimpchannel.c
* app/core/gimplayer.c: ...and don't push undos in
GimpItem::scale(), GimpItem::resize(), GimpDrawable::set_tiles().
* app/core/gimpchannel.c: Removed even more bounds_known = FALSE
assignments from functions which already call
gimp_drawable_set_tiles().
2004-03-15 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.c (gimp_drawable_set_tiles_full): emit
"update" signals from the drawable before and after setting tiles
and offsets.
* app/core/gimpdrawable-offset.c (gimp_drawable_offset)
* app/core/gimpdrawable-transform.c (gimp_drawable_transform_paste)
* app/core/gimpimage-undo-push.c (undo_pop_layer_mod, _channel_mod)
* app/text/gimptextlayer.c (gimp_text_layer_render)
* app/tools/gimptransformtool.c (gimp_transform_tool_doit):
removed calls to gimp_drawable_update().
* app/core/gimpdrawable-offset.c (gimp_drawable_offset): don't
push an undo step before calling gimp_drawable_set_tiles()
but simply pass push_undo == TRUE and the undo_desc.
2004-03-15 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.[ch]: added "offset_x" and "offset_y"
parameters to GimpDrawable::set_tiles().
(gimp_drawable_set_tiles): removed the "GimpImageType" parameter.
(gimp_drawable_set_tiles_full): new function adding type, offset_x
and offset_y parameters.
(gimp_drawable_real_set_tiles): set the drawable's offsets from
the offset parameters and its size from the passed TileManager's
size. Emit "size_changed" accordingly.
* app/core/gimpchannel.c
* app/core/gimpdrawable-offset.c
* app/core/gimpdrawable-transform.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-undo-push.c
* app/core/gimplayer.c
* app/text/gimptextlayer.c
* app/tools/gimptransformtool.c: changed accordingly: removed
calls to gimp_viewable_size_changed() and all sorts of hackish
assignments of the drawable's width/height/offset_x/offset_y
properties.
2004-03-15 Michael Natterer <mitch@gimp.org>
* app/text/gimptextlayer.c (gimp_text_layer_render): don't call
gimp_image_flush().
* app/tools/gimpxttool.c (gimp_text_tool_apply): call it here
instead.
Now that we have a common place that exchanges drawable->tiles,
we can abstract away boundary invalidation for this operation:
* app/core/gimpdrawable.c (gimp_drawable_real_set_tiles):
call gimp_drawable_invalidate_boundary() before setting
the new tiles.
* app/core/gimpchannel.c (gimp_channel_set_tiles)
* app/core/gimpdrawable-transform.c (gimp_drawable_transform_paste)
* app/core/gimpimage-undo-push.c (undo_pop_layer_mod)
* app/core/gimplayer.c (gimp_layer_scale) (gimp_layer_resize)
(gimp_layer_flip) (gimp_layer_rotate) (gimp_layer_transform)
* app/text/gimptextlayer.c (gimp_text_layer_render): removed
calls to gimp_drawable_invalidate_boundary() from all functions
which finally call gimp_drawable_real_set_tiles().
* app/tools/gimptransformtool.c (gimp_transform_tool_doit): no
need to set channel->bounds_known to FALSE, because
gimp_drawable_set_tiles() already did this.
2004-03-15 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.[ch]: added "gboolean alpha_changed" to
GimpImageFlushAccumulator. Install an "alpha_changed" handler
on gimage->layers and set flush_accum.alpha_changed = TRUE
whenever the image's *only* layer changed its alpha.
* app/core/gimpimage-undo-push.c (undo_pop_layer_mod)
* app/core/gimplayer.c (gimp_layer_add_alpha): removed
explicit calls to gimp_image_alpha_changed().
2004-03-15 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.c (gimp_drawable_real_set_tiles): emit
"alpha_changed" if the drawable got/lost an alpha channel by
setting the new tiles.
* app/core/gimpimage-undo-push.c (undo_pop_layer_mod)
* app/core/gimplayer.c (gimp_layer_add_alpha): removed explicit
calls to gimp_drawable_alpha_changed().
2004-03-15 Michael Natterer <mitch@gimp.org>
Closer to text layer undo:
* app/core/gimpchannel.c (gimp_channel_set_tiles): invalidate the
channel's boundary and bounds.
* app/text/gimptextlayer.c: implement GimpDrawable::swap_pixels()
and set text_layer->modified = TRUE after upchaining.
(gimp_text_layer_render): use gimp_drawable_set_tiles() and
set text_layer->modified = FALSE afterwards.
* app/core/gimpimage-undo-push.c: cleaned up variable declarations
and initializations.
(undo_pop_layer_mod)
(undo_pop_channel_mod): use gimp_channel_set_tiles() instead of
touching drawable->tiles manually. Now all pixel manipulation
(at least on layers) should be virtualized and can be detected by
the text layer.
2004-03-15 Michael Natterer <mitch@gimp.org>
Prepare the undo system for proper text layer undo:
* app/core/core-enums.[ch] (enum GimpUndoType): replaced
GIMP_UNDO_IMAGE and GIMP_UNDO_IMAGE_MOD by GIMP_UNDO_DRAWABLE.
* app/core/gimpimage-undo-push.[ch]: ditto: replaced
gimp_image_undo_push_image() and gimp_image_undo_push_image_mod()
by gimp_image_undo_push_drawable() which *always* expects to get a
TileManager passed. Also added g_return_if_fail()s to check if the
passed in tile manager follows the semantics of the "sparse"
boolean.
(undo_pop_drawable): removed all code and call the new
gimp_drawable_swap_pixels() instead (see below).
* app/core/gimpdrawable.[ch] (gimp_drawable_push_undo): if tiles
are NULL, create a copy of the area here and always pass tiles to
gimp_image_undo_push_drawable(). Added lots of g_return_if_fail()
here too.
Added new vitrual function GimpDrawable::swap_pixels() which
does what undo_pop_drawable() did.
* app/core/gimpchannel.c: implement swap_pixels() and invalidate
the channel's bounds and boundary.
2004-02-18 Sven Neumann <sven@gimp.org>
* tile-cache.c
* tile-private.h
* tile.[ch]: removed trailing whitespace, added some newlines,
let tile_is_valid() return a gboolean instead of a gint.
* app/core/gimpimage-projection.c
* app/core/gimpimage-undo-push.c
* app/paint/gimppaintcore.c
* app/tools/gimpinktool.c: use the return value from tile_is_valid()
as a boolean.
2004-02-14 Michael Natterer <mitch@gimp.org>
Fixed lots of QuickMask brokenness by letting the image adjust
its qmask_state automatically:
* app/core/gimpimage-qmask.h: #define GIMP_IMAGE_QMASK_NAME "Qmask".
Use the define in all files below.
* app/core/gimpimage.[ch]: split gimp_image_drawable_add,_remove()
into separate handlers for layers and channels. Added a
"name_changed" handler for all channels. In the channel "add",
"remove" and "name_changed" handlers, check if it was a channel
named "Qmask" that was added, removed or renamed and call
gimp_image_set_qmask_state() accordingly.
* app/core/core-enums.[ch]
* app/core/gimpimage-undo-push.[ch]
* app/core/gimpundo.c: removed all Qmask undo code because the image
does the right thing without undo interaction now.
* app/core/gimpimage-qmask.c (gimp_image_set_qmask_state): set
gimage->qmask_state early so we can return early when called
recursively. Removed calls to gimp_image_undo_push_image_qmask().
Returned "removed" callback (it was utterly broken the way it was
implemented).
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_qmask_toggled): check if the image's
qmask state needs to be changed before changing it.
* app/xcf/xcf-load.c (xcf_load_channel): removed code which
recognized the qmask. GimpImage does this automatically now.
* app/gui/qmask-commands.c: cleanup.
* app/widgets/gimpimagedock.c (gimp_image_dock_constructor):
destroy the "/Select/By Color" and "/Select/Toggle QuickMask" menu
items.
* app/widgets/image-menu.c (image_menu_update): changed accordingly.
2004-02-12 Michael Natterer <mitch@gimp.org>
Make sure that non-indexed images never have a colormap.
Fixes bug #121033.
* app/core/gimpimage-colormap.c (gimp_image_set_colormap): set
image->cmap to NULL when called with a NULL colormap.
* app/core/gimpimage-undo-push.c: made colormap undo/redo aware
of NULL colormaps.
* app/core/gimpimage-convert.c (gimp_image_convert): remove the
colormap using gimp_image_set_colormap() instead of freeing it
manually.
* app/widgets/gimpcolormapeditor.c: always check if the image
is INDEXED *and* has a colormap before accessing the colormap.
(need this new check because the fixed behaviour of colormap undo
produces undo groups which, when being popped, make the image have
no colormap while still being INDEXED in the small time frame
between the emission of "colormap_changed" and "mode_changed").
2004-01-26 Michael Natterer <mitch@gimp.org>
* plug-ins/script-fu/scripts/unsharp-mask.scm: add the layer to
the image before pasting to it. Fixes bug #132504.
Fixed the underlying problem: make it impossible to attach
floating selections to drawables which are not currently part of
the image's layer or channel stacks.
Also cleaned up image <-> floating_sel interaction:
* app/core/gimplayer-floating-sel.[ch] (floating_sel_attach):
added assertion that the drawable is part of the image (see below).
Don't call gimp_image_floating_selection_changed(), it's emitted
by gimp_image_add_layer() now.
(floating_sel_remove)
(floating_sel_anchor): don't emit "floating_selection_changed",
it's emitted by gimp_image_remove_layer() now.
(floating_sel_anchor): removed the fix for bug #132162 because
gimp_image_remove_layer() behaves correctly now (see below).
Renamed floating_sel_reset() to floating_sel_activate_drawable().
Added g_return_if_fail() all over the place.
* app/core/gimpimage.[ch]: added new function gimp_image_owns_item()
which return TRUE if the passed item is part of the image.
(gimp_image_add_layer): emit "floating_selection_changed" here if
needed.
(gimp_image_remove_layer): emit "floating_selection_changed" if
needed, don't try to activate a layer if we called
floating_sel_activate_drawable().
This is the real fix for bug #132162.
* app/core/gimpimage-undo-push.c (undo_pop_layer): apply the same
fixes as to gimp_image_add,remove_layer(). Don't call
gimp_drawable_invalidate_preview() on the previously active layer
because that's done by gimp_image_set_active_layer() now.
* app/xcf/xcf-load.c: remember the "floating_sel_drawable" in the
XcfInfo struct and attach it *after* all layers and channels are
loaded to avoid attaching the floating selection to an
out-of-image drawable.
* app/core/gimp-edit.c (gimp_edit_paste)
* app/core/gimpdrawable-transform.c (gimp_drawable_transform_affine,
gimp_drawable_transform_flip, gimp_drawable_transform_rotate)
* app/core/gimpselection.c (gimp_selection_float)
* app/text/gimptext-compat.c (text_render): added checks for
gimp_image_owns_item() in all functions which can produce
floating selections.
* tools/pdbgen/pdb/edit.pdb
* tools/pdbgen/pdb/floating_sel.pdb
* tools/pdbgen/pdb/selection.pdb
* tools/pdbgen/pdb/text_tool.pdb
* tools/pdbgen/pdb/transform_tools.pdb: added checks for
gimp_item_owns_image() and return an execution error if invoked
with a drawable which is not part of the image.
* app/pdb/edit_cmds.c
* app/pdb/floating_sel_cmds.c
* app/pdb/selection_cmds.c
* app/pdb/text_tool_cmds.c
* app/pdb/transform_tools_cmds.c: regenerated.
2004-01-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_set_active_layer): don't allow
to select anything but the floating selection. Fixes bug #128025.
(gimp_image_set_active_layer,channel,vectors): allow to pass NULL
to unselect the active item. Removed the silly feature that
passing some random item of another image would select the first
item in the list (was unused anyway).
(gimp_image_unset_active_channel): use gimp_image_set_active_channel()
now that it accepts NULL.
(gimp_image_add_layer,channel,vectors): cleaned up / simplified.
(gimp_image_remove_layer,channel,vectors): cleanup,
simplification, use gimp_image_set_active_layer,channel,vectors()
now that they accept NULL, make sure the item next to the removed
item becomes the active one (and not the first in the list, which
was a severe usability problem in the dialogs).
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): pass
NULL to the set_active functions, cleanup.
* app/core/gimpimage-duplicate.c: attach the floating selection
before setting the active layer. Code relied on broken
gimp_image_set_active_layer() behaviour before.
* app/core/gimplayer-floating-sel.c: no need to set
gimage->floating_sel before calling gimp_image_add_layer(). The
weird GUI mentioned in the comment existed in 1.2 only.
* app/display/gimpdisplayshell-layer-select.c (layer_select_advance):
don't assume that setting the active_layer always succeeds.
* tools/pdbgen/pdb/image.pdb: behave as the documentation says
and return an execution error if setting the active layer or
channel failed.
Unrelated:
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: removed leftover cruft from the old
guchar based color API.
* tools/pdbgen/pdb/channel.pdb: simplified code which handles the
channel's color.
* app/pdb/channel_cmds.c
* app/pdb/image_cmds.c: regenerated.
2004-01-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-undo-push.c (undo_pop_layer): removed broken
code which tried to figure manually whether "alpha_changed" should
be emitted. Instead, simply compare the return values of
gimp_image_has_alpha() before and after adding/removing the
layer. Fixes bug #131721.
2004-01-05 Sven Neumann <sven@gimp.org>
* app/core/core-enums.[ch]: added GIMP_UNDO_TEXT_LAYER to
GimpUndoType enum.
* app/core/gimpimage-undo-push.[ch]: added new undo function
gimp_image_undo_push_text_layer().
* app/text/gimptextlayer.[ch]: renamed gimp_text_layer_render() to
gimp_layer_text_layer_flush().
Added new function gimp_text_layer_discard().
* app/text/gimptextlayer-transform.c: changed accordingly.
* app/gui/image-menu.c
* app/gui/layers-commands.[ch]
* app/gui/layers-menu.c: added menu entries that allow to discard
the text information of a text layer (bug #118547).
* app/widgets/gimppreviewrendererlayer.c
(gimp_preview_renderer_layer_render): treat text layers without a
text object like ordinary layers.
* app/widgets/gimppreviewrenderer-utils.c: include gimplayer.h
instead of gimptextlayer.h.
2003-12-04 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-projection.c (gimp_image_projection_allocate):
optimized to reallocate the projection TileManager only if it does
not match the required width, height and depth.
* app/core/gimpimage.c (gimp_image_size_changed): call
gimp_image_projection_allocate().
* app/core/gimpimage-crop.c
* app/core/gimpimage-resize.c
* app/core/gimpimage-rotate.c
* app/core/gimpimage-scale.c
* app/core/gimpimage-undo-push.c: removed calls to
gimp_image_projection_allocate(), since "size_changed" does it
automatically now.
2003-12-01 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c: added a default implementation of
GimpImage::mode_changed() which reallocates the projection.
* app/core/gimpimage-convert.c (gimp_image_convert)
* app/core/gimpimage-undo-push.c (undo_pop_image_type): removed
explicit calls to gimp_image_projection_allocate().
2003-11-13 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-undo-push.c (undo_pop_layer): when trying to
activate the previously selected layer after a layer removal, also
look at gimage->layer_stack, just as gimp_image_remove_layer()
does. Should fix regression from 1.2 when there was no avtive
layer after certain undo operations. Fixes bug #126781.
Reordered instructions to match gimp_image_remove_layer().
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcolorizetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: although the crash triggering bug
is fixed, the image_map tools should not crash when invoked
without active drawable: changed all _initialize() functions to
silently return if there is no active drawable.
Changed "drawable" to "layer" in all user visible warnings about
indexed or non-RGB drawables. Cleanup.
2003-10-14 Sven Neumann <sven@gimp.org>
* app/config/gimpconfig-utils.[ch]: removed
gimp_config_copy_properties() and added the more intelligent
gimp_config_sync() instead.
* app/config/Makefile.am
* app/config/config-types.h
* app/config/gimpcoreconfig.[ch]
* app/config/gimprc-blurbs.h: replaced default image properties
with a single GimpTemplate object property. Changed the
set_property function to not replace aggregate objects but call
gimp_config_sync() instead.
* app/tools/gimptextoptions.c (gimp_text_options_set_property):
same change here.
* app/config/gimpconfig.[ch]: changed return value of
gimp_config_duplicate() to gpointer to avoid some casts that only
made the code harder to read.
* app/widgets/gimptemplateeditor.[ch]: don't keep an internal copy
here but edit the GimpTemplate passed when the editor was
constructed.
* app/gui/preferences-dialog.c: use a GimpTemplateEditor to allow
editing of the default image paramaters.
* app/config/gimprc.c
* app/core/core-types.h
* app/core/gimp.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-grid.c
* app/core/gimpimage-new.c
* app/core/gimpimage-undo-push.c
* app/core/gimpimage.c
* app/core/gimptemplate.[ch]
* app/gui/file-new-dialog.c
* app/gui/grid-dialog.c
* app/gui/info-window.c
* app/gui/resize-dialog.c
* app/gui/templates-commands.[ch]
* app/gui/tool-options-commands.c
* app/text/gimptextlayer.c
* app/text/gimptextlayer.c
* app/tools/gimptexttool.c
* app/widgets/gimptemplateview.c
* app/xcf/xcf-load.c: changed accordingly.
2003-10-14 Sven Neumann <sven@gimp.org>
* app/widgets/gimpgrideditor.[ch]: removed "grid_changed" signal.
The user of GimpGridEditor can connect to notifications of the
grid that is being edited. There is no need for a proxy signal.
* app/core/gimpimage-grid.c (gimp_image_set_grid): don't exchange
the image's grid object, it is part of the image. Copy all grid
properties instead.
* app/core/gimpimage-undo-push.c
* app/gui/grid-dialog.c: changed accordingly.
2003-10-06 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.[ch]: added new virtual functions
GimpDrawable::get_active_components(), apply_region() and
replace_region().
* app/core/Makefile.am
* app/core/gimpdrawable-combine.[ch]: new files containing
apply_region()'s and replace_region()'s default implementation.
They are identical to the ones removed from GimpImage except that
they don't mask the selection with itself (bug #107949).
* app/core/gimpchannel.c
* app/core/gimplayer.c: implement get_active_components().
* app/core/gimpchannel.c: implement apply_region() and
replace_region() and invalidate the channel's boundary
before upchaining (bug #107949).
* app/core/gimpimage.[ch]: removed gimp_image_apply_image(),
gimp_image_replace_image() and gimp_image_get_active_components().
* app/core/gimpimage-undo-push.c (undo_pop_image): invalidate
boundary and bounds if the drawable is a channel (bug #107949).
(undo_pop_mask)
(undo_pop_channel_mod): finish previous commit :)
* app/core/gimp-edit.c
* app/core/gimpdrawable-blend.c
* app/core/gimpdrawable-bucket-fill.c
* app/core/gimpdrawable-stroke.c
* app/core/gimpimagemap.c
* app/core/gimplayer-floating-sel.c
* app/paint/gimppaintcore.c
* app/tools/gimpinktool.c: changed accordingly.
2003-10-06 Michael Natterer <mitch@gimp.org>
Treat changes to the selection like changes to any other drawable:
* app/core/gimpchannel.c
* app/core/gimpchannel-combine.c: call gimp_drawable_update() after
changing the channel.
* app/core/gimpimage.[ch]: added struct GimpImageFlushAccumulator
with one member "gboolean mask_changed". Connect to "update" of
the selection and set accum.mask_changed to TRUE in the callback.
Added default implementation for GimpImage::flush() and emit
"mask_changed" there.
Unrelated:
* app/core/gimpimage.h: removed GimpGuide struct...
* app/core/gimpimage-guides.h: ...and added it here.
* app/core/gimpimage-undo-push.c (undo_pop_mask)
(undo_pop_channel_mod): don't distinguish between selection and
non-selection channels and just call gimp_drawable_update().
* app/core/gimpundo.h
* app/core/gimpimage-undo.c: removed "gboolean mask_changed" from
the GimpUndoAccumulator struct since we don't have to care about
that signal explicitly any more.
* app/display/gimpdisplay-foreach.[ch]: removed gimp_displays_flush().
* tools/pdbgen/pdb/display.pdb (displays_flush_invoker): call
gimp_image_flush() on all images so the flush accumulator is
honored.
This generalization enables the removal of more special purpose
code which was needed to treat the selection different:
* app/core/gimpimage-mask-select.[ch]: removed...
* app/core/gimpchannel-select.[ch]: ...and added under a new name
because it's not selection specific any more.
* app/core/gimpimage-mask.[ch]: removed...
* app/core/gimpselection.[ch]: ...added the two remaining
functions here. Removed all calls to gimp_image_mask_changed().
* app/core/Makefile.am
* app/core/gimp-edit.c
* app/core/gimpdrawable-transform.c
* app/core/gimpimage-scale.c
* app/core/gimpimage-snap.c
* app/display/gimpdisplayshell.c
* app/gui/channels-commands.c
* app/gui/layers-commands.c
* app/gui/select-commands.c
* app/gui/vectors-commands.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpellipseselecttool.c
* app/tools/gimpfreeselecttool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimpiscissorstool.c
* app/tools/gimprectselecttool.c
* app/tools/gimptransformtool.c
* app/widgets/gimpchanneltreeview.c
* app/widgets/gimpselectioneditor.c
* app/widgets/gimpvectorstreeview.c
* app/xcf/xcf-save.c
* tools/pdbgen/pdb/paths.pdb
* tools/pdbgen/pdb/selection.pdb
* tools/pdbgen/pdb/selection_tools.pdb: changed accordingly.
* app/core/gimpdrawable-bucket-fill.c
* app/core/gimpimage-colormap.c
* app/core/gimplayer-floating-sel.c
* app/core/gimplayer.c
* app/gui/image-menu.c
* app/paint/gimppaintcore.c
* app/tools/gimpcroptool.c
* app/tools/gimpinkoptions.c
* app/tools/gimpvectortool.c: removed useless and/or obsolete
#includes.
* app/pdb/display_cmds.c
* app/pdb/paths_cmds.c
* app/pdb/selection_cmds.c
* app/pdb/selection_tools_cmds.c: regenerated.
2003-09-06 Michael Natterer <mitch@gimp.org>
To optimize duplicate and/or wrong image updates away, introduced
new policy that a child object must never explicitly update or
invalidate its parent object (just like the GUI is not updated
explicitly by the core):
* app/core/gimpdrawable.[ch]: added new signal
GimpDrawable::update(). Never update or invalidate the image when
the drawable is updated or invalidated.
(gimp_drawable_set_visible): don't gimp_drawable_update() the
drawable since its pixels have not changed.
* app/core/gimpimage.[ch]: connect to the "add" and "remove"
signals of the layers and channels containers. Also connect to the
"update" and "visibility_changed" signals of all drawables in
these containers (optimizes away updates issued by drawables which
are not yet added to the image and updates of the selection
mask). Also, don't propagate updates to the image if the emitting
drawable is invisible (optimizes away updates issued by invisible
drawables).
(gimp_image_add_layer,channel)
(gimp_image_remove_layer,channel): don't update the image since
that's done by our "add" and "remove" handlers now.
(gimp_image_position_layer,channel): update just the image, not
the drawable since its pixels have not changed.
(gimp_image_real_colormap_changed)
(gimp_image_set_component_visible): always call
gimp_image_update() *and* gimp_viewable_invalidate_preview() to
get everything updated, since update and invalidate of images are
not connected.
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): don't
update the drawable since (a) its pixels don't change and (b) the
image updates itself upon adding/removing now.
(undo_pop_layer_mod): replaced gimp_image_update() by
gimp_drawable_update() (just for consistency with other similar
functions).
* app/core/gimplayer.c: connect to "update" of the layer mask and
issue updates on the layer if the mask update has any effect on
the projection.
(gimp_layer_create_mask): don't set the mask's offsets here since
they may be different when we later add the mask to the layer.
* app/core/gimplayermask.c (gimp_layer_mask_set_layer): set the
mask offsets here instead.
* app/core/gimpchannel.c (gimp_channel_translate): update the
channel even if push_undo == FALSE.
* app/paint/gimppaintcore.c (gimp_paint_core_finish)
* app/tools/gimpinktool.c (ink_finish): invalidate both the
drawable and the image preview since invalidating the drawable
doesn't invalidate the image any more.
* app/text/gimptextlayer.c (gimp_text_layer_render_now): also
update the new extents of the text layer, not only the old one.
(gimp_text_layer_render_layout): don't update the drawable since
gimp_drawable_fill() already updated it.
2003-09-04 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.[ch]: added new pure virtual function
GimpDrawable::invalidate_boundary().
* app/core/gimplayer.[ch]: implement it and removed public
function gimp_layer_invalidate_boundary().
* app/core/gimpchannel.[ch]: implement it.
* app/core/gimpselection.[ch]: implement it and removed public
function gimp_selection_invalidate().
* app/core/gimpimage-mask.c (gimp_image_mask_invalidate)
* app/core/gimpimage-undo-push.c
* app/core/gimpimage.c
* app/core/gimplayer-floating-sel.c
* app/text/gimptextlayer.c: changed accordingly.
* app/core/gimpchannel.[ch]: made gimp_channel_push_undo() a
public function and made it call
gimp_drawable_invalidate_boundary(). Added undo_desc strings for
all undo pushing functions to GimpChannelClass.
* app/core/gimpselection.[ch]: removed gimp_selection_push_undo()
since after the change above it was identical to
gimp_channel_push_undo(). Don't push any undo here since
upchaining does the right thing now. Override GimpChannelClass'
undo_desc strings to say "Selection".
* app/core/gimpimage-mask.c (gimp_image_mask_push_undo): changed
accordingly.
2003-08-31 Manish Singh <yosh@gimp.org>
* app/core/gimpimage-undo-push.c (undo_pop_layer): gsize is unsigned,
reflect that in the g_prints.
* tools/pdbgen/pdb/color.pdb: case to GIMP_BASE_CONFIG for the call
to gimp_histogram_new, #include "core/gimpdrawable-histogram.h"
* app/pdb/color_cmds.c: regenerated.
2003-08-25 Michael Natterer <mitch@gimp.org>
* app/core/gimpobject.[ch]: changed GimpObject::get_memsize() to
return a second value named "gui_size", where the primary return
value is the "constant" actual size (as long as no operation is
performed on the object), and the second "gui_size" return value
is the size of temporary stuff like preview caches or boundary
segments (which may change asynchronously, even if the object is
on the undo stack).
* app/core/gimp.c
* app/core/gimpbrush.c
* app/core/gimpbrushpipe.c
* app/core/gimpbuffer.c
* app/core/gimpchannel.c
* app/core/gimpcontainer.c
* app/core/gimpcontext.c
* app/core/gimpdata.c
* app/core/gimpdatafactory.c
* app/core/gimpdrawable.c
* app/core/gimpgradient.c
* app/core/gimpimage-undo.c
* app/core/gimpimage.c
* app/core/gimpitem.c
* app/core/gimplayer.c
* app/core/gimplist.c
* app/core/gimppalette.c
* app/core/gimpparasitelist.c
* app/core/gimppattern.c
* app/core/gimpundo.c
* app/core/gimpundostack.c
* app/core/gimpviewable.c
* app/text/gimptextlayer.c
* app/vectors/gimpstroke.c
* app/vectors/gimpvectors.c: changed get_memsize() implementations
accordingly.
* app/display/gimpdisplayshell-title.c
* app/gui/debug-commands.c
* app/widgets/gimppreview.c: changed callers accordingly.
* app/core/gimpimage-undo-push.c: changed layer, channel, vectors
and layer_mask undo steps to add/subtract the size of the
resp. objects whenever they take/drop ownership of them. Ignore
the objects' "gui_size" to get identical sizes on
adding/subtracting. Fixes bug #120429.
2003-07-25 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-undo-push.c (gimp_image_remove_layer)
* app/core/gimpimage.c (undo_pop_layer)
* app/text/gimptextlayer.c (gimp_text_layer_render):
gimp_layer_invalidate_boundary() must be called whenever a layer
gets translated, resized or removed. Fixes stale layer outlines in
the canvas padding area.
2003-07-04 Henrik Brix Andersen <brix@gimp.org>
Added persistent storage of image grid in XCF files.
* app/core/gimpimage.[ch]: removed gimp_image_get_grid() and
gimp_image_set_grid() ...
* app/core/Makefile.am
* app/core/gimpimage-grid.[ch]: ... and added them to these new
files. Added gimp_grid_parasite_name(), gimp_grid_to_parasite()
and gimp_grid_from_parasite() functions.
* app/core/gimpimage-snap.c
* app/gui/grid-dialog.c: #include "gimpimage-grid.h"
* app/core/gimpimage-undo-push.c: #include "gimpimage-grid.h".
(gimp_image_undo_push_image_grid) mark image as dirty.
* app/xcf/xcf-save.c (xcf_save_image_props): save GimpGrid object
as a parasite.
* app/xcf/xcf-load.c (xcf_load_image): load GimpGrid from
parasite.
* devel-docs/parasites.txt: documented the new "gimp-image-grid"
parasite.
2003-06-24 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-undo-push.c (undo_pop_image_grid)
* app/core/gimpimage.c (gimp_image_set_grid): ref/unref the grid.
* app/gui/view-commands.c (view_configure_grid_cmd_callback): set
the dialog transient for the shell, make shell->grid_dialog a
weak pointer of the grid dialog.
* app/gui/grid-dialog.c: don't set shell->grid_dialog to NULL
here, attach the grid using g_object_set_data_full() and don't
unref it explicitely. Use gimp_config_is_equal_to() instead of
gimp_config_diff().
* app/core/gimpgrid.[ch]: derive GimpGrid from GimpObject (not
GObject) allowing us to use gimp_object_get_memsize(). Added
missing copyright notice.
* app/core/gimpimage.c: only call gimp_object_get_memsize() if
gimage->grid != NULL.
* app/gui/grid-dialog.c: added mnemonics, set shell->grid_dialog
to NULL when destroyed.
* app/gui/view-commands.c (view_configure_grid_cmd_callback):
added call to gtk_window_present().
This fixes bug #65198
* app/core/Makefile.am
* app/core/core-types.h:
* app/core/gimpgrid.[ch]: added new class GimpGrid.
* app/core/core-enums.[ch]: added new enum GimpGridType.
* app/core/gimpimage-guides.[ch]: removed the gimp_image_snap_*()
functions...
* app/core/gimpimage-snap.[ch]: ...and added them here since they
are no longer guide specific.
* app/core/gimpimage-undo-push.[ch]: added
gimp_image_undo_push_image_grid()
* app/display/gimpdisplayshell-handlers.c:
* app/core/gimpimage.[ch]: added grid member to _GimpImage. Added
new signal "grid_changed", added gimp_image_grid_changed(),
gimp_image_get_grid() and gimp_image_set_grid().
* app/display/gimpdisplayshell-appearance.[ch]: added
gimp_display_shell_set_show_grid(),
gimp_display_shell_get_show_grid(),
gimp_display_shell_set_snap_to_grid() and
gimp_display_shell_get_snap_to_grid().
* app/display/gimpdisplayshell-callbacks.c: added call to
gimp_display_shell_draw_grid()
* app/display/gimpdisplayshell.[ch]: added grid member to
_GimpDisplayShellVisibility, added snap_to_grid and grid_dialog
members to _GimpDisplayShell, added
gimp_display_shell_draw_grid(), modified
gimp_display_shell_snap_coords() to use the new
gimp_image_snap_*() functions.
* app/gui/image-menu.c: added grid entries to
image_menu_entries[].
* app/gui/view-commands.[ch]: added
view_configure_grid_cmd_callback(),
view_toggle_grid_cmd_callback() and
view_snap_to_grid_cmd_callback().
* app/gui/Makefile.am
* app/gui/grid-dialog.[ch]: added a grid dialog.
2003-05-26 Michael Natterer <mitch@gimp.org>
* app/base/tile-manager-private.h: added "gint ref_count" to the
TileManager struct.
* app/base/tile-manager.[ch]: replaced tile_manager_destroy()
by tile_manager_ref() and tile_manager_unref().
* app/core/gimpimage-undo-push.c: ref the tile managers stored in
the undo system and DON'T destroy them if no undo could be pushed.
Should fix the remaining crashes with undo disabled like in
bug #9350.
(!!!) Note that the tiles passed to gimp_image_undo_push_image()
and gimp_drawable_push_undo() as well as the tile managers of
drawables passed to gimp_image_undo_push_[layer|channel]_mod()
must be unref'ed by the caller now.
* app/core/gimpdrawable-transform.c (gimp_drawable_transform_paste):
don't take ownership of the passed tiles but ref them if needed.
(!!!) Callers must unref the passed tiles themselves now.
* app/core/gimpbuffer.c
* app/core/gimpdrawable-blend.c
* app/core/gimpdrawable-bucket-fill.c
* app/core/gimpdrawable-offset.c
* app/core/gimpdrawable.c
* app/core/gimpedit.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-mask.c
* app/core/gimpimage-projection.c
* app/core/gimpimage.c
* app/core/gimpimagemap.c
* app/core/gimplayer-floating-sel.c
* app/core/gimplayer.c
* app/paint/gimppaintcore.c
* app/text/gimptextlayer.c
* app/tools/gimpinktool.c
* app/tools/gimpiscissorstool.c
* app/tools/gimptransformtool-undo.c
* app/tools/gimptransformtool.c: changed accordingly.
2003-05-21 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.[ch]: added GimpDrawable::alpha_changed()
signal.
* app/core/gimpimage-undo-push.c
* app/core/gimplayer.c: emit it when alpha is removed from or
added to a layer.
* app/widgets/gimpcontainertreeview.[ch]: added a
"name_attributes" column to the list store which provides a
PangoAttrList for the name column.
* app/widgets/gimplayertreeview.[ch]: connect to all layers'
"alpha_changed" and set the BG layer's name to bold.
* app/widgets/gimpdrawabletreeview.c: removed redundant assertions.
2003-05-20 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-undo-push.c (undo_pop_layer_mod): call
gimp_layer_invalidate_boundary() because the layer extents may
change.
* app/core/gimpitem-linked.c: pass clip_result == TRUE when
rotating linked channels.
* app/core/gimpdrawable-transform.c: implement clip_result so
linked channels can be rotated without leaving the image in an
inconsistent state. Added utility function
gimp_drawable_transform_rotate_point().
2003-05-20 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-undo-push.c: remember the guide's orientation
in the guide undo. Needed for gimp_image_rotate().