Commit Graph

318 Commits

Author SHA1 Message Date
Sven Neumann 60fcaa9629 app/core/gimplayer.c app/actions/edit-commands.c
2008-08-07  Sven Neumann  <sven@gimp.org>

	* app/core/gimplayer.c
	* app/actions/edit-commands.c
	* app/actions/layers-commands.c
	* tools/pdbgen/pdb/layer.pdb: corrected the GimpImageType passed
	to gimp_layer_new_from_tiles().

	* app/pdb/layer-cmds.c: regenerated.


svn path=/trunk/; revision=26425
2008-08-07 17:19:32 +00:00
Sven Neumann e5196e3017 added some empty lines for readability.
2008-08-07  Sven Neumann  <sven@gimp.org>

	* app/core/gimplayer.c (gimp_layer_new_from_region): added some
	empty lines for readability.


svn path=/trunk/; revision=26417
2008-08-07 13:36:04 +00:00
Sven Neumann 4aa7e67c67 removed "add_alpha" parameter from gimp_item_duplicate() and
2008-01-08  Sven Neumann  <sven@gimp.org>

	* app/core/gimpitem.[ch]: removed "add_alpha" parameter from
	gimp_item_duplicate() and gimp_item_convert(). This is a relict
	from the time when only the bottom layer was allowed to have no
	alpha channel.

	* app/actions/channels-commands.c
	* app/actions/layers-commands.c
	* app/actions/vectors-commands.c
	* app/core/gimpchannel.c
	* app/core/gimpdrawable.c
	* app/core/gimpimage-duplicate.c
	* app/core/gimpimage-merge.c
	* app/core/gimpimage-quick-mask.c
	* app/core/gimplayer.c
	* app/core/gimplayermask.c
	* app/core/gimpselection.c
	* app/display/gimpdisplayshell-dnd.c
	* app/file/file-open.c
	* app/pdb/channel_cmds.c
	* app/pdb/layer_cmds.c
	* app/text/gimptextlayer.c
	* app/vectors/gimpvectors.c
	* app/vectors/gimpvectorsmodundo.c
	* app/widgets/gimpchanneltreeview.c
	* app/widgets/gimpitemtreeview.c
	* app/widgets/gimplayertreeview.c
	* app/widgets/gimptoolbox-dnd.c
	* tools/pdbgen/pdb/channel.pdb
	* tools/pdbgen/pdb/layer.pdb: changed accordingly.

svn path=/trunk/; revision=24570
2008-01-08 11:46:15 +00:00
Michael Natterer 147f3417fd reordered and renamed parameters to make more sense.
2008-01-07  Michael Natterer  <mitch@gimp.org>

	* app/core/gimplayer.c (gimp_layer_transform_color): reordered
	and renamed parameters to make more sense.


svn path=/trunk/; revision=24562
2008-01-07 18:53:55 +00:00
Michael Natterer 75061fccfd app/actions/channels-commands.c app/actions/colormap-actions.c
2007-12-25  Michael Natterer  <mitch@gimp.org>

	* app/actions/channels-commands.c
	* app/actions/colormap-actions.c
	* app/actions/colormap-commands.c
	* app/actions/image-commands.c
	* app/core/gimp-edit.c
	* app/core/gimpdrawable-preview.c
	* app/core/gimpimage-colorhash.c
	* app/core/gimpimage-colormap.c
	* app/core/gimpimage-convert.c
	* app/core/gimpimage-crop.c
	* app/core/gimpimage-duplicate.c
	* app/core/gimpimage-flip.c
	* app/core/gimpimage-guides.c
	* app/core/gimpimage-merge.c
	* app/core/gimpimage-preview.c
	* app/core/gimpimage-quick-mask.c
	* app/core/gimpimage-resize.c
	* app/core/gimpimage-rotate.c
	* app/core/gimpimage-sample-points.c
	* app/core/gimpimage-scale.c
	* app/core/gimpimage-snap.c
	* app/core/gimpimage.c
	* app/core/gimpimagefile.c
	* app/core/gimpimageundo.c
	* app/core/gimpitem-preview.c
	* app/core/gimpitem.c
	* app/core/gimplayer.c
	* app/core/gimppalette-import.c
	* app/core/gimpprojection-construct.c
	* app/core/gimpprojection.c
	* app/core/gimpselection.c
	* app/core/gimpundo.c
	* app/dialogs/layer-options-dialog.c
	* app/dialogs/print-size-dialog.c
	* app/display/gimpdisplay.c
	* app/display/gimpdisplayshell-draw.c
	* app/display/gimpdisplayshell-scale.c
	* app/display/gimpdisplayshell-scroll.c
	* app/display/gimpdisplayshell-title.c
	* app/display/gimpdisplayshell-transform.c
	* app/display/gimpdisplayshell.c
	* app/display/gimpstatusbar.c
	* app/file/file-open.c
	* app/paint/gimppaintoptions.c
	* app/tools/gimpaligntool.c
	* app/tools/gimpcolortool.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimpiscissorstool.c
	* app/tools/gimpmeasuretool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimpperspectiveclonetool.c
	* app/tools/gimprectangleselecttool.c
	* app/tools/gimprectangletool.c
	* app/tools/gimprotatetool.c
	* app/vectors/gimpvectors-export.c
	* app/vectors/gimpvectors-import.c
	* app/vectors/gimpvectors.c
	* app/widgets/gimpimagepropview.c
	* app/widgets/gimpnavigationview.c
	* app/widgets/gimpselectioneditor.c
	* app/widgets/gimpviewrendererdrawable.c
	* app/widgets/gimpviewrendererimage.c
	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c
	* tools/pdbgen/pdb/guides.pdb
	* tools/pdbgen/pdb/image.pdb: use accessors for many image properties.

	* app/pdb/guides_cmds.c
	* app/pdb/image_cmds.c: regenerated.


svn path=/trunk/; revision=24432
2007-12-25 16:21:40 +00:00
Michael Natterer ecb2c46dc8 app/actions/layers-commands.c app/core/gimpchannel-combine.c
2007-12-23  Michael Natterer  <mitch@gimp.org>

	* app/actions/layers-commands.c
	* app/core/gimpchannel-combine.c
	* app/core/gimpchannel-select.c
	* app/core/gimpchannel.c
	* app/core/gimpdrawable-convert.c
	* app/core/gimpdrawable.c
	* app/core/gimpdrawablemodundo.c
	* app/core/gimpfloatingselundo.c
	* app/core/gimpimage-convert.c
	* app/core/gimpimage-merge.c
	* app/core/gimpimage-resize.c
	* app/core/gimpimage.c
	* app/core/gimpitem-preview.c
	* app/core/gimpitem.c
	* app/core/gimplayer-floating-sel.c
	* app/core/gimplayer.c
	* app/core/gimplayermask.c
	* app/core/gimplayerundo.c
	* app/core/gimpmaskundo.c
	* app/core/gimppalette-import.c
	* app/core/gimpprojection-construct.c
	* app/core/gimpselection.c
	* app/dialogs/offset-dialog.c
	* app/text/gimptextlayer-xcf.c
	* app/text/gimptextlayer.c
	* app/vectors/gimpvectors-compat.c
	* app/vectors/gimpvectors.c
	* app/vectors/gimpvectorsmodundo.c
	* app/widgets/gimplayertreeview.c
	* app/widgets/gimpviewrendererdrawable.c
	* app/widgets/gimpviewrenderervectors.c: use accessors for item,
	layer, channel and mask attributes.


svn path=/trunk/; revision=24429
2007-12-23 16:58:41 +00:00
Michael Natterer dfaf761dc0 added GError to GimpItem::rename().
2007-12-12  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpitem.[ch]: added GError to GimpItem::rename().

	* app/core/gimplayer.c
	* app/core/gimplayermask.c: set errors when renaming is impossible.

	* app/text/gimptextlayer.c
	* app/core/gimpimage-quick-mask.c: changed accordingly.

	* app/actions/channels-commands.c
	* app/actions/layers-commands.c
	* app/actions/vectors-commands.c
	* app/widgets/gimpitemtreeview.c: handle the returned errors.

	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/vectors.pdb: pass the error.

	* app/pdb/drawable_cmds.c
	* app/pdb/vectors_cmds.c: regenerated.


svn path=/trunk/; revision=24338
2007-12-12 13:57:11 +00:00
Michael Natterer 543302f551 Move some gimp_message() calls where they belong:
2007-12-06  Michael Natterer  <mitch@gimp.org>

	Move some gimp_message() calls where they belong:

	* app/core/gimplayer-floating-sel.[ch]: removed unreachable
	gimp_message() in floating_sel_anchor() and added GError parameter
	to floating_sel_to_layer().

	* app/core/gimplayer.c
	* app/core/gimpimage-quick-mask.c
	* app/actions/layers-commands.c: pass NULL or an error as
	appropriate and show the error message.

	* tools/pdbgen/pdb/floating_sel.pdb: set the error when the passed
	layer was no floating selection.

	* app/pdb/floating_sel_cmds.c: regenerated.


svn path=/trunk/; revision=24272
2007-12-06 18:00:10 +00:00
Michael Natterer dd80b4c263 added new API gimp_drawable_estimate_memsize() and virtual function
2007-12-04  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable.[ch]: added new API
	gimp_drawable_estimate_memsize() and virtual function
	GimpDrawable::estimate_memsize() which estimate the memsize of a
	drawable after scaling/resizing.

	* app/core/gimplayer.c: implement the virtual function and take
	the layer mask into account.

	* app/core/gimpimage-item-list.[ch] (gimp_image_item_list_get_list):
	added const qualifiers.

	* app/core/gimpimage-scale.c (gimp_image_scale_check): use the new
	function to correctly estimate the new size instead of scaling the
	drawables' memsizes including all constant parts. Fixes bug #329468.

	* app/gimp-log.[ch]: added IMAGE_SCALE log domain.

	* app/core/gimpimage-scale.c: use it here for debugging output.


svn path=/trunk/; revision=24260
2007-12-04 11:30:31 +00:00
Michael Natterer 036085fd9e app/base/temp-buf.c app/base/tile-manager.c accept NULL in all
2007-11-16  Michael Natterer  <mitch@gimp.org>

	* app/base/temp-buf.c
	* app/base/tile-manager.c
	* app/core/gimpobject.c: accept NULL in all get_memsize() functions.

	* app/core/gimp-utils.[ch]: ditto. Added gimp_string_get_memsize().

	* app/core/gimp.c
	* app/core/gimpbrush.c
	* app/core/gimpbuffer.c
	* app/core/gimpcontainer.c
	* app/core/gimpcontext.c
	* app/core/gimpdata.c
	* app/core/gimpdrawable.c
	* app/core/gimpdrawablemodundo.c
	* app/core/gimpdrawableundo.c
	* app/core/gimpimage.c
	* app/core/gimpitempropundo.c
	* app/core/gimplayer.c
	* app/core/gimpmaskundo.c
	* app/core/gimppalette.c
	* app/core/gimpparasitelist.c
	* app/core/gimppattern.c
	* app/core/gimppreviewcache.c
	* app/core/gimpundo.c
	* app/core/gimpundostack.c
	* app/core/gimpviewable.c
	* app/pdb/gimpprocedure.c
	* app/plug-in/gimpplugindef.c
	* app/plug-in/gimppluginmanager.c
	* app/plug-in/gimppluginprocedure.c
	* app/text/gimptext.c
	* app/text/gimptextlayer.c
	* app/text/gimptextundo.c
	* app/vectors/gimpvectorsmodundo.c: simplify
	GimpObject::get_memsize() implementations accordingly.

	* app/core/gimpimageundo.c: ditto. Always keep around colormaps in
	chunks of GIMP_IMAGE_COLORMAP_SIZE to be coonsistent with the
	other colormap handling code.


svn path=/trunk/; revision=24174
2007-11-16 18:19:30 +00:00
Michael Natterer 08d38cea82 Make layer masks work consistently on layers without alpha. Fixes bug
2007-09-15  Michael Natterer  <mitch@gimp.org>

	Make layer masks work consistently on layers without alpha.
	Fixes bug #475548.

	* app/core/gimplayer.c (gimp_layer_apply_mask): changed to work
	on layers without alpha.

	* app/actions/layers-commands.c (layers_add_mask_response): don't
	automatically add an alpha channel when adding a layer mask.


svn path=/trunk/; revision=23555
2007-09-15 19:23:20 +00:00
Sven Neumann 1954ee81fe use the offsets module TILE_WIDTH and TILE_HEIGHT instead of doing the
2007-09-12  Sven Neumann  <sven@gimp.org>

	* app/base/tile.c (tile_data_pointer): use the offsets module
	TILE_WIDTH and TILE_HEIGHT instead of doing the module operation
	in each and every caller.

	* app/base/boundary.c
	* app/base/pixel-region.c
	* app/base/tile-manager.c
	* app/core/gimpchannel.c
	* app/core/gimpdrawable-blend.c
	* app/core/gimpdrawable.c
	* app/core/gimpimage-contiguous-region.c
	* app/core/gimplayer.c
	* app/display/gimpdisplayshell-render.c
	* app/paint-funcs/paint-funcs.c
	* app/paint/gimppaintcore.c
	* app/tools/gimpiscissorstool.c: changed accordingly.


svn path=/trunk/; revision=23515
2007-09-12 18:29:11 +00:00
Sven Neumann 77b7161a32 app/core/gimp-transform-region.[ch] app/core/gimpchannel.c
2007-09-10  Sven Neumann  <sven@gimp.org>

	* app/core/gimp-transform-region.[ch]
	* app/core/gimpchannel.c
	* app/core/gimpdrawable-transform.[ch]
	* app/core/gimpdrawable.c
	* app/core/gimpimage-item-list.[ch]
	* app/core/gimpitem-linked.[ch]
	* app/core/gimpitem.[ch]
	* app/core/gimplayer.c
	* app/paint/gimpperspectiveclone.c
	* app/vectors/gimpvectors.c: removed supersample parameter from
	transform functions and perform it depending on the interpolation
	type (bug #473265).

	* app/tools/gimptransformoptions.[ch]
	* app/tools/gimptransformtool.c: removed Supersample toggle from
	the transform tool options.

	* tools/pdbgen/pdb/drawable_transform.pdb
	* tools/pdbgen/pdb/transform_tools.pdb: document that the
	supersample parameter is unused and improved documentation of the
	recursion-level parameter.

	* app/pdb/transform_tools_cmds.c
	* app/pdb/drawable_transform_cmds.c
	* libgimp/gimpdrawabletransform_pdb.c: regenerated.

svn path=/trunk/; revision=23494
2007-09-10 15:29:48 +00:00
Sven Neumann ce489b17ae allow adding a mask to a layer without alpha channel (bug #316207).
2007-03-22  Sven Neumann  <sven@gimp.org>

	* app/core/gimplayer.c (gimp_layer_add_mask): allow adding a mask
	to a layer without alpha channel (bug #316207).

svn path=/trunk/; revision=22163
2007-03-22 17:58:42 +00:00
Mukund Sivaraman f0cff0ff92 app/core/Makefile.am app/core/gimp-transform-resize.c
2006-12-24  Mukund Sivaraman  <muks@mukund.org>

        * app/core/Makefile.am
        * app/core/gimp-transform-resize.c
        * app/core/gimpchannel.c
        * app/core/gimpdrawable-transform.c
        * app/core/gimpdrawable-transform.h
        * app/core/gimpdrawable.c
        * app/core/gimpimage-item-list.c
        * app/core/gimpimage-item-list.h
        * app/core/gimpitem-linked.c
        * app/core/gimpitem-linked.h
        * app/core/gimpitem.c
        * app/core/gimpitem.h
        * app/core/gimplayer.c
        * app/pdb/drawable_transform_cmds.c
        * app/text/gimptextlayer-transform.c
        * app/text/gimptextlayer-transform.h
        * app/tools/gimptransformoptions.c
        * app/tools/gimptransformtool.c
        * app/vectors/gimpvectors.c
        * libgimp/gimpdrawabletransform_pdb.c
        * libgimp/gimpdrawabletransform_pdb.h
        * libgimp/gimpenums.c.tail
        * libgimpbase/gimpbase.def
        * libgimpbase/gimpbaseenums.c
        * libgimpbase/gimpbaseenums.h
        * tools/pdbgen/enums.pl
        * tools/pdbgen/pdb/drawable_transform.pdb: implemented UI and PDB
        for new clipping modes for affine transforms (crop to largest
        rectangle, and crop to largest rectangle with the source's aspect
        ratio); fixed various bugs in the largest rectangle computation
        code; set padding to 6 in the transformation tool options.
2006-12-24 16:48:08 +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 dd6f5d711a changed GimpDrawable parameter to "GimpImageType dest_type".
2006-10-26  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpimage.[ch]
	(gimp_image_transform_rgb)
	(gimp_image_transform_color)
	(gimp_image_transform_temp_buf): changed GimpDrawable parameter to
	"GimpImageType dest_type".

	(gimp_image_get_foreground)
	(gimp_image_get_background): ditto and reordered parameters.

	* app/core/gimp-edit.c
	* app/core/gimpdrawable-bucket-fill.c
	* app/core/gimpdrawable-stroke.c
	* app/core/gimpdrawable-transform.c
	* app/core/gimpdrawable.c
	* app/core/gimpimage-merge.c
	* app/core/gimplayer.c
	* app/core/gimpselection.c
	* app/paint/gimpbrushcore.c
	* app/paint/gimpclone.c
	* app/paint/gimperaser.c
	* app/paint/gimpheal.c
	* app/paint/gimpink.c
	* app/paint/gimppaintbrush.c: changed accordingly.

	* app/core/gimpdrawable-transform.c
	(gimp_drawable_transform_tiles_affine): set the progress to 1.0
	when done, some tiny cleanups around lanczos.
2006-10-25 22:14:36 +00:00
Michael Natterer b72ffb8b49 removed the "floating" flag and the floating/sink API.
2006-10-16  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpitem.[ch]: removed the "floating" flag and the
	floating/sink API.

	(gimp_item_init): call g_object_force_floating() instead.

	* app/core/gimpimage.c
	* app/core/gimplayer.c
	* app/xcf/xcf-load.c
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/image.pdb: use combinations of
	g_object_ref_sink() and g_object_unref() instead of
	gimp_item_sink(). Use g_object_is_floating() instead of
	gimp_item_is_floating().

	* app/pdb/drawable_cmds.c
	* app/pdb/image_cmds.c: regenerated.
2006-10-16 17:09:17 +00:00
Sven Neumann d34ff5537d libgimpbase/Makefile.am libgimpbase/gimpbase.h added new files that hold
2006-08-29  Sven Neumann  <sven@gimp.org>

	* libgimpbase/Makefile.am
	* libgimpbase/gimpbase.h
	* libgimpbase/gimprectangle.[ch]: added new files that hold
	gimp_rectangle_intersect(), factored out of the core.

	* libgimpbase/gimpbase.def: updated.

	* app/core/gimp-edit.c
	* app/core/gimp-utils.c
	* app/core/gimp-utils.h
	* app/core/gimpchannel-combine.c
	* app/core/gimpdrawable-foreground-extract.c
	* app/core/gimpdrawable-transform.c
	* app/core/gimpdrawable.c
	* app/core/gimpimage-preview.c
	* app/core/gimplayer.c
	* app/core/gimpscanconvert.c
	* app/display/gimpdisplayshell-draw.c: changed includes accordingly.

	* libgimp/gimpdrawablepreview.c: don't duplicate
	gimp_rectangle_intersect() here, use the function in libgimpbase.

	* app/base/siox.c: use gimp_rectangle_intersect() to reduce the
	working area to the region of interest. Fixes bug #340422.
2006-08-29 14:46:32 +00:00
Sven Neumann 48d054e8d4 added new function gimp_message() as a replacement for g_message(). Part
2006-08-08  Sven Neumann  <sven@gimp.org>

	* app/core/gimp.[ch]: added new function gimp_message() as a
	replacement for g_message(). Part of the fix for bug #347214.

	* app/actions/data-commands.c
	* app/actions/documents-commands.c
	* app/actions/file-commands.c
	* app/actions/layers-commands.c
	* app/core/gimpimage-convert.c
	* app/core/gimpimagefile.c
	* app/core/gimpitem.c
	* app/core/gimplayer.c
	* app/dialogs/file-open-dialog.c
	* app/dialogs/file-open-location-dialog.c
	* app/dialogs/file-save-dialog.c
	* app/display/gimpdisplayshell-dnd.c
	* app/pdb/gimppdb.c
	* app/tools/gimpblendtool.c
	* 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
	* app/widgets/gimpwidgets-utils.c
	* app/xcf/xcf-load.c
	* app/xcf/xcf-private.h
	* app/xcf/xcf-save.c
	* app/xcf/xcf.c
	* tools/pdbgen/pdb/brush.pdb
	* tools/pdbgen/pdb/gradient.pdb
	* tools/pdbgen/pdb/image.pdb
	* tools/pdbgen/pdb/palette.pdb: use gimp_message() instead of
	gimp_message() whenever we have a GimpProgress.

	* app/pdb/brush_cmds.c
	* app/pdb/gradient_cmds.c
	* app/pdb/image_cmds.c
	* app/pdb/palette_cmds.c: regenerated.
2006-08-08 21:06:36 +00:00
Sven Neumann 6ebcf700d1 removed erroneous semicolon after G_DEFINE_TYPE macros.
2006-05-15  Sven Neumann  <sven@gimp.org>

	* app/*/*.c:
	* lib*/*.c: removed erroneous semicolon after G_DEFINE_TYPE macros.
2006-05-15 09:46:31 +00:00
Michael Natterer 1217dc8d07 Allow to initialize a new layer mask with any of the image's channels.
2006-05-14  Michael Natterer  <mitch@gimp.org>

	Allow to initialize a new layer mask with any of the image's
	channels. Fixes bug #310207.

	* libgimpbase/gimpbaseenums.h (enum GimpAddMaskType): added
	value GIMP_ADD_CHANNEL_MASK.

	* libgimpbase/gimpbaseenums.c
	* tools/pdbgen/enums.pl: regenerated.

	* app/core/gimplayer.[ch] (gimp_layer_create_mask): added
	GimpChannel* parameter. Hacked the GIMP_ADD_SELECTION_MASK code a
	bit so it can handle GIMP_ADD_CHANNEL_MASK too. Cleaned up the
	function a bit.

	* app/dialogs/layer-add-mask-dialog.[ch]: added a menu of the
	image's channels.

	* app/actions/layers-commands.c (layers_add_mask_response): pass
	the channel selected in the menu to gimp_layer_create_mask().

	* tools/pdbgen/pdb/layer.pdb (layer_create_mask): use the image's
	active channel when GIMP_ADD_CHANNEL_MASK is passed. Fail if there
	is no active channel.

	* app/pdb/layer_cmds.c: regenerated.
2006-05-14 16:24:31 +00:00
Michael Natterer 8ffd5bb0ff add an alpha channel if the layer has none and interpolation is requested.
2006-05-13  Michael Natterer  <mitch@gimp.org>

	* app/core/gimplayer.c (gimp_layer_transform): add an alpha
	channel if the layer has none and interpolation is requested.
	Works around bug #315048, the real fix would be to implement
	interpolation on layers without alpha.
2006-05-13 21:49:29 +00:00
Sven Neumann 049872b361 app/*.[ch] converted tabs to spaces.
2006-04-12  Sven Neumann  <sven@gimp.org>

	* app/*.[ch]
	* app/*/*.[ch]: converted tabs to spaces.
2006-04-12 12:49:29 +00:00
Sven Neumann 5fc9bd4096 app/actions/tool-options-commands.c app/core/gimp.c
2006-04-07  Sven Neumann  <sven@gimp.org>

	* app/actions/tool-options-commands.c
	* app/core/gimp.c
	* app/core/gimpbrushpipe.c
	* app/core/gimpbuffer.c
	* app/core/gimpcontext.c
	* app/core/gimpdatafactory.c
	* app/core/gimpgradient-load.c
	* app/core/gimpimage-merge.c
	* app/core/gimpimage-undo-push.c
	* app/core/gimpitem.c
	* app/core/gimplayer.c
	* app/core/gimplayermask.c
	* app/core/gimplist.c
	* app/core/gimppalette.c
	* app/dialogs/template-options-dialog.c
	* app/display/gimpdisplayshell-dnd.c
	* app/file/file-open.c
	* app/paint/gimp-paint.c
	* app/widgets/gimpdataeditor.c
	* app/widgets/gimpdatafactoryview.c
	* app/widgets/gimplayertreeview.c
	* app/widgets/gimptemplateview.c
	* app/widgets/gimptoolbox-dnd.c: use gimp_object_set_static_name()
	and gimp_object_take_name() where appropriate.
2006-04-07 10:51:22 +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
2 3d9837eb59 remove extra semicolon; fix for bug #330882 from Jens Granseuer.
2006-02-12  <weskaggs@primate.ucdavis.edu>

	* app/core/gimplayer.c: remove extra semicolon; fix for
	bug #330882 from Jens Granseuer.
2006-02-12 16:07:39 +00:00
Michael Natterer e1ceed5147 define GIMP_PARAM_STATIC_STRINGS which is G_PARAM_STATIC_NAME|NICK|BLURB.
2006-01-18  Michael Natterer  <mitch@gimp.org>

	* app/config/config-types.c: define GIMP_PARAM_STATIC_STRINGS
	which is G_PARAM_STATIC_NAME|NICK|BLURB. Also define
	GIMP_PARAM_READABLE, _WRITABLE and _READWRITE which include
	GIMP_PARAM_STATIC_STRINGS.

	* app/*/*.c: use them for all object properties so their
	strings are not copied.
2006-01-18 20:29:40 +00:00
Michael Natterer 54c86f97f7 app/core/gimpchannel.c app/core/gimpdrawable.c app/core/gimplayer.c
2005-12-23  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpchannel.c
	* app/core/gimpdrawable.c
	* app/core/gimplayer.c
	* app/core/gimplayermask.c
	* app/text/gimptextlayer.c
	* app/vectors/gimpvectors.c: moved variables to local scopes in
	implementations of GimpItem::duplicate()
2005-12-23 01:15:19 +00:00
Michael Natterer 0d4a10fee4 app/config/*.c app/core/*.c app/display/*.c app/text/*.c port to
2005-12-10  Michael Natterer  <mitch@gimp.org>

	* app/config/*.c
	* app/core/*.c
	* app/display/*.c
	* app/text/*.c
	* app/vectors/*.c: port to G_DEFINE_TYPE() and friends. Some related
	core reordering and cleanup.
2005-12-10 19:24:36 +00:00
Michael Natterer 218c03c796 gimp_layer_transform_color() wants the destination image passed, not the
2005-11-16  Michael Natterer  <mitch@gimp.org>

	* app/core/gimplayer.c (gimp_layer_convert):
	gimp_layer_transform_color() wants the destination image passed,
	not the source image.
2005-11-16 17:59:50 +00:00
Michael Natterer 34697840ed set the "tooltip" return value to NULL before calling the virtual
2005-10-10  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpviewable.c (gimp_viewable_get_description): set the
	"tooltip" return value to NULL before calling the virtual function.

	* app/core/gimpbrush.c
	* app/core/gimpbuffer.c
	* app/core/gimpchannel.c
	* app/core/gimplayer.c
	* app/core/gimppaintinfo.c
	* app/core/gimppalette.c
	* app/core/gimppattern.c
	* app/core/gimptoolinfo.c (get_description): don't do it here.

	* app/core/gimpbuffer.c
	* app/core/gimppaintinfo.c: untabbify, cleanup.

	* app/core/gimpobject.c: emit "notify::name" whenerver the name
	changes, clenup.
2005-10-09 23:05:25 +00:00
Michael Natterer 09454fb2a4 some general cleanup.
2005-09-03  Michael Natterer  <mitch@gimp.org>

	* app/base/pixel-region.[ch]: some general cleanup.

	(pixel_region_init_temp_buf)
	(pixel_region_init_data): new functions which initialize pixel
	regions on TempBufs and on raw contiguous arrays of pixel data.

	(pixel_region_configure): fixed a bug that has probably been there
	forever: when processing contiguous (non-tiled) data, interpret
	the original x and y coordinates of the region as offsets into
	the data. Before this fix, the initial x and y were simply ignored
	(by using them in a broken way), thus always forcing the upper
	left corner of the region being the beginning of the passed data.

	Lots of code was working around this problem by setting the
	pixel_region's data pointer to the proper starting pixel of the
	region in the middle the buffer.

	* libgimp/gimppixelrgn.c: some general cleanup.

	(gimp_pixel_rgn_configure): same fix as above. Fortunately, nobody
	seems to know that libgimp pixel regions can be used on arrays of
	data, just as core ones. Only two plug-ins were using this
	feature, and they are antique and written by spencer and federico,
	respectively. They both don't use offsets into the buffers and are
	not affected by this change. It's highly unlikely that anybody out
	there knows/uses this feature, so it can IMHO be safely changed.

	* app/base/temp-buf.c
	* app/core/gimpbuffer.c
	* app/core/gimpdrawable-combine.c
	* app/core/gimpdrawable-preview.c
	* app/core/gimpimage-preview.c
	* app/core/gimplayer.c
	* app/paint/gimpbrushcore.c
	* app/paint/gimpclone.c
	* app/paint/gimpconvolve.c
	* app/paint/gimpdodgeburn.c
	* app/paint/gimppaintcore.c
	* app/paint/gimpsmudge.c
	* app/tools/gimpiscissorstool.c
	* app/tools/gimppainttool.c: use the pixel_region_init_foo()
	functions instead of initializing regions of TempBufs and raw data
	manually. Removed lots of workarounds for the broken offset
	handling. The changed places of code are much more readable now.
2005-09-03 17:16:58 +00:00
Sven Neumann 21829c4431 take image type instead of basetype of the source drawable. Handle
2005-08-09  Sven Neumann  <sven@gimp.org>

	* app/core/gimplayer.c (gimp_layer_transform_color): take image
	type instead of basetype of the source drawable. Handle conversion
	from drawables without alpha channel.
	(gimp_layer_new_from_region): handle source regions without alpha.
2005-08-09 00:07:21 +00:00
Michael Natterer 4c6d9ddd78 new function.
2005-08-07  Michael Natterer  <mitch@gimp.org>

	* app/core/gimplayer.[ch] (gimp_layer_flatten): new function.

	* app/actions/layers-actions.c
	* app/actions/layers-commands.[ch]
	* app/widgets/gimphelp-ids.h
	* menus/image-menu.xml.in
	* menus/layers-menu.xml: added "Remove Alpha Channel" action,
	action callback, help ID and menu items. Fixes bug #309762.
2005-08-07 16:38:35 +00:00
Michael Natterer d64bf3564f added GimpPickable::get_opacity_at()
2005-07-11  Michael Natterer  <mitch@gimp.org>

	* app/core/gimppickable.[ch]: added GimpPickable::get_opacity_at()

	* app/core/gimpchannel.[ch]: removed gimp_channel_value() and
	implement ::get_opacity_at() instead.

	* app/core/gimplayer.[ch]: removed gimp_layer_pick_correlate()
	and implement ::get_opacity_at() instead.

	* app/core/gimpselection.c: GimpChannel::value() doesn't exist
	any more.

	* app/core/gimpprojection.c: implement ::get_opacity_at(), always
	returns OPAQUE.

	* app/core/gimpimage.c
	* app/tools/gimpbucketfilltool.c
	* app/tools/gimpclonetool.c
	* app/tools/gimpfliptool.c
	* app/tools/gimpiscissorstool.c
	* app/tools/gimpnewrectselecttool.c
	* app/tools/gimprectangletool.c
	* app/tools/gimpselectiontool.c
	* app/tools/gimptransformtool.c
	* tools/pdbgen/pdb/selection.pdb: changed accordingly.

	* app/pdb/selection_cmds.c: regenerated.
2005-07-11 19:21:52 +00:00
Michael Natterer fea229090f added read-only properties "opacity", "mode" and "lock-alpha".
2005-07-11  Michael Natterer  <mitch@gimp.org>

	* app/core/gimplayer.c: added read-only properties "opacity",
	"mode" and "lock-alpha".
2005-07-11 16:46:28 +00:00
Michael Natterer 20b4769cf5 app/actions/layers-actions.c app/actions/layers-commands.[ch]
2005-07-10  Michael Natterer  <mitch@gimp.org>

	* app/actions/layers-actions.c
	* app/actions/layers-commands.[ch]
	* app/core/core-enums.[ch]
	* app/core/gimpimage-undo-push.[ch]
	* app/core/gimplayer-floating-sel.c
	* app/core/gimplayer.[ch]
	* app/text/gimptextlayer-xcf.c
	* app/widgets/gimphelp-ids.h
	* app/widgets/gimplayertreeview.[ch]
	* app/xcf/xcf-load.c
	* app/xcf/xcf-private.h
	* app/xcf/xcf-save.c
	* tools/pdbgen/pdb/layer.pdb
	* menus/image-menu.xml.in
	* libgimp/gimp.def: did a global s/preserve_trans/lock_alpha/ in
	preparation for more layer locking flags.

	* app/pdb/procedural_db.c
	* libgimp/gimplayer.[ch]: added compat stuff for preserve_trans.

	* app/pdb/layer_cmds.c
	* libgimp/gimplayer_pdb.[ch]: regenerated.

	* plug-ins/common/colortoalpha.c
	* plug-ins/common/iwarp.c
	* plug-ins/common/psd.c
	* plug-ins/common/psd_save.c
	* plug-ins/common/psp.c
	* plug-ins/common/rotate.c
	* plug-ins/common/threshold_alpha.c
	* plug-ins/common/vpropagate.c
	* plug-ins/script-fu/scripts/3d-outline.scm
	* plug-ins/script-fu/scripts/alien-glow-bar.scm
	* plug-ins/script-fu/scripts/alien-glow-bullet.scm
	* plug-ins/script-fu/scripts/alien-glow-logo.scm
	* plug-ins/script-fu/scripts/basic1-logo.scm
	* plug-ins/script-fu/scripts/basic2-logo.scm
	* plug-ins/script-fu/scripts/beveled-pattern-button.scm
	* plug-ins/script-fu/scripts/blend-anim.scm
	* plug-ins/script-fu/scripts/blended-logo.scm
	* plug-ins/script-fu/scripts/bovinated-logo.scm
	* plug-ins/script-fu/scripts/burn-in-anim.scm
	* plug-ins/script-fu/scripts/carved-logo.scm
	* plug-ins/script-fu/scripts/chalk.scm
	* plug-ins/script-fu/scripts/chip-away.scm
	* plug-ins/script-fu/scripts/comic-logo.scm
	* plug-ins/script-fu/scripts/coolmetal-logo.scm
	* plug-ins/script-fu/scripts/crystal-logo.scm
	* plug-ins/script-fu/scripts/drop-shadow.scm
	* plug-ins/script-fu/scripts/gimp-headers.scm
	* plug-ins/script-fu/scripts/gimp-labels.scm
	* plug-ins/script-fu/scripts/glowing-logo.scm
	* plug-ins/script-fu/scripts/gradient-bevel-logo.scm
	* plug-ins/script-fu/scripts/image-structure.scm
	* plug-ins/script-fu/scripts/neon-logo.scm
	* plug-ins/script-fu/scripts/perspective-shadow.scm
	* plug-ins/script-fu/scripts/starburst-logo.scm
	* plug-ins/script-fu/scripts/starscape-logo.scm
	* plug-ins/script-fu/scripts/textured-logo.scm
	* plug-ins/script-fu/scripts/title-header.scm
	* plug-ins/script-fu/scripts/waves-anim.scm
	* plug-ins/xjt/xjt.c: changed accordingly.
2005-07-10 21:17:22 +00:00
Michael Natterer 9b9052b866 removed if(image) checks where the image can't be NULL.
2005-07-09  Michael Natterer  <mitch@gimp.org>

	* app/core/gimplayer.c: removed if(image) checks where the image
	can't be NULL.
2005-07-09 21:47:54 +00:00
Michael Natterer 4cded149d9 copy the alpha channel from the correct source.
2005-06-13  Michael Natterer  <mitch@gimp.org>

	* app/core/gimplayer.c (gimp_layer_transform_color): copy the
	alpha channel from the correct source.
2005-06-13 11:52:00 +00:00
Sven Neumann 3ca90a182e Use the canonical form for signal names in lots of places (but by far not
2005-05-27  Sven Neumann  <sven@gimp.org>

	* (lots of files): Use the canonical form for signal names in lots
	of places (but by far not all).
2005-05-27 13:05:26 +00:00
Sven Neumann 21a16899da fixed gtk-doc comment.
2005-04-13  Sven Neumann  <sven@gimp.org>

	* app/core/gimplayer.c: fixed gtk-doc comment.
2005-04-13 17:45:53 +00:00
Michael Natterer 7609645970 Implement dragging and dropping in any GdkPixbuf supported format. Fixes
2005-04-09  Michael Natterer  <mitch@gimp.org>

	Implement dragging and dropping in any GdkPixbuf supported
	format. Fixes bug #172794 and bug #172795.

	* app/core/gimplayer.[ch] (gimp_layer_new_from_region): new
	function which contains all stuff that was in
	gimp_layer_new_from_tiles().

	(gimp_layer_new_from_tiles): use above function.
	(gimp_layer_new_from_pixbuf): new function.

	* app/widgets/Makefile.am
	* app/widgets/gimppixbuf.[ch]: new files containing GdkPixbuf
	utility functions for clipboard and DnD.

	* app/widgets/gimpselectiondata.[ch]: removed
	gimp_selection_data_set,get_pixbuf(), GTK+ provides the same API.
	Also removed GdkAtom parameters all over the place because it's
	always the same as selection_data->target.

	* app/widgets/gimpclipboard.c: use the new pixbuf utility
	functions and gtk_selection_data_set,get_pixbuf().

	* app/widgets/widgets-enums.h
	* app/widgets/gimpdnd.[ch]: removed never-implemented
	GIMP_DND_TYPE_PNG and added a generic GIMP_DND_TYPE_PIXBUF
	instead. Added API to drag and drop GdkPixbufs which transparently
	converts from/to and GdkPixbuf-supported image format. Removed
	passing around of GdkAtoms, since they were always the same
	as selection_data->target.

	* app/widgets/gimpdnd-xds.[ch]: follow GdkAtom parameter removal.

	* app/widgets/gimpcontainertreeview.[ch]: added virtual function
	GimpContainerTreeView::drop_pixbuf().

	* app/widgets/gimpcontainertreeview-dnd.c: dispatch drop_pixbuf().

	* app/widgets/gimplayertreeview.c: implement drop_pixbuf().

	* app/widgets/gimpdrawabletreeview.c: allow to drag all drawables
	as pixbufs.

	* app/display/gimpdisplayshell-dnd.c: allow dropping of pixbufs.
2005-04-09 17:56:04 +00:00
Sven Neumann 52d6f00e56 app/core/Makefile.am new files holding gimp_drawable_convert_rgb() and
2005-02-18  Sven Neumann  <sven@gimp.org>

	* app/core/Makefile.am
	* app/core/gimpdrawable-convert.[ch]: new files holding
	gimp_drawable_convert_rgb() and gimp_drawable_convert_grayscale()
	moved out of gimpimage-convert.[ch].

	* app/core/gimpchannel.c
	* app/core/gimpimage-convert.[ch]
	* app/core/gimplayer.c: changed accordingly.
2005-02-18 16:16:24 +00:00
Sven Neumann ddf6688fc8 code cleanup.
2005-02-16  Sven Neumann  <sven@gimp.org>

	* app/core/gimplayer.c (gimp_layer_transform_color): code cleanup.
2005-02-15 23:38:59 +00:00
Michael Natterer 4e942377e6 Splitting GimpItem::convert() into two virtual functions was apparently
2005-01-13  Michael Natterer  <mitch@gimp.org>

	Splitting GimpItem::convert() into two virtual functions was
	apparently buggy over-engineering. Reverted that stuff and
	implement item conversion much simpler:

	* app/core/gimpitem.[ch]: have a single virtual function,
	GimpItem::convert(), which takes a newly duplicated item and the
	destination image.

	(gimp_item_convert): simply call GimpItem::convert() on the result
	of gimp_item_duplicate().

	(gimp_item_real_convert): set the item's new image.

	* app/core/gimplayer.c (gimp_layer_convert)
	* app/vectors/gimpvectors.c (gimp_vectors_convert): changed
	accordingly and chain up after, not before doing our own stuff
	so the old image is still available as item->image for stuff
	like colormap conversion. Fixes bug #163879.
2005-01-13 18:17:24 +00:00
Michael Natterer 0527989edf Item conversion depends on the old *and* the new item type, so it can't
2004-12-23  Michael Natterer  <mitch@gimp.org>

	Item conversion depends on the old *and* the new item type, so
	it can't live in the old item's vtable only:

	* app/core/gimpitem.[ch]: split GimpItem::convert() into
	GimpItem::convert_from() (which is called on the old item and
	creates the new item) and GimpItem::convert_to() (which is called
	on the new item). This way functions from the old *and* new items'
	vtables are called and it's possible to convert between item types
	which live on different branches of the class hierarchy or to item
	types which live further down the class tree than the old item.

	(gimp_item_convert): call ::convert_to() on the new item created
	by ::convert_from().

	* app/vectors/gimpvectors.c: changed ::convert() implementation
	to ::convert_from().

	* app/core/gimplayer.c: changed ::convert() to ::convert_to().
	Fixes bug #161877.
2004-12-23 11:53:14 +00:00
Michael Natterer 0d5df41904 app/core/gimpchannel-select.c app/core/gimpchannel.c
2004-11-16  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpchannel-select.c
	* app/core/gimpchannel.c
	* app/core/gimpdrawable-desaturate.c
	* app/core/gimpdrawable-equalize.c
	* app/core/gimpdrawable-histogram.c
	* app/core/gimpdrawable-invert.c
	* app/core/gimpdrawable-levels.c
	* app/core/gimpdrawable-offset.c
	* app/core/gimpdrawable-stroke.c
	* app/core/gimpdrawable-transform.c
	* app/core/gimpdrawable.c
	* app/core/gimpitem-linked.c
	* app/core/gimpitem.c
	* app/core/gimplayer.c
	* app/core/gimpselection.c
	* app/paint/gimppaintcore-stroke.c
	* app/text/gimptextlayer.c: in all functions which somehow
	(explicitely or implicitely) touch undo, either g_return_if_fail()
	on gimp_item_is_attached() or simply don't push an undo step if
	feasible (e.g. for simple stuff like layer opacity).

	* tools/pdbgen/pdb/color.pdb
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/image.pdb
	* tools/pdbgen/pdb/layer.pdb
	* tools/pdbgen/pdb/paint_tools.pdb: let PDB wrappers fail
	accordingly so they don't run into the assertions added above.

	* app/pdb/color_cmds.c
	* app/pdb/drawable_cmds.c
	* app/pdb/image_cmds.c
	* app/pdb/layer_cmds.c
	* app/pdb/paint_tools_cmds.c: regenerated.
2004-11-16 13:41:55 +00:00
Michael Natterer 10d80dac75 removed the hack that was displaying "Floating Selection" instead of the
2004-09-22  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimplayertreeview.c
	(gimp_layer_tree_view_floating_selection_changed): removed the
	hack that was displaying "Floating Selection" instead of the
	floating layer's real name.

	* app/core/gimplayer.c: implement GimpViewable::get_description()
	instead and special case floating selections with a two-line
	text that contains "Floating Selection".

	* app/core/gimplayer-floating-sel.c
	* app/core/gimpimage-undo-push.c: emit "name_changed" on the layer
	when it changes its state from floating to normal or vice versa
	so the views can update accordingly.

	* app/core/gimpselection.c: s/"Selection"/"Floated Layer"/.

	* app/tools/gimpeditselectiontool.c:
	s/"Floating Layer"/"Floating Selection"/.
2004-09-22 12:46:35 +00:00
Sven Neumann 23690346af Improved undo memory calculation for paint operations (bug #153035):
2004-09-19  Sven Neumann  <sven@gimp.org>

	Improved undo memory calculation for paint operations (bug #153035):

	* app/base/tile-manager.[ch] (tile_manager_get_memsize): added a
	"gboolean sparse" parameter to get more accurate results for
	sparse tile-managers.

	* app/core/gimpbuffer.c
	* app/core/gimpdrawable.c
	* app/core/gimpimage-undo-push.c
	* app/core/gimpimage.c
	* app/core/gimplayer.c
	* app/core/gimpprojection.c: changed accordingly.
2004-09-19 19:47:26 +00:00
Michael Natterer 02d2b990f5 Redid the whole internal progress stuff: don't pass around
2004-08-10  Michael Natterer  <mitch@gimp.org>

	Redid the whole internal progress stuff: don't pass around
	progress_callback and progress_data; instead, provide a
	pointer to a GimpProgressInterface which can be implemented
	by a variety of backends.

	Addresses (but not yet fixes) bugs #6010, #97266 and #135185.

	* app/display/Makefile.am
	* app/display/gimpprogress.[ch]: removed the old progress hack.

	* app/core/Makefile.am
	* app/core/core-types.h
	* app/core/gimpprogress.[ch]: implement GimpProgressInterface.

	* app/widgets/Makefile.am
	* app/widgets/widgets-types.h
	* app/widgets/gimpprogressdialog.[ch]: the standalone progress
	dialog as widget implementing GimpProgressInterface.

	* app/display/gimpdisplay.c
	* app/display/gimpstatusbar.[ch]
	* app/widgets/gimpfiledialog.[ch]
	* app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface
	implementation to these classes.

	* app/core/gimp-gui.[ch]
	* app/gui/gui-vtable.c: replaced the old progress vtable entries
	by two new to create and destroy a GimpProgressDialog in case
	no other progress is available.

	* app/pdb/procedural_db.[ch]
	* app/plug-in/plug-in-run.[ch]
	* tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and
	all plug-ins.

	* app/plug-in/plug-in.[ch]
	* app/plug-in/plug-ins.c
	* app/plug-in/plug-in-message.c
	* app/plug-in/plug-in-progress.c: handle the case there the
	plug-in was crated with a progress as well as the case where it
	wasn't.

	* app/app_procs.c
	* app/batch.c
	* app/xcf/xcf.c
	* app/file/file-open.[ch]
	* app/file/file-save.[ch]
	* app/widgets/gimphelp.c
	* app/widgets/gimpbrushselect.c
	* app/widgets/gimpfontselect.c
	* app/widgets/gimpgradientselect.c
	* app/widgets/gimppaletteselect.c
	* app/widgets/gimppatternselect.c: changed accordingly.

	* app/core/gimpimagefile.[ch]
	* app/display/gimpdisplayshell-dnd.c
	* app/gui/file-open-dialog.c
	* app/gui/file-open-location-dialog.c
	* app/gui/file-save-dialog.c
	* app/widgets/gimplayertreeview.c
	* app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file
	related functions. Embed the progress in the file dialog where
	possible.

	* app/core/gimpdrawable-blend.[ch]
	* app/core/gimpdrawable-transform.[ch]
	* app/core/gimpimage-convert.[ch]
	* app/core/gimpimage-flip.[ch]
	* app/core/gimpimage-resize.[ch]
	* app/core/gimpimage-rotate.[ch]
	* app/core/gimpimage-scale.[ch]
	* app/core/gimpitem-linked.[ch]
	* app/core/gimpitem.[ch]
	* app/core/gimpchannel.c
	* app/core/gimpdrawable.c
	* app/core/gimplayer.c
	* app/core/gimpselection.c
	* app/vectors/gimpvectors.c: replaced callback/data by GimpProgress.

	* app/tools/gimpblendtool.c
	* app/tools/gimptransformtool.c
	* app/gui/convert-dialog.c
	* app/actions/documents-commands.c
	* app/actions/file-commands.c
	* app/actions/image-commands.c
	* app/actions/layers-commands.c
	* app/actions/plug-in-commands.c
	* app/actions/vectors-commands.c
	* tools/pdbgen/pdb/convert.pdb
	* tools/pdbgen/pdb/edit.pdb
	* tools/pdbgen/pdb/image.pdb
	* tools/pdbgen/pdb/layer.pdb: changed callers accordingly.

	* app/pdb/*_cmds.c: regenerated.
2004-08-10 18:47:21 +00:00
Sven Neumann 56ac0a4d37 ooops 2004-07-07 15:25:27 +00:00
Sven Neumann b8897d2bfb add an alpha channel if the src tile-manager doesn't have one. Warn on
2004-07-07  Sven Neumann  <sven@gimp.org>

	* app/core/gimplayer.c (gimp_layer_new_from_tiles): add an alpha
	channel if the src tile-manager doesn't have one. Warn on
	unsupported type conversions instead of silently doing the wrong
	thing. Fixes bug #145482.

	* app/core/gimpbuffer.c: cosmetics.
2004-07-07 15:07:17 +00:00
Michael Natterer 49e3657a06 don't set layer->mask's offsets. It is wrong because
2004-06-07  Michael Natterer  <mitch@gimp.org>

	* app/core/gimplayer.c (gimp_layer_set_tiles): don't set
	layer->mask's offsets. It is wrong because GimpDrawable::set_tiles()
	is a lowlevel function which is used by stuff like scale and
	resize which keep the mask in sync explicitely and don't expect it
	to be moved in the middle of chaining up. Fixes bug #143860.
2004-06-07 15:13:54 +00:00
Michael Natterer 1c62ddef4d Long overdue core container cleanup:
2004-05-24  Michael Natterer  <mitch@gimp.org>

	Long overdue core container cleanup:

	* app/core/gimplist.[ch]: added "unique-names" and "sort-func"
	properties and merged the resp. code from GimpDataList into
	GimpList. Removed "policy" parameters from gimp_list_new() and
	added "unique_names". Added new constructor gimp_list_new_weak().
	Made public function gimp_list_uniquefy_name() private.

	* app/core/Makefile.am
	* app/core/core-types.h
	* app/core/gimpdatalist.[ch]: removed. Its functionality is
	entirely in GimpList now.

	* app/core/gimpdata.[ch]: added gimp_data_name_compare() which
	used to live in GimpDataList.

	* app/core/gimp.c
	* app/core/gimpdatafactory.c
	* app/core/gimpimage.c
	* app/core/gimptoolinfo.c
	* app/core/gimpundostack.c
	* app/paint/gimp-paint.c
	* app/tools/gimp-tools.c
	* app/widgets/gimpdevices.c
	* app/widgets/gimptemplateeditor.c
	* app/widgets/gimpundoeditor.c: changed list creation accordingly.

	Made gimp->templates, gimp->named_buffers, tool_info->presets and
	the image's lists of layers, channels and vectors automatically
	ensure unique names.

	* app/widgets/gimptemplateview.c
	* app/actions/file-commands.c
	* app/actions/templates-commands.c
	* app/actions/tool-options-commands.c: removed calls to
	gimp_list_uniquefy_name().

	* app/core/gimpitem.c: removed major insanity where the items
	themselves where ensuring their unique names. Bah!

	* app/core/gimplayer.c (gimp_layer_name_changed): chain up
	conditionally.

	* app/core/gimplayermask.c (gimp_layer_mask_name_changed): removed
	because there is no need any more to keep the parent
	implementation from being invoked.
2004-05-24 10:49:34 +00:00
Michael Natterer 18d9161eea Get rid of the "current_context" which was in fact just a bunch of global
2004-04-15  Michael Natterer  <mitch@gimp.org>

	Get rid of the "current_context" which was in fact just a bunch of
	global variables. Instead, pass the needed context all the way
	from the GUI and the PDB to the core. This is a prerequisite for
	macro recording and generally helps separating the various
	subsystems from each other. Work in progress...

	* app/core/gimp.[ch]: removed member "current_context" and
	gimp_[get|set]_current_context().

	* app/core/gimp-edit.[ch]
	* app/core/gimpdrawable-blend.[ch]
	* app/core/gimpdrawable-bucket-fill.[ch]
	* app/core/gimpdrawable-offset.[ch]
	* app/core/gimpdrawable-transform.[ch]
	* app/core/gimpimage-crop.[ch]
	* app/core/gimpimage-flip.[ch]
	* app/core/gimpimage-merge.[ch]
	* app/core/gimpimage-resize.[ch]
	* app/core/gimpimage-rotate.[ch]
	* app/core/gimpimage.[ch]
	* app/core/gimpimagefile.[ch]
	* app/core/gimpitem-linked.[ch]
	* app/core/gimpitem.[ch]
	* app/core/gimplayer.[ch]
	* app/core/gimpselection.[ch]
	* app/core/gimptemplate.[ch]
	* app/file/file-open.[ch]
	* app/file/file-save.[ch]
	* app/pdb/procedural_db.[ch]
	* app/text/gimptext-compat.[ch]
	* app/text/gimptextlayer-transform.[ch]
	* app/gui/brush-select.[ch]
	* app/gui/font-select.[ch]
	* app/gui/gradient-select.[ch]
	* app/gui/palette-select.[ch]
	* app/gui/pattern-select.[ch]: added tons of "GimpContext *context"
	parameters and use the passed context instead of
	gimp_get_current_context().

	* app/app_procs.c
	* app/batch.c
	* app/core/gimpchannel.c
	* app/core/gimpdrawable.c
	* app/paint/gimperaser.c
	* app/paint/gimppaintbrush.c
	* app/plug-in/plug-in-message.c
	* app/plug-in/plug-ins.c
	* app/text/gimptextlayer.c
	* app/tools/gimpblendtool.c
	* app/tools/gimpbucketfilltool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimpfliptool.c
	* app/tools/gimpinktool.c
	* app/tools/gimptransformtool.c
	* app/vectors/gimpvectors.c
	* app/gui/convert-dialog.c
	* app/gui/drawable-commands.c
	* app/gui/edit-commands.c
	* app/gui/file-commands.c
	* app/gui/file-new-dialog.c
	* app/gui/file-open-dialog.c
	* app/gui/file-save-dialog.c
	* app/gui/image-commands.c
	* app/gui/layers-commands.c
	* app/gui/offset-dialog.c
	* app/gui/select-commands.c
	* app/gui/vectors-commands.c
	* app/widgets/gimpdnd.c
	* app/widgets/gimpdocumentview.c
	* app/widgets/gimphelp.c
	* app/widgets/gimpthumbbox.c: pass gimp_get_user_context() or
	GIMP_CONTEXT(tool_options) or whatever is the right context
	to the changed core functions.

	* tools/pdbgen/app.pl: pass "GimpContext *context" to all
	generated PDB invokers.

	* tools/pdbgen/pdb/brush_select.pdb
	* tools/pdbgen/pdb/brushes.pdb
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/edit.pdb
	* tools/pdbgen/pdb/font_select.pdb
	* tools/pdbgen/pdb/gradient_select.pdb
	* tools/pdbgen/pdb/gradients.pdb
	* tools/pdbgen/pdb/image.pdb
	* tools/pdbgen/pdb/layer.pdb
	* tools/pdbgen/pdb/paint_tools.pdb
	* tools/pdbgen/pdb/palette.pdb
	* tools/pdbgen/pdb/palette_select.pdb
	* tools/pdbgen/pdb/palettes.pdb
	* tools/pdbgen/pdb/paths.pdb
	* tools/pdbgen/pdb/pattern_select.pdb
	* tools/pdbgen/pdb/patterns.pdb
	* tools/pdbgen/pdb/selection.pdb
	* tools/pdbgen/pdb/text_tool.pdb
	* tools/pdbgen/pdb/transform_tools.pdb: pass the new context
	parameter to the changed core functions.

	* app/pdb/*_cmds.c: regenerated.
2004-04-14 23:37:34 +00:00
Michael Natterer 2e61d12ed4 Moved the calls to floating_sel_relax()/rigor() from various places to two
2004-04-13  Michael Natterer  <mitch@gimp.org>

	Moved the calls to floating_sel_relax()/rigor() from various
	places to two single spots in the core where they are actually
	needed. Fixes bug #138356 (which was caused by the projection
	being triggered in the middle of changing the floating selection's
	size or the size of the drawable it is attached to). This commit
	effectively removes floating selection fiddling from the core's
	public API.

	* app/core/gimpdrawable.[ch] (gimp_drawable_has_floating_sel): new
	function which returns TRUE if there is a floating selection
	attached to the drawable.

	* app/core/gimpdrawable.c (gimp_drawable_translate)
	(gimp_drawable_set_tiles_full): if the drawable *has* a floating
	selection, relax/rigor it before/after modifying the drawable.

	* app/core/gimplayer.c (gimp_layer_translate)
	(gimp_layer_set_tiles): if the layer *is* the floating selection,
	relax/rigor it before/after modifying it.

	* app/core/gimpdrawable-transform.c
	* app/core/gimpimage-convert.c
	* app/core/gimpimage-crop.c
	* app/core/gimpimage-flip.c
	* app/core/gimpimage-resize.c
	* app/core/gimpimage-rotate.c
	* app/core/gimpimage-scale.c
	* app/gui/layers-commands.c
	* app/tools/gimpeditselectiontool.c
	* tools/pdbgen/pdb/layer.pdb: removed calls to
	floating_sel_rigor()/relax() all over the place. Also removed
	lots of undo groups which are obsolete now.

	* app/pdb/layer_cmds.c: regenerated.
2004-04-13 13:54:54 +00:00
Michael Natterer 069489fb71 GimpItem undo group cleanup in preparation of fixing bug #138356:
2004-04-13  Michael Natterer  <mitch@gimp.org>

	GimpItem undo group cleanup in preparation of fixing bug #138356:

	* app/core/core-enums.[c]: renamed LAYER_SCALE and LAYER_RESIZE
	undo groups to ITEM_SCALE and ITEM_RESIZE.

	* app/core/gimpitem.[ch]: always push undo groups around
	GimpItem::translate(), scale(), resize(), flip(), rotate() and
	transform(). Added the resp. undo_desc strings to GimpItemClass.

	* app/core/gimpchannel.[ch]
	* app/core/gimpdrawable.[ch]
	* app/core/gimplayer.c: removed all undo groups from
	implementations of the above methods. Removed the undo_desc
	strings which were moved to GimpItemClass.

	* app/core/gimpimage-crop.c
	* app/core/gimpselection.c
	* app/gui/layers-commands.c
	* app/vectors/gimpvectors.c
	* tools/pdbgen/pdb/layer.pdb: changed accordingly.

	* app/pdb/layer_cmds.c: regenerated.
2004-04-13 11:43:27 +00:00
Michael Natterer 49238237dc ref new tiles before unrefing the old ones.
2004-03-16  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable.c (gimp_drawable_set_tiles): ref new
	tiles before unrefing the old ones.

	* app/core/gimpimage-undo-push.c: keep undo memsize exact by
	adjusting undo->size when the stored data changes.

	* app/core/gimpchannel.[ch] (gimp_channel_new_from_alpha)
	* app/core/gimpchannel-select.[ch] (gimp_channel_select_alpha):
	replaced "layer" parameter by "drawable".

	* app/gui/layers-commands.c
	* tools/pdbgen/pdb/selection.pdb: changed accordingly.

	* app/pdb/selection_cmds.c: regenerated.

	* app/core/gimpchannel.c
	* app/core/gimplayer.c
	* app/core/gimplayermask.[ch]
	* app/core/gimpselection.c: remdom cleanup & code review.
2004-03-16 16:23:06 +00:00
Michael Natterer 5ef7c7746d replaced GIMP_UNDO_LAYER_MOD and GIMP_UNDO_CHANNEL_MOD by
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 20:58:07 +00:00
Michael Natterer 1ef5fa93ca added "offset_x" and "offset_y" parameters to GimpDrawable::set_tiles().
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 19:34:35 +00:00
Michael Natterer 7977603648 don't call gimp_image_flush().
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 17:53:55 +00:00
Michael Natterer 800b7a5d53 added "gboolean alpha_changed" to GimpImageFlushAccumulator. Install an
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 16:38:49 +00:00
Michael Natterer d376ac5d5e emit "alpha_changed" if the drawable got/lost an alpha channel by setting
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 15:37:12 +00:00
Michael Natterer d1fe0f9e6b app/core/gimpdrawable-offset.c (gimp_drawable_offset)
2004-03-14  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable-offset.c (gimp_drawable_offset)
	* app/core/gimpdrawable.c (gimp_drawable_scale) (gimp_drawable_resize)
	* app/core/gimplayer.c (gimp_layer_convert) (gimp_layer_add_alpha):
	use gimp_drawable_set_tiles() instead of fiddling with
	drawable->tiles, ->bytes etc. manually.
2004-03-14 11:34:31 +00:00
Michael Natterer 2498c6659e Completed the fix for bug #136702:
2004-03-13  Michael Natterer  <mitch@gimp.org>

	Completed the fix for bug #136702:

	* app/core/gimpitem.[ch]: added "gboolean supersample" and
	"gint recursion_level" to GimpItem::transform().

	* app/core/gimpitem-linked.[ch]	(gimp_item_linked_transform): ditto.

	* app/core/gimpdrawable-transform.[ch]: added "recursion_level"
	parameters and removed the RECURSION_LEVEL #define.

	* app/core/gimpchannel.c
	* app/core/gimpdrawable.c
	* app/core/gimplayer.c
	* app/vectors/gimpvectors.c: changed accordingly.

	* app/tools/gimptransformoptions.[ch]: added new property
	"recursion_level" which is not serializable and has no GUI. Pretty
	useless, but it's IMHO better to hardcode the default value here
	than in gimpdrawable-transform.c

	* app/tools/gimptransformtool.c: changed accordingly.

	* tools/pdbgen/pdb/transform_tools.pdb: hardcode "recursion_level"
	to 3.

	* app/pdb/transform_tools_cmds.c: regenerated.
2004-03-13 17:45:58 +00:00
Sven Neumann c179f9acaf added new virtual function GimpDrawable::set_tiles().
2004-03-13  Sven Neumann  <sven@gimp.org>

	* app/core/gimpdrawable.[ch]: added new virtual function
	GimpDrawable::set_tiles().

	* app/core/gimpchannel.c
	* app/core/gimplayer.c: push an undo before chaining up in
	set_tiles().

	* app/core/gimpdrawable-transform.c
	* app/core/gimpimage-convert.c
	* app/tools/gimptransformtool.c: use gimp_drawable_set_tiles()
	instead of fiddling with the drawable's tile manager directly.
2004-03-13 13:56:09 +00:00
Michael Natterer abee5eef7a when deleting the mask, use "Delete Layer Mask" instead of "Apply Layer
2004-02-28  Michael Natterer  <mitch@gimp.org>

	* app/core/gimplayer.c (gimp_layer_apply_mask): when deleting the
	mask, use "Delete Layer Mask" instead of "Apply Layer Mask" as
	undo description.
2004-02-28 18:56:55 +00:00
Michael Natterer d928919200 Make sure each GimpItem emits "removed" when it is removed from the image
2004-02-17  Michael Natterer  <mitch@gimp.org>

	Make sure each GimpItem emits "removed" when it is removed from
	the image so dialogs have a chance to close themselves:

	* app/core/gimplayer.c (gimp_layer_apply_mask): emit "removed"
	from the mask.

	(gimp_layer_removed): new function which emits "removed" from
	the layer's mask when the layer gets removed from the image.

	* app/core/gimpimage.c (gimp_image_dispose): emit "removed"
	from all layers, channels and vectors.

	* app/gui/layers-commands.c (layers_scale_layer_query)
	(layers_resize_layer_query): removed recently added connections to
	"removed" because GimpViewableDialog does this automatically.
2004-02-17 11:45:46 +00:00
Sven Neumann 1359960a56 added progress callback pointers to gimp_item_scale() and its variants.
2004-02-09  Sven Neumann  <sven@gimp.org>

	* app/core/gimpitem.[ch]: added progress callback pointers to
	gimp_item_scale() and its variants.

	* app/core/gimpchannel.c
	* app/core/gimpdrawable.c
	* app/core/gimpimage-scale.c
	* app/core/gimplayer.c
	* app/core/gimpselection.c
	* app/gui/layers-commands.c97999
	* app/paint-funcs/paint-funcs.[ch]
	* app/vectors/gimpvectors.c
	* tools/pdbgen/pdb/layer.pdb: changed accordingly. Fixes bug #97999.

	* app/pdb/layer_cmds.c: regenerated.
2004-02-09 00:09:20 +00:00
Michael Natterer 82276adaa4 Disallow to rename the layer mask. Instead, always name the mask "<layer
2004-02-01  Michael Natterer  <mitch@gimp.org>

	Disallow to rename the layer mask. Instead, always name the mask
	"<layer name> mask". Fixes bug #133112 along with some other
	unreported ones.

	* app/core/gimpitem.[ch]: added a boolean return value indicating
	success to GimpItem::rename().

	(gimp_item_real_rename): push an undo step only if the item is
	attached.

	* app/core/gimplayer.c (gimp_layer_rename): refuse renaming if
	the layer is a floating selection floated from a channel
	(renaming a layer's floating selection makes a new layer out
	of the floating selection).

	(gimp_layer_duplicate): use gimp_layer_add_mask() to attach the
	mask's duplicate. Fixes mask refcount brokenness for duplicated
	layer masks.

	(gimp_layer_name_changed): new function. Automatically renames the
	layer mask when the layer's name changes.

	* app/core/gimplayermask.c (gimp_layer_mask_rename): new function
	which refuses renaming.

	(gimp_layer_mask_name_changed): skip the unique name voodoo
	GimpItem does by not chaining up.

	(gimp_layer_mask_set_layer): change the mask's name whenever it is
	attached to a layer.

	* app/text/gimptextlayer.c (gimp_text_layer_rename): fiddle with
	text_layer->auto_rename only if renaming was successful.

	* app/widgets/gimpitemtreeview.c (gimp_item_tree_view_name_edited):
	restore the old name if renaming failed.

	* tools/pdbgen/pdb/drawable.pdb (set_name): return an execution
	error if renaming failed.

	* app/pdb/drawable_cmds.c: regenerated.
2004-02-01 20:38:26 +00:00
Michael Natterer 748d432f3a removed gimp_image_owns_item() again.
2004-01-26  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpimage.[ch]: removed gimp_image_owns_item() again.

	* app/core/gimpitem.[ch]: instead, added new virtual function
	GimpItem::is_attached().

	* app/core/gimpchannel.c
	* app/core/gimplayer.c
	* app/core/gimplayermask.c
	* app/core/gimpselection.c
	* app/vectors/gimpvectors.c: implement it.

	* app/core/gimp-edit.c
	* app/core/gimpdrawable-transform.c
	* app/core/gimplayer-floating-sel.c
	* app/text/gimptext-compat.c
	* 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_ changed accordingly.

	* 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-26 16:18:16 +00:00
Michael Natterer 1cc434fa6e Fixed memory management of layers and channels which were created using
2003-12-09  Michael Natterer  <mitch@gimp.org>

	Fixed memory management of layers and channels which were created
	using the PDB:

	* app/core/gimpitem.[ch]: added "gboolean floating" flag to
	GimpItem. Items are created with floating == TRUE. Added
	gimp_item_sink() which resets the floating flag and unrefs the
	item if it was TRUE.  Added gimp_item_is_floating() accessor.

	* app/core/gimpimage.c (gimp_image_add_layer,channel,vectors):
	g_object_ref()/gimp_item_sink() added items to take ownership of
	them.

	* app/core/gimplayer.c (gimp_layer_add_mask):
	g_object_ref()/gimp_item_sink() the mask.

	* app/gui/layers-commands.c
	* app/xcf/xcf-load.c: don't unref layer masks after adding them to
	the layer.

	* tools/pdbgen/pdb/drawable.pdb (drawable_delete):
	gimp_item_sink() the drawable if it's floating and fail if it's
	not. Fixes bug #128881.

	* tools/pdbgen/pdb/layer.pdb (layer_create_mask): fixed docs.

	* app/pdb/drawable_cmds.c
	* app/pdb/layer_cmds.c
	* libgimp/gimplayer_pdb.c: regenerated.
2003-12-09 18:59:35 +00:00
Michael Natterer c97d090d13 eek, it should be GIMP_ADD_ALPHA_TRANSFER_MASK, not
2003-11-26  Michael Natterer  <mitch@gimp.org>

	* app/core/core-enums.[ch]: eek, it should be
	GIMP_ADD_ALPHA_TRANSFER_MASK, not GIMP_ADD_ALPHA_MASK_TRANSFER.

	* app/core/gimplayer.c (gimp_layer_create_mask): changed accordingly.

	* app/pdb/layer_cmds.c
	* libgimp/gimpenums.h
	* plug-ins/pygimp/gimpenums.py
	* plug-ins/script-fu/script-fu-constants.c
	* tools/pdbgen/enums.pl: regenerated.
2003-11-26 16:00:14 +00:00
Michael Natterer e0e8a34f31 added enum values GIMP_ADD_ALPHA_MASK_TRANSFER and
2003-11-26  Michael Natterer  <mitch@gimp.org>

	* app/core/core-enums.[ch]: added enum values
	GIMP_ADD_ALPHA_MASK_TRANSFER and GIMP_UNDO_GROUP_LAYER_ADD_MASK.

	* app/core/gimplayer.c (gimp_layer_create_mask): applied patch
	from Pedro Gimeno which implements the new ADD_MASK type and
	added undo. Fixes bug #127930.

	* app/gui/layers-commands.c: push an undo group around layer mask
	creation & adding since the creation may change the layer now.

	* app/pdb/layer_cmds.c
	* libgimp/gimpenums.h
	* plug-ins/pygimp/gimpenums.py
	* plug-ins/script-fu/script-fu-constants.c
	* tools/pdbgen/enums.pl: regenerated.
2003-11-26 15:48:50 +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 a20e04bdaf added new virtual functions GimpDrawable::get_active_components(),
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 14:40:12 +00:00
Michael Natterer f0372cad0f Treat changes to the selection like changes to any other drawable:
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-10-06 12:17:11 +00:00
Michael Natterer 7cf4eb467a removed "visible" and all its API...
2003-09-11  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable.[ch]: removed "visible" and all its API...

	* app/core/gimpitem.[ch]: ...and added it here.

	* app/core/core-enums.[ch]
	* app/core/gimpimage-undo-push.[ch]: changed the drawable
	visibility undo to be an item visibility undo.

	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c: save it in PROP_VECTORS and changed channel
	and layer loading/saving accordingly.

	* app/core/gimpimage-merge.c
	* app/core/gimpimage-preview.c
	* app/core/gimpimage-projection.c
	* app/core/gimpimage.c
	* app/core/gimplayer-floating-sel.c
	* app/core/gimplayer.c
	* app/core/gimpselection.c
	* app/text/gimptextlayer.c
	* app/gui/channels-commands.c
	* tools/pdbgen/pdb/channel.pdb
	* tools/pdbgen/pdb/layer.pdb: changed accordingly.

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

	* app/widgets/gimpdrawabletreeview.[ch]: removed the eye icon...

	* app/widgets/gimpitemtreeview.[ch]: ...and added it here.
2003-09-11 19:52:29 +00:00
Michael Natterer 7a5f914866 To optimize duplicate and/or wrong image updates away, introduced new
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-06 20:06:53 +00:00
Michael Natterer aaf84a73d2 removed function map_to_color() since it does not belong here and the two
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-05 17:44:39 +00:00
Michael Natterer f9f5089f91 added new pure virtual function GimpDrawable::invalidate_boundary().
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-09-04 11:33:06 +00:00
Michael Natterer e837849934 removed the _value() and _is_empty() wrappers.
2003-09-03  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpimage-mask.[ch]: removed the _value() and
	_is_empty() wrappers.

	* app/display/gimpdisplayshell.[ch]: removed
	gimp_display_shell_mask_value() since it is not used.

	* app/core/gimpdrawable-blend.c
	* app/core/gimpdrawable-transform.c
	* app/core/gimpedit.c
	* app/core/gimpimage.c
	* app/core/gimplayer.c
	* app/gui/image-menu.c
	* app/gui/vectors-menu.c
	* app/tools/gimpclonetool.c
	* app/tools/gimpfliptool.c
	* app/tools/gimpinktool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimpselectiontool.c
	* app/tools/gimptransformtool.c
	* tools/pdbgen/pdb/misc_tools.pdb: changed accordingly.

	* app/pdb/misc_tools_cmds.c: regenerated.
2003-09-03 15:13:19 +00:00
Michael Natterer 420d17d286 made all functions which push an undo step virtual and added them all as
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-02 23:07:40 +00:00
Sven Neumann e924a1372b app/text/gimptextlayout-render.c (gimp_text_layout_render)
2003-09-02  Sven Neumann  <sven@gimp.org>

	* app/text/gimptextlayout-render.c (gimp_text_layout_render)
	* app/widgets/gimpfontselection.c (gimp_font_selection_set_fontname)
	* app/widgets/gimptexteditor.c (gimp_text_editor_new)
	* app/gui/file-save-dialog.c (file_save_ok_callback): plugged
	some memleaks found using memprof.

	* app/vectors/gimpvectors.c: implemented the finalize method.

	* app/vectors/gimpstroke.c: minor code cleanup.

	* app/core/gimpdrawable.c (gimp_drawable_finalize)
	* app/core/gimplayer.c (gimp_layer_finalize)
	* app/core/gimpparasitelist.c (gimp_parasite_list_finalize):
	removed useless assertions.
2003-09-02 13:43:26 +00:00
Michael Natterer c4dfccd8db Enabled type-preserving DND of all kinds of items between different
2003-08-27  Michael Natterer  <mitch@gimp.org>

	Enabled type-preserving DND of all kinds of items between
	different images. Fixes bug #119983.

	* app/core/gimpitem.[ch]: added new virtual function
	GimpItem::convert() which duplicates an item for another image.

	* app/core/gimplayer.[ch]: removed gimp_layer_new_from_drawable()
	and made it a GimpItem::convert() implementation.

	* app/vectors/gimpvectors.[ch]: removed gimp_vectors_convert() and
	made it a GimpItem::convert() implementation.

	* app/widgets/gimpitemtreeview.[ch]: removed GimpConvertItemFunc
	typedef and function pointer in GimpItemTreeViewClass since
	we can simply call gimp_item_convert() now.

	* app/widgets/gimplayertreeview.c
	* app/widgets/gimpvectorstreeview.c
	* app/display/gimpdisplayshell-dnd.c
	* tools/pdbgen/pdb/layer.pdb: changed accordingly.

	* app/pdb/layer_cmds.c: regenerated.
2003-08-27 17:21:49 +00:00
Michael Natterer 24f3da165b changed GimpObject::get_memsize() to return a second value named
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-08-25 10:49:33 +00:00
Sven Neumann 5c4020edf2 libgimpmath/gimpmathtypes.h moved struct declarations.
2003-07-07  Sven Neumann  <sven@gimp.org>

	* libgimpmath/gimpmathtypes.h
	* libgimpmath/gimpvector.h: moved struct declarations.

	* libgimpmath/gimpmatrix.[ch]: made GimpMatrix3 and GimpMatrix4
	structs instead of typedefs for arrays. Pass them by reference,
	not by value. Added lots of const qualifiers.

	* app/core/gimpchannel.c
	* app/core/gimpdrawable-transform-utils.[ch]
	* app/core/gimpdrawable-transform.[ch]
	* app/core/gimpdrawable.c
	* app/core/gimpitem-linked.[ch]
	* app/core/gimpitem.[ch]
	* app/core/gimplayer.c
	* app/pdb/transform_tools_cmds.c
	* app/tools/gimpperspectivetool.c
	* app/tools/gimprotatetool.c
	* app/tools/gimpscaletool.c
	* app/tools/gimpsheartool.c
	* app/tools/gimptransformtool.c
	* app/vectors/gimpvectors.c
	* tools/pdbgen/pdb/transform_tools.pdb: changed accordingly.
2003-07-07 13:50:48 +00:00
Sven Neumann f30586d112 app/config/gimpconfig.[ch] app/config/gimpconfigwriter.[ch] added support
2003-06-23  Sven Neumann  <sven@gimp.org>

	* app/config/gimpconfig.[ch]
	* app/config/gimpconfigwriter.[ch]
	* app/config/gimpscanner.[ch]: added support for serializing to
	and deserializing from strings. Had to do some smaller changes to
	the GimpConfig API.

	* app/config/test-config.c: added a simple test for the new
	functions.

	* app/config/gimpconfig-dump.c
	* app/config/gimprc.c
	* app/core/gimp-documents.c
	* app/core/gimp-parasites.c
	* app/core/gimp-templates.c
	* app/core/gimpunits.c
	* app/gui/session.c
	* app/plug-in/plug-in-rc.c
	* app/tools/tool_options.c
	* app/widgets/gimpdevices.c: follow GimpConfig API changes.

	* libgimpbase/gimpparasite.[ch]: declared the return value of
	gimp_parasite_data() as gconstpointer.
2003-06-23 22:02:56 +00:00
Michael Natterer 707e597665 added "gint ref_count" to the TileManager struct.
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-26 17:02:06 +00:00
Michael Natterer 31bf3c9052 added GimpDrawable::alpha_changed() signal.
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-21 11:34:00 +00:00
Sven Neumann 1de667f0b6 added new enum GimpRotationType.
2003-05-20  Sven Neumann  <sven@gimp.org>

	* app/core/core-enums.[ch]: added new enum GimpRotationType.

	* app/core/Makefile.am
	* app/core/gimpimage-rotate.[ch]: new files.

	* app/core/gimpchannel.c
	* app/core/gimpdrawable-transform.[ch]
	* app/core/gimpdrawable.c
	* app/core/gimpitem.[ch]
	* app/core/gimplayer.c
	* app/vectors/gimpvectors.c: added GimpItem::rotate. Still work in
	progress.

	* plug-ins/common/rotate.c: don't install any menu entries. The
	plug-in is only kept around to provide plug_in_rotate for backward
	compatibility.

	* app/gui/drawable-commands.[ch]
	* app/gui/image-commands.[ch]
	* app/gui/image-menu.c: use the new rotate implementation and use
	stock icons for the menu entries. Fixes bug #57797.
2003-05-20 10:36:29 +00:00
Michael Natterer 4624d49662 call gimp_item_set_image() on the new layer's mask too if it exists.
2003-05-18  Michael Natterer  <mitch@gimp.org>

	* app/core/gimplayer.c (gimp_layer_new_from_drawable): call
	gimp_item_set_image() on the new layer's mask too if it exists.
2003-05-18 10:32:16 +00:00
Michael Natterer 149e81dab5 app/core/Makefile.am new file for utility functions. Contains
2003-05-14  Michael Natterer  <mitch@gimp.org>

	* app/core/Makefile.am
	* app/core/gimp-utils.[ch]: new file for utility functions.
	Contains gimp_rectangle_intersect() for now.

	* app/core/gimpdrawable-transform.c: removed the function here.

	* app/core/gimpdrawable.c (gimp_drawable_resize): use it to
	determine the amount of pixels to copy between the old and new
	tile managers. Removed restriction that forced the areas to
	overlap by at least one pixel.

	* app/core/gimpitem.c (gimp_item_real_transform): removed the
	restriction here, too.

	* app/core/gimplayer.c (gimp_layer_create_mask): use the new
	function to decide how much to copy from the selection when
	creating a mask from it.
2003-05-14 15:32:07 +00:00
Michael Natterer a4395cead9 added "gboolean clip_result" to GimpItem::flip().
2003-05-13  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpitem.[ch]: added "gboolean clip_result" to
	GimpItem::flip().

	* app/vectors/gimpvectors.c
	* app/tools/gimpfliptool.c: changed accordingly.

	* app/core/gimpdrawable.c: implement GimpItem::flip() and
	GimpItem::transform().

	* app/core/gimpchannel.c
	* app/core/gimplayer.c: chain up in flip() and transform() and do
	only the layer/channel specific stuff here.

	* app/core/gimpdrawable-transform.[ch]: fixed indentation.
	(gimp_drawable_transform_tiles_flip): added "gboolean clip_result"
	and warn that it is not yet implemented.
	(gimp_drawable_transform_tiles_affine): when transforming a
	channel set bg_color to transparent. Clip channels (but not layer
	masks) only if the passed tiles have bpp == 1 (the channel is
	unfloated).
	(gimp_drawable_transform_affine): clip all unfloated channels.

	* app/core/gimpitem-linked.[ch]: added gimp_item_linked_get_list()
	utility function to avoind iterating all layers/channels/vectors
	in all functions.

	* app/tools/gimptransformtool.c: clip all unfloated channels.

	The clipping fixes above together fix bug #112858.
2003-05-13 13:57:11 +00:00
Michael Natterer 45334e637e Added support for transforming linked layers, channels and vectors. Fixes
2003-05-12  Michael Natterer  <mitch@gimp.org>

	Added support for transforming linked layers, channels
	and vectors. Fixes bug #86277.

	* app/core/gimpdrawable-transform.[ch]
	(gimp_drawable_transform_tiles_flip): added "gdouble axis" and
	calculate the resulting drawable offset.
	(gimp_drawable_transform_flip): calculate the axis and pass it to
	the function above.
	(gimp_drawable_transform_[tiles_]affine): reordered parameters.

	* app/core/gimpitem.[ch]: added virtual functions GimpItem::flip()
	and GimpItem::transform().

	* app/core/gimpchannel.c
	* app/core/gimplayer.c
	* app/vectors/gimpvectors.c: implement flip() and transform().
	Note that all functions always transform the whole item,
	regardless of a present selection.

	* app/core/Makefile.am
	* app/core/gimpitem-linked.[ch]: new files containing utility
	functions which translate, flip and transform all linked items.

	* app/tools/gimpfliptool.c
	* app/tools/gimptransformtool.c
	* tools/pdbgen/pdb/layer.pdb: use the new gimp_item_linked_*()
	functions to translate, flip and transform all linked items.

	* tools/pdbgen/pdb/transform_tools.pdb: follow
	gimp_drawable_transform_affine() API change.

	* app/pdb/layer_cmds.c
	* app/pdb/transform_tools_cmds.c: regenerated.
2003-05-12 15:56:36 +00:00
Michael Natterer 457368140d added "gboolean push_undo" to GimpItem::translate() and don't push and
2003-05-09  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpitem.[ch]: added "gboolean push_undo" to
	GimpItem::translate() and don't push and undo in
	gimp_item_translate().

	* app/core/gimpchannel.[ch]: removed public function
	gimp_channel_translate() and implement GimpItem::translate().

	* app/core/gimpimage-mask.c
	* app/core/gimplayer.c: changed accordingly.

	* app/vectors/gimpvectors.c: actually translate the vectors
	in translate().

	* app/gui/channels-commands.c (channels_new_channel_query): removed
	useless call to gimp_channel_translate().

	* app/tools/gimpeditselectiontool.c
	* tools/pdbgen/pdb/layer.pdb: when translating a linked layer,
	also translate all linked channels and vectors. Cleanup.

	Note that the "linked" behaviour has changed: before this change,
	moving a layer moved all linked layers unconditionally. Now,
	linked layers/channels/vectors are moved *only* if the moved layer
	is also linked (the linked items behave as a group now and moving
	something not in the group does not affect the group).

	* app/pdb/layer_cmds.c: regenerated.
2003-05-09 13:05:37 +00:00
Michael Natterer 33b7d779d6 removed "linked" member and API...
2003-05-08  Michael Natterer  <mitch@gimp.org>

	* app/core/gimplayer.[ch]: removed "linked" member and API...

	* app/core/gimpitem.[ch]: ...and added it here.

	* app/core/core-enums.[ch]
	* app/core/gimpimage-undo-push.[ch]: changed layer_linked undo
	types and functions to be item_linked ones.

	* app/tools/gimpeditselectiontool.c
	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c
	* tools/pdbgen/pdb/layer.pdb: changed accordingly.

	* app/pdb/layer_cmds.c: regenerated.

	* app/widgets/gimplayertreeview.[ch]: removed "linked" icon and
	functions...

	* app/widgets/gimpitemtreeview.[ch]: and added them here. Setting
	channels or vectors to "linked" does nothing yet.
2003-05-08 20:26:01 +00:00
Michael Natterer 129c78d271 added gimp_item_translate() and virtual function GimpItem::translate().
2003-05-08  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpitem.[ch]: added gimp_item_translate() and
	virtual function GimpItem::translate().

	* app/core/gimplayer.[ch]: removed public function
	gimp_layer_translate() and implement GimpItem::translate()
	instead.

	* app/core/core-enums.[ch]
	* app/core/gimpimage-undo-push.[ch]: changed layer_displace undo
	types and functions to be item_displace ones.

	* app/core/gimpimage-crop.c
	* app/core/gimpimage-resize.c
	* app/display/gimpdisplayshell-dnd.c
	* app/gui/layers-commands.c
	* app/tools/gimpeditselectiontool.c
	* app/widgets/gimptoolbox.c
	* tools/pdbgen/pdb/layer.pdb: changed accordingly.

	* app/pdb/layer_cmds.c: regenerated.
2003-05-08 19:11:17 +00:00
Michael Natterer ab0ac8472f removed the remaining layer scale API.
2003-05-08  Michael Natterer  <mitch@gimp.org>

	* app/core/gimplayer.[ch]: removed the remaining layer scale API.

	* app/core/gimpitem.[ch]: added the same functions here.

	* app/core/gimpimage-scale.c
	* app/gui/layers-commands.c
	* tools/pdbgen/pdb/layer.pdb: changed accordingly.

	* app/pdb/layer_cmds.c: regenerated.
2003-05-08 14:54:04 +00:00