2007-07-17 Sven Neumann <sven@gimp.org>
* app/core/gimptoolinfo.c (gimp_tool_info_new): use the tool-info
identifier as the name of the tool-options object.
* app/paint/gimppaintoptions.c (gimp_paint_options_new): use the
paint-info identifier as the name of the paint-options object.
* app/paint/gimp-paint.c (gimp_paint_register): added parameter check.
* app/tools/gimp-tools.c (gimp_tools_init): formatting.
svn path=/trunk/; revision=22941
2007-07-04 Sven Neumann <sven@gimp.org>
* app/paint/gimpbrushcore.[ch]: applied patch from Jens Persson
that adds a LUT to apply the jitter in polar coordinates (bug
#434532).
svn path=/trunk/; revision=22859
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-25 Sven Neumann <sven@gimp.org>
* configure.in: removed extra check for gthread and fold it into
the GLIB and GTK checks.
* */Makefile.am: changed accordingly.
* app/main.c (main): always call g_thread_init().
svn path=/trunk/; revision=22832
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-07 Sven Neumann <sven@gimp.org>
* app/text/Makefile.am
* app/core/Makefile.am
* app/tools/Makefile.am
* app/display/Makefile.am
* app/widgets/Makefile.am
* app/base/Makefile.am
* app/paint/Makefile.am
* app/plug-in/Makefile.am
* libgimp/Makefile.am
* libgimpthumb/Makefile.am
* tools/pdbgen/Makefile.am
* libgimpwidgets/Makefile.am: applied the remaining parts of the
patch from Daniel Richard G. to fix out-of-source-tree builds
(bug #444960).
svn path=/trunk/; revision=22735
2007-05-15 Michael Natterer <mitch@gimp.org>
* app/paint/gimpheal.c (gimp_heal_motion): convert the source
region to the dest region's type, not the other way around
(using the wrong if() condition when doing so). Fixes bug #390938.
svn path=/trunk/; revision=22496
2007-05-05 Sven Neumann <sven@gimp.org>
* app/paint-funcs/paint-funcs.c (convolve_region): instead of
just
copying the border pixels, convolute the full region and extend
the borders.
* app/paint/gimpconvolve.[ch]: removed broken code that used to
deal with the image borders. Fixes bug #434279. Also reduced the
matrix sizes to 3x3 as only the inner 3x3 values were nonzero.
svn path=/trunk/; revision=22424
2007-05-02 Sven Neumann <sven@gimp.org>
* app/paint/gimpsmudge.c (gimp_smudge_start)
* app/paint/gimpconvolve.c (gimp_convolve_motion): use
gimp_pickable_get_pixel_at() to get the color to use with
color_region(). Fixes Smudge and Convolve tools on grayscale images.
svn path=/trunk/; revision=22376
2007-04-13 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h
* app/base/temp-buf.[ch]: remove redundant and inconsistently used
MaskBuf type and API.
* app/core/gimpbrush-scale.c
* app/paint/gimpbrushcore.[ch]: use TempBuf and its API instead.
This also optimizes away a useless memset() on brush scaling,
we completely fill each of the created buffers anyway.
svn path=/trunk/; revision=22249
2007-03-18 Michael Natterer <mitch@gimp.org>
* app/paint/gimpbrushcore.c: simplified brush scale calculation by
making sure that brush_core->scale always contains a value that's
suited as input for gimp_brush_scale_mask/pixmap() (bug #419290).
(gimp_brush_core_calc_brush_size): removed this function. All
places can now call gimp_brush_scale_size() directly with
core->scale as parameter.
(gimp_brush_core_calc_brush_scale): new function which returns
a linear scale factor which contains both the area-based pressure
scale factor and the linear paint options scale factor.
(gimp_brush_core_start)
(gimp_brush_core_get_paint_area): use the new function instead
of doing these calculations manually.
(gimp_brush_core_interpolate): remove call to
gimp_brush_core_scale_brush_size() and use core->scale directly.
(gimp_brush_core_get_paint_area)
(gimp_brush_core_scale_mask)
(gimp_brush_core_scale_pixmap): use gimp_brush_scale_size()
instead of the removed gimp_brush_core_scale_brush_size().
(gimp_brush_core_create_bound_segs): use only
paint_options->brush_scale here since the canvas brush preview
always has to asume full pressure.
* app/core/gimpbrush.c (gimp_brush_scale_size): special case
scale == 1.0 and return the mask's width/height without calling
the virtual function.
svn path=/trunk/; revision=22141
2007-03-14 Martin Nordholts <martinn@svn.gnome.org>
Made brushes upscalable by using scale_region. Downscaling still
uses functions in app/base/brush-scale.c (because of better
performance). Parametric brushes of course recalculates masks
instead of using bitmap scaling. Fixes bug #65030.
* app/core/gimpbrush.[ch]: Added a private scale_buf method which
uses scale_region (with GIMP_INTERPOLATION_LINEAR) to scale its
masks and pixmaps. Also added public virtual method scale_size to
GimpBrush (overridden by GimpBrushGenerated) which calculates the
buffer sizes for a given brush scaled with a given scale.
* app/core/gimpbrushgenerated.c: Implemented the new scale_size
method inherited from GimpBrush, and modified
gimp_brush_generated_calc to use this helper function.
* app/tools/gimppaintoptions-gui.c (gimp_paint_options_gui): Made
the brush Scale-slider logarithmic.
* app/paint/gimppaintoptions.c (gimp_paint_options_class_init):
Changed Scale scale to [0.0, 10.0].
* app/paint/gimpbrushcore.c:
(gimp_brush_core_calc_brush_size): Refactored 'get brush size' code
to where it belongs, in GimpBrush-classes, and allowed scales
larger than 1.0.
svn path=/trunk/; revision=22113
2007-03-12 Michael Natterer <mitch@gimp.org>
* app/core/gimpbrush.[ch]
* app/core/gimpbrushgenerated.c
* app/tools/gimppaintoptions-gui.c
* app/base/brush-scale.[ch]
* app/base/temp-buf.[ch]
* app/paint/gimppaintoptions.c
* app/paint/gimpbrushcore.c: revert last commit. The patch needs
more review and it's easier to start from quare one than have
patches on top of patches.
svn path=/trunk/; revision=22101
2007-03-11 Michael Schumacher <schumaml@cvs.gnome.org>
Made brushes scalable (both up and down) by using existing
scaling routines, and also refactored some brush-code. Patch by
Martin Nordholts. Fixes bug #65030.
* app/paint/gimpbrushcore.c:
(gimp_brush_core_calc_brush_length_scale) Refactored 'get brush
size' code to where it belongs, in GimpBrush-classes, and renamed
gimp_brush_core_calc_brush_size to
gimp_brush_core_calc_brush_length_scale.
* app/paint/gimppaintoptions.c (gimp_paint_options_class_init):
Changed Scale scale to [0.0, 100.0].
* app/base/temp-buf.[ch] (mask_buf_new): Change signature to also
take a bpp parameter.
* app/base/brush-scale.[ch]: Changed brush_scale_(mask|pixmap) to
the new brush_scale_buf, which uses existing scaling routines
(scale_region) instead of dedicated down-scaling only routines.
* app/tools/gimppaintoptions-gui.c (gimp_paint_options_gui): Made
the brush Scale-slider logarithmic.
* app/core/gimpbrushgenerated.c: Implemented the new
get_scaled_size method inherited from GimpBrush, and modified
gimp_brush_generated_calc to use this helper function.
* app/core/gimpbrush.[ch]: Added public virtual method
get_scaled_size to GimpBrush, overridden by GimpBrushGenerated,
which calculates the buffer sizes for a given brush scaled with a
given scale. Also changed calls to brush_scale_(mask|pixmap) to
the new brush_scale_buf.
svn path=/trunk/; revision=22099
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-02-08 Michael Natterer <mitch@gimp.org>
* app/paint/paint-types.h
* app/paint/*.h: move opaque typedefs of object instances to
paint-types.h, don't typedef empty class stuctures as their parent
class (gtk-doc gets confused), cleanups.
svn path=/trunk/; revision=21877
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-01-15 Michael Natterer <mitch@gimp.org>
* app/base/pixel-region.c (pixel_region_set,get_row): add support
for non-tiled regions.
* app/paint/gimpperspectiveclone.[ch]: replace handmade
transformation code by a call to gimp_transform_region(). Fix
getting the original pixels for src_pickable != dest_drawable
(bug #394610). Various small fixes and cleanups.
svn path=/trunk/; revision=21720
2006-12-18 Sven Neumann <sven@gimp.org>
* app/paint/gimpbrushcore.c (gimp_brush_core_interpolate): applied
patch from Aurore D that improves jitter for brushes with an angle
close to 90° (bug #386061).
2006-12-10 Michael Natterer <mitch@gimp.org>
* app/paint/gimpbrushcore.c: also scale the brush's spacing (by
scaling its x_axis and y_axis). Addresses bug #65030.
2006-11-22 Michael Natterer <mitch@gimp.org>
* app/paint/gimpbrushcore.[ch]: applied modified patch from Adrian
Likins which adds a GRand to the GimpBrushCore struct and uses it
instead of using g_random_foo() functions. Fixes bug #377981.
2006-11-16 Michael Natterer <mitch@gimp.org>
Made all brushes scalable from the tool options. So far only
downscaling is supported since we lack an algorithm for bitmap
brush upscaling. Addresses bug #65030.
* app/paint/gimppaintoptions.[ch]: added "brush-scale" property.
* app/paint/gimpbrushcore.[ch]: separate pressure logic from brush
scaling logic and take paint_options->brush_scale into account.
Added gimp_brush_core_create_bound_segs() which returns BoundSegs
of the correctly scaled brush mask for the brush preview on the
canvas.
* app/tools/gimpbrushtool.c: use gimp_brush_core_create_bound_segs()
instead of doing this here (also removes all knowledge about lowlevel
stuff from this file). Connect to notify::brush-scale of the
paint options and invalidate the brush core's brush accordingly.
* app/tools/gimppaintoptions-gui.c: added brush scale slider.
2006-11-09 Michael Natterer <mitch@gimp.org>
Properly abstract brush scaling:
* app/core/gimpbrush.[ch]: added virtual functions
GimpBrush::scale_mask() and ::scale_pixmap() and default
implementations which call the functions in base/brush-scale.c.
* app/core/gimpbrushgenerated.c: factored out brush calculation to
an internal utility function and call that function from ::dirty()
and from the new ::scale_mask().
* app/core/gimpbrushcore.c: use gimp_brush_scale_mask/pixmap()
instead of using the lowlevel scale functions directly. Fixes the
uglyness that we were scaling generated brushes instead of simply
recalculating them in the right size.
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-20 Michael Natterer <mitch@gimp.org>
* app/paint/gimpsourcecore.c: implement GimpPaintCore::start()
and set paint_core->use_saved_proj to TRUE when we are using
the destination drawable image's projection as source. Return
FALSE from start() if there is no src_drawable set and removed
checks for src_drawable != NULL further down in the code path.
* app/tools/gimpperspectiveclonetool.c (button_press)
* app/tools/gimpsourcetool.c (button_press): don't fiddle with
paint_core->use_saved_proj here.
* app/paint/gimpclone.c: implement GimpPaintCore::start() and
return FALSE if we are in pattern mode and there is no pattern to
clone from. Removed GimpPaintCore::paint() implementation because
all it did was popping a message if there is no pattern. Removed
check for pattern != NULL and cleaned up the file a bit.
* app/paint/gimpperspectiveclone.c (paint): removed message about
no pattern to clone from.
2006-09-13 Michael Natterer <mitch@gimp.org>
* app/paint/gimpclone.c (gimp_clone_motion): don't access the
src_pickable when cloning from a pattern. Fixes runtime warnings.
2006-09-12 Michael Natterer <mitch@gimp.org>
* app/paint/gimpsourcecore.[ch]: made gimp_source_core_motion() a
public function for the time being, pending further refactoring.
* app/paint/gimpperspectiveclone.[ch]: derive from GimpClone and
remove everything that is already imeplemented in the parent
classes. Particullarly, removed motion() implementation in favor
of a get_source() implementation and simply use GimpClone's
motion(). Also refuse to work on indexed drawables.
* app/paint/gimpperspectivecloneoptions.[ch]: derive from
GimpCloneOptions and remove everything that is already done by the
parent classes.
* app/tools/gimpperspectiveclonetool.c: changed
accordingly. Doesn't derive from GimpSourceTool yet since there is
some virtual function refactoring in GimpSourceTool missing.
2006-09-09 Michael Natterer <mitch@gimp.org>
* app/paint/gimpclone.c (gimp_clone_line_image): changed src_pickable
parameter to src_type.
(gimp_clone_motion): allow the passed srcPR to have alpha even if
the source pickable is flat. Pass the correct GimpImageType to
gimp_clone_line_image().