Commit Graph

16 Commits

Author SHA1 Message Date
Michael Natterer bdc91d6c52 Remove support for the old undo pop and free cruft:
2007-02-03  Michael Natterer  <mitch@gimp.org>

	Remove support for the old undo pop and free cruft:

	* app/core/core-types.h: remove typedefs GimpUndoPopFunc and
	GimpUndoFreeFunc.

	* app/core/gimpundo.[ch]: remove members and properties size,
	data, pop_func and free_func.

	* app/core/gimpimage-undo.[ch] (gimp_image_undo_push): remove
	parameters size, struct_size, pop_func and free_func.

	* app/core/gimpimage-undo-push.c
	* app/tools/gimptransformtool.c
	* app/paint/gimpink.c
	* app/paint/gimppaintcore.c: change calls to above function
	accordingly.


svn path=/trunk/; revision=21845
2007-02-03 22:25:32 +00:00
Michael Natterer 11a43d6a50 app/core/Makefile.am app/core/core-types.h new undo class which handles
2007-01-28  Michael Natterer  <mitch@gimp.org>

	* app/core/Makefile.am
	* app/core/core-types.h
	* app/core/gimpimageundo.[ch]: new undo class which handles
	GIMP_UNDO_IMAGE_TYPE, GIMP_UNDO_IMAGE_SIZE and
	GIMP_UNDO_IMAGE_RESOLUTION.

	* app/core/gimpimage-undo-push.c: use the new undo class and
	remove the resp. code here.

	* app/core/gimpimage-undo.h: changed include guards to not
	conflict with gimpimageundo.h


svn path=/trunk/; revision=21789
2007-01-28 18:21:39 +00:00
Sven Neumann 41237259c9 In all files, changed the standard copyright notice to say "GIMP - The GNU
2006-12-09  Sven Neumann  <sven@gimp.org>

        * In all files, changed the standard copyright notice to say
        "GIMP - The GNU Image Manipulation Program".
2006-12-09 21:33:38 +00:00
Michael Natterer e634d4d718 Added "Edit -> Fade" which allows to modify the paint mode and opacity of
2006-10-21  Michael Natterer  <mitch@gimp.org>

	Added "Edit -> Fade" which allows to modify the paint mode and
	opacity of the last drawable operation (fill, plugins etc.).
	Started from a patch by Bill Skaggs. Fixes bug #170707.

	* app/base/base-enums.[ch] (enum GimpLayerModeEffects): register
	the values REPLACE_MODE, ERASE_MODE and ANTI_ERASE_MODE with
	the type system.

	* app/widgets/gimppropwidgets.[ch]
	* app/widgets/gimpwidgets-constructors.[ch]: added "gboolean
	with_replace_modes" to the paint mode menu constructors.

	* app/tools/gimppaintoptions-gui.c
	* app/widgets/gimpbrushselect.c
	* app/widgets/gimplayertreeview.c: pass with_replace_modes = FALSE.

	* app/core/gimpdrawableundo.[ch]: added members which keep tiles,
	paint mode and opacity of the pasted pixels.

	* app/core/gimpimage-undo.[ch] (gimp_image_undo_get_fadeable):
	returns a GimpUndo suitable for a fade operation, or NULL.

	* app/core/gimp-edit.[ch] (gimp_edit_fade): implements the actual
	fade by undoing the last operation and then re-applying the pixels
	with different paint mode and opacity.

	* app/core/gimpdrawable-combine.c: store the pasted pixels in
	the GimpDrawableUndo.

	* app/actions/edit-actions.c
	* app/actions/edit-commands.[ch]: action and callback for fade.

	* app/dialogs/Makefile.am
	* app/dialogs/fade-dialog.[ch]: the fade dialog.

	* app/widgets/gimphelp-ids.h: the fade help ID.

	* menus/image-menu.xml.in: added a menu entry in "Edit".
2006-10-21 18:46:49 +00:00
William Skaggs 701b7b31d7 Bill Skaggs <weskaggs@primate.ucdavis.edu>
Finally implemented the suggestion in bug #144854, of
	"strong" undo/redo commands that continue undoing so long
	as they only encounter visibility changes.

	* app/actions/edit-actions.c
	* app/actions/edit-commands.c
	* app/actions/edit-commands.h: added "strong undo"
	and "strong redo" commands/actions.

	* app/core/gimpimage-undo.[ch]: added functions
	gimp_image_strong_undo() and gimp_image_strong_redo().

	* app/core/gimpundo.[ch]: added utility function
	gimp_undo_is_weak().

	* app/widgets/gimphelp-ids.h:added id's.

	* menus/image-menu.xml.in: added to edit menu,
	bound to C-S-z and C-S-y.

	This will no doubt need tweaking, but I will consider it
	to fix bug #144854.
2006-06-13 02:03:44 +00:00
Sven Neumann 905fdfcbed did a global gimage -> image substitution.
2006-03-28  Sven Neumann  <sven@gimp.org>

	* app/*: did a global gimage -> image substitution.
2006-03-28 17:08:36 +00:00
Sven Neumann 489aebab5e app/core/gimp-gui.h app/core/gimp-utils.h app/core/gimpimage-undo.h
2005-09-27  Sven Neumann  <sven@gimp.org>

	* app/core/gimp-gui.h
	* app/core/gimp-utils.h
	* app/core/gimpimage-undo.h
	* app/text/gimptextlayer.h
	* app/widgets/gimpeditor.h
	* app/widgets/gimpmenufactory.h
	* app/widgets/gimpmessagedialog.h
	* app/widgets/gimpsessioninfo.h
	* app/widgets/gimptooldialog.h
	* app/widgets/gimpviewabledialog.h: use G_GNUC_NULL_TERMINATED
	where appropriate.
2005-09-27 17:31:32 +00:00
Michael Natterer b909c2b2ee new function which checks if undo compression is possible:
2004-08-03  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpimage-undo.[ch] (gimp_image_undo_can_compress):
	new function which checks if undo compression is possible:

	(1) is the image dirty? Fixes bug #148853.
	(2) is redo stack empty?
	(3) do both the passed undo object_type and undo_type
	    match the top undo item?

	Consistently name the GType and GimpUndoType passed to undo
	functions "object_type" and "undo_type" to avoid confusion.

	* app/actions/layers-commands.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimptexttool.c
	* app/widgets/gimpitemtreeview.c
	* app/widgets/gimplayertreeview.c: use the new utility function
	instead of checking the above conditions manually.
2004-08-03 14:09:49 +00:00
Michael Natterer 4b582b481a Replaced the concept of having a boolean indicating if an undo step
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-29 14:16:21 +00:00
Michael Natterer da74f1269e app/core/gimpundo.[ch] app/core/gimpitemundo.[ch] removed all _new()
2004-07-12  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpundo.[ch]
	* app/core/gimpitemundo.[ch]
	* app/text/gimptextundo.[ch]: removed all _new() functions and
	added properties and GObject::constructor() implementations
	instead.

	* app/core/gimpimage-undo.[ch] (gimp_image_undo_push): added
	"GType undo_gtype" parameter and allow to pass name-value pairs as
	"...". Une the new GParameter utility functions to construct the
	appropriate undo step with g_object_newv().

	(gimp_image_undo_push_item): removed.

	(gimp_image_undo_push_undo): removed. Merged its code back into
	gimp_image_undo_push(), where it originally came from.

	* app/core/gimpimage-undo-push.c
	* app/core/gimpundostack.c
	* app/paint/gimppaintcore-undo.c
	* app/tools/gimptransformtool-undo.c
	* app/widgets/gimpundoeditor.c: changed accordingly.
2004-07-12 16:59:36 +00:00
Michael Natterer 525a98f81a Made the undo system robust against the currently pushed undo being too
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-07-07 13:58:51 +00:00
Sven Neumann 2326e1b979 added gimp_undo_type_to_name() a similar function used to live in
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-21 23:14:21 +00:00
Sven Neumann fd30d5c976 app/config/gimpbaseconfig.h use gint64 for all memsize properties.
2003-11-16  Sven Neumann  <sven@gimp.org>

	* app/config/gimpbaseconfig.h
	* app/config/gimpcoreconfig.h: use gint64 for all memsize properties.

	* app/base/tile-manager.[ch] (tile_manager_get_memsize): since
	tiles can be swapped out, a tilemanager can be larger than gsize
	(on 32bit platforms). Use a gint64 to avoid an overflow.

	* 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-push.c
	* app/core/gimpimage-undo.[ch]
	* app/core/gimpimage.c
	* app/core/gimpitem.c
	* app/core/gimpitemundo.[ch]
	* app/core/gimplayer.c
	* app/core/gimplist.c
	* app/core/gimpobject.[ch]
	* app/core/gimppalette.c
	* app/core/gimpparasitelist.c
	* app/core/gimppattern.c
	* app/core/gimpundo.[ch]
	* app/core/gimpundostack.c
	* app/core/gimpviewable.c
	* app/text/gimptext.c
	* app/text/gimptextlayer.c
	* app/vectors/gimpstroke.c
	* app/vectors/gimpvectors.c: use gint64 for gimp_object_get_memsize()
	and all its implementations.

	* app/display/gimpdisplayshell-title.c
	* app/gui/info-window.c: changed accordingly.
2003-11-16 17:51:36 +00:00
Michael Natterer 884b3aa7a3 Made drawable/layer properties (visibility, opacity etc.) undoable (fixes
2003-03-17  Michael Natterer  <mitch@gimp.org>

	Made drawable/layer properties (visibility, opacity etc.)
	undoable (fixes bug #73893).

	* app/core/core-enums.[ch]: added undo types/groups for
	visibility, mode, opacity, linked and preserve_trans.

	* app/core/Makefile.am
	* app/core/core-types.h
	* app/core/gimpitemundo.[ch]: new GimpUndo subclass which holds a
	ref'ed GimpItem pointer so (1) this doesn't need to be done by all
	undo steps related to an item and (2) the item the undo step is
	for can be determined from outside the undo system.

	* app/core/gimpimage-undo.[ch]: added gimp_image_undo_push_item()
	which returns a new GimpItemUndo.

	* app/core/gimpimage-undo-push.[ch]: use it for all item related
	undo steps. Removed lots of GimpItem, GimpLayer, GimpDrawable
	and GimpVectors pointers from the private undo structs. Added
	undo push functions for the new undo types added above.

	* app/core/gimpdrawable.[ch] (gimp_drawable_set_visible): added
	"gboolean push_undo" parameter.

	* app/core/gimplayer.[ch] (gimp_layer_set_opacity, _mode,
	_preserve_trans, _linked): added "gboolean push_undo" parameters.

	* app/core/gimpimage-mask.c
	* app/core/gimpimage-merge.c
	* app/core/gimplayer-floating-sel.c
	* app/tools/gimpmovetool.c
	* app/xcf/xcf-load.c
	* app/widgets/gimpdrawablelistitem.c
	* app/widgets/gimplayerlistitem.c
	* app/widgets/gimplayerlistview.c: changed accordingly.

	* tools/pdbgen/pdb/channel.pdb
	* tools/pdbgen/pdb/layer.pdb: ditto. Added '$undo' paramaters to
	the foo_accessors() functions. Removed $func from foo_accesors()
	because we don't manipulate items without using getters/setters
	any longer.

	* app/pdb/channel_cmds.c
	* app/pdb/layer_cmds.c: regenerated.

	* app/widgets/gimpcellrenderertoggle.[ch]: added "clicked" signal
	which carries an additional "GdkModifierType state" parameter as
	in GimpCellRendererViewable .

	* app/widgets/gimpcontainertreeview.c: emit "clicked" from
	the toggle renderer, not "toggled" so the callbacks get the
	modifier state.

	* app/widgets/gimpdrawabletreeview.c: resurrected the "exclusive
	visible by <shift>+click" feature as in 1.2.

	* app/widgets/gimplayertreeview.c: compress layer opacity undos by
	looking at the top of the undo stack and not pushing an undo if
	there already is a GIMP_UNDO_DRAWABLE_OPACITY for the active
	layer.
2003-03-17 18:02:41 +00:00
Michael Natterer be70105d3b Moved the undo system to the core: Keep GimpUndoStack objects as undo and
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-02-12 17:11:34 +00:00
Sven Neumann 75e8e3877c app/Makefile.am app/apptypes.h app/gimpimage-undo.[ch] app/gimpundo.[ch]
2001-03-05  Sven Neumann  <sven@gimp.org>

	* app/Makefile.am
	* app/apptypes.h
	* app/gimpimage-undo.[ch]
	* app/gimpundo.[ch]
	* app/gimpundostack.[ch]: added new GimpUndo and GimpUndoStack objects
	which will be used for the upcoming new undo system. Actually my
	current plan for the undo system is to keep it pretty much as it is...

	* app/gimpimage.[ch]: added new GimpUndoStacks but temporarily kept
	old GSLists around, so I don't break everything now.
2001-03-05 01:01:16 +00:00