[glibmm] Gio::DBusAuthObserver: Make parameters constant.



commit c24b1a6ad14e0d3449dc0e97e049914223f79e1c
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Fri Jul 23 16:47:44 2010 -0400

    	Gio::DBusAuthObserver: Make parameters constant.
    
    	* gio/src/dbusauthobserver.[hg|ccg]:
    	* gio/src/filelist.am: Add the source files, this time making sure the
    	parameters in the methods and signals are constant because this class
    	is only meant to observe authentications of remote peers and tell if
    	the connection is valid based on the parameters.  It doesn't look like
    	the parameters should be changed in the signal handlers.
    
    	* gio/src/gio_signals.defs:
    	* tools/extra_defs_gen/generate_defs_gio.cc: Add changes not included
    	in the addition of the Gio::DBusAuthObserver API.
    
    	* tools/m4/convert_gio.m4: Fix the conversions so that they convert
    	from const parameters to non-const for the C API.

 ChangeLog                                 |   18 +++++++++
 gio/src/dbusauthobserver.ccg              |   25 ++++++++++++
 gio/src/dbusauthobserver.hg               |   59 +++++++++++++++++++++++++++++
 gio/src/filelist.am                       |    1 +
 gio/src/gio_signals.defs                  |   27 ++++++++++++-
 tools/extra_defs_gen/generate_defs_gio.cc |    1 +
 tools/m4/convert_gio.m4                   |    1 +
 7 files changed, 129 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 46e6801..95f156d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2010-07-23  José Alburquerque  <jaalburqu svn gnome org>
+
+	Gio::DBusAuthObserver: Make parameters constant.
+
+	* gio/src/dbusauthobserver.[hg|ccg]:
+	* gio/src/filelist.am: Add the source files, this time making sure the
+	parameters in the methods and signals are constant because this class
+	is only meant to observe authentications of remote peers and tell if
+	the connection is valid based on the parameters.  It doesn't look like
+	the parameters should be changed in the signal handlers.
+
+	* gio/src/gio_signals.defs:
+	* tools/extra_defs_gen/generate_defs_gio.cc: Add changes not included
+	in the addition of the Gio::DBusAuthObserver API.
+
+	* tools/m4/convert_gio.m4: Fix the conversions so that they convert
+	from const parameters to non-const for the C API.
+
 2010-07-23  Murray Cumming  <murrayc murrayc com>
 
 	Fix warnings.
diff --git a/gio/src/dbusauthobserver.ccg b/gio/src/dbusauthobserver.ccg
new file mode 100644
index 0000000..555a34b
--- /dev/null
+++ b/gio/src/dbusauthobserver.ccg
@@ -0,0 +1,25 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+
+/* Copyright (C) 2010 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>
+
+namespace Gio
+{
+
+} // namespace Gio
diff --git a/gio/src/dbusauthobserver.hg b/gio/src/dbusauthobserver.hg
new file mode 100644
index 0000000..857f590
--- /dev/null
+++ b/gio/src/dbusauthobserver.hg
@@ -0,0 +1,59 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+
+/* Copyright (C) 2010 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>
+#include <giomm/credentials.h>
+#include <giomm/iostream.h>
+
+_DEFS(giomm,gio)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Gio
+{
+
+
+/** DBusAuthObserver - Object used for authenticating connections.
+ * The DBusAuthObserver type provides a mechanism for participating in how a
+ * Gio::DBusServer (or a Gio::DBusConnection) authenticates remote peers.
+ * Simply instantiate a GDBusAuthObserver and connect to the signals you are
+ * interested in. Note that new signals may be added in the future.
+ *
+ * TODO: Add example from the C API docs.
+ *
+ * @newin{2,26}
+ */
+class DBusAuthObserver : public Glib::Object
+{
+  _CLASS_GOBJECT(DBusAuthObserver, GDBusAuthObserver, G_DBUS_AUTH_OBSERVER, Glib::Object, GObject)
+
+protected:
+  _CTOR_DEFAULT
+  _IGNORE(g_dbus_auth_observer_new)
+
+public:
+  _WRAP_CREATE()
+
+  _WRAP_METHOD(bool authorize_authenticated_peer(const Glib::RefPtr<const IOStream>& stream, const Glib::RefPtr<const Credentials>& credentials), g_dbus_auth_observer_authorize_authenticated_peer)
+
+#m4 _CONVERSION(`GIOStream*', `const Glib::RefPtr<const IOStream>&', `Glib::wrap($3, true)')
+#m4 _CONVERSION(`GCredentials*', `const Glib::RefPtr<const Credentials>&', `Glib::wrap($3, true)')
+  _WRAP_SIGNAL(bool authorize_authenticated_peer(const Glib::RefPtr<const IOStream>& stream, const Glib::RefPtr<const Credentials>& credentials), "authorize-authenticated-peer")
+};
+
+} // namespace Gio
diff --git a/gio/src/filelist.am b/gio/src/filelist.am
index 9c799c5..5d17069 100644
--- a/gio/src/filelist.am
+++ b/gio/src/filelist.am
@@ -20,6 +20,7 @@ giomm_files_any_hg =			\
 	credentials.hg			\
 	datainputstream.hg		\
 	dataoutputstream.hg		\
+	dbusauthobserver.hg \
 	dbusconnection.hg \
 	dbusmessage.hg \
 	drive.hg			\
diff --git a/gio/src/gio_signals.defs b/gio/src/gio_signals.defs
index ace64e9..8dc10f0 100644
--- a/gio/src/gio_signals.defs
+++ b/gio/src/gio_signals.defs
@@ -664,6 +664,18 @@
   )
 )
 
+;; From GDBusAuthObserver
+
+(define-signal authorize-authenticated-peer
+  (of-object "GDBusAuthObserver")
+  (return-type "gboolean")
+  (when "last")
+  (parameters
+    '("GIOStream*" "p0")
+    '("GCredentials*" "p1")
+  )
+)
+
 ;; From GInetAddress
 
 (define-property family
@@ -925,10 +937,10 @@
   (construct-only #t)
 )
 
-(define-property context
+(define-property backend
   (of-object "GSettings")
-  (prop-type "GParamString")
-  (docs "The name of the context for this settings object")
+  (prop-type "GParamObject")
+  (docs "The GSettingsBackend for this settings object")
   (readable #t)
   (writable #t)
   (construct-only #t)
@@ -1035,6 +1047,15 @@
   (construct-only #f)
 )
 
+(define-property timeout
+  (of-object "GSocket")
+  (prop-type "GParamUInt")
+  (docs "The timeout in seconds on socket I/O")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
 ;; From GSocketClient
 
 (define-property family
diff --git a/tools/extra_defs_gen/generate_defs_gio.cc b/tools/extra_defs_gen/generate_defs_gio.cc
index 6163394..6d1a656 100644
--- a/tools/extra_defs_gen/generate_defs_gio.cc
+++ b/tools/extra_defs_gen/generate_defs_gio.cc
@@ -73,6 +73,7 @@ int main(int, char**)
             << get_defs(G_TYPE_VOLUME_MONITOR)
 
             // network IO classes
+            << get_defs(G_TYPE_DBUS_AUTH_OBSERVER)
             << get_defs(G_TYPE_INET_ADDRESS)
             << get_defs(G_TYPE_INET_SOCKET_ADDRESS)
             << get_defs(G_TYPE_SOCKET_ADDRESS)
diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4
index 72eaa8c..4420d33 100644
--- a/tools/m4/convert_gio.m4
+++ b/tools/m4/convert_gio.m4
@@ -117,6 +117,7 @@ _CONVERSION(`GIOStream*',`Glib::RefPtr<Gio::IOStream>',`Glib::wrap($3)')
 _CONVERSION(`GIOStream*',`Glib::RefPtr<IOStream>',`Glib::wrap($3)')
 _CONVERSION(`GIOStream*',`Glib::RefPtr<const Gio::IOStream>',`Glib::wrap($3)')
 _CONVERSION(`GIOStream*',`Glib::RefPtr<const IOStream>',`Glib::wrap($3)')
+_CONVERSION(`const Glib::RefPtr<const IOStream>&',`GIOStream*',`const_cast<GIOStream*>(Glib::unwrap($3))')
 
 # InetAddress
 _CONVERSION(`const Glib::RefPtr<InetAddress>&',`GInetAddress*',__CONVERT_CONST_REFPTR_TO_P)



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