With this script it is possible to test libfprint/fprintd without any
hardware device. The image needs to be provides as a PNG with the alpha
channel storing the print data.
See the comment in the file on how the script can be used.
This is a rewrite of the core based on GObject and Gio. This commit
breaks the build in a lot of ways, but basic functionality will start
working again with the next commits.
Apply the previously added spatch/coccinell file to replace all
free/malloc/realloc calls with g_free/g_malloc/g_realloc. It also removes
all the error code paths that we do not need to check anymore.
This means that the returned data must be free'ed using g_free rather
than free, making memory management more consistent.
Add an spatch/coccinelle file to replace all free/malloc/realloc calls
with g_free/g_malloc/g_realloc. It also removes all the error code paths
that we do not need to check anymore.
These PNGs were generated using gimp simply by using the greyscale image
itself as an alpha mask. The reason to do this is solely for easier
consumption together with cairo A8 surfaces.
We will not want to install virtual drivers by default, yet they should
be inside the "all" category. So add a new "default" category and also a
separate array for the future virtual drivers.
We will use GUsb rather than libusb directly in the future. This should
simplify a lot of the integration work and changes such as supporting
hotplugging. It will also require quite a lot of internal changes.
If one of the callbacks called from fpi_imgdev_deactivate_complete()
was reactivating the device, then we would be overwriting whichever
"action" got set in the callback, leading to
fpi_imgdev_activate_complete() failing as it doesn't handle the "none"
action.
Reset the action before calling the callbacks.
If a USB transfer is started but not completed in one go, the wdata we
pass to continue_write_regv() will already be freed by the time we try
to use it again.
Only free() the wdata on error, or when the USB transfer is completed.
Closes: #180
The state was always AWAIT_FINGER and it was never used by any driver
(except for error checking). So remove it, in particular as a correct
state change will be done after activation anyway.
The only driver with code that actually did anything based on this was
the URU4000 driver. However, all it did was an explicit state change
execution. This is not necessary, as the state_change handler is called
anyway (i.e. we now only write the AWAIT_FINGER register once rather
than twice).
Manual changes plus:
@ init @
identifier driver_name;
identifier activate_func;
@@
struct fp_img_driver driver_name = {
...,
.activate = activate_func,
...,
};
@ remove_arg @
identifier dev;
identifier state;
identifier init.activate_func;
@@
activate_func (
struct fp_img_dev *dev
- , enum fp_imgdev_state state
)
{
<...
- if (state != IMGDEV_STATE_AWAIT_FINGER_ON) { ... }
...>
}
The driver was never ported to the new asynchronous model, meaning it
has been defunct since some time in 2008. Remove the driver, as
seemingly no one has complained about this and we have no proper way to
even verify a port is correct.
libfprint already uses G_DEBUG_HERE in a lot of places which requires
GLib 2.50. Also add the appropriate defines so that usage of newer API
will result in warnings.