From 053d2f630767e99cb24de5db822cfcb3fe7ff037 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Sun, 6 Sep 2020 23:39:58 -0700 Subject: [PATCH] Imported Upstream version 2.35.9 --- ChangeLog | 76 ++++++++++++++++++++++++++++++++++++++++ NEWS | 28 ++++++++++++++- configure.ac | 4 +-- gio/src/appinfo.hg | 2 +- gio/src/tlscertificate.ccg | 1 + gio/src/tlscertificate.hg | 14 ++++++-- gio/src/tlsclientconnection.hg | 7 ++-- gio/src/tlsdatabase.hg | 57 ++++++++++++++++++++++-------- gio/src/tlsfiledatabase.ccg | 5 --- gio/src/tlsfiledatabase.hg | 9 +++-- gio/src/tlsinteraction.hg | 8 +++-- gio/src/tlspassword.hg | 3 +- glib/glibmm.h | 2 ++ glib/src/bytearray.ccg | 46 ++++++++++++++++++++++++ glib/src/bytearray.hg | 70 ++++++++++++++++++++++++++++++++++++ glib/src/filelist.am | 1 + glib/src/glib_extra_objects.defs | 5 +++ tools/m4/convert_gio.m4 | 4 ++- tools/m4/convert_glib.m4 | 3 ++ 19 files changed, 309 insertions(+), 36 deletions(-) create mode 100644 glib/src/bytearray.ccg create mode 100644 glib/src/bytearray.hg diff --git a/ChangeLog b/ChangeLog index 57a2ef9..7e711db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,79 @@ +2.35.9: + +2013-03-13 José Alburquerque + + TlsFileDatabase: Use _WRAP_METHOD() to wrap the create() method. + + * gio/src/tlsfiledatabase.{ccg,hg}: It can't be properly wrapped using + _WRAP_CTOR()/WRAP_CREATE() yet but it can be wrapped using + _WRAP_METHOD(). (I don't know why I thought it had to be + handwrapped.) + +2013-03-12 José Alburquerque + + TlsFileDatabase: Add a TODO. + + * gio/src/tlsfiledatabase.hg: + +2013-03-12 José Alburquerque + + TlsFileDatabase: Wrap the create() method. + + * gio/src/tlsfiledatabase.{ccg,hg}: Manually wrap it because + presently the *_new() function does more than call g_initable_new(). + +2013-02-26 José Alburquerque + + Tls*: Add the rest of the (unwrapped) properties, methods and vfuncs. + + * gio/src/tlscertificate.{ccg,hg}: Wrap the "certificate" property. + * gio/src/tlsclientconnection.hg: Add the get_accepted_cas() methods + and the "accepted-cas" property. + * gio/src/tlsdatabase.hg: Add the lookup_certificates_issued_by*() + methods and virtual functions. Correct a TlsCertificate conversion + for the virtual functions so that the underlying GObject is properly + copied from the C++ wrapper. + * tools/m4/convert_gio.m4: Add a ByteArray conversion. + + * gio/src/tlspassword.hg: Clarify a TODO. + + * glib/glibmm.h: Add bytes.h and bytearray.h to the includes. + +2013-02-25 José Alburquerque + + glibmm: Add ByteArray. + + * glib/src/bytearray.{ccg,hg}: + * glib/src/filelist.am: Add the new sources for the ByteArray class + that wraps GByteArray and include the sources in the build. Some of + the GTls* API uses GByteArray so it is necessary to wrap it. + * glib/src/glib_extra_objects.defs: Include an object definition for + GByteArray to avoid a gmmproc documentation warning. + * tools/m4/convert_glib.m4: Add a GByteArray conversion so the sources + can be processed properly. + +2013-02-25 Pavel Vasin + + AppInfo::get_all(): Fix ownerships + + Bug #694505 + +2013-02-25 José Alburquerque + + TlsDatabase: Virtual function const correction. + + * gio/src/tlsdatabase.hg (create_certificate_handle_vfunc): Make it + const because it does not modify the database. + +2013-02-24 José Alburquerque + + Tls[Database|Interaction]: Add the virtual functions. + + * gio/src/tlsdatabase.hg: + * gio/src/tlsinteraction.hg: Add the virtual functions. It is + necessary to wrap GByteArray to wrap the remaining three virtual + functions of TlsDatabase. + 2.35.8 (unstable); 2013-02-21 Murray Cumming diff --git a/NEWS b/NEWS index 821d0a2..5eef451 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,30 @@ -2.35.8 (unstable); +2.35.9 (unstable): + +Glib: +* Add edByteArray, because it is used in the GTls* API. + (José Alburquerque) +* AppInfo::get_all(): Fix ownerships. + (Pavel Vasi) Bug #694505 + + +Gio: +* TlsFileDatabase: Add the create() method. + (José Alburquerque) +* TlsCertificate: Add the certificate property. + (José Alburquerque) +* TlsClientConnection: Add get_accepted_cas() + and the "accepted-cas" property. + (José Alburquerque) +* TlsDatabase: Add the lookup_certificates_issued_by*() + methods and virtual functions. Correct a TlsCertificate conversion + for the virtual functions so that the underlying GObject is properly + copied from the C++ wrapper. + (José Alburquerque) +* TlsInteraction: Add the virtual functions. + (José Alburquerque) + + +2.35.8 (unstable): Glib: * Resolver: Add lookup_records(), lookup_records_async() diff --git a/configure.ac b/configure.ac index 3daade8..f51e3fd 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ ## You should have received a copy of the GNU Lesser General Public License ## along with this library. If not, see . -AC_INIT([glibmm], [2.35.8], +AC_INIT([glibmm], [2.35.9], [http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm], [glibmm], [http://www.gtkmm.org/]) AC_PREREQ([2.59]) @@ -60,7 +60,7 @@ AS_IF([test "x$enable_static" = xyes], AC_DEFINE([GIOMM_STATIC_LIB], [1], [Define if giomm is built as a static library]) ]) -glibreq='2.0 >= 2.35.8' +glibreq='2.0 >= 2.35.9' GLIBMM_MODULES="sigc++-2.0 >= 2.2.10 glib-$glibreq gobject-$glibreq gmodule-$glibreq" GIOMM_MODULES="$GLIBMM_MODULES gio-$glibreq" diff --git a/gio/src/appinfo.hg b/gio/src/appinfo.hg index 77c8093..4045757 100644 --- a/gio/src/appinfo.hg +++ b/gio/src/appinfo.hg @@ -212,7 +212,7 @@ public: _WRAP_METHOD(bool set_as_last_used_for_type(const std::string& content_type), g_app_info_set_as_last_used_for_type, errthrow) -#m4 _CONVERSION(`GList*',`Glib::ListHandle >',`Glib::ListHandle >($3, Glib::OWNERSHIP_SHALLOW)') +#m4 _CONVERSION(`GList*',`Glib::ListHandle >',`Glib::ListHandle >($3, Glib::OWNERSHIP_DEEP)') _WRAP_METHOD(static Glib::ListHandle > get_all(), g_app_info_get_all) _WRAP_METHOD(static Glib::ListHandle > get_all_for_type(const std::string& content_type), g_app_info_get_all_for_type) diff --git a/gio/src/tlscertificate.ccg b/gio/src/tlscertificate.ccg index 7225d99..d0262cd 100644 --- a/gio/src/tlscertificate.ccg +++ b/gio/src/tlscertificate.ccg @@ -16,4 +16,5 @@ */ #include +#include #include diff --git a/gio/src/tlscertificate.hg b/gio/src/tlscertificate.hg index 98e581f..a1ff368 100644 --- a/gio/src/tlscertificate.hg +++ b/gio/src/tlscertificate.hg @@ -21,6 +21,14 @@ _DEFS(giomm,gio) _PINCLUDE(glibmm/private/object_p.h) +namespace Glib +{ + +// Forward declaration. +class ByteArray; + +} + namespace Gio { @@ -61,12 +69,12 @@ public: _WRAP_METHOD(TlsCertificateFlags verify(const Glib::RefPtr& identity{?}, const Glib::RefPtr& trusted_ca{?}) const, g_tls_certificate_verify) _WRAP_METHOD(bool is_same(const Glib::RefPtr& cert_two) const, g_tls_certificate_is_same) - //TODO: _WRAP_PROPERTY("certificate", GByteArray*) - + _WRAP_PROPERTY("certificate", Glib::RefPtr) _WRAP_PROPERTY("certificate-pem", char*) _WRAP_PROPERTY("issuer", Glib::RefPtr) - //TODO: _WRAP_PROPERTY("private-key", GByteArray*) + // Write-only and construct-only + //_WRAP_PROPERTY("private-key", Glib::RefPtr) // Write-only and construct-only //_WRAP_PROPERTY("private-key-pem", char*) diff --git a/gio/src/tlsclientconnection.hg b/gio/src/tlsclientconnection.hg index 57da809..dd454a1 100644 --- a/gio/src/tlsclientconnection.hg +++ b/gio/src/tlsclientconnection.hg @@ -55,10 +55,13 @@ public: _WRAP_METHOD(void set_use_ssl3(bool use_ssl3), g_tls_client_connection_set_use_ssl3) _WRAP_METHOD(bool get_use_ssl3() const, g_tls_client_connection_get_use_ssl3) - //TODO: _WRAP_METHOD(GList* get_accepted_cas(), g_tls_client_connection_get_accepted_cas) +#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr >',`Glib::ListHandler< Glib::RefPtr >::list_to_vector($3, Glib::OWNERSHIP_DEEP)') + _WRAP_METHOD(std::vector< Glib::RefPtr > get_accepted_cas(), g_tls_client_connection_get_accepted_cas) - //TODO: _WRAP_PROPERTY("accepted-cas", gpointer) +#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr >',`Glib::ListHandler< Glib::RefPtr >::list_to_vector($3, Glib::OWNERSHIP_DEEP)') + _WRAP_METHOD(std::vector< Glib::RefPtr > get_accepted_cas() const, g_tls_client_connection_get_accepted_cas) + _WRAP_PROPERTY("accepted-cas", std::vector< Glib::RefPtr >) _WRAP_PROPERTY("server-identity", Glib::RefPtr) _WRAP_PROPERTY("use-ssl3", bool) _WRAP_PROPERTY("validation-flags", TlsCertificateFlags) diff --git a/gio/src/tlsdatabase.hg b/gio/src/tlsdatabase.hg index 6f3c01f..2463491 100644 --- a/gio/src/tlsdatabase.hg +++ b/gio/src/tlsdatabase.hg @@ -23,6 +23,14 @@ _DEFS(giomm,gio) _PINCLUDE(glibmm/private/object_p.h) +namespace Glib +{ + +// Forward declaration. +class ByteArray; + +} + namespace Gio { @@ -65,9 +73,14 @@ public: _WRAP_METHOD(void lookup_certificate_issuer_async(const Glib::RefPtr& certificate, const Glib::RefPtr& interaction, const SlotAsyncReady& slot{callback}, const Glib::RefPtr& cancellable{.?}, TlsDatabaseLookupFlags flags{.} = TLS_DATABASE_LOOKUP_NONE), g_tls_database_lookup_certificate_issuer_async, slot_name slot, slot_callback SignalProxy_async_callback) _WRAP_METHOD(Glib::RefPtr lookup_certificate_issuer_finish(const Glib::RefPtr& result), g_tls_database_lookup_certificate_issuer_finish, errthrow) - //TODO: _WRAP_METHOD(GList* lookup_certificates_issued_by(GByteArray* issuer_raw_dn, const Glib::RefPtr& interaction, TlsDatabaseLookupFlags flags, const Glib::RefPtr& cancellable), g_tls_database_lookup_certificates_issued_by, errthrow) - //TODO: _WRAP_METHOD(void lookup_certificates_issued_by_async(GByteArray* issuer_raw_dn, const Glib::RefPtr& interaction, TlsDatabaseLookupFlags flags, const Glib::RefPtr& cancellable, const SlotAsyncReady& slot, gpointer user_data), g_tls_database_lookup_certificates_issued_by_async) - //TODO: _WRAP_METHOD(GList* lookup_certificates_issued_by_finish(const Glib::RefPtr& result), g_tls_database_lookup_certificates_issued_by_finish, errthrow) +#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr >',`Glib::ListHandler< Glib::RefPtr >::list_to_vector($3, Glib::OWNERSHIP_DEEP)') + _WRAP_METHOD(std::vector< Glib::RefPtr > lookup_certificates_issued_by(const Glib::RefPtr& issuer_raw_dn, const Glib::RefPtr& interaction, const Glib::RefPtr& cancellable{.}, TlsDatabaseLookupFlags flags{.} = Gio::TLS_DATABASE_LOOKUP_NONE), g_tls_database_lookup_certificates_issued_by, errthrow) + +#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr >',`Glib::ListHandler< Glib::RefPtr >::list_to_vector($3, Glib::OWNERSHIP_DEEP)') + _WRAP_METHOD(std::vector< Glib::RefPtr > lookup_certificates_issued_by(const Glib::RefPtr& issuer_raw_dn, const Glib::RefPtr& interaction, const Glib::RefPtr& cancellable{.}, TlsDatabaseLookupFlags flags{.} = Gio::TLS_DATABASE_LOOKUP_NONE) const, g_tls_database_lookup_certificates_issued_by, errthrow) + + _WRAP_METHOD(void lookup_certificates_issued_by_async(const Glib::RefPtr& issuer_raw_dn, const Glib::RefPtr& interaction, const SlotAsyncReady& slot{callback}, const Glib::RefPtr& cancellable{.}, TlsDatabaseLookupFlags flags{.} = Gio::TLS_DATABASE_LOOKUP_NONE), g_tls_database_lookup_certificates_issued_by_async, slot_name slot, slot_callback SignalProxy_async_callback) + _WRAP_METHOD(std::vector< Glib::RefPtr > lookup_certificates_issued_by_finish(const Glib::RefPtr& result), g_tls_database_lookup_certificates_issued_by_finish, errthrow) _WRAP_METHOD(Glib::ustring create_certificate_handle(const Glib::RefPtr& certificate) const, g_tls_database_create_certificate_handle) @@ -77,21 +90,35 @@ public: _WRAP_METHOD(void lookup_certificate_for_handle_async(const Glib::ustring& handle, const Glib::RefPtr& interaction, const SlotAsyncReady& slot{callback}, const Glib::RefPtr& cancellable{.?}, TlsDatabaseLookupFlags flags{.} = TLS_DATABASE_LOOKUP_NONE), g_tls_database_lookup_certificate_for_handle_async, slot_name slot, slot_callback SignalProxy_async_callback) _WRAP_METHOD(Glib::RefPtr lookup_certificate_for_handle_finish(const Glib::RefPtr& result), g_tls_database_lookup_certificate_for_handle_finish, errthrow) -/* TODO: - _WRAP_VFUNC(TlsCertificateFlags verify_chain(const Glib::RefPtr& chain, const Glib::ustring& purpose, const Glib::RefPtr& identity, const Glib::RefPtr& interaction, TlsDatabaseVerifyFlags flags, const Glib::RefPtr& cancellable), "verify_chain", errthrow) - _WRAP_VFUNC(void verify_chain_async(const Glib::RefPtr& chain, const Glib::ustring& purpose, const Glib::RefPtr& identity, const Glib::RefPtr& interaction, TlsDatabaseVerifyFlags flags, const Glib::RefPtr& cancellable, const SlotAsyncReady& slot, gpointer user_data), "verify_chain_async") +#m4 _CONVERSION(`GTlsCertificate*',`const Glib::RefPtr&',`Glib::wrap($3, true)') +#m4 _CONVERSION(`GSocketConnectable*',`const Glib::RefPtr&',`Glib::wrap($3, true)') +#m4 _CONVERSION(`GTlsInteraction*',`const Glib::RefPtr&',`Glib::wrap($3, true)') + + _WRAP_VFUNC(TlsCertificateFlags verify_chain(const Glib::RefPtr& chain, const Glib::ustring& purpose, const Glib::RefPtr& identity, const Glib::RefPtr& interaction, const Glib::RefPtr& cancellable{.}, TlsDatabaseVerifyFlags flags{.}), "verify_chain", errthrow) + _WRAP_VFUNC(void verify_chain_async(const Glib::RefPtr& chain, const Glib::ustring& purpose, const Glib::RefPtr& identity, const Glib::RefPtr& interaction, const SlotAsyncReady& slot{callback}, const Glib::RefPtr& cancellable{.}, TlsDatabaseVerifyFlags flags{.}), "verify_chain_async", slot_name slot, slot_callback SignalProxy_async_callback) + +#m4 _CONVERSION(`GAsyncResult*',`const Glib::RefPtr&',`Glib::wrap($3, true)') + _WRAP_VFUNC(TlsCertificateFlags verify_chain_finish(const Glib::RefPtr& result), "verify_chain_finish", errthrow) - _WRAP_VFUNC(Glib::ustring create_certificate_handle(const Glib::RefPtr& certificate), "create_certificate_handle") - _WRAP_VFUNC(Glib::RefPtr lookup_certificate_for_handle(const Glib::ustring& handle, const Glib::RefPtr& interaction, TlsDatabaseLookupFlags flags, const Glib::RefPtr& cancellable), "lookup_certificate_for_handle", errthrow) - _WRAP_VFUNC(void lookup_certificate_for_handle_async(const Glib::ustring& handle, const Glib::RefPtr& interaction, TlsDatabaseLookupFlags flags, const Glib::RefPtr& cancellable, const SlotAsyncReady& slot, gpointer user_data), "lookup_certificate_for_handle_async") + + _WRAP_VFUNC(Glib::ustring create_certificate_handle(const Glib::RefPtr& certificate) const, "create_certificate_handle") + +#m4 _CONVERSION(`Glib::RefPtr',`GTlsCertificate*',`G_TLS_CERTIFICATE(g_object_ref(Glib::unwrap($3)))') + + _WRAP_VFUNC(Glib::RefPtr lookup_certificate_for_handle(const Glib::ustring& handle, const Glib::RefPtr& interaction, const Glib::RefPtr& cancellable{.}, TlsDatabaseLookupFlags flags{.}), "lookup_certificate_for_handle", errthrow) + _WRAP_VFUNC(void lookup_certificate_for_handle_async(const Glib::ustring& handle, const Glib::RefPtr& interaction, const SlotAsyncReady& slot{callback}, const Glib::RefPtr& cancellable{.}, TlsDatabaseLookupFlags flags{.}), "lookup_certificate_for_handle_async", slot_name slot, slot_callback SignalProxy_async_callback) _WRAP_VFUNC(Glib::RefPtr lookup_certificate_for_handle_finish(const Glib::RefPtr& result), "lookup_certificate_for_handle_finish", errthrow) - _WRAP_VFUNC(Glib::RefPtr lookup_certificate_issuer(const Glib::RefPtr& certificate, const Glib::RefPtr& interaction, TlsDatabaseLookupFlags flags, const Glib::RefPtr& cancellable), "lookup_certificate_issuer", errthrow) - _WRAP_VFUNC(void lookup_certificate_issuer_async(const Glib::RefPtr& certificate, const Glib::RefPtr& interaction, TlsDatabaseLookupFlags flags, const Glib::RefPtr& cancellable, const SlotAsyncReady& slot, gpointer user_data), "lookup_certificate_issuer_async") + + _WRAP_VFUNC(Glib::RefPtr lookup_certificate_issuer(const Glib::RefPtr& certificate, const Glib::RefPtr& interaction, const Glib::RefPtr& cancellable{.}, TlsDatabaseLookupFlags flags{.}), "lookup_certificate_issuer", errthrow) + _WRAP_VFUNC(void lookup_certificate_issuer_async(const Glib::RefPtr& certificate, const Glib::RefPtr& interaction, const SlotAsyncReady& slot{callback}, const Glib::RefPtr& cancellable{.}, TlsDatabaseLookupFlags flags{.}), "lookup_certificate_issuer_async", slot_name slot, slot_callback SignalProxy_async_callback) _WRAP_VFUNC(Glib::RefPtr lookup_certificate_issuer_finish(const Glib::RefPtr& result), "lookup_certificate_issuer_finish", errthrow) - _WRAP_VFUNC(GList* lookup_certificates_issued_by(GByteArray* issuer_raw_dn, const Glib::RefPtr& interaction, TlsDatabaseLookupFlags flags, const Glib::RefPtr& cancellable), "lookup_certificates_issued_by", errthrow) - _WRAP_VFUNC(void lookup_certificates_issued_by_async(GByteArray* issuer_raw_dn, const Glib::RefPtr& interaction, TlsDatabaseLookupFlags flags, const Glib::RefPtr& cancellable, const SlotAsyncReady& slot, gpointer user_data), "lookup_certificates_issued_by_async") - _WRAP_VFUNC(GList* lookup_certificates_issued_by_finish(const Glib::RefPtr& result), "lookup_certificates_issued_by_finish", errthrow) -*/ + +#m4 _CONVERSION(`std::vector< Glib::RefPtr >',`GList*',`g_list_copy(Glib::ListHandler< Glib::RefPtr >::vector_to_list($3).data())') +#m4 _CONVERSION(`GByteArray*',`const Glib::RefPtr&',`Glib::wrap($3, true)') + + _WRAP_VFUNC(std::vector< Glib::RefPtr > lookup_certificates_issued_by(const Glib::RefPtr& issuer_raw_dn, const Glib::RefPtr& interaction, const Glib::RefPtr& cancellable{.}, TlsDatabaseLookupFlags flags{.}), "lookup_certificates_issued_by", errthrow) + _WRAP_VFUNC(void lookup_certificates_issued_by_async(const Glib::RefPtr& issuer_raw_dn, const Glib::RefPtr& interaction, const SlotAsyncReady& slot{callback}, const Glib::RefPtr& cancellable{.}, TlsDatabaseLookupFlags flags{.}), "lookup_certificates_issued_by_async", slot_name slot, slot_callback SignalProxy_async_callback) + _WRAP_VFUNC(std::vector< Glib::RefPtr > lookup_certificates_issued_by_finish(const Glib::RefPtr& result), "lookup_certificates_issued_by_finish", errthrow) }; } // namespace Gio diff --git a/gio/src/tlsfiledatabase.ccg b/gio/src/tlsfiledatabase.ccg index 22171e0..d76f332 100644 --- a/gio/src/tlsfiledatabase.ccg +++ b/gio/src/tlsfiledatabase.ccg @@ -16,8 +16,3 @@ */ #include - -namespace Gio -{ - -} // namespace Gio diff --git a/gio/src/tlsfiledatabase.hg b/gio/src/tlsfiledatabase.hg index 2c5d9f8..e5fe0f0 100644 --- a/gio/src/tlsfiledatabase.hg +++ b/gio/src/tlsfiledatabase.hg @@ -39,8 +39,13 @@ class TlsFileDatabase : public Glib::Interface _CLASS_INTERFACE(TlsFileDatabase, GTlsFileDatabase, G_TLS_FILE_DATABASE, GTlsFileDatabaseInterface) public: - //TODO: Wrap the the g_tls_file_database_new() C function which returns a - //GTlsDatabase* and does more than calling g_initable_new(). + //TODO: Should this create() method be in TlsDatabase since the _new() + //function returns a GTlsDatabase? + //TODO: Wrap this using _WRAP_CTR()/WRAP_CREATE() when the + //g_tls_file_database_new() function does not do more than calling + //g_initable_new(). +#m4 _CONVERSION(`GTlsDatabase*',`Glib::RefPtr',`Glib::wrap(G_TLS_FILE_DATABASE($3))') + _WRAP_METHOD(static Glib::RefPtr create(const Glib::ustring& anchors), g_tls_file_database_new, errthrow) _WRAP_PROPERTY("anchors", Glib::ustring) }; diff --git a/gio/src/tlsinteraction.hg b/gio/src/tlsinteraction.hg index 7310e36..37ad491 100644 --- a/gio/src/tlsinteraction.hg +++ b/gio/src/tlsinteraction.hg @@ -20,6 +20,7 @@ _DEFS(giomm,gio) _PINCLUDE(glibmm/private/object_p.h) +_PINCLUDE(gio/gio.h) namespace Gio { @@ -64,11 +65,12 @@ public: _WRAP_METHOD(TlsInteractionResult ask_password_finish(const Glib::RefPtr& result), g_tls_interaction_ask_password_finish, errthrow) _WRAP_METHOD(TlsInteractionResult invoke_ask_password(const Glib::RefPtr& password, const Glib::RefPtr& cancellable{?}), g_tls_interaction_invoke_ask_password, errthrow) -/* TODO: +#m4 _CONVERSION(`GTlsPassword*',`const Glib::RefPtr&',`Glib::wrap($3, true)') _WRAP_VFUNC(TlsInteractionResult ask_password(const Glib::RefPtr& password, const Glib::RefPtr& cancellable), "ask_password", errthrow) - _WRAP_VFUNC(void ask_password_async(const Glib::RefPtr& password, const SlotAsyncReady& slot, const Glib::RefPtr& cancellable), "ask_password_async") + _WRAP_VFUNC(void ask_password_async(const Glib::RefPtr& password, const SlotAsyncReady& slot{callback}, const Glib::RefPtr& cancellable{.}), "ask_password_async", slot_name slot, slot_callback SignalProxy_async_callback) + +#m4 _CONVERSION(`GAsyncResult*',`const Glib::RefPtr&',`Glib::wrap($3, true)') _WRAP_VFUNC(TlsInteractionResult ask_password_finish(const Glib::RefPtr& result), "ask_password_finish", errthrow) -*/ }; } // namespace Gio diff --git a/gio/src/tlspassword.hg b/gio/src/tlspassword.hg index e9dfd70..96ccdaa 100644 --- a/gio/src/tlspassword.hg +++ b/gio/src/tlspassword.hg @@ -41,6 +41,7 @@ public: _WRAP_CREATE(TlsPasswordFlags flags, const Glib::ustring& description) _WRAP_METHOD(const guchar* get_value(gsize& length{?}) const, g_tls_password_get_value) + _WRAP_METHOD(void set_value(const guchar* value, gssize length = -1), g_tls_password_set_value) // This function does not copy the value as g_tls_password_set_value() does. // It keeps a reference to the original value and expects it to be freed @@ -63,7 +64,7 @@ public: #m4 _CONVERSION(`gsize*', `gsize&', `*($3)') _WRAP_VFUNC(const guchar* get_value(gsize& length) const, "get_value") - //TODO: _WRAP_VFUNC(void set_value(guchar* value, gssize length, GDestroyNotify destroy), "set_value") + //TODO? (See g_tls_password_set_value_full() comment above): _WRAP_VFUNC(void set_value(guchar* value, gssize length, GDestroyNotify destroy), "set_value") #m4 _CONVERSION(`Glib::ustring', `const gchar*', `g_strdup($3.c_str())') _WRAP_VFUNC(Glib::ustring get_default_warning() const, "get_default_warning") diff --git a/glib/glibmm.h b/glib/glibmm.h index 9fb35e8..825b209 100644 --- a/glib/glibmm.h +++ b/glib/glibmm.h @@ -90,6 +90,8 @@ #include #include +#include +#include #include #include #include diff --git a/glib/src/bytearray.ccg b/glib/src/bytearray.ccg new file mode 100644 index 0000000..71a0d5f --- /dev/null +++ b/glib/src/bytearray.ccg @@ -0,0 +1,46 @@ +/* Copyright (C) 2013 The glibmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +namespace +{ + +extern "C" +{ + +int ByteArray_Compare_Data_Func(gconstpointer a, gconstpointer b, + gpointer user_data) +{ + Glib::ByteArray::SlotCompare* slot = + static_cast(user_data); + + return (*slot)(static_cast(a), static_cast(b)); +} + +} + +} + +namespace Glib +{ + +Glib::RefPtr ByteArray::create() +{ + GByteArray* array = g_byte_array_new(); + return Glib::wrap(array); +} + +} // namespace Glib diff --git a/glib/src/bytearray.hg b/glib/src/bytearray.hg new file mode 100644 index 0000000..8cd6555 --- /dev/null +++ b/glib/src/bytearray.hg @@ -0,0 +1,70 @@ +/* Copyright (C) 2013 The glibmm Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +_DEFS(glibmm,glib) + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _GByteArray GByteArray; +#endif + +namespace Glib +{ + +/** ByteArray - Arrays of bytes. + * ByteArray is a mutable array of bytes, to provide arrays of bytes which grow + * automatically as elements are added. + * + * To create a new ByteArray use create(). To add elements to a ByteArray, use + * append(), and prepend(). + * + * To set the size of a ByteArray, use set_size(). + * + * @newin{2,36} + */ +class ByteArray +{ + _CLASS_OPAQUE_REFCOUNTED(ByteArray, GByteArray, NONE, g_byte_array_ref, g_byte_array_unref) + _IGNORE(g_byte_array_ref, g_byte_array_unref) +public: + /** A Slot type to compare two elements in the array. The slot should return + * -1 if the first value is less than the second, 0 if they are equal and 1 + * if the first value is greater than the second. + * + * Slot Prototype: + * + * + * int compare(const guint8* first, const guint8* second); + * + */ + typedef sigc::slot SlotCompare; + + _WRAP_METHOD_DOCS_ONLY(g_byte_array_new) + static Glib::RefPtr create(); + + _WRAP_METHOD(Glib::RefPtr append(const guint8* data, guint len), g_byte_array_append) + _WRAP_METHOD(Glib::RefPtr prepend(const guint8* data, guint len), g_byte_array_prepend) + _WRAP_METHOD(Glib::RefPtr remove_index(guint index_), g_byte_array_remove_index) + _WRAP_METHOD(Glib::RefPtr remove_index_fast(guint index_), g_byte_array_remove_index_fast) + _WRAP_METHOD(Glib::RefPtr remove_range(guint index_, guint length), g_byte_array_remove_range) + + _WRAP_METHOD(void sort(const SlotCompare& slot), g_byte_array_sort_with_data, slot_name slot, slot_callback ByteArray_Compare_Data_Func, no_slot_copy) + _IGNORE(g_byte_array_sort) + + _WRAP_METHOD(Glib::RefPtr set_size(guint length), g_byte_array_set_size) +}; + +} // namespace Glib diff --git a/glib/src/filelist.am b/glib/src/filelist.am index 64b8b60..0c5ef5d 100644 --- a/glib/src/filelist.am +++ b/glib/src/filelist.am @@ -18,6 +18,7 @@ glibmm_files_defs = \ glibmm_files_hg = \ balancedtree.hg \ bytes.hg \ + bytearray.hg \ checksum.hg \ convert.hg \ date.hg \ diff --git a/glib/src/glib_extra_objects.defs b/glib/src/glib_extra_objects.defs index d173edc..1774ec4 100644 --- a/glib/src/glib_extra_objects.defs +++ b/glib/src/glib_extra_objects.defs @@ -6,6 +6,11 @@ ; that are mentioned in documentation text. ; (DocsParser.pm:substitute_function(), which uses GtkDefs.pm:lookup_object().) +(define-object ByteArray + (in-module "GLib") + (c-name "GByteArray") +) + (define-object Checksum (in-module "GLib") (c-name "GChecksum") diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4 index 4fac16d..9e3148b 100644 --- a/tools/m4/convert_gio.m4 +++ b/tools/m4/convert_gio.m4 @@ -73,10 +73,12 @@ _CONVERSION(`const Glib::RefPtr&',`GApplicationCommandLi # AsyncResult _CONVERSION(`Glib::RefPtr',`GObject*',__CONVERT_REFPTR_TO_P) - _CONVERSION(`const Glib::RefPtr&',`GAsyncResult*',__CONVERT_REFPTR_TO_P) _CONVERSION(`Glib::RefPtr&',`GAsyncResult*',__CONVERT_REFPTR_TO_P) +#ByteArray +_CONVERSION(`const Glib::RefPtr&',`GByteArray*',`Glib::unwrap($3)') + # Cancellable _CONVERSION(`const Glib::RefPtr&',`GCancellable*',__CONVERT_CONST_REFPTR_TO_P) _CONVERSION(`const Glib::RefPtr&',`GCancellable*',__CONVERT_CONST_REFPTR_TO_P) diff --git a/tools/m4/convert_glib.m4 b/tools/m4/convert_glib.m4 index 5e36245..810d781 100644 --- a/tools/m4/convert_glib.m4 +++ b/tools/m4/convert_glib.m4 @@ -127,6 +127,9 @@ _CONVERSION(`GBytes*',`Glib::RefPtr',`Glib::wrap($3)') _CONVERSION(`GBytes*',`Glib::RefPtr',`Glib::wrap($3)') _CONVERSION(`const Glib::RefPtr&',`GBytes*',__CONVERT_CONST_REFPTR_TO_P_SUN(Glib::Bytes))) +dnl ByteArray +_CONVERSION(`GByteArray*',`Glib::RefPtr',`Glib::wrap($3)') + dnl Regex _CONVERSION(`GRegex*',`Glib::RefPtr',`Glib::wrap($3)') _CONVERSION(`GRegex*',`Glib::RefPtr',`Glib::wrap($3)') -- 2.7.4