[glibmm] UnixConnection: Add [receive|send]_credentials_[async|finish]().



commit dc6463045879409e130767ae9fa07876d7a8e82f
Author: Josà Alburquerque <jaalburqu svn gnome org>
Date:   Sun Nov 4 17:24:15 2012 -0500

    UnixConnection: Add [receive|send]_credentials_[async|finish]().
    
    	* gio/src/unixconnection.{ccg,hg}: Add the new methods (adding
    	non-cancellable versions for the async methods) wrapping the
    	corresponding C functions.
    	* gio/src/socketconnection.hg: Typo.

 ChangeLog                   |    9 ++++++++
 gio/src/socketconnection.hg |    2 +-
 gio/src/unixconnection.ccg  |   47 +++++++++++++++++++++++++++++++++++++++++++
 gio/src/unixconnection.hg   |   42 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 99 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8721fc9..554efb4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2012-11-04  Josà Alburquerque  <jaalburquerque gmail com>
 
+	UnixConnection: Add [receive|send]_credentials_[async|finish]().
+
+	* gio/src/unixconnection.{ccg,hg}: Add the new methods (adding
+	non-cancellable versions for the async methods) wrapping the
+	corresponding C functions.
+	* gio/src/socketconnection.hg: Typo.
+
+2012-11-04  Josà Alburquerque  <jaalburquerque gmail com>
+
 	ThemedIcon: Wrap the "names" property.
 
 	* gio/src/themedicon.hg:
diff --git a/gio/src/socketconnection.hg b/gio/src/socketconnection.hg
index 6bcd377..2e8b859 100644
--- a/gio/src/socketconnection.hg
+++ b/gio/src/socketconnection.hg
@@ -71,7 +71,7 @@ public:
     const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable);
   _IGNORE(g_socket_connection_connect_async)
 
-  /// A Non-cancellable version of connect_async().
+  /// A non-cancellable version of connect_async().
   void connect_async(const Glib::RefPtr<SocketAddress>& address,
     const SlotAsyncReady& slot);
 
diff --git a/gio/src/unixconnection.ccg b/gio/src/unixconnection.ccg
index e4433e4..2341973 100644
--- a/gio/src/unixconnection.ccg
+++ b/gio/src/unixconnection.ccg
@@ -19,7 +19,54 @@
 
 #include <gio/gio.h>
 #include <gio/gunixconnection.h>
+#include "slot_async.h"
 
 namespace Gio
 {
+
+void UnixConnection::receive_credentials_async(const SlotAsyncReady& slot,
+  const Glib::RefPtr<Cancellable>& cancellable)
+{
+  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+
+  g_unix_connection_receive_credentials_async(gobj(),
+                                              Glib::unwrap(cancellable),
+                                              &SignalProxy_async_callback,
+                                              slot_copy);
+}
+
+void UnixConnection::receive_credentials_async(const SlotAsyncReady& slot)
+{
+  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+
+  g_unix_connection_receive_credentials_async(gobj(),
+                                              0,
+                                              &SignalProxy_async_callback,
+                                              slot_copy);
+}
+
+void
+UnixConnection::send_credentials_async(const SlotAsyncReady& slot,
+  const Glib::RefPtr<Cancellable>& cancellable)
+{
+  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+
+  g_unix_connection_send_credentials_async(gobj(),
+                                           Glib::unwrap(cancellable),
+                                           &SignalProxy_async_callback,
+                                           slot_copy);
+}
+
+void
+UnixConnection::send_credentials_async(const SlotAsyncReady& slot)
+
+{
+  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+
+  g_unix_connection_send_credentials_async(gobj(),
+                                           0,
+                                           &SignalProxy_async_callback,
+                                           slot_copy);
+}
+
 } // namespace Gio
diff --git a/gio/src/unixconnection.hg b/gio/src/unixconnection.hg
index 1f1d036..65b87ad 100644
--- a/gio/src/unixconnection.hg
+++ b/gio/src/unixconnection.hg
@@ -49,7 +49,49 @@ public:
 
     _WRAP_METHOD(Glib::RefPtr<Credentials> receive_credentials(const Glib::RefPtr<Cancellable>& cancellable{?}), g_unix_connection_receive_credentials, errthrow)
     _WRAP_METHOD(Glib::RefPtr<const Credentials> receive_credentials(const Glib::RefPtr<Cancellable>& cancellable{?}) const, g_unix_connection_receive_credentials, errthrow, constversion)
+
+  /**  Asynchronously receive credentials.
+   * For more details, see receive_credentials() which is the synchronous
+   * version of this call.
+   *
+   * When the operation is finished, @a slot will be called. You can then call
+   * receive_credentials_finish() to get the result of the operation.
+   *
+   * @param slot A SlotAsyncReady to call when the request is satisfied. 
+   * @param cancellable A Cancellable object.
+   * @newin{2,36}
+   */
+  void receive_credentials_async(const SlotAsyncReady& slot,
+    const Glib::RefPtr<Cancellable>& cancellable);
+  _IGNORE(g_unix_connection_receive_credentials_async)
+
+  /// A non-cancellable version of receive_credentials_async().
+  void receive_credentials_async(const SlotAsyncReady& slot);
+
+  _WRAP_METHOD(Glib::RefPtr<Credentials> receive_credentials_finish(const Glib::RefPtr<AsyncResult>& result), g_unix_connection_receive_credentials_finish, errthrow)
+  _WRAP_METHOD(Glib::RefPtr<const Credentials> receive_credentials_finish(const Glib::RefPtr<AsyncResult>& result) const, g_unix_connection_receive_credentials_finish, errthrow, constversion)
+
     _WRAP_METHOD(bool send_credentials(const Glib::RefPtr<Cancellable>& cancellable{?}), g_unix_connection_send_credentials, errthrow)
+
+  /**  Asynchronously send credentials.
+   * For more details, see send_credentials() which is the synchronous version
+   * of this call.
+   *
+   * When the operation is finished, @a slot will be called. You can then call
+   * send_credentials_finish() to get the result of the operation.
+   *
+   * @param slot A SlotAsyncReady to call when the request is satisfied. 
+   * @param cancellable A Cancellable object.  
+   * @newin{2,36}
+   */
+  void send_credentials_async(const SlotAsyncReady& slot,
+    const Glib::RefPtr<Cancellable>& cancellable);
+  _IGNORE(g_unix_connection_send_credentials_async)
+
+  /// A non-cancellable version of send_credentials_async().
+  void send_credentials_async(const SlotAsyncReady& slot);
+
+  _WRAP_METHOD(bool send_credentials_finish(const Glib::RefPtr<AsyncResult>& result), g_unix_connection_send_credentials_finish, errthrow)
 };
 
 } // namespace Gio



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