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

@ -192,7 +192,7 @@ sub vectors_stroke_get_length {
code => <<"CODE"
{
PikaStroke *stroke = pika_pdb_get_vectors_stroke (vectors, stroke_id, 0, error);
if (stroke)
length = pika_stroke_get_length (stroke, precision);
else
@ -207,7 +207,7 @@ sub vectors_stroke_get_point_at_dist {
$help = <<'HELP';
This will return the x,y position of a point at a given distance along the
stroke. The distance will be obtained by first digitizing the
stroke. The distance will be obtained by first digitizing the
curve internally and then walking along the curve. For a closed stroke the
start of the path is the first point on the path that was created. This might
not be obvious. If the stroke is not long enough, a "valid" flag will be FALSE.
@ -241,7 +241,7 @@ HELP
code => <<"CODE"
{
PikaStroke *stroke = pika_pdb_get_vectors_stroke (vectors, stroke_id, 0, error);
if (stroke)
{
PikaCoords coord;
@ -279,7 +279,7 @@ HELP
{
PikaStroke *stroke = pika_pdb_get_vectors_stroke (vectors, stroke_id,
PIKA_PDB_ITEM_CONTENT, error);
if (stroke)
{
if (pika_item_is_attached (PIKA_ITEM (vectors)))
@ -317,7 +317,7 @@ HELP
{
PikaStroke *stroke = pika_pdb_get_vectors_stroke (vectors, stroke_id,
PIKA_PDB_ITEM_CONTENT, error);
if (stroke)
{
if (pika_item_is_attached (PIKA_ITEM (vectors)))
@ -405,7 +405,7 @@ HELP
PIKA_PDB_ITEM_CONTENT |
PIKA_PDB_ITEM_POSITION,
error);
if (stroke)
{
if (pika_item_is_attached (PIKA_ITEM (vectors)))
@ -451,7 +451,7 @@ HELP
PIKA_PDB_ITEM_CONTENT |
PIKA_PDB_ITEM_POSITION,
error);
if (stroke)
{
if (pika_item_is_attached (PIKA_ITEM (vectors)))
@ -498,7 +498,7 @@ HELP
PIKA_PDB_ITEM_CONTENT |
PIKA_PDB_ITEM_POSITION,
error);
if (stroke)
{
if (pika_item_is_attached (PIKA_ITEM (vectors)))
@ -544,7 +544,7 @@ HELP
PIKA_PDB_ITEM_CONTENT |
PIKA_PDB_ITEM_POSITION,
error);
if (stroke)
{
if (pika_item_is_attached (PIKA_ITEM (vectors)))
@ -595,7 +595,7 @@ HELP
PIKA_PDB_ITEM_CONTENT |
PIKA_PDB_ITEM_POSITION,
error);
if (stroke)
{
if (pika_item_is_attached (PIKA_ITEM (vectors)))
@ -647,7 +647,7 @@ HELP
code => <<"CODE"
{
PikaStroke *stroke = pika_pdb_get_vectors_stroke (vectors, stroke_id, 0, error);
if (PIKA_IS_BEZIER_STROKE (stroke))
{
GArray *points_array;
@ -713,7 +713,7 @@ HELP
code => <<"CODE"
{
PikaStroke *stroke = pika_pdb_get_vectors_stroke (vectors, stroke_id, 0, error);
if (stroke)
{
GArray *coords_array;
@ -1162,7 +1162,7 @@ HELP
{
GList *list;
gint i;
vectors = g_new (PikaVectors *, num_vectors);
for (i = 0, list = vectors_list;
@ -1231,9 +1231,9 @@ HELP
{
GList *list;
gint i;
vectors = g_new (PikaVectors *, num_vectors);
for (i = 0, list = vectors_list;
i < num_vectors;
i++, list = g_list_next (list))
@ -1255,8 +1255,8 @@ sub vectors_export_to_file {
$help = <<'HELP';
This procedure creates an SVG file to save a Vectors object, that is,
a path. The resulting file can be edited using a vector graphics
application, or later reloaded into PIKA. If you pass 0 as the 'vectors'
argument, then all paths in the image will be exported.
application, or later reloaded into PIKA. Pass %NULL as the 'vectors'
argument to export all paths in the image.
HELP
&bill_pdb_misc('2007', '2.6');
@ -1267,14 +1267,17 @@ HELP
{ name => 'file', type => 'file',
desc => 'The SVG file to create.' },
{ name => 'vectors', type => 'vectors', no_validate => 1,
desc => 'The vectors object to be saved, or 0 for all in the image' }
desc => 'The vectors object to export, or %NULL for all in the image' }
);
%invoke = (
headers => [ qw("vectors/pikavectors-export.h") ],
code => <<'CODE'
{
GList *vectors_list = g_list_prepend (NULL, vectors);
GList *vectors_list = NULL;
if (vectors != NULL)
vectors_list = g_list_prepend (vectors_list, vectors);
success = pika_vectors_export_file (image, vectors_list, file, error);
@ -1289,9 +1292,9 @@ sub vectors_export_to_string {
$help = <<'HELP';
This procedure works like pika_vectors_export_to_file() but creates a string
rather than a file. The contents are a NUL-terminated string that holds a
complete XML document. If you pass 0 as the 'vectors' argument, then all
paths in the image will be exported.
rather than a file. The string is NULL-terminated and holds a
complete XML document. Pass %NULL as the 'vectors' argument to export
all paths in the image.
HELP
&bill_pdb_misc('2007', '2.6');
@ -1300,7 +1303,7 @@ HELP
{ name => 'image', type => 'image',
desc => 'The image' },
{ name => 'vectors', type => 'vectors', no_validate => 1,
desc => 'The vectors object to save, or 0 for all in the image' }
desc => 'The vectors object to export, or %NULL for all in the image' }
);
@outargs = (
@ -1312,7 +1315,10 @@ HELP
headers => [ qw("vectors/pikavectors-export.h") ],
code => <<'CODE'
{
GList *vectors_list = g_list_prepend (NULL, vectors);
GList *vectors_list = NULL;
if (vectors != NULL)
vectors_list = g_list_prepend (vectors_list, vectors);
string = pika_vectors_export_string (image, vectors_list);
g_list_free (vectors_list);