[glibmm] Tls[Client|Server]Connection: Add the create() methods.



commit 8af06f70a861995ce93eaf71aa4f0e1ce282f2dd
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Sun Mar 24 23:46:05 2013 -0400

    Tls[Client|Server]Connection: Add the create() methods.
    
        * gio/src/tlsclientconnection.hg:
        * gio/src/tlsserverconnection.hg: Add the create() methods, wrapping
        the *_new() functions of these classes.  Since these classes are
        interfaces, it is not possible to use _WRAP_CTOR/WRAP_CREATE() to wrap
        the new functions.
    
        Also make these classes derive from TlsConnection which is their base
        class (see [1][2][3][4]).  Its odd because the base class is a GObject
        and the derived ones are GInterfaces, but that's how the C API has
        done it.  Hopefully it will not be a problem.
    
        [1] https://developer.gnome.org/gio/stable/GTlsConnection.html#GTlsConnection.description
        [2] https://developer.gnome.org/gio/stable/GTlsConnection.html#GTlsConnection.derived-interfaces
        [3] https://developer.gnome.org/gio/stable/GTlsClientConnection.html#GTlsClientConnection.description
        [4] https://developer.gnome.org/gio/stable/GTlsServerConnection.html#GTlsServerConnection.description

 ChangeLog                      |   20 ++++++++++++++++++++
 gio/src/tlsclientconnection.hg |    9 ++++++---
 gio/src/tlsserverconnection.hg |    9 ++++++---
 3 files changed, 32 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7aa3318..1414b71 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,25 @@
 2013-03-24  José Alburquerque  <jaalburquerque gmail com>
 
+       Tls[Client|Server]Connection: Add the create() methods.
+
+       * gio/src/tlsclientconnection.hg:
+       * gio/src/tlsserverconnection.hg: Add the create() methods, wrapping
+       the *_new() functions of these classes.  Since these classes are
+       interfaces, it is not possible to use _WRAP_CTOR/WRAP_CREATE() to wrap
+       the new functions.
+
+       Also make these classes derive from TlsConnection which is their base
+       class (see [1][2][3][4]).  Its odd because the base class is a GObject
+       and the derived ones are GInterfaces, but that's how the C API has
+       done it.  Hopefully it will not be a problem.
+
+       [1] https://developer.gnome.org/gio/stable/GTlsConnection.html#GTlsConnection.description
+       [2] https://developer.gnome.org/gio/stable/GTlsConnection.html#GTlsConnection.derived-interfaces
+       [3] https://developer.gnome.org/gio/stable/GTlsClientConnection.html#GTlsClientConnection.description
+       [4] https://developer.gnome.org/gio/stable/GTlsServerConnection.html#GTlsServerConnection.description
+
+2013-03-24  José Alburquerque  <jaalburquerque gmail com>
+
        gio/src/tls*.ccg: Remove empty namespaces.
 
        * gio/src/tlsconnection.ccg:
diff --git a/gio/src/tlsclientconnection.hg b/gio/src/tlsclientconnection.hg
index dd454a1..0db96e8 100644
--- a/gio/src/tlsclientconnection.hg
+++ b/gio/src/tlsclientconnection.hg
@@ -16,6 +16,7 @@
  */
 
 #include <glibmm/interface.h>
+#include <giomm/tlsconnection.h>
 #include <giomm/enums.h>
 
 _DEFS(giomm,gio)
@@ -36,13 +37,15 @@ class SocketConnectable;
  * representing a client-side TLS connection.
  * @newin{2,36}
  */
-class TlsClientConnection : public Glib::Interface
+class TlsClientConnection : public Glib::Interface, public TlsConnection
 {
   _CLASS_INTERFACE(TlsClientConnection, GTlsClientConnection, G_TLS_CLIENT_CONNECTION, 
GTlsClientConnectionInterface)
 
 public:
-  //TODO: This new function creates an IOStream, not a TlsClientConnection:
-  // GIOStream* g_tls_client_connection_new(GIOStream *base_io_stream, GSocketConnectable *server_identity, 
GError **error);
+  //TODO: It's not possible to use _WRAP_CTOR/_WRAP_CREATE to wrap the new
+  //function because this is an interface.
+#m4 _CONVERSION(`GIOStream*',`Glib::RefPtr<TlsClientConnection>',`Glib::wrap(G_TLS_CLIENT_CONNECTION($3))')
+  _WRAP_METHOD(static Glib::RefPtr<TlsClientConnection> create(const Glib::RefPtr<IOStream>& base_io_stream, 
const Glib::RefPtr<const SocketConnectable>& server_identity{?}), g_tls_client_connection_new, errthrow)
 
   _WRAP_METHOD(void set_server_identity(const Glib::RefPtr<SocketConnectable>& identity), 
g_tls_client_connection_set_server_identity)
 
diff --git a/gio/src/tlsserverconnection.hg b/gio/src/tlsserverconnection.hg
index ed374b8..b44ba37 100644
--- a/gio/src/tlsserverconnection.hg
+++ b/gio/src/tlsserverconnection.hg
@@ -16,6 +16,7 @@
  */
 
 #include <glibmm/interface.h>
+#include <giomm/tlsconnection.h>
 #include <giomm/enums.h>
 
 _DEFS(giomm,gio)
@@ -34,13 +35,15 @@ namespace Gio
  * representing a server-side TLS connection.
  * @newin{2,36}
  */
-class TlsServerConnection : public Glib::Interface
+class TlsServerConnection : public Glib::Interface, public TlsConnection
 {
   _CLASS_INTERFACE(TlsServerConnection, GTlsServerConnection, G_TLS_SERVER_CONNECTION, 
GTlsServerConnectionInterface)
 
 public:
-  //TODO: This new function creates an IOStream, not a TlsServerConnection:
-  //GIOStream* g_tls_server_connection_new(GIOStream *base_io_stream, GTlsCertificate *certificate, GError 
**error);
+  //TODO: It's not possible to use _WRAP_CTOR/_WRAP_CREATE to wrap the new
+  //function because this is an interface.
+#m4 _CONVERSION(`GIOStream*',`Glib::RefPtr<TlsServerConnection>',`Glib::wrap(G_TLS_SERVER_CONNECTION($3))')
+  _WRAP_METHOD(static Glib::RefPtr<IOStream> create(const Glib::RefPtr<IOStream>& base_io_stream, const 
Glib::RefPtr<TlsCertificate>& certificate), g_tls_server_connection_new, errthrow)
 
   _WRAP_PROPERTY("authentication-mode", TlsAuthenticationMode)
 };


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