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 (141→142) taken 5947 times.
✓ Branch 1 (141→143) taken 30 times.
✓ Branch 2 (131→132) taken 759315 times.
✓ Branch 3 (131→133) taken 1 times.
✓ Branch 4 (77→78) taken 753337 times.
✓ Branch 5 (77→79) taken 5945 times.
✓ Branch 6 (79→80) taken 1 times.
✓ Branch 7 (79→81) taken 753336 times.
✓ Branch 8 (19→20) taken 1 times.
✗ Branch 9 (19→21) not taken.
✓ Branch 10 (21→22) taken 1 times.
✗ Branch 11 (21→23) not taken.
✓ Branch 12 (12→14) taken 1 times.
✗ Branch 13 (12→15) not taken.
✓ Branch 14 (15→16) taken 1 times.
✗ Branch 15 (15→17) not taken.
✓ Branch 16 (18→19) taken 1 times.
✗ Branch 17 (18→20) not taken.
✓ Branch 18 (13→14) taken 1 times.
✗ Branch 19 (13→15) not taken.
✗ Branch 20 (41→42) not taken.
✓ Branch 21 (41→43) taken 1 times.
✗ Branch 22 (43→44) not taken.
✓ Branch 23 (43→45) taken 1 times.
✓ Branch 24 (45→46) taken 1 times.
✗ Branch 25 (45→47) not taken.
✗ Branch 26 (95→96) not taken.
✓ Branch 27 (95→97) taken 1 times.
✗ Branch 28 (97→98) not taken.
✓ Branch 29 (97→99) taken 1 times.
✗ Branch 30 (40→41) not taken.
✓ Branch 31 (40→42) taken 1 times.
✗ Branch 32 (42→43) not taken.
✓ Branch 33 (42→44) taken 1 times.
✓ Branch 34 (44→45) taken 1 times.
✗ Branch 35 (44→46) not taken.
✗ Branch 36 (44→45) not taken.
✓ Branch 37 (44→46) taken 1 times.
✗ Branch 38 (46→47) not taken.
✓ Branch 39 (46→48) taken 1 times.
✓ Branch 40 (48→49) taken 1 times.
✗ Branch 41 (48→50) not taken.
✗ Branch 42 (38→39) not taken.
✓ Branch 43 (38→40) taken 1 times.
✓ Branch 44 (40→41) taken 1 times.
✗ Branch 45 (40→42) not taken.
✗ Branch 46 (42→43) not taken.
✓ Branch 47 (42→44) taken 1 times.
✓ Branch 48 (37→38) taken 1 times.
✗ Branch 49 (37→39) not taken.
✓ Branch 50 (39→40) taken 1 times.
✗ Branch 51 (39→41) not taken.
✗ Branch 52 (41→42) not taken.
✓ Branch 53 (41→43) taken 1 times.
✗ Branch 54 (158→159) not taken.
✓ Branch 55 (158→160) taken 1 times.
✓ Branch 56 (160→161) taken 1 times.
✗ Branch 57 (160→162) not taken.
✗ Branch 58 (36→37) not taken.
✓ Branch 59 (36→38) taken 1 times.
✓ Branch 60 (38→39) taken 1 times.
✗ Branch 61 (38→40) not taken.
✓ Branch 62 (22→23) taken 1 times.
✗ Branch 63 (22→24) not taken.
✓ Branch 64 (24→25) taken 1 times.
✗ Branch 65 (24→26) not taken.
✗ Branch 66 (28→29) not taken.
✓ Branch 67 (28→30) taken 1 times.
✓ Branch 68 (30→31) taken 1 times.
✗ Branch 69 (30→32) not taken.
✗ Branch 70 (32→33) not taken.
✓ Branch 71 (32→34) taken 1 times.
✓ Branch 72 (34→35) taken 1 times.
✗ Branch 73 (34→36) not taken.
✓ Branch 74 (26→27) taken 1 times.
✗ Branch 75 (26→28) not taken.
✓ Branch 76 (28→29) taken 1 times.
✗ Branch 77 (28→30) not taken.
✗ Branch 78 (29→30) not taken.
✓ Branch 79 (29→31) taken 1 times.
✓ Branch 80 (31→32) taken 1 times.
✗ Branch 81 (31→33) not taken.
✓ Branch 82 (33→34) taken 1 times.
✗ Branch 83 (33→35) not taken.
✓ Branch 84 (27→28) taken 1 times.
✗ Branch 85 (27→29) not taken.
✓ Branch 86 (29→30) taken 1 times.
✗ Branch 87 (29→31) not taken.
✓ Branch 88 (11→13) taken 1 times.
✗ Branch 89 (11→14) not taken.
✓ Branch 90 (18→19) taken 1 times.
✗ Branch 91 (18→20) not taken.
✓ Branch 92 (14→15) taken 1 times.
✗ Branch 93 (14→16) not taken.
✗ Branch 94 (59→60) not taken.
✓ Branch 95 (59→61) taken 1 times.
✓ Branch 96 (13→14) taken 1 times.
✗ Branch 97 (13→15) not taken.
✓ Branch 98 (3→4) taken 1 times.
✗ Branch 99 (3→7) not taken.
✓ Branch 100 (4→5) taken 1 times.
✗ Branch 101 (4→6) not taken.
✗ Branch 102 (5→6) not taken.
✓ Branch 103 (5→7) taken 1 times.
|
759390 | 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 |