[glibmm] giomm: Added remaining Proxy and ProxyResolver methods.



commit 0c4e2bcbd9f677db0b5fa48a6756c461e00c67be
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Sep 3 14:31:06 2010 +0200

    giomm: Added remaining Proxy and ProxyResolver methods.
    
    * gio/src/proxy.[hg|ccg]: Added connect_async().
    * gio/src/proxyresolver.[hg|ccg]: Added lookup_async().

 ChangeLog                 |    7 +++++++
 gio/src/proxy.ccg         |   30 ++++++++++++++++++++++++++++++
 gio/src/proxy.hg          |   18 ++++++++----------
 gio/src/proxyaddress.hg   |   28 ++++++++++++++--------------
 gio/src/proxyresolver.ccg |   28 ++++++++++++++++++++++++++++
 gio/src/proxyresolver.hg  |    8 +++++++-
 6 files changed, 94 insertions(+), 25 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9488fc8..99e7e78 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-09-03  Murray Cumming  <murrayc murrayc com>
+
+	giomm: Added remaining Proxy and ProxyResolver methods.
+
+	* gio/src/proxy.[hg|ccg]: Added connect_async().
+	* gio/src/proxyresolver.[hg|ccg]: Added lookup_async().
+
 2010-09-02  José Alburquerque  <jaalburqu svn gnome org>
 
 	giomm: DBus: watch_name(): Add DBusConnection implementation.
diff --git a/gio/src/proxy.ccg b/gio/src/proxy.ccg
index 1632029..8f8a7cd 100644
--- a/gio/src/proxy.ccg
+++ b/gio/src/proxy.ccg
@@ -26,4 +26,34 @@
 namespace Gio
 {
 
+void Proxy::connect_async(const Glib::RefPtr<IOStream>& connection, const Glib::RefPtr<const ProxyAddress>& proxy_address, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable)
+{
+  // Create a copy of the slot.
+  // A pointer to it will be passed through the callback's data parameter
+  // and deleted in the callback.
+  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+
+  g_proxy_connect_async(gobj(),
+    Glib::unwrap(connection),
+    const_cast<GProxyAddress*>(Glib::unwrap(proxy_address)),
+    Glib::unwrap(cancellable),
+    &SignalProxy_async_callback,
+    slot_copy);
+}
+ 
+void Proxy::connect_async(const Glib::RefPtr<IOStream>& connection, const Glib::RefPtr<const ProxyAddress>& proxy_address, const SlotAsyncReady& slot)
+{
+  // Create a copy of the slot.
+  // A pointer to it will be passed through the callback's data parameter
+  // and deleted in the callback.
+  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+
+  g_proxy_connect_async(gobj(),
+    Glib::unwrap(connection),
+    const_cast<GProxyAddress*>(Glib::unwrap(proxy_address)),
+    0,
+    &SignalProxy_async_callback,
+    slot_copy);
+}
+
 } //namespace Gio
diff --git a/gio/src/proxy.hg b/gio/src/proxy.hg
index b14c2a2..daf36c0 100644
--- a/gio/src/proxy.hg
+++ b/gio/src/proxy.hg
@@ -51,16 +51,14 @@ public:
   _WRAP_METHOD(Glib::RefPtr<IOStream> connect(const Glib::RefPtr<IOStream>& connection,
     const Glib::RefPtr<const ProxyAddress>& proxy_adress, const Glib::RefPtr<Cancellable>& cancellable), g_proxy_connect, errthrow)
 
-/* TODO:
-void       g_proxy_connect_async     (GProxy               *proxy,
-				      GIOStream            *connection,
-				      GProxyAddress        *proxy_address,
-				      GCancellable         *cancellable,
-				      GAsyncReadyCallback   callback,
-				      gpointer              user_data);
-*/
-
-  _WRAP_METHOD(Glib::RefPtr<IOStream> connect_finish(const Glib::RefPtr<AsyncResult>& result), g_proxy_resolver_connect_finish, errthrow)
+  //TODO: Documentation
+  void connect_async(const Glib::RefPtr<IOStream>& connection, const Glib::RefPtr<const ProxyAddress>& proxy_address, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable);
+ 
+  //TODO: Documentation 
+  void connect_async(const Glib::RefPtr<IOStream>& connection, const Glib::RefPtr<const ProxyAddress>& proxy_address, const SlotAsyncReady& slot);
+  _IGNORE(g_proxy_connect_async)
+
+  _WRAP_METHOD(Glib::RefPtr<IOStream> connect_finish(const Glib::RefPtr<AsyncResult>& result), g_proxy_connect_finish, errthrow)
   
   _WRAP_METHOD(bool supports_hostname() const, g_proxy_supports_hostname)
 
diff --git a/gio/src/proxyaddress.hg b/gio/src/proxyaddress.hg
index 853f4bb..867b735 100644
--- a/gio/src/proxyaddress.hg
+++ b/gio/src/proxyaddress.hg
@@ -35,22 +35,22 @@ class ProxyAddress
   _CLASS_GOBJECT(ProxyAddress, GProxyAddress, G_PROXY_ADDRESS, InetSocketAddress, GInetSocketAddress)
 
 protected:
- _WRAP_CTOR(ProxyAddress(const Glib::RefPtr<InetAddress>& address,
-   guint16 port,
-   const Glib::ustring& protocol,
-   const Glib::ustring& destination_hostname,
-   guint16 destination_port,
-   const Glib::ustring& username = Glib::ustring(),
-   const Glib::ustring& password = Glib::ustring()), g_proxy_address_new)
+  _WRAP_CTOR(ProxyAddress(const Glib::RefPtr<InetAddress>& address,
+    guint16 port,
+    const Glib::ustring& protocol,
+    const Glib::ustring& destination_hostname,
+    guint16 destination_port,
+    const Glib::ustring& username = Glib::ustring(),
+    const Glib::ustring& password = Glib::ustring()), g_proxy_address_new)
 
 public:
- _WRAP_CREATE(const Glib::RefPtr<InetAddress>& address,
-   guint16 port,
-   const Glib::ustring& protocol,
-   const Glib::ustring& destination_hostname,
-   guint16 destination_port,
-   const Glib::ustring& username = Glib::ustring(),
-   const Glib::ustring& password = Glib::ustring())
+  _WRAP_CREATE(const Glib::RefPtr<InetAddress>& address,
+    guint16 port,
+    const Glib::ustring& protocol,
+    const Glib::ustring& destination_hostname,
+    guint16 destination_port,
+    const Glib::ustring& username = Glib::ustring(),
+    const Glib::ustring& password = Glib::ustring())
 
   _WRAP_METHOD(Glib::ustring get_protocol() const, g_proxy_address_get_protocol)
   _WRAP_METHOD(Glib::ustring get_destination_hostname() const, g_proxy_address_get_destination_hostname)
diff --git a/gio/src/proxyresolver.ccg b/gio/src/proxyresolver.ccg
index 037ad17..d34fdcd 100644
--- a/gio/src/proxyresolver.ccg
+++ b/gio/src/proxyresolver.ccg
@@ -36,4 +36,32 @@ Glib::StringArrayHandle ProxyResolver::lookup(const Glib::ustring& uri)
   return retvalue;
 }
 
+void ProxyResolver::lookup_async(const Glib::ustring& uri, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable)
+{
+  // Create a copy of the slot.
+  // A pointer to it will be passed through the callback's data parameter
+  // and deleted in the callback.
+  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+
+  g_proxy_resolver_lookup_async(gobj(),
+    uri.c_str(),
+    Glib::unwrap(cancellable),
+    &SignalProxy_async_callback,
+    slot_copy);
+}
+  
+void ProxyResolver::lookup_async(const Glib::ustring& uri, const SlotAsyncReady& slot)
+{
+  // Create a copy of the slot.
+  // A pointer to it will be passed through the callback's data parameter
+  // and deleted in the callback.
+  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+
+  g_proxy_resolver_lookup_async(gobj(),
+    uri.c_str(),
+    0,
+    &SignalProxy_async_callback,
+    slot_copy);
+}
+
 } //namespace Gio
diff --git a/gio/src/proxyresolver.hg b/gio/src/proxyresolver.hg
index 75336b6..75de1f9 100644
--- a/gio/src/proxyresolver.hg
+++ b/gio/src/proxyresolver.hg
@@ -56,7 +56,13 @@ public:
 	//TODO: Documentation
 	Glib::StringArrayHandle lookup(const Glib::ustring& uri);
 						 
-  //TODO: _WRAP_METHOD(void lookup_async(const std::string& uri, const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot), g_proxy_resolver_lookup_async)
+  //TODO: Documentation
+  void lookup_async(const Glib::ustring& uri, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable);
+ 
+  //TODO: Documentation 
+  void lookup_async(const Glib::ustring& uri, const SlotAsyncReady& slot);
+
+  _IGNORE(g_proxy_resolver_lookup_async)
 
   _WRAP_METHOD(Glib::StringArrayHandle lookup_finish(const Glib::RefPtr<AsyncResult>& result), g_proxy_resolver_lookup_finish, errthrow)
 



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