fbd-feedback-led: Modernize property definitions

Adapt current phosh coding style before making other changes
This commit is contained in:
Guido Günther
2024-06-13 07:44:42 +02:00
parent 8d4c2590cb
commit 4551b1c939
+35 -34
View File
@@ -1,6 +1,8 @@
/* /*
* Copyright (C) 2020 Purism SPC * Copyright (C) 2020 Purism SPC
* 2024 The Phosh Developers
* SPDX-License-Identifier: GPL-3.0+ * SPDX-License-Identifier: GPL-3.0+
*
* Author: Guido Günther <agx@sigxcpu.org> * Author: Guido Günther <agx@sigxcpu.org>
*/ */
@@ -12,11 +14,9 @@
#include "fbd-feedback-manager.h" #include "fbd-feedback-manager.h"
/** /**
* SECTION:fbd-feedback-led * FbdFeedbackLed:
* @short_description: Describes a led feedback
* @Title: FbdFeedbackLed
* *
* The #FbdFeedbackLed describes a feedback via an LED. It currently * The `FbdFeedbackLed` describes a feedback via an LED. It currently
* only supports periodic patterns. * only supports periodic patterns.
*/ */
@@ -68,6 +68,7 @@ fbd_feedback_led_set_property (GObject *object,
} }
} }
static void static void
fbd_feedback_led_get_property (GObject *object, fbd_feedback_led_get_property (GObject *object,
guint property_id, guint property_id,
@@ -95,6 +96,7 @@ fbd_feedback_led_get_property (GObject *object,
} }
} }
static void static void
fbd_feedback_led_run (FbdFeedbackBase *base) fbd_feedback_led_run (FbdFeedbackBase *base)
{ {
@@ -112,6 +114,7 @@ fbd_feedback_led_run (FbdFeedbackBase *base)
self->frequency); self->frequency);
} }
static void static void
fbd_feedback_led_end (FbdFeedbackBase *base) fbd_feedback_led_end (FbdFeedbackBase *base)
{ {
@@ -124,6 +127,7 @@ fbd_feedback_led_end (FbdFeedbackBase *base)
fbd_feedback_base_done (FBD_FEEDBACK_BASE (self)); fbd_feedback_base_done (FBD_FEEDBACK_BASE (self));
} }
static gboolean static gboolean
fbd_feedback_led_is_available (FbdFeedbackBase *base) fbd_feedback_led_is_available (FbdFeedbackBase *base)
{ {
@@ -133,6 +137,7 @@ fbd_feedback_led_is_available (FbdFeedbackBase *base)
return FBD_IS_DEV_LEDS (dev); return FBD_IS_DEV_LEDS (dev);
} }
static void static void
fbd_feedback_led_class_init (FbdFeedbackLedClass *klass) fbd_feedback_led_class_init (FbdFeedbackLedClass *klass)
{ {
@@ -146,38 +151,36 @@ fbd_feedback_led_class_init (FbdFeedbackLedClass *klass)
base_class->end = fbd_feedback_led_end; base_class->end = fbd_feedback_led_end;
base_class->is_available = fbd_feedback_led_is_available; base_class->is_available = fbd_feedback_led_is_available;
/**
* FbdFeedbackLed:frequency:
*
* The frequency the LED should blink with in mHz.
*/
props[PROP_FREQUENCY] = props[PROP_FREQUENCY] =
g_param_spec_uint ( g_param_spec_uint ("frequency", "", "",
"frequency", 0, G_MAXUINT, 0,
"Frequency", G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
"Led event frequency in mHz", /**
0, G_MAXUINT, 0, * FbdFeedbackLed:color:
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); *
* The color the LED should blink with.
*/
props[PROP_COLOR] = props[PROP_COLOR] =
g_param_spec_enum ( g_param_spec_enum ("color", "", "",
"color", FBD_FEEDBACK_LED_COLOR_WHITE,
"Color", FBD_TYPE_FEEDBACK_LED_COLOR,
"The LED color", G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
FBD_TYPE_FEEDBACK_LED_COLOR,
FBD_FEEDBACK_LED_COLOR_WHITE,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
/** /**
* FbdFeedbackLed:priority: * FbdFeedbackLed:priority:
* *
* Priority of the led pattern. Led devices can only display a limited * Priority of the LED pattern. LED devices can only display a limited
* amount of patterns at time. In this case the pattern with the highest * amount of patterns at a time. In this case the pattern with the highest
* priority wins. * priority wins.
*/ */
props[PROP_PRIORITY] = props[PROP_PRIORITY] =
g_param_spec_uint ( g_param_spec_uint ("priority", "", "",
"priority", 0, 255, 0,
"Priority", G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
"The LED pattern priority",
0, 255, 0,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
/** /**
* FbdFeedbackLed:max-brightness: * FbdFeedbackLed:max-brightness:
* *
@@ -185,16 +188,14 @@ fbd_feedback_led_class_init (FbdFeedbackLedClass *klass)
* maximum brightness. * maximum brightness.
*/ */
props[PROP_MAX_BRIGHTNESS] = props[PROP_MAX_BRIGHTNESS] =
g_param_spec_uint ( g_param_spec_uint ("max-brightness", "", "",
"max-brightness", 1, 100, 100,
"Maximum brightness percentage", G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
"Maximum brightness in the LED pattern",
1, 100, 100,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, PROP_LAST_PROP, props); g_object_class_install_properties (object_class, PROP_LAST_PROP, props);
} }
static void static void
fbd_feedback_led_init (FbdFeedbackLed *self) fbd_feedback_led_init (FbdFeedbackLed *self)
{ {