mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-06-11 18:38:07 +00:00
tests: Use more versioned types for fpi types tests
Also move images into its own header
This commit is contained in:
@@ -24,11 +24,11 @@
|
||||
|
||||
#include "base-fp-device.h"
|
||||
|
||||
typedef struct _GUsbDevice GUsbDevice;
|
||||
typedef struct _GUsbDevice GUsbDevice;
|
||||
|
||||
typedef struct _FpIdEntryTODV1 FpIdEntryTODV1;
|
||||
typedef struct _FpIdEntryTODV1_90_1 FpIdEntryTODV1_90_1;
|
||||
|
||||
struct _FpIdEntryTODV1
|
||||
struct _FpIdEntryTODV1_90_1
|
||||
{
|
||||
union
|
||||
{
|
||||
@@ -46,21 +46,21 @@ struct _FpIdEntryTODV1
|
||||
gpointer _padding_dummy[16];
|
||||
};
|
||||
|
||||
struct _FpDeviceClassTODV1
|
||||
struct _FpDeviceClassTODV1_90_1
|
||||
{
|
||||
/*< private >*/
|
||||
GObjectClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
/* Static information about the driver. */
|
||||
const gchar *id;
|
||||
const gchar *full_name;
|
||||
FpDeviceTypeTODV1 type;
|
||||
const FpIdEntryTODV1 *id_table;
|
||||
const gchar *id;
|
||||
const gchar *full_name;
|
||||
FpDeviceTypeTODV1_90_1 type;
|
||||
const FpIdEntryTODV1_90_1 *id_table;
|
||||
|
||||
/* Defaults for device properties */
|
||||
gint nr_enroll_stages;
|
||||
FpScanTypeTODV1 scan_type;
|
||||
gint nr_enroll_stages;
|
||||
FpScanTypeTODV1_90_1 scan_type;
|
||||
|
||||
/* Callbacks */
|
||||
gint (*usb_discover) (GUsbDevice *usb_device);
|
||||
@@ -81,34 +81,186 @@ struct _FpDeviceClassTODV1
|
||||
gpointer _padding_dummy[32];
|
||||
};
|
||||
|
||||
typedef struct _FpDeviceClassTODV1 FpDeviceClassTODV1;
|
||||
typedef struct _FpDeviceClassTODV1_90_1 FpDeviceClassTODV1_90_1;
|
||||
|
||||
typedef enum {
|
||||
FPI_DEVICE_ACTION_TODV1_NONE = 0,
|
||||
FPI_DEVICE_ACTION_TODV1_PROBE,
|
||||
FPI_DEVICE_ACTION_TODV1_OPEN,
|
||||
FPI_DEVICE_ACTION_TODV1_CLOSE,
|
||||
FPI_DEVICE_ACTION_TODV1_ENROLL,
|
||||
FPI_DEVICE_ACTION_TODV1_VERIFY,
|
||||
FPI_DEVICE_ACTION_TODV1_IDENTIFY,
|
||||
FPI_DEVICE_ACTION_TODV1_CAPTURE,
|
||||
FPI_DEVICE_ACTION_TODV1_LIST,
|
||||
FPI_DEVICE_ACTION_TODV1_DELETE,
|
||||
} FpiDeviceActionTODV1;
|
||||
FPI_DEVICE_ACTION_TODV1_90_1_NONE = 0,
|
||||
FPI_DEVICE_ACTION_TODV1_90_1_PROBE,
|
||||
FPI_DEVICE_ACTION_TODV1_90_1_OPEN,
|
||||
FPI_DEVICE_ACTION_TODV1_90_1_CLOSE,
|
||||
FPI_DEVICE_ACTION_TODV1_90_1_ENROLL,
|
||||
FPI_DEVICE_ACTION_TODV1_90_1_VERIFY,
|
||||
FPI_DEVICE_ACTION_TODV1_90_1_IDENTIFY,
|
||||
FPI_DEVICE_ACTION_TODV1_90_1_CAPTURE,
|
||||
FPI_DEVICE_ACTION_TODV1_90_1_LIST,
|
||||
FPI_DEVICE_ACTION_TODV1_90_1_DELETE,
|
||||
} FpiDeviceActionTODV1_90_1;
|
||||
|
||||
typedef enum {
|
||||
FPI_DEVICE_ACTION_TODV1_92_0_NONE = 0,
|
||||
FPI_DEVICE_ACTION_TODV1_92_0_PROBE,
|
||||
FPI_DEVICE_ACTION_TODV1_92_0_OPEN,
|
||||
FPI_DEVICE_ACTION_TODV1_92_0_CLOSE,
|
||||
FPI_DEVICE_ACTION_TODV1_92_0_ENROLL,
|
||||
FPI_DEVICE_ACTION_TODV1_92_0_VERIFY,
|
||||
FPI_DEVICE_ACTION_TODV1_92_0_IDENTIFY,
|
||||
FPI_DEVICE_ACTION_TODV1_92_0_CAPTURE,
|
||||
FPI_DEVICE_ACTION_TODV1_92_0_LIST,
|
||||
FPI_DEVICE_ACTION_TODV1_92_0_DELETE,
|
||||
FPI_DEVICE_ACTION_TODV1_92_0_CLEAR_STORAGE
|
||||
} FpiDeviceActionTODV1_92_0;
|
||||
|
||||
typedef enum /*< flags >*/ {
|
||||
FP_DEVICE_FEATURE_TODV1_NONE = 0,
|
||||
FP_DEVICE_FEATURE_TODV1_CAPTURE = 1 << 0,
|
||||
FP_DEVICE_FEATURE_TODV1_IDENTIFY = 1 << 1,
|
||||
FP_DEVICE_FEATURE_TODV1_VERIFY = 1 << 2,
|
||||
FP_DEVICE_FEATURE_TODV1_STORAGE = 1 << 3,
|
||||
FP_DEVICE_FEATURE_TODV1_STORAGE_LIST = 1 << 4,
|
||||
FP_DEVICE_FEATURE_TODV1_STORAGE_DELETE = 1 << 5,
|
||||
FP_DEVICE_FEATURE_TODV1_STORAGE_CLEAR = 1 << 6,
|
||||
FP_DEVICE_FEATURE_TODV1_DUPLICATES_CHECK = 1 << 7,
|
||||
} FpDeviceFeatureTODV1;
|
||||
FP_DEVICE_FEATURE_TODV1_92_0_NONE = 0,
|
||||
FP_DEVICE_FEATURE_TODV1_92_0_CAPTURE = 1 << 0,
|
||||
FP_DEVICE_FEATURE_TODV1_92_0_IDENTIFY = 1 << 1,
|
||||
FP_DEVICE_FEATURE_TODV1_92_0_VERIFY = 1 << 2,
|
||||
FP_DEVICE_FEATURE_TODV1_92_0_STORAGE = 1 << 3,
|
||||
FP_DEVICE_FEATURE_TODV1_92_0_STORAGE_LIST = 1 << 4,
|
||||
FP_DEVICE_FEATURE_TODV1_92_0_STORAGE_DELETE = 1 << 5,
|
||||
FP_DEVICE_FEATURE_TODV1_92_0_STORAGE_CLEAR = 1 << 6,
|
||||
FP_DEVICE_FEATURE_TODV1_92_0_DUPLICATES_CHECK = 1 << 7,
|
||||
} FpDeviceFeatureTODV1_92_0;
|
||||
|
||||
typedef enum /*< flags >*/ {
|
||||
FP_DEVICE_FEATURE_TODV1_94_0_NONE = 0,
|
||||
FP_DEVICE_FEATURE_TODV1_94_0_CAPTURE = 1 << 0,
|
||||
FP_DEVICE_FEATURE_TODV1_94_0_IDENTIFY = 1 << 1,
|
||||
FP_DEVICE_FEATURE_TODV1_94_0_VERIFY = 1 << 2,
|
||||
FP_DEVICE_FEATURE_TODV1_94_0_STORAGE = 1 << 3,
|
||||
FP_DEVICE_FEATURE_TODV1_94_0_STORAGE_LIST = 1 << 4,
|
||||
FP_DEVICE_FEATURE_TODV1_94_0_STORAGE_DELETE = 1 << 5,
|
||||
FP_DEVICE_FEATURE_TODV1_94_0_STORAGE_CLEAR = 1 << 6,
|
||||
FP_DEVICE_FEATURE_TODV1_94_0_DUPLICATES_CHECK = 1 << 7,
|
||||
FP_DEVICE_FEATURE_TODV1_94_0_ALWAYS_ON = 1 << 8,
|
||||
} FpDeviceFeatureTODV1_94_0;
|
||||
|
||||
typedef enum {
|
||||
FPI_DEVICE_UDEV_SUBTYPE_TODV1_SPIDEV = 1 << 0,
|
||||
FPI_DEVICE_UDEV_SUBTYPE_TODV1_HIDRAW = 1 << 1,
|
||||
} FpiDeviceUdevSubtypeFlagsTODV1;
|
||||
FPI_DEVICE_UDEV_SUBTYPE_TODV1_92_0_SPIDEV = 1 << 0,
|
||||
FPI_DEVICE_UDEV_SUBTYPE_TODV1_92_0_HIDRAW = 1 << 1,
|
||||
} FpiDeviceUdevSubtypeFlagsTODV1_92_0;
|
||||
|
||||
typedef struct _FpIdEntryTODV1_92_0 FpIdEntryTODV1_92_0;
|
||||
|
||||
struct _FpIdEntryTODV1_92_0
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
guint pid;
|
||||
guint vid;
|
||||
};
|
||||
const gchar *virtual_envvar;
|
||||
};
|
||||
guint64 driver_data;
|
||||
|
||||
/* Elements added after TODv1 */
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
FpiDeviceUdevSubtypeFlagsTODV1_92_0 udev_types;
|
||||
const gchar *spi_acpi_id;
|
||||
struct
|
||||
{
|
||||
guint pid;
|
||||
guint vid;
|
||||
} hid_id;
|
||||
};
|
||||
};
|
||||
|
||||
/*< private >*/
|
||||
/* padding for future expansion */
|
||||
gpointer _padding_dummy[13];
|
||||
};
|
||||
|
||||
typedef struct _FpIdEntryTODV1_92_0 FpIdEntryTODV1_92_0;
|
||||
|
||||
struct _FpDeviceClassTODV1_92_0
|
||||
{
|
||||
/*< private >*/
|
||||
GObjectClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
/* Static information about the driver. */
|
||||
const gchar *id;
|
||||
const gchar *full_name;
|
||||
FpDeviceTypeTODV1_92_0 type;
|
||||
const FpIdEntryTODV1_92_0 *id_table;
|
||||
|
||||
/* Defaults for device properties */
|
||||
gint nr_enroll_stages;
|
||||
FpScanTypeTODV1_90_1 scan_type;
|
||||
|
||||
/* Callbacks */
|
||||
gint (*usb_discover) (GUsbDevice *usb_device);
|
||||
void (*probe) (FpDevice *device);
|
||||
void (*open) (FpDevice *device);
|
||||
void (*close) (FpDevice *device);
|
||||
void (*enroll) (FpDevice *device);
|
||||
void (*verify) (FpDevice *device);
|
||||
void (*identify) (FpDevice *device);
|
||||
void (*capture) (FpDevice *device);
|
||||
void (*list) (FpDevice *device);
|
||||
void (*delete) (FpDevice * device);
|
||||
|
||||
void (*cancel) (FpDevice *device);
|
||||
|
||||
FpDeviceFeatureTODV1_92_0 features;
|
||||
|
||||
/*< private >*/
|
||||
/* padding for future expansion */
|
||||
gpointer _padding_dummy[31];
|
||||
};
|
||||
|
||||
typedef struct _FpDeviceClassTODV1_92_0 FpDeviceClassTODV1_92_0;
|
||||
|
||||
|
||||
struct _FpDeviceClassTODV1_94_0
|
||||
{
|
||||
/*< private >*/
|
||||
GObjectClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
/* Static information about the driver. */
|
||||
const gchar *id;
|
||||
const gchar *full_name;
|
||||
FpDeviceTypeTODV1_92_0 type;
|
||||
const FpIdEntryTODV1_92_0 *id_table;
|
||||
|
||||
/* Defaults for device properties */
|
||||
gint nr_enroll_stages;
|
||||
FpScanTypeTODV1_90_1 scan_type;
|
||||
|
||||
/* Callbacks */
|
||||
gint (*usb_discover) (GUsbDevice *usb_device);
|
||||
void (*probe) (FpDevice *device);
|
||||
void (*open) (FpDevice *device);
|
||||
void (*close) (FpDevice *device);
|
||||
void (*enroll) (FpDevice *device);
|
||||
void (*verify) (FpDevice *device);
|
||||
void (*identify) (FpDevice *device);
|
||||
void (*capture) (FpDevice *device);
|
||||
void (*list) (FpDevice *device);
|
||||
void (*delete) (FpDevice * device);
|
||||
|
||||
void (*cancel) (FpDevice *device);
|
||||
|
||||
/* Class elements added after tod-v1 */
|
||||
FpDeviceFeatureTODV1_94_0 features;
|
||||
|
||||
/* Simple device temperature model constants */
|
||||
gint32 temp_hot_seconds;
|
||||
gint32 temp_cold_seconds;
|
||||
|
||||
void (*clear_storage) (FpDevice * device);
|
||||
void (*suspend) (FpDevice *device);
|
||||
void (*resume) (FpDevice *device);
|
||||
|
||||
/*< private >*/
|
||||
/* padding for future expansion */
|
||||
gpointer _padding_dummy[27];
|
||||
};
|
||||
|
||||
typedef struct _FpDeviceClassTODV1_94_0 FpDeviceClassTODV1_94_0;
|
||||
|
||||
Reference in New Issue
Block a user