2006-06-03 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.[ch]: renamed
gimp_image_coords_in_active_drawable() to
gimp_image_coords_in_active_pickable() and added boolean
"sample_merged" and "selected_only" parameters. Use floor()
instead of ROUND(), we want to round to the actual pixel, not to
the nearest pixel boundary.
* app/tools/gimpbucketfilltool.c
* app/tools/gimpclonetool.c
* app/tools/gimpcolortool.c
* app/tools/gimpfliptool.c
* app/tools/gimptransformtool.c: changed accordingly. Removed
quite some duplicated code which checked sample_merged and the
mask value at the cursor location.
* app/tools/gimpbycolorselecttool.c: use the hand tool cursor,
there's also a hand in the toolbox icon. Fixed cursor_update()
function to set the bad modifier when there is no pickable pixel
at the cursor loction.
* app/tools/gimpfuzzyselecttool.c: added cursor_update()
implementation which does the same as by_color_select's one.
* app/tools/gimpselectiontool.c
(gimp_selection_tool_cursor_update): don't override the bad
modifier which was set by a subclass' cursor_update().
2006-04-05 Michael Natterer <mitch@gimp.org>
* app/plug-in/plug-in-types.h
* app/plug-in/plug-in-proc-def.[ch]: renamed to GimpPlugInProcedure
and made a GObject derived from GimpProcedure (instead of having
a pointer to a GimpProcedure). Added image_types and file_magic
utility functions taken from plug-ins.[ch]. Still lives in the
same crappy files because I am undecided where to put it...
* app/pdb/gimpprocedure.c (gimp_procedure_real_execute): removed
switch() statement and always call the internal marshaller because
GimpProcedure::execute() is properly overridden by
GimpPlugInProcedure now.
* app/plug-in/plug-ins.[ch]: removed the mime_type and file_magic
utilities added to GimpPlugInProcedure.
* app/actions/file-commands.c
* app/actions/plug-in-actions.[ch]
* app/actions/plug-in-commands.[ch]
* app/core/gimp-gui.[ch]
* app/core/gimp.[ch]
* app/core/gimpimage.[ch]
* app/dialogs/file-open-dialog.c
* app/dialogs/file-save-dialog.c
* app/dialogs/print-size-dialog.c
* app/file/file-open.[ch]
* app/file/file-save.[ch]
* app/file/file-utils.[ch]
* app/gui/gui-vtable.c
* app/menus/plug-in-menus.[ch]
* app/plug-in/plug-in-def.[ch]
* app/plug-in/plug-in-message.c
* app/plug-in/plug-in-rc.c
* app/plug-in/plug-in-run.c
* app/plug-in/plug-in.c
* app/plug-in/plug-ins-query.c
* app/widgets/gimpactiongroup.[ch]
* app/widgets/gimpdnd-xds.c
* app/widgets/gimpfiledialog.[ch]
* app/widgets/gimpfileprocview.[ch]
* app/widgets/gimppluginaction.[ch]
* app/xcf/xcf.c
* tools/pdbgen/pdb/fileops.pdb
* tools/pdbgen/pdb/plug_in.pdb: changed addordingly.
* app/pdb/fileops_cmds.c
* app/pdb/plug_in_cmds.c: regenerated.
2006-04-02 Michael Natterer <mitch@gimp.org>
* app/core/gimpparasitelist.[ch] (gimp_parasite_list_add): removed
the return value again.
(gimp_parasite_list_find): return a const parasite.
* app/core/gimp-parasites.[ch]
* app/core/gimpimage.[ch]
* app/core/gimpitem.[ch] (*_parasite_attach): take a const
parasite. Make a local copy of the parasite struct because
gimp_parasite_shift_parent() changes it.
(*_parasite_find): return a const parasite.
* app/core/gimptemplate.c
* app/text/gimptextlayer-xcf.c
* app/xcf/xcf-load.c: changed accordingly.
2005-04-03 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.[ch]: added new signals "sample-point-added"
and "sample-point-removed" and public functions to emit them.
* app/core/gimpimage-sample-points.c (gimp_image_add_sample_point)
(gimp_image_remove_sample_point): emit them accordingly.
* app/core/gimpimage-undo-push.c (undo_pop_image_sample_point):
ditto.
(undo_pop_image_guide)
(undo_pop_image_sample_point): added comments why we add/remove
stuff manually instead of using the GimpImage APIs.
* app/widgets/Makefile.am
* app/widgets/widgets-types.h
* app/widgets/gimpcursorview.[ch]
* app/widgets/gimpsamplepointeditor.[ch]: new widgets.
GimpCursorView is a replacement for the info window's "Cursor"
page, GimpSamplePointEditor is a view on an image's sample points.
The sample point editor does nothing yet except keeping a 2x2 grid
of GimpColorFrames. Addresses bug #137776.
* app/dialogs/dialogs.c
* app/dialogs/dialogs-constructors.[ch]: register the new widgets
as dockable dialogs.
* app/actions/dialogs-actions.c (dialogs_dockable_actions)
* menus/dialogs-menuitems.xml: added actions and menu items for
the new dialogs.
* app/display/gimpdisplayshell-cursor.c
(gimp_display_shell_update_cursor)
(gimp_display_shell_clear_cursor): update the new cursor view.
* app/widgets/gimphelp-ids.h: help IDs for the new dialogs.
* app/widgets/widgets-enums.[ch] (enum GimpColorFrameMode):
changed description "Pixel values" to "Pixel" because the former
was too long.
2004-10-12 Sven Neumann <sven@gimp.org>
* app/core/gimpimage.[ch]: renamed struct member "unit" to
"resolution_unit".
* app/actions/image-commands.c
* app/core/gimp-edit.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-undo-push.c
* app/dialogs/info-window.c
* app/vectors/gimpvectors-export.c
* app/widgets/gimptoolbox-dnd.c:
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c: changed accordingly. Use gimp_image_get_unit()
where appropriate.
* app/core/gimptemplate.c (gimp_template_set_from_image): fixed
unit handling. Don't touch the template unit, it is used as the
initial display unit. This will need further changes...
2004-10-06 Sven Neumann <sven@gimp.org>
* app/core/gimpimage.[ch]: store the time when the image is first
dirtied.
* app/display/gimpdisplayshell-close.c: tell the user what time
period of changes will be lost when the image is not saved.
2004-07-29 Michael Natterer <mitch@gimp.org>
Replaced the concept of having a boolean indicating if an undo
step dirties the image by a bitfield indicating which parts
of the image are dirtied:
* app/core/core-enums.[ch]: reordered two values in enum
GimpUndoType, added GIMP_DIRTY_IMAGE_SIZE to enum GimpDirtyMask.
The values of GimpDirtyMask are still questionable and will
probably change...
* app/core/gimpimage.[ch]: removed signal "undo_start" and added
a GimpDirtyMask parameter to the "dirty" and "clean" signals.
* app/core/gimpimage-undo.[ch] (gimp_image_undo_push): replaced
"gboolean dirties_image" by "GimpDirtyMask dirty_mask" and pass
it to gimp_image_dirty().
(gimp_image_undo_group_start): added *ugly* code which tries to
figure GimpDirtyMask from the group's GimpUndoType and store it in
the GimpUndoGroup. Call gimp_image_dirty() instead of the removed
gimp_image_undo_start(). This means the undo group now dirties the
image just like one of its undo steps, but that's no problem since
undoing cleans it in the same way.
* app/core/gimpundo.[ch]: s/dirties_image/dirty_mask/g
(gimp_undo_pop): emit clean/dirty signals *before* performing the
actual undo step so listeners can detach from the image before it
is changed by undo.
* app/core/gimpimage-undo-push.c (gimp_image_undo_push_*): pass a
GimpDirtyMask instead of TRUE/FALSE to gimp_image_undo_push().
* app/core/gimpimagemap.[ch]: removed "gboolean interactive"
because it makes no sense to use GimpImageMap noninteractively.
Don't freeze()/thaw() undo while the image_map is active which
fixes many ways of trashing the image's undo state but probably
introduces new ways of doing evil things.
* app/display/gimpdisplay-foreach.c
* app/display/gimpdisplayshell-handlers.c: changed according
to the GimpImage::clean()/dirty() signal changes. Small fixes
in the quit dialog's dirty image container.
* app/tools/gimptoolcontrol.[ch]: added member and API to
set/get the dirty_mask.
* app/tools/gimpcroptool.c
* app/tools/gimpimagemaptool.c
* app/tools/gimpiscissorstool.c
* app/tools/gimptexttool.c
* app/tools/gimptransformtool.c: whenever setting "preserve" to
FALSE, also set a "dirty_mask" which specifies on which image
changes the tool wants to be canceled.
* app/tools/tool_manager.c: removed "undo_start" connection and
connect to both "dirty" *and* "clean" to check if the active_tool
needs to be canceled. Cancel the tool only if the dirty_mask
passed in the signal has common bits with the tool's dirty_mask.
Fixes bug #109561 and probably opens some new ones...
2004-07-05 Michael Natterer <mitch@gimp.org>
* app/core/gimpchannel.[ch]: added signal "color-changed" and emit
it in gimp_channel_set_color() and gimp_channel_set_opacity().
* app/core/gimpimage-qmask.[ch]: added new functions
gimp_image_set,get_qmask_color().
* app/core/gimpimage.[ch]: install a "color-changed" handler on
gimage->channels and update gimage->qmask_color when the qmask's
color changes. Fixes bug #145361.
* app/actions/qmask-commands.c: use the new qmask color API.
2004-06-01 Sven Neumann <sven@gimp.org>
* tools/pdbgen/pdb/image.pdb
* app/pdb/image_cmds.c
* app/core/gimpimage.[ch]: reverted changes I did to the image
unit earlier. As in 2.0, it will continue to not accept pixels.
This makes the PDB API and the XCF format compatible again and
fixes bug #142961 (and to some extent bug #137704).
* app/core/Makefile.am
* app/core/gimpimage-unit.[ch]: removed these files. The
convenience accessors defined here aren't commonly used any
longer.
* app/display/gimpdisplay.[ch]
* app/display/gimpdisplayshell.[ch]: added a unit parameter to
gimp_display_new(). Made "unit" and "scale" properties of
GimpDisplayShell.
* app/actions/image-commands.c
* app/actions/images-commands.c
* app/actions/layers-commands.c
* app/actions/select-commands.c
* app/actions/view-commands.c
* app/core/gimp-edit.c
* app/core/gimp.[ch]
* app/core/gimptemplate.c
* app/display/gimpdisplayshell-handlers.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-title.c
* app/display/gimpstatusbar.c
* app/file/file-open.c
* app/gui/gui-vtable.c
* app/gui/info-window.c
* app/gui/offset-dialog.c
* app/gui/resize-dialog.[ch]
* app/pdb/display_cmds.c
* app/tools/gimpcroptool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimppainttool.c
* app/tools/gimprectselecttool.c
* app/tools/gimprotatetool.c
* app/tools/gimpscaletool.c
* app/vectors/gimpvectors-export.c
* app/widgets/gimptoolbox-dnd.c
* tools/pdbgen/pdb/display.pdb: changed accordingly. Use the
display unit where the image unit was used before.
2004-04-19 Michael Natterer <mitch@gimp.org>
More GtkAction stuff (still unused):
* configure.in: added new directories menus/ and app/actions/
* Makefile.am: build menus/
* menus/.cvsignore
* menus/Makefile.am
* menus/*-menu.xml: new files: XML menu descriptions for each menu
which is now defined in gui/*-menu.c.
* app/widgets/widgets-types.h: some typedefs for GimpActionGroup.
* app/widgets/gimpactiongroup.[ch]: added a "Gimp" construct-only
property. Added APIs to set actions visible/sensitive/active
and an unimplemented stub for setting the action's color.
* app/Makefile.am: build actions/ and link libappactions.a
* app/actions/.cvsignore
* app/actions/Makefile.am
* app/actions/*-actions.[ch]: new files: GtkActions for each
*-commands.c file in gui/. Ported all "update" functions from the
*-menu.c files.
(everything completely unused, untested and partly #if 0'ed)
* app/core/gimpimage.[ch]: for reasons of (action-) symmetry, added
API to raise/lower channels/vectors to top/bottom.
* app/gui/channels-commands.[ch]
* app/gui/vectors-commands.[ch]: added callbacks for the new
to top/bottom functions.
* app/gui/Makefile.am
* app/gui/dockable-commands.[ch]: new files split out of
dialogs-commands.[ch].
* app/gui/dialogs-commands.[ch]
* app/gui/dialogs-menu.c: changed accordingly.
* app/gui/edit-commands.[ch]: added edit_paste_into_cmd_callback()
and remove usage of "guint action".
* app/gui/image-menu.c: changed accordingly.
* app/gui/palette-editor-commands.[ch]: split
+palette_editor_new_color_cmd_callback() into separate callbacks
for adding from FG and BG.
* app/gui/palette-editor-menu.c: changed accordingly.
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 Simon Budig <simon@gimp.org>
* app/core/gimpimage.[ch]
* app/core/gimpimage-undo.c: renamed gimage->freeze_count
to gimage->undo_freeze_count (more explicit).
* app/file/file-open.c: Ensure that the undo system is enabled
after loading an image (to protect against broken loaders).
2004-03-14 Simon Budig <simon@gimp.org>
* app/core/gimpimage.[ch]
* app/core/gimpimage-undo.c: introduced a freeze counter, so
that undo_freeze(); undo_freeze(); undo_thaw(); no longer
results in an thawed undo stack.
Fixes Bug #124176.
This might reveal other places in the code where
gimp_image_undo_freeze/thaw or gimp_image_undo_disable/enable
were used in an inconsistent (not-paired) manner.
* app/file/file-open.c: e.g. here, where _enable was called on
the new image. The intention was to free a potential undo stack,
so now call gimp_image_undo_free() instead.
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-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.[ch] (gimp_image_get_color): also return the
color's alpha byte if it has alpha, not only the converted RGB
values. Return OPAQUE_OPACITY for drawables without alpha.
Fixes bug #131706.
* app/core/gimpdrawable.c (gimp_drawable_get_color_at)
* app/core/gimpimage-contiguous-region.c
(gimp_image_contiguous_region_by_color)
* app/core/gimpimage-projection.c (gimp_image_projection_get_color_at)
* app/core/gimpimagemap.c (gimp_image_map_get_color_at)
* app/paint/gimpclone.c (gimp_clone_line_image): removed separate
handling of the alpha byte from all users of gimp_image_get_color().
2003-10-14 Sven Neumann <sven@gimp.org>
* app/core/gimpimage-grid.c
* app/core/gimpimage.[ch]
* app/gui/grid-dialog.c: removed the "grid_changed" signal from
GimpImage.
* app/display/gimpdisplayshell-handlers.c: connect to
notifications from the image grid instead.
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-27 Michael Natterer <mitch@gimp.org>
* app/paint-funcs/paint-funcs.[ch]: added new functions
color_region_mask() which works like color_region() but takes an
additional maskPR parameters and pattern_region() which fills
destPR with a TempBuf of *matching color depth*.
* app/paint-funcs/paint-funcs-generic.h: added corresponding
color_pixels_mask() and pattern_pixels().
* app/core/gimpimage.[ch] (gimp_image_transform_temp_buf): new
function which transforms a TempBuf to a specified drawable's
color space.
* app/core/gimpdrawable-bucket-fill.c: the functions were factored
out here. Removed them and use the new stuff.
* app/core/core-enums.[ch]: added enum GimpStrokeStyle which can
be one of { SOLID, PATTERN }.
* app/core/gimpstrokeoptions.[ch]: added "GimpStrokeStyle style"
property, cleanup.
* app/core/gimpdrawable-stroke.c: honor the new "style" property
and call the new color_region_mask() and pattern_region()
functions accordingly, cleanup.
* app/widgets/gimpstrokeeditor.c: added a GUI for the stroke
style. Ugly but works.
* app/gui/stroke-dialog.c: undefine "foreground" and "pattern" and
set the user context as parent context so we get these properties
from the global settings.
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-05 Michael Natterer <mitch@gimp.org>
* app/paint-funcs/paint-funcs.[ch]: removed function map_to_color()
since it does not belong here and the two places using it look much
cleaner when doing that stuff themselves.
* app/core/gimpdrawable-preview.c: cleanup.
(gimp_drawable_preview_scale): do the indexed palette lookup here
instead of calling map_to_color().
* app/core/gimpimage.c (gimp_image_get_color): transform the
colors here instead of calling map_to_color().
* app/core/gimpimage.[ch] (gimp_image_get_color): reordered
parameters src parameters are before dest parameters.
Made the src color const.
(gimp_image_transform_color): reordered so src parameters are
*after* dest parameters (since this function operates on the dest
image and it makes sense to have the dest parameters
together). Made the src color const here, too.
* app/core/gimpdrawable-bucket-fill.c
* app/core/gimpdrawable.c
* app/core/gimpimage-contiguous-region.c
* app/core/gimpimage-projection.c
* app/core/gimpimagemap.c
* app/core/gimplayer.c
* app/core/gimppalette-import.c
* app/paint/gimpclone.c
* app/paint/gimppaintcore.c: changed accordingly.
* app/core/gimpedit.c (gimp_edit_cut,copy): simplified by
moving the "cropped" variable to a local scope.
* app/core/gimpimage-mask.c: calling gimp_image_update() followed
by gimp_viewable_imvalidate_preview(drawable) is equal to calling
gimp_drawable_update() directly.
2003-09-03 Michael Natterer <mitch@gimp.org>
* app/core/gimpchannel.[ch]: made all functions which push an
undo step virtual and added them all as default implementations.
* app/core/Makefile.am
* app/core/core-types.h
* app/core/gimpselection.[ch]: new object which is a GimpChannel
subclass and implements all of its virtual functions, pushes
an image_mask undo and chains up with "push_undo = FALSE".
* app/core/gimpimage-mask.[ch]: made most functions simple
wrappers like gimp_channel_invert(gimp_image_get_mask(gimage));
so the API stays the same for now.
* app/core/gimpimage.[ch]: create a GimpSelection object
as gimage->selection_mask. Removed "gboolean mask_stroking"
since it is in GimpSelection now.
* app/xcf/xcf-load.c (xcf_load_channel_props): added an evil hack
which turns a GimpChannel into a GimpSelection once we figured the
loaded channel is the selection.
* app/core/gimplayer.c (gimp_layer_create_mask):
gimp_channel_clear() takes an additional "const gchar *undo_desc"
parameter now.
* app/core/gimpscanconvert.c (gimp_scan_convert_to_channel): set
mask->bounds_known to FALSE before returning the new channel
* app/tools/gimpiscissorstool.c (iscissors_convert): no need to
call gimp_channel_invalidate_boundary() on the channel returned by
the above function.
* app/core/gimpchannel.[ch]: removed
gimp_channel_invalidate_boundary() since it is no longer needed.
2003-09-01 Michael Natterer <mitch@gimp.org>
* app/core/gimpitem.[ch]: added new virtual function
GimpItem::stroke().
* app/core/gimpchannel.c
* app/vectors/gimpvectors.c: implement GimpItem::stroke().
* app/core/gimpimage-mask.[ch] (gimp_image_mask_stroke): changed
signature to match gimp_item_stroke() (the selection mask *really*
should be a GimpChannel subclass).
Removed global variable "gboolean gimp_image_mask_stroking"...
* app/core/gimpimage.[ch]: ...and added "gboolean mask_stroking"
to the GimpImage struct.
* app/gui/vectors-commands.[ch]: removed vectors_stroke_vectors().
* app/widgets/widgets-types.h: removed GimpStrokeItemFunc typedef.
* app/widgets/gimpvectorstreeview.[ch]: removed "stroke_item_func"
member and use gimp_item_stroke() instead.
* app/gui/dialogs-constructors.c (dialogs_vectors_list_view_new)
* app/gui/edit-commands.c (edit_stroke_cmd_callback)
* app/gui/vectors-commands. (vectors_stroke_cmd_callback)
* app/widgets/gimpselectioneditor.c
(gimp_selection_editor_stroke_clicked)
* tools/pdbgen/pdb/edit.pdb (gimp_edit_stroke): changed accordingly.
* app/pdb/edit_cmds.c: regenerated.
Note that there is no GUI for "stroke channel", although it would
be utterly cool to have one, since currently slelection stroking
cannot be masked by a selection (because we stroke the selection).
Anyway, if anyone has an idea how to trigger "stroke channel" with
another drawable active (the one to stroke to), please let me
know...
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.
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-03-25 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.[ch]: added new functions
gimp_image_active_[layer|channel|vectors]_changed() which emit the
resp. signals.
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel,vectors):
fixed them to not leave the image's active layer, channel, vectors
pointers undefined (fixes bug #109110). Call gimp_item_removed()
from all of them.
* app/core/gimpimage-qmask.c: cleanup.
2003-03-18 Michael Natterer <mitch@gimp.org>
Added an API for image colormap manupulation and made colormap
changes undoable (fixes bug #25963).
* app/core/Makefile.am
* app/core/gimpimage-colormap.[ch]: new files implementing
colormap getters/setters. The setters push undos using the
new function below.
* app/core/core-enums.[ch]: added GIMP_UNDO_IMAGE_COLORMAP.
* app/core/gimpimage-undo-push.[ch]: added
gimp_image_undo_push_image_colormap(). Use GimpItemUndo even more
often. Cleanup.
* app/core/gimpimage.[ch]: removed gimp_image_get_colormap() here.
* app/core/gimpimage-convert.c
* app/gui/colormap-editor-commands.c
* app/widgets/gimpcolormapeditor.c
* app/widgets/gimptoolbox.c
* tools/pdbgen/pdb/image.pdb: use the new API.
* app/pdb/image_cmds.c: regenerated.
* plug-ins/common/vinvert.c: removed the comment about the bug,
cosmetic cleanup.
Unrelated:
* app/gui/splash.c: added a frame around the splash. Please eek
if it doesn't please you.
2003-03-12 Michael Natterer <mitch@gimp.org>
* app/core/core-enums.[ch]: added descriptions to the
GimpChannelType enum.
* app/core/gimpimage.[ch]: added gimp_image_get_component_index()
utility function which does the GIMP_RED_CHANNEL -> RED_PIX etc.
mapping. Use it in all component getters/setters.
* app/widgets/gimpcomponenteditor.[ch]: new widget implementing
the component list using GtkListStore/GtkTreeView. Still a bit
ugly because it uses the standard check instead of the eye icon.
* app/widgets/gimpcomponentlistitem.[ch]: removed.
* app/widgets/Makefile.am
* app/widgets/widgets-types.h
* app/widgets/gimpvectorslistview.c: changed accordingly.
* app/widgets/gimpchannellistview.[ch]: create a GimpComponentEditor
and removed the old GtkList based stuff.
* app/widgets/gimpitemlistview.[ch]: keep around a pointer to the
GimpMenuFactory passed to the constructor.
* app/gui/channels-menu.c (channels_menu_update): do the right
thing if "data" is a GimpComponentEditor.
* app/gui/channels-commands.[ch]: ditto. Implemented duplicating
of components and component to selection (bug #61018).
2003-03-11 Sven Neumann <sven@gimp.org>
* app/core/gimpimage.[ch]: made gimp_image_get_active_components()
a static function and changed its behaviour so that the image's
active components are only used for layers, not for channels.
Fixes bug #108083.
2003-02-20 Michael Natterer <mitch@gimp.org>
Reimplemented the undo history:
* app/Makefile.am
* app/undo_history.[ch]: removed.
Changes/cleanups to the undo system to enable/simplify the new
undo history implementation:
* app/core/core-types.h: removed enum undo_event_t. Removed the
GimpImage parameter from GimpUndoPopFunc and GimpUndoFreeFunc
because GimpUndo has a GimpImage pointer now (see below).
* app/core/core-enums.[ch]: added enum GimpUndoEvent. Added an
enum value for REDO_EXPIRED.
* app/core/gimpimage.[ch]: added a GimpUndo pointer to the
"undo_event" signal which needs to be passed for all events except
UNDO_FREE.
* app/display/gimpdisplayshell-handlers.c: changed accordingly.
* app/core/gimpundo.[ch]: added a GimpImage pointer to the
GimpUndo struct. Removed GimpImage parameters all over the
place. Added preview stuff. The preview creation needs to be
triggered explicitly using gimp_undo_create_preview() because the
GimpUndo can't know when it's possible to create the preview.
* app/core/gimpimage-undo-push.c
* app/paint/gimppaintcore-undo.c
* app/tools/gimptransformtool-undo.c: changed accordingly, cleanup.
* app/core/gimpundostack.[ch]: ditto. Return the freed undo from
gimp_undo_stack_free_bottom(). Removed unused container signal
handlers.
* app/core/gimpimage-undo.c: free the redo stack the same way old
undos are freed (from bottom up). Emit "undo_event" with event ==
REDO_EXPIRED for each removed redo.
* app/core/gimpmarshal.list: added new marshallers.
New undo history implementation:
* app/widgets/Makefile.am
* app/widgets/widgets-types.h
* app/widgets/gimpundoeditor.[ch]
* app/widgets/gimpundopreview.[ch]: new widgets for the undo
step previews and the history itself.
* app/widgets/gimppreview-utils.c: added GimpUndoPreview to the
list of possible preview types.
* app/gui/dialogs-constructors.[ch]
* app/gui/dialogs-menu.c
* app/gui/dialogs.c
* app/gui/image-menu.c
* app/gui/toolbox-menu.c: removed the old and added the new undo
history to the dialog factory and the various dialog menus.
* app/widgets/gimpdnd.[ch]: don't warn if a GType has no
corresponding DND type. Instead, return FALSE from the function
that failed.
* app/widgets/gimppreview.c: check the return value of gimpdnd
functions. Not only add drag sources but also remove them when no
longer needed.
* app/widgets/gimpselectioneditor.h: removed unneeded inclusion of
"gui/gui-types.h".
2003-02-17 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.[ch] (gimp_image_position_*): added
"undo_desc" parameters.
* app/core/gimpimage-undo-push.c: changed accordingly.
* app/widgets/gimpitemlistview.[ch]: moved the item stack
manipulation function pointers from the instance to the class
struct. Added lots of descriptive strings to be used by tooltips
and undo steps.
* app/widgets/gimpchannellistview.c
* app/widgets/gimpitemlistitem.c
* app/widgets/gimplayerlistview.[ch]
* app/widgets/gimpvectorslistview.c
* app/gui/dialogs-constructors.c
* app/gui/layers-commands.[ch]
* app/gui/vectors-commands.c: changed accordingly. Cleanup.
2003-02-12 Michael Natterer <mitch@gimp.org>
Moved the undo system to the core: Keep GimpUndoStack objects as
undo and redo stack. Use GimpUndo objects as members of the
stacks. GimpUndoStack is derived from GimpUndo and keeps undo
groups, so undo group handling is much simpler than before
(the whole group is just a single GimpUndo object on the
stack and not everything between group boundary markers).
* app/Makefile.am
* app/undo_types.h: removed.
* app/config/gimpcoreconfig.[ch]: added "gulong undo_size".
* app/config/gimprc-blurbs.h: and its blurb.
* app/core/core-enums.[ch]: added GimpUndoMode and GimpUndoType.
* app/core/core-types.h: removed UndoType, added GimpUndoAccumulator,
GimpUndoPopFunc and GimpUndoFreeFunc.
* app/core/gimpundo.[ch]: do everything the old "Undo" struct did.
Removed the virtual push() function and added free().
* app/core/gimpundostack.[ch]: keeps the new undo/redo stacks
and also acts as undo group.
* app/core/gimpimage-undo.[ch]: moved the undo apparatus here.
* app/core/gimpimage.[ch]: removed the old stuff.
* app/core/gimpmarshal.list: added marshaller needed for GimpUndo.
* app/undo.[ch]: removed the whole undo mechanism. Only the
actual undo pushing functions are left.
* app/undo_history.c
* app/gui/edit-commands.c
* app/gui/file-commands.c
* app/gui/image-menu.c
* app/gui/preferences-dialog.c
* app/tools/gimpeditselectiontool.c: changed accordingly.
2003-01-02 Michael Natterer <mitch@gimp.org>
Replaced Garry's fix for bug #98843 by a more general solution
which stops the active tool when an undo group start is pushed:
* app/core/gimpimage.[ch]: removed the "layer_merge" signal
and added "undo_start" instead.
* app/undo.c: emit "undo_start" in undo_push_group_start()
_before_ checking if gimage->undo_on is TRUE.
* app/tools/tool_manager.c: connect to "undo_start" and HALT the
active tool if neccessary.
* app/core/core-types.h: added EDIT_COPY_UNDO_GROUP.
* app/core/gimpedit.c: push an undo group around the copy
operation. Will probably have to add more undo group types to wrap
other critical image modifications with.
* app/core/gimpimage-merge.c
* app/gui/convert-dialog.c
* app/gui/edit-commands.c
* app/gui/test-commands.c
* app/tools/gimpimagemaptool.c: removed all special code to
stop the active tool.
2003-01-01 Garry R. Osgood <grosgood@rcn.com>
* MAINTAINERS: Updated my CVS.
* app/undo.c
* app/undo_history.c
* app/core/gimpimage.[ch]
* app/tools/gimpimagemaptool.c
* app/core/gimpimage-merge.c: implementation of LAYER_MERGE
signal emitters and listeners. (see bug #98843); listeners thaw
undo stack (image map tools, usually).
* app/widgets/gimpviewabledialog.c: gimp_viewable_dialog_close ()
Check if the widget has a non-null reference to a window before
using it to synthesize a cancel event. These seven deltas closes bug #98843.
* app/core/gimpimage-merge.c: (gimp_image_merge_layers())
Regardless of merge type, temporarily set composition mode
of bottom layer to NORMAL, then merge. Closes bug #101036.