]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
glib-2.0: add IOSource to make IOChannel.create_watch safer and easier
authorDavid Kozub <zub@linux.fjfi.cvut.cz>
Thu, 24 Nov 2011 17:15:00 +0000 (09:15 -0800)
committerEvan Nemerson <evan@coeus-group.com>
Fri, 2 Dec 2011 00:18:24 +0000 (16:18 -0800)
vapi/glib-2.0.vapi

index 8d39693fd47d036b7aefd62534871530c03045d0..5b79e463123fc2e45bd5a41d0e3c1875b38ecd45 100644 (file)
@@ -2014,7 +2014,7 @@ namespace GLib {
                public IOStatus seek_position (int64 offset, SeekType type) throws IOChannelError;
                public IOStatus shutdown (bool flush) throws IOChannelError;
                [CCode (cname = "g_io_create_watch")]
-               public GLib.Source create_watch (IOCondition condition);
+               public IOSource create_watch (IOCondition condition);
                [CCode (cname = "g_io_add_watch")]
                public uint add_watch (IOCondition condition, IOFunc func);
                [CCode (cname = "g_io_add_watch_full")]
@@ -2034,6 +2034,15 @@ namespace GLib {
                public void set_close_on_unref (bool do_close);
        }
 
+       [Compact]
+       [CCode (cname = "GSource")]
+       public class IOSource : Source {
+               [CCode (cname = "g_io_create_watch")]
+               public IOSource (IOChannel channel, IOCondition condition);
+               [CCode (cname = "g_source_set_callback")]
+               public void set_callback ([CCode (type = "GSourceFunc")] owned IOFunc func);
+       }
+
        [CCode (cprefix = "G_SEEK_", has_type_id = false)]
        public enum SeekType {
                CUR,