[vala/staging: 2/2] gio-2.0: Improve DatagramBased.create_source() binding




commit a75751dd043ae3eb09d3a3971a4f0a13474677b7
Author: Ole André Vadla Ravnås <oleavr gmail com>
Date:   Thu May 20 20:03:28 2021 +0200

    gio-2.0: Improve DatagramBased.create_source() binding

 vapi/gio-2.0.vapi                 | 12 ++++++++++--
 vapi/metadata/Gio-2.0-custom.vala |  9 +++++++++
 vapi/metadata/Gio-2.0.metadata    |  3 ++-
 3 files changed, 21 insertions(+), 3 deletions(-)
---
diff --git a/vapi/gio-2.0.vapi b/vapi/gio-2.0.vapi
index e8993f958..855aeb9e8 100644
--- a/vapi/gio-2.0.vapi
+++ b/vapi/gio-2.0.vapi
@@ -1164,6 +1164,14 @@ namespace GLib {
                public void set_byte_order (GLib.DataStreamByteOrder order);
                public GLib.DataStreamByteOrder byte_order { get; set; }
        }
+       [CCode (cheader_filename = "gio/gio.h", cname = "GSource", ref_function = "g_source_ref", 
unref_function = "g_source_unref")]
+       [Compact]
+       public class DatagramBasedSource : GLib.Source {
+               [CCode (cname = "g_source_new")]
+               protected DatagramBasedSource ();
+               [CCode (cname = "g_source_set_callback")]
+               public void set_callback ([CCode (type = "GSourceFunc")] owned GLib.DatagramBasedSourceFunc 
func);
+       }
        [CCode (cheader_filename = "gio/gio.h", type_id = "g_emblem_get_type ()")]
        public class Emblem : GLib.Object, GLib.Icon {
                [CCode (has_construct_function = false)]
@@ -3462,7 +3470,7 @@ namespace GLib {
        public interface DatagramBased : GLib.Object {
                public GLib.IOCondition condition_check (GLib.IOCondition condition);
                public bool condition_wait (GLib.IOCondition condition, int64 timeout, GLib.Cancellable? 
cancellable = null) throws GLib.Error;
-               public GLib.Source create_source (GLib.IOCondition condition, GLib.Cancellable? cancellable = 
null);
+               public GLib.DatagramBasedSource create_source (GLib.IOCondition condition, GLib.Cancellable? 
cancellable = null);
                [CCode (vfunc_name = "condition_check")]
                [NoWrapper]
                public virtual GLib.IOCondition datagram_condition_check (GLib.IOCondition condition);
@@ -3471,7 +3479,7 @@ namespace GLib {
                public virtual bool datagram_condition_wait (GLib.IOCondition condition, int64 timeout, 
GLib.Cancellable? cancellable = null) throws GLib.Error;
                [CCode (vfunc_name = "create_source")]
                [NoWrapper]
-               public virtual GLib.Source datagram_create_source (GLib.IOCondition condition, 
GLib.Cancellable? cancellable = null);
+               public virtual GLib.DatagramBasedSource datagram_create_source (GLib.IOCondition condition, 
GLib.Cancellable? cancellable = null);
                [CCode (vfunc_name = "receive_messages")]
                [NoWrapper]
                public virtual int datagram_receive_messages ([CCode (array_length_cname = "num_messages", 
array_length_pos = 1.5, array_length_type = "guint")] GLib.InputMessage[] messages, int flags, int64 timeout, 
GLib.Cancellable? cancellable = null) throws GLib.Error;
diff --git a/vapi/metadata/Gio-2.0-custom.vala b/vapi/metadata/Gio-2.0-custom.vala
index 1b212271a..95952ffc2 100644
--- a/vapi/metadata/Gio-2.0-custom.vala
+++ b/vapi/metadata/Gio-2.0-custom.vala
@@ -69,6 +69,15 @@ namespace GLib {
                public async string? read_line_utf8_async (int io_priority = GLib.Priority.DEFAULT, 
GLib.Cancellable? cancellable = null, out size_t length = null) throws GLib.IOError;
        }
 
+       [CCode (cheader_filename = "gio/gio.h", cname = "GSource", ref_function = "g_source_ref", 
unref_function = "g_source_unref")]
+       [Compact]
+       public class DatagramBasedSource : GLib.Source {
+               [CCode (cname = "g_source_new")]
+               protected DatagramBasedSource ();
+               [CCode (cname = "g_source_set_callback")]
+               public void set_callback ([CCode (type = "GSourceFunc")] owned GLib.DatagramBasedSourceFunc 
func);
+       }
+
        [CCode (cheader_filename = "gio/gio.h", type_id = "g_file_monitor_get_type ()")]
        public abstract class FileMonitor : GLib.Object {
                [Version (deprecated_since = "2.46")]
diff --git a/vapi/metadata/Gio-2.0.metadata b/vapi/metadata/Gio-2.0.metadata
index a6336e3a3..2a56f3e5e 100644
--- a/vapi/metadata/Gio-2.0.metadata
+++ b/vapi/metadata/Gio-2.0.metadata
@@ -86,7 +86,8 @@ Credentials
 DatagramBased
   .condition_check#virtual_method virtual name="datagram_condition_check" no_wrapper
   .condition_wait#virtual_method virtual name="datagram_condition_wait" no_wrapper
-  .create_source#virtual_method virtual name="datagram_create_source" no_wrapper
+  .create_source#method type="GLib.DatagramBasedSource"
+  .create_source#virtual_method virtual name="datagram_create_source" type="GLib.DatagramBasedSource" 
no_wrapper
   .receive_messages#virtual_method virtual name="datagram_receive_messages" no_wrapper
   .send_messages#virtual_method virtual name="datagram_send_messages" no_wrapper
 DataInputStream


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