[vala/staging: 2/7] gio-2.0: Add CancellableSource ctor and update PollableSource ctors



commit 1a4c4d0c3fa5424701a009a184a6628ba1b9f3b9
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Jan 8 13:20:38 2019 +0100

    gio-2.0: Add CancellableSource ctor and update PollableSource ctors

 vapi/gio-2.0.vapi                 | 13 +++++++++----
 vapi/metadata/Gio-2.0-custom.vala |  9 +++++----
 vapi/metadata/Gio-2.0.metadata    |  7 ++++---
 3 files changed, 18 insertions(+), 11 deletions(-)
---
diff --git a/vapi/gio-2.0.vapi b/vapi/gio-2.0.vapi
index 7c253ed23..d663cd17e 100644
--- a/vapi/gio-2.0.vapi
+++ b/vapi/gio-2.0.vapi
@@ -545,13 +545,16 @@ namespace GLib {
                public void release_fd ();
                public void reset ();
                public bool set_error_if_cancelled () throws GLib.IOError;
-               [Version (since = "2.28")]
+               [Version (deprecated_since = "vala-0.44", replacement = "CancellableSource", since = "2.28")]
                public GLib.CancellableSource source_new ();
                public virtual signal void cancelled ();
        }
        [CCode (cheader_filename = "gio/gio.h", cname = "GSource", ref_function = "g_source_ref", 
unref_function = "g_source_unref")]
        [Compact]
        public class CancellableSource : GLib.Source {
+               [CCode (has_construct_function = false)]
+               [Version (since = "2.28")]
+               public CancellableSource (GLib.Cancellable? cancellable);
                [CCode (cname = "g_source_set_callback")]
                public void set_callback ([CCode (type = "GSourceFunc")] owned GLib.CancellableSourceFunc 
func);
        }
@@ -2003,10 +2006,12 @@ namespace GLib {
        [CCode (cheader_filename = "gio/gio.h", cname = "GSource", ref_function = "g_source_ref", 
unref_function = "g_source_unref")]
        [Compact]
        public class PollableSource : GLib.Source {
-               [CCode (type = "GSource*")]
+               [CCode (cheader_filename = "gio/gio.h", has_construct_function = false)]
+               [Version (since = "2.28")]
                public PollableSource (GLib.Object pollable_stream);
-               [CCode (type = "GSource*")]
-               public PollableSource.full (GLib.Object pollable_stream, GLib.Source? child_source, 
GLib.Cancellable? cancellable = null);
+               [CCode (cheader_filename = "gio/gio.h", has_construct_function = false)]
+               [Version (since = "2.34")]
+               public PollableSource.full (GLib.Object pollable_stream, GLib.Source? child_source = null, 
GLib.Cancellable? cancellable = null);
                [CCode (cname = "g_source_set_callback")]
                public void set_callback ([CCode (type = "GSourceFunc")] owned GLib.PollableSourceFunc func);
        }
diff --git a/vapi/metadata/Gio-2.0-custom.vala b/vapi/metadata/Gio-2.0-custom.vala
index 1909e6b82..0fe88c90d 100644
--- a/vapi/metadata/Gio-2.0-custom.vala
+++ b/vapi/metadata/Gio-2.0-custom.vala
@@ -20,6 +20,11 @@ namespace GLib {
                public weak GLib.SimpleActionChangeStateCallback? change_state;
        }
 
+       public class Cancellable : GLib.Object {
+               [Version (since = "2.28", deprecated_since = "vala-0.44", replacement = "CancellableSource")]
+               public GLib.CancellableSource source_new ();
+       }
+
        [Compact]
        [CCode (cname = "GSource", ref_function = "g_source_ref", unref_function = "g_source_unref")]
        public class CancellableSource : GLib.Source {
@@ -95,10 +100,6 @@ namespace GLib {
        [Compact]
        [CCode (cname = "GSource", ref_function = "g_source_ref", unref_function = "g_source_unref")]
        public class PollableSource : GLib.Source {
-               [CCode (type = "GSource*")]
-               public PollableSource (GLib.Object pollable_stream);
-               [CCode (type = "GSource*")]
-               public PollableSource.full (GLib.Object pollable_stream, GLib.Source? child_source, 
GLib.Cancellable? cancellable = null);
                [CCode (cname = "g_source_set_callback")]
                public void set_callback ([CCode (type = "GSourceFunc")] owned PollableSourceFunc func);
        }
diff --git a/vapi/metadata/Gio-2.0.metadata b/vapi/metadata/Gio-2.0.metadata
index 90e13d290..6766461c3 100644
--- a/vapi/metadata/Gio-2.0.metadata
+++ b/vapi/metadata/Gio-2.0.metadata
@@ -79,7 +79,7 @@ Cancellable
   .connect.callback type="owned GLib.Func<GLib.Cancellable>"
   .get_current nullable
   .set_error_if_cancelled throws="GLib.IOError"
-  .source_new skip=false type="GLib.CancellableSource"
+  .source_new skip=false parent="GLib.CancellableSource" symbol_type="constructor" name="new"
 Credentials
   .get_native skip=false
 DatagramBased
@@ -309,7 +309,9 @@ OutputMessage
 DBusError errordomain
 DBusSubtreeEnumerateFunc unowned=false skip=false
 ReallocFunc skip=false
-pollable_source_new_full skip
+pollable_source_new parent="GLib.PollableSource" symbol_type="constructor" name="new"
+pollable_source_new_full parent="GLib.PollableSource" symbol_type="constructor" name="new_full"
+  .child_source default=null
 pollable_stream_read
   .buffer type="uint8[]" array_length_idx=2
 
@@ -318,7 +320,6 @@ content_types_get_registered parent="GLib.ContentType" name="list_registered"
 io_modules_* parent="GLib.IOModule" name="io_modules_(.*)"
 io_scheduler_cancel_all_jobs parent="GLib.IOSchedulerJob" name="cancel_all"
 io_scheduler_push_job parent="GLib.IOSchedulerJob" name="push"
-pollable_source_new skip
 network_monitor_get_default skip
 proxy_get_default_for_protocol skip
 proxy_resolver_get_default skip


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