]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
gio-2.0: fix callbacks for sources created with Socket.create_source
authorEvan Nemerson <evan@coeus-group.com>
Mon, 3 May 2010 01:20:46 +0000 (18:20 -0700)
committerEvan Nemerson <evan@coeus-group.com>
Tue, 4 May 2010 23:49:08 +0000 (16:49 -0700)
Fixes bug 617069.

vapi/gio-2.0.vapi
vapi/packages/gio-2.0/gio-2.0-custom.vala
vapi/packages/gio-2.0/gio-2.0.metadata

index f4f9bb60065f6c655a89b4f4e4c9efa220f0f5b6..4ead2fa8890db1e482e3c03be144be2a183ecc14 100644 (file)
@@ -715,7 +715,7 @@ namespace GLib {
                public GLib.IOCondition condition_check (GLib.IOCondition condition);
                public bool condition_wait (GLib.IOCondition condition, GLib.Cancellable? cancellable) throws GLib.Error;
                public bool connect (GLib.SocketAddress address, GLib.Cancellable? cancellable) throws GLib.Error;
-               public unowned GLib.TimeoutSource create_source (GLib.IOCondition condition, GLib.Cancellable? cancellable);
+               public GLib.SocketSource create_source (GLib.IOCondition condition, GLib.Cancellable? cancellable);
                [CCode (has_construct_function = false)]
                public Socket.from_fd (int fd) throws GLib.Error;
                public bool get_blocking ();
@@ -844,6 +844,12 @@ namespace GLib {
                public virtual signal bool incoming (GLib.SocketConnection connection, GLib.Object? source_object);
        }
        [Compact]
+       [CCode (cname = "GSource", cheader_filename = "gio/gio.h")]
+       public class SocketSource : GLib.Source {
+               [CCode (cname = "g_source_set_callback")]
+               public void set_callback ([CCode (type = "GSourceFunc")] owned GLib.SocketSourceFunc func);
+       }
+       [Compact]
        [CCode (copy_function = "g_srv_target_copy", type_id = "G_TYPE_SRV_TARGET", cheader_filename = "gio/gio.h")]
        public class SrvTarget {
                [CCode (has_construct_function = false)]
index 42ab86c390e4ccb5631ecbbbac8860590a116deb..ae52b16afec8e85abc6af1add111a843da5cc714 100644 (file)
@@ -34,6 +34,13 @@ namespace GLib {
                public abstract GLib.FileMonitor monitor_file (GLib.FileMonitorFlags flags, GLib.Cancellable? cancellable = null) throws GLib.IOError;
        }
 
+       [Compact]
+       [CCode (cname = "GSource", ref_function = "g_source_ref", unref_function = "g_source_unref")]
+       public class SocketSource : GLib.Source {
+               [CCode (cname = "g_source_set_callback")]
+               public void set_callback ([CCode (type = "GSourceFunc")] owned SocketSourceFunc func);
+       }
+
        [CCode (cname = "g_file_hash", cheader_filename = "gio/gio.h")]
        public static GLib.HashFunc file_hash;
        [CCode (cname = "g_file_equal", cheader_filename = "gio/gio.h")]
index 74e9aaed51d30c64db8621add22b0923cacd7565..f783e1a11e88e94ec92cce47871d5cbb03c0926e 100644 (file)
@@ -113,6 +113,7 @@ g_resolver_lookup_service transfer_ownership="1" type_arguments="SrvTarget"
 g_resolver_lookup_service_finish transfer_ownership="1" type_arguments="SrvTarget"
 g_seekable_truncate abstract="1" vfunc_name="truncate_fn"
 g_seekable_truncate_fn hidden="1"
+g_socket_create_source type_name="SocketSource" transfer_ownership="1"
 g_socket_listener_add_address.source_object nullable="1"
 g_socket_listener_add_inet_port.source_object nullable="1"
 g_socket_listener_add_socket.source_object nullable="1"