Commit Graph

51 Commits

Author SHA1 Message Date
Michael Natterer 0908e53148 app: use the new unit conversion functions
and get rid of the brainfuck idea that app/ has to use _gimp_unit_foo()
functions, passing a gimp pointer. Instead, simply use the libgimpbase
API all over the place. Should we ever allow more than one gimp instance,
they will simply have to share one unit database.
2010-02-21 16:46:39 +01:00
Michael Natterer f18943f4ce Don't access the image's unit and resolution members directly 2010-02-03 19:53:45 +01: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 198416450d add optional parameter "PixelRegion *destPR" to
2008-11-08  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable.[ch]: add optional parameter "PixelRegion
	*destPR" to GimpDrawable::apply_region().

	* app/core/gimpdrawable-combine.[ch]: if the passed destPR is !=
	NULL, write the result of the combination into that region instead
	of the drawable's tiles. The region must have the exact size of
	the result.

	* app/core/gimp-edit.c
	* app/core/gimpchannel.c
	* app/core/gimpdrawable-blend.c
	* app/core/gimpdrawable-bucket-fill.c
	* app/core/gimpdrawable-shadow.c
	* app/core/gimpdrawable-stroke.c
	* app/core/gimpimagemap.c
	* app/core/gimplayer-floating-sel.c
	* app/paint/gimppaintcore.c: pass NULL as destPR. Code actually
	using this feature follows.


svn path=/trunk/; revision=27574
2008-11-08 19:52:18 +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 5b68a1d0eb renamed gimp_item_offsets() to gimp_item_get_offset() and
2008-11-03  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpitem.[ch]: renamed
	gimp_item_offsets() to gimp_item_get_offset() and
	gimp_item_set_offsets() to gimp_item_set_offset().

	* app/actions/drawable-commands.c
	* app/actions/layers-commands.c
	* app/core/<many>.c
	* app/display/gimpdisplayshell-dnd.c
	* app/display/gimpdisplayshell-preview.c
	* app/display/gimpdisplayshell-transform.c
	* app/display/gimpdisplayshell.c
	* app/paint/gimppaintcore-stroke.c
	* app/paint/gimppaintcore.c
	* app/paint/gimpsourcecore.c
	* app/text/gimptextlayer-xcf.c
	* app/tools/<many>.c
	* app/widgets/gimptoolbox-dnd.c
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/drawable_transform.pdb
	* tools/pdbgen/pdb/selection.pdb
	* tools/pdbgen/pdb/transform_tools.pdb
	* tools/pdbgen/pdb/vectors.pdb: changed accordingly.

	* app/pdb/drawable-cmds.c
	* app/pdb/drawable-transform-cmds.c
	* app/pdb/selection-cmds.c
	* app/pdb/vectors-cmds.c
	* app/pdb/transform-tools-cmds.c: regenerated.


svn path=/trunk/; revision=27529
2008-11-02 23:03:29 +00:00
Michael Natterer f0c79b81e3 Merge a modified and enhanced patch from the vector layer branch:
2008-10-25  Michael Natterer  <mitch@gimp.org>

	Merge a modified and enhanced patch from the vector layer branch:

	* app/core/gimpdrawable-stroke.[ch]: add new public API
	gimp_drawable_fill_boundary() and gimp_drawable_fill_vectors().

	Split the internal code up so that there are functions which turn
	the BoundSegs and GimpVectors into a GimpScanConvert and changed
	gimp_drawable_stroke_scan_convert() so it can either fill the
	shape or stroke it.


svn path=/trunk/; revision=27399
2008-10-25 13:12:48 +00:00
Michael Natterer 39af762f61 More merging from SOC 2006's vector layer branch:
2008-10-25  Michael Natterer  <mitch@gimp.org>

	More merging from SOC 2006's vector layer branch:

	* app/core/gimpitem.[ch]: add "gboolean push_undo" to
	GimpItem::stroke().

	* app/core/gimpdrawable-stroke.[ch]
	* app/paint/gimppaintcore-stroke.[ch]
	* app/paint/gimppaintcore.[ch] (gimp_paint_core_finish): add
	"push_undo" parameters here too.

	* app/actions/select-commands.c
	* app/actions/vectors-commands.c
	* app/core/gimpchannel.c
	* app/core/gimpselection.c
	* app/dialogs/stroke-dialog.c
	* app/tools/gimppainttool.c
	* app/vectors/gimpvectors.c
	* tools/pdbgen/pdb/edit.pdb
	* tools/pdbgen/pdb/paint_tools.pdb
	* tools/pdbgen/pdb/paths.pdb: pass TRUE all over the place.

	* app/pdb/edit-cmds.c
	* app/pdb/paint-tools-cmds.c
	* app/pdb/paths-cmds.c: regenerated.


svn path=/trunk/; revision=27398
2008-10-25 11:59:03 +00:00
Michael Natterer 3dfef0f15a rename GimpStrokeStyle to GimpFillStyle.
2008-10-23  Michael Natterer  <mitch@gimp.org>

	* app/core/core-enums.[ch]: rename GimpStrokeStyle to GimpFillStyle.

	* app/core/gimpfilloptions.[ch]
	* app/core/gimpdrawable-stroke.c
	(gimp_drawable_stroke_scan_convert): changed accordingly.


svn path=/trunk/; revision=27379
2008-10-23 21:30:28 +00:00
Michael Natterer 67a5eaea68 Merge a part of SOC 2006's vector layer branch:
2008-10-23  Michael Natterer  <mitch@gimp.org>

	Merge a part of SOC 2006's vector layer branch:

	* app/core/Makefile.am
	* app/core/core-types.h
	* app/core/gimpfilloptions.[ch]: new GimpContext subclass factored
	out of GimpStrokeOptions. Has "style" and "antialias" properties.

	* app/core/gimpstrokeoptions.[ch]: derive from GimpFillOptions
	and remove said properties.

	* app/core/gimpdrawable-stroke.c
	(gimp_drawable_stroke_scan_convert): changed accordingly.


svn path=/trunk/; revision=27378
2008-10-23 21:18:39 +00:00
Martin Nordholts e38ca5490a Rename the convenient channel offset defines from FOO_PIX to FOO as this
* app/base/base-types.h: Rename the convenient channel offset
defines from FOO_PIX to FOO as this increases readability.

* app/base/color-balance.c
* app/base/colorize.c
* app/base/desaturate.c
* app/base/hue-saturation.c
* app/base/siox.c
* app/base/threshold.c

* app/core/gimp-edit.c
* app/core/gimp-transform-region.c
* app/core/gimpchannel.c
* app/core/gimpdrawable-bucket-fill.c
* app/core/gimpdrawable-convert.c
* app/core/gimpdrawable-stroke.c
* app/core/gimpdrawable.c
* app/core/gimpimage-convert.c
* app/core/gimpimage.c
* app/core/gimppalette-import.c
* app/core/gimppickable.c

* app/gegl/gimpoperation*mode.c
* app/gegl/gimpoperationcolorbalance.c
* app/gegl/gimpoperationcolorize.c
* app/gegl/gimpoperationhuesaturation.c
* app/gegl/gimpoperationlevels.c
* app/gegl/gimpoperationposterize.c
* app/gegl/gimpoperationthreshold.c

* app/paint-funcs/subsample-region.c

* app/paint/gimpclone.c
* app/paint/gimppaintbrush.c

* app/widgets/gimpviewrenderer.c: Adapt.

svn path=/trunk/; revision=27324
2008-10-19 13:47:09 +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 1e8371361e app/actions/image-commands.c app/actions/select-commands.c
2007-12-26  Michael Natterer  <mitch@gimp.org>

	* app/actions/image-commands.c
	* app/actions/select-commands.c
	* app/core/gimp-edit.c
	* app/core/gimpdrawable-stroke.c
	* app/core/gimpimage-duplicate.c
	* app/core/gimpimage-preview.c
	* app/core/gimpimage-rotate.c
	* app/core/gimpimageundo.c
	* app/core/gimpitem-preview.c
	* app/dialogs/grid-dialog.c
	* app/dialogs/layer-options-dialog.c
	* app/dialogs/offset-dialog.c
	* app/dialogs/stroke-dialog.c
	* app/display/gimpdisplayshell-scale.c
	* app/display/gimpdisplayshell-title.c
	* app/display/gimpdisplayshell.c
	* app/display/gimpstatusbar.c
	* app/paint/gimppaintoptions.c
	* app/tools/gimpmagnifytool.c
	* app/tools/gimpmeasuretool.c
	* app/tools/gimppainttool.c
	* app/tools/gimprectangletool.c
	* app/tools/gimprotatetool.c
	* app/tools/gimpscaletool.c
	* app/tools/gimptexttool.c
	* app/vectors/gimpvectors-export.c
	* app/vectors/gimpvectors-import.c
	* app/widgets/gimpcursorview.c
	* app/widgets/gimpimagepropview.c
	* app/widgets/gimptoolbox-dnd.c
	* app/widgets/gimpviewrendererdrawable.c
	* app/widgets/gimpviewrendererimage.c
	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c: use gimp_image_get/set_resolution() instead
	of accessing the GimpImage members directly.


svn path=/trunk/; revision=24436
2007-12-26 17:33:41 +00:00
Sven Neumann b7588c5a09 formatting.
2007-10-12  Sven Neumann  <sven@gimp.org>

	* app/core/gimpdrawable-stroke.c: formatting.

svn path=/trunk/; revision=23810
2007-10-12 13:14:43 +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 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
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
Michael Natterer 4fb1743f55 renamed puclic functions, defines and enums to live in a proper "boundary"
2005-08-20  Michael Natterer  <mitch@gimp.org>

	* app/base/boundary.[ch]: renamed puclic functions, defines and
	enums to live in a proper "boundary" namespace. Cleaned up and
	simplified internal code even more.

	* app/core/gimpchannel.c
	* app/core/gimpdrawable-stroke.c
	* app/core/gimplayer-floating-sel.c
	* app/paint/gimppaintcore-stroke.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimpfuzzyselecttool.c
	* app/tools/gimppainttool.c: changed accordingly.
2005-08-20 15:46:37 +00:00
Sven Neumann 9b29707961 renamed property "miter" to "miter-limit" and added a description to be
2005-05-19  Sven Neumann  <sven@gimp.org>

	* app/core/gimpstrokeoptions.[ch]: renamed property "miter" to
	"miter-limit" and added a description to be used as a tooltip in
	the stroke editor.

	* app/core/gimpdrawable-stroke.c
	* app/widgets/gimpstrokeeditor.c: changed accordingly.
2005-05-19 15:17:30 +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 7ab5fe2903 Replacing the call to gimp_channel_is_empty() by a simple
2004-10-20  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable-stroke.c
	(gimp_drawable_stroke_scan_convert): Replacing the call to
	gimp_channel_is_empty() by a simple gimp_drawable_mask_intersect()
	was wrong because gimp_channel_is_empty() makes sure that the
	selection doesn't mask itself while being stroked.
2004-10-20 22:06:00 +00:00
Michael Natterer cb48cef8be added gimp_drawable_mask_intersect() which returns the same bounding box
2004-10-20  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable.[ch]: added gimp_drawable_mask_intersect()
	which returns the same bounding box as gimp_drawable_mask_bounds(),
	but returns TRUE only if there is a non-empty intersection between
	the drawable and the selection, or no selection at all. It also
	returns the intersection as x,y,width,height instead of the
	eeky x1,y1,x2,y2.

	* app/core/gimp-edit.c
	* app/core/gimpdrawable-blend.c
	* app/core/gimpdrawable-bucket-fill.c
	* app/core/gimpdrawable-desaturate.c
	* app/core/gimpdrawable-equalize.c
	* app/core/gimpdrawable-histogram.c
	* app/core/gimpdrawable-invert.c
	* app/core/gimpdrawable-stroke.c
	* app/core/gimpimagemap.c
	* app/core/gimpselection.c
	* tools/pdbgen/pdb/color.pdb
	* tools/pdbgen/pdb/transform_tools.pdb: either switch from
	gimp_drawable_mask_bounds() to _intersect() or check the return
	values of _mask_bounds() manually to avoid operations on empty
	areas. Return successfully because it's a nop, not a failure.
	Fixes bug #155733 for the core.

	* app/pdb/color_cmds.c
	* app/pdb/transform_tools_cmds.c: regenerated.
2004-10-19 22:52:04 +00:00
Simon Budig 910c506e4a app/core/gimpdrawable-stroke.c Don't simplify the border of the selection.
2003-12-31  Simon Budig  <simon@gimp.org>

	* app/core/gimpdrawable-stroke.c
	* app/paint/gimppaintcore-stroke.c: Don't simplify the border
	of the selection. Quite some people were confused by the
	polygonal look of a stroked ellipse. The old behaviour doesn't
	look good, but the new one isn't really better. Since the
	old behaviour is more predictable, I am reverting this for now
	(Please note that the function to simplify the boundary still
	is available, it just is unused).

	Hopefully at some point it will be possible to have non-integer
	boundary coordinates or even a more sophisticated set of
	"vector-selection" tools.
2003-12-31 02:26:32 +00:00
Simon Budig c95bca30e9 Dashed stroking is here... :-)
2003-12-27  Simon Budig  <simon@gimp.org>

	Dashed stroking is here...  :-)

	* app/core/gimpdrawable-stroke.c: actually use the dash pattern
	from the options

	* app/core/gimpscanconvert.c: Normalize the dash pattern, so
	that libart does the right thing.

	* app/core/gimpstrokeoptions.c: Fix default value for dash
	offset, handle the property_get for PROP_DASH_INFO correct.

	* app/widgets/gimpdasheditor.[ch]
	* app/widgets/Makefile.am
	* app/widgets/widgets-types.h: New widget to edit a dash
	pattern.

	* app/widgets/gimpstrokeeditor.c: Use it.
2003-12-27 19:25:19 +00:00
Michael Natterer b7dbaacc1f fixed cut'n'paste bug: always use offset_x, not offset_y for x coordinates
2003-12-21  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable-stroke.c (gimp_drawable_stroke_boundary):
	fixed cut'n'paste bug: always use offset_x, not offset_y for x
	coordinates (spotted by Olivier Gondouin).
2003-12-21 15:57:43 +00:00
Sven Neumann 722fb64dbd Fixed some selection editor problems (bug #127644):
2003-11-22  Sven Neumann  <sven@gimp.org>

	Fixed some selection editor problems (bug #127644):

	* plug-ins/sel2path/sel2path.c: use the given image_ID, ignore the
	drawable_ID. This plug-in doesn't operate on a drawable at all.

	* plug-ins/imagemap/imap_main.c: pass a valid image_ID to sel2path.

	* app/gui/vectors-commands.c: don't attempt to create a valid
	drawable_ID for the call to sel2path since it isn't used anyway.

	* app/core/gimpdrawable-stroke.c (gimp_drawable_stroke_boundary):
	just return when being called with an empty boundary.
2003-11-22 13:38:11 +00:00
Simon Budig a07815f504 removed erraneous offset by 0.5 pixels.
2003-11-13 Simon Budig  <simon@gimp.org>

	* app/core/gimpdrawable-stroke.c: removed erraneous offset by
	0.5 pixels.

	* app/core/gimpstrokeoptions.c: Adjusted default width of libart
	strokes so that a rectangular selection gets stroked with sharp
	edges.
2003-11-13 03:27:21 +00:00
Michael Natterer 6a8e112921 added new local variables to hold the drawable's offsets instead of
2003-10-06  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable-stroke.c
	(gimp_drawable_stroke_scan_convert): added new local variables to
	hold the drawable's offsets instead of abusing x2 and y2. Use
	existing APIs instead of re-implementing stuff. Removed an
	obsolete call to tile_manager_set_offsets(). Cleanup.
2003-10-06 17:13:57 +00:00
Michael Natterer d734595991 create a channel which the size of the layer, not of the image...
2003-10-06  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpchannel.c (gimp_channel_new_from_alpha): create
	a channel which the size of the layer, not of the image...

	* app/core/gimpchannel-select.c (gimp_channel_select_alpha):
	...and take the layer's offsets into account.

	* app/core/gimpscanconvert.[ch] (gimp_scan_convert_render): added
	off_x and off_y parameters and don't use the passed TileManager's
	offsets.

	* app/core/gimpchannel-select.c
	* app/core/gimpdrawable-stroke.c
	* app/tools/gimpiscissorstool.c: changed accordingly.
2003-10-06 16:43:05 +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
Simon Budig e8831f5502 Implemented simplify_boundary (), which tries to reduce the number of
2003-10-01  Simon Budig  <simon@gimp.org>

	* app/base/boundary.[ch]: Implemented simplify_boundary (),
	which tries to reduce the number of coordinates to get
	better interpolation for stroking.

	The results still need tweaking.

	* app/core/gimpdrawable-stroke.c: Use it.
2003-10-01 00:02:48 +00:00
Michael Natterer 657b49b402 removed "width", "height" and "antialias" from the GimpScanConvert struct
2003-09-30  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpscanconvert.[ch]: removed "width", "height" and
	"antialias" from the GimpScanConvert struct and from
	gimp_scan_convert_new(). Removed gimp_scan_convert_to_channel().
	Added "gboolean antialias" to gimp_scan_convert_render().
	Some general cleanup.

	* app/core/gimpdrawable-stroke.c
	* app/core/gimpimage-mask-select.c
	* app/tools/gimpiscissorstool.c: changed accordingly.

	* app/core/gimpdrawable-stroke.c: renamed
	gimp_drawable_stroke_scanconvert_stroke() to
	gimp_drawable_stroke_scan_convert() and removed the "gboolean
	use_mask_bounds" parameter since we can't decide if it's the
	selection's boundary which is stroked. Instead use
	gimp_channel_is_empty() on the selection which will return FALSE
	while the selection is being stroked.

	* app/paint/gimppaintcore-stroke.c: cleanup.

	(gimp_paint_core_stroke_boundary): don't use "gint i" twice.

	(gimp_paint_core_stroke_vectors): no need to manually close a
	closed stroke.
2003-09-30 18:06:19 +00:00
Simon Budig 20683bede5 Accept NULL for ret_closed.
2003-09-30  Simon Budig  <simon@gimp.org>

	* app/vectors/gimpbezierstroke.c:
	(gimp_bezier_stroke_interpolate) Accept NULL for ret_closed.

	* app/widgets/gimppreviewrenderervectors.c: removed "closed"
	variable.

	* app/core/gimpdrawable-stroke.[ch]: Factored out the final
	rendering of the scanconvert. Implemented
	gimp_drawable_stroke_boundary. Unfortunately the results are
	not really good, since the boundary calculation code is
	too exact for this purpose. I have a rough idea how to fix this.

	* app/core/gimpchannel.c: changed accordingly.
2003-09-30 15:16:51 +00:00
Michael Natterer d0e1c1c661 cleanup.
2003-09-30  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintcore-stroke.c: cleanup.

	(gimp_paint_core_stroke_boundary): don't push a separate undo
	for each part of the boundary.

	* app/core/gimpdrawable-stroke.[ch]: added empty stub
	gimp_drawable_stroke_boundary(). Changed
	gimp_drawable_stroke_vectors() to take the GimpStrokeOptions as
	second parameter.

	* app/core/gimpchannel.c (gimp_channel_stroke): use it. No need
	to push an undo group around gimp_paint_core_stroke_boundary().

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

	* app/widgets/gimpselectioneditor.[ch]: added a GimpStrokeItemFunc
	pointer and use it for stroking.

	* app/gui/edit-commands.[ch] (edit_stroke_selection): a
	GimpStrokeItemFunc which strokes the selection using the
	stroke-dialog.

	* app/gui/dialogs-constructors.c: use it for the selection editor.
2003-09-30 02:44:17 +00:00
Simon Budig fba6a1a77a replaced gimp_scan_convert_set_resolution with
2003-09-30  Simon Budig  <simon@gimp.org>

	* app/core/gimpscanconvert.[ch]: replaced
	gimp_scan_convert_set_resolution with
	gimp_scan_convert_set_pixel_ratio where you specify the pixel
	ratio (width/height). Also made the stroke-width consistent
	with other places in the gimp by using the Y-Resolution as
	the base for the calculations.

	* app/core/gimpdrawable-stroke.c: changed accordingly.
2003-09-30 01:03:25 +00:00
Sven Neumann f4c7ef9914 app/core/gimpdrawable-stroke.c app/core/gimpstrokeoptions.[ch] removed the
2003-09-30  Sven Neumann  <sven@gimp.org>

	* app/core/gimpdrawable-stroke.c
	* app/core/gimpstrokeoptions.[ch]
	* app/gui/stroke-dialog.c: removed the resolution property again.
	The object should stay resolution independent. The resolution can
	be taken from the image it is used with.
2003-09-30 00:15:00 +00:00
Simon Budig 3761462869 Added support for setting X- and Y-resolution for stroking paths. The
2003-09-30  Simon Budig  <simon@gimp.org>

	* app/core/gimpscanconvert.[ch]: Added support for setting
	X- and Y-resolution for stroking paths. The width of a path
	has to be given in pixels, using X-resolution.

	* app/core/gimpstrokeoptions.[ch]: Added "resolution" property,
	so that conversion between various width-units can happen.
	Should be set to the target images X-resolution.

	* app/gui/stroke-dialog.c: set the resolution of the options.

	* app/core/gimpdrawable-stroke.c: Use that stuff, cleanup.
2003-09-29 23:45:06 +00:00
Sven Neumann 55a0c4c960 removed "dash-unit" property and renamed "width-unit" to "unit".
2003-09-29  Sven Neumann  <sven@gimp.org>

	* app/core/gimpstrokeoptions.[ch]: removed "dash-unit" property and
	renamed "width-unit" to "unit".

	* app/core/gimpdrawable-stroke.c
	* app/widgets/gimpstrokeeditor.c: changed accordingly.
2003-09-29 11:13:21 +00:00
Simon Budig 4fce98042d Fixed glitch to enable dashed strokes with width < 1.0.
2003-09-29  Simon Budig  <simon@gimp.org>

	* app/core/gimpscanconvert.c: Fixed glitch to enable dashed
	strokes with width < 1.0.

	* app/core/gimpdrawable-stroke.c: Actually pass the miter
	limit to gimp_scan_convert_stroke ().
2003-09-28 22:33:08 +00:00
Simon Budig 7c3b455924 "The last of the Oldenburg commits"
2003-09-28  Simon Budig  <simon@gimp.org>

	"The last of the Oldenburg commits"

	Thanks to the team of the Oldenburg Linux Developers Meeting 2003
	for providing a nice hacking environment.

	* app/vectors/gimpvectors.c: Add a default stock_id.

	* app/widgets/gimppreviewrenderervectors.[ch]: New Widget
	to render the preview of vectors. Just renders a stock item
	now, since I was unable to figure out how to properly draw
	in the GtkWidget.

	* app/widgets/Makefile.am
	* app/widgets/widgets-types.h: Changed accordingly.

	* app/widgets/gimppreviewrenderer-utils.c: Use the new widget.

	* app/core/gimpscanconvert.c
	* app/core/gimpdrawable-stroke.c: Use higher prescision for
	libart-stroking vectors. Reduces artefacts.

	* app/pdb/paths_cmds.c
	* libgimp/gimppaths_pdb.c: Regenerated after Tors changes.
2003-09-28 04:00:50 +00:00
Michael Natterer f5b98a4822 set the transformed color's alpha to OPAQUE so it works with
2003-09-27  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable-bucket-fill.c
	(gimp_drawable_bucket_fill_full): set the transformed color's
	alpha to OPAQUE so it works with color_region().

	* app/core/gimpdrawable-stroke.c (gimp_drawable_stroke_vectors):
	no need to transform the color into a newly allocated array,
	simply use guchar[MAX_CHANNELS] instead.

	Cleaned up both functions to use RED_PIX, GREEN_PIX and BLUE_PIX
	instead of 0, 1 and 2.
2003-09-27 20:42:31 +00:00
Michael Natterer ab34b3ee94 added new functions color_region_mask() which works like color_region()
2003-09-27  Michael Natterer  <mitch@gimp.org>

	* app/paint-funcs/paint-funcs.[ch]: added new functions
	color_region_mask() which works like color_region() but takes an
	additional maskPR parameters and pattern_region() which fills
	destPR with a TempBuf of *matching color depth*.

	* app/paint-funcs/paint-funcs-generic.h: added corresponding
	color_pixels_mask() and pattern_pixels().

	* app/core/gimpimage.[ch] (gimp_image_transform_temp_buf): new
	function which transforms a TempBuf to a specified drawable's
	color space.

	* app/core/gimpdrawable-bucket-fill.c: the functions were factored
	out here. Removed them and use the new stuff.

	* app/core/core-enums.[ch]: added enum GimpStrokeStyle which can
	be one of { SOLID, PATTERN }.

	* app/core/gimpstrokeoptions.[ch]: added "GimpStrokeStyle style"
	property, cleanup.

	* app/core/gimpdrawable-stroke.c: honor the new "style" property
	and call the new color_region_mask() and pattern_region()
	functions accordingly, cleanup.

	* app/widgets/gimpstrokeeditor.c: added a GUI for the stroke
	style. Ugly but works.

	* app/gui/stroke-dialog.c: undefine "foreground" and "pattern" and
	set the user context as parent context so we get these properties
	from the global settings.
2003-09-27 20:04:07 +00:00
Simon Budig ee3394754b changed the API of gimp_drawable_stroke_vectors to accept
2003-09-27  Simon Budig  <simon@gimp.org>

	* app/core/gimpdrawable-stroke.[ch]: changed the API of
	gimp_drawable_stroke_vectors to accept GimpStrokeOptions
	instead of lots of individual parameters.

	* app/vectors/gimpvectors.c: changed accordingly.
2003-09-27 15:29:21 +00:00
Simon Budig 3f76868aee This still is very much in progress. I just want to commit this to avoid
2003-09-27  Simon Budig  <simon@gimp.org>

	This still is very much in progress. I just want to commit this
	to avoid lossage. It kind of works but there definitely is
	code in the wrong place now.

	* app/gui/stroke-dialog.[ch]: New files implementing a dialog
	containing Svens GimpStrokeEditor-Widget.

	* app/gui/Makefile.am: changed accordingly.

	* app/gui/vectors-commands.c: Open the StrokeOptions-Dialog when
	the "stroke" menu entry gets selected.

	* app/vectors/gimpvectors.c: Remove bad #ifdef hacks and use
	Libart/Paintcore-Stroking depending on the type of the stroke_desc
	Parameter.

	* app/core/gimpstrokeoptions.c: Proper handle the Enum-Properties.

	* app/core/gimpscanconvert.[ch]: make the antialias-parameter
	to gimp_scan_convert_new a gboolean.

	* app/tools/gimpiscissorstool.c
	* app/core/gimpdrawable-stroke.c
	* app/core/gimpimage-mask-select.c: Changed accordingly.
2003-09-27 02:34:18 +00:00
Simon Budig 8172df9a15 Add some parameters to gimp_scan_convert_stroke () to expose the
2003-09-26  Simon Budig  <simon@gimp.org>

	* app/core/gimpscanconvert.[ch]: Add some parameters to
	gimp_scan_convert_stroke () to expose the Miter-Setting
	and enable dashing of vectors.

	* app/core/gimpdrawable-stroke.c: Use the dashing feature.

	* app/vectors/gimpvectors.c: Expose a bad hack (opacity
	controls the libart-stroke width) in a #define. Default
	is not enabled.
2003-09-26 00:41:10 +00:00
Simon Budig 2c212214fe Fixed vectors stroking on GRAY* and INDEXED* layers.
2003-09-23  Simon Budig  <simon@gimp.org>

	* app/core/gimpdrawable-stroke.c: Fixed vectors stroking on
	GRAY* and INDEXED* layers.

	* app/tools/gimpvectortool.c: Made the polygonal mode more
	consistent.
2003-09-22 23:19:22 +00:00
Simon Budig 460b3e84e5 Adjusted to make sure that no successive LINETOs to the same coordinate
2003-09-21  Simon Budig  <simon@gimp.org>

	* app/core/gimpscanconvert.c: Adjusted to make sure that
	no successive LINETOs to the same coordinate are in the
	path. Libart chokes on that.

	* app/core/gimpdrawable-stroke.c: Respect the offsets of the
	target drawable.

	* app/tools/gimpvectortool.c: Removed status message in
	VECTORS_FINISHED mode as requested by Ville Pätsi.

	* app/vectors/gimpvectors.c: Determine the stroke parameters
	from the current context (opacity/color/paint_mode).
	The other parameters are not yet supported.
2003-09-21 19:07:48 +00:00
Sven Neumann 3ee7c4d0e0 renamed new enums to use "style" instead of the overloaded term "type".
2003-09-21  Sven Neumann  <sven@gimp.org>

	* app/core/core-enums.[ch]: renamed new enums to use "style" instead
	of the overloaded term "type". Also renamed GimpGridType while I was
	on it.

	* app/core/gimpdrawable-stroke.[ch]
	* app/core/gimpgrid.[ch]
	* app/core/gimpscanconvert.[ch]
	* app/display/gimpdisplayshell.c
	* app/vectors/gimpvectors.c
	* app/gui/grid-dialog.c: changed accordingly.
2003-09-21 10:45:19 +00:00
Simon Budig 09630e45f9 Dave Neary <bolsh@gimp.org>
2003-09-21  Simon Budig  <simon@gimp.org>
            Dave Neary  <bolsh@gimp.org>

	* app/core/gimpdrawable-stroke.c: gimp_image_apply_image () must
	not get the pixel Region twice, use NULL for src1_tiles, which
	then defaults to the drawables tiles. Also pixel_region_init()
	does not take the offsets set by tile_manager_set_offsets into
	account. Use 0,0 instead of x1,y1. Fixes bad crashes.

	* app/core/gimpscanconvert.c: fixed crash for the same reason.

	* app/vectors/gimpvectors.c: Enabled the new stroking by default.
	Of course there should be a dialog to tweak the settings...  :-)
2003-09-21 00:58:04 +00:00