Update upstream

This commit is contained in:
2023-12-02 11:03:24 -08:00
parent 84ea557696
commit d472f6348d
129 changed files with 17814 additions and 14162 deletions

View File

@ -51,19 +51,26 @@ static gchar * pika_vectors_export_path_data (PikaVectors *vectors);
/**
* pika_vectors_export_file:
* @image: the #PikaImage from which to export vectors
* @vectors: a #GList of #PikaVectors objects or %NULL to export all vectors in @image
* @image: the #PikaImage from which to export
* @path_list: a #GList of #PikaVectors objects or %NULL to export all paths in @image
* @file: the file to write
* @error: return location for errors
*
* Exports one or more vectors to a SVG file.
* Exports one or more vectors aka path to an SVG file aka XML doc.
*
* When @path_list is %NULL aka empty list, exports all paths in image.
*
* When @path_list is empty and image has no paths,
* this still writes a non-empty file containing an XML doc.
*
* Will overwrite any existing file.
*
* Returns: %TRUE on success,
* %FALSE if there was an error writing the file
* %FALSE when there was an error writing the file
**/
gboolean
pika_vectors_export_file (PikaImage *image,
GList *vectors,
GList *path_list,
GFile *file,
GError **error)
{
@ -81,7 +88,7 @@ pika_vectors_export_file (PikaImage *image,
if (! output)
return FALSE;
string = pika_vectors_export (image, vectors);
string = pika_vectors_export (image, path_list);
if (! g_output_stream_write_all (output, string->str, string->len,
NULL, NULL, &my_error))
@ -111,20 +118,25 @@ pika_vectors_export_file (PikaImage *image,
/**
* pika_vectors_export_string:
* @image: the #PikaImage from which to export vectors
* @vectors: a #PikaVectors object or %NULL to export all vectors in @image
* @image: the #PikaImage from which to export
* @path_list: a #GList of #PikaVectors objects, or %NULL to export all paths in @image
*
* Exports one or more vectors to a SVG string.
* Exports one or more vectors aka path to a SVG string.
*
* Returns: a %NUL-terminated string that holds a complete XML document
* When @path_list is %NULL aka empty list, exports all paths in image.
*
* When @path_list is empty and image has no paths,
* this still returns a string for an empty XML doc.
*
* Returns: a NULL-terminated string that holds a complete XML document
**/
gchar *
pika_vectors_export_string (PikaImage *image,
GList *vectors)
GList *path_list)
{
g_return_val_if_fail (PIKA_IS_IMAGE (image), NULL);
return g_string_free (pika_vectors_export (image, vectors), FALSE);
return g_string_free (pika_vectors_export (image, path_list), FALSE);
}
static GString *