]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
gio-2.0: Add type-parameter to ListModel and ListStore
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 8 Apr 2023 13:50:53 +0000 (15:50 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 17 Apr 2023 19:02:03 +0000 (21:02 +0200)
vapi/gio-2.0.vapi
vapi/metadata/Gio-2.0.metadata

index 7b95a60276b633b985d1c3883e9a91850bb48efb..974a75a269d58ee9e9727d7e19beb4355a0319a3 100644 (file)
@@ -1791,30 +1791,30 @@ namespace GLib {
                public virtual async ssize_t skip_async (size_t count, int io_priority = GLib.Priority.DEFAULT, GLib.Cancellable? cancellable = null) throws GLib.IOError;
        }
        [CCode (cheader_filename = "gio/gio.h", type_id = "g_list_store_get_type ()")]
-       public sealed class ListStore : GLib.Object, GLib.ListModel {
+       public sealed class ListStore<G> : GLib.Object, GLib.ListModel<G> {
                [CCode (has_construct_function = false)]
                [Version (since = "2.44")]
                public ListStore (GLib.Type item_type);
                [Version (since = "2.44")]
-               public void append (GLib.Object item);
+               public void append ([CCode (type = "gpointer")] G item);
                [Version (since = "2.64")]
-               public bool find (GLib.Object item, out uint position);
+               public bool find ([CCode (type = "gpointer")] G item, out uint position);
                [Version (since = "2.64")]
-               public bool find_with_equal_func (GLib.Object? item, GLib.EqualFunc<GLib.Object> equal_func, out uint position);
+               public bool find_with_equal_func ([CCode (type = "gpointer")] G item, GLib.EqualFunc<G> equal_func, out uint position);
                [Version (since = "2.74")]
-               public bool find_with_equal_func_full (GLib.Object? item, [CCode (delegate_target_pos = 2.5)] GLib.EqualFuncFull<GLib.Object> equal_func, out uint position);
+               public bool find_with_equal_func_full ([CCode (type = "gpointer")] G item, [CCode (delegate_target_pos = 2.5)] GLib.EqualFuncFull<G> equal_func, out uint position);
                [Version (since = "2.44")]
-               public void insert (uint position, GLib.Object item);
+               public void insert (uint position, [CCode (type = "gpointer")] G item);
                [Version (since = "2.44")]
-               public uint insert_sorted (GLib.Object item, GLib.CompareDataFunc<GLib.Object> compare_func);
+               public uint insert_sorted ([CCode (type = "gpointer")] G item, GLib.CompareDataFunc<G> compare_func);
                [Version (since = "2.44")]
                public void remove (uint position);
                [Version (since = "2.44")]
                public void remove_all ();
                [Version (since = "2.46")]
-               public void sort (GLib.CompareDataFunc<GLib.Object> compare_func);
+               public void sort (GLib.CompareDataFunc<G> compare_func);
                [Version (since = "2.44")]
-               public void splice (uint position, uint n_removals, [CCode (array_length_cname = "n_additions", array_length_pos = 3.1, array_length_type = "guint")] GLib.Object[] additions);
+               public void splice (uint position, uint n_removals, [CCode (array_length_cname = "n_additions", array_length_pos = 3.1, array_length_type = "guint")] G[] additions);
                [NoAccessorMethod]
                [Version (since = "2.44")]
                public GLib.Type item_type { get; construct; }
@@ -3990,15 +3990,15 @@ namespace GLib {
                public static GLib.Object newv (GLib.Type object_type, [CCode (array_length_cname = "n_parameters", array_length_pos = 1.5, array_length_type = "guint")] GLib.Parameter[] parameters, GLib.Cancellable? cancellable = null) throws GLib.Error;
        }
        [CCode (cheader_filename = "gio/gio.h", type_cname = "GListModelInterface", type_id = "g_list_model_get_type ()")]
-       public interface ListModel : GLib.Object {
+       public interface ListModel<G> : GLib.Object {
                [Version (since = "2.44")]
-               public abstract GLib.Object? get_item (uint position);
+               public abstract G? get_item (uint position);
                [Version (since = "2.44")]
                public abstract GLib.Type get_item_type ();
                [Version (since = "2.44")]
                public abstract uint get_n_items ();
                [Version (since = "2.44")]
-               public GLib.Object? get_object (uint position);
+               public G? get_object (uint position);
                [HasEmitter]
                [Version (since = "2.44")]
                public signal void items_changed (uint position, uint removed, uint added);
index 270ad6f05184e01031b9c7cb27d7110e05a39ea8..5c255d20498efa186227f415e0e257ee2977cf82 100644 (file)
@@ -161,14 +161,14 @@ InputStream
   .read_finish throws="GLib.IOError"
   .skip throws="GLib.IOError"
   .skip_finish throws="GLib.IOError"
-ListModel
+ListModel type_parameters="G"
   .get_item#virtual_method skip
-  .get_item#method skip=false abstract type="GLib.Object?"
-ListStore
-  .find_with_equal_func.equal_func type_arguments="GLib.Object"
-  .find_with_equal_func_full.equal_func type_arguments="GLib.Object"
-  .insert_sorted.compare_func type_arguments="GLib.Object"
-  .sort.compare_func type_arguments="GLib.Object"
+  .get_item#method skip=false abstract type="G?"
+  .get_object type="G?"
+ListStore type_parameters="G" implements="GLib.ListModel<G>"
+  .*.item type="G"
+  .*.*_func type_arguments="G"
+  .splice.additions type="G[]"
 MemoryInputStream
   .add_data.destroy default=GLib.g_free
 MemoryInputStream