@girs/fprint-2.0 2.0.0-4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +104 -0
- package/fprint-2.0-ambient.d.ts +12 -0
- package/fprint-2.0-ambient.js +2 -0
- package/fprint-2.0-import.d.ts +12 -0
- package/fprint-2.0-import.js +3 -0
- package/fprint-2.0.d.ts +2034 -0
- package/fprint-2.0.js +6 -0
- package/package.json +57 -0
- package/tsconfig.json +23 -0
- package/typedoc.json +7 -0
package/fprint-2.0.d.ts
ADDED
|
@@ -0,0 +1,2034 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Type Definitions for Gjs (https://gjs.guide/)
|
|
3
|
+
*
|
|
4
|
+
* These type definitions are automatically generated, do not edit them by hand.
|
|
5
|
+
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import './fprint-2.0-ambient.d.ts';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* FPrint-2.0
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import type Gio from '@girs/gio-2.0';
|
|
15
|
+
import type GObject from '@girs/gobject-2.0';
|
|
16
|
+
import type GLib from '@girs/glib-2.0';
|
|
17
|
+
import type GUsb from '@girs/gusb-1.0';
|
|
18
|
+
import type Json from '@girs/json-1.0';
|
|
19
|
+
|
|
20
|
+
export namespace FPrint {
|
|
21
|
+
/**
|
|
22
|
+
* Error codes for device operations. More specific errors from other domains
|
|
23
|
+
* such as #G_IO_ERROR or #G_USB_DEVICE_ERROR may also be reported.
|
|
24
|
+
*/
|
|
25
|
+
class DeviceError extends GLib.Error {
|
|
26
|
+
static $gtype: GObject.GType<DeviceError>;
|
|
27
|
+
|
|
28
|
+
// Static fields of FPrint.DeviceError
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A general error occurred.
|
|
32
|
+
*/
|
|
33
|
+
static GENERAL: number;
|
|
34
|
+
/**
|
|
35
|
+
* The device does not support the requested
|
|
36
|
+
* operation.
|
|
37
|
+
*/
|
|
38
|
+
static NOT_SUPPORTED: number;
|
|
39
|
+
/**
|
|
40
|
+
* The device needs to be opened to start this
|
|
41
|
+
* operation.
|
|
42
|
+
*/
|
|
43
|
+
static NOT_OPEN: number;
|
|
44
|
+
/**
|
|
45
|
+
* The device has already been opened.
|
|
46
|
+
*/
|
|
47
|
+
static ALREADY_OPEN: number;
|
|
48
|
+
/**
|
|
49
|
+
* The device is busy with another request.
|
|
50
|
+
*/
|
|
51
|
+
static BUSY: number;
|
|
52
|
+
/**
|
|
53
|
+
* Protocol error
|
|
54
|
+
*/
|
|
55
|
+
static PROTO: number;
|
|
56
|
+
/**
|
|
57
|
+
* The passed data is invalid
|
|
58
|
+
*/
|
|
59
|
+
static DATA_INVALID: number;
|
|
60
|
+
/**
|
|
61
|
+
* Requested print was not found on device
|
|
62
|
+
*/
|
|
63
|
+
static DATA_NOT_FOUND: number;
|
|
64
|
+
/**
|
|
65
|
+
* No space on device available for operation
|
|
66
|
+
*/
|
|
67
|
+
static DATA_FULL: number;
|
|
68
|
+
/**
|
|
69
|
+
* Enrolling template duplicates storaged templates
|
|
70
|
+
*/
|
|
71
|
+
static DATA_DUPLICATE: number;
|
|
72
|
+
/**
|
|
73
|
+
* The device has been removed.
|
|
74
|
+
*/
|
|
75
|
+
static REMOVED: number;
|
|
76
|
+
/**
|
|
77
|
+
* The device might be getting too hot
|
|
78
|
+
*/
|
|
79
|
+
static TOO_HOT: number;
|
|
80
|
+
|
|
81
|
+
// Constructors of FPrint.DeviceError
|
|
82
|
+
|
|
83
|
+
constructor(options: { message: string; code: number });
|
|
84
|
+
_init(...args: any[]): void;
|
|
85
|
+
|
|
86
|
+
// Own static methods of FPrint.DeviceError
|
|
87
|
+
|
|
88
|
+
static quark(): GLib.Quark;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Error codes representing scan failures resulting in the user needing to
|
|
93
|
+
* retry.
|
|
94
|
+
*/
|
|
95
|
+
enum DeviceRetry {
|
|
96
|
+
/**
|
|
97
|
+
* The scan did not succeed due to poor scan quality
|
|
98
|
+
* or other general user scanning problem.
|
|
99
|
+
*/
|
|
100
|
+
GENERAL,
|
|
101
|
+
/**
|
|
102
|
+
* The scan did not succeed because the finger
|
|
103
|
+
* swipe was too short.
|
|
104
|
+
*/
|
|
105
|
+
TOO_SHORT,
|
|
106
|
+
/**
|
|
107
|
+
* The scan did not succeed because the finger
|
|
108
|
+
* was not centered on the scanner.
|
|
109
|
+
*/
|
|
110
|
+
CENTER_FINGER,
|
|
111
|
+
/**
|
|
112
|
+
* The scan did not succeed due to quality or
|
|
113
|
+
* pressure problems; the user should remove their finger from the scanner
|
|
114
|
+
* before retrying.
|
|
115
|
+
*/
|
|
116
|
+
REMOVE_FINGER,
|
|
117
|
+
}
|
|
118
|
+
enum DeviceType {
|
|
119
|
+
/**
|
|
120
|
+
* The device is a virtual device
|
|
121
|
+
*/
|
|
122
|
+
VIRTUAL,
|
|
123
|
+
/**
|
|
124
|
+
* The device is a USB device
|
|
125
|
+
*/
|
|
126
|
+
USB,
|
|
127
|
+
/**
|
|
128
|
+
* The device is a udev device
|
|
129
|
+
*/
|
|
130
|
+
UDEV,
|
|
131
|
+
}
|
|
132
|
+
enum Finger {
|
|
133
|
+
/**
|
|
134
|
+
* The finger is unknown
|
|
135
|
+
*/
|
|
136
|
+
UNKNOWN,
|
|
137
|
+
/**
|
|
138
|
+
* Left thumb
|
|
139
|
+
*/
|
|
140
|
+
LEFT_THUMB,
|
|
141
|
+
/**
|
|
142
|
+
* Left index finger
|
|
143
|
+
*/
|
|
144
|
+
LEFT_INDEX,
|
|
145
|
+
/**
|
|
146
|
+
* Left middle finger
|
|
147
|
+
*/
|
|
148
|
+
LEFT_MIDDLE,
|
|
149
|
+
/**
|
|
150
|
+
* Left ring finger
|
|
151
|
+
*/
|
|
152
|
+
LEFT_RING,
|
|
153
|
+
/**
|
|
154
|
+
* Left little finger
|
|
155
|
+
*/
|
|
156
|
+
LEFT_LITTLE,
|
|
157
|
+
/**
|
|
158
|
+
* Right thumb
|
|
159
|
+
*/
|
|
160
|
+
RIGHT_THUMB,
|
|
161
|
+
/**
|
|
162
|
+
* Right index finger
|
|
163
|
+
*/
|
|
164
|
+
RIGHT_INDEX,
|
|
165
|
+
/**
|
|
166
|
+
* Right middle finger
|
|
167
|
+
*/
|
|
168
|
+
RIGHT_MIDDLE,
|
|
169
|
+
/**
|
|
170
|
+
* Right ring finger
|
|
171
|
+
*/
|
|
172
|
+
RIGHT_RING,
|
|
173
|
+
/**
|
|
174
|
+
* Right little finger
|
|
175
|
+
*/
|
|
176
|
+
RIGHT_LITTLE,
|
|
177
|
+
/**
|
|
178
|
+
* The first finger in the fp-print order
|
|
179
|
+
*/
|
|
180
|
+
FIRST,
|
|
181
|
+
/**
|
|
182
|
+
* The last finger in the fp-print order
|
|
183
|
+
*/
|
|
184
|
+
LAST,
|
|
185
|
+
}
|
|
186
|
+
enum ScanType {
|
|
187
|
+
/**
|
|
188
|
+
* Sensor requires swiping the finger.
|
|
189
|
+
*/
|
|
190
|
+
SWIPE,
|
|
191
|
+
/**
|
|
192
|
+
* Sensor requires placing/pressing down the finger.
|
|
193
|
+
*/
|
|
194
|
+
PRESS,
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* When a device is created, it is assumed to be cold. Applications such as
|
|
198
|
+
* fprintd may want to ensure all devices on the system are cold before
|
|
199
|
+
* shutting down in order to ensure that the cool-off period is not violated
|
|
200
|
+
* because the internal libfprint state about the device is lost.
|
|
201
|
+
*/
|
|
202
|
+
enum Temperature {
|
|
203
|
+
/**
|
|
204
|
+
* Sensor is considered cold.
|
|
205
|
+
*/
|
|
206
|
+
COLD,
|
|
207
|
+
/**
|
|
208
|
+
* Sensor is warm, usage time may be limited.
|
|
209
|
+
*/
|
|
210
|
+
WARM,
|
|
211
|
+
/**
|
|
212
|
+
* Sensor is hot and cannot be used.
|
|
213
|
+
*/
|
|
214
|
+
HOT,
|
|
215
|
+
}
|
|
216
|
+
function device_error_quark(): GLib.Quark;
|
|
217
|
+
function device_retry_quark(): GLib.Quark;
|
|
218
|
+
interface EnrollProgress {
|
|
219
|
+
(device: Device, completed_stages: number, print?: Print | null, error?: GLib.Error | null): void;
|
|
220
|
+
}
|
|
221
|
+
interface MatchCb {
|
|
222
|
+
(device: Device, match?: Print | null, print?: Print | null, error?: GLib.Error | null): void;
|
|
223
|
+
}
|
|
224
|
+
enum DeviceFeature {
|
|
225
|
+
/**
|
|
226
|
+
* Device does not support any feature
|
|
227
|
+
*/
|
|
228
|
+
NONE,
|
|
229
|
+
/**
|
|
230
|
+
* Supports image capture
|
|
231
|
+
*/
|
|
232
|
+
CAPTURE,
|
|
233
|
+
/**
|
|
234
|
+
* Supports finger identification
|
|
235
|
+
*/
|
|
236
|
+
IDENTIFY,
|
|
237
|
+
/**
|
|
238
|
+
* Supports finger verification
|
|
239
|
+
*/
|
|
240
|
+
VERIFY,
|
|
241
|
+
/**
|
|
242
|
+
* Device has a persistent storage
|
|
243
|
+
*/
|
|
244
|
+
STORAGE,
|
|
245
|
+
/**
|
|
246
|
+
* Supports listing the storage templates
|
|
247
|
+
*/
|
|
248
|
+
STORAGE_LIST,
|
|
249
|
+
/**
|
|
250
|
+
* Supports deleting stored templates
|
|
251
|
+
*/
|
|
252
|
+
STORAGE_DELETE,
|
|
253
|
+
/**
|
|
254
|
+
* Supports clearing the whole storage
|
|
255
|
+
*/
|
|
256
|
+
STORAGE_CLEAR,
|
|
257
|
+
/**
|
|
258
|
+
* Natively supports duplicates detection
|
|
259
|
+
*/
|
|
260
|
+
DUPLICATES_CHECK,
|
|
261
|
+
/**
|
|
262
|
+
* Whether the device can run continuously
|
|
263
|
+
*/
|
|
264
|
+
ALWAYS_ON,
|
|
265
|
+
/**
|
|
266
|
+
* Supports updating an existing print record using new scans
|
|
267
|
+
*/
|
|
268
|
+
UPDATE_PRINT,
|
|
269
|
+
}
|
|
270
|
+
enum FingerStatusFlags {
|
|
271
|
+
/**
|
|
272
|
+
* Sensor has not the finger on it, nor requires it
|
|
273
|
+
*/
|
|
274
|
+
NONE,
|
|
275
|
+
/**
|
|
276
|
+
* Sensor waits for the finger
|
|
277
|
+
*/
|
|
278
|
+
NEEDED,
|
|
279
|
+
/**
|
|
280
|
+
* Sensor has the finger on it
|
|
281
|
+
*/
|
|
282
|
+
PRESENT,
|
|
283
|
+
}
|
|
284
|
+
module Context {
|
|
285
|
+
// Signal callback interfaces
|
|
286
|
+
|
|
287
|
+
interface DeviceAdded {
|
|
288
|
+
(device: Device): void;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
interface DeviceRemoved {
|
|
292
|
+
(device: Device): void;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// Constructor properties interface
|
|
296
|
+
|
|
297
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps {}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
class Context extends GObject.Object {
|
|
301
|
+
static $gtype: GObject.GType<Context>;
|
|
302
|
+
|
|
303
|
+
// Constructors of FPrint.Context
|
|
304
|
+
|
|
305
|
+
constructor(properties?: Partial<Context.ConstructorProps>, ...args: any[]);
|
|
306
|
+
|
|
307
|
+
_init(...args: any[]): void;
|
|
308
|
+
|
|
309
|
+
static ['new'](): Context;
|
|
310
|
+
|
|
311
|
+
// Own signals of FPrint.Context
|
|
312
|
+
|
|
313
|
+
connect(id: string, callback: (...args: any[]) => any): number;
|
|
314
|
+
connect_after(id: string, callback: (...args: any[]) => any): number;
|
|
315
|
+
emit(id: string, ...args: any[]): void;
|
|
316
|
+
connect(signal: 'device-added', callback: (_source: this, device: Device) => void): number;
|
|
317
|
+
connect_after(signal: 'device-added', callback: (_source: this, device: Device) => void): number;
|
|
318
|
+
emit(signal: 'device-added', device: Device): void;
|
|
319
|
+
connect(signal: 'device-removed', callback: (_source: this, device: Device) => void): number;
|
|
320
|
+
connect_after(signal: 'device-removed', callback: (_source: this, device: Device) => void): number;
|
|
321
|
+
emit(signal: 'device-removed', device: Device): void;
|
|
322
|
+
|
|
323
|
+
// Own virtual methods of FPrint.Context
|
|
324
|
+
|
|
325
|
+
vfunc_device_added(device: Device): void;
|
|
326
|
+
vfunc_device_removed(device: Device): void;
|
|
327
|
+
|
|
328
|
+
// Own methods of FPrint.Context
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Enumerate all devices. You should call this function exactly once
|
|
332
|
+
* at startup. Please note that it iterates the mainloop until all
|
|
333
|
+
* devices are enumerated.
|
|
334
|
+
*/
|
|
335
|
+
enumerate(): void;
|
|
336
|
+
/**
|
|
337
|
+
* Get all devices. fp_context_enumerate() will be called as needed.
|
|
338
|
+
* @returns a new #GPtrArray of #FpDevice's.
|
|
339
|
+
*/
|
|
340
|
+
get_devices(): Device[];
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
module Device {
|
|
344
|
+
// Signal callback interfaces
|
|
345
|
+
|
|
346
|
+
interface Removed {
|
|
347
|
+
(): void;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// Constructor properties interface
|
|
351
|
+
|
|
352
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps, Gio.AsyncInitable.ConstructorProps {
|
|
353
|
+
device_id: string;
|
|
354
|
+
deviceId: string;
|
|
355
|
+
driver: string;
|
|
356
|
+
finger_status: FingerStatusFlags;
|
|
357
|
+
fingerStatus: FingerStatusFlags;
|
|
358
|
+
fpi_driver_data: number;
|
|
359
|
+
fpiDriverData: number;
|
|
360
|
+
fpi_environ: string;
|
|
361
|
+
fpiEnviron: string;
|
|
362
|
+
fpi_udev_data_hidraw: string;
|
|
363
|
+
fpiUdevDataHidraw: string;
|
|
364
|
+
fpi_udev_data_spidev: string;
|
|
365
|
+
fpiUdevDataSpidev: string;
|
|
366
|
+
fpi_usb_device: GUsb.Device;
|
|
367
|
+
fpiUsbDevice: GUsb.Device;
|
|
368
|
+
name: string;
|
|
369
|
+
nr_enroll_stages: number;
|
|
370
|
+
nrEnrollStages: number;
|
|
371
|
+
open: boolean;
|
|
372
|
+
removed: boolean;
|
|
373
|
+
scan_type: ScanType;
|
|
374
|
+
scanType: ScanType;
|
|
375
|
+
temperature: Temperature;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
abstract class Device extends GObject.Object implements Gio.AsyncInitable<Device> {
|
|
380
|
+
static $gtype: GObject.GType<Device>;
|
|
381
|
+
|
|
382
|
+
// Own properties of FPrint.Device
|
|
383
|
+
|
|
384
|
+
get device_id(): string;
|
|
385
|
+
get deviceId(): string;
|
|
386
|
+
get driver(): string;
|
|
387
|
+
get finger_status(): FingerStatusFlags;
|
|
388
|
+
get fingerStatus(): FingerStatusFlags;
|
|
389
|
+
set fpi_driver_data(val: number);
|
|
390
|
+
set fpiDriverData(val: number);
|
|
391
|
+
set fpi_environ(val: string);
|
|
392
|
+
set fpiEnviron(val: string);
|
|
393
|
+
get fpi_udev_data_hidraw(): string;
|
|
394
|
+
get fpiUdevDataHidraw(): string;
|
|
395
|
+
get fpi_udev_data_spidev(): string;
|
|
396
|
+
get fpiUdevDataSpidev(): string;
|
|
397
|
+
get fpi_usb_device(): GUsb.Device;
|
|
398
|
+
get fpiUsbDevice(): GUsb.Device;
|
|
399
|
+
get name(): string;
|
|
400
|
+
get nr_enroll_stages(): number;
|
|
401
|
+
get nrEnrollStages(): number;
|
|
402
|
+
get open(): boolean;
|
|
403
|
+
get removed(): boolean;
|
|
404
|
+
get scan_type(): ScanType;
|
|
405
|
+
get scanType(): ScanType;
|
|
406
|
+
get temperature(): Temperature;
|
|
407
|
+
|
|
408
|
+
// Constructors of FPrint.Device
|
|
409
|
+
|
|
410
|
+
constructor(properties?: Partial<Device.ConstructorProps>, ...args: any[]);
|
|
411
|
+
|
|
412
|
+
_init(...args: any[]): void;
|
|
413
|
+
|
|
414
|
+
// Own signals of FPrint.Device
|
|
415
|
+
|
|
416
|
+
connect(id: string, callback: (...args: any[]) => any): number;
|
|
417
|
+
connect_after(id: string, callback: (...args: any[]) => any): number;
|
|
418
|
+
emit(id: string, ...args: any[]): void;
|
|
419
|
+
connect(signal: 'removed', callback: (_source: this) => void): number;
|
|
420
|
+
connect_after(signal: 'removed', callback: (_source: this) => void): number;
|
|
421
|
+
emit(signal: 'removed'): void;
|
|
422
|
+
|
|
423
|
+
// Own methods of FPrint.Device
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Start an asynchronous operation to capture an image. The callback will
|
|
427
|
+
* be called once the operation has finished. Retrieve the result with
|
|
428
|
+
* fp_device_capture_finish().
|
|
429
|
+
* @param wait_for_finger Whether to wait for a finger or not
|
|
430
|
+
* @param cancellable a #GCancellable, or %NULL
|
|
431
|
+
* @param callback the function to call on completion
|
|
432
|
+
*/
|
|
433
|
+
capture(
|
|
434
|
+
wait_for_finger: boolean,
|
|
435
|
+
cancellable?: Gio.Cancellable | null,
|
|
436
|
+
callback?: Gio.AsyncReadyCallback<this> | null,
|
|
437
|
+
): void;
|
|
438
|
+
/**
|
|
439
|
+
* Finish an asynchronous operation to capture an image. You should check
|
|
440
|
+
* for an error of type %FP_DEVICE_RETRY to prompt the user again if there
|
|
441
|
+
* was an interaction issue.
|
|
442
|
+
*
|
|
443
|
+
* See fp_device_capture().
|
|
444
|
+
* @param result A #GAsyncResult
|
|
445
|
+
* @returns #FpImage or %NULL on error
|
|
446
|
+
*/
|
|
447
|
+
capture_finish(result: Gio.AsyncResult): Image;
|
|
448
|
+
/**
|
|
449
|
+
* Start an synchronous operation to capture an image.
|
|
450
|
+
* @param wait_for_finger Whether to wait for a finger or not
|
|
451
|
+
* @param cancellable a #GCancellable, or %NULL
|
|
452
|
+
* @returns A new #FpImage or %NULL on error
|
|
453
|
+
*/
|
|
454
|
+
capture_sync(wait_for_finger: boolean, cancellable?: Gio.Cancellable | null): Image;
|
|
455
|
+
/**
|
|
456
|
+
* Start an asynchronous operation to delete all prints from the device.
|
|
457
|
+
* The callback will be called once the operation has finished. Retrieve
|
|
458
|
+
* the result with fp_device_clear_storage_finish().
|
|
459
|
+
*
|
|
460
|
+
* This only makes sense on devices that store prints on-chip, but is safe
|
|
461
|
+
* to always call.
|
|
462
|
+
* @param cancellable a #GCancellable, or %NULL
|
|
463
|
+
* @param callback the function to call on completion
|
|
464
|
+
*/
|
|
465
|
+
clear_storage(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback<this> | null): void;
|
|
466
|
+
/**
|
|
467
|
+
* Finish an asynchronous operation to delete all enrolled prints.
|
|
468
|
+
*
|
|
469
|
+
* See fp_device_clear_storage().
|
|
470
|
+
* @param result A #GAsyncResult
|
|
471
|
+
* @returns %FALSE on error, %TRUE otherwise
|
|
472
|
+
*/
|
|
473
|
+
clear_storage_finish(result: Gio.AsyncResult): void;
|
|
474
|
+
/**
|
|
475
|
+
* Clear sensor storage.
|
|
476
|
+
* @param cancellable a #GCancellable, or %NULL
|
|
477
|
+
* @returns %FALSE on error, %TRUE otherwise
|
|
478
|
+
*/
|
|
479
|
+
clear_storage_sync(cancellable?: Gio.Cancellable | null): void;
|
|
480
|
+
/**
|
|
481
|
+
* Start an asynchronous operation to close the device. The callback will
|
|
482
|
+
* be called once the operation has finished. Retrieve the result with
|
|
483
|
+
* fp_device_close_finish().
|
|
484
|
+
* @param cancellable a #GCancellable, or %NULL
|
|
485
|
+
* @param callback the function to call on completion
|
|
486
|
+
*/
|
|
487
|
+
close(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback<this> | null): void;
|
|
488
|
+
/**
|
|
489
|
+
* Finish an asynchronous operation to close the device.
|
|
490
|
+
* See fp_device_close().
|
|
491
|
+
* @param result A #GAsyncResult
|
|
492
|
+
* @returns %FALSE on error, %TRUE otherwise
|
|
493
|
+
*/
|
|
494
|
+
close_finish(result: Gio.AsyncResult): void;
|
|
495
|
+
/**
|
|
496
|
+
* Close the device synchronously.
|
|
497
|
+
* @param cancellable a #GCancellable, or %NULL
|
|
498
|
+
* @returns %FALSE on error, %TRUE otherwise
|
|
499
|
+
*/
|
|
500
|
+
close_sync(cancellable?: Gio.Cancellable | null): void;
|
|
501
|
+
/**
|
|
502
|
+
* Start an asynchronous operation to delete a print from the device.
|
|
503
|
+
* The callback will be called once the operation has finished. Retrieve
|
|
504
|
+
* the result with fp_device_delete_print_finish().
|
|
505
|
+
*
|
|
506
|
+
* This only makes sense on devices that store prints on-chip, but is safe
|
|
507
|
+
* to always call.
|
|
508
|
+
* @param enrolled_print a #FpPrint to delete
|
|
509
|
+
* @param cancellable a #GCancellable, or %NULL
|
|
510
|
+
* @param callback the function to call on completion
|
|
511
|
+
*/
|
|
512
|
+
delete_print(
|
|
513
|
+
enrolled_print: Print,
|
|
514
|
+
cancellable?: Gio.Cancellable | null,
|
|
515
|
+
callback?: Gio.AsyncReadyCallback<this> | null,
|
|
516
|
+
): void;
|
|
517
|
+
/**
|
|
518
|
+
* Finish an asynchronous operation to delete an enrolled print.
|
|
519
|
+
*
|
|
520
|
+
* See fp_device_delete_print().
|
|
521
|
+
* @param result A #GAsyncResult
|
|
522
|
+
* @returns %FALSE on error, %TRUE otherwise
|
|
523
|
+
*/
|
|
524
|
+
delete_print_finish(result: Gio.AsyncResult): void;
|
|
525
|
+
/**
|
|
526
|
+
* Delete a given print from the device.
|
|
527
|
+
* @param enrolled_print a #FpPrint to verify
|
|
528
|
+
* @param cancellable a #GCancellable, or %NULL
|
|
529
|
+
* @returns %FALSE on error, %TRUE otherwise
|
|
530
|
+
*/
|
|
531
|
+
delete_print_sync(enrolled_print: Print, cancellable?: Gio.Cancellable | null): void;
|
|
532
|
+
/**
|
|
533
|
+
* Start an asynchronous operation to enroll a print. The callback will
|
|
534
|
+
* be called once the operation has finished. Retrieve the result with
|
|
535
|
+
* fp_device_enroll_finish().
|
|
536
|
+
*
|
|
537
|
+
* The `template_print` parameter is a #FpPrint with available metadata filled
|
|
538
|
+
* in and, optionally, with existing fingerprint data to be updated with newly
|
|
539
|
+
* enrolled fingerprints if a device driver supports it. The driver may make use
|
|
540
|
+
* of the metadata, when e.g. storing the print on device memory. It is undefined
|
|
541
|
+
* whether this print is filled in by the driver and returned, or whether the
|
|
542
|
+
* driver will return a newly created print after enrollment succeeded.
|
|
543
|
+
* @param template_print a #FpPrint
|
|
544
|
+
* @param cancellable a #GCancellable, or %NULL
|
|
545
|
+
* @param callback the function to call on completion
|
|
546
|
+
*/
|
|
547
|
+
enroll(
|
|
548
|
+
template_print: Print,
|
|
549
|
+
cancellable?: Gio.Cancellable | null,
|
|
550
|
+
callback?: Gio.AsyncReadyCallback<this> | null,
|
|
551
|
+
): void;
|
|
552
|
+
/**
|
|
553
|
+
* Finish an asynchronous operation to enroll a print. You should check
|
|
554
|
+
* for an error of type %FP_DEVICE_RETRY to prompt the user again if there
|
|
555
|
+
* was an interaction issue.
|
|
556
|
+
* See fp_device_enroll().
|
|
557
|
+
* @param result A #GAsyncResult
|
|
558
|
+
* @returns The enrolled #FpPrint, or %NULL on error
|
|
559
|
+
*/
|
|
560
|
+
enroll_finish(result: Gio.AsyncResult): Print;
|
|
561
|
+
/**
|
|
562
|
+
* Enroll a new print. See fp_device_enroll(). It is undefined whether
|
|
563
|
+
* `template_print` is updated or a newly created #FpPrint is returned.
|
|
564
|
+
* @param template_print A #FpPrint to fill in or use as a template.
|
|
565
|
+
* @param cancellable a #GCancellable, or %NULL
|
|
566
|
+
* @param progress_cb progress reporting callback
|
|
567
|
+
* @returns A #FpPrint on success, %NULL otherwise
|
|
568
|
+
*/
|
|
569
|
+
enroll_sync(
|
|
570
|
+
template_print: Print,
|
|
571
|
+
cancellable?: Gio.Cancellable | null,
|
|
572
|
+
progress_cb?: EnrollProgress | null,
|
|
573
|
+
): Print;
|
|
574
|
+
get_device_id(): string;
|
|
575
|
+
get_driver(): string;
|
|
576
|
+
/**
|
|
577
|
+
* Gets the #FpDeviceFeature's supported by the `device`.
|
|
578
|
+
* @returns #FpDeviceFeature flags of supported features
|
|
579
|
+
*/
|
|
580
|
+
get_features(): DeviceFeature;
|
|
581
|
+
/**
|
|
582
|
+
* Retrieves the finger status flags for the device.
|
|
583
|
+
* This can be used by the UI to present the relevant feedback, although it
|
|
584
|
+
* is not guaranteed to be a relevant value when not performing any action.
|
|
585
|
+
* @returns The current #FpFingerStatusFlags
|
|
586
|
+
*/
|
|
587
|
+
get_finger_status(): FingerStatusFlags;
|
|
588
|
+
get_name(): string;
|
|
589
|
+
/**
|
|
590
|
+
* Retrieves the number of enroll stages for this device.
|
|
591
|
+
* @returns The number of enroll stages
|
|
592
|
+
*/
|
|
593
|
+
get_nr_enroll_stages(): number;
|
|
594
|
+
/**
|
|
595
|
+
* Retrieves the scan type of the device.
|
|
596
|
+
* @returns The #FpScanType
|
|
597
|
+
*/
|
|
598
|
+
get_scan_type(): ScanType;
|
|
599
|
+
/**
|
|
600
|
+
* Retrieves simple temperature information for device. It is not possible
|
|
601
|
+
* to use a device when this is #FP_TEMPERATURE_HOT.
|
|
602
|
+
* @returns The current temperature estimation.
|
|
603
|
+
*/
|
|
604
|
+
get_temperature(): Temperature;
|
|
605
|
+
/**
|
|
606
|
+
* Checks if `device` supports the requested #FpDeviceFeature's.
|
|
607
|
+
* See fp_device_get_features()
|
|
608
|
+
* @param feature #FpDeviceFeature flags to check against device supported features
|
|
609
|
+
* @returns %TRUE if supported, %FALSE otherwise
|
|
610
|
+
*/
|
|
611
|
+
has_feature(feature: DeviceFeature): boolean;
|
|
612
|
+
/**
|
|
613
|
+
* Whether the device has on-chip storage. If it has, you can list the
|
|
614
|
+
* prints stored on the with fp_device_list_prints() and you should
|
|
615
|
+
* always delete prints from the device again using
|
|
616
|
+
* fp_device_delete_print().
|
|
617
|
+
*/
|
|
618
|
+
has_storage(): boolean;
|
|
619
|
+
/**
|
|
620
|
+
* Start an asynchronous operation to identify prints. The callback will
|
|
621
|
+
* be called once the operation has finished. Retrieve the result with
|
|
622
|
+
* fp_device_identify_finish().
|
|
623
|
+
* @param prints #GPtrArray of #FpPrint
|
|
624
|
+
* @param cancellable a #GCancellable, or %NULL
|
|
625
|
+
* @param callback the function to call on completion
|
|
626
|
+
*/
|
|
627
|
+
identify(
|
|
628
|
+
prints: Print[],
|
|
629
|
+
cancellable?: Gio.Cancellable | null,
|
|
630
|
+
callback?: Gio.AsyncReadyCallback<this> | null,
|
|
631
|
+
): void;
|
|
632
|
+
/**
|
|
633
|
+
* Finish an asynchronous operation to identify a print. You should check
|
|
634
|
+
* for an error of type %FP_DEVICE_RETRY to prompt the user again if there
|
|
635
|
+
* was an interaction issue.
|
|
636
|
+
*
|
|
637
|
+
* Use `match` to find the print that matched. With `print` you can fetch the
|
|
638
|
+
* newly created print and retrieve the image data if available.
|
|
639
|
+
*
|
|
640
|
+
* See fp_device_identify().
|
|
641
|
+
* @param result A #GAsyncResult
|
|
642
|
+
* @returns %FALSE on error, %TRUE otherwise
|
|
643
|
+
*/
|
|
644
|
+
identify_finish(result: Gio.AsyncResult): [Print | null, Print | null];
|
|
645
|
+
/**
|
|
646
|
+
* Identify a print synchronously.
|
|
647
|
+
* @param prints #GPtrArray of #FpPrint
|
|
648
|
+
* @param cancellable a #GCancellable, or %NULL
|
|
649
|
+
* @returns %FALSE on error, %TRUE otherwise
|
|
650
|
+
*/
|
|
651
|
+
identify_sync(prints: Print[], cancellable?: Gio.Cancellable | null): [Print | null, Print | null];
|
|
652
|
+
is_open(): boolean;
|
|
653
|
+
/**
|
|
654
|
+
* Start an asynchronous operation to list all prints stored on the device.
|
|
655
|
+
* This only makes sense on devices that store prints on-chip.
|
|
656
|
+
*
|
|
657
|
+
* Retrieve the result with fp_device_list_prints_finish().
|
|
658
|
+
* @param cancellable a #GCancellable, or %NULL
|
|
659
|
+
* @param callback the function to call on completion
|
|
660
|
+
*/
|
|
661
|
+
list_prints(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback<this> | null): void;
|
|
662
|
+
/**
|
|
663
|
+
* Finish an asynchronous operation to list all device stored prints.
|
|
664
|
+
*
|
|
665
|
+
* See fp_device_list_prints().
|
|
666
|
+
* @param result A #GAsyncResult
|
|
667
|
+
* @returns Array of prints or %NULL on error
|
|
668
|
+
*/
|
|
669
|
+
list_prints_finish(result: Gio.AsyncResult): Print[];
|
|
670
|
+
/**
|
|
671
|
+
* List device stored prints synchronously.
|
|
672
|
+
* @param cancellable a #GCancellable, or %NULL
|
|
673
|
+
* @returns Array of prints, or %NULL on error
|
|
674
|
+
*/
|
|
675
|
+
list_prints_sync(cancellable?: Gio.Cancellable | null): Print[];
|
|
676
|
+
/**
|
|
677
|
+
* Finish an asynchronous operation to open the device.
|
|
678
|
+
* See fp_device_open().
|
|
679
|
+
* @param result A #GAsyncResult
|
|
680
|
+
* @returns %FALSE on error, %TRUE otherwise
|
|
681
|
+
*/
|
|
682
|
+
open_finish(result: Gio.AsyncResult): void;
|
|
683
|
+
/**
|
|
684
|
+
* Open the device synchronously.
|
|
685
|
+
* @param cancellable a #GCancellable, or %NULL
|
|
686
|
+
* @returns %FALSE on error, %TRUE otherwise
|
|
687
|
+
*/
|
|
688
|
+
open_sync(cancellable?: Gio.Cancellable | null): void;
|
|
689
|
+
/**
|
|
690
|
+
* Resume device after system suspend. Retrieve the result with
|
|
691
|
+
* fp_device_suspend_finish().
|
|
692
|
+
*
|
|
693
|
+
* Note that it is not defined when any ongoing operation may return (success or
|
|
694
|
+
* error). You must be ready to handle this before, during or after the
|
|
695
|
+
* resume operation.
|
|
696
|
+
* @param cancellable a #GCancellable, or %NULL, currently not used
|
|
697
|
+
* @param callback the function to call on completion
|
|
698
|
+
*/
|
|
699
|
+
resume(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback<this> | null): void;
|
|
700
|
+
/**
|
|
701
|
+
* Finish an asynchronous operation to resume the device after suspend.
|
|
702
|
+
* See fp_device_resume().
|
|
703
|
+
*
|
|
704
|
+
* The API user should accept an error of #FP_DEVICE_ERROR_NOT_SUPPORTED.
|
|
705
|
+
* @param result A #GAsyncResult
|
|
706
|
+
* @returns %FALSE on error, %TRUE otherwise
|
|
707
|
+
*/
|
|
708
|
+
resume_finish(result: Gio.AsyncResult): void;
|
|
709
|
+
/**
|
|
710
|
+
* Resume device after suspend.
|
|
711
|
+
* @param cancellable a #GCancellable, or %NULL, currently not used
|
|
712
|
+
* @returns %FALSE on error, %TRUE otherwise
|
|
713
|
+
*/
|
|
714
|
+
resume_sync(cancellable?: Gio.Cancellable | null): void;
|
|
715
|
+
/**
|
|
716
|
+
* Check whether the device supports capturing images.
|
|
717
|
+
* @returns Whether the device supports image capture
|
|
718
|
+
*/
|
|
719
|
+
supports_capture(): boolean;
|
|
720
|
+
/**
|
|
721
|
+
* Check whether the device supports identification.
|
|
722
|
+
* @returns Whether the device supports identification
|
|
723
|
+
*/
|
|
724
|
+
supports_identify(): boolean;
|
|
725
|
+
/**
|
|
726
|
+
* Prepare the device for system suspend. Retrieve the result with
|
|
727
|
+
* fp_device_suspend_finish().
|
|
728
|
+
*
|
|
729
|
+
* The suspend method can be called at any time (even if the device is not
|
|
730
|
+
* opened) and must be paired with a corresponding resume call. It is undefined
|
|
731
|
+
* when or how any ongoing operation is finished. This call might wait for an
|
|
732
|
+
* ongoing operation to finish, might cancel the ongoing operation or may
|
|
733
|
+
* prepare the device so that the host is resumed when the operation can be
|
|
734
|
+
* finished.
|
|
735
|
+
*
|
|
736
|
+
* If an ongoing operation must be cancelled then it will complete with an error
|
|
737
|
+
* code of #FP_DEVICE_ERROR_BUSY before the suspend async routine finishes.
|
|
738
|
+
*
|
|
739
|
+
* Any operation started while the device is suspended will fail with
|
|
740
|
+
* #FP_DEVICE_ERROR_BUSY, this includes calls to open or close the device.
|
|
741
|
+
* @param cancellable a #GCancellable, or %NULL, currently not used
|
|
742
|
+
* @param callback the function to call on completion
|
|
743
|
+
*/
|
|
744
|
+
suspend(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback<this> | null): void;
|
|
745
|
+
/**
|
|
746
|
+
* Finish an asynchronous operation to prepare the device for suspend.
|
|
747
|
+
* See fp_device_suspend().
|
|
748
|
+
*
|
|
749
|
+
* The API user should accept an error of #FP_DEVICE_ERROR_NOT_SUPPORTED.
|
|
750
|
+
* @param result A #GAsyncResult
|
|
751
|
+
* @returns %FALSE on error, %TRUE otherwise
|
|
752
|
+
*/
|
|
753
|
+
suspend_finish(result: Gio.AsyncResult): void;
|
|
754
|
+
/**
|
|
755
|
+
* Prepare device for suspend.
|
|
756
|
+
* @param cancellable a #GCancellable, or %NULL, currently not used
|
|
757
|
+
* @returns %FALSE on error, %TRUE otherwise
|
|
758
|
+
*/
|
|
759
|
+
suspend_sync(cancellable?: Gio.Cancellable | null): void;
|
|
760
|
+
/**
|
|
761
|
+
* Start an asynchronous operation to verify a print. The callback will
|
|
762
|
+
* be called once the operation has finished. Retrieve the result with
|
|
763
|
+
* fp_device_verify_finish().
|
|
764
|
+
* @param enrolled_print a #FpPrint to verify
|
|
765
|
+
* @param cancellable a #GCancellable, or %NULL
|
|
766
|
+
* @param callback the function to call on completion
|
|
767
|
+
*/
|
|
768
|
+
verify(
|
|
769
|
+
enrolled_print: Print,
|
|
770
|
+
cancellable?: Gio.Cancellable | null,
|
|
771
|
+
callback?: Gio.AsyncReadyCallback<this> | null,
|
|
772
|
+
): void;
|
|
773
|
+
/**
|
|
774
|
+
* Finish an asynchronous operation to verify an enrolled print. You should check
|
|
775
|
+
* for an error of type %FP_DEVICE_RETRY to prompt the user again if there
|
|
776
|
+
* was an interaction issue.
|
|
777
|
+
*
|
|
778
|
+
* With `print` you can fetch the newly created print and retrieve the image data if available.
|
|
779
|
+
*
|
|
780
|
+
* See fp_device_verify().
|
|
781
|
+
* @param result A #GAsyncResult
|
|
782
|
+
* @returns %FALSE on error, %TRUE otherwise
|
|
783
|
+
*/
|
|
784
|
+
verify_finish(result: Gio.AsyncResult): [boolean, Print | null];
|
|
785
|
+
/**
|
|
786
|
+
* Verify a given print synchronously.
|
|
787
|
+
* @param enrolled_print a #FpPrint to verify
|
|
788
|
+
* @param cancellable a #GCancellable, or %NULL
|
|
789
|
+
* @returns %FALSE on error, %TRUE otherwise
|
|
790
|
+
*/
|
|
791
|
+
verify_sync(enrolled_print: Print, cancellable: Gio.Cancellable | null): [boolean, Print | null];
|
|
792
|
+
|
|
793
|
+
// Inherited methods
|
|
794
|
+
/**
|
|
795
|
+
* Starts asynchronous initialization of the object implementing the
|
|
796
|
+
* interface. This must be done before any real use of the object after
|
|
797
|
+
* initial construction. If the object also implements #GInitable you can
|
|
798
|
+
* optionally call g_initable_init() instead.
|
|
799
|
+
*
|
|
800
|
+
* This method is intended for language bindings. If writing in C,
|
|
801
|
+
* g_async_initable_new_async() should typically be used instead.
|
|
802
|
+
*
|
|
803
|
+
* When the initialization is finished, `callback` will be called. You can
|
|
804
|
+
* then call g_async_initable_init_finish() to get the result of the
|
|
805
|
+
* initialization.
|
|
806
|
+
*
|
|
807
|
+
* Implementations may also support cancellation. If `cancellable` is not
|
|
808
|
+
* %NULL, then initialization can be cancelled by triggering the cancellable
|
|
809
|
+
* object from another thread. If the operation was cancelled, the error
|
|
810
|
+
* %G_IO_ERROR_CANCELLED will be returned. If `cancellable` is not %NULL, and
|
|
811
|
+
* the object doesn't support cancellable initialization, the error
|
|
812
|
+
* %G_IO_ERROR_NOT_SUPPORTED will be returned.
|
|
813
|
+
*
|
|
814
|
+
* As with #GInitable, if the object is not initialized, or initialization
|
|
815
|
+
* returns with an error, then all operations on the object except
|
|
816
|
+
* g_object_ref() and g_object_unref() are considered to be invalid, and
|
|
817
|
+
* have undefined behaviour. They will often fail with g_critical() or
|
|
818
|
+
* g_warning(), but this must not be relied on.
|
|
819
|
+
*
|
|
820
|
+
* Callers should not assume that a class which implements #GAsyncInitable can
|
|
821
|
+
* be initialized multiple times; for more information, see g_initable_init().
|
|
822
|
+
* If a class explicitly supports being initialized multiple times,
|
|
823
|
+
* implementation requires yielding all subsequent calls to init_async() on the
|
|
824
|
+
* results of the first call.
|
|
825
|
+
*
|
|
826
|
+
* For classes that also support the #GInitable interface, the default
|
|
827
|
+
* implementation of this method will run the g_initable_init() function
|
|
828
|
+
* in a thread, so if you want to support asynchronous initialization via
|
|
829
|
+
* threads, just implement the #GAsyncInitable interface without overriding
|
|
830
|
+
* any interface methods.
|
|
831
|
+
* @param io_priority the [I/O priority][io-priority] of the operation
|
|
832
|
+
* @param cancellable optional #GCancellable object, %NULL to ignore.
|
|
833
|
+
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
|
|
834
|
+
*/
|
|
835
|
+
init_async(
|
|
836
|
+
io_priority: number,
|
|
837
|
+
cancellable?: Gio.Cancellable | null,
|
|
838
|
+
callback?: Gio.AsyncReadyCallback<this> | null,
|
|
839
|
+
): void;
|
|
840
|
+
/**
|
|
841
|
+
* Finishes asynchronous initialization and returns the result.
|
|
842
|
+
* See g_async_initable_init_async().
|
|
843
|
+
* @param res a #GAsyncResult.
|
|
844
|
+
* @returns %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
|
|
845
|
+
*/
|
|
846
|
+
init_finish(res: Gio.AsyncResult): boolean;
|
|
847
|
+
/**
|
|
848
|
+
* Finishes the async construction for the various g_async_initable_new
|
|
849
|
+
* calls, returning the created object or %NULL on error.
|
|
850
|
+
* @param res the #GAsyncResult from the callback
|
|
851
|
+
* @returns a newly created #GObject, or %NULL on error. Free with g_object_unref().
|
|
852
|
+
*/
|
|
853
|
+
new_finish(res: Gio.AsyncResult): Device;
|
|
854
|
+
/**
|
|
855
|
+
* Starts asynchronous initialization of the object implementing the
|
|
856
|
+
* interface. This must be done before any real use of the object after
|
|
857
|
+
* initial construction. If the object also implements #GInitable you can
|
|
858
|
+
* optionally call g_initable_init() instead.
|
|
859
|
+
*
|
|
860
|
+
* This method is intended for language bindings. If writing in C,
|
|
861
|
+
* g_async_initable_new_async() should typically be used instead.
|
|
862
|
+
*
|
|
863
|
+
* When the initialization is finished, `callback` will be called. You can
|
|
864
|
+
* then call g_async_initable_init_finish() to get the result of the
|
|
865
|
+
* initialization.
|
|
866
|
+
*
|
|
867
|
+
* Implementations may also support cancellation. If `cancellable` is not
|
|
868
|
+
* %NULL, then initialization can be cancelled by triggering the cancellable
|
|
869
|
+
* object from another thread. If the operation was cancelled, the error
|
|
870
|
+
* %G_IO_ERROR_CANCELLED will be returned. If `cancellable` is not %NULL, and
|
|
871
|
+
* the object doesn't support cancellable initialization, the error
|
|
872
|
+
* %G_IO_ERROR_NOT_SUPPORTED will be returned.
|
|
873
|
+
*
|
|
874
|
+
* As with #GInitable, if the object is not initialized, or initialization
|
|
875
|
+
* returns with an error, then all operations on the object except
|
|
876
|
+
* g_object_ref() and g_object_unref() are considered to be invalid, and
|
|
877
|
+
* have undefined behaviour. They will often fail with g_critical() or
|
|
878
|
+
* g_warning(), but this must not be relied on.
|
|
879
|
+
*
|
|
880
|
+
* Callers should not assume that a class which implements #GAsyncInitable can
|
|
881
|
+
* be initialized multiple times; for more information, see g_initable_init().
|
|
882
|
+
* If a class explicitly supports being initialized multiple times,
|
|
883
|
+
* implementation requires yielding all subsequent calls to init_async() on the
|
|
884
|
+
* results of the first call.
|
|
885
|
+
*
|
|
886
|
+
* For classes that also support the #GInitable interface, the default
|
|
887
|
+
* implementation of this method will run the g_initable_init() function
|
|
888
|
+
* in a thread, so if you want to support asynchronous initialization via
|
|
889
|
+
* threads, just implement the #GAsyncInitable interface without overriding
|
|
890
|
+
* any interface methods.
|
|
891
|
+
* @param io_priority the [I/O priority][io-priority] of the operation
|
|
892
|
+
* @param cancellable optional #GCancellable object, %NULL to ignore.
|
|
893
|
+
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
|
|
894
|
+
*/
|
|
895
|
+
vfunc_init_async(
|
|
896
|
+
io_priority: number,
|
|
897
|
+
cancellable?: Gio.Cancellable | null,
|
|
898
|
+
callback?: Gio.AsyncReadyCallback<this> | null,
|
|
899
|
+
): void;
|
|
900
|
+
/**
|
|
901
|
+
* Finishes asynchronous initialization and returns the result.
|
|
902
|
+
* See g_async_initable_init_async().
|
|
903
|
+
* @param res a #GAsyncResult.
|
|
904
|
+
*/
|
|
905
|
+
vfunc_init_finish(res: Gio.AsyncResult): boolean;
|
|
906
|
+
/**
|
|
907
|
+
* Creates a binding between `source_property` on `source` and `target_property`
|
|
908
|
+
* on `target`.
|
|
909
|
+
*
|
|
910
|
+
* Whenever the `source_property` is changed the `target_property` is
|
|
911
|
+
* updated using the same value. For instance:
|
|
912
|
+
*
|
|
913
|
+
*
|
|
914
|
+
* ```c
|
|
915
|
+
* g_object_bind_property (action, "active", widget, "sensitive", 0);
|
|
916
|
+
* ```
|
|
917
|
+
*
|
|
918
|
+
*
|
|
919
|
+
* Will result in the "sensitive" property of the widget #GObject instance to be
|
|
920
|
+
* updated with the same value of the "active" property of the action #GObject
|
|
921
|
+
* instance.
|
|
922
|
+
*
|
|
923
|
+
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
|
|
924
|
+
* if `target_property` on `target` changes then the `source_property` on `source`
|
|
925
|
+
* will be updated as well.
|
|
926
|
+
*
|
|
927
|
+
* The binding will automatically be removed when either the `source` or the
|
|
928
|
+
* `target` instances are finalized. To remove the binding without affecting the
|
|
929
|
+
* `source` and the `target` you can just call g_object_unref() on the returned
|
|
930
|
+
* #GBinding instance.
|
|
931
|
+
*
|
|
932
|
+
* Removing the binding by calling g_object_unref() on it must only be done if
|
|
933
|
+
* the binding, `source` and `target` are only used from a single thread and it
|
|
934
|
+
* is clear that both `source` and `target` outlive the binding. Especially it
|
|
935
|
+
* is not safe to rely on this if the binding, `source` or `target` can be
|
|
936
|
+
* finalized from different threads. Keep another reference to the binding and
|
|
937
|
+
* use g_binding_unbind() instead to be on the safe side.
|
|
938
|
+
*
|
|
939
|
+
* A #GObject can have multiple bindings.
|
|
940
|
+
* @param source_property the property on @source to bind
|
|
941
|
+
* @param target the target #GObject
|
|
942
|
+
* @param target_property the property on @target to bind
|
|
943
|
+
* @param flags flags to pass to #GBinding
|
|
944
|
+
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
|
|
945
|
+
*/
|
|
946
|
+
bind_property(
|
|
947
|
+
source_property: string,
|
|
948
|
+
target: GObject.Object,
|
|
949
|
+
target_property: string,
|
|
950
|
+
flags: GObject.BindingFlags,
|
|
951
|
+
): GObject.Binding;
|
|
952
|
+
/**
|
|
953
|
+
* Complete version of g_object_bind_property().
|
|
954
|
+
*
|
|
955
|
+
* Creates a binding between `source_property` on `source` and `target_property`
|
|
956
|
+
* on `target,` allowing you to set the transformation functions to be used by
|
|
957
|
+
* the binding.
|
|
958
|
+
*
|
|
959
|
+
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
|
|
960
|
+
* if `target_property` on `target` changes then the `source_property` on `source`
|
|
961
|
+
* will be updated as well. The `transform_from` function is only used in case
|
|
962
|
+
* of bidirectional bindings, otherwise it will be ignored
|
|
963
|
+
*
|
|
964
|
+
* The binding will automatically be removed when either the `source` or the
|
|
965
|
+
* `target` instances are finalized. This will release the reference that is
|
|
966
|
+
* being held on the #GBinding instance; if you want to hold on to the
|
|
967
|
+
* #GBinding instance, you will need to hold a reference to it.
|
|
968
|
+
*
|
|
969
|
+
* To remove the binding, call g_binding_unbind().
|
|
970
|
+
*
|
|
971
|
+
* A #GObject can have multiple bindings.
|
|
972
|
+
*
|
|
973
|
+
* The same `user_data` parameter will be used for both `transform_to`
|
|
974
|
+
* and `transform_from` transformation functions; the `notify` function will
|
|
975
|
+
* be called once, when the binding is removed. If you need different data
|
|
976
|
+
* for each transformation function, please use
|
|
977
|
+
* g_object_bind_property_with_closures() instead.
|
|
978
|
+
* @param source_property the property on @source to bind
|
|
979
|
+
* @param target the target #GObject
|
|
980
|
+
* @param target_property the property on @target to bind
|
|
981
|
+
* @param flags flags to pass to #GBinding
|
|
982
|
+
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
|
|
983
|
+
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
|
|
984
|
+
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
|
|
985
|
+
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
|
|
986
|
+
*/
|
|
987
|
+
bind_property_full(
|
|
988
|
+
source_property: string,
|
|
989
|
+
target: GObject.Object,
|
|
990
|
+
target_property: string,
|
|
991
|
+
flags: GObject.BindingFlags,
|
|
992
|
+
transform_to?: GObject.BindingTransformFunc | null,
|
|
993
|
+
transform_from?: GObject.BindingTransformFunc | null,
|
|
994
|
+
notify?: GLib.DestroyNotify | null,
|
|
995
|
+
): GObject.Binding;
|
|
996
|
+
// Conflicted with GObject.Object.bind_property_full
|
|
997
|
+
bind_property_full(...args: never[]): any;
|
|
998
|
+
/**
|
|
999
|
+
* This function is intended for #GObject implementations to re-enforce
|
|
1000
|
+
* a [floating][floating-ref] object reference. Doing this is seldom
|
|
1001
|
+
* required: all #GInitiallyUnowneds are created with a floating reference
|
|
1002
|
+
* which usually just needs to be sunken by calling g_object_ref_sink().
|
|
1003
|
+
*/
|
|
1004
|
+
force_floating(): void;
|
|
1005
|
+
/**
|
|
1006
|
+
* Increases the freeze count on `object`. If the freeze count is
|
|
1007
|
+
* non-zero, the emission of "notify" signals on `object` is
|
|
1008
|
+
* stopped. The signals are queued until the freeze count is decreased
|
|
1009
|
+
* to zero. Duplicate notifications are squashed so that at most one
|
|
1010
|
+
* #GObject::notify signal is emitted for each property modified while the
|
|
1011
|
+
* object is frozen.
|
|
1012
|
+
*
|
|
1013
|
+
* This is necessary for accessors that modify multiple properties to prevent
|
|
1014
|
+
* premature notification while the object is still being modified.
|
|
1015
|
+
*/
|
|
1016
|
+
freeze_notify(): void;
|
|
1017
|
+
/**
|
|
1018
|
+
* Gets a named field from the objects table of associations (see g_object_set_data()).
|
|
1019
|
+
* @param key name of the key for that association
|
|
1020
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
1021
|
+
*/
|
|
1022
|
+
get_data(key: string): any | null;
|
|
1023
|
+
get_property(property_name: string): any;
|
|
1024
|
+
/**
|
|
1025
|
+
* This function gets back user data pointers stored via
|
|
1026
|
+
* g_object_set_qdata().
|
|
1027
|
+
* @param quark A #GQuark, naming the user data pointer
|
|
1028
|
+
* @returns The user data pointer set, or %NULL
|
|
1029
|
+
*/
|
|
1030
|
+
get_qdata(quark: GLib.Quark): any | null;
|
|
1031
|
+
/**
|
|
1032
|
+
* Gets `n_properties` properties for an `object`.
|
|
1033
|
+
* Obtained properties will be set to `values`. All properties must be valid.
|
|
1034
|
+
* Warnings will be emitted and undefined behaviour may result if invalid
|
|
1035
|
+
* properties are passed in.
|
|
1036
|
+
* @param names the names of each property to get
|
|
1037
|
+
* @param values the values of each property to get
|
|
1038
|
+
*/
|
|
1039
|
+
getv(names: string[], values: (GObject.Value | any)[]): void;
|
|
1040
|
+
/**
|
|
1041
|
+
* Checks whether `object` has a [floating][floating-ref] reference.
|
|
1042
|
+
* @returns %TRUE if @object has a floating reference
|
|
1043
|
+
*/
|
|
1044
|
+
is_floating(): boolean;
|
|
1045
|
+
/**
|
|
1046
|
+
* Emits a "notify" signal for the property `property_name` on `object`.
|
|
1047
|
+
*
|
|
1048
|
+
* When possible, eg. when signaling a property change from within the class
|
|
1049
|
+
* that registered the property, you should use g_object_notify_by_pspec()
|
|
1050
|
+
* instead.
|
|
1051
|
+
*
|
|
1052
|
+
* Note that emission of the notify signal may be blocked with
|
|
1053
|
+
* g_object_freeze_notify(). In this case, the signal emissions are queued
|
|
1054
|
+
* and will be emitted (in reverse order) when g_object_thaw_notify() is
|
|
1055
|
+
* called.
|
|
1056
|
+
* @param property_name the name of a property installed on the class of @object.
|
|
1057
|
+
*/
|
|
1058
|
+
notify(property_name: string): void;
|
|
1059
|
+
/**
|
|
1060
|
+
* Emits a "notify" signal for the property specified by `pspec` on `object`.
|
|
1061
|
+
*
|
|
1062
|
+
* This function omits the property name lookup, hence it is faster than
|
|
1063
|
+
* g_object_notify().
|
|
1064
|
+
*
|
|
1065
|
+
* One way to avoid using g_object_notify() from within the
|
|
1066
|
+
* class that registered the properties, and using g_object_notify_by_pspec()
|
|
1067
|
+
* instead, is to store the GParamSpec used with
|
|
1068
|
+
* g_object_class_install_property() inside a static array, e.g.:
|
|
1069
|
+
*
|
|
1070
|
+
*
|
|
1071
|
+
* ```c
|
|
1072
|
+
* typedef enum
|
|
1073
|
+
* {
|
|
1074
|
+
* PROP_FOO = 1,
|
|
1075
|
+
* PROP_LAST
|
|
1076
|
+
* } MyObjectProperty;
|
|
1077
|
+
*
|
|
1078
|
+
* static GParamSpec *properties[PROP_LAST];
|
|
1079
|
+
*
|
|
1080
|
+
* static void
|
|
1081
|
+
* my_object_class_init (MyObjectClass *klass)
|
|
1082
|
+
* {
|
|
1083
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
1084
|
+
* 0, 100,
|
|
1085
|
+
* 50,
|
|
1086
|
+
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
1087
|
+
* g_object_class_install_property (gobject_class,
|
|
1088
|
+
* PROP_FOO,
|
|
1089
|
+
* properties[PROP_FOO]);
|
|
1090
|
+
* }
|
|
1091
|
+
* ```
|
|
1092
|
+
*
|
|
1093
|
+
*
|
|
1094
|
+
* and then notify a change on the "foo" property with:
|
|
1095
|
+
*
|
|
1096
|
+
*
|
|
1097
|
+
* ```c
|
|
1098
|
+
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
|
|
1099
|
+
* ```
|
|
1100
|
+
*
|
|
1101
|
+
* @param pspec the #GParamSpec of a property installed on the class of @object.
|
|
1102
|
+
*/
|
|
1103
|
+
notify_by_pspec(pspec: GObject.ParamSpec): void;
|
|
1104
|
+
/**
|
|
1105
|
+
* Increases the reference count of `object`.
|
|
1106
|
+
*
|
|
1107
|
+
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
|
|
1108
|
+
* of `object` will be propagated to the return type (using the GCC typeof()
|
|
1109
|
+
* extension), so any casting the caller needs to do on the return type must be
|
|
1110
|
+
* explicit.
|
|
1111
|
+
* @returns the same @object
|
|
1112
|
+
*/
|
|
1113
|
+
ref(): GObject.Object;
|
|
1114
|
+
/**
|
|
1115
|
+
* Increase the reference count of `object,` and possibly remove the
|
|
1116
|
+
* [floating][floating-ref] reference, if `object` has a floating reference.
|
|
1117
|
+
*
|
|
1118
|
+
* In other words, if the object is floating, then this call "assumes
|
|
1119
|
+
* ownership" of the floating reference, converting it to a normal
|
|
1120
|
+
* reference by clearing the floating flag while leaving the reference
|
|
1121
|
+
* count unchanged. If the object is not floating, then this call
|
|
1122
|
+
* adds a new normal reference increasing the reference count by one.
|
|
1123
|
+
*
|
|
1124
|
+
* Since GLib 2.56, the type of `object` will be propagated to the return type
|
|
1125
|
+
* under the same conditions as for g_object_ref().
|
|
1126
|
+
* @returns @object
|
|
1127
|
+
*/
|
|
1128
|
+
ref_sink(): GObject.Object;
|
|
1129
|
+
/**
|
|
1130
|
+
* Releases all references to other objects. This can be used to break
|
|
1131
|
+
* reference cycles.
|
|
1132
|
+
*
|
|
1133
|
+
* This function should only be called from object system implementations.
|
|
1134
|
+
*/
|
|
1135
|
+
run_dispose(): void;
|
|
1136
|
+
/**
|
|
1137
|
+
* Each object carries around a table of associations from
|
|
1138
|
+
* strings to pointers. This function lets you set an association.
|
|
1139
|
+
*
|
|
1140
|
+
* If the object already had an association with that name,
|
|
1141
|
+
* the old association will be destroyed.
|
|
1142
|
+
*
|
|
1143
|
+
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
|
|
1144
|
+
* This means a copy of `key` is kept permanently (even after `object` has been
|
|
1145
|
+
* finalized) — so it is recommended to only use a small, bounded set of values
|
|
1146
|
+
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
|
|
1147
|
+
* @param key name of the key
|
|
1148
|
+
* @param data data to associate with that key
|
|
1149
|
+
*/
|
|
1150
|
+
set_data(key: string, data?: any | null): void;
|
|
1151
|
+
set_property(property_name: string, value: any): void;
|
|
1152
|
+
/**
|
|
1153
|
+
* Remove a specified datum from the object's data associations,
|
|
1154
|
+
* without invoking the association's destroy handler.
|
|
1155
|
+
* @param key name of the key
|
|
1156
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
1157
|
+
*/
|
|
1158
|
+
steal_data(key: string): any | null;
|
|
1159
|
+
/**
|
|
1160
|
+
* This function gets back user data pointers stored via
|
|
1161
|
+
* g_object_set_qdata() and removes the `data` from object
|
|
1162
|
+
* without invoking its destroy() function (if any was
|
|
1163
|
+
* set).
|
|
1164
|
+
* Usually, calling this function is only required to update
|
|
1165
|
+
* user data pointers with a destroy notifier, for example:
|
|
1166
|
+
*
|
|
1167
|
+
* ```c
|
|
1168
|
+
* void
|
|
1169
|
+
* object_add_to_user_list (GObject *object,
|
|
1170
|
+
* const gchar *new_string)
|
|
1171
|
+
* {
|
|
1172
|
+
* // the quark, naming the object data
|
|
1173
|
+
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
|
|
1174
|
+
* // retrieve the old string list
|
|
1175
|
+
* GList *list = g_object_steal_qdata (object, quark_string_list);
|
|
1176
|
+
*
|
|
1177
|
+
* // prepend new string
|
|
1178
|
+
* list = g_list_prepend (list, g_strdup (new_string));
|
|
1179
|
+
* // this changed 'list', so we need to set it again
|
|
1180
|
+
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
|
|
1181
|
+
* }
|
|
1182
|
+
* static void
|
|
1183
|
+
* free_string_list (gpointer data)
|
|
1184
|
+
* {
|
|
1185
|
+
* GList *node, *list = data;
|
|
1186
|
+
*
|
|
1187
|
+
* for (node = list; node; node = node->next)
|
|
1188
|
+
* g_free (node->data);
|
|
1189
|
+
* g_list_free (list);
|
|
1190
|
+
* }
|
|
1191
|
+
* ```
|
|
1192
|
+
*
|
|
1193
|
+
* Using g_object_get_qdata() in the above example, instead of
|
|
1194
|
+
* g_object_steal_qdata() would have left the destroy function set,
|
|
1195
|
+
* and thus the partial string list would have been freed upon
|
|
1196
|
+
* g_object_set_qdata_full().
|
|
1197
|
+
* @param quark A #GQuark, naming the user data pointer
|
|
1198
|
+
* @returns The user data pointer set, or %NULL
|
|
1199
|
+
*/
|
|
1200
|
+
steal_qdata(quark: GLib.Quark): any | null;
|
|
1201
|
+
/**
|
|
1202
|
+
* Reverts the effect of a previous call to
|
|
1203
|
+
* g_object_freeze_notify(). The freeze count is decreased on `object`
|
|
1204
|
+
* and when it reaches zero, queued "notify" signals are emitted.
|
|
1205
|
+
*
|
|
1206
|
+
* Duplicate notifications for each property are squashed so that at most one
|
|
1207
|
+
* #GObject::notify signal is emitted for each property, in the reverse order
|
|
1208
|
+
* in which they have been queued.
|
|
1209
|
+
*
|
|
1210
|
+
* It is an error to call this function when the freeze count is zero.
|
|
1211
|
+
*/
|
|
1212
|
+
thaw_notify(): void;
|
|
1213
|
+
/**
|
|
1214
|
+
* Decreases the reference count of `object`. When its reference count
|
|
1215
|
+
* drops to 0, the object is finalized (i.e. its memory is freed).
|
|
1216
|
+
*
|
|
1217
|
+
* If the pointer to the #GObject may be reused in future (for example, if it is
|
|
1218
|
+
* an instance variable of another object), it is recommended to clear the
|
|
1219
|
+
* pointer to %NULL rather than retain a dangling pointer to a potentially
|
|
1220
|
+
* invalid #GObject instance. Use g_clear_object() for this.
|
|
1221
|
+
*/
|
|
1222
|
+
unref(): void;
|
|
1223
|
+
/**
|
|
1224
|
+
* This function essentially limits the life time of the `closure` to
|
|
1225
|
+
* the life time of the object. That is, when the object is finalized,
|
|
1226
|
+
* the `closure` is invalidated by calling g_closure_invalidate() on
|
|
1227
|
+
* it, in order to prevent invocations of the closure with a finalized
|
|
1228
|
+
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
|
|
1229
|
+
* added as marshal guards to the `closure,` to ensure that an extra
|
|
1230
|
+
* reference count is held on `object` during invocation of the
|
|
1231
|
+
* `closure`. Usually, this function will be called on closures that
|
|
1232
|
+
* use this `object` as closure data.
|
|
1233
|
+
* @param closure #GClosure to watch
|
|
1234
|
+
*/
|
|
1235
|
+
watch_closure(closure: GObject.Closure): void;
|
|
1236
|
+
vfunc_constructed(): void;
|
|
1237
|
+
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
|
|
1238
|
+
vfunc_dispose(): void;
|
|
1239
|
+
vfunc_finalize(): void;
|
|
1240
|
+
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
|
|
1241
|
+
/**
|
|
1242
|
+
* Emits a "notify" signal for the property `property_name` on `object`.
|
|
1243
|
+
*
|
|
1244
|
+
* When possible, eg. when signaling a property change from within the class
|
|
1245
|
+
* that registered the property, you should use g_object_notify_by_pspec()
|
|
1246
|
+
* instead.
|
|
1247
|
+
*
|
|
1248
|
+
* Note that emission of the notify signal may be blocked with
|
|
1249
|
+
* g_object_freeze_notify(). In this case, the signal emissions are queued
|
|
1250
|
+
* and will be emitted (in reverse order) when g_object_thaw_notify() is
|
|
1251
|
+
* called.
|
|
1252
|
+
* @param pspec
|
|
1253
|
+
*/
|
|
1254
|
+
vfunc_notify(pspec: GObject.ParamSpec): void;
|
|
1255
|
+
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
|
|
1256
|
+
disconnect(id: number): void;
|
|
1257
|
+
set(properties: { [key: string]: any }): void;
|
|
1258
|
+
block_signal_handler(id: number): any;
|
|
1259
|
+
unblock_signal_handler(id: number): any;
|
|
1260
|
+
stop_emission_by_name(detailedName: string): any;
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
module Image {
|
|
1264
|
+
// Constructor properties interface
|
|
1265
|
+
|
|
1266
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps {
|
|
1267
|
+
height: number;
|
|
1268
|
+
width: number;
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
class Image extends GObject.Object {
|
|
1273
|
+
static $gtype: GObject.GType<Image>;
|
|
1274
|
+
|
|
1275
|
+
// Own properties of FPrint.Image
|
|
1276
|
+
|
|
1277
|
+
get height(): number;
|
|
1278
|
+
get width(): number;
|
|
1279
|
+
|
|
1280
|
+
// Constructors of FPrint.Image
|
|
1281
|
+
|
|
1282
|
+
constructor(properties?: Partial<Image.ConstructorProps>, ...args: any[]);
|
|
1283
|
+
|
|
1284
|
+
_init(...args: any[]): void;
|
|
1285
|
+
|
|
1286
|
+
static ['new'](width: number, height: number): Image;
|
|
1287
|
+
|
|
1288
|
+
// Own methods of FPrint.Image
|
|
1289
|
+
|
|
1290
|
+
/**
|
|
1291
|
+
* Detects the minutiae found in an image.
|
|
1292
|
+
* @param cancellable a #GCancellable, or %NULL
|
|
1293
|
+
* @param callback the function to call on completion
|
|
1294
|
+
*/
|
|
1295
|
+
detect_minutiae(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback<this> | null): void;
|
|
1296
|
+
/**
|
|
1297
|
+
* Finish minutiae detection in an image
|
|
1298
|
+
* @param result A #GAsyncResult
|
|
1299
|
+
* @returns %TRUE on success
|
|
1300
|
+
*/
|
|
1301
|
+
detect_minutiae_finish(result: Gio.AsyncResult): boolean;
|
|
1302
|
+
/**
|
|
1303
|
+
* Gets the binarized data for an image. This data must not be modified or
|
|
1304
|
+
* freed. You need to first detect the minutiae using
|
|
1305
|
+
* fp_image_detect_minutiae().
|
|
1306
|
+
* @returns The binarized image data
|
|
1307
|
+
*/
|
|
1308
|
+
get_binarized(): Uint8Array;
|
|
1309
|
+
/**
|
|
1310
|
+
* Gets the greyscale data for an image. This data must not be modified or
|
|
1311
|
+
* freed.
|
|
1312
|
+
* @returns The image data
|
|
1313
|
+
*/
|
|
1314
|
+
get_data(): Uint8Array;
|
|
1315
|
+
// Conflicted with GObject.Object.get_data
|
|
1316
|
+
get_data(...args: never[]): any;
|
|
1317
|
+
/**
|
|
1318
|
+
* Gets the pixel height of an image.
|
|
1319
|
+
* @returns the height of the image
|
|
1320
|
+
*/
|
|
1321
|
+
get_height(): number;
|
|
1322
|
+
/**
|
|
1323
|
+
* Gets the minutiae for an image. This data must not be modified or
|
|
1324
|
+
* freed. You need to first detect the minutiae using
|
|
1325
|
+
* fp_image_detect_minutiae().
|
|
1326
|
+
* @returns The detected minutiae
|
|
1327
|
+
*/
|
|
1328
|
+
get_minutiae(): Minutia[];
|
|
1329
|
+
/**
|
|
1330
|
+
* Gets the resolution of the image. Note that this is assumed to
|
|
1331
|
+
* be fixed to 500 points per inch (~19.685 p/mm) for most drivers.
|
|
1332
|
+
* @returns the resolution of the image in points per millimeter
|
|
1333
|
+
*/
|
|
1334
|
+
get_ppmm(): number;
|
|
1335
|
+
/**
|
|
1336
|
+
* Gets the pixel width of an image.
|
|
1337
|
+
* @returns the width of the image
|
|
1338
|
+
*/
|
|
1339
|
+
get_width(): number;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
module ImageDevice {
|
|
1343
|
+
// Signal callback interfaces
|
|
1344
|
+
|
|
1345
|
+
interface FpiImageDeviceStateChanged {
|
|
1346
|
+
(new_state: unknown): void;
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
// Constructor properties interface
|
|
1350
|
+
|
|
1351
|
+
interface ConstructorProps extends Device.ConstructorProps, Gio.AsyncInitable.ConstructorProps {}
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
abstract class ImageDevice extends Device implements Gio.AsyncInitable<ImageDevice> {
|
|
1355
|
+
static $gtype: GObject.GType<ImageDevice>;
|
|
1356
|
+
|
|
1357
|
+
// Constructors of FPrint.ImageDevice
|
|
1358
|
+
|
|
1359
|
+
constructor(properties?: Partial<ImageDevice.ConstructorProps>, ...args: any[]);
|
|
1360
|
+
|
|
1361
|
+
_init(...args: any[]): void;
|
|
1362
|
+
|
|
1363
|
+
// Own signals of FPrint.ImageDevice
|
|
1364
|
+
|
|
1365
|
+
connect(id: string, callback: (...args: any[]) => any): number;
|
|
1366
|
+
connect_after(id: string, callback: (...args: any[]) => any): number;
|
|
1367
|
+
emit(id: string, ...args: any[]): void;
|
|
1368
|
+
connect(
|
|
1369
|
+
signal: 'fpi-image-device-state-changed',
|
|
1370
|
+
callback: (_source: this, new_state: unknown) => void,
|
|
1371
|
+
): number;
|
|
1372
|
+
connect_after(
|
|
1373
|
+
signal: 'fpi-image-device-state-changed',
|
|
1374
|
+
callback: (_source: this, new_state: unknown) => void,
|
|
1375
|
+
): number;
|
|
1376
|
+
emit(signal: 'fpi-image-device-state-changed', new_state: unknown): void;
|
|
1377
|
+
|
|
1378
|
+
// Inherited methods
|
|
1379
|
+
/**
|
|
1380
|
+
* Starts asynchronous initialization of the object implementing the
|
|
1381
|
+
* interface. This must be done before any real use of the object after
|
|
1382
|
+
* initial construction. If the object also implements #GInitable you can
|
|
1383
|
+
* optionally call g_initable_init() instead.
|
|
1384
|
+
*
|
|
1385
|
+
* This method is intended for language bindings. If writing in C,
|
|
1386
|
+
* g_async_initable_new_async() should typically be used instead.
|
|
1387
|
+
*
|
|
1388
|
+
* When the initialization is finished, `callback` will be called. You can
|
|
1389
|
+
* then call g_async_initable_init_finish() to get the result of the
|
|
1390
|
+
* initialization.
|
|
1391
|
+
*
|
|
1392
|
+
* Implementations may also support cancellation. If `cancellable` is not
|
|
1393
|
+
* %NULL, then initialization can be cancelled by triggering the cancellable
|
|
1394
|
+
* object from another thread. If the operation was cancelled, the error
|
|
1395
|
+
* %G_IO_ERROR_CANCELLED will be returned. If `cancellable` is not %NULL, and
|
|
1396
|
+
* the object doesn't support cancellable initialization, the error
|
|
1397
|
+
* %G_IO_ERROR_NOT_SUPPORTED will be returned.
|
|
1398
|
+
*
|
|
1399
|
+
* As with #GInitable, if the object is not initialized, or initialization
|
|
1400
|
+
* returns with an error, then all operations on the object except
|
|
1401
|
+
* g_object_ref() and g_object_unref() are considered to be invalid, and
|
|
1402
|
+
* have undefined behaviour. They will often fail with g_critical() or
|
|
1403
|
+
* g_warning(), but this must not be relied on.
|
|
1404
|
+
*
|
|
1405
|
+
* Callers should not assume that a class which implements #GAsyncInitable can
|
|
1406
|
+
* be initialized multiple times; for more information, see g_initable_init().
|
|
1407
|
+
* If a class explicitly supports being initialized multiple times,
|
|
1408
|
+
* implementation requires yielding all subsequent calls to init_async() on the
|
|
1409
|
+
* results of the first call.
|
|
1410
|
+
*
|
|
1411
|
+
* For classes that also support the #GInitable interface, the default
|
|
1412
|
+
* implementation of this method will run the g_initable_init() function
|
|
1413
|
+
* in a thread, so if you want to support asynchronous initialization via
|
|
1414
|
+
* threads, just implement the #GAsyncInitable interface without overriding
|
|
1415
|
+
* any interface methods.
|
|
1416
|
+
* @param io_priority the [I/O priority][io-priority] of the operation
|
|
1417
|
+
* @param cancellable optional #GCancellable object, %NULL to ignore.
|
|
1418
|
+
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
|
|
1419
|
+
*/
|
|
1420
|
+
init_async(
|
|
1421
|
+
io_priority: number,
|
|
1422
|
+
cancellable?: Gio.Cancellable | null,
|
|
1423
|
+
callback?: Gio.AsyncReadyCallback<this> | null,
|
|
1424
|
+
): void;
|
|
1425
|
+
/**
|
|
1426
|
+
* Finishes asynchronous initialization and returns the result.
|
|
1427
|
+
* See g_async_initable_init_async().
|
|
1428
|
+
* @param res a #GAsyncResult.
|
|
1429
|
+
* @returns %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
|
|
1430
|
+
*/
|
|
1431
|
+
init_finish(res: Gio.AsyncResult): boolean;
|
|
1432
|
+
/**
|
|
1433
|
+
* Finishes the async construction for the various g_async_initable_new
|
|
1434
|
+
* calls, returning the created object or %NULL on error.
|
|
1435
|
+
* @param res the #GAsyncResult from the callback
|
|
1436
|
+
* @returns a newly created #GObject, or %NULL on error. Free with g_object_unref().
|
|
1437
|
+
*/
|
|
1438
|
+
new_finish(res: Gio.AsyncResult): ImageDevice;
|
|
1439
|
+
/**
|
|
1440
|
+
* Starts asynchronous initialization of the object implementing the
|
|
1441
|
+
* interface. This must be done before any real use of the object after
|
|
1442
|
+
* initial construction. If the object also implements #GInitable you can
|
|
1443
|
+
* optionally call g_initable_init() instead.
|
|
1444
|
+
*
|
|
1445
|
+
* This method is intended for language bindings. If writing in C,
|
|
1446
|
+
* g_async_initable_new_async() should typically be used instead.
|
|
1447
|
+
*
|
|
1448
|
+
* When the initialization is finished, `callback` will be called. You can
|
|
1449
|
+
* then call g_async_initable_init_finish() to get the result of the
|
|
1450
|
+
* initialization.
|
|
1451
|
+
*
|
|
1452
|
+
* Implementations may also support cancellation. If `cancellable` is not
|
|
1453
|
+
* %NULL, then initialization can be cancelled by triggering the cancellable
|
|
1454
|
+
* object from another thread. If the operation was cancelled, the error
|
|
1455
|
+
* %G_IO_ERROR_CANCELLED will be returned. If `cancellable` is not %NULL, and
|
|
1456
|
+
* the object doesn't support cancellable initialization, the error
|
|
1457
|
+
* %G_IO_ERROR_NOT_SUPPORTED will be returned.
|
|
1458
|
+
*
|
|
1459
|
+
* As with #GInitable, if the object is not initialized, or initialization
|
|
1460
|
+
* returns with an error, then all operations on the object except
|
|
1461
|
+
* g_object_ref() and g_object_unref() are considered to be invalid, and
|
|
1462
|
+
* have undefined behaviour. They will often fail with g_critical() or
|
|
1463
|
+
* g_warning(), but this must not be relied on.
|
|
1464
|
+
*
|
|
1465
|
+
* Callers should not assume that a class which implements #GAsyncInitable can
|
|
1466
|
+
* be initialized multiple times; for more information, see g_initable_init().
|
|
1467
|
+
* If a class explicitly supports being initialized multiple times,
|
|
1468
|
+
* implementation requires yielding all subsequent calls to init_async() on the
|
|
1469
|
+
* results of the first call.
|
|
1470
|
+
*
|
|
1471
|
+
* For classes that also support the #GInitable interface, the default
|
|
1472
|
+
* implementation of this method will run the g_initable_init() function
|
|
1473
|
+
* in a thread, so if you want to support asynchronous initialization via
|
|
1474
|
+
* threads, just implement the #GAsyncInitable interface without overriding
|
|
1475
|
+
* any interface methods.
|
|
1476
|
+
* @param io_priority the [I/O priority][io-priority] of the operation
|
|
1477
|
+
* @param cancellable optional #GCancellable object, %NULL to ignore.
|
|
1478
|
+
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
|
|
1479
|
+
*/
|
|
1480
|
+
vfunc_init_async(
|
|
1481
|
+
io_priority: number,
|
|
1482
|
+
cancellable?: Gio.Cancellable | null,
|
|
1483
|
+
callback?: Gio.AsyncReadyCallback<this> | null,
|
|
1484
|
+
): void;
|
|
1485
|
+
/**
|
|
1486
|
+
* Finishes asynchronous initialization and returns the result.
|
|
1487
|
+
* See g_async_initable_init_async().
|
|
1488
|
+
* @param res a #GAsyncResult.
|
|
1489
|
+
*/
|
|
1490
|
+
vfunc_init_finish(res: Gio.AsyncResult): boolean;
|
|
1491
|
+
/**
|
|
1492
|
+
* Creates a binding between `source_property` on `source` and `target_property`
|
|
1493
|
+
* on `target`.
|
|
1494
|
+
*
|
|
1495
|
+
* Whenever the `source_property` is changed the `target_property` is
|
|
1496
|
+
* updated using the same value. For instance:
|
|
1497
|
+
*
|
|
1498
|
+
*
|
|
1499
|
+
* ```c
|
|
1500
|
+
* g_object_bind_property (action, "active", widget, "sensitive", 0);
|
|
1501
|
+
* ```
|
|
1502
|
+
*
|
|
1503
|
+
*
|
|
1504
|
+
* Will result in the "sensitive" property of the widget #GObject instance to be
|
|
1505
|
+
* updated with the same value of the "active" property of the action #GObject
|
|
1506
|
+
* instance.
|
|
1507
|
+
*
|
|
1508
|
+
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
|
|
1509
|
+
* if `target_property` on `target` changes then the `source_property` on `source`
|
|
1510
|
+
* will be updated as well.
|
|
1511
|
+
*
|
|
1512
|
+
* The binding will automatically be removed when either the `source` or the
|
|
1513
|
+
* `target` instances are finalized. To remove the binding without affecting the
|
|
1514
|
+
* `source` and the `target` you can just call g_object_unref() on the returned
|
|
1515
|
+
* #GBinding instance.
|
|
1516
|
+
*
|
|
1517
|
+
* Removing the binding by calling g_object_unref() on it must only be done if
|
|
1518
|
+
* the binding, `source` and `target` are only used from a single thread and it
|
|
1519
|
+
* is clear that both `source` and `target` outlive the binding. Especially it
|
|
1520
|
+
* is not safe to rely on this if the binding, `source` or `target` can be
|
|
1521
|
+
* finalized from different threads. Keep another reference to the binding and
|
|
1522
|
+
* use g_binding_unbind() instead to be on the safe side.
|
|
1523
|
+
*
|
|
1524
|
+
* A #GObject can have multiple bindings.
|
|
1525
|
+
* @param source_property the property on @source to bind
|
|
1526
|
+
* @param target the target #GObject
|
|
1527
|
+
* @param target_property the property on @target to bind
|
|
1528
|
+
* @param flags flags to pass to #GBinding
|
|
1529
|
+
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
|
|
1530
|
+
*/
|
|
1531
|
+
bind_property(
|
|
1532
|
+
source_property: string,
|
|
1533
|
+
target: GObject.Object,
|
|
1534
|
+
target_property: string,
|
|
1535
|
+
flags: GObject.BindingFlags,
|
|
1536
|
+
): GObject.Binding;
|
|
1537
|
+
/**
|
|
1538
|
+
* Complete version of g_object_bind_property().
|
|
1539
|
+
*
|
|
1540
|
+
* Creates a binding between `source_property` on `source` and `target_property`
|
|
1541
|
+
* on `target,` allowing you to set the transformation functions to be used by
|
|
1542
|
+
* the binding.
|
|
1543
|
+
*
|
|
1544
|
+
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
|
|
1545
|
+
* if `target_property` on `target` changes then the `source_property` on `source`
|
|
1546
|
+
* will be updated as well. The `transform_from` function is only used in case
|
|
1547
|
+
* of bidirectional bindings, otherwise it will be ignored
|
|
1548
|
+
*
|
|
1549
|
+
* The binding will automatically be removed when either the `source` or the
|
|
1550
|
+
* `target` instances are finalized. This will release the reference that is
|
|
1551
|
+
* being held on the #GBinding instance; if you want to hold on to the
|
|
1552
|
+
* #GBinding instance, you will need to hold a reference to it.
|
|
1553
|
+
*
|
|
1554
|
+
* To remove the binding, call g_binding_unbind().
|
|
1555
|
+
*
|
|
1556
|
+
* A #GObject can have multiple bindings.
|
|
1557
|
+
*
|
|
1558
|
+
* The same `user_data` parameter will be used for both `transform_to`
|
|
1559
|
+
* and `transform_from` transformation functions; the `notify` function will
|
|
1560
|
+
* be called once, when the binding is removed. If you need different data
|
|
1561
|
+
* for each transformation function, please use
|
|
1562
|
+
* g_object_bind_property_with_closures() instead.
|
|
1563
|
+
* @param source_property the property on @source to bind
|
|
1564
|
+
* @param target the target #GObject
|
|
1565
|
+
* @param target_property the property on @target to bind
|
|
1566
|
+
* @param flags flags to pass to #GBinding
|
|
1567
|
+
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
|
|
1568
|
+
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
|
|
1569
|
+
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
|
|
1570
|
+
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
|
|
1571
|
+
*/
|
|
1572
|
+
bind_property_full(
|
|
1573
|
+
source_property: string,
|
|
1574
|
+
target: GObject.Object,
|
|
1575
|
+
target_property: string,
|
|
1576
|
+
flags: GObject.BindingFlags,
|
|
1577
|
+
transform_to?: GObject.BindingTransformFunc | null,
|
|
1578
|
+
transform_from?: GObject.BindingTransformFunc | null,
|
|
1579
|
+
notify?: GLib.DestroyNotify | null,
|
|
1580
|
+
): GObject.Binding;
|
|
1581
|
+
// Conflicted with GObject.Object.bind_property_full
|
|
1582
|
+
bind_property_full(...args: never[]): any;
|
|
1583
|
+
/**
|
|
1584
|
+
* This function is intended for #GObject implementations to re-enforce
|
|
1585
|
+
* a [floating][floating-ref] object reference. Doing this is seldom
|
|
1586
|
+
* required: all #GInitiallyUnowneds are created with a floating reference
|
|
1587
|
+
* which usually just needs to be sunken by calling g_object_ref_sink().
|
|
1588
|
+
*/
|
|
1589
|
+
force_floating(): void;
|
|
1590
|
+
/**
|
|
1591
|
+
* Increases the freeze count on `object`. If the freeze count is
|
|
1592
|
+
* non-zero, the emission of "notify" signals on `object` is
|
|
1593
|
+
* stopped. The signals are queued until the freeze count is decreased
|
|
1594
|
+
* to zero. Duplicate notifications are squashed so that at most one
|
|
1595
|
+
* #GObject::notify signal is emitted for each property modified while the
|
|
1596
|
+
* object is frozen.
|
|
1597
|
+
*
|
|
1598
|
+
* This is necessary for accessors that modify multiple properties to prevent
|
|
1599
|
+
* premature notification while the object is still being modified.
|
|
1600
|
+
*/
|
|
1601
|
+
freeze_notify(): void;
|
|
1602
|
+
/**
|
|
1603
|
+
* Gets a named field from the objects table of associations (see g_object_set_data()).
|
|
1604
|
+
* @param key name of the key for that association
|
|
1605
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
1606
|
+
*/
|
|
1607
|
+
get_data(key: string): any | null;
|
|
1608
|
+
get_property(property_name: string): any;
|
|
1609
|
+
/**
|
|
1610
|
+
* This function gets back user data pointers stored via
|
|
1611
|
+
* g_object_set_qdata().
|
|
1612
|
+
* @param quark A #GQuark, naming the user data pointer
|
|
1613
|
+
* @returns The user data pointer set, or %NULL
|
|
1614
|
+
*/
|
|
1615
|
+
get_qdata(quark: GLib.Quark): any | null;
|
|
1616
|
+
/**
|
|
1617
|
+
* Gets `n_properties` properties for an `object`.
|
|
1618
|
+
* Obtained properties will be set to `values`. All properties must be valid.
|
|
1619
|
+
* Warnings will be emitted and undefined behaviour may result if invalid
|
|
1620
|
+
* properties are passed in.
|
|
1621
|
+
* @param names the names of each property to get
|
|
1622
|
+
* @param values the values of each property to get
|
|
1623
|
+
*/
|
|
1624
|
+
getv(names: string[], values: (GObject.Value | any)[]): void;
|
|
1625
|
+
/**
|
|
1626
|
+
* Checks whether `object` has a [floating][floating-ref] reference.
|
|
1627
|
+
* @returns %TRUE if @object has a floating reference
|
|
1628
|
+
*/
|
|
1629
|
+
is_floating(): boolean;
|
|
1630
|
+
/**
|
|
1631
|
+
* Emits a "notify" signal for the property `property_name` on `object`.
|
|
1632
|
+
*
|
|
1633
|
+
* When possible, eg. when signaling a property change from within the class
|
|
1634
|
+
* that registered the property, you should use g_object_notify_by_pspec()
|
|
1635
|
+
* instead.
|
|
1636
|
+
*
|
|
1637
|
+
* Note that emission of the notify signal may be blocked with
|
|
1638
|
+
* g_object_freeze_notify(). In this case, the signal emissions are queued
|
|
1639
|
+
* and will be emitted (in reverse order) when g_object_thaw_notify() is
|
|
1640
|
+
* called.
|
|
1641
|
+
* @param property_name the name of a property installed on the class of @object.
|
|
1642
|
+
*/
|
|
1643
|
+
notify(property_name: string): void;
|
|
1644
|
+
/**
|
|
1645
|
+
* Emits a "notify" signal for the property specified by `pspec` on `object`.
|
|
1646
|
+
*
|
|
1647
|
+
* This function omits the property name lookup, hence it is faster than
|
|
1648
|
+
* g_object_notify().
|
|
1649
|
+
*
|
|
1650
|
+
* One way to avoid using g_object_notify() from within the
|
|
1651
|
+
* class that registered the properties, and using g_object_notify_by_pspec()
|
|
1652
|
+
* instead, is to store the GParamSpec used with
|
|
1653
|
+
* g_object_class_install_property() inside a static array, e.g.:
|
|
1654
|
+
*
|
|
1655
|
+
*
|
|
1656
|
+
* ```c
|
|
1657
|
+
* typedef enum
|
|
1658
|
+
* {
|
|
1659
|
+
* PROP_FOO = 1,
|
|
1660
|
+
* PROP_LAST
|
|
1661
|
+
* } MyObjectProperty;
|
|
1662
|
+
*
|
|
1663
|
+
* static GParamSpec *properties[PROP_LAST];
|
|
1664
|
+
*
|
|
1665
|
+
* static void
|
|
1666
|
+
* my_object_class_init (MyObjectClass *klass)
|
|
1667
|
+
* {
|
|
1668
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
1669
|
+
* 0, 100,
|
|
1670
|
+
* 50,
|
|
1671
|
+
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
1672
|
+
* g_object_class_install_property (gobject_class,
|
|
1673
|
+
* PROP_FOO,
|
|
1674
|
+
* properties[PROP_FOO]);
|
|
1675
|
+
* }
|
|
1676
|
+
* ```
|
|
1677
|
+
*
|
|
1678
|
+
*
|
|
1679
|
+
* and then notify a change on the "foo" property with:
|
|
1680
|
+
*
|
|
1681
|
+
*
|
|
1682
|
+
* ```c
|
|
1683
|
+
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
|
|
1684
|
+
* ```
|
|
1685
|
+
*
|
|
1686
|
+
* @param pspec the #GParamSpec of a property installed on the class of @object.
|
|
1687
|
+
*/
|
|
1688
|
+
notify_by_pspec(pspec: GObject.ParamSpec): void;
|
|
1689
|
+
/**
|
|
1690
|
+
* Increases the reference count of `object`.
|
|
1691
|
+
*
|
|
1692
|
+
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
|
|
1693
|
+
* of `object` will be propagated to the return type (using the GCC typeof()
|
|
1694
|
+
* extension), so any casting the caller needs to do on the return type must be
|
|
1695
|
+
* explicit.
|
|
1696
|
+
* @returns the same @object
|
|
1697
|
+
*/
|
|
1698
|
+
ref(): GObject.Object;
|
|
1699
|
+
/**
|
|
1700
|
+
* Increase the reference count of `object,` and possibly remove the
|
|
1701
|
+
* [floating][floating-ref] reference, if `object` has a floating reference.
|
|
1702
|
+
*
|
|
1703
|
+
* In other words, if the object is floating, then this call "assumes
|
|
1704
|
+
* ownership" of the floating reference, converting it to a normal
|
|
1705
|
+
* reference by clearing the floating flag while leaving the reference
|
|
1706
|
+
* count unchanged. If the object is not floating, then this call
|
|
1707
|
+
* adds a new normal reference increasing the reference count by one.
|
|
1708
|
+
*
|
|
1709
|
+
* Since GLib 2.56, the type of `object` will be propagated to the return type
|
|
1710
|
+
* under the same conditions as for g_object_ref().
|
|
1711
|
+
* @returns @object
|
|
1712
|
+
*/
|
|
1713
|
+
ref_sink(): GObject.Object;
|
|
1714
|
+
/**
|
|
1715
|
+
* Releases all references to other objects. This can be used to break
|
|
1716
|
+
* reference cycles.
|
|
1717
|
+
*
|
|
1718
|
+
* This function should only be called from object system implementations.
|
|
1719
|
+
*/
|
|
1720
|
+
run_dispose(): void;
|
|
1721
|
+
/**
|
|
1722
|
+
* Each object carries around a table of associations from
|
|
1723
|
+
* strings to pointers. This function lets you set an association.
|
|
1724
|
+
*
|
|
1725
|
+
* If the object already had an association with that name,
|
|
1726
|
+
* the old association will be destroyed.
|
|
1727
|
+
*
|
|
1728
|
+
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
|
|
1729
|
+
* This means a copy of `key` is kept permanently (even after `object` has been
|
|
1730
|
+
* finalized) — so it is recommended to only use a small, bounded set of values
|
|
1731
|
+
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
|
|
1732
|
+
* @param key name of the key
|
|
1733
|
+
* @param data data to associate with that key
|
|
1734
|
+
*/
|
|
1735
|
+
set_data(key: string, data?: any | null): void;
|
|
1736
|
+
set_property(property_name: string, value: any): void;
|
|
1737
|
+
/**
|
|
1738
|
+
* Remove a specified datum from the object's data associations,
|
|
1739
|
+
* without invoking the association's destroy handler.
|
|
1740
|
+
* @param key name of the key
|
|
1741
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
1742
|
+
*/
|
|
1743
|
+
steal_data(key: string): any | null;
|
|
1744
|
+
/**
|
|
1745
|
+
* This function gets back user data pointers stored via
|
|
1746
|
+
* g_object_set_qdata() and removes the `data` from object
|
|
1747
|
+
* without invoking its destroy() function (if any was
|
|
1748
|
+
* set).
|
|
1749
|
+
* Usually, calling this function is only required to update
|
|
1750
|
+
* user data pointers with a destroy notifier, for example:
|
|
1751
|
+
*
|
|
1752
|
+
* ```c
|
|
1753
|
+
* void
|
|
1754
|
+
* object_add_to_user_list (GObject *object,
|
|
1755
|
+
* const gchar *new_string)
|
|
1756
|
+
* {
|
|
1757
|
+
* // the quark, naming the object data
|
|
1758
|
+
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
|
|
1759
|
+
* // retrieve the old string list
|
|
1760
|
+
* GList *list = g_object_steal_qdata (object, quark_string_list);
|
|
1761
|
+
*
|
|
1762
|
+
* // prepend new string
|
|
1763
|
+
* list = g_list_prepend (list, g_strdup (new_string));
|
|
1764
|
+
* // this changed 'list', so we need to set it again
|
|
1765
|
+
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
|
|
1766
|
+
* }
|
|
1767
|
+
* static void
|
|
1768
|
+
* free_string_list (gpointer data)
|
|
1769
|
+
* {
|
|
1770
|
+
* GList *node, *list = data;
|
|
1771
|
+
*
|
|
1772
|
+
* for (node = list; node; node = node->next)
|
|
1773
|
+
* g_free (node->data);
|
|
1774
|
+
* g_list_free (list);
|
|
1775
|
+
* }
|
|
1776
|
+
* ```
|
|
1777
|
+
*
|
|
1778
|
+
* Using g_object_get_qdata() in the above example, instead of
|
|
1779
|
+
* g_object_steal_qdata() would have left the destroy function set,
|
|
1780
|
+
* and thus the partial string list would have been freed upon
|
|
1781
|
+
* g_object_set_qdata_full().
|
|
1782
|
+
* @param quark A #GQuark, naming the user data pointer
|
|
1783
|
+
* @returns The user data pointer set, or %NULL
|
|
1784
|
+
*/
|
|
1785
|
+
steal_qdata(quark: GLib.Quark): any | null;
|
|
1786
|
+
/**
|
|
1787
|
+
* Reverts the effect of a previous call to
|
|
1788
|
+
* g_object_freeze_notify(). The freeze count is decreased on `object`
|
|
1789
|
+
* and when it reaches zero, queued "notify" signals are emitted.
|
|
1790
|
+
*
|
|
1791
|
+
* Duplicate notifications for each property are squashed so that at most one
|
|
1792
|
+
* #GObject::notify signal is emitted for each property, in the reverse order
|
|
1793
|
+
* in which they have been queued.
|
|
1794
|
+
*
|
|
1795
|
+
* It is an error to call this function when the freeze count is zero.
|
|
1796
|
+
*/
|
|
1797
|
+
thaw_notify(): void;
|
|
1798
|
+
/**
|
|
1799
|
+
* Decreases the reference count of `object`. When its reference count
|
|
1800
|
+
* drops to 0, the object is finalized (i.e. its memory is freed).
|
|
1801
|
+
*
|
|
1802
|
+
* If the pointer to the #GObject may be reused in future (for example, if it is
|
|
1803
|
+
* an instance variable of another object), it is recommended to clear the
|
|
1804
|
+
* pointer to %NULL rather than retain a dangling pointer to a potentially
|
|
1805
|
+
* invalid #GObject instance. Use g_clear_object() for this.
|
|
1806
|
+
*/
|
|
1807
|
+
unref(): void;
|
|
1808
|
+
/**
|
|
1809
|
+
* This function essentially limits the life time of the `closure` to
|
|
1810
|
+
* the life time of the object. That is, when the object is finalized,
|
|
1811
|
+
* the `closure` is invalidated by calling g_closure_invalidate() on
|
|
1812
|
+
* it, in order to prevent invocations of the closure with a finalized
|
|
1813
|
+
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
|
|
1814
|
+
* added as marshal guards to the `closure,` to ensure that an extra
|
|
1815
|
+
* reference count is held on `object` during invocation of the
|
|
1816
|
+
* `closure`. Usually, this function will be called on closures that
|
|
1817
|
+
* use this `object` as closure data.
|
|
1818
|
+
* @param closure #GClosure to watch
|
|
1819
|
+
*/
|
|
1820
|
+
watch_closure(closure: GObject.Closure): void;
|
|
1821
|
+
vfunc_constructed(): void;
|
|
1822
|
+
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
|
|
1823
|
+
vfunc_dispose(): void;
|
|
1824
|
+
vfunc_finalize(): void;
|
|
1825
|
+
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
|
|
1826
|
+
/**
|
|
1827
|
+
* Emits a "notify" signal for the property `property_name` on `object`.
|
|
1828
|
+
*
|
|
1829
|
+
* When possible, eg. when signaling a property change from within the class
|
|
1830
|
+
* that registered the property, you should use g_object_notify_by_pspec()
|
|
1831
|
+
* instead.
|
|
1832
|
+
*
|
|
1833
|
+
* Note that emission of the notify signal may be blocked with
|
|
1834
|
+
* g_object_freeze_notify(). In this case, the signal emissions are queued
|
|
1835
|
+
* and will be emitted (in reverse order) when g_object_thaw_notify() is
|
|
1836
|
+
* called.
|
|
1837
|
+
* @param pspec
|
|
1838
|
+
*/
|
|
1839
|
+
vfunc_notify(pspec: GObject.ParamSpec): void;
|
|
1840
|
+
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
|
|
1841
|
+
disconnect(id: number): void;
|
|
1842
|
+
set(properties: { [key: string]: any }): void;
|
|
1843
|
+
block_signal_handler(id: number): any;
|
|
1844
|
+
unblock_signal_handler(id: number): any;
|
|
1845
|
+
stop_emission_by_name(detailedName: string): any;
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
module Print {
|
|
1849
|
+
// Constructor properties interface
|
|
1850
|
+
|
|
1851
|
+
interface ConstructorProps extends GObject.InitiallyUnowned.ConstructorProps {
|
|
1852
|
+
description: string;
|
|
1853
|
+
device_id: string;
|
|
1854
|
+
deviceId: string;
|
|
1855
|
+
device_stored: boolean;
|
|
1856
|
+
deviceStored: boolean;
|
|
1857
|
+
driver: string;
|
|
1858
|
+
enroll_date: GLib.Date;
|
|
1859
|
+
enrollDate: GLib.Date;
|
|
1860
|
+
finger: Finger;
|
|
1861
|
+
fpi_data: GLib.Variant;
|
|
1862
|
+
fpiData: GLib.Variant;
|
|
1863
|
+
fpi_prints: any;
|
|
1864
|
+
fpiPrints: any;
|
|
1865
|
+
image: Image;
|
|
1866
|
+
username: string;
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1870
|
+
class Print extends GObject.InitiallyUnowned {
|
|
1871
|
+
static $gtype: GObject.GType<Print>;
|
|
1872
|
+
|
|
1873
|
+
// Own properties of FPrint.Print
|
|
1874
|
+
|
|
1875
|
+
get description(): string;
|
|
1876
|
+
set description(val: string);
|
|
1877
|
+
get device_id(): string;
|
|
1878
|
+
get deviceId(): string;
|
|
1879
|
+
get device_stored(): boolean;
|
|
1880
|
+
get deviceStored(): boolean;
|
|
1881
|
+
get driver(): string;
|
|
1882
|
+
get enroll_date(): GLib.Date;
|
|
1883
|
+
set enroll_date(val: GLib.Date);
|
|
1884
|
+
get enrollDate(): GLib.Date;
|
|
1885
|
+
set enrollDate(val: GLib.Date);
|
|
1886
|
+
get finger(): Finger;
|
|
1887
|
+
set finger(val: Finger);
|
|
1888
|
+
get fpi_data(): GLib.Variant;
|
|
1889
|
+
set fpi_data(val: GLib.Variant);
|
|
1890
|
+
get fpiData(): GLib.Variant;
|
|
1891
|
+
set fpiData(val: GLib.Variant);
|
|
1892
|
+
get fpi_prints(): any;
|
|
1893
|
+
set fpi_prints(val: any);
|
|
1894
|
+
get fpiPrints(): any;
|
|
1895
|
+
set fpiPrints(val: any);
|
|
1896
|
+
get image(): Image;
|
|
1897
|
+
get username(): string;
|
|
1898
|
+
set username(val: string);
|
|
1899
|
+
|
|
1900
|
+
// Constructors of FPrint.Print
|
|
1901
|
+
|
|
1902
|
+
constructor(properties?: Partial<Print.ConstructorProps>, ...args: any[]);
|
|
1903
|
+
|
|
1904
|
+
_init(...args: any[]): void;
|
|
1905
|
+
|
|
1906
|
+
static ['new'](device: Device): Print;
|
|
1907
|
+
|
|
1908
|
+
// Own static methods of FPrint.Print
|
|
1909
|
+
|
|
1910
|
+
/**
|
|
1911
|
+
* Deserialize a print definition from permanent storage.
|
|
1912
|
+
* @param data The binary data
|
|
1913
|
+
*/
|
|
1914
|
+
static deserialize(data: Uint8Array | string): Print;
|
|
1915
|
+
|
|
1916
|
+
// Own methods of FPrint.Print
|
|
1917
|
+
|
|
1918
|
+
/**
|
|
1919
|
+
* Tests whether the prints is compatible with the given device.
|
|
1920
|
+
* @param device A #FpDevice
|
|
1921
|
+
* @returns %TRUE if the print is compatible with the device
|
|
1922
|
+
*/
|
|
1923
|
+
compatible(device: Device): boolean;
|
|
1924
|
+
/**
|
|
1925
|
+
* Tests whether the prints can be considered equal. This only compares the
|
|
1926
|
+
* actual information about the print, not the metadata.
|
|
1927
|
+
* @param other Second #FpPrint
|
|
1928
|
+
* @returns %TRUE if the prints are equal
|
|
1929
|
+
*/
|
|
1930
|
+
equal(other: Print): boolean;
|
|
1931
|
+
/**
|
|
1932
|
+
* Returns the user defined description for the print.
|
|
1933
|
+
* @returns The description
|
|
1934
|
+
*/
|
|
1935
|
+
get_description(): string | null;
|
|
1936
|
+
/**
|
|
1937
|
+
* Returns the device ID that the print was created for.
|
|
1938
|
+
* @returns The device ID
|
|
1939
|
+
*/
|
|
1940
|
+
get_device_id(): string;
|
|
1941
|
+
/**
|
|
1942
|
+
* Whether the print is actually stored on the device and this is
|
|
1943
|
+
* just a handle to use that references the device stored data.
|
|
1944
|
+
* @returns Whether the print is stored on the device
|
|
1945
|
+
*/
|
|
1946
|
+
get_device_stored(): boolean;
|
|
1947
|
+
/**
|
|
1948
|
+
* Returns the driver that the print was created for.
|
|
1949
|
+
* @returns The driver
|
|
1950
|
+
*/
|
|
1951
|
+
get_driver(): string;
|
|
1952
|
+
/**
|
|
1953
|
+
* Returns the user defined enroll date for the print.
|
|
1954
|
+
* @returns The #GDate
|
|
1955
|
+
*/
|
|
1956
|
+
get_enroll_date(): GLib.Date | null;
|
|
1957
|
+
/**
|
|
1958
|
+
* Returns the finger that the print was created for.
|
|
1959
|
+
* @returns The #FpFinger
|
|
1960
|
+
*/
|
|
1961
|
+
get_finger(): Finger;
|
|
1962
|
+
/**
|
|
1963
|
+
* Returns the image that the print was created from, or %NULL
|
|
1964
|
+
* @returns The #FpImage
|
|
1965
|
+
*/
|
|
1966
|
+
get_image(): Image | null;
|
|
1967
|
+
/**
|
|
1968
|
+
* Returns the user defined username for the print.
|
|
1969
|
+
* @returns The username
|
|
1970
|
+
*/
|
|
1971
|
+
get_username(): string | null;
|
|
1972
|
+
/**
|
|
1973
|
+
* Serialize a print definition for permanent storage. Note that this is
|
|
1974
|
+
* lossy in the sense that e.g. the image data is discarded.
|
|
1975
|
+
* @returns %TRUE on success
|
|
1976
|
+
*/
|
|
1977
|
+
serialize(): Uint8Array;
|
|
1978
|
+
/**
|
|
1979
|
+
* Set the description for the print.
|
|
1980
|
+
* @param description The new description
|
|
1981
|
+
*/
|
|
1982
|
+
set_description(description: string): void;
|
|
1983
|
+
/**
|
|
1984
|
+
* Set the enroll date for the print.
|
|
1985
|
+
* @param enroll_date The new enroll date
|
|
1986
|
+
*/
|
|
1987
|
+
set_enroll_date(enroll_date: GLib.Date): void;
|
|
1988
|
+
/**
|
|
1989
|
+
* Set the finger that the print is for.
|
|
1990
|
+
* @param finger The #FpFinger
|
|
1991
|
+
*/
|
|
1992
|
+
set_finger(finger: Finger): void;
|
|
1993
|
+
/**
|
|
1994
|
+
* Set the username for the print.
|
|
1995
|
+
* @param username The new username
|
|
1996
|
+
*/
|
|
1997
|
+
set_username(username: string): void;
|
|
1998
|
+
}
|
|
1999
|
+
|
|
2000
|
+
type ContextClass = typeof Context;
|
|
2001
|
+
type DeviceClass = typeof Device;
|
|
2002
|
+
type ImageClass = typeof Image;
|
|
2003
|
+
type ImageDeviceClass = typeof ImageDevice;
|
|
2004
|
+
abstract class Minutia {
|
|
2005
|
+
static $gtype: GObject.GType<Minutia>;
|
|
2006
|
+
|
|
2007
|
+
// Constructors of FPrint.Minutia
|
|
2008
|
+
|
|
2009
|
+
_init(...args: any[]): void;
|
|
2010
|
+
|
|
2011
|
+
// Own methods of FPrint.Minutia
|
|
2012
|
+
|
|
2013
|
+
/**
|
|
2014
|
+
* Returns the coordinates of the found minutia. This is only useful for
|
|
2015
|
+
* debugging purposes and the API is not considered stable for production.
|
|
2016
|
+
*/
|
|
2017
|
+
get_coords(): [number, number];
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
type PrintClass = typeof Print;
|
|
2021
|
+
/**
|
|
2022
|
+
* Name of the imported GIR library
|
|
2023
|
+
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
|
|
2024
|
+
*/
|
|
2025
|
+
const __name__: string;
|
|
2026
|
+
/**
|
|
2027
|
+
* Version of the imported GIR library
|
|
2028
|
+
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
|
|
2029
|
+
*/
|
|
2030
|
+
const __version__: string;
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
export default FPrint;
|
|
2034
|
+
// END
|