68
68
* Creates a new empty vectors object.
70
* Creates a new empty vectors object. Needs to be added to an image
71
* using gimp_image_add_vectors().
70
* Creates a new empty vectors object. The vectors object needs to be
71
* added to the image using gimp_image_add_vectors().
73
73
* Returns: the current vector object, 0 if no vector exists in the image.
100
* gimp_vectors_new_from_text_layer:
101
* @image_ID: The image.
102
* @layer_ID: The text layer.
104
* Creates a new vectors object from a text layer.
106
* Creates a new vectors object from a text layer. The vectors object
107
* needs to be added to the image using gimp_image_add_vectors().
109
* Returns: The vectors of the text layer.
114
gimp_vectors_new_from_text_layer (gint32 image_ID,
117
GimpParam *return_vals;
119
gint32 vectors_ID = -1;
121
return_vals = gimp_run_procedure ("gimp-vectors-new-from-text-layer",
123
GIMP_PDB_IMAGE, image_ID,
124
GIMP_PDB_LAYER, layer_ID,
127
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
128
vectors_ID = return_vals[1].data.d_vectors;
130
gimp_destroy_params (return_vals, nreturn_vals);
137
* @vectors_ID: The vectors object to copy.
139
* Copy a vectors object.
141
* This procedure copies the specified vectors object and returns the
144
* Returns: The newly copied vectors object.
149
gimp_vectors_copy (gint32 vectors_ID)
151
GimpParam *return_vals;
153
gint32 vectors_copy_ID = -1;
155
return_vals = gimp_run_procedure ("gimp-vectors-copy",
157
GIMP_PDB_VECTORS, vectors_ID,
160
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
161
vectors_copy_ID = return_vals[1].data.d_vectors;
163
gimp_destroy_params (return_vals, nreturn_vals);
165
return vectors_copy_ID;
100
169
* gimp_vectors_get_image:
101
170
* @vectors_ID: The vectors object.
1364
1433
return success;
1437
* gimp_vectors_export_to_file:
1438
* @image_ID: The image.
1439
* @filename: The name of the SVG file to create.
1440
* @vectors_ID: The vectors object to be saved, or 0 for all in the image.
1442
* save a path as an SVG file.
1444
* This procedure creates an SVG file to save a Vectors object, that
1445
* is, a path. The resulting file can be edited using a vector graphics
1446
* application, or later reloaded into GIMP. If you pass 0 as the
1447
* 'vectors' argument, then all paths in the image will be exported.
1449
* Returns: TRUE on success.
1454
gimp_vectors_export_to_file (gint32 image_ID,
1455
const gchar *filename,
1458
GimpParam *return_vals;
1460
gboolean success = TRUE;
1462
return_vals = gimp_run_procedure ("gimp-vectors-export-to-file",
1464
GIMP_PDB_IMAGE, image_ID,
1465
GIMP_PDB_STRING, filename,
1466
GIMP_PDB_VECTORS, vectors_ID,
1469
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
1471
gimp_destroy_params (return_vals, nreturn_vals);
1477
* gimp_vectors_export_to_string:
1478
* @image_ID: The image.
1479
* @vectors_ID: The vectors object to save, or 0 for all in the image.
1481
* Save a path as an SVG string.
1483
* This procedure works like gimp_vectors_export_to_file() but creates
1484
* a string rather than a file. The contents are a %NUL-terminated
1485
* string that holds a complete XML document. If you pass 0 as the
1486
* 'vectors' argument, then all paths in the image will be exported.
1488
* Returns: A string whose contents are a complete SVG document.
1493
gimp_vectors_export_to_string (gint32 image_ID,
1496
GimpParam *return_vals;
1498
gchar *string = NULL;
1500
return_vals = gimp_run_procedure ("gimp-vectors-export-to-string",
1502
GIMP_PDB_IMAGE, image_ID,
1503
GIMP_PDB_VECTORS, vectors_ID,
1506
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
1507
string = g_strdup (return_vals[1].data.d_string);
1509
gimp_destroy_params (return_vals, nreturn_vals);