Commit ab4d8b03 authored by Simon Budig's avatar Simon Budig Committed by Simon Budig

extended gimp_vectors_import() and friends with a parameter for returning

2006-10-25  Simon Budig  <simon@gimp.org>

        * app/vectors/gimpvectors-import.[ch]: extended gimp_vectors_import()
        and friends with a parameter for returning the newly generated vectors.

        * app/actions/edit-commands.c
        * app/actions/vectors-commands.c
        * app/display/gimpdisplayshell-dnd.c
        * app/widgets/gimpvectorstreeview.c: Changed accordingly.

        * app/vectors/vectors-enums.h: moved the GimpVectorsStrokeType to...
        * libgimpbase/gimpbaseenums.h: ... this file.

        * app/vectors/Makefile.am: Changed accordingly
        * app/vectors/vectors-enums.c: removed accordingly.

        * tools/pdbgen/pdb/vectors.pdb: new functions
        gimp_vectors_new_from_file() and gimp_vectors_new_from_string().

        * tools/pdbgen/pdb/paths.pdb: deprecated the previous functions.

        * app/pdb/internal_procs.c
        * app/pdb/paths_cmds.c
        * app/pdb/vectors_cmds.c
        * app/vectors/vectors-enums.c
        * libgimp/gimpenums.h
        * tools/pdbgen/enums.pl
        * libgimp/gimppaths_pdb.[ch]
        * libgimp/gimpvectors_pdb.[ch]
        * libgimpbase/gimpbaseenums.c
        * devel-docs/libgimp/tmpl/gimpfontselectbutton.sgml
        * devel-docs/libgimp/tmpl/gimptools.sgml: regenerated.
parent ec43fe20
2006-10-25 Simon Budig <simon@gimp.org>
* app/vectors/gimpvectors-import.[ch]: extended gimp_vectors_import()
and friends with a parameter for returning the newly generated vectors.
* app/actions/edit-commands.c
* app/actions/vectors-commands.c
* app/display/gimpdisplayshell-dnd.c
* app/widgets/gimpvectorstreeview.c: Changed accordingly.
* app/vectors/vectors-enums.h: moved the GimpVectorsStrokeType to...
* libgimpbase/gimpbaseenums.h: ... this file.
* app/vectors/Makefile.am: Changed accordingly
* app/vectors/vectors-enums.c: removed accordingly.
* tools/pdbgen/pdb/vectors.pdb: new functions
gimp_vectors_new_from_file() and gimp_vectors_new_from_string().
* tools/pdbgen/pdb/paths.pdb: deprecated the previous functions.
* app/pdb/internal_procs.c
* app/pdb/paths_cmds.c
* app/pdb/vectors_cmds.c
* app/vectors/vectors-enums.c
* libgimp/gimpenums.h
* tools/pdbgen/enums.pl
* libgimp/gimppaths_pdb.[ch]
* libgimp/gimpvectors_pdb.[ch]
* libgimpbase/gimpbaseenums.c
* devel-docs/libgimp/tmpl/gimpfontselectbutton.sgml
* devel-docs/libgimp/tmpl/gimptools.sgml: regenerated.
2006-10-25 Sven Neumann <sven@gimp.org>
* plug-ins/script-fu/scripts/Makefile.am
......
......@@ -408,7 +408,7 @@ edit_paste (GimpDisplay *display,
if (svg)
{
if (gimp_vectors_import_buffer (display->image, svg, svg_size,
TRUE, TRUE, -1, NULL))
TRUE, TRUE, -1, NULL, NULL))
{
gimp_image_flush (display->image);
}
......
......@@ -447,7 +447,7 @@ vectors_paste_cmd_callback (GtkAction *action,
GError *error = NULL;
if (! gimp_vectors_import_buffer (image, svg, svg_size,
TRUE, TRUE, -1, &error))
TRUE, TRUE, -1, NULL, &error))
{
gimp_message (image->gimp, G_OBJECT (widget), GIMP_MESSAGE_ERROR,
"%s", error->message);
......@@ -625,7 +625,7 @@ vectors_import_response (GtkWidget *widget,
if (gimp_vectors_import_file (dialog->image, filename,
vectors_import_merge, vectors_import_scale,
-1, &error))
-1, NULL, &error))
{
gimp_image_flush (dialog->image);
}
......
......@@ -275,7 +275,7 @@ gimp_display_shell_drop_svg (GtkWidget *widget,
if (! gimp_vectors_import_buffer (image,
(const gchar *) svg_data, svg_data_len,
TRUE, TRUE, -1, &error))
TRUE, TRUE, -1, NULL, &error))
{
gimp_message (image->gimp, G_OBJECT (shell->display), GIMP_MESSAGE_ERROR,
"%s", error->message);
......
......@@ -75,7 +75,7 @@ void register_undo_procs (GimpPDB *pdb);
void register_unit_procs (GimpPDB *pdb);
void register_vectors_procs (GimpPDB *pdb);
/* 534 procedures registered total */
/* 536 procedures registered total */
void
internal_procs_init (GimpPDB *pdb)
......
......@@ -640,7 +640,8 @@ path_import_invoker (GimpProcedure *procedure,
if (success)
{
success = gimp_vectors_import_file (image, filename, merge, scale, -1, NULL);
success = gimp_vectors_import_file (image, filename,
merge, scale, -1, NULL, NULL);
}
return gimp_procedure_get_return_values (procedure, success);
......@@ -669,7 +670,7 @@ path_import_string_invoker (GimpProcedure *procedure,
if (success)
{
success = gimp_vectors_import_buffer (image, string, length,
merge, scale, -1, NULL);
merge, scale, -1, NULL, NULL);
}
return gimp_procedure_get_return_values (procedure, success);
......@@ -1208,12 +1209,12 @@ register_paths_procs (GimpPDB *pdb)
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-path-import");
gimp_procedure_set_static_strings (procedure,
"gimp-path-import",
"Import paths from an SVG file.",
"This procedure imports paths from an SVG file. SVG elements other than paths and basic shapes are ignored.",
"Sven Neumann <sven@gimp.org>",
"Sven Neumann",
"2003",
NULL);
"This procedure is deprecated! Use 'vectors_new_from_file' instead.",
"This procedure is deprecated! Use 'vectors_new_from_file' instead.",
"",
"",
"",
"vectors_new_from_file");
gimp_procedure_add_argument (procedure,
gimp_param_spec_image_id ("image",
"image",
......@@ -1249,12 +1250,12 @@ register_paths_procs (GimpPDB *pdb)
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-path-import-string");
gimp_procedure_set_static_strings (procedure,
"gimp-path-import-string",
"Import paths from an SVG string.",
"This procedure works like 'gimp-path-import' but takes a string rather than reading the SVG from a file. This allows you to write scripts that generate SVG and feed it to GIMP.",
"Sven Neumann <sven@gimp.org>",
"Sven Neumann",
"2005",
NULL);
"This procedure is deprecated! Use 'vectors_new_from_string' instead.",
"This procedure is deprecated! Use 'vectors_new_from_string' instead.",
"",
"",
"",
"vectors_new_from_string");
gimp_procedure_add_argument (procedure,
gimp_param_spec_image_id ("image",
"image",
......
......@@ -36,6 +36,7 @@
#include "gimp-intl.h"
#include "vectors/gimpanchor.h"
#include "vectors/gimpbezierstroke.h"
#include "vectors/gimpvectors-import.h"
#include "vectors/gimpvectors.h"
......@@ -560,7 +561,7 @@ vectors_stroke_get_points_invoker (GimpProcedure *procedure,
gboolean closed = FALSE;
vectors = gimp_value_get_vectors (&args->values[0], gimp);
stroke_id = g_value_get_int (&args->values[1]);
stroke_id = g_value_get_enum (&args->values[1]);
if (success)
{
......@@ -939,6 +940,124 @@ vectors_to_selection_invoker (GimpProcedure *procedure,
return gimp_procedure_get_return_values (procedure, success);
}
static GValueArray *
vectors_new_from_file_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args)
{
gboolean success = TRUE;
GValueArray *return_vals;
GimpImage *image;
const gchar *filename;
gboolean merge;
gboolean scale;
gint32 num_vectors = 0;
gint32 *vectors_ids = NULL;
image = gimp_value_get_image (&args->values[0], gimp);
filename = g_value_get_string (&args->values[1]);
merge = g_value_get_boolean (&args->values[2]);
scale = g_value_get_boolean (&args->values[3]);
if (success)
{
GList *list, *vectors_list = NULL;
success = gimp_vectors_import_file (image, filename,
merge, scale, -1, &vectors_list, NULL);
if (success)
{
num_vectors = g_list_length (vectors_list);
if (num_vectors)
{
gint i;
vectors_ids = g_new (gint32, num_vectors);
list = vectors_list;
for (i = 0; i < num_vectors; i++, list = g_list_next (list))
vectors_ids[i] = gimp_item_get_ID (GIMP_ITEM (list->data));
g_list_free (vectors_list);
}
}
}
return_vals = gimp_procedure_get_return_values (procedure, success);
if (success)
{
g_value_set_int (&return_vals->values[1], num_vectors);
gimp_value_take_int32array (&return_vals->values[2], vectors_ids, num_vectors);
}
return return_vals;
}
static GValueArray *
vectors_new_from_string_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args)
{
gboolean success = TRUE;
GValueArray *return_vals;
GimpImage *image;
const gchar *string;
gint32 length;
gboolean merge;
gboolean scale;
gint32 num_vectors = 0;
gint32 *vectors_ids = NULL;
image = gimp_value_get_image (&args->values[0], gimp);
string = g_value_get_string (&args->values[1]);
length = g_value_get_int (&args->values[2]);
merge = g_value_get_boolean (&args->values[3]);
scale = g_value_get_boolean (&args->values[4]);
if (success)
{
GList *list, *vectors_list = NULL;
success = gimp_vectors_import_buffer (image, string, length,
merge, scale, -1, &vectors_list, NULL);
if (success)
{
num_vectors = g_list_length (vectors_list);
if (num_vectors)
{
gint i;
vectors_ids = g_new (gint32, num_vectors);
list = vectors_list;
for (i = 0; i < num_vectors; i++, list = g_list_next (list))
vectors_ids[i] = gimp_item_get_ID (GIMP_ITEM (list->data));
g_list_free (vectors_list);
}
}
}
return_vals = gimp_procedure_get_return_values (procedure, success);
if (success)
{
g_value_set_int (&return_vals->values[1], num_vectors);
gimp_value_take_int32array (&return_vals->values[2], vectors_ids, num_vectors);
}
return return_vals;
}
void
register_vectors_procs (GimpPDB *pdb)
{
......@@ -1526,11 +1645,12 @@ register_vectors_procs (GimpPDB *pdb)
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("stroke-id",
"stroke id",
"The stroke ID",
G_MININT32, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
g_param_spec_enum ("stroke-id",
"stroke id",
"The stroke ID",
GIMP_TYPE_VECTORS_STROKE_TYPE,
GIMP_VECTORS_STROKE_TYPE_BEZIER,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_int32 ("type",
"type",
......@@ -1914,4 +2034,114 @@ register_vectors_procs (GimpPDB *pdb)
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-new-from-file
*/
procedure = gimp_procedure_new (vectors_new_from_file_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-vectors-new-from-file");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-new-from-file",
"Import paths from an SVG file.",
"This procedure imports paths from an SVG file. SVG elements other than paths and basic shapes are ignored.",
"Simon Budig",
"Simon Budig",
"2006",
NULL);
gimp_procedure_add_argument (procedure,
gimp_param_spec_image_id ("image",
"image",
"The image",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("filename",
"filename",
"The name of the SVG file to import.",
TRUE, FALSE,
NULL,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("merge",
"merge",
"Merge paths into a single vectors object.",
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("scale",
"scale",
"Scale the SVG to image dimensions.",
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_int32 ("num-vectors",
"num vectors",
"The number of newly created vectors",
0, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_int32_array ("vectors-ids",
"vectors ids",
"The list of newly created vectors",
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-new-from-string
*/
procedure = gimp_procedure_new (vectors_new_from_string_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-vectors-new-from-string");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-new-from-string",
"Import paths from an SVG string.",
"This procedure works like 'gimp-vectors-new-from-file' but takes a string rather than reading the SVG from a file. This allows you to write scripts that generate SVG and feed it to GIMP.",
"Simon Budig",
"Simon Budig",
"2006",
NULL);
gimp_procedure_add_argument (procedure,
gimp_param_spec_image_id ("image",
"image",
"The image",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("string",
"string",
"A string that must be a complete and valid SVG document.",
TRUE, FALSE,
NULL,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("length",
"length",
"Number of bytes in string or -1 if the string is NULL terminated.",
G_MININT32, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("merge",
"merge",
"Merge paths into a single vectors object.",
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("scale",
"scale",
"Scale the SVG to image dimensions.",
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_int32 ("num-vectors",
"num vectors",
"The number of newly created vectors",
0, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_int32_array ("vectors-ids",
"vectors ids",
"The list of newly created vectors",
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
}
......@@ -37,22 +37,5 @@ libappvectors_a_SOURCES = \
gimpvectors-warp.c \
gimpvectors-warp.h
libappvectors_a_built_sources = \
vectors-enums.c
EXTRA_DIST = makefile.msc
$(srcdir)/vectors-enums.c: $(srcdir)/vectors-enums.h $(GIMP_MKENUMS)
$(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"libgimpbase/gimpbase.h\"\n#include \"vectors-enums.h\"\n#include \"gimp-intl.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static const G@Type@Value values[] =\n {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n" \
--dhead " static const Gimp@Type@Desc descs[] =\n {" \
--dprod " { @VALUENAME@, @valuedesc@, @valuehelp@ }," \
--dtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (! type)\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \
$(srcdir)/vectors-enums.h > xgen-cec \
&& cp xgen-cec $(@F) \
&& rm -f xgen-cec
......@@ -95,6 +95,7 @@ static gboolean gimp_vectors_import (GimpImage *image,
gboolean merge,
gboolean scale,
gint position,
GList **ret_vectors,
GError **error);
static void svg_parser_start_element (GMarkupParseContext *context,
......@@ -195,14 +196,16 @@ gimp_vectors_import_file (GimpImage *image,
gboolean merge,
gboolean scale,
gint position,
GList **ret_vectors,
GError **error)
{
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
g_return_val_if_fail (filename != NULL, FALSE);
g_return_val_if_fail (ret_vectors == NULL || *ret_vectors == NULL, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
return gimp_vectors_import (image, filename, NULL, 0, merge, scale, position,
error);
ret_vectors, error);
}
/**
......@@ -225,14 +228,16 @@ gimp_vectors_import_buffer (GimpImage *image,
gboolean merge,
gboolean scale,
gint position,
GList **ret_vectors,
GError **error)
{
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
g_return_val_if_fail (buffer != NULL || len == 0, FALSE);
g_return_val_if_fail (ret_vectors == NULL || *ret_vectors == NULL, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
return gimp_vectors_import (image, NULL, buffer, len, merge, scale, position,
error);
ret_vectors, error);
}
static gboolean
......@@ -243,6 +248,7 @@ gimp_vectors_import (GimpImage *image,
gboolean merge,
gboolean scale,
gint position,
GList **ret_vectors,
GError **error)
{
GimpXmlParser *xml_parser;
......@@ -299,6 +305,9 @@ gimp_vectors_import (GimpImage *image,
gimp_image_add_vectors (image, vectors, position);
gimp_vectors_freeze (vectors);
if (ret_vectors)
*ret_vectors = g_list_prepend (*ret_vectors, vectors);
if (position != -1)
position++;
}
......
......@@ -28,6 +28,7 @@ gboolean gimp_vectors_import_file (GimpImage *image,
gboolean merge,
gboolean scale,
gint position,
GList **ret_vectors,
GError **error);
gboolean gimp_vectors_import_buffer (GimpImage *image,
const gchar *buffer,
......@@ -35,6 +36,7 @@ gboolean gimp_vectors_import_buffer (GimpImage *image,
gboolean merge,
gboolean scale,
gint position,
GList **ret_vectors,
GError **error);
......
/* Generated data (by gimp-mkenums) */
#include "config.h"
#include <glib-object.h>
#include "libgimpbase/gimpbase.h"
#include "vectors-enums.h"
#include "gimp-intl.h"
/* enumerations from "./vectors-enums.h" */
GType
gimp_vectors_stroke_type_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_VECTORS_STROKE_TYPE_BEZIER, "GIMP_VECTORS_STROKE_TYPE_BEZIER", "bezier" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_VECTORS_STROKE_TYPE_BEZIER, "GIMP_VECTORS_STROKE_TYPE_BEZIER", NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (! type)
{
type = g_enum_register_static ("GimpVectorsStrokeType", values);
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
/* Generated data ends here */
......@@ -22,15 +22,6 @@
#ifndef __VECTORS_ENUMS_H__
#define __VECTORS_ENUMS_H__
#define GIMP_TYPE_VECTORS_STROKE_TYPE (gimp_vectors_stroke_type_get_type ())
GType gimp_vectors_stroke_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_VECTORS_STROKE_TYPE_BEZIER
} GimpVectorsStrokeType;
typedef enum /*< skip >*/
{
GIMP_ANCHOR_ANCHOR,
......
......@@ -233,7 +233,7 @@ gimp_vectors_tree_view_drop_svg (GimpContainerTreeView *tree_view,
}
if (! gimp_vectors_import_buffer (image, svg_data, svg_data_len,
TRUE, TRUE, index, &error))
TRUE, TRUE, index, NULL, &error))
{
gimp_message (image->gimp, G_OBJECT (tree_view), GIMP_MESSAGE_ERROR,
"%s", error->message);
......
......@@ -28,10 +28,6 @@ GimpFontSelectButton
</para>
@:
@:
@:
@gimpfontselectbutton: the object which received the signal.
@arg1:
@arg2:
......@@ -41,9 +37,9 @@ GimpFontSelectButton
</para>
@gimpfontselectbutton: the object which received the signal.
@arg1:
@arg2:
@:
@:
@:
<!-- ##### ARG GimpFontSelectButton:font-name ##### -->
<para>
......
......@@ -68,7 +68,8 @@ Functions giving access to common toolbox tools.
@operation:
@antialias:
@feather:
@feather_radius:
@feather_radius_x:
@feather_radius_y:
@sample_merged:
@select_transparent:
@select_criterion:
......@@ -263,7 +264,8 @@ Functions giving access to common toolbox tools.
@operation:
@antialias:
@feather:
@feather_radius:
@feather_radius_x:
@feather_radius_y:
@sample_merged:
@select_transparent:
@select_criterion:
......
......@@ -310,16 +310,6 @@ typedef enum
} GimpVectorExtendMode;
#define GIMP_TYPE_VECTORS_STROKE_TYPE (gimp_vectors_stroke_type_get_type ())
GType gimp_vectors_stroke_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_VECTORS_STROKE_TYPE_BEZIER
} GimpVectorsStrokeType;
void gimp_enums_init (void);
const gchar ** gimp_enums_get_type_names (gint *n_type_names);
......
......@@ -527,10 +527,7 @@ gimp_path_to_selection (gint32 image_ID,
* @merge: Merge paths into a single vectors object.
* @scale: Scale the SVG to image dimensions.
*
* Import paths from an SVG file.
*
* This procedure imports paths from an SVG file. SVG elements other
* than paths and basic shapes are ignored.
* This procedure is deprecated! Use vectors_new_from_file() instead.
*
* Returns: TRUE on success.
*/
......@@ -567,15 +564,9 @@ gimp_path_import (gint32 image_ID,
* @merge: Merge paths into a single vectors object.
* @scale: Scale the SVG to image dimensions.
*
* Import paths from an SVG string.
*
* This procedure works like gimp_path_import() but takes a string
* rather than reading the SVG from a file. This allows you to write
* scripts that generate SVG and feed it to GIMP.
* This procedure is deprecated! Use vectors_new_from_string() instead.
*
* Returns: TRUE on success.
*
* Since: GIMP 2.4
*/
gboolean
gimp_path_import_string (gint32 image_ID,
......
......@@ -73,7 +73,6 @@ gboolean gimp_path_to_selection (gint32 image_ID,
gboolean feather,
gdouble feather_radius_x,
gdouble feather_radius_y);
#endif /* GIMP_DISABLE_DEPRECATED */
gboolean gimp_path_import (gint32 image_ID,
const gchar *filename,
gboolean merge,
......@@ -83,6 +82,7 @@ gboolean gimp_path_import_string (gint32 image_ID,
gint length,
gboolean merge,
gboolean scale);
#endif /* GIMP_DISABLE_DEPRECATED */
G_END_DECLS
......
......@@ -674,11 +674,11 @@ gimp_vectors_stroke_scale (gint32 vectors_ID,
* Since: GIMP 2.4
*/
gint
gimp_vectors_stroke_get_points (gint32 vectors_ID,
gint stroke_id,
gint *num_points,
gdouble **controlpoints,
gboolean *closed)
gimp_vectors_stroke_get_points (gint32 vectors_ID,
GimpVectorsStrokeType stroke_id,
gint *num_points,
gdouble **controlpoints,
gboolean *closed)
{
GimpParam *return_vals;
gint nreturn_vals;
......@@ -1030,3 +1030,111 @@ gimp_vectors_to_selection (gint32 vectors_ID,
return success;
}
/**
* gimp_vectors_new_from_file:
* @image_ID: The image.
* @filename: The name of the SVG file to import.
* @merge: Merge paths into a single vectors object.
* @scale: Scale the SVG to image dimensions.
* @num_vectors: The number of newly created vectors.
*
* Import paths from an SVG file.
*
* This procedure imports paths from an SVG file. SVG elements other
* than paths and basic shapes are ignored.
*
* Returns: The list of newly created vectors.
*
* Since: GIMP 2.4
*/
gint *
gimp_vectors_new_from_file (gint32 image_ID,
const gchar *filename,
gboolean merge,
gboolean scale,
gint *num_vectors)
{
GimpParam *retu