[glibmm] TlsConnection: Wrap the virtual functions.
- From: Josà Alburquerque <jaalburqu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] TlsConnection: Wrap the virtual functions.
- Date: Thu, 17 Jan 2013 07:03:04 +0000 (UTC)
commit d1ccc3bae88396f03e5889286db50547a45dbfed
Author: Josà Alburquerque <jaalburqu svn gnome org>
Date: Thu Jan 17 01:59:01 2013 -0500
TlsConnection: Wrap the virtual functions.
* gio/src/tlsconnection.hg: Wrap the three virtual functions that were
left as TODO's now that it's possible to wrap virtual functions with
slots.
* tools/m4/vfunc.m4: Use 'retval' instead of 'result' for variables
that store the result of the C base virtual function invocation and
the C++ virtual function invocation because 'result' conflicts with
the AsyncResult 'result' parameter of the handshake_finish_vfunc().
ChangeLog | 12 ++++++++++++
gio/src/tlsconnection.hg | 10 +++++-----
tools/m4/vfunc.m4 | 10 +++++-----
3 files changed, 22 insertions(+), 10 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index fd7c585..2158286 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2013-01-17 Josà Alburquerque <jaalburquerque gmail com>
+
+ TlsConnection: Wrap the virtual functions.
+
+ * gio/src/tlsconnection.hg: Wrap the three virtual functions that were
+ left as TODO's now that it's possible to wrap virtual functions with
+ slots.
+ * tools/m4/vfunc.m4: Use 'retval' instead of 'result' for variables
+ that store the result of the C base virtual function invocation and
+ the C++ virtual function invocation because 'result' conflicts with
+ the AsyncResult 'result' parameter of the handshake_finish_vfunc().
+
2013-01-16 Josà Alburquerque <jaalburquerque gmail com>
gmmproc: _WRAP_VFUNC: Support the wrapping of slots.
diff --git a/gio/src/tlsconnection.hg b/gio/src/tlsconnection.hg
index 0d35ca8..0c5e670 100644
--- a/gio/src/tlsconnection.hg
+++ b/gio/src/tlsconnection.hg
@@ -93,11 +93,11 @@ public:
#m4 _CONVERSION(`GTlsCertificate*',`const Glib::RefPtr<const TlsCertificate>&',`Glib::wrap($3, true)')
_WRAP_SIGNAL(bool accept_certificate(const Glib::RefPtr<const TlsCertificate>& peer_cert, TlsCertificateFlags errors), "accept_certificate")
-/* TODO:
- _WRAP_VFUNC(bool handshake(const Glib::RefPtr<GCancellable>& cancellable), "handshake", errthrow)
- _WRAP_VFUNC(void handshake_async(int io_priority, const Glib::RefPtr<GCancellable>& cancellable, GAsyncReadyCallback callback, gpointer user_data), "handshake_async")
- _WRAP_VFUNC(bool handshake_finish(const Glib::RefPtr<GAsyncResult>& result), "handshake_finish", errthrow)
-*/
+ _WRAP_VFUNC(bool handshake(const Glib::RefPtr<Cancellable>& cancellable), "handshake", errthrow)
+ _WRAP_VFUNC(void handshake_async(const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.}, int io_priority{.} = Glib::PRIORITY_DEFAULT), "handshake_async", slot_name slot, slot_callback SignalProxy_async_callback)
+
+#m4 _CONVERSION(`GAsyncResult*',`const Glib::RefPtr<AsyncResult>&',`Glib::wrap($3, true)')
+ _WRAP_VFUNC(bool handshake_finish(const Glib::RefPtr<AsyncResult>& result), "handshake_finish", errthrow)
};
} // namespace Gio
diff --git a/tools/m4/vfunc.m4 b/tools/m4/vfunc.m4
index 53f8714..061ba5c 100644
--- a/tools/m4/vfunc.m4
+++ b/tools/m4/vfunc.m4
@@ -93,12 +93,12 @@ dnl g_assert(base != 0);
// Call the original underlying C function:
if(base && base->$2)
{
- ifelse($4,void,,`$4 result = ')(*base->$2)`'($6);
+ ifelse($4,void,,`$4 retval = ')(*base->$2)`'($6);
ifelse($11,errthrow,`dnl
if(*error)
::Glib::Error::throw_exception(*error);
')dnl
-ifelse($4,void,,` return result;
+ifelse($4,void,,` return retval;
')dnl
}
@@ -150,15 +150,15 @@ ifelse($3,void,`dnl
}
',`dnl
ifelse($8,refreturn,`dnl Assume Glib::wrap() is correct if refreturn is requested.
- $3 result(Glib::wrap((*base->$2)`'(ifelse(`$7',1,const_cast<__CNAME__*>(gobj()),gobj())`'_COMMA_PREFIX($6)), true));
+ $3 retval(Glib::wrap((*base->$2)`'(ifelse(`$7',1,const_cast<__CNAME__*>(gobj()),gobj())`'_COMMA_PREFIX($6)), true));
',`dnl
- $3 result(_CONVERT($4,$3,`(*base->$2)`'(ifelse(`$7',1,const_cast<__CNAME__*>(gobj()),gobj())`'_COMMA_PREFIX($6))'));
+ $3 retval(_CONVERT($4,$3,`(*base->$2)`'(ifelse(`$7',1,const_cast<__CNAME__*>(gobj()),gobj())`'_COMMA_PREFIX($6))'));
')dnl
ifelse($10,errthrow,`dnl
if(gerror)
::Glib::Error::throw_exception(gerror);
')dnl
- return result;
+ return retval;
}
typedef $3 RType;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]