Commit Graph

144 Commits

Author SHA1 Message Date
Martin Nordholts a9bb68a248 Include gimpprojection.h for gimp_projection_get_tiles().
2008-08-13  Martin Nordholts  <martinn@svn.gnome.org>

	* app/paint/gimppaintcore.c: Include gimpprojection.h for
	gimp_projection_get_tiles().

svn path=/trunk/; revision=26528
2008-08-13 17:30:08 +00:00
Sven Neumann a59c7ccaf0 use gimp_projection_get_tiles() instead of doing the same through the
2008-08-12  Sven Neumann  <sven@gimp.org>

	* app/paint/gimppaintcore.c (gimp_paint_core_start): use
	gimp_projection_get_tiles() instead of doing the same through 
the
	GimpPickable interface.


svn path=/trunk/; revision=26522
2008-08-12 18:59:04 +00:00
Sven Neumann 3b067cba23 added gimp_image_get_projection().
2008-08-07  Sven Neumann  <sven@gimp.org>

	* app/core/gimpimage.[ch]: added gimp_image_get_projection().

	* app/display/gimpdisplay-handlers.c
	* app/display/gimpdisplayshell-render.c
	* app/display/gimpdisplayshell-scroll.c
	* app/paint/gimppaintcore.c
	* app/paint/gimpsourcecore.c
	* app/tools/gimpbycolorselecttool.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimpimagemaptool.c
	* app/tools/gimpiscissorstool.c
	* app/tools/gimppainttool.c
	* app/widgets/gimpsamplepointeditor.c
	* tools/pdbgen/pdb/image.pdb: use the new accessor function.

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


svn path=/trunk/; revision=26413
2008-08-07 09:17:46 +00:00
Sven Neumann caa4c529f5 removed 'use_pressure' field from GimpPaintCore.
2008-07-17  Sven Neumann  <sven@gimp.org>

	* app/paint/gimppaintcore.[ch]: removed 'use_pressure' field 
from
	GimpPaintCore.
	
	* app/paint/gimppaintoptions.[ch]: removed 'use_pressure' 
parameter.

	* app/paint/gimpairbrush.c
	* app/paint/gimpbrushcore.c
	* app/paint/gimpclone.c
	* app/paint/gimpconvolve.c
	* app/paint/gimpdodgeburn.c
	* app/paint/gimperaser.c
	* app/paint/gimpheal.c
	* app/paint/gimppaintbrush.c
	* app/paint/gimpsmudge.c
	* app/tools/gimppainttool.c: changed accordingly.


svn path=/trunk/; revision=26225
2008-07-17 19:00:13 +00:00
Sven Neumann efa6b2b820 Fix for bug #494049 (painting doesn't update the histogram):
2007-11-13  Sven Neumann  <sven@gimp.org>

	Fix for bug #494049 (painting doesn't update the histogram):

	* app/paint/gimppaintcore.c: freeze the drawable preview while we
	are painting. Update the drawable instead of the image.

	* app/widgets/gimphistogrameditor.c: use a short timeout instead
	of an idle handler to update the histogram.

svn path=/trunk/; revision=24143
2007-11-13 10:59:32 +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
Michael Natterer 4625597ab8 update the image, not the drawable so we avoid constantly invalidating the
2007-06-27  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpimagemap.c (gimp_image_map_clear)
	(gimp_image_map_do): update the image, not the drawable so we
	avoid constantly invalidating the drawable preview.

	* app/tools/gimpimagemaptool.c (gimp_image_map_tool_response):
	invalidate the drawable preview here.

	* app/paint/gimppaintcore.c (gimp_paint_core_paste)
	(gimp_paint_core_replace): clean up drawable offset handling code.


svn path=/trunk/; revision=22843
2007-06-26 22:41:06 +00:00
Michael Natterer 1a13f51e02 Part one of fix for bug #449141 (fixes the projection but still leaves
2007-06-21  Michael Natterer  <mitch@gimp.org>

	Part one of fix for bug #449141 (fixes the projection but still
	leaves some image previews unupdated).

	* app/core/gimpimage.c (lots of functions)
	* app/paint/gimppaintcore.c (gimp_paint_core_finish)
	* app/file/file-open.c (file_open_sanitize_image): removed calls
	to gimp_viewable_invalidate_preview(image).

	* app/file/file-open.c (file_open_sanitize_image): update and
	flush the entire image instead. Load plug-ins are not required to
	call gimp_drawable_update() or anything else to make sure the
	projection is up-to-date.

	* app/core/gimpimage.c (gimp_image_real_flush): inavlidate the
	image preview here because we now create it from the projection.
	(this is still not the entirely correct place though).


svn path=/trunk/; revision=22815
2007-06-21 10:09:27 +00:00
Michael Natterer b2ef4856b0 set core->saved_proj_tiles to NULL after unrefing them.
2007-03-31  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintcore.c (gimp_paint_core_start): set
	core->saved_proj_tiles to NULL after unrefing them.

	* app/paint/gimppaintcore.h: whitespace fixes.


svn path=/trunk/; revision=22210
2007-03-31 16:43:41 +00:00
Michael Natterer bdc91d6c52 Remove support for the old undo pop and free cruft:
2007-02-03  Michael Natterer  <mitch@gimp.org>

	Remove support for the old undo pop and free cruft:

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

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

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

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


svn path=/trunk/; revision=21845
2007-02-03 22:25:32 +00:00
Michael Natterer 792ba89818 app/paint/gimppaintcore-undo.[ch] removed...
2007-02-03  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintcore-undo.[ch]
	* app/paint/gimpink-undo.[ch]: removed...

	* app/paint/Makefile.am
	* app/paint/paint-types.h
	* app/paint/gimppaintcoreundo.[ch]
	* app/paint/gimpinkundo.[ch]: ...and added as proper undo classes.

	* app/paint/gimppaintcore.[ch]
	* app/paint/gimpink.c: push undos using the new classes.


svn path=/trunk/; revision=21842
2007-02-03 18:48:00 +00:00
Sven Neumann 125c3d9632 added some comments.
2007-01-22  Sven Neumann  <sven@gimp.org>

	* app/paint/gimppaintbrush.c: added some comments.

	* app/paint/gimppaintcore.c: sprinkled with const qualifiers.


svn path=/trunk/; revision=21756
2007-01-22 17:24:17 +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 1b1299aff3 added GError** parameter to GimpPaintCore::start().
2006-09-26  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintcore.[ch]: added GError** parameter to
	GimpPaintCore::start().

	* app/tools/gimppainttool.c (button_press): display the error in
	the statusbar.

	* app/paint/gimppaintcore-stroke.c: pass a NULL error, effectively
	swallowing mssages. Will fix that later.

	* app/paint/gimpbrushcore.c
	* app/paint/gimpclone.c
	* app/paint/gimpsourcecore.c: changed accordingly. Set the error
	instead of calling g_message().

	* app/paint/gimpheal.c
	* app/paint/gimpperspectiveclone.c: implement start() and bail out
	early on indexed drawables instead of showing a g_message() in
	other functions that are called later.

	* app/tools/gimptool.[ch]: added GError** to GimpTool::initialize().

	* app/tools/gimptool.c (gimp_tool_initialize): display the error
	in the statusbar. Keep the external API GError-free.

	* app/tools/gimprectangletool.[ch]: added GError** to
	gimp_rectangle_tool_initialize().

	* app/tools/gimpbrightnesscontrasttool.c
	* app/tools/gimpcolorbalancetool.c
	* app/tools/gimpcolorizetool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimphuesaturationtool.c
	* app/tools/gimpimagemaptool.c
	* app/tools/gimplevelstool.c
	* app/tools/gimpperspectiveclonetool.c
	* app/tools/gimpposterizetool.c
	* app/tools/gimpthresholdtool.c
	* app/tools/gimptransformtool.c: changed accordingly. Set the
	errors in initialize() instead of using gimp_message().

	* app/tools/gimpblendtool.c: implement initialize() and bail out
	early on indexed images instead of showing a gimp_message() in
	button_press().
2006-09-26 20:55:40 +00:00
Michael Natterer c598fe6566 added some missing g_return_if_fail() and moved variables to local scopes.
2006-09-26  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintcore.c: added some missing g_return_if_fail()
	and moved variables to local scopes.
2006-09-26 09:59:13 +00:00
Sven Neumann a44d24ccf3 added construct-only property "undo-desc". Use this when pushing an undo
2006-09-03  Sven Neumann  <sven@gimp.org>

        * app/paint/gimppaintcore.[ch]: added construct-only property
        "undo-desc". Use this when pushing an undo instead of attempting
        an unsuccessful lookup of the GimpPaintInfo object.

        * tools/pdbgen/pdb/paint_tools.pdb
        * app/tools/gimppainttool.c: use paint_info->blurb as undo
        description when constructing the paint core.

        * app/pdb/paint_tools_cmds.c: regenerated.
2006-09-03 13:16:58 +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
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 cef9db57fe renamed gimp_drawable_data() to gimp_drawable_get_tiles().
2006-04-07  Sven Neumann  <sven@gimp.org>

	* app/core/gimpdrawable.[ch]: renamed gimp_drawable_data() to
	gimp_drawable_get_tiles().

	[lots of files]: changed accordingly.
2006-04-07 09:21:18 +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 684fe95ce3 use G_DEFINE_TYPE().
2005-12-07  Michael Natterer  <mitch@gimp.org>

	* app/paint/*: use G_DEFINE_TYPE().
2005-12-07 21:11:53 +00:00
Michael Natterer 8dcebeaa7a replaced manual calculation of the offset of a pixel in a tile (marked as
2005-09-03  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintcore.c (gimp_paint_core_get_orig_image)
	(gimp_paint_core_get_orig_proj): replaced manual calculation of
	the offset of a pixel in a tile (marked as /* dubious... */ for a
	reason) by simply using the offset parameters of tile_data_pointer().
2005-09-03 20:39:17 +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
Michael Natterer 26374e814e Immplement "Sample Merged" for the clone tool. Fixes bug #123627.
2005-08-28  Michael Natterer  <mitch@gimp.org>

	Immplement "Sample Merged" for the clone tool. Fixes bug #123627.

	* app/paint/gimppaintcore.[ch] (struct GimpPaintCore): added
	members "saved_proj_tiles" which stores the unmodified projection,
	"orig_proj_buf" which stores the unmodified temp paint application
	buf and "use_saved_proj" which controls if all the additional
	stuff should be allocated and managed.

	(gimp_paint_core_start): allocate the saved_proj_tiles if needed.

	(gimp_paint_core_get_orig_proj): new function like
	gimp_paint_core_get_orig_image() which returns unmodified
	projection pixels for paint application.

	(gimp_paint_core_validate_saved_proj_tiles): new function like
	gimp_paint_core_validate_undo_tiles() which copies the tiles that
	will be dirtied to saved_proj_tiles.

	(gimp_paint_core_paste): call above save_proj_tiles() so
	projection tiles are saved before dirtying them.

	* app/paint/gimpclone.[ch]: replaced member src_drawable by
	src_pickable and use the image's projection if sample_merged it
	TRUE. Adjust src offsets accordingly and use GimpPaintCore's new
	get_orig_proj() API to get the src pixels.

	* app/paint/gimpcloneoptions.[ch]: added boolean "sample_merged"
	property.

	* app/tools/gimpclonetool.c: follow GimpClone's src_drawable ->
	src_pickable change.

	(gimp_clone_tool_button_press): set the paint_core's
	"use_saved_proj" boolean before chaining up.

	(gimp_clone_options_gui): add a "Sample Merged" toggle button.
2005-08-28 19:17:44 +00:00
Michael Natterer d4177c88ce added GIMP_UNDO_INK.
2005-01-14  Michael Natterer  <mitch@gimp.org>

	* app/core/core-enums.[ch] (enum GimpUndoType): added GIMP_UNDO_INK.

	* app/paint/gimppaintcore.[ch]: added virtual function
	GimpPaintCore::push_undo() and call it.

	* app/paint/gimppaintcore-undo.[ch]: made it the default
	implementation.

	* app/paint/gimpink-blob.[ch]: added blob_duplicate().

	* app/paint/gimpink.[ch]: added a "start_blob" (just like
	GimpPaintCore::start_coords) which gets set whenever we start a
	new stroke or line. Removed ink->lastx and ink->lasty because
	they are the same as paint_core->last_coords.

	* app/paint/Makefile.am
	* app/paint/gimpink-undo.[ch]: new files implementing an
	undo step for ink which restores the last blob used along
	with the whole ink state. Fixes bug #163670.
2005-01-14 20:13:54 +00:00
Sven Neumann 0c2d88e992 app/tools/Makefile.am added gimp_tool_motion_constrain(),
2004-08-22  Sven Neumann  <sven@gimp.org>

	* app/tools/Makefile.am
	* app/tools/tools-utils.[ch]: added gimp_tool_motion_constrain(),

	* app/paint/gimppaintcore.[ch]: removed gimp_paint_core_constrain().

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

	* app/tools/gimpblendtool.[ch]: use gimp_tool_motion_constrain()
	instead of duplicating that functionality.

	* app/tools/gimpmeasuretool.c: use gimp_tool_motion_constrain()
	instead of implementing completely different constraints.
2004-08-22 21:48:50 +00:00
Michael Natterer 85c2b2dd4f removed enum GimpPaintCoreState.
2004-07-19  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintcore.h: removed enum GimpPaintCoreState.

	* app/paint/paint-enums.h: added enum GimpPaintState (with values
	that have a name space).

	* app/paint/gimppaintcore.[ch]
	* app/paint/gimpairbrush.c
	* app/paint/gimpbrushcore.c
	* app/paint/gimpclone.c
	* app/paint/gimpconvolve.c
	* app/paint/gimpdodgeburn.c
	* app/paint/gimperaser.c
	* app/paint/gimpink.c
	* app/paint/gimppaintbrush.c
	* app/paint/gimppaintcore-stroke.c
	* app/paint/gimpsmudge.c
	* app/tools/gimppainttool.c: changed accordingly.

	* app/tools/gimpinktool.c: removed unused #include.
2004-07-19 14:37:40 +00:00
Michael Natterer 587e070ff4 removed PRETRACE_PAINT and POSTTRACE_PAINT from the GimpPaintCoreState
2004-06-14  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintcore.[ch]: removed PRETRACE_PAINT and
	POSTTRACE_PAINT from the GimpPaintCoreState enum. Removed
	"gboolean traces_on_window" from GimpPaintCoreClass.

	* app/paint/gimpclone.[ch]
	* app/paint/gimpink.c
	* app/tools/gimpclonetool.c: changed accordingly.

	* app/tools/gimppainttool.c: ditto. Show the brush outline
	while painting. Fixes bug #118348.
2004-06-14 15:26:29 +00:00
Michael Natterer 3e2690832c added new virtual function GimpPaintCore::post_paint() and call it after
2004-06-14  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintcore.[ch]: added new virtual function
	GimpPaintCore::post_paint() and call it after calling
	GimpPaintCore::paint().

	* app/paint/gimpbrushcore.[ch]: renamed brush_core->grr_brush
	to brush_core->main_brush and reset brush_core->brush
	to brush_core->main_brush in GimpPaintCore::post_paint().

	* app/paint/gimpbrushcore.c
	* app/paint/gimppaintcore-stroke.c
	* app/tools/gimppainttool.c: removed all code which restores
	the brush_core's old brush after painting since post_paint()
	does this automatically now.

	* app/paint/gimpclone.[ch]: moved static variables to the
	GimpClone struct.
2004-06-14 12:52:33 +00:00
Sven Neumann 8ce95ff6d5 app/paint/gimppaintcore.c app/paint-funcs/paint-funcs-generic.h applied a
2004-06-05  Sven Neumann  <sven@gimp.org>

	* app/paint/gimppaintcore.c
	* app/paint-funcs/paint-funcs-generic.h
	* app/paint-funcs/paint-funcs.[ch]: applied a patch from Philip
	Lafleur that changes the way that paint is applied during a paint
	stroke. Fixes bug #124225.
2004-06-05 16:21:41 +00:00
Michael Natterer afb57d59bf app/paint/gimpbrushcore.c app/paint/gimpdodgeburn.c
2004-05-28  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimpbrushcore.c
	* app/paint/gimpdodgeburn.c
	* app/paint/gimppaintcore.[ch]
	* app/tools/gimpairbrushtool.c
	* app/tools/gimpclonetool.c
	* app/tools/gimpconvolvetool.c
	* app/tools/gimpdodgeburntool.c
	* app/tools/gimpinktool.c
	* app/tools/gimppaintbrushtool.c
	* app/tools/gimppenciltool.c
	* app/tools/gimpsmudgetool.c: code review / cleanup.
2004-05-28 09:34:13 +00:00
Michael Natterer 23cfde41ba removed enum GimpPaintCoreFlags and member GimpPaintCore::flags. Added
2004-05-27  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintcore.[ch]: removed enum GimpPaintCoreFlags
	and member GimpPaintCore::flags. Added "gboolean traces_on_window"
	to GimpPaintCoreClass (defaults to FALSE).

	* app/paint/gimpclone.c: set traces_on_window = TRUE.

	* app/paint/gimpbrushcore.[ch]: added
	"gboolean handles_changing_brush" to GimpBrushCoreClass (defaults
	to FALSE).

	* app/paint/gimpclone.c
	* app/paint/gimpdodgeburn.c
	* app/paint/gimperaser.c
	* app/paint/gimppaintbrush.c
	* app/paint/gimppaintcore.c: set handles_changing_brush = TRUE.

	* app/tools/gimppainttool.c: changed accordingly.
2004-05-27 20:48:49 +00:00
Michael Natterer b9d74b9aa4 added "guint32 time" parameters to GimpPaintCore::paint() and
2004-05-26  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintcore.[ch]: added "guint32 time" parameters
	to GimpPaintCore::paint() and ::interpolate().

	* app/paint/gimpairbrush.c
	* app/paint/gimpbrushcore.c
	* app/paint/gimpclone.c
	* app/paint/gimpconvolve.c
	* app/paint/gimpdodgeburn.c
	* app/paint/gimperaser.c
	* app/paint/gimppaintbrush.c
	* app/paint/gimpsmudge.c: changed accordingly.

	* app/paint/gimpink.c: ditto and use the passed time instead of
	hardcoded dummy values.

	* app/paint/gimppaintcore-stroke.c: pass '0' as time.

	* app/tools/gimppainttool.c: pass the GdkEvent time.
2004-05-26 16:13:53 +00:00
Michael Natterer 552fc7a519 don't do special stuff if a virtual function doesn't exist. Instead, added
2004-05-26  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintcore.c: don't do special stuff if a virtual
	function doesn't exist. Instead, added default implementations
	which do the special stuff and call the virtual functions
	unconditionally.

	* app/tools/gimppainttool.c: some stylistic cleanup.
2004-05-26 12:55:10 +00:00
Michael Natterer 06a976ce7f replaced the "MaskBuf *paint_mask" parameters by "PixelRegion
2004-05-26  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintcore.[ch] (gimp_paint_core_paste)
	(gimp_paint_core_replace): replaced the "MaskBuf *paint_mask"
	parameters by "PixelRegion *mask_bufPR", so subclasses can pass in
	any kind of paint_mask buffer and are not restricted to MaskBufs.

	Also removes implicit knowledge about the MaskBuf originating from
	a brush in paint_mask_to_canvas_buf() and _to_canvas_tiles() which
	don't need to offset the mask by width/2 height/2 any more.

	Made gimp_paint_core_validate_undo_tiles() and
	gimp_paint_core_validate_canvas_tiles() protected functions.

	* app/paint/gimpbrushcore.c (gimp_brush_core_paste_canvas)
	(gimp_brush_core_replace_canvas): create correctly positioned
	PixelRegions from the MaskBufs before passing them to the
	paint_core.
2004-05-26 11:37:23 +00:00
Michael Natterer 1bdb42bc53 removed "gdouble scale" parameter and added "GimpPaintOptions" in
2004-05-26  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintcore.[ch]: removed "gdouble scale" parameter
	and added "GimpPaintOptions" in GimpPaintCore::get_paint_area().
	Check if virtual functions exist befoe calling them.

	* app/paint/gimpbrushcore.[ch]: added "gdouble scale" to GimpBrushCore
	and "gboolean use_scale" to GimpBrushCoreClass (defaults to TRUE).
	Set scale from paint_options in GimpPaintCore::get_paint_area().
	Removed "scale" parameter from gimp_brush_core_paste_canvas()
	and _replace_canvas().

	* app/paint/gimpsmudge.c (gimp_smudge_class_init): set use_scale
	to FALSE.

	* app/paint/gimpclone.c
	* app/paint/gimpconvolve.c
	* app/paint/gimpdodgeburn.c
	* app/paint/gimperaser.c
	* app/paint/gimppaintbrush.c: removed all scale calculations and
	simply pass paint_options to GimpPaintCore::get_paint_area().
2004-05-26 09:32:03 +00:00
Michael Natterer 9a41a73de8 app/paint/Makefile.am app/paint/gimpbrushcore-kernels.h new GimpPaintCore
2004-05-25  Michael Natterer  <mitch@gimp.org>

	* app/paint/Makefile.am
	* app/paint/gimpbrushcore-kernels.h
	* app/paint/gimpbrushcore.[ch]: new GimpPaintCore subclass
	containing all the brush painting specific stuff.

	* app/paint/gimppaintcore-kernels.h: removed this file.

	* app/paint/gimppaintcore.[ch]: removed all brush stuff.

	* app/paint/gimpairbrush.c
	* app/paint/gimpclone.[ch]
	* app/paint/gimpconvolve.[ch]
	* app/paint/gimpdodgeburn.[ch]
	* app/paint/gimperaser.[ch]
	* app/paint/gimppaintbrush.[ch]
	* app/paint/gimppencil.c
	* app/paint/gimpsmudge.[ch]: changed accordingly. Derive all
	classes which used to derive directly from GimpPaintCore from
	GimpBrushCore now. Lots of cleanup.

	* app/paint/paint-types.h
	* app/paint/gimp-paint.c
	* app/paint/gimppaintcore-stroke.c
	* app/tools/gimppainttool.c
	* tools/kernelgen.c: changed accordingly.
2004-05-25 20:41:09 +00:00
Sven Neumann f14e42b01b better fix for bug #123811; patch provided by Philip Lafleur.
2004-05-21  Sven Neumann  <sven@gimp.org>

	* app/paint/gimppaintcore.c (gimp_paint_core_interpolate): better
	fix for bug #123811; patch provided by Philip Lafleur.
2004-05-21 15:23:28 +00:00
Sven Neumann 9a5b21cc3f make sure that pressure never becomes negative. Fixes bug #123811; thanks
2004-05-19  Sven Neumann  <sven@gimp.org>

	* app/paint/gimppaintcore.c (gimp_paint_core_interpolate): make
	sure that pressure never becomes negative. Fixes bug #123811;
	thanks to Philip Lafleur for investigating this problem.
2004-05-19 10:33:47 +00:00
Sven Neumann fb1213290f tile-cache.c tile-private.h removed trailing whitespace, added some
2004-02-18  Sven Neumann  <sven@gimp.org>

        * tile-cache.c
        * tile-private.h
        * tile.[ch]: removed trailing whitespace, added some newlines,
        let tile_is_valid() return a gboolean instead of a gint.

        * app/core/gimpimage-projection.c
        * app/core/gimpimage-undo-push.c
        * app/paint/gimppaintcore.c
        * app/tools/gimpinktool.c: use the return value from tile_is_valid()
        as a boolean.
2004-02-18 18:57:43 +00:00
Michael Natterer 4d24bdbf81 Some code review:
2004-02-18  Michael Natterer  <mitch@gimp.org>

	Some code review:

	* app/config/gimpconfig-deserialize.c
	* app/config/gimpconfig-serialize.c: removed obsolete code which
	made sure serialize_property()/deserialize_property() are only
	called for properties of the correct class. We do it the right way
	for quite a while now and clear the inherited function pointers in
	gimp_config_iface_base_init().

	* app/config/gimprc.c (gimp_rc_dispose): don't forget to chain up.

	* app/base/gimplut.c
	* app/base/lut-funcs.c
	* app/config/gimpconfig-deserialize.c
	* app/config/gimpconfig-serialize.c
	* app/config/gimpconfig-types.c
	* app/config/gimprc.c
	* app/core/gimp-modules.c
	* app/core/gimpbrush.c
	* app/core/gimpcontainer.c
	* app/core/gimpdocumentlist.c
	* app/core/gimpitem.c
	* app/gui/about-dialog.c
	* app/gui/color-notebook.c
	* app/gui/gui.c
	* app/gui/tips-dialog.c
	* app/paint/gimppaintcore.c
	* app/paint-funcs/paint-funcs.c
	* app/widgets/gimpcolorpanel.c
	* app/widgets/gimpcontainergridview.c
	* app/widgets/gimpcontainermenuimpl.c
	* app/widgets/gimpselectioneditor.c: removed I/O includes from
	files which don't use lowlevel APIs any more. Also removes
	a whole bunch of G_OS_WIN32 special casing. Removed trailing
	whitespace. Misc tiny cleanups.
2004-02-18 13:43:50 +00:00
Manish Singh 38a2656c53 Use a real GimpVector2 for vector operations, instead of stuffing
2004-01-27  Manish Singh  <yosh@gimp.org>

        * app/paint/gimppaintcore.c (gimp_paint_core_interpolate): Use a real
        GimpVector2 for vector operations, instead of stuffing everything
        into a GimpCoords. C99 aliasing fix.
2004-01-28 03:29:58 +00:00
Michael Natterer b2c661e305 use gimp_drawable_bytes_with_alpha().
2004-01-18  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintcore.c (gimp_paint_core_get_paint_area): use
	gimp_drawable_bytes_with_alpha().
2004-01-18 12:48:37 +00:00
Sven Neumann 3ca9520cc4 invalidate the solid brush cache as well. Should fix #127681.
2003-11-25  Sven Neumann  <sven@gimp.org>

	* app/paint/gimppaintcore.c (gimp_paint_core_scale_mask):
	invalidate the solid brush cache as well. Should fix #127681.
2003-11-25 16:41:20 +00:00
Sven Neumann ddfe7575ed removed debugging output that shouldd have never been committed.
2003-10-12  Sven Neumann  <sven@gimp.org>

	* app/paint/gimppaintcore.c: removed debugging output that shouldd
	have never been committed.
2003-10-12 13:28:05 +00:00
Sven Neumann a88e11afb3 app/widgets/gimpdocked.[ch] renamed GimpDockedIface to
2003-10-11  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpdocked.[ch]
	* app/widgets/widgets-types.h: renamed GimpDockedIface to
	GimpDockedInterface.

	* app/display/gimpnavigationview.c
	* app/widgets/gimpcoloreditor.c
	* app/widgets/gimpcontainereditor.c
	* app/widgets/gimpcontainerview.c
	* app/widgets/gimpeditor.c
	* app/widgets/gimpimageeditor.c
	* app/widgets/gimpitemtreeview.c
	* app/widgets/gimptooloptionseditor.c: changed accordingly.

	* app/config/config-types.h
	* app/config/gimpconfig.[ch]
	* app/config/gimpconfig-deserialize.[ch]
	* app/config/gimpconfig-serialize.[ch]
	* app/config/gimpconfig-utils.[ch]: added a GimpConfig typedef and
	changed the GimpConfig API to take GimpConfig instead of GObject
	pointers.

	* app/config/gimpconfig-dump.c
	* app/config/gimprc.c
	* app/config/test-config.c
	* app/core/gimp-documents.c
	* app/core/gimp-parasites.c
	* app/core/gimp-templates.c
	* app/core/gimp.[ch]
	* app/core/gimpcontainer.c
	* app/core/gimpcontext.c
	* app/core/gimpdocumentlist.c
	* app/core/gimpgrid.c
	* app/core/gimpimage-duplicate.c
	* app/core/gimpimage-new.c
	* app/core/gimpimage.c
	* app/core/gimpparasitelist.c
	* app/core/gimptemplate.c
	* app/core/gimptooloptions.c
	* app/core/gimpviewable.c
	* app/gui/grid-dialog.c
	* app/gui/preferences-dialog.c
	* app/gui/stroke-dialog.c
	* app/gui/templates-commands.c
	* app/gui/tool-options-commands.c
	* app/paint/gimppaintcore.c
	* app/pdb/gimprc_cmds.c
	* app/text/gimptext-parasite.c
	* app/text/gimptext.c
	* app/text/gimptextlayer.c
	* app/tools/gimp-tools.c
	* app/tools/gimptexttool.c
	* app/widgets/gimpdevices.c
	* app/widgets/gimptemplateeditor.c
	* app/widgets/gimptemplateview.c
	* tools/pdbgen/pdb/gimprc.pdb: changed accordingly.
2003-10-11 14:30:18 +00:00
Manish Singh f64ad067d7 app/gui/image-menu.c app/gui/layers-menu.c "Imagesize" isn't a real word.
2003-10-06  Manish Singh  <yosh@gimp.org>

        * app/gui/image-menu.c
        * app/gui/layers-menu.c
        * etc/ps-menurc: "Imagesize" isn't a real word. Fix to "Image Size".

        * app/paint/gimppaintcore.c: add declaration for rotate_pointers which
        was inadvertently took out.

        * tools/pdbgen/pdb/layer.pdb: add gimp_layer_resize_to_image_size.
        Fix failure reporting logic for gimp_layer_delete.

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

        * plug-ins/common/tiff.c: always compare used unsigned chars for 7bit
        ASCII check.
2003-10-06 21:22:09 +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 2ce758b846 Added nomis' favorite feature ;)
2003-09-17  Michael Natterer  <mitch@gimp.org>

	Added nomis' favorite feature ;)

	* app/paint/gimppaintcore.[ch]: added gimp_paint_core_cancel()
	which can be called instead of gimp_paint_core_finish().
	It simply copies core->undo_tiles back to the drawable instead of
	pushing them to the undo stack.

	* app/tools/gimppainttool.c (gimp_paint_core_button_release): call
	_cancel() instead of _finish() if the right mouse button is
	pressed.
2003-09-17 12:05:11 +00:00