Blame SOURCES/0153-Prefix-internal-properties-signals-with-fpi-and-anno.patch

73b847
From 56edf22163089dba9314e4dd48449829a1110b40 Mon Sep 17 00:00:00 2001
73b847
From: Benjamin Berg <bberg@redhat.com>
73b847
Date: Wed, 18 Dec 2019 12:03:42 +0100
73b847
Subject: [PATCH 153/181] Prefix internal properties/signals with fpi- and
73b847
 annotate them
73b847
73b847
We prefixed them with fp- which is not as obvious as fpi-. Also,
73b847
explicitly mark them as private and to be skipped in the GObject
73b847
Introspection annotatinos.
73b847
73b847
Warning: FPrint: (Signal)fp-image-device-state-changed: argument object: Unresolved type: 'FpiImageDeviceState'
73b847
---
73b847
 libfprint/drivers/synaptics/synaptics.c |  8 +++----
73b847
 libfprint/drivers/upekts.c              |  4 ++--
73b847
 libfprint/fp-context.c                  |  8 +++----
73b847
 libfprint/fp-device.c                   | 29 +++++++++++++++++++++----
73b847
 libfprint/fp-image-device.c             | 20 +++++++++++++++--
73b847
 libfprint/fp-print.c                    | 22 +++++++++++++++----
73b847
 libfprint/fpi-image-device.c            | 12 +++++-----
73b847
 libfprint/fpi-print.c                   |  2 +-
73b847
 tests/test-fpi-device.c                 |  6 ++---
73b847
 9 files changed, 81 insertions(+), 30 deletions(-)
73b847
73b847
diff --git a/libfprint/drivers/synaptics/synaptics.c b/libfprint/drivers/synaptics/synaptics.c
73b847
index af4a2fd..2aac75e 100644
73b847
--- a/libfprint/drivers/synaptics/synaptics.c
73b847
+++ b/libfprint/drivers/synaptics/synaptics.c
73b847
@@ -519,7 +519,7 @@ list_msg_cb (FpiDeviceSynaptics *self,
73b847
 
73b847
           fpi_print_set_type (print, FPI_PRINT_RAW);
73b847
           fpi_print_set_device_stored (print, TRUE);
73b847
-          g_object_set (print, "fp-data", data, NULL);
73b847
+          g_object_set (print, "fpi-data", data, NULL);
73b847
           g_object_set (print, "description", get_enroll_templates_resp->templates[n].user_id, NULL);
73b847
 
73b847
           /* The format has 24 bytes at the start and some dashes in the right places */
73b847
@@ -670,7 +670,7 @@ verify (FpDevice *device)
73b847
 
73b847
   fpi_device_get_verify_data (device, &print);
73b847
 
73b847
-  g_object_get (print, "fp-data", &data, NULL);
73b847
+  g_object_get (print, "fpi-data", &data, NULL);
73b847
   g_debug ("data is %p", data);
73b847
   if (!parse_print_data (data, &finger, &user_id, &user_id_len))
73b847
     {
73b847
@@ -858,7 +858,7 @@ enroll (FpDevice *device)
73b847
 
73b847
   fpi_print_set_type (print, FPI_PRINT_RAW);
73b847
   fpi_print_set_device_stored (print, TRUE);
73b847
-  g_object_set (print, "fp-data", data, NULL);
73b847
+  g_object_set (print, "fpi-data", data, NULL);
73b847
   g_object_set (print, "description", user_id, NULL);
73b847
 
73b847
   g_debug ("user_id: %s, finger: %d", user_id, finger);
73b847
@@ -927,7 +927,7 @@ delete_print (FpDevice *device)
73b847
 
73b847
   fpi_device_get_delete_data (device, &print);
73b847
 
73b847
-  g_object_get (print, "fp-data", &data, NULL);
73b847
+  g_object_get (print, "fpi-data", &data, NULL);
73b847
   g_debug ("data is %p", data);
73b847
   if (!parse_print_data (data, &finger, &user_id, &user_id_len))
73b847
     {
73b847
diff --git a/libfprint/drivers/upekts.c b/libfprint/drivers/upekts.c
73b847
index 6ce8136..16534d3 100644
73b847
--- a/libfprint/drivers/upekts.c
73b847
+++ b/libfprint/drivers/upekts.c
73b847
@@ -1126,7 +1126,7 @@ e_handle_resp02 (FpDevice *dev, unsigned char *data,
73b847
                                            data_len - sizeof (scan_comp),
73b847
                                            1);
73b847
 
73b847
-      g_object_set (print, "fp-data", fp_data, NULL);
73b847
+      g_object_set (print, "fpi-data", fp_data, NULL);
73b847
       g_object_ref (print);
73b847
     }
73b847
 
73b847
@@ -1293,7 +1293,7 @@ verify_start_sm_run_state (FpiSsm *ssm, FpDevice *dev)
73b847
 
73b847
     case VERIFY_INIT:
73b847
       fpi_device_get_verify_data (dev, &print);
73b847
-      g_object_get (dev, "fp-data", &fp_data, NULL);
73b847
+      g_object_get (dev, "fpi-data", &fp_data, NULL);
73b847
 
73b847
       data = g_variant_get_fixed_array (fp_data, &data_len, 1);
73b847
 
73b847
diff --git a/libfprint/fp-context.c b/libfprint/fp-context.c
73b847
index f64968d..0e7c17f 100644
73b847
--- a/libfprint/fp-context.c
73b847
+++ b/libfprint/fp-context.c
73b847
@@ -170,8 +170,8 @@ usb_device_added_cb (FpContext *self, GUsbDevice *device, GUsbContext *usb_ctx)
73b847
                               priv->cancellable,
73b847
                               async_device_init_done_cb,
73b847
                               self,
73b847
-                              "fp-usb-device", device,
73b847
-                              "fp-driver-data", found_entry->driver_data,
73b847
+                              "fpi-usb-device", device,
73b847
+                              "fpi-driver-data", found_entry->driver_data,
73b847
                               NULL);
73b847
 }
73b847
 
73b847
@@ -373,8 +373,8 @@ fp_context_enumerate (FpContext *context)
73b847
                                       priv->cancellable,
73b847
                                       async_device_init_done_cb,
73b847
                                       context,
73b847
-                                      "fp-environ", val,
73b847
-                                      "fp-driver-data", entry->driver_data,
73b847
+                                      "fpi-environ", val,
73b847
+                                      "fpi-driver-data", entry->driver_data,
73b847
                                       NULL);
73b847
           g_debug ("created");
73b847
         }
73b847
diff --git a/libfprint/fp-device.c b/libfprint/fp-device.c
73b847
index 8041a86..116f9f8 100644
73b847
--- a/libfprint/fp-device.c
73b847
+++ b/libfprint/fp-device.c
73b847
@@ -342,22 +342,43 @@ fp_device_class_init (FpDeviceClass *klass)
73b847
                           "Wether the device is open or not", FALSE,
73b847
                           G_PARAM_STATIC_STRINGS | G_PARAM_READABLE);
73b847
 
73b847
+  /**
73b847
+   * FpDevice::fpi-environ: (skip)
73b847
+   *
73b847
+   * This property is only for internal purposes.
73b847
+   *
73b847
+   * Stability: private
73b847
+   */
73b847
   properties[PROP_FPI_ENVIRON] =
73b847
-    g_param_spec_string ("fp-environ",
73b847
+    g_param_spec_string ("fpi-environ",
73b847
                          "Virtual Environment",
73b847
                          "Private: The environment variable for the virtual device",
73b847
                          NULL,
73b847
                          G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY);
73b847
 
73b847
+  /**
73b847
+   * FpDevice::fpi-usb-device: (skip)
73b847
+   *
73b847
+   * This property is only for internal purposes.
73b847
+   *
73b847
+   * Stability: private
73b847
+   */
73b847
   properties[PROP_FPI_USB_DEVICE] =
73b847
-    g_param_spec_object ("fp-usb-device",
73b847
+    g_param_spec_object ("fpi-usb-device",
73b847
                          "USB Device",
73b847
                          "Private: The USB device for the device",
73b847
                          G_USB_TYPE_DEVICE,
73b847
                          G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY);
73b847
 
73b847
+  /**
73b847
+   * FpDevice::fpi-driver-data: (skip)
73b847
+   *
73b847
+   * This property is only for internal purposes.
73b847
+   *
73b847
+   * Stability: private
73b847
+   */
73b847
   properties[PROP_FPI_DRIVER_DATA] =
73b847
-    g_param_spec_uint64 ("fp-driver-data",
73b847
+    g_param_spec_uint64 ("fpi-driver-data",
73b847
                          "Driver Data",
73b847
                          "Private: The driver data from the ID table entry",
73b847
                          0,
73b847
@@ -737,7 +758,7 @@ fp_device_enroll (FpDevice           *device,
73b847
       return;
73b847
     }
73b847
 
73b847
-  g_object_get (template_print, "fp-type", &print_type, NULL);
73b847
+  g_object_get (template_print, "fpi-type", &print_type, NULL);
73b847
   if (print_type != FPI_PRINT_UNDEFINED)
73b847
     {
73b847
       g_warning ("Passed print template must be newly created and blank!");
73b847
diff --git a/libfprint/fp-image-device.c b/libfprint/fp-image-device.c
73b847
index 9e6c375..20e181e 100644
73b847
--- a/libfprint/fp-image-device.c
73b847
+++ b/libfprint/fp-image-device.c
73b847
@@ -267,16 +267,32 @@ fp_image_device_class_init (FpImageDeviceClass *klass)
73b847
   klass->activate = fp_image_device_default_activate;
73b847
   klass->deactivate = fp_image_device_default_deactivate;
73b847
 
73b847
+  /**
73b847
+   * FpImageDevice::fpi-image-device-state: (skip)
73b847
+   *
73b847
+   * This property is only for internal purposes.
73b847
+   *
73b847
+   * Stability: private
73b847
+   */
73b847
   properties[PROP_FPI_STATE] =
73b847
-    g_param_spec_enum ("fp-image-device-state",
73b847
+    g_param_spec_enum ("fpi-image-device-state",
73b847
                        "Image Device State",
73b847
                        "Private: The state of the image device",
73b847
                        FPI_TYPE_IMAGE_DEVICE_STATE,
73b847
                        FPI_IMAGE_DEVICE_STATE_INACTIVE,
73b847
                        G_PARAM_STATIC_STRINGS | G_PARAM_READABLE);
73b847
 
73b847
+  /**
73b847
+   * FpImageDevice::fpi-image-device-state-changed: (skip)
73b847
+   * @image_device: A #FpImageDevice
73b847
+   * @new_state: The new state of the device
73b847
+   *
73b847
+   * This signal is only for internal purposes.
73b847
+   *
73b847
+   * Stability: private
73b847
+   */
73b847
   signals[FPI_STATE_CHANGED] =
73b847
-    g_signal_new ("fp-image-device-state-changed",
73b847
+    g_signal_new ("fpi-image-device-state-changed",
73b847
                   G_TYPE_FROM_CLASS (object_class),
73b847
                   G_SIGNAL_RUN_FIRST,
73b847
                   G_STRUCT_OFFSET (FpImageDeviceClass, change_state),
73b847
diff --git a/libfprint/fp-print.c b/libfprint/fp-print.c
73b847
index dd45b95..34139ce 100644
73b847
--- a/libfprint/fp-print.c
73b847
+++ b/libfprint/fp-print.c
73b847
@@ -268,16 +268,30 @@ fp_print_class_init (FpPrintClass *klass)
73b847
                         G_TYPE_DATE,
73b847
                         G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE);
73b847
 
73b847
+  /**
73b847
+   * FpPrint::fpi-type: (skip)
73b847
+   *
73b847
+   * This property is only for internal purposes.
73b847
+   *
73b847
+   * Stability: private
73b847
+   */
73b847
   properties[PROP_FPI_TYPE] =
73b847
-    g_param_spec_enum ("fp-type",
73b847
+    g_param_spec_enum ("fpi-type",
73b847
                        "Type",
73b847
                        "Private: The type of the print data",
73b847
                        FPI_TYPE_PRINT_TYPE,
73b847
                        FPI_PRINT_RAW,
73b847
                        G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
73b847
 
73b847
+  /**
73b847
+   * FpPrint::fpi-data: (skip)
73b847
+   *
73b847
+   * This property is only for internal purposes.
73b847
+   *
73b847
+   * Stability: private
73b847
+   */
73b847
   properties[PROP_FPI_DATA] =
73b847
-    g_param_spec_variant ("fp-data",
73b847
+    g_param_spec_variant ("fpi-data",
73b847
                           "Raw Data",
73b847
                           "The raw data for internal use only",
73b847
                           G_VARIANT_TYPE_ANY,
73b847
@@ -846,11 +860,11 @@ fp_print_deserialize (const guchar *data,
73b847
       g_autoptr(GVariant) fp_data = g_variant_get_child_value (print_data, 0);
73b847
 
73b847
       result = g_object_new (FP_TYPE_PRINT,
73b847
-                             "fp-type", type,
73b847
+                             "fpi-type", type,
73b847
                              "driver", driver,
73b847
                              "device-id", device_id,
73b847
                              "device-stored", device_stored,
73b847
-                             "fp-data", fp_data,
73b847
+                             "fpi-data", fp_data,
73b847
                              NULL);
73b847
     }
73b847
   else
73b847
diff --git a/libfprint/fpi-image-device.c b/libfprint/fpi-image-device.c
73b847
index e03d60c..975e3a1 100644
73b847
--- a/libfprint/fpi-image-device.c
73b847
+++ b/libfprint/fpi-image-device.c
73b847
@@ -55,7 +55,7 @@ fpi_image_device_activate (FpImageDevice *self)
73b847
   /* We don't have a neutral ACTIVE state, but we always will
73b847
    * go into WAIT_FINGER_ON afterwards. */
73b847
   priv->state = FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON;
73b847
-  g_object_notify (G_OBJECT (self), "fp-image-device-state");
73b847
+  g_object_notify (G_OBJECT (self), "fpi-image-device-state");
73b847
 
73b847
   /* We might have been waiting for deactivation to finish before
73b847
    * starting the next operation. */
73b847
@@ -83,7 +83,7 @@ fpi_image_device_deactivate (FpImageDevice *self)
73b847
     g_warning ("Deactivating image device while waiting for finger, this should not happen.");
73b847
 
73b847
   priv->state = FPI_IMAGE_DEVICE_STATE_INACTIVE;
73b847
-  g_object_notify (G_OBJECT (self), "fp-image-device-state");
73b847
+  g_object_notify (G_OBJECT (self), "fpi-image-device-state");
73b847
 
73b847
   fp_dbg ("Deactivating image device\n");
73b847
   cls->deactivate (self);
73b847
@@ -106,8 +106,8 @@ fp_image_device_change_state (FpImageDevice *self, FpiImageDeviceState state)
73b847
   fp_dbg ("Image device internal state change from %d to %d\n", priv->state, state);
73b847
 
73b847
   priv->state = state;
73b847
-  g_object_notify (G_OBJECT (self), "fp-image-device-state");
73b847
-  g_signal_emit_by_name (self, "fp-image-device-state-changed", priv->state);
73b847
+  g_object_notify (G_OBJECT (self), "fpi-image-device-state");
73b847
+  g_signal_emit_by_name (self, "fpi-image-device-state-changed", priv->state);
73b847
 }
73b847
 
73b847
 static void
73b847
@@ -563,7 +563,7 @@ fpi_image_device_open_complete (FpImageDevice *self, GError *error)
73b847
   g_debug ("Image device open completed");
73b847
 
73b847
   priv->state = FPI_IMAGE_DEVICE_STATE_INACTIVE;
73b847
-  g_object_notify (G_OBJECT (self), "fp-image-device-state");
73b847
+  g_object_notify (G_OBJECT (self), "fpi-image-device-state");
73b847
 
73b847
   fpi_device_open_complete (FP_DEVICE (self), error);
73b847
 }
73b847
@@ -589,7 +589,7 @@ fpi_image_device_close_complete (FpImageDevice *self, GError *error)
73b847
   g_return_if_fail (action == FPI_DEVICE_ACTION_CLOSE);
73b847
 
73b847
   priv->state = FPI_IMAGE_DEVICE_STATE_INACTIVE;
73b847
-  g_object_notify (G_OBJECT (self), "fp-image-device-state");
73b847
+  g_object_notify (G_OBJECT (self), "fpi-image-device-state");
73b847
 
73b847
   fpi_device_close_complete (FP_DEVICE (self), error);
73b847
 }
73b847
diff --git a/libfprint/fpi-print.c b/libfprint/fpi-print.c
73b847
index 7a5e1e2..4e3ed03 100644
73b847
--- a/libfprint/fpi-print.c
73b847
+++ b/libfprint/fpi-print.c
73b847
@@ -75,7 +75,7 @@ fpi_print_set_type (FpPrint     *print,
73b847
       g_assert_null (print->prints);
73b847
       print->prints = g_ptr_array_new_with_free_func (g_free);
73b847
     }
73b847
-  g_object_notify (G_OBJECT (print), "fp-type");
73b847
+  g_object_notify (G_OBJECT (print), "fpi-type");
73b847
 }
73b847
 
73b847
 /**
73b847
diff --git a/tests/test-fpi-device.c b/tests/test-fpi-device.c
73b847
index 398407a..3fa800c 100644
73b847
--- a/tests/test-fpi-device.c
73b847
+++ b/tests/test-fpi-device.c
73b847
@@ -240,7 +240,7 @@ test_driver_get_usb_device (void)
73b847
   g_autoptr(FpDevice) device = NULL;
73b847
 
73b847
   dev_class->type = FP_DEVICE_TYPE_USB;
73b847
-  device = g_object_new (FPI_TYPE_DEVICE_FAKE, "fp-usb-device", NULL);
73b847
+  device = g_object_new (FPI_TYPE_DEVICE_FAKE, "fpi-usb-device", NULL);
73b847
   g_assert_null (fpi_device_get_usb_device (device));
73b847
 
73b847
   g_clear_object (&device);
73b847
@@ -259,7 +259,7 @@ test_driver_get_virtual_env (void)
73b847
   g_autoptr(FpDevice) device = NULL;
73b847
 
73b847
   dev_class->type = FP_DEVICE_TYPE_VIRTUAL;
73b847
-  device = g_object_new (FPI_TYPE_DEVICE_FAKE, "fp-environ", "TEST_VIRTUAL_ENV_GETTER", NULL);
73b847
+  device = g_object_new (FPI_TYPE_DEVICE_FAKE, "fpi-environ", "TEST_VIRTUAL_ENV_GETTER", NULL);
73b847
   g_assert_cmpstr (fpi_device_get_virtual_env (device), ==, "TEST_VIRTUAL_ENV_GETTER");
73b847
 
73b847
   g_clear_object (&device);
73b847
@@ -278,7 +278,7 @@ test_driver_get_driver_data (void)
73b847
   guint64 driver_data;
73b847
 
73b847
   driver_data = g_random_int ();
73b847
-  device = g_object_new (FPI_TYPE_DEVICE_FAKE, "fp-driver-data", driver_data, NULL);
73b847
+  device = g_object_new (FPI_TYPE_DEVICE_FAKE, "fpi-driver-data", driver_data, NULL);
73b847
   g_assert_cmpuint (fpi_device_get_driver_data (device), ==, driver_data);
73b847
 }
73b847
 
73b847
-- 
73b847
2.24.1
73b847