Commit Graph

176 Commits

Author SHA1 Message Date
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Michael Natterer 697572ccc0 app,libgimp*: fix includes to follow our include policy
- don't include <gdk-pixbuf/gdk-pixbuf.h> in headers in app/
- instead, include it in many .c files instead of <glib-object.h>,
  finally acknowledging the fact that app/ depends on gdk-pixbuf almost
  globally
- fix up includes as if libgimpbase depended in GIO, which it soon will
2013-10-15 01:58:39 +02:00
Michael Natterer 5cd8b98efb app: factor out the core mask combine functions to gegl-only functions
so we can use them on plain GeglBuffers. Use them in
gimpchannel-combine.c for now.
2013-04-08 21:54:46 +02:00
Michael Natterer 1a624d4df4 app: remove many includes of "gegl/gimp-gegl-utils.h" 2012-05-10 23:12:39 +02:00
Michael Natterer c0f7538f4f app: port gimpchannel-combine.c to float
so all basic mask manipulations are float now
2012-05-02 17:51:14 +02:00
Øyvind Kolås 6efd812d08 app: s/GIMP_GEGL_RECT/GEGL_RECTANGLE/
Defining GeglRectangle inline is so useful that it has been added to
GEGL.
2012-05-02 17:50:52 +02:00
Øyvind Kolås bfb3cd60d1 app: adapt to API changes in gegl_buffer_iterator 2012-05-02 17:46:15 +02:00
Øyvind Kolås 9a22e2202f app: update with GEGL iterator API changes 2012-05-02 17:46:15 +02:00
Øyvind Kolås c872a9368e app: sprinkle level argument over process functions 2012-05-02 17:46:13 +02:00
Øyvind Kolås f8b1372038 app: make use of GIMP_GEGL_RECT in more places 2012-05-02 17:46:05 +02:00
Michael Natterer 0bcae125b5 app: merge gimp_drawable_get_read_buffer() and get_write_buffer()
into get_buffer(). The loss of zero copy will be compensated soon.
2012-05-02 17:46:04 +02:00
Michael Natterer 6f6c42a9c3 app: port gimp_channel_combine_mask() to GeglBufferIterator 2012-05-02 17:46:01 +02:00
Michael Natterer dfa7173ee0 app: port gimp_channel_combine_ellipse_rect() to GeglBufferIterator 2012-05-02 17:45:55 +02:00
Michael Natterer 2a279f5e40 app: some more gegl_buffer_clear()/set_color() on mask objects 2012-05-02 17:45:51 +02:00
Sven Neumann 4e124c983b Only call gimp_channel_combine_span() if the value actually changed 2009-10-11 13:49:14 +02:00
Sven Neumann aa9538a81a Optimize gimp_channel_combine_ellipse_rect()
The actual algorithm is still the same sick algorithm that was used
before. But instead of iterating the mask row-by-row and filling
it in small spans, we now use one pixel_regions_process() loop to
process the whole mask. Makes a significant difference for large
elliptical selections.

Remove gimp_channel_add_segment() and gimp_channel_sub_segment()
as they are not needed any longer and were responsible for the
bad performance.
2009-10-10 23:09:54 +02:00
Sven Neumann bcfce95a5e minor cleanups 2009-10-10 23:09:46 +02:00
Sven Neumann 4c0f1a2d54 app: minor optimization and cleanups
gimp_channel_add_segment() and gimp_channel_sub_segment() can just
write directly if the value is 255, which it is quite commonly.
2009-10-10 23:09:46 +02:00
Sven Neumann d9bd97d02b fixed incorrect optimization that caused glitches in the rounded corners
2009-01-29  Sven Neumann  <sven@gimp.org>

	* app/core/gimpchannel-combine.c 
(gimp_channel_combine_ellipse_rect):
	fixed incorrect optimization that caused glitches in the rounded
	corners on the left side of rectangular selections.


svn path=/trunk/; revision=27968
2009-01-29 10:02:47 +00:00
Michael Natterer d9b5207aa2 Change licence to GPLv3 (and to LGPLv3 for libgimp).
2009-01-17  Michael Natterer  <mitch@gimp.org>

	* all files with a GPL header and all COPYING files:

	Change licence to GPLv3 (and to LGPLv3 for libgimp).

	Cleaned up some copyright headers and regenerated the parsers in
	the ImageMap plugin.


svn path=/trunk/; revision=27913
2009-01-17 22:28:01 +00:00
Michael Natterer 740ab5e633 renamed gimp_item_width() to gimp_item_get_width() and gimp_item_height()
2008-11-03  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpitem.[ch]: renamed
	gimp_item_width() to gimp_item_get_width() and
	gimp_item_height() to gimp_item_get_height().

	* app/actions/channels-commands.c
	* app/actions/drawable-commands.c
	* app/actions/layers-commands.c
	* app/core/<many>.c
	* app/dialogs/offset-dialog.c
	* app/dialogs/resize-dialog.c
	* app/dialogs/scale-dialog.c
	* app/display/gimpdisplayshell-dnd.c
	* app/display/gimpdisplayshell.c
	* app/paint/gimpbrushcore.c
	* app/paint/gimpdodgeburn.c
	* app/paint/gimpink.c
	* app/paint/gimppaintcore.c
	* app/paint/gimpsmudge.c
	* app/text/gimptextlayer-xcf.c
	* app/text/gimptextlayer.c
	* app/tools/gimpaligntool.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimpforegroundselecttool.c
	* app/tools/gimpimagemaptool.c
	* app/tools/gimprectangletool.c
	* app/tools/gimpregionselecttool.c
	* app/tools/gimptexttool.c
	* app/vectors/gimpvectors.c
	* app/vectors/gimpvectorsmodundo.c
	* app/widgets/gimptoolbox-dnd.c
	* app/widgets/gimpviewrendererdrawable.c
	* app/widgets/gimpviewrenderervectors.c
	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c
	* tools/pdbgen/pdb/drawable.pdb: changed accordingly.

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


svn path=/trunk/; revision=27531
2008-11-03 00:09:01 +00:00
Michael Natterer 5503e6a055 Add GEGL_CFLAGS and #includes as if gimpdrawable.h and gimpimage.h had a
2008-10-09  Michael Natterer  <mitch@gimp.org>

	Add GEGL_CFLAGS and #includes as if gimpdrawable.h and gimpimage.h
	had a GEGL dependency (they will have in the next commit, but I
	wanted to keep the commit separate).

	* app/dialogs/Makefile.am
	* app/file/Makefile.am
	* app/gui/Makefile.am
	* app/menus/Makefile.am
	* app/paint/Makefile.am
	* app/plug-in/Makefile.am
	* app/text/Makefile.am
	* app/vectors/Makefile.am
	* app/widgets/Makefile.am
	* app/xcf/Makefile.am: add GEGL_CFLAGS.

	* app/actions/*.c
	* app/core/*.c
	* app/dialogs/*.c
	* app/display/*.c
	* app/file/*.c
	* app/gui/*.c
	* app/menus/*.c
	* app/paint/*.c
	* app/pdb/gimppdb-utils.c
	* app/pdb/gimpprocedure.c
	* app/plug-in/*.c
	* app/text/*.c
	* app/tools/*.c
	* app/vectors/*.c
	* app/widgets/*.c
	* app/xcf/*.c: add <gegl.h> or replace <glib-object.h> by <gegl.h>
	to all files which include a drawable subclass or gimpimage.h

	* tools/pdbgen/app.pl: include <gegl.h> instead of <glib-object.h>
	in all generated files.

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

	* data/images/gimp-splash.png: the goat is still sleeping.
	By Aurore Derriennic.


svn path=/trunk/; revision=27202
2008-10-09 20:24:04 +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 83d3a750d4 include "libgimpmath/gimpmathtypes.h" instead of "libgimpmath/gimpmath.h".
2007-03-09  Michael Natterer  <mitch@gimp.org>

	* app/core/core-types.h: include "libgimpmath/gimpmathtypes.h"
	instead of "libgimpmath/gimpmath.h".

	* app/core/gimpbrush.h
	* app/paint/gimppaintcore.h
	* app/paint/gimpperspectiveclone.h
	* app/text/gimptext.h
	* app/tools/gimptransformtool.h: include gimpvector.h and
	gimpmatrix.h explicitely where they are needed in public structs.

	* app/*/*.c
	* tools/pdbgen/pdb/paths.pdb: include "libgimpmath/gimpmath.h"
	where needed.

	* app/pdb/paths_cmds.c: regenerated.


svn path=/trunk/; revision=22084
2007-03-09 13:00:01 +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 1ee6516d52 Applied modified patch from Martin Nordholts which adds a "Rounded
2006-10-18  Michael Natterer  <mitch@gimp.org>

	Applied modified patch from Martin Nordholts which adds a "Rounded
	Corners" option to the rectangle select tool. Fixes bug #86279.

	* app/core/gimpchannel-combine.[ch]: added
	gimp_channel_combine_ellipse_rect(). Use it from
	gimp_channel_combine_ellipse().

	* app/core/gimpchannel-select.[ch]: added
	gimp_channel_select_round_rect()

	* app/tools/gimprectangleselectoptions.[ch]: added properties
	"round-corners" and "corner-radius" and GUI for the new propeties.

	* app/tools/gimprectangleselecttool.h: added macro
	GIMP_RECT_SELECT_TOOL_GET_OPTIONS().

	* app/tools/gimprectangleselecttool.c (gimp_rect_select_tool_draw):
	draw round corners if enabled.

	(gimp_rect_select_tool_real_select): use
	gimp_channel_select_round_rect() if enabled.

	* app/tools/gimpselectionoptions.[ch]: added "antialias_toggle"
	to the GimpSelectionOptions struct so the rect select options
	can set its sensitivity.

	Unrelated:

	* app/tools/gimpellipseselecttool.c (gimp_ellipse_select_tool_draw):
	use 360 * 64 instead of 23040.
2006-10-18 18:54:28 +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 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
Michael Natterer 7eb96e17da use gimp_rectangle_intersect() instead of just looking at the passed in
2005-09-07  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpchannel-combine.c (gimp_channel_combine_ellipse):
	use gimp_rectangle_intersect() instead of just looking at the
	passed in w,h to figure whether nothing needs to be done. While
	the algorithm does nicely with an entirely out-of-image ellipse,
	the channel's bounds were set to a rectangle of zero width or
	height, which caused subsequent calls to gimp_channel_bounds() to
	return broken bounds. Fixes bug #315417.

	(gimp_channel_combine_rect)
	(gimp_channel_combine_mask): use gimp_rectangle_intersect() here
	too instead of the usual unclear CLAMPing on x1,y1,x2,y2.
2005-09-07 10:08:02 +00:00
Sven Neumann adff5aeb09 code cleanup. Removed unsued code, renamed variables and types.
2005-02-11  Sven Neumann  <sven@gimp.org>

	* app/base/pixel-processor.[ch]: code cleanup. Removed unsued code,
	renamed variables and types.

	* app/base/gimphistogram.c
	* app/core/gimpchannel-combine.c
	* app/core/gimpchannel.c
	* app/core/gimpdrawable-equalize.c
	* app/core/gimpdrawable-invert.c
	* app/core/gimpdrawable-levels.c
	* app/paint-funcs/paint-funcs.c
	* tools/pdbgen/pdb/color.pdb: changed accordingly.

	* app/pdb/color_cmds.c: regenerated.
2005-02-11 17:03:56 +00:00
Sven Neumann f26d1b8a8c moved variable declarations to the scope they are being used in, removed
2004-07-19  Sven Neumann  <sven@gimp.org>

	* app/core/gimpchannel-combine.c (gimp_channel_combine_ellipse):
	moved variable declarations to the scope they are being used in,
	removed trailing whitespace, minor cleanups.
2004-07-19 14:25:59 +00:00
William Skaggs b48a7cce8f Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/core/gimpchannel-combine.c: put in two lines accidentally
	omitted in previous change, improve doc comment.
2004-07-19 14:12:30 +00:00
Michael Natterer fe23211092 comments not intended for gtk-doc must not start with '/**'.
2004-07-19  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpchannel-combine.c (gimp_channel_combine_ellipse):
	comments not intended for gtk-doc must not start with '/**'.
2004-07-19 12:43:40 +00:00
William Skaggs f7cca5f2f2 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/core/gimpchannel-combine.c: improve anti-aliasing for
	elliptical selections, as described in bug #147836.
2004-07-18 19:31:29 +00:00
Michael Natterer de7a940501 app/config/gimpconfig-deserialize.c app/config/gimpscanner.c
2004-05-12  Michael Natterer  <mitch@gimp.org>

	* app/config/gimpconfig-deserialize.c
	* app/config/gimpscanner.c
	* app/core/gimp-edit.c
	* app/core/gimpchannel-combine.c
	* app/core/gimpcontainer.c
	* app/core/gimpdrawable-bucket-fill.c
	* app/core/gimpdrawable-combine.c
	* app/core/gimpdrawable.c
	* app/core/gimpgradient.c
	* app/core/gimpimage-flip.c
	* app/core/gimpimage-merge.c
	* app/core/gimpimage-projection.c
	* app/core/gimpimage.c
	* app/display/gimpdisplay-handlers.c
	* app/display/gimpdisplayshell-callbacks.c
	* app/display/gimpprogress.c
	* app/gui/info-dialog.c
	* app/gui/module-browser.c
	* app/gui/offset-dialog.c
	* app/plug-in/plug-in.c
	* app/tools/gimpdrawtool.c
	* app/tools/tool_manager.c
	* app/widgets/gimpactiongroup.c
	* app/widgets/gimpdialogfactory.c
	* app/widgets/gimpgradienteditor.c
	* app/widgets/gimpitemfactory.c
	* app/widgets/gimppropwidgets.c
	* app/widgets/gimpwidgets-utils.c
	* app/xcf/xcf-save.c
	* libgimp/gimpexport.c
	* libgimpwidgets/gimphelpui.c
	* libgimpwidgets/gimppixmap.c
	* libgimpwidgets/gimpunitmenu.c: replaced G_GNUC_FUNCTION,
	G_GNUC_PRETTY_FUNCTION, G_STRLOC and hardcoded function names in
	g_warning()s by G_STRFUNC.
2004-05-12 08:13:33 +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 3911d511cf app/core/Makefile.am new files split out of gimpchannel.[ch].
2003-09-04  Michael Natterer  <mitch@gimp.org>

	* app/core/Makefile.am
	* app/core/gimpchannel-combine.[ch]: new files split out of
	gimpchannel.[ch].

	* app/core/gimpchannel.[ch]: removed the combine functions here.

	* app/core/gimpdrawable-bucket-fill.c
	* app/core/gimpimage-mask-select.c
	* tools/pdbgen/pdb/channel.pdb: changed #includes accordingly.

	* app/pdb/channel_cmds.c: regenerated.
2003-09-04 12:18:40 +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 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
Michael Natterer dcb6f225d9 added new virtual function GimpItem::stroke().
2003-09-01  Michael Natterer  <mitch@gimp.org>

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

	* app/core/gimpchannel.c
	* app/vectors/gimpvectors.c: implement GimpItem::stroke().

	* app/core/gimpimage-mask.[ch] (gimp_image_mask_stroke): changed
	signature to match gimp_item_stroke() (the selection mask *really*
	should be a GimpChannel subclass).
	Removed global variable "gboolean gimp_image_mask_stroking"...

	* app/core/gimpimage.[ch]: ...and added "gboolean mask_stroking"
	to the GimpImage struct.

	* app/gui/vectors-commands.[ch]: removed vectors_stroke_vectors().

	* app/widgets/widgets-types.h: removed GimpStrokeItemFunc typedef.

	* app/widgets/gimpvectorstreeview.[ch]: removed "stroke_item_func"
	member and use gimp_item_stroke() instead.

	* app/gui/dialogs-constructors.c (dialogs_vectors_list_view_new)
	* app/gui/edit-commands.c (edit_stroke_cmd_callback)
	* app/gui/vectors-commands. (vectors_stroke_cmd_callback)
	* app/widgets/gimpselectioneditor.c
	(gimp_selection_editor_stroke_clicked)
	* tools/pdbgen/pdb/edit.pdb (gimp_edit_stroke): changed accordingly.

	* app/pdb/edit_cmds.c: regenerated.

	Note that there is no GUI for "stroke channel", although it would
	be utterly cool to have one, since currently slelection stroking
	cannot be masked by a selection (because we stroke the selection).
	Anyway, if anyone has an idea how to trigger "stroke channel" with
	another drawable active (the one to stroke to), please let me
	know...
2003-09-01 17:56:44 +00:00
Michael Natterer 2da93d692f app/core/gimpchannel.[ch] (gimp_channel_boundary)
2003-08-30  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpchannel.[ch] (gimp_channel_boundary)
	* app/core/gimpimage-mask.[ch] (gimp_image_mask_boundary)
	* app/core/gimplayer-floating-sel.[ch] (floating_sel_boundary):
	return const BoundSeg arrays because they are cached and not newly
	allocated.

	* app/base/boundary.[ch] (sort_boundary)
	* app/tools/gimpdrawtool.[ch] (gimp_draw_tool_draw_boundary):
	take const BoundSeg arrays.

	* app/core/gimpimage-mask.c (gimp_image_mask_stroke)
	* app/display/gimpdisplayshell-selection.c
	* app/tools/gimpeditselectiontool.c (init_edit_selection):
	changed accordingly.
2003-08-30 14:25:05 +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
Michael Natterer a319c455d9 app/widgets/Makefile.am new file defining the available help topics. Work
2003-08-21  Michael Natterer  <mitch@gimp.org>

	* app/widgets/Makefile.am
	* app/widgets/gimphelp-ids.h: new file defining the available help
	topics. Work in progress and totally unusable for matching to the
	help system. Stay tuned...

	* app/gui/about-dialog.c
	* app/gui/brushes-menu.c
	* app/gui/buffers-menu.c
	* app/gui/channels-commands.[ch]
	* app/gui/channels-menu.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/gradients-commands.c
	* app/gui/gradients-menu.c
	* app/gui/image-menu.c
	* app/gui/layers-commands.[ch]
	* app/gui/layers-menu.c
	* app/gui/module-browser.c
	* app/gui/offset-dialog.c
	* app/gui/palettes-menu.c
	* app/gui/patterns-menu.c
	* app/gui/resize-dialog.c
	* app/gui/select-commands.c
	* app/gui/templates-menu.c
	* app/gui/tips-dialog.c
	* app/gui/toolbox-menu.c
	* app/gui/vectors-commands.[ch]
	* app/gui/vectors-menu.c: replaced literal HTML file paths by help
	IDs from gimphelp-ids.h. Renamed some menu callbacks to be
	consistent with similar ones. This is just an intermediate commit
	and not finished.

	While browsing all the menus, I noticed that our "x to selection"
	functions are not consistent at all. They should all offer the
	REPLACE,ADD,SUBTRACT,INTERSECT options:

	* app/core/gimpchannel.[ch]: added new function
	gimp_channel_new_from_alpha(). Removed gimp_channel_layer_alpha()
	and gimp_channel_layer_mask().

	* app/core/gimpimage-mask.[ch]: added
	gimp_image_mask_select_alpha() and
	gimp_image_mask_select_component() which offer the full set of
	operation, feather and feather_radius parameters as the other
	selection functions.

	* app/core/gimpimage-mask-select.[ch]: removed
	gimp_image_mask_layer_alpha() and gimp_image_mask_layer_mask().

	* app/gui/channels-commands.c (channels_channel_to_selection): use
	gimp_image_mask_select_component() instead of implementing it
	here.

	* app/gui/image-menu.c
	* app/gui/layers-commands.[ch]: offer the full choice of
	REPLACE,ADD,SUBTRACT,INTERSECT with "Alpha to Selection" and "Mask
	to Selection".

	* tools/pdbgen/pdb/selection.pdb: changed accordingly.

	* app/pdb/selection_cmds.c: regenerated.
2003-08-21 15:54:47 +00:00
Michael Natterer e8a7307a8f added "guchar threshold" parameters all over the place instead of always
2003-07-10  Michael Natterer  <mitch@gimp.org>

	* app/base/boundary.[ch]: added "guchar threshold" parameters all
	over the place instead of always using 127. Made the HALF_WAY
	#define public.
	(find_empty_segs): don't crash if PR->tiles is NULL but treat
	PR->data as the entire buffer so the function can be used on
	PixelRegions of TempBufs.

	* app/core/gimpchannel.c
	* app/core/gimplayer-floating-sel.c
	* app/tools/gimpfuzzyselecttool.c: pass HALF_WAY to
	find_mask_boundary().
2003-07-10 11:59:38 +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
Michael Natterer f8081a8629 always return channel->x1,y1,x2,y2, *not* tx1,ty1,tx2,ty2 since the latter
2003-06-05  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpchannel.c (gimp_channel_bounds): always return
	channel->x1,y1,x2,y2, *not* tx1,ty1,tx2,ty2 since the latter
	contain bogus values if the mask is empty. Fixes bug #114419.

	* plug-ins/script-fu/scripts/unsharp-mask.scm: cleaned up
	while searching the bug.
2003-06-05 13:27:27 +00:00
Michael Natterer 2d90edbcf6 make sure channels end up at (0, 0) after scaling and resizing. Fixes bug
2003-06-02  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpchannel.c (gimp_channel_scale, resize): make sure
	channels end up at (0, 0) after scaling and resizing.
	Fixes bug #114213.
2003-06-02 15:19:03 +00:00
Michael Natterer 966fb5595f don't default to clip_result == TRUE (unlike the other transform
2003-05-20  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpchannel.c (gimp_channel_rotate): don't default to
	clip_result == TRUE (unlike the other transform functions).

	* app/core/gimpdrawable-transform.c
	(gimp_drawable_transform_tiles_rotate): fixed offset calculation.

	* app/core/gimpimage-rotate.c: change the image size *after* all items
	are rotated. Adjust all items' offsets after rotation. Rotate the
	resolutions too. Seems to work now and fixes bug #6101.

	* app/core/gimpimage.c (gimp_image_size_changed): emit
	"size_changed" on all vectors.

	* app/core/gimpitem-linked.[ch]: added gimp_item_linked_rotate().

	* app/gui/drawable-commands.c: flip and rotate linked items too.

	* app/vectors/gimpvectors.c (gimp_vectors_rotate): fixed rotation
	angles.

	Unrelated:

	* app/core/gimpimage-merge.c: don't #include "path.h".
2003-05-20 15:26:38 +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 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