Allow to pass a double-pointer to be nullified as the transfer data in order
to mark it as NULL when the transfer is done.
This is useful if we're keeping the transfer around in order to check that
no one is currently running.
When a transfer is completed, we automatically unref it since we can't
consider it valid anymore since this point.
Update the drivers not to free the transfer after submitting anymore.
When a machine is completed, we automatically free it since we can't
consider it valid anymore since this point.
Update the drivers not to free the SSM on completion callback anymore.
As per commit 201b5a961 we use g_date_copy() to copy the date, however the
GLib implementation is done assuming that the GDate getters are always used
as the copy function doesn't preserve the original format of the date
(whether is using julian days or dmy), and the synaptics driver access to
the dmy values directly, without using the getter that would recompute the
proper values.
Causing a read error of unset values.
So, to avoid this, just use the g_date_get_* getters to retrieve the day
month and year for for defining the print enroll id.
This is the same logic we apply to fp-device by default: any completed
action should trigger the subsequent one when it is finished.
So in case we want reactivate after a deactivation, let's do it in an idle,
after removing the current pending timeout.
Just define once and modify its syntax when needed.
Use a more verbose definition for the min/max version (instead of just
join the split version) so that in case we may depend on a specifc glib
micro release during development.
Meson files are normally using 4-spaces to indent and functions use first
parameter on the same line while others at next indentation level, not
following the parenthesis indentation.
So adapt libfprint to follow the meson standard.
Use the same approach of GTask, making possible to set the data from a
function. Givent the fact that a SSM has now a device parameter, it's
generally not needed to pass an extra data value.
In such case make it possible to set it and to define a destroy-notify
function to handle its destruction when freeing the SSM.
While there are various functions which similar usage in all the examples,
I'd prefer to keep each example to be self-containing most of the things.
However some clearly repeated action can be moved to a single codebase.
With the spatch to use GLib memory functions a lot of error paths were
removed. This causes an unused variable warning, so drop in a further
patch to remove the unused variable.
These examples have not been ported. In addition, they are also not very
useful these days, as the demo application offers a much nicer view to
view images from a sensor.
When drivers signal that an action is completed, they might be still in the
middle of a SSM and so its callback might not be called properly as part of
the completion.
This could make impossible to chain operations like open->enroll/list with
some drivers (hey, synaptics, I'm looking at you!) when the next operation
is called from the GAsyncReadyCallback of the previous call.
To avoid this to happen, ensure that when a driver completes an operation,
we handle the notification to the caller in a next idle iteration, not to
end up in a possible broken state.
Abstract this by using a function that handles the task return for each
used task type to avoid duplicating similar functions doing all the same
thing