[libadwaita/wip/exalm/gi-docgen: 20/50] enum-list-model: Add docs




commit 40c5aa4665943d54dce0c57ce916834043a0e13b
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Mon May 10 16:23:23 2021 +0500

    enum-list-model: Add docs
    
    Convert the description, but mostly add new docs.

 src/adw-enum-list-model.c | 46 +++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 41 insertions(+), 5 deletions(-)
---
diff --git a/src/adw-enum-list-model.c b/src/adw-enum-list-model.c
index 3add9db9..2b25229c 100644
--- a/src/adw-enum-list-model.c
+++ b/src/adw-enum-list-model.c
@@ -12,11 +12,13 @@
 #include <gio/gio.h>
 
 /**
- * SECTION:adwenumlistmodel
- * @short_description: TODO
- * @Title: AdwEnumListModel
+ * AdwEnumListModel:
  *
- * TODO
+ * A `GListModel` representing values of a given enum.
+ *
+ * `AdwEnumListModel` contains objects of type [class@AdwEnumValueObject].
+ *
+ * Since: 1.0
  */
 
 struct _AdwEnumListModel
@@ -113,10 +115,17 @@ adw_enum_list_model_class_init (AdwEnumListModelClass *klass)
   object_class->get_property = adw_enum_list_model_get_property;
   object_class->set_property = adw_enum_list_model_set_property;
 
+  /**
+   * AdwEnumListModel:enum-type: (attributes org.gtk.Property.get=adw_enum_list_model_get_enum_type)
+   *
+   * The type of the enum represented by the model.
+   *
+   * Since: 1.0
+   */
   props[PROP_ENUM_TYPE] =
     g_param_spec_gtype ("enum-type",
                         "Enum type",
-                        "The type of the enum to construct the model from",
+                        "The type of the enum represented by the model",
                         G_TYPE_ENUM,
                         G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
 
@@ -162,6 +171,16 @@ adw_enum_list_model_list_model_init (GListModelInterface *iface)
   iface->get_item = adw_enum_list_model_get_item;
 }
 
+/**
+ * adw_enum_list_model_new:
+ * @enum_type: the type of the enum to construct the model from
+ *
+ * Creates a new `AdwEnumListModel` for @enum_type.
+ *
+ * Returns: the newly created `AdwEnumListModel`
+ *
+ * Since: 1.0
+ */
 AdwEnumListModel *
 adw_enum_list_model_new (GType enum_type)
 {
@@ -170,6 +189,15 @@ adw_enum_list_model_new (GType enum_type)
                        NULL);
 }
 
+/**
+ * adw_enum_list_model_get_enum_type: (attributes org.gtk.Method.get_property=enum-type)
+ *
+ * Gets the type of the enum represented by @self.
+ *
+ * Returns: the enum type
+ *
+ * Since: 1.0
+ */
 GType
 adw_enum_list_model_get_enum_type (AdwEnumListModel *self)
 {
@@ -178,6 +206,14 @@ adw_enum_list_model_get_enum_type (AdwEnumListModel *self)
   return self->enum_type;
 }
 
+/**
+ * adw_enum_list_model_find_position:
+ * @value: an enum value
+ *
+ * Finds the position of a given enum value in @self.
+ *
+ * Since: 1.0
+ */
 guint
 adw_enum_list_model_find_position (AdwEnumListModel *self,
                                    int               value)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]