static void verify_cb(struct fp_dev *dev, int result, struct fp_img *img, void *user_data) { GtkWidget *dialog; int r; destroy_scan_finger_dialog(GTK_WIDGET(user_data)); vwin_vfy_status_verify_result(result); fp_img_free(img_normal); img_normal = NULL; fp_img_free(img_bin); img_bin = NULL; if (img) { img_normal = img; img_bin = fp_img_binarize(img); vwin_img_draw(); } dialog = run_please_wait_dialog("Ending verification..."); r = fp_async_verify_stop(dev, verify_stopped_cb, dialog); if (r < 0) gtk_widget_destroy(dialog); }
static void scan_finger_response(GtkWidget *dialog, gint arg, gpointer user_data) { int r; destroy_scan_finger_dialog(dialog); dialog = run_please_wait_dialog("Ending verification..."); r = fp_async_verify_stop(fpdev, verify_stopped_cb, dialog); if (r < 0) gtk_widget_destroy(dialog); }
static void _fprint_device_client_vanished (GDBusConnection *connection, const char *name, FprintDevice *rdev) { FprintDevicePrivate *priv = DEVICE_GET_PRIVATE(rdev); /* Was that the client that claimed the device? */ if (g_strcmp0 (priv->sender, name) == 0) { gboolean done = FALSE; switch (priv->current_action) { case ACTION_NONE: break; case ACTION_IDENTIFY: fp_async_identify_stop(priv->dev, action_stop_cb, &done); while (done == FALSE) g_main_context_iteration (NULL, TRUE); break; case ACTION_VERIFY: fp_async_verify_stop(priv->dev, action_stop_cb, &done); while (done == FALSE) g_main_context_iteration (NULL, TRUE); break; case ACTION_ENROLL: fp_async_enroll_stop(priv->dev, action_stop_cb, &done); while (done == FALSE) g_main_context_iteration (NULL, TRUE); break; } priv->current_action = ACTION_NONE; done = FALSE; /* Close the claimed device as well */ fp_async_dev_close (priv->dev, action_stop_cb, &done); while (done == FALSE) g_main_context_iteration (NULL, TRUE); g_free (priv->sender); priv->sender = NULL; g_free (priv->username); priv->username = NULL; } g_hash_table_remove (priv->clients, name); if (g_hash_table_size (priv->clients) == 0) { g_object_notify (G_OBJECT (rdev), "in-use"); } }