...to path.
Changes the names of
gimp_vectors_* () API to
gimp_path[s]_* (). Renames related files
to [path] instead of [vectors], along with
relevant enums and functions.
This commit renames the GimpVectors
object to GimpPath in both app/core and
in libgimp. It also renames the files
to gimppath.[ch] and updates the relevant
build and translation files.
There are still outstanding gimp_vectors_* ()
functions on the app side that need to be renamed
in a subsequent commit.
- Make the various virtual methods of GimpPaintCore use a list of
drawables as argument instead of a single drawable.
- gimp_brush_core_eval_transform_dynamics() can work with an image as
argument rather than a drawable as it doesn't actually depends on
specific drawable data.
- New function gimp_paint_tool_enable_multi_paint() to be used in init()
method of paint tools to announce that this tool can work with
multiple layers selected.
- Use gimp_paint_tool_enable_multi_paint() in the GimpSourceTool base
class only for now.
This is a first step for multi-layer drawing, but we don't want it to be
possible in just any random cases, which is why I add a special function
to advertize this capability. We will use it for special-casing the
clone (as well as heal and perspective tools most likely) tool to work
on several layers at once. At this step, it is still very bugged and not
really working properly. In particular, since we don't process the
drawable offset early anymore (because it makes no sense when we pass a
list of drawables with different offsets), I suspect that all the
offset-related code will be very broken.
- don't include <gdk-pixbuf/gdk-pixbuf.h> in headers in app/
- instead, include it in many .c files instead of <glib-object.h>,
finally acknowledging the fact that app/ depends on gdk-pixbuf almost
globally
- fix up includes as if libgimpbase depended in GIO, which it soon will
paint_core->start_coords is in fact the last stroke's endpoint and
only used for storing it in GimpPaintCoreUndo, so the last endpoint
can be resotred for straight-line painting after an undo. Make the
code actually doing that.
Pass the current coords to the function instead of setting them
on the paint core before calling it. Doesn't exactly make the code
in the paint tool simpler, but that needs further refactoring anyway.
2009-02-08 Michael Natterer <mitch@gimp.org>
Bug 520078 – Rotate brushes
Applied a slightly modified patch from Alexia Death:
* app/core/core-types.h (struct GimpCoords): add "direction" member.
* app/core/gimpcoords.c: take direction into account in mix(),
scalarprod(), length_squared(), manhattan_dist() and equal().
* app/core/gimpcoords-interpolate.c
(gimp_coords_interpolate_catmull): same here.
* app/display/gimpdisplayshell-coords.c
(gimp_display_shell_eval_event): same here.
* app/paint/gimppaintoptions.[ch]: add properties for direction
dynamics and adapt dynamics mixing accordingly.
* app/paint/gimpbrushcore.c (gimp_brush_core_interpolate):
"interpolate" direction too (in fact, just copy it from
last_coords since it doesn't change along a straight line).
* app/paint/gimppaintcore-stroke.c
(gimp_paint_core_stroke_emulate_dynamics): emulate direction too.
* app/tools/gimppaintoptions-gui.c: add GUI for direction dynamics.
svn path=/trunk/; revision=28001
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
crashes GIMP
* app/paint/gimppaintcore-stroke.c
(gimp_paint_core_stroke_vectors): Return an error message if there
were not enough points to stroke.
* app/dialogs/stroke-dialog.c (stroke_dialog_response): Guard
against crashes if an implementator forgets to set an error.
svn path=/trunk/; revision=27589
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-08-15 Michael Natterer <mitch@gimp.org>
* app/paint/gimppaintcore-stroke.c
(gimp_paint_core_stroke_boundary)
(gimp_paint_core_stroke_vectors): when stroking multiple segments,
set paint_core->cur_coords to the start of each segment. It
normally gets assigned by gimp_paint_core_start(), but that's not
called for subsequent segments. Fixes stroking multiple segments
with the ink tool. The other tools were not affected since they
plot individual brushes rather than a shape from the last to the
current coordinates. Spotted by Alexia.
svn path=/trunk/; revision=26578
2008-07-23 Sven Neumann <sven@gimp.org>
* app/paint/gimppaintcore-stroke.[ch]: also implement brush
dynamics emulation for stroking selections.
* app/core/gimpchannel.c: pass the 'emulate-dynamics' parameter
to
gimp_paint_core_stroke_boundary().
svn path=/trunk/; revision=26293
2008-07-23 Sven Neumann <sven@gimp.org>
Based on a patch from Alexia Death (bug #543706):
* app/paint/gimppaintcore-stroke.[ch]
(gimp_paint_core_stroke_vectors): added code to emulate brush
dynamics by modifying pressure and velocity along the stroke.
* app/vectors/gimpvectors.c (gimp_vectors_stroke): pass the
'emulate-dynamics' parameter to
gimp_paint_core_stroke_vectors().
svn path=/trunk/; revision=26291
2007-12-06 Michael Natterer <mitch@gimp.org>
* app/paint/gimppaintcore-stroke.[ch]: added GError arguments and
fixed all functions to abort when the first call to
gimp_paint_core_start() fails (it won't succeed either for the
next path or whatever segemts).
* app/core/gimpitem.[ch]: added GError to gimp_item_stroke()
* app/core/gimpselection.c
* app/core/gimpchannel.c
* app/vectors/gimpvectors.c: don't gimp_message() in
GimpItem::stroke() but set the error.
* app/dialogs/stroke-dialog.c
* app/actions/vectors-commands.c
* app/actions/select-commands.c: handle the returned errors.
* tools/pdbgen/pdb/edit.pdb
* tools/pdbgen/pdb/paths.pdb
* tools/pdbgen/pdb/paint_tools.pdb: pass the error to the stroke
functions.
* app/pdb/paint_tools_cmds.c
* app/pdb/edit_cmds.c
* app/pdb/paths_cmds.c: regenerated.
svn path=/trunk/; revision=24273
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().
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.
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-05-26 Michael Natterer <mitch@gimp.org>
* app/paint/gimppaintcore-stroke.c: check if we really have
a GimpBrushCore before casting and accessing its members.
2004-02-23 Michael Natterer <mitch@gimp.org>
* app/core/core-types.h: added #defines for GimpCoords' default
pressure, tilt and wheel values.
* app/display/gimpdisplayshell-callbacks.c
* app/paint/gimppaintcore-stroke.c
* app/text/gimptext-vectors.c
* tools/pdbgen/pdb/paint_tools.pdb: use them. Fixes lots more
buggy default values for tilt (in fact all of them were wrong).
* app/pdb/paint_tools_cmds.c: regenerated.
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-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 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-12 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-mask-select.c (gimp_image_mask_select_vectors)
* app/paint/gimppaintcore-stroke.c (gimp_paint_core_stroke_vectors)
* app/display/gimpdisplayshell.c (gimp_display_shell_draw_vector)
* app/tools/gimpdrawtool.c (gimp_draw_tool_real_draw)
* app/tools/gimptransformtool.c (gimp_transform_tool_draw)
* app/tools/gimpvectortool.c (gimp_vector_tool_vectors_visible)
(gimp_vector_tool_draw): all callers of gimp_stroke_interpolate():
don't leak the returned GimpCoords array and don't crash if it's
NULL.
* app/tools/gimpvectortool.[ch]: added VECTORS_SELECT_VECTOR state
which enables activating any visible GimpVectors on any display.
(gimp_vector_tool_on_handle)
(gimp_vector_tool_on_curve): added a GimpVectors parameter so we
can check for vectors which are not vector_tool->vectors.
(gimp_vector_tool_oper_update): iterate gdisp->gimage->vectors
to figure if we are hovering any visible vectors and set
VECTORS_SELECT_VECTOR.
(gimp_vector_tool_button_press): catch VECTORS_SELECT_VECTOR and
start editing the selected vectors. Also make it the image's
active_vectors.
(gimp_vector_tool_button_release): removed unneeded call to
gimp_viewable_invalidate_preview(vectors).
Random cleanup all over the place.
2003-08-30 Michael Natterer <mitch@gimp.org>
Fixed & cleaned up paint function registration to work without
GUI. Finishes core/GUI separation for the paint tools:
* app/core/gimppaintinfo.[ch]: removed "gchar *pdb_string" all over
the place since we don't stroke using the PDB any more.
(gimp_paint_info_new): create paint_info->paint_options here so
the paint system is fully initialized when there is no GUI.
* app/paint/paint.c: removed pdb_string stuff here, too.
* app/core/gimptoolinfo.[ch]: create tool_info->tool_options
only if tool_info->tool_options_type is not the same type
as paint_info->paint_options_type (if we are no paint tool).
* app/core/gimptooloptions.c: removed G_PARAM_CONSTRUCT_ONLY from
the "tool-info" property. Instead, changed
gimp_tool_options_set_property to ensure that it is only set once.
* app/core/gimp.c (gimp_initialize): moved paint_init() after
data_factory creation (was in gimp_init()), since GimpPaintInfo
now creates the GimpPaintOptions, which are GimpContexts, which
need gimp->*_factory to be constructed.
* app/tools/tool_manager.c: don't create tool_info->tool_options
here (it's not the job of the tool_manager to set up the core
paint system correctly, it must be already initialized before any
tool_manager function is called).
Made "Stroke Selection" and "Stroke Path" work the same way:
* app/paint/gimppaintcore-stroke.[ch]: added new function
gimp_paint_core_stroke_boundary() which strokes without using
the PDB.
* app/core/gimpimage-mask.c (gimp_image_mask_stroke): use it
instead of using the PDB. Enables all available paint options for
stroke operations. Fixes bug #119411.
* app/gui/vectors-commands.c (vectors_stroke_vectors)
* app/core/gimpimage-mask.c (gimp_image_mask_stroke): removed all
code which tries to figure how to stroke and simply look at the
active tool's tool_info->paint_info, since it is always set up
correctly now.
* app/paint/gimppaintcore.c: paint_core_interpolate now takes care
of setting core->last_coords. Don't reset core->distance in
paint_core_start (fixes problem with shift-click brush strokes).
Improved brush placement for stroked selections in
paint_core_interpolate.
* app/paint/gimppaintcore-stroke.c: dont need to set
core->last_coords anymore.
* app/tools/gimppainttool.c: dont need to set core->last_coords
anymore. Set core->distance in gimp_paint_tool_button_press.