They are unreliable because every type checking cast discards them,
they are useless anyway, visual clutter, added inconsistently, and
generally suck. Wanted to do this a long time ago, it was a bad idea
in the first place.
Introduce gimp_vectors_get_bezier() which creates the bezier
representation on demand and then caches it for subsequent calls
until the vectors object is frozen.
At some point we should introduce GimpVectors::changed instead
of relying on the fact that a vectors object is always frozen
and thawn whenever it is changed...
this is pretty pointless from an abstraction point of view, but using
these functions will make the code a lot more readable by getting rid
of tons of ugly casts to and from GimpViewable whenever getting an
item's parent.
This reverts commit 2d2b6f03c5 and
adapts the code. We can use gimp_vectors_stroke_get_next (vectors,
NULL) instead of gimp_vectors_get_stroke (vectors, 0). Thanks to nomis
for pointing this out.
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
2008-05-12 Simon Budig <simon@gimp.org>
* app/vectors/gimpvectors.[ch]
* app/vectors/gimpstroke.[ch]
* app/vectors/gimpbezierstroke.c: Implement functionality to
get a bezier description a la moveto/curveto/closepath.
* app/vectors/vectors-types.h: implement an evil hack to avoid
the inclusion of cairo.h in most C files...
* app/vectors/Makefile.am: link against cairo
* app/widgets/gimpviewrenderervectors.c: use the new functionality
for preview rendering.
svn path=/trunk/; revision=25645
2005-05-17 Simon Budig <simon@gimp.org>
* app/vectors/gimpvectors.[ch]: added gimp_vectors_get_n_strokes ();
* tools/pdbgen/pdb/vectors.pdb: Attempt to fill an array with IDs,
does not yet work.
* app/pdb/vectors_cmds.c
* libgimp/gimpvectors_pdb.c: regenerated.
2005-04-14 Simon Budig <simon@gimp.org>
Started a PDB api for vectors/strokes. Not yet functional, this
commit is to get the infrastructure up and running.
* app/vectors/gimpstroke.[ch]
* app/vectors/gimpvectors.[ch]: Added IDs to the strokes
* tools/pdbgen/pdb.pl: corrected "vectors" type, deleted "path" type.
* tools/pdbgen/pdb/image.pdb: added gimp_image_get_vectors()
* tools/pdbgen/pdb/vectors.pdb: New file for the vectors API
(just a stub for now)
* tools/pdbgen/Makefile.am: Added vectors.pdb
* tools/pdbgen/groups.pl: regenerated.
* plug-ins/script-fu/siod-wrapper.c: Enable the Path/Vectors type.
* libgimp/gimpvectors_pdb.[ch]
* app/pdb/vectors_cmds.c: new autogenerated files.
* libgimp/Makefile.am
* app/pdb/Makefile.am: Added new autogenerated file.
* libgimp/gimp_pdb.h
* libgimp/gimpimage_pdb.[ch]
* app/pdb/image_cmds.c
* app/pdb/internal_procs.c: regenerated.
* app/vectors/gimpvectors-warp.c
* app/vectors/gimpvectors-warp.h: new files implmenting
"path along a path" functionality.
* app/vectors/Makefile.am: new stuff added
* gimp/app/vectors/gimpvectors.[ch]: actually implement
gimp_vectors_real_stroke_get_length().
* app/tools/gimptexttool.c
* app/tools/gimptextoptions.c: first pass at "text
along a path", using new functions. See bug #169616.
2003-11-07 Simon Budig <simon@gimp.org>
* app/vectors/gimpvectors.[ch]: New function that appends a
duplicate of the source vectors strokes to the list of strokes
of a target vectors object.
* app/core/gimpimage-merge.[ch]
* app/core/core-enums.h: Use this new function to merge
the visible vectors in an Image. New Undo type for vectors merging.
* app/core/core-enums.c: regenerated.
* app/gui/vectors-menu.c
* app/gui/vectors-commands.[ch]
* app/widgets/gimphelp-ids.h: New Menu entry + callback to invoke
the merge functionality. New Help ID for the menu entry.
2003-09-20 Simon Budig <simon@gimp.org>
Dave Neary <bolsh@gimp.org>
First steps towards Libart stroking. Right now the code
crashes and thus is disabled by default. If you want to
test it, change the #define LIBART_STROKE in
app/vectors/gimpvectors.c. Then a click on the stroke button
in the paths dialog invokes the new code.
The crash is in gimpdrawable-stroke.c - apparently I did not
yet get the TileManager stuff correctly.
* app/core/gimpscanconvert.[ch]: Rewritten to be more clear
and have an easier API. Now can handle open Paths and
libart-stroke the (open/closed) polygons defined earlier.
* app/core/core-enums.h: Added Enums for LineJoin-Type and
EndCap-Type for stroking.
* app/core/core-enums.c: regenerated.
* app/core/gimpimage-mask-select.c: Use the new API of
GimpScanConvert where appropriate.
* app/vectors/gimpvectors.c: Added #define to enable the libart
stroking. Disabled by default because of the crash mentioned
above...
* app/vectors/gimpbezierstroke.c
* app/vectors/gimpstroke.c
* app/vectors/gimpvectors.[ch]: Removed Libart stuff here.
Libart usage now lives exclusively in GimpScanConvert.
* app/core/gimpdrawable-stroke.[ch]: New files for the libart
stroking (right now just vector objects).
* app/core/Makefile.am: changed accordingly.
* app/Makefile.am: Needed to tweak linking. :-/
2003-09-17 Simon Budig <simon@gimp.org>
* app/vectors/gimpstroke.[ch]
* app/vectors/gimpvectors.[ch]: Changed gimp_*_anchor_select to
accept the selection state as an argument.
* app/tools/gimpdrawtool.[ch]: Added "exclusive" boolean parameter
to gimp_draw_tool_on_vectors_handle(), so that you can specify
that you just get exactly the type of anchor you want to have.
* app/tools/gimpvectortool.[ch]: Handling of multiple selected
anchors: Shift-Clicking in Extend mode selects them, you can
move them together.
2003-09-16 Simon Budig <simon@gimp.org>
* app/vectors/gimpvectors.[ch]: Implemented an (unused/untested)
gimp_vectors_bounds () that returns the bounding box of an vectors
object.
* app/tools/gimpdrawtool.[ch]: made gimp_draw_tool_on_vectors()
ignore handles/anchors, since they are not visible when that
function gets used.
2003-09-07 Dave Neary <bolsh@gimp.org>
* app/vectors/gimpvectors.[ch]
* app/vectors/gimpstroke.[ch]
* app/vectors/gimpbezierstroke.c: Cleanup - removed libart
from the included headers in the .h files, don't pass around
libart objects any more. Still stub code.
2003-09-07 Sven Neumann <sven@gimp.org>
* app/vectors/gimpvectors.[ch]: redid the fix for the compiler
warning: made gimp_vectors_to_art_vpath() take a const GimpVectors
again, but don't freeze/thaw it since it isn't changed anyway.
2003-09-06 Dave Neary <bolsh@gimp.org>
Ooops! Sorry for the oversight.
* app/vectors/gimpvectors.[ch]
* app/vectors/gimpstroke.[ch]
* app/vectors/gimpbezierstroke.c: Changed include order
to conform to the coding standards in devel-docs/includes.txt
(which should really be integrated into HACKING).
2003-09-06 Dave Neary <bolsh@gimp.org>
* app/vectors/Makefile.am: Include libart headers
* app/vectors/gimpvectors.[ch]
* app/vectors/gimpstroke.[ch]
* app/vectors/gimpbezierstroke.[ch]: Committing unfinished,
useless stub code for converting a GimpVectors object to a
libart vector path. Will pad this out later.
2003-08-27 Michael Natterer <mitch@gimp.org>
Enabled type-preserving DND of all kinds of items between
different images. Fixes bug #119983.
* app/core/gimpitem.[ch]: added new virtual function
GimpItem::convert() which duplicates an item for another image.
* app/core/gimplayer.[ch]: removed gimp_layer_new_from_drawable()
and made it a GimpItem::convert() implementation.
* app/vectors/gimpvectors.[ch]: removed gimp_vectors_convert() and
made it a GimpItem::convert() implementation.
* app/widgets/gimpitemtreeview.[ch]: removed GimpConvertItemFunc
typedef and function pointer in GimpItemTreeViewClass since
we can simply call gimp_item_convert() now.
* app/widgets/gimplayertreeview.c
* app/widgets/gimpvectorstreeview.c
* app/display/gimpdisplayshell-dnd.c
* tools/pdbgen/pdb/layer.pdb: changed accordingly.
* app/pdb/layer_cmds.c: regenerated.
2003-08-21 Simon Budig <simon@gimp.org>
* app/vectors/gimpstroke.[ch]: added _is_empty () that checks
if a stroke is empty.
* app/vectors/gimpbezierstroke.c: Implemented _anchor_delete ()
* app/vectors/gimpvectors.[ch]: added _stroke_remove ()
* app/tools/gimpvectortool.[ch]: implemented the deletion of
anchors. CTRL-Click on the anchor in Insert/Delete mode does
the trick. Also did some renaming to the Vector tool
(now Path tool) and set the Tooltip to something sane.
Folks, I think the new path tool is no longer a regression
against the 1.2 bezier select tool!
2003-08-19 Simon Budig <simon@gimp.org>
* app/vectors/gimpvectors.h
* app/vectors/gimpstroke.[ch]: removed temp_anchor stuff. I don't
think that this is needed. Added virtual function to determine the
closest point on the curve to a given target point.
* app/vectors/gimpbezierstroke.c: implemented
gimp_bezier_stroke_nearest_point_get () - up to now untested and
unused.
2003-08-17 Simon Budig <simon@gimp.org>
* app/vectors/gimpstroke.[ch]
* app/vectors/gimpbezierstroke.[ch]: Virtualized
gimp_bezier_stroke_extend, added gimp_stroke_is_extendable.
* app/text/gimptext-vectors.c: changed accordingly.
* app/vectors/gimpvectors.[ch]: added gimp_vectors_anchor_select.
* app/tools/gimpvectoroptions.[ch]: dummy switch for future
extensions
* app/tools/gimpvectortool.[ch]: Major overhaul. Made use of
gimp_vector_tool_oper_update, cleaned up
gimp_vector_tool_button_press a lot and finally have a
working cursor_update. Still buggy, but I wanted to have it
in CVS.
2003-05-19 Simon Budig <simon@gimp.org>
* app/vectors/gimpbezierstroke.[ch]: Implemented closed paths. Not
yet available in a sane manner via the UI. Added the last missing
line from gimp_bezier_stroke_interpolate ().
* app/tools/gimpvectortool.c: Changed accordingly
* app/vectors/gimpstroke.[ch]
* app/vectors/gimpvectors.[ch]: removed Tabs.
2003-05-18 Michael Natterer <mitch@gimp.org>
* app/vectors/gimpvectors.[ch]: added new function
gimp_vectors_convert() which duplicates a GimpVectors for another
image.
* app/widgets/gimpvectorstreeview.c
(gimp_vectors_tree_view_class_init): use it as
GimpItemTreeView::convert_item() implementation. Enables
DND-copying of vectors between images.
2003-05-09 Michael Natterer <mitch@gimp.org>
* app/core/gimpitem.c: added default implementations for scale()
and resize() which just set the resulting width/height and offset
values.
* app/core/gimpdrawable.c: chain up in scale() and resize().
* app/vectors/gimpvectors.[ch]: buncha vectors changes/features:
- Removed unused "linked" and "locked" members.
- Removed "changed" signal.
- Added "freeze" and "thaw" signals and functions to emit them.
- Added "freeze_count" member so we emit only one freeze/thaw pair
even when doing nested changes.
- Added GimpItem::translate() implementation.
- Actually scale and resize the vectors in scale() and resize().
- Added undo for scale() and resize().
- Added freeze()/thaw() pairs around all modifying functions.
- Changed gimp_vectors_copy_strokes() to work as needed.
* app/core/gimpimage-resize.c
* app/core/gimpimage-scale.c: resize and scale all vectors.
Fixes bug #36491.
* app/core/gimpimage-undo-push.c (undo_pop_vectors_mod): added
freeze()/thaw() around the vectors-modifying code. Also restore
width, height and offsets.
* app/tools/gimpvectortool.c: connect to "freeze" and "thaw"
and pause()/resume() vectors drawing accordingly.
2003-04-14 Michael Natterer <mitch@gimp.org>
* app/vectors/gimpvectors.[ch]: made "changed" a real signal,
don't crash when iterating a NULL stroke list, cleanup.
2003-04-14 Simon Budig <simon@gimp.org>
* app/vectors/gimpstroke.[ch]
* app/vectors/gimpvectors.[ch]: Changed vectors->strokes to a
GList and removed stroke->next. Implemented stuff for duplicating
strokes. Duplicating a vector works now.
* app/tools/gimpvectortool.c: added not-yet-used function to
determine where a click has been. Refcounting stuff changed.
* app/core/gimpimage-mask-select.c
* app/paint/gimppaintcore-stroke.c: Changed accordingly.
2003-01-31 Michael Natterer <mitch@gimp.org>
* app/core/gimpitem.[ch]: added gimp_item_configure() and
gimp_item_copy().
* app/core/gimpdrawable.c (gimp_drawable_configure,copy): use them.
* app/vectors/gimpvectors.[ch]: added gimp_vectors_new(),
gimp_vectors_copy() and gimp_vectors_copy_points(). Use the new
GimpItem functions just as GimpDrawable does. Added a
get_memsize() implementation.
* app/vectors/gimpstroke.[ch]: made it a GimpObject and added
a get_memsize() implementation.
* app/undo.c: implemented vectors undo as if the new GimpVectors
functions above worked.
* app/gui/dialogs-constructors.c
* app/gui/vectors-commands.c
* app/tools/gimpvectortool.c: use gimp_vectors_new,copy().
2002-09-30 Simon Budig <simon@gimp.org>
* data/brushes/1circle.gbr: fixed the default spacing, so that
lines actually look like 1 pixel lines...
* themes/Default/images/tools/.cvsignore: Added some files.
* app/vectors/gimpanchor.h
* app/vectors/gimpbezierstroke.[ch]
* app/vectors/gimpstroke.h
* app/vectors/gimpvectors.h: Added some stuff, mostly unused
code that otherwise would just rot on my harddisk. Mitch: I
need to discuss the data structures with you...
2002-02-25 Simon Budig <simon@gimp.org>
* app/vectors/gimpbezierstroke.c
* app/tools/gimpvectortool.[ch]
* app/vectors/gimpstroke.[ch]
* app/vectors/gimpvectors.[ch]: Fixed various bugs, *including*
the nasty one from this morning (thanks Mitch).
2002-02-25 Simon Budig <simon@gimp.org>
* app/vectors/gimpvectors.c
* app/vectors/gimpvectors.h: Changed to a container of
GimpStrokes. This will enable it to contain different
Stroke-types in one Vectors-Object (think Entry in path
dialog)
* app/vectors/gimpstroke.c
* app/vectors/gimpstroke.h
* app/vectors/gimpbezierstroke.c
* app/vectors/gimpbezierstroke.h: New Objects: A connected
component in a vector.
* app/vectors/gimpbezier.c
* app/vectors/gimpbezier.h: Removed, obsoleted by gimpstroke
and gimpbezierstroke.
* app/tools/gimpvectortool.c
* app/vectors/Makefile.am
* app/vectors/vectors-types.h
* app/vectors/gimpanchor.h: Changed accordingly.
There is a nasty bug I am yet unable to find in the tool.
Don't use it. For some reason a wrong function instead of
gimp_stroke_real_anchor_get_next gets called. I have *no*
idea, whats wrong here. I stared at the code for hours.
If somebody has an idea I'd appreciate a hint.
2002-02-22 Simon Budig <simon@gimp.org>
* app/vectors/Makefile
* app/vectors/Makefile.am
* app/vectors/Makefile.in
* app/vectors/gimpanchor.h
* app/vectors/gimpbezier.c
* app/vectors/gimpbezier.h
* app/vectors/gimpvectors.c
* app/vectors/gimpvectors.h
* app/vectors/vectors-types.h: new files, the beginning
of a new vector infrastructure for gimp.
* configure.in
* app/Makefile.am
* app/core/core-types.h: changed accordingly.
* app/tools/Makefile.am
* app/tools/gimpvectortool.c
* app/tools/gimpvectortool.h
* app/tools/tools.c: New tool without practical use (yet),
using the new infrastructure.
to be continued...