virtual-device: Move shared functions into the internal scope
We are currently exporting such functions in the library, even though they are meant to be only private.
This commit is contained in:
parent
e4a297887b
commit
8fd1fcbe49
4 changed files with 143 additions and 143 deletions
|
@ -28,35 +28,35 @@
|
|||
|
||||
#include "virtual-device-private.h"
|
||||
|
||||
struct _FpDeviceVirtualListener
|
||||
struct _FpiDeviceVirtualListener
|
||||
{
|
||||
GSocketListener parent_instance;
|
||||
GSocketListener parent_instance;
|
||||
|
||||
GSocketConnection *connection;
|
||||
GCancellable *cancellable;
|
||||
guint cancellable_id;
|
||||
GSocketConnection *connection;
|
||||
GCancellable *cancellable;
|
||||
guint cancellable_id;
|
||||
|
||||
FpDeviceVirtualListenerConnectionCb ready_cb;
|
||||
gpointer ready_cb_data;
|
||||
FpiDeviceVirtualListenerConnectionCb ready_cb;
|
||||
gpointer ready_cb_data;
|
||||
|
||||
gint socket_fd;
|
||||
gint client_fd;
|
||||
gint socket_fd;
|
||||
gint client_fd;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (FpDeviceVirtualListener, fp_device_virtual_listener, G_TYPE_SOCKET_LISTENER)
|
||||
G_DEFINE_TYPE (FpiDeviceVirtualListener, fpi_device_virtual_listener, G_TYPE_SOCKET_LISTENER)
|
||||
|
||||
static void start_listen (FpDeviceVirtualListener *self);
|
||||
static void start_listen (FpiDeviceVirtualListener *self);
|
||||
|
||||
FpDeviceVirtualListener *
|
||||
fp_device_virtual_listener_new (void)
|
||||
FpiDeviceVirtualListener *
|
||||
fpi_device_virtual_listener_new (void)
|
||||
{
|
||||
return g_object_new (fp_device_virtual_listener_get_type (), NULL);
|
||||
return g_object_new (fpi_device_virtual_listener_get_type (), NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
fp_device_virtual_listener_dispose (GObject *object)
|
||||
fpi_device_virtual_listener_dispose (GObject *object)
|
||||
{
|
||||
FpDeviceVirtualListener *self = FP_DEVICE_VIRTUAL_LISTENER (object);
|
||||
FpiDeviceVirtualListener *self = FPI_DEVICE_VIRTUAL_LISTENER (object);
|
||||
|
||||
if (self->cancellable_id)
|
||||
{
|
||||
|
@ -70,19 +70,19 @@ fp_device_virtual_listener_dispose (GObject *object)
|
|||
|
||||
self->ready_cb = NULL;
|
||||
|
||||
G_OBJECT_CLASS (fp_device_virtual_listener_parent_class)->dispose (object);
|
||||
G_OBJECT_CLASS (fpi_device_virtual_listener_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
fp_device_virtual_listener_class_init (FpDeviceVirtualListenerClass *klass)
|
||||
fpi_device_virtual_listener_class_init (FpiDeviceVirtualListenerClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->dispose = fp_device_virtual_listener_dispose;
|
||||
object_class->dispose = fpi_device_virtual_listener_dispose;
|
||||
}
|
||||
|
||||
static void
|
||||
fp_device_virtual_listener_init (FpDeviceVirtualListener *self)
|
||||
fpi_device_virtual_listener_init (FpiDeviceVirtualListener *self)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ static void
|
|||
new_connection_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
FpDeviceVirtualListener *self = user_data;
|
||||
FpiDeviceVirtualListener *self = user_data;
|
||||
GSocketConnection *connection;
|
||||
|
||||
connection = g_socket_listener_accept_finish (G_SOCKET_LISTENER (source_object),
|
||||
|
@ -123,7 +123,7 @@ new_connection_cb (GObject *source_object, GAsyncResult *res, gpointer user_data
|
|||
}
|
||||
|
||||
static void
|
||||
start_listen (FpDeviceVirtualListener *self)
|
||||
start_listen (FpiDeviceVirtualListener *self)
|
||||
{
|
||||
g_socket_listener_accept_async (G_SOCKET_LISTENER (self),
|
||||
self->cancellable,
|
||||
|
@ -132,27 +132,27 @@ start_listen (FpDeviceVirtualListener *self)
|
|||
}
|
||||
|
||||
static void
|
||||
on_cancelled (GCancellable *cancellable,
|
||||
FpDeviceVirtualListener *self)
|
||||
on_cancelled (GCancellable *cancellable,
|
||||
FpiDeviceVirtualListener *self)
|
||||
{
|
||||
fp_device_virtual_listener_connection_close (self);
|
||||
fpi_device_virtual_listener_connection_close (self);
|
||||
g_socket_listener_close (G_SOCKET_LISTENER (self));
|
||||
g_clear_object (&self->cancellable);
|
||||
self->ready_cb = NULL;
|
||||
}
|
||||
|
||||
gboolean
|
||||
fp_device_virtual_listener_start (FpDeviceVirtualListener *self,
|
||||
const char *address,
|
||||
GCancellable *cancellable,
|
||||
FpDeviceVirtualListenerConnectionCb cb,
|
||||
gpointer user_data,
|
||||
GError **error)
|
||||
fpi_device_virtual_listener_start (FpiDeviceVirtualListener *self,
|
||||
const char *address,
|
||||
GCancellable *cancellable,
|
||||
FpiDeviceVirtualListenerConnectionCb cb,
|
||||
gpointer user_data,
|
||||
GError **error)
|
||||
{
|
||||
g_autoptr(GSocketAddress) addr = NULL;
|
||||
G_DEBUG_HERE ();
|
||||
|
||||
g_return_val_if_fail (FP_IS_DEVICE_VIRTUAL_LISTENER (self), FALSE);
|
||||
g_return_val_if_fail (FPI_IS_DEVICE_VIRTUAL_LISTENER (self), FALSE);
|
||||
g_return_val_if_fail (cb != NULL, FALSE);
|
||||
g_return_val_if_fail (self->ready_cb == NULL, FALSE);
|
||||
|
||||
|
@ -191,9 +191,9 @@ fp_device_virtual_listener_start (FpDeviceVirtualListener *self,
|
|||
}
|
||||
|
||||
gboolean
|
||||
fp_device_virtual_listener_connection_close (FpDeviceVirtualListener *self)
|
||||
fpi_device_virtual_listener_connection_close (FpiDeviceVirtualListener *self)
|
||||
{
|
||||
g_return_val_if_fail (FP_IS_DEVICE_VIRTUAL_LISTENER (self), FALSE);
|
||||
g_return_val_if_fail (FPI_IS_DEVICE_VIRTUAL_LISTENER (self), FALSE);
|
||||
|
||||
if (!self->connection)
|
||||
return FALSE;
|
||||
|
@ -211,7 +211,7 @@ on_stream_read_cb (GObject *source_object,
|
|||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(GTask) task = user_data;
|
||||
FpDeviceVirtualListener *self = g_task_get_source_object (task);
|
||||
FpiDeviceVirtualListener *self = g_task_get_source_object (task);
|
||||
gboolean all;
|
||||
gboolean success;
|
||||
gsize bytes;
|
||||
|
@ -282,17 +282,17 @@ on_stream_read_cb (GObject *source_object,
|
|||
}
|
||||
|
||||
void
|
||||
fp_device_virtual_listener_read (FpDeviceVirtualListener *self,
|
||||
gboolean all,
|
||||
void *buffer,
|
||||
gsize count,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
fpi_device_virtual_listener_read (FpiDeviceVirtualListener *self,
|
||||
gboolean all,
|
||||
void *buffer,
|
||||
gsize count,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_autoptr(GTask) task = NULL;
|
||||
GInputStream *stream;
|
||||
|
||||
g_return_if_fail (FP_IS_DEVICE_VIRTUAL_LISTENER (self));
|
||||
g_return_if_fail (FPI_IS_DEVICE_VIRTUAL_LISTENER (self));
|
||||
|
||||
task = g_task_new (self, self->cancellable, callback, user_data);
|
||||
g_object_set_data (G_OBJECT (task), "all", GINT_TO_POINTER (all));
|
||||
|
@ -324,9 +324,9 @@ fp_device_virtual_listener_read (FpDeviceVirtualListener *self,
|
|||
}
|
||||
|
||||
gsize
|
||||
fp_device_virtual_listener_read_finish (FpDeviceVirtualListener *self,
|
||||
GAsyncResult *result,
|
||||
GError **error)
|
||||
fpi_device_virtual_listener_read_finish (FpiDeviceVirtualListener *self,
|
||||
GAsyncResult *result,
|
||||
GError **error)
|
||||
{
|
||||
g_return_val_if_fail (g_task_is_valid (result, self), 0);
|
||||
|
||||
|
@ -334,10 +334,10 @@ fp_device_virtual_listener_read_finish (FpDeviceVirtualListener *self,
|
|||
}
|
||||
|
||||
gboolean
|
||||
fp_device_virtual_listener_write_sync (FpDeviceVirtualListener *self,
|
||||
const char *buffer,
|
||||
gsize count,
|
||||
GError **error)
|
||||
fpi_device_virtual_listener_write_sync (FpiDeviceVirtualListener *self,
|
||||
const char *buffer,
|
||||
gsize count,
|
||||
GError **error)
|
||||
{
|
||||
if (!self->connection || g_io_stream_is_closed (G_IO_STREAM (self->connection)))
|
||||
{
|
||||
|
|
|
@ -32,59 +32,59 @@
|
|||
|
||||
#define MAX_LINE_LEN 1024
|
||||
|
||||
G_DECLARE_FINAL_TYPE (FpDeviceVirtualListener, fp_device_virtual_listener, FP, DEVICE_VIRTUAL_LISTENER, GSocketListener)
|
||||
G_DECLARE_FINAL_TYPE (FpiDeviceVirtualListener, fpi_device_virtual_listener, FPI, DEVICE_VIRTUAL_LISTENER, GSocketListener)
|
||||
|
||||
typedef void (*FpDeviceVirtualListenerConnectionCb) (FpDeviceVirtualListener *listener,
|
||||
gpointer user_data);
|
||||
typedef void (*FpiDeviceVirtualListenerConnectionCb) (FpiDeviceVirtualListener *listener,
|
||||
gpointer user_data);
|
||||
|
||||
FpDeviceVirtualListener * fp_device_virtual_listener_new (void);
|
||||
FpiDeviceVirtualListener * fpi_device_virtual_listener_new (void);
|
||||
|
||||
gboolean fp_device_virtual_listener_start (FpDeviceVirtualListener *listener,
|
||||
const char *address,
|
||||
GCancellable *cancellable,
|
||||
FpDeviceVirtualListenerConnectionCb cb,
|
||||
gpointer user_data,
|
||||
GError **error);
|
||||
gboolean fpi_device_virtual_listener_start (FpiDeviceVirtualListener *listener,
|
||||
const char *address,
|
||||
GCancellable *cancellable,
|
||||
FpiDeviceVirtualListenerConnectionCb cb,
|
||||
gpointer user_data,
|
||||
GError **error);
|
||||
|
||||
gboolean fp_device_virtual_listener_connection_close (FpDeviceVirtualListener *listener);
|
||||
gboolean fpi_device_virtual_listener_connection_close (FpiDeviceVirtualListener *listener);
|
||||
|
||||
void fp_device_virtual_listener_read (FpDeviceVirtualListener *listener,
|
||||
gboolean all,
|
||||
void *buffer,
|
||||
gsize count,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gsize fp_device_virtual_listener_read_finish (FpDeviceVirtualListener *listener,
|
||||
GAsyncResult *result,
|
||||
GError **error);
|
||||
void fpi_device_virtual_listener_read (FpiDeviceVirtualListener *listener,
|
||||
gboolean all,
|
||||
void *buffer,
|
||||
gsize count,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gsize fpi_device_virtual_listener_read_finish (FpiDeviceVirtualListener *listener,
|
||||
GAsyncResult *result,
|
||||
GError **error);
|
||||
|
||||
gboolean fp_device_virtual_listener_write_sync (FpDeviceVirtualListener *self,
|
||||
const char *buffer,
|
||||
gsize count,
|
||||
GError **error);
|
||||
gboolean fpi_device_virtual_listener_write_sync (FpiDeviceVirtualListener *self,
|
||||
const char *buffer,
|
||||
gsize count,
|
||||
GError **error);
|
||||
|
||||
|
||||
struct _FpDeviceVirtualDevice
|
||||
{
|
||||
FpDevice parent;
|
||||
FpDevice parent;
|
||||
|
||||
FpDeviceVirtualListener *listener;
|
||||
GCancellable *cancellable;
|
||||
FpiDeviceVirtualListener *listener;
|
||||
GCancellable *cancellable;
|
||||
|
||||
char recv_buf[MAX_LINE_LEN];
|
||||
char recv_buf[MAX_LINE_LEN];
|
||||
|
||||
GPtrArray *pending_commands;
|
||||
GPtrArray *pending_commands;
|
||||
|
||||
GHashTable *prints_storage;
|
||||
GHashTable *prints_storage;
|
||||
|
||||
guint wait_command_id;
|
||||
guint sleep_timeout_id;
|
||||
guint enroll_stages_passed;
|
||||
gboolean match_reported;
|
||||
gboolean supports_cancellation;
|
||||
gboolean injected_synthetic_cmd;
|
||||
gboolean ignore_wait;
|
||||
gboolean keep_alive;
|
||||
guint wait_command_id;
|
||||
guint sleep_timeout_id;
|
||||
guint enroll_stages_passed;
|
||||
gboolean match_reported;
|
||||
gboolean supports_cancellation;
|
||||
gboolean injected_synthetic_cmd;
|
||||
gboolean ignore_wait;
|
||||
gboolean keep_alive;
|
||||
};
|
||||
|
||||
/* Not really final here, but we can do this to share the FpDeviceVirtualDevice
|
||||
|
|
|
@ -217,10 +217,10 @@ process_cmds (FpDeviceVirtualDevice * self,
|
|||
static void
|
||||
write_key_to_listener (void *key, void *val, void *user_data)
|
||||
{
|
||||
FpDeviceVirtualListener *listener = FP_DEVICE_VIRTUAL_LISTENER (user_data);
|
||||
FpiDeviceVirtualListener *listener = FPI_DEVICE_VIRTUAL_LISTENER (user_data);
|
||||
|
||||
if (!fp_device_virtual_listener_write_sync (listener, key, strlen (key), NULL) ||
|
||||
!fp_device_virtual_listener_write_sync (listener, "\n", 1, NULL))
|
||||
if (!fpi_device_virtual_listener_write_sync (listener, key, strlen (key), NULL) ||
|
||||
!fpi_device_virtual_listener_write_sync (listener, "\n", 1, NULL))
|
||||
g_warning ("Error writing reply to LIST command");
|
||||
}
|
||||
|
||||
|
@ -230,10 +230,10 @@ recv_instruction_cb (GObject *source_object,
|
|||
gpointer user_data)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
FpDeviceVirtualListener *listener = FP_DEVICE_VIRTUAL_LISTENER (source_object);
|
||||
FpiDeviceVirtualListener *listener = FPI_DEVICE_VIRTUAL_LISTENER (source_object);
|
||||
gsize bytes;
|
||||
|
||||
bytes = fp_device_virtual_listener_read_finish (listener, res, &error);
|
||||
bytes = fpi_device_virtual_listener_read_finish (listener, res, &error);
|
||||
fp_dbg ("Got instructions of length %ld", bytes);
|
||||
|
||||
if (error)
|
||||
|
@ -306,23 +306,23 @@ recv_instruction_cb (GObject *source_object,
|
|||
}
|
||||
}
|
||||
|
||||
fp_device_virtual_listener_connection_close (listener);
|
||||
fpi_device_virtual_listener_connection_close (listener);
|
||||
}
|
||||
|
||||
static void
|
||||
recv_instruction (FpDeviceVirtualDevice *self)
|
||||
{
|
||||
fp_device_virtual_listener_read (self->listener,
|
||||
FALSE,
|
||||
self->recv_buf,
|
||||
sizeof (self->recv_buf),
|
||||
recv_instruction_cb,
|
||||
self);
|
||||
fpi_device_virtual_listener_read (self->listener,
|
||||
FALSE,
|
||||
self->recv_buf,
|
||||
sizeof (self->recv_buf),
|
||||
recv_instruction_cb,
|
||||
self);
|
||||
}
|
||||
|
||||
static void
|
||||
on_listener_connected (FpDeviceVirtualListener *listener,
|
||||
gpointer user_data)
|
||||
on_listener_connected (FpiDeviceVirtualListener *listener,
|
||||
gpointer user_data)
|
||||
{
|
||||
FpDeviceVirtualDevice *self = FP_DEVICE_VIRTUAL_DEVICE (user_data);
|
||||
|
||||
|
@ -334,7 +334,7 @@ dev_init (FpDevice *dev)
|
|||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(GCancellable) cancellable = NULL;
|
||||
g_autoptr(FpDeviceVirtualListener) listener = NULL;
|
||||
g_autoptr(FpiDeviceVirtualListener) listener = NULL;
|
||||
FpDeviceVirtualDevice *self = FP_DEVICE_VIRTUAL_DEVICE (dev);
|
||||
|
||||
G_DEBUG_HERE ();
|
||||
|
@ -355,15 +355,15 @@ dev_init (FpDevice *dev)
|
|||
return;
|
||||
}
|
||||
|
||||
listener = fp_device_virtual_listener_new ();
|
||||
listener = fpi_device_virtual_listener_new ();
|
||||
cancellable = g_cancellable_new ();
|
||||
|
||||
if (!fp_device_virtual_listener_start (listener,
|
||||
fpi_device_get_virtual_env (FP_DEVICE (self)),
|
||||
cancellable,
|
||||
on_listener_connected,
|
||||
self,
|
||||
&error))
|
||||
if (!fpi_device_virtual_listener_start (listener,
|
||||
fpi_device_get_virtual_env (FP_DEVICE (self)),
|
||||
cancellable,
|
||||
on_listener_connected,
|
||||
self,
|
||||
&error))
|
||||
{
|
||||
fpi_device_open_complete (dev, g_steal_pointer (&error));
|
||||
return;
|
||||
|
|
|
@ -36,14 +36,14 @@
|
|||
|
||||
struct _FpDeviceVirtualImage
|
||||
{
|
||||
FpImageDevice parent;
|
||||
FpImageDevice parent;
|
||||
|
||||
FpDeviceVirtualListener *listener;
|
||||
GCancellable *cancellable;
|
||||
FpiDeviceVirtualListener *listener;
|
||||
GCancellable *cancellable;
|
||||
|
||||
gboolean automatic_finger;
|
||||
FpImage *recv_img;
|
||||
gint recv_img_hdr[2];
|
||||
gboolean automatic_finger;
|
||||
FpImage *recv_img;
|
||||
gint recv_img_hdr[2];
|
||||
};
|
||||
|
||||
G_DECLARE_FINAL_TYPE (FpDeviceVirtualImage, fpi_device_virtual_image, FPI, DEVICE_VIRTUAL_IMAGE, FpImageDevice)
|
||||
|
@ -57,12 +57,12 @@ recv_image_img_recv_cb (GObject *source_object,
|
|||
gpointer user_data)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
FpDeviceVirtualListener *listener = FP_DEVICE_VIRTUAL_LISTENER (source_object);
|
||||
FpiDeviceVirtualListener *listener = FPI_DEVICE_VIRTUAL_LISTENER (source_object);
|
||||
FpDeviceVirtualImage *self;
|
||||
FpImageDevice *device;
|
||||
gsize bytes;
|
||||
|
||||
bytes = fp_device_virtual_listener_read_finish (listener, res, &error);
|
||||
bytes = fpi_device_virtual_listener_read_finish (listener, res, &error);
|
||||
|
||||
if (!bytes || g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) ||
|
||||
g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CONNECTION_CLOSED))
|
||||
|
@ -88,10 +88,10 @@ recv_image_hdr_recv_cb (GObject *source_object,
|
|||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
FpDeviceVirtualImage *self;
|
||||
FpDeviceVirtualListener *listener = FP_DEVICE_VIRTUAL_LISTENER (source_object);
|
||||
FpiDeviceVirtualListener *listener = FPI_DEVICE_VIRTUAL_LISTENER (source_object);
|
||||
gsize bytes;
|
||||
|
||||
bytes = fp_device_virtual_listener_read_finish (listener, res, &error);
|
||||
bytes = fpi_device_virtual_listener_read_finish (listener, res, &error);
|
||||
|
||||
if (error)
|
||||
{
|
||||
|
@ -111,7 +111,7 @@ recv_image_hdr_recv_cb (GObject *source_object,
|
|||
if (self->recv_img_hdr[0] > 5000 || self->recv_img_hdr[1] > 5000)
|
||||
{
|
||||
g_warning ("Image header suggests an unrealistically large image, disconnecting client.");
|
||||
fp_device_virtual_listener_connection_close (listener);
|
||||
fpi_device_virtual_listener_connection_close (listener);
|
||||
}
|
||||
|
||||
if (self->recv_img_hdr[0] < 0 || self->recv_img_hdr[1] < 0)
|
||||
|
@ -147,7 +147,7 @@ recv_image_hdr_recv_cb (GObject *source_object,
|
|||
|
||||
default:
|
||||
/* disconnect client, it didn't play fair */
|
||||
fp_device_virtual_listener_connection_close (listener);
|
||||
fpi_device_virtual_listener_connection_close (listener);
|
||||
}
|
||||
|
||||
/* And, listen for more images from the same client. */
|
||||
|
@ -157,28 +157,28 @@ recv_image_hdr_recv_cb (GObject *source_object,
|
|||
|
||||
self->recv_img = fp_image_new (self->recv_img_hdr[0], self->recv_img_hdr[1]);
|
||||
g_debug ("image data: %p", self->recv_img->data);
|
||||
fp_device_virtual_listener_read (listener,
|
||||
TRUE,
|
||||
(guint8 *) self->recv_img->data,
|
||||
self->recv_img->width * self->recv_img->height,
|
||||
recv_image_img_recv_cb,
|
||||
self);
|
||||
fpi_device_virtual_listener_read (listener,
|
||||
TRUE,
|
||||
(guint8 *) self->recv_img->data,
|
||||
self->recv_img->width * self->recv_img->height,
|
||||
recv_image_img_recv_cb,
|
||||
self);
|
||||
}
|
||||
|
||||
static void
|
||||
recv_image (FpDeviceVirtualImage *self)
|
||||
{
|
||||
fp_device_virtual_listener_read (self->listener,
|
||||
TRUE,
|
||||
self->recv_img_hdr,
|
||||
sizeof (self->recv_img_hdr),
|
||||
recv_image_hdr_recv_cb,
|
||||
self);
|
||||
fpi_device_virtual_listener_read (self->listener,
|
||||
TRUE,
|
||||
self->recv_img_hdr,
|
||||
sizeof (self->recv_img_hdr),
|
||||
recv_image_hdr_recv_cb,
|
||||
self);
|
||||
}
|
||||
|
||||
static void
|
||||
on_listener_connected (FpDeviceVirtualListener *listener,
|
||||
gpointer user_data)
|
||||
on_listener_connected (FpiDeviceVirtualListener *listener,
|
||||
gpointer user_data)
|
||||
{
|
||||
FpDeviceVirtualImage *self = FPI_DEVICE_VIRTUAL_IMAGE (user_data);
|
||||
FpiImageDeviceState state;
|
||||
|
@ -206,21 +206,21 @@ static void
|
|||
dev_init (FpImageDevice *dev)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(FpDeviceVirtualListener) listener = NULL;
|
||||
g_autoptr(FpiDeviceVirtualListener) listener = NULL;
|
||||
g_autoptr(GCancellable) cancellable = NULL;
|
||||
FpDeviceVirtualImage *self = FPI_DEVICE_VIRTUAL_IMAGE (dev);
|
||||
|
||||
G_DEBUG_HERE ();
|
||||
|
||||
listener = fp_device_virtual_listener_new ();
|
||||
listener = fpi_device_virtual_listener_new ();
|
||||
cancellable = g_cancellable_new ();
|
||||
|
||||
if (!fp_device_virtual_listener_start (listener,
|
||||
fpi_device_get_virtual_env (FP_DEVICE (self)),
|
||||
cancellable,
|
||||
on_listener_connected,
|
||||
self,
|
||||
&error))
|
||||
if (!fpi_device_virtual_listener_start (listener,
|
||||
fpi_device_get_virtual_env (FP_DEVICE (self)),
|
||||
cancellable,
|
||||
on_listener_connected,
|
||||
self,
|
||||
&error))
|
||||
{
|
||||
fpi_image_device_open_complete (dev, g_steal_pointer (&error));
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue