summaryrefslogtreecommitdiff
path: root/gio/src
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjellahlstedt@gmail.com>2020-07-30 16:42:14 +0200
committerKjell Ahlstedt <kjellahlstedt@gmail.com>2020-07-30 16:42:14 +0200
commit2b089793b961549c44d8de562af43cf48a60d95b (patch)
treee14c34bfb2699a154addb1c108c0a2bb4d7d56c2 /gio/src
parentb8299eae569f9681f1e2ee6f36864ce68e4eba12 (diff)
downloadglibmm-2b089793b961549c44d8de562af43cf48a60d95b.tar.gz
Gio: Add Tls[Client,Server]ConnectionImpl
Restructure Tls[Client,Server]Connection. They are interfaces. Now they derive only from Glib::Interface, like all interfaces shall do. Tls[Client,Server]ConnectionImpl don't correspond to C classes. They can wrap any C object that derives from GTlsConnection and implements GTls[Client,Server]Connection. Such C classes in GLib are not public. They can't be wrapped in the usual way.
Diffstat (limited to 'gio/src')
-rw-r--r--gio/src/tlsclientconnection.ccg11
-rw-r--r--gio/src/tlsclientconnection.hg25
-rw-r--r--gio/src/tlsconnection.hg6
-rw-r--r--gio/src/tlsfiledatabase.hg10
-rw-r--r--gio/src/tlsserverconnection.ccg11
-rw-r--r--gio/src/tlsserverconnection.hg21
6 files changed, 41 insertions, 43 deletions
diff --git a/gio/src/tlsclientconnection.ccg b/gio/src/tlsclientconnection.ccg
index c2785a42..0fb8fbb0 100644
--- a/gio/src/tlsclientconnection.ccg
+++ b/gio/src/tlsclientconnection.ccg
@@ -16,13 +16,4 @@
#include <gio/gio.h>
#include <giomm/socketconnectable.h>
-
-namespace Gio
-{
-
-TlsClientConnection::TlsClientConnection(GTlsClientConnection* castitem)
-: TlsConnection(G_TLS_CONNECTION(castitem))
-{
-}
-
-} // namespace Gio
+#include <giomm/tlsclientconnectionimpl.h>
diff --git a/gio/src/tlsclientconnection.hg b/gio/src/tlsclientconnection.hg
index ca01922e..94465477 100644
--- a/gio/src/tlsclientconnection.hg
+++ b/gio/src/tlsclientconnection.hg
@@ -15,8 +15,8 @@
*/
#include <glibmm/interface.h>
-#include <giomm/tlsconnection.h>
#include <giomm/enums.h>
+#include <giomm/iostream.h>
_DEFS(giomm,gio)
_PINCLUDE(glibmm/private/interface_p.h)
@@ -26,32 +26,35 @@ _PINCLUDE(gio/gio.h)
typedef struct _GTlsClientConnectionInterface GTlsClientConnectionInterface;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
+namespace Glib
+{
+class GLIBMM_API ByteArray;
+}
+
namespace Gio
{
class GIOMM_API SocketConnectable;
+class GIOMM_API TlsClientConnectionImpl;
-// It's unusual that a subclass of Glib::Object is a base class of an interface.
-// For a discussion, see https://bugzilla.gnome.org/show_bug.cgi?id=776537
+// See https://bugzilla.gnome.org/show_bug.cgi?id=776537
// especially the last paragraph of comment 6.
-/** TlsClientConnection - TLS client-side connection.
- * TlsClientConnection is the client-side subclass of TlsConnection,
+/** TLS client-side connection.
+ * %TlsClientConnection is the client-side subclass of TlsConnection,
* representing a client-side TLS connection.
* @newin{2,36}
*/
-class GIOMM_API TlsClientConnection
-: public Glib::Interface,
- public TlsConnection
+class GIOMM_API TlsClientConnection : public Glib::Interface
{
_CLASS_INTERFACE(TlsClientConnection, GTlsClientConnection, G_TLS_CLIENT_CONNECTION, GTlsClientConnectionInterface, , , GIOMM_API)
- _CUSTOM_CTOR_CAST
public:
// 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)
+#m4 _CONVERSION(`GIOStream*',`Glib::RefPtr<TlsClientConnectionImpl>',`Glib::wrap_tls_client_connection_impl(G_TLS_CONNECTION($3))')
+ _WRAP_METHOD(static Glib::RefPtr<TlsClientConnectionImpl> 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/tlsconnection.hg b/gio/src/tlsconnection.hg
index c70cc803..12132a80 100644
--- a/gio/src/tlsconnection.hg
+++ b/gio/src/tlsconnection.hg
@@ -30,9 +30,9 @@ class GIOMM_API Cancellable;
class GIOMM_API TlsDatabase;
class GIOMM_API TlsInteraction;
-/** TlsConnection - TLS connection type.
- * TlsConnection is the base TLS connection class type, which wraps an IOStream
- * and provides TLS encryption on top of it. Its subclasses,
+/** TLS connection type.
+ * %TlsConnection is the base TLS connection class type, which wraps an IOStream
+ * and provides TLS encryption on top of it. Its subclasses that implement
* TlsClientConnection and TlsServerConnection, implement client-side and
* server-side TLS, respectively.
* @newin{2,36}
diff --git a/gio/src/tlsfiledatabase.hg b/gio/src/tlsfiledatabase.hg
index 232126f9..a2382bed 100644
--- a/gio/src/tlsfiledatabase.hg
+++ b/gio/src/tlsfiledatabase.hg
@@ -28,6 +28,16 @@ typedef struct _GTlsFileDatabaseInterface GTlsFileDatabaseInterface;
namespace Gio
{
+// commit e28f5093dced2e8cafef5795c02657b7265b78ca
+// Author: José Alburquerque <jaalburqu@svn.gnome.org>
+// Date: Tue Mar 26 10:48:59 2013 -0400
+// TlsFileDatabase: Remove the class until its usage is more clear.
+
+// TODO: If this class is ever added to the build system, consider restructuring
+// like TlsClientConnectionImpl and TlsServerConnectionImpl.
+// class GIOMM_API TlsFileDatabase : public Glib::Interface
+// class GIOMM_API TlsFileDatabaseImpl : public TlsFileDatabase, public TlsDatabase
+
// It's unusual that a subclass of Glib::Object is a base class of an interface.
// For a discussion, see https://bugzilla.gnome.org/show_bug.cgi?id=776537
// especially the last paragraph of comment 6.
diff --git a/gio/src/tlsserverconnection.ccg b/gio/src/tlsserverconnection.ccg
index 01cfc858..16da8120 100644
--- a/gio/src/tlsserverconnection.ccg
+++ b/gio/src/tlsserverconnection.ccg
@@ -15,13 +15,4 @@
*/
#include <gio/gio.h>
-
-namespace Gio
-{
-
-TlsServerConnection::TlsServerConnection(GTlsServerConnection* castitem)
-: TlsConnection(G_TLS_CONNECTION(castitem))
-{
-}
-
-} // namespace Gio
+#include <giomm/tlsserverconnectionimpl.h>
diff --git a/gio/src/tlsserverconnection.hg b/gio/src/tlsserverconnection.hg
index d4676119..94a729a5 100644
--- a/gio/src/tlsserverconnection.hg
+++ b/gio/src/tlsserverconnection.hg
@@ -15,8 +15,9 @@
*/
#include <glibmm/interface.h>
-#include <giomm/tlsconnection.h>
#include <giomm/enums.h>
+#include <giomm/iostream.h>
+#include <giomm/tlscertificate.h>
_DEFS(giomm,gio)
_PINCLUDE(glibmm/private/interface_p.h)
@@ -28,25 +29,27 @@ typedef struct _GTlsServerConnectionInterface GTlsServerConnectionInterface;
namespace Gio
{
-// It's unusual that a subclass of Glib::Object is a base class of an interface.
-// For a discussion, see https://bugzilla.gnome.org/show_bug.cgi?id=776537
+
+class GIOMM_API TlsServerConnectionImpl;
+
+// See https://bugzilla.gnome.org/show_bug.cgi?id=776537
// especially the last paragraph of comment 6.
-/** TlsServerConnection - TLS server-side connection.
- * TlsServerConnection is the server-side subclass of TlsConnection,
+/** TLS server-side connection.
+ * %TlsServerConnection is the server-side subclass of TlsConnection,
* representing a server-side TLS connection.
* @newin{2,36}
*/
-class GIOMM_API TlsServerConnection : public Glib::Interface, public TlsConnection
+class GIOMM_API TlsServerConnection : public Glib::Interface
{
_CLASS_INTERFACE(TlsServerConnection, GTlsServerConnection, G_TLS_SERVER_CONNECTION, GTlsServerConnectionInterface, , , GIOMM_API)
- _CUSTOM_CTOR_CAST
public:
// 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)
+#m4 _CONVERSION(`GIOStream*',`Glib::RefPtr<TlsServerConnectionImpl>',`Glib::wrap_tls_server_connection_impl(G_TLS_CONNECTION($3))')
+ _WRAP_METHOD(static Glib::RefPtr<TlsServerConnectionImpl> create(const Glib::RefPtr<IOStream>& base_io_stream,
+ const Glib::RefPtr<TlsCertificate>& certificate), g_tls_server_connection_new, errthrow)
_WRAP_PROPERTY("authentication-mode", TlsAuthenticationMode)
};