[glibmm] giomm: Add the TlsPassword class.



commit ac6031bee7c386817d20d95604ea85a1992886fa
Author: Josà Alburquerque <jaalburqu svn gnome org>
Date:   Tue Nov 13 20:29:00 2012 -0500

    giomm: Add the TlsPassword class.
    
    	* gio/src/tlspassword.{ccg,hg}:
    	* gio/src/filelist.am: Add the new sources containing the constructor,
    	methods, properties and virtual functions and include the sources in
    	the build.
    	* gio/src/gio_vfuncs.defs: Add the GTlsPassword virtual functions so
    	that they are recognized by gmmproc.
    	* tools/m4/convert_gio.m4: Add an enum conversion.

 ChangeLog               |   12 ++++++++
 gio/src/filelist.am     |    1 +
 gio/src/gio_vfuncs.defs |   27 ++++++++++++++++-
 gio/src/tlspassword.ccg |   18 ++++++++++++
 gio/src/tlspassword.hg  |   72 +++++++++++++++++++++++++++++++++++++++++++++++
 tools/m4/convert_gio.m4 |    1 +
 6 files changed, 129 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 56b8eca..76e5e60 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2012-11-13  Josà Alburquerque  <jaalburquerque gmail com>
 
+	giomm: Add the TlsPassword class.
+
+	* gio/src/tlspassword.{ccg,hg}:
+	* gio/src/filelist.am: Add the new sources containing the constructor,
+	methods, properties and virtual functions and include the sources in
+	the build.
+	* gio/src/gio_vfuncs.defs: Add the GTlsPassword virtual functions so
+	that they are recognized by gmmproc.
+	* tools/m4/convert_gio.m4: Add an enum conversion.
+
+2012-11-13  Josà Alburquerque  <jaalburquerque gmail com>
+
 	giomm: Add the GTls* GTypes to the extra defs generation utility.
 
 	* tools/extra_defs_gen/generate_defs_gio.cc: Add the GTypes.
diff --git a/gio/src/filelist.am b/gio/src/filelist.am
index f07b380..3a9d479 100644
--- a/gio/src/filelist.am
+++ b/gio/src/filelist.am
@@ -114,6 +114,7 @@ giomm_files_any_hg =			\
 	threadedsocketservice.hg	\
 	themedicon.hg			\
 	tlscertificate.hg		\
+	tlspassword.hg			\
 	volume.hg			\
 	volumemonitor.hg		\
 	zlibdecompressor.hg		\
diff --git a/gio/src/gio_vfuncs.defs b/gio/src/gio_vfuncs.defs
index 31acf6f..94e6fec 100644
--- a/gio/src/gio_vfuncs.defs
+++ b/gio/src/gio_vfuncs.defs
@@ -725,6 +725,31 @@
  )
 )
 
+; GTlsPassword
+
+(define-vfunc get_value
+  (of-object "GTlsPassword")
+  (return-type "const-guchar*")
+  (parameters
+   '("gsize*" "length")
+  )
+)
+
+(define-vfunc set_value
+  (of-object "GTlsPassword")
+  (return-type "void")
+  (parameters
+   '("guchar*" "value")
+   '("gssize" "length")
+   '("GDestroyNotify" "destroy")
+  )
+)
+
+(define-vfunc get_default_warning
+  (of-object "GTlsPassword")
+  (return-type "const-gchar*")
+)
+
 ; GVolume
 
 (define-vfunc get_name
@@ -877,5 +902,3 @@
   '("GMount*" "mount")
  )
 )
-
-
diff --git a/gio/src/tlspassword.ccg b/gio/src/tlspassword.ccg
new file mode 100644
index 0000000..d04c195
--- /dev/null
+++ b/gio/src/tlspassword.ccg
@@ -0,0 +1,18 @@
+/* Copyright (C) 2012 The giomm 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.
+ */
+
+#include <gio/gio.h>
diff --git a/gio/src/tlspassword.hg b/gio/src/tlspassword.hg
new file mode 100644
index 0000000..34845a8
--- /dev/null
+++ b/gio/src/tlspassword.hg
@@ -0,0 +1,72 @@
+/* Copyright (C) 2012 The giomm 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.
+ */
+
+#include <glibmm/object.h>
+
+_DEFS(giomm,gio)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Gio
+{
+
+_WRAP_ENUM(TlsPasswordFlags, GTlsPasswordFlags)
+
+/** TlsPassword - TLS Passwords for prompting.
+ * Holds a password used in TLS.
+ * @newin{2,36}
+ */
+class TlsPassword : public Glib::Object
+{
+  _CLASS_GOBJECT(TlsPassword, GTlsPassword, G_TLS_PASSWORD, Glib::Object, GObject)
+
+protected:
+  _WRAP_CTOR(TlsPassword(TlsPasswordFlags flags, const Glib::ustring& description), g_tls_password_new)
+
+public:
+  _WRAP_METHOD_DOCS_ONLY(g_tls_password_new)
+  _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
+  // later in a specified GDestroyNotify callback.  Ignore it for now.
+  _IGNORE(g_tls_password_set_value_full)
+
+  _WRAP_METHOD(Glib::ustring get_description() const, g_tls_password_get_description)
+  _WRAP_METHOD(void set_description(const Glib::ustring& description), g_tls_password_set_description)
+
+  _WRAP_METHOD(TlsPasswordFlags get_flags() const, g_tls_password_get_flags)
+  _WRAP_METHOD(void set_flags(TlsPasswordFlags flags), g_tls_password_set_flags)
+
+  _WRAP_METHOD(Glib::ustring get_warning() const, g_tls_password_get_warning)
+  _WRAP_METHOD(void set_warning(const Glib::ustring& warning), g_tls_password_set_warning)
+
+  _WRAP_PROPERTY("description", Glib::ustring)
+  _WRAP_PROPERTY("flags", TlsPasswordFlags)
+  _WRAP_PROPERTY("warning", Glib::ustring)
+
+#m4 _CONVERSION(`gsize*', `gsize&', `*($3)')
+  _WRAP_VFUNC(const guchar* get_value(gsize& length), "get_value")
+
+  //TODO: _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(), "get_default_warning")
+};
+
+} // namespace Gio
diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4
index 2f143b6..ed34d9d 100644
--- a/tools/m4/convert_gio.m4
+++ b/tools/m4/convert_gio.m4
@@ -40,6 +40,7 @@ _CONV_ENUM(G,SocketMsgFlags)
 _CONV_ENUM(G,SocketProtocol)
 _CONV_ENUM(G,SocketType)
 _CONV_ENUM(G, TlsCertificateFlags)
+_CONV_ENUM(G, TlsPasswordFlags)
 _CONV_ENUM(G,UnixSocketAddressType)
 _CONV_ENUM(G,ZlibCompressorFormat)
 



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