2007-04-30 Michael Natterer <mitch@gimp.org>
* app/core/gimpselection.[ch] (gimp_selection_extract): changed
"drawable" parameter to "pickable" and added some special casing
for the GIMP_IS_DRAWABLE(pickable) case in the implementation.
* app/core/gimpdrawable-transform.c: changed accordingly.
* app/core/gimp-edit.c: ditto. Removed utility function
gimp_edit_extract_visible() and simply use gimp_edit_extract() for
"copy visible", passing image->projection. Fixes bug #434102.
svn path=/trunk/; revision=22368
2007-04-27 Sven Neumann <sven@gimp.org>
* app/core/gimppickable.[ch]: added get_pixel_at() method to the
GimpPickable interface. This gives direct access to the pixel
without converting it to an RGB color.
* app/core/gimpdrawable.c
* app/core/gimpimagemap.c
* app/core/gimpprojection.c: implement the new method and also use
it to reimplement get_color_at().
* app/core/gimpimage-crop.c (gimp_image_crop_guess_bgcolor): use
gimp_pickable_get_pixel_at(). Fixes auto-shrink on indexed and
grayscale images.
svn path=/trunk/; revision=22359
2007-04-26 Michael Natterer <mitch@gimp.org>
* app/core/gimpparamspecs.[ch]: renamed GimpParamSpecString's
flag "no_validate" to "allow_non_utf8".
* tools/pdbgen/app.pl
* tools/pdbgen/pdb/*.pdb: renamed argument flag
"no_validate" (which turns off utf8-validation for strings) to
"allow_non_utf8" and renamed "no_success" (which turns off
argument validation alltogether) to "no_validate".
Doesn't affect generated code.
svn path=/trunk/; revision=22350
2007-04-25 Michael Natterer <mitch@gimp.org>
* app/core/gimpparamspecs.c (gimp_param_string_validate): added
#warning to use GParamSpecString's features once we depend on a
fixed version.
svn path=/trunk/; revision=22330
2007-04-18 Sven Neumann <sven@gimp.org>
* app/plug-in/Makefile.am
* app/plug-in/gimppluginmanager.[ch]
* app/plug-in/gimppluginmanager-restore.[ch]: moved
gimp_plug_in_manager_restore() to it's own file.
* app/core/gimp.c: changed accordingly.
* app/Makefile.am (LDFLAGS): convince the linker to do its job.
svn path=/trunk/; revision=22286
2007-04-17 Sven Neumann <sven@gimp.org>
Allow other applications to open images in GIMP as if they were
new images (without associating a filename). Fixes bug #423118.
* app/file/file-open.[ch]: added parameter 'as_new' to
file_open_image() and its variants.
* app/actions/data-commands.c
* app/actions/documents-commands.c
* app/actions/file-commands.c
* app/core/gimpimagefile.c
* app/dialogs/file-open-dialog.c
* app/dialogs/file-open-location-dialog.c
* app/widgets/gimptoolbox.c
* app/widgets/gimptoolbox-dnd.c: changed accordingly.
* app/app.[ch]
* app/main.c: added new command-line option '--as-new'.
* app/widgets/gimpdbusservice.[ch]
* app/widgets/dbus-service.xml: added new method "OpenAsNew" to the
D-Bus interface.
* docs/gimp.1.in: document the new command-line option.
svn path=/trunk/; revision=22264
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-04-01 Michael Natterer <mitch@gimp.org>
* app/base/Makefile.am
* app/base/brush-scale.[ch]: removed these files.
* app/core/Makefile.am
* app/core/gimpbrush-scale.[ch]: added the functions here as
static utility functions. Also move the default implementations of
GimpBrush::scale_size(), ::scale_mask() and ::scale_pixmap() here,
including their utility functions.
* app/core/gimpbrush.c: remove all scale stuff and
include "gimpbrush-scale.h" instead.
(gimp_brush_get_new_preview): use GimpBrush's scale functions
instead of the now private ones. Cleanup.
(gimp_brush_scale_mask)
(gimp_brush_scale_pixmap): return a copy of the buf for
scale == 1.0.
svn path=/trunk/; revision=22213
2007-03-29 Sven Neumann <sven@gimp.org>
* app/core/gimpbrushgenerated.c (gimp_brush_generated_calc): moved
generation of the lookup table to it's own function. Also changed
SUPERSAMPLING from 5 to 4. Let's see if someone complains...
svn path=/trunk/; revision=22193
2007-03-22 Sven Neumann <sven@gimp.org>
* app/core/gimplayer.c (gimp_layer_add_mask): allow adding a mask
to a layer without alpha channel (bug #316207).
svn path=/trunk/; revision=22163
2007-03-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 Michael Natterer <mitch@gimp.org>
* app/core/gimpbrush.c
* app/core/gimpbrushgenerated.c: some minor fixes and stylistic
paranoia i overlooked in last night's late review.
svn path=/trunk/; revision=22119
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-10 Michael Natterer <mitch@gimp.org>
* app/core/core-types.h: don't include libgimpmath/gimpmathtypes.h
* app/base/base-types.h: include it here. Also include
libgimpcolor/gimpcolortypes.h
svn path=/trunk/; revision=22094
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-05 Michael Natterer <mitch@gimp.org>
Makes default Select -> Border behaviour consistent, and makes
'sticky image edges' optional by adding a checkbox in the Border
Selection dialog. Patch by Martin Nordholts. Fixes bug #350009.
* app/actions/select-commands.c (select_border_cmd_callback)
(select_border_callback): Added edge-lock checkbox to dialog and
modified calls accordingly.
* app/paint-funcs/paint-funcs.c (border_region)
(compute_transition): Fixed algorithm. (compute_transition is a
helper function to the algorithm). Also clarified many parts of
the algorithm with comments.
* app/paint-funcs/paint-funcs.h
* app/core/gimpchannel.[ch]
* app/core/gimpselection.c: Added gboolean edge_lock to function
calls/signatures.
* app/pdb/selection_cmds.c: Regenerated.
svn path=/trunk/; revision=22047
2007-03-05 Michael Natterer <mitch@gimp.org>
* app/core/core-types.h: added typdef GimpMemsizeFunc.
* app/core/gimp-utils.[ch]: added _foreach() variants of
GHashTable, GList and GSList functions which take GimpMemsizeFunc
callbacks. Added gimp_parasite_get_memsize(). Added "data_size"
parameter to gimp_g_hash_table_get_memsize().
* app/core/gimp.c
* app/core/gimppalette.c
* app/core/gimpparasitelist.c
* app/pdb/gimppdb.c
* app/plug-in/gimppluginmanager.c: use the new functions instead
of itering manually or ignoring the containers' elements. Changed
callers of gimp_g_hash_table_get_memsize().
svn path=/trunk/; revision=22046
2007-03-04 Michael Natterer <mitch@gimp.org>
* app/core/gimpobject.c (gimp_object_get_memsize): don't pass
random strings to g_print() without running them through %s.
Fixes crash/warning when the string contains '%'.
svn path=/trunk/; revision=22042
2007-03-01 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable-blend.c (gimp_drawable_blend): use
gimp_drawable_bytes_with_alpha() instead of manually adding
alpha to the value returned by gimp_drawable_bytes()
svn path=/trunk/; revision=22037
2007-02-27 Sven Neumann <sven@gimp.org>
* app/core/gimpsubprogress.[ch]: allow the parent progress to be NULL.
Documented the API.
* app/core/gimpimage-scale.c: use the sub-progress unconditionally.
svn path=/trunk/; revision=22010
2007-02-27 Sven Neumann <sven@gimp.org>
* app/core/Makefile.am
* app/core/core-types.h
* app/core/gimpsubprogress.[ch]: added GimpSubProgress, an
object
that implements the GimpProgress interface and maps progress
information to a sub-range of the parent progress.
* app/core/gimpimage-scale.c (gimp_image_scale): use the new
object.
svn path=/trunk/; revision=22009
2007-02-26 Sven Neumann <sven@gimp.org>
* app/core/gimp-transform-region.c (normalize_coords): removed a
redundant condition and marked another one as unlikely.
svn path=/trunk/; revision=22008
2007-02-26 Sven Neumann <sven@gimp.org>
* app/core/gimp-transform-region.c: moved common code to an
inlined function. gimp_transform_region_lanczos() now also does
supersampling. Removed boundary checks and clamping as
PixelSurround and read_pixel_data_1() already deal with this for
us. Gives another small speedup.
svn path=/trunk/; revision=21999
2007-02-26 Sven Neumann <sven@gimp.org>
* app/core/gimp-transform-region.c (gimp_transform_region_lanczos):
use PixelSurround instead of read_pixel_data_1(). This yields a
dramatic speedup.
svn path=/trunk/; revision=21998
2007-02-26 Sven Neumann <sven@gimp.org>
* app/core/gimp-transform-region.c (gimp_transform_region_lanczos):
iterate over tiles instead of rows in the destination buffer.
svn path=/trunk/; revision=21997
2007-02-24 Sven Neumann <sven@gimp.org>
* app/core/gimp-transform-region.c (gimp_transform_region): moved
linear and cubic code to their own functions and let them iterate
over tiles instead of rows in the destination buffer.
svn path=/trunk/; revision=21996
2007-02-24 Sven Neumann <sven@gimp.org>
* app/core/gimp-transform-region.c
(gimp_transform_region_nearest):
operate on tiles instead of iterating row by row.
svn path=/trunk/; revision=21988
2007-02-24 Sven Neumann <sven@gimp.org>
* app/core/gimp-transform-region.c (gimp_transform_region):
moved nearest-neighbor code to it's own function to improve
performance and readability.
svn path=/trunk/; revision=21987
2007-02-23 Sven Neumann <sven@gimp.org>
* app/core/gimp-transform-region.c (gimp_transform_region):
moved
lanczos code into it's own function to improve readability.
svn path=/trunk/; revision=21986
2007-02-23 Sven Neumann <sven@gimp.org>
* app/base/pixel-surround.[ch]: do less tile lock and release
operations by reusing the last locked tile if possible. Allow to
call pixel_surround_lock() several times without unlocking.
* app/core/gimp-transform-region.c: don't unlock the PixelSurround
so that the locked tile can be reused. Yields about 30% speedup
for transformations.
svn path=/trunk/; revision=21984
2007-02-22 Sven Neumann <sven@gimp.org>
* app/base/base-types.h
* app/base/pixel-surround.[ch]: hide PixelSurround struct and
cleaned up the PixelSurround API.
* app/core/gimp-transform-region.c: changed accordingly. Also
sprinkled some const qualifiers.
svn path=/trunk/; revision=21978
2007-02-17 Michael Natterer <mitch@gimp.org>
* app/core/gimp-utils.[ch]
* app/core/gimp.c
* app/widgets/gimpcontrollerinfo.c
* libgimpwidgets/gimpcontroller.c: removed various boolean_handled
signal accumulators and use g_signal_accumulator_true_handled().
svn path=/trunk/; revision=21933
2007-02-11 Michael Natterer <mitch@gimp.org>
* app/core/gimpcontainer.c (gimp_container_deserialize): plug leak
introduced with last commit: simply always use the deserialized
name, also on ojects already existing in the container.
svn path=/trunk/; revision=21890
2007-02-10 Michael Natterer <mitch@gimp.org>
Made templates say "ppi" instead of "dpi". Fixes bug #376990:
* app/core/gimp-templates.c
(gimp_templates_migrate_get_child_by_name): find the child also
if the name differs only in the substrings "dpi" and "ppi".
* app/core/gimpcontainer.c (gimp_container_deserialize): if we
found a child, give it the deserialized name if it isn't the same
as its old name.
* etc/templaterc: applied patch from Michael Schumacher that
replaces "dpi" by "ppi".
svn path=/trunk/; revision=21888