[libmanette] device: Document rumble functions has_rumble() and rumble()
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libmanette] device: Document rumble functions has_rumble() and rumble()
- Date: Tue, 17 Nov 2020 21:59:18 +0000 (UTC)
commit ac2dbd2beca67df3ff02c1b984ad1bfc086eed9b
Author: vanadiae <vanadiae35 gmail com>
Date: Wed Oct 14 19:36:52 2020 +0200
device: Document rumble functions has_rumble() and rumble()
This is particularly needed as they are public API and rumbling
can be hard to understand if you didn't use rumbles before.
src/manette-device.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
---
diff --git a/src/manette-device.c b/src/manette-device.c
index bbd4f9f..b539475 100644
--- a/src/manette-device.c
+++ b/src/manette-device.c
@@ -818,6 +818,14 @@ manette_device_remove_user_mapping (ManetteDevice *self)
g_object_unref (mapping_manager);
}
+/**
+ * manette_device_has_rumble:
+ * @self: a #ManetteDevice
+ *
+ * Checks whether device @self has a rumble motor.
+ *
+ * Returns: whether device @self has a rumble motor.
+ */
gboolean
manette_device_has_rumble (ManetteDevice *self)
{
@@ -834,6 +842,18 @@ manette_device_has_rumble (ManetteDevice *self)
return TRUE;
}
+/**
+ * manette_device_rumble:
+ * @self: a #ManetteDevice
+ * @strong_magnitude: the magnitude for the heavy rumbling motor, when there's one
+ * @weak_magnitude: the magnitude for the small rumbling motor
+ * @duration: the rumble effect play time in milliseconds, with a maximum of 32767.
+ *
+ * Make @self rumble during @duration milliseconds, with heavy motor rumbling at
+ * magnitude @strong_magnitude and the small rumbling motor at magnitude @weak_magnitude.
+ *
+ * Returns: whether the rumble effect was played.
+ */
gboolean
manette_device_rumble (ManetteDevice *self,
guint16 strong_magnitude,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]