Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | * FPrint Print handling | ||
3 | * Copyright (C) 2007 Daniel Drake <dsd@gentoo.org> | ||
4 | * Copyright (C) 2019 Benjamin Berg <bberg@redhat.com> | ||
5 | * | ||
6 | * This library is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU Lesser General Public | ||
8 | * License as published by the Free Software Foundation; either | ||
9 | * version 2.1 of the License, or (at your option) any later version. | ||
10 | * | ||
11 | * This library is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
14 | * Lesser General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU Lesser General Public | ||
17 | * License along with this library; if not, write to the Free Software | ||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
19 | */ | ||
20 | |||
21 | #pragma once | ||
22 | |||
23 | #include "fp-image.h" | ||
24 | #include "fp-enums.h" | ||
25 | |||
26 | G_BEGIN_DECLS | ||
27 | |||
28 | #define FP_TYPE_PRINT (fp_print_get_type ()) | ||
29 |
56/104✓ Branch 0 taken 5947 times.
✓ Branch 1 taken 30 times.
✓ Branch 2 taken 759495 times.
✓ Branch 3 taken 1 times.
✓ Branch 4 taken 753517 times.
✓ Branch 5 taken 5945 times.
✓ Branch 6 taken 1 times.
✓ Branch 7 taken 753516 times.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
✓ Branch 23 taken 1 times.
✓ Branch 24 taken 1 times.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✓ Branch 27 taken 1 times.
✗ Branch 28 not taken.
✓ Branch 29 taken 1 times.
✗ Branch 30 not taken.
✓ Branch 31 taken 1 times.
✗ Branch 32 not taken.
✓ Branch 33 taken 1 times.
✓ Branch 34 taken 1 times.
✗ Branch 35 not taken.
✗ Branch 36 not taken.
✓ Branch 37 taken 1 times.
✗ Branch 38 not taken.
✓ Branch 39 taken 1 times.
✓ Branch 40 taken 1 times.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✓ Branch 43 taken 1 times.
✓ Branch 44 taken 1 times.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✓ Branch 47 taken 1 times.
✓ Branch 48 taken 1 times.
✗ Branch 49 not taken.
✓ Branch 50 taken 1 times.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✓ Branch 53 taken 1 times.
✗ Branch 54 not taken.
✓ Branch 55 taken 1 times.
✓ Branch 56 taken 1 times.
✗ Branch 57 not taken.
✗ Branch 58 not taken.
✓ Branch 59 taken 1 times.
✓ Branch 60 taken 1 times.
✗ Branch 61 not taken.
✓ Branch 62 taken 1 times.
✗ Branch 63 not taken.
✓ Branch 64 taken 1 times.
✗ Branch 65 not taken.
✗ Branch 66 not taken.
✓ Branch 67 taken 1 times.
✓ Branch 68 taken 1 times.
✗ Branch 69 not taken.
✗ Branch 70 not taken.
✓ Branch 71 taken 1 times.
✓ Branch 72 taken 1 times.
✗ Branch 73 not taken.
✓ Branch 74 taken 1 times.
✗ Branch 75 not taken.
✓ Branch 76 taken 1 times.
✗ Branch 77 not taken.
✗ Branch 78 not taken.
✓ Branch 79 taken 1 times.
✓ Branch 80 taken 1 times.
✗ Branch 81 not taken.
✓ Branch 82 taken 1 times.
✗ Branch 83 not taken.
✓ Branch 84 taken 1 times.
✗ Branch 85 not taken.
✓ Branch 86 taken 1 times.
✗ Branch 87 not taken.
✓ Branch 88 taken 1 times.
✗ Branch 89 not taken.
✓ Branch 90 taken 1 times.
✗ Branch 91 not taken.
✓ Branch 92 taken 1 times.
✗ Branch 93 not taken.
✗ Branch 94 not taken.
✓ Branch 95 taken 1 times.
✓ Branch 96 taken 1 times.
✗ Branch 97 not taken.
✓ Branch 98 taken 1 times.
✗ Branch 99 not taken.
✓ Branch 100 taken 1 times.
✗ Branch 101 not taken.
✗ Branch 102 not taken.
✓ Branch 103 taken 1 times.
|
759570 | G_DECLARE_FINAL_TYPE (FpPrint, fp_print, FP, PRINT, GInitiallyUnowned) |
30 | |||
31 | #define FP_FINGER_IS_VALID(finger) \ | ||
32 | ((finger) >= FP_FINGER_FIRST && (finger) <= FP_FINGER_LAST) | ||
33 | |||
34 | #include "fp-device.h" | ||
35 | |||
36 | /** | ||
37 | * FpFinger: | ||
38 | * @FP_FINGER_UNKNOWN: The finger is unknown | ||
39 | * @FP_FINGER_LEFT_THUMB: Left thumb | ||
40 | * @FP_FINGER_LEFT_INDEX: Left index finger | ||
41 | * @FP_FINGER_LEFT_MIDDLE: Left middle finger | ||
42 | * @FP_FINGER_LEFT_RING: Left ring finger | ||
43 | * @FP_FINGER_LEFT_LITTLE: Left little finger | ||
44 | * @FP_FINGER_RIGHT_THUMB: Right thumb | ||
45 | * @FP_FINGER_RIGHT_INDEX: Right index finger | ||
46 | * @FP_FINGER_RIGHT_MIDDLE: Right middle finger | ||
47 | * @FP_FINGER_RIGHT_RING: Right ring finger | ||
48 | * @FP_FINGER_RIGHT_LITTLE: Right little finger | ||
49 | * @FP_FINGER_FIRST: The first finger in the fp-print order | ||
50 | * @FP_FINGER_LAST: The last finger in the fp-print order | ||
51 | */ | ||
52 | typedef enum { | ||
53 | FP_FINGER_UNKNOWN = 0, | ||
54 | FP_FINGER_LEFT_THUMB, | ||
55 | FP_FINGER_LEFT_INDEX, | ||
56 | FP_FINGER_LEFT_MIDDLE, | ||
57 | FP_FINGER_LEFT_RING, | ||
58 | FP_FINGER_LEFT_LITTLE, | ||
59 | FP_FINGER_RIGHT_THUMB, | ||
60 | FP_FINGER_RIGHT_INDEX, | ||
61 | FP_FINGER_RIGHT_MIDDLE, | ||
62 | FP_FINGER_RIGHT_RING, | ||
63 | FP_FINGER_RIGHT_LITTLE, | ||
64 | |||
65 | FP_FINGER_FIRST = FP_FINGER_LEFT_THUMB, | ||
66 | FP_FINGER_LAST = FP_FINGER_RIGHT_LITTLE, | ||
67 | } FpFinger; | ||
68 | |||
69 | /** | ||
70 | * FpFingerStatusFlags: | ||
71 | * @FP_FINGER_STATUS_NONE: Sensor has not the finger on it, nor requires it | ||
72 | * @FP_FINGER_STATUS_NEEDED: Sensor waits for the finger | ||
73 | * @FP_FINGER_STATUS_PRESENT: Sensor has the finger on it | ||
74 | */ | ||
75 | typedef enum { | ||
76 | FP_FINGER_STATUS_NONE = 0, | ||
77 | FP_FINGER_STATUS_NEEDED = 1 << 0, | ||
78 | FP_FINGER_STATUS_PRESENT = 1 << 1, | ||
79 | } FpFingerStatusFlags; | ||
80 | |||
81 | FpPrint *fp_print_new (FpDevice *device); | ||
82 | |||
83 | const gchar *fp_print_get_driver (FpPrint *print); | ||
84 | const gchar *fp_print_get_device_id (FpPrint *print); | ||
85 | FpImage *fp_print_get_image (FpPrint *print); | ||
86 | |||
87 | FpFinger fp_print_get_finger (FpPrint *print); | ||
88 | const gchar *fp_print_get_username (FpPrint *print); | ||
89 | const gchar *fp_print_get_description (FpPrint *print); | ||
90 | const GDate *fp_print_get_enroll_date (FpPrint *print); | ||
91 | gboolean fp_print_get_device_stored (FpPrint *print); | ||
92 | |||
93 | void fp_print_set_finger (FpPrint *print, | ||
94 | FpFinger finger); | ||
95 | void fp_print_set_username (FpPrint *print, | ||
96 | const gchar *username); | ||
97 | void fp_print_set_description (FpPrint *print, | ||
98 | const gchar *description); | ||
99 | void fp_print_set_enroll_date (FpPrint *print, | ||
100 | const GDate *enroll_date); | ||
101 | |||
102 | gboolean fp_print_compatible (FpPrint *self, | ||
103 | FpDevice *device); | ||
104 | gboolean fp_print_equal (FpPrint *self, | ||
105 | FpPrint *other); | ||
106 | |||
107 | gboolean fp_print_serialize (FpPrint *print, | ||
108 | guchar **data, | ||
109 | gsize *length, | ||
110 | GError **error); | ||
111 | |||
112 | FpPrint *fp_print_deserialize (const guchar *data, | ||
113 | gsize length, | ||
114 | GError **error); | ||
115 | |||
116 | G_END_DECLS | ||
117 |