diff options
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | gio/src/dbusinterfaceskeleton.ccg | 20 | ||||
-rw-r--r-- | gio/src/dbusinterfaceskeleton.hg | 86 | ||||
-rw-r--r-- | gio/src/filelist.am | 1 | ||||
-rw-r--r-- | gio/src/gio_signals.defs | 29 | ||||
-rw-r--r-- | tools/extra_defs_gen/generate_defs_gio.cc | 1 | ||||
-rw-r--r-- | tools/m4/convert_gio.m4 | 4 |
7 files changed, 156 insertions, 0 deletions
@@ -1,3 +1,18 @@ +2013-06-05 José Alburquerque <jaalburquerque@gmail.com> + + giomm: Add the Gio::DBus::InterfaceSkeleton class. + + * gio/src/dbusinterfaceskeleton.{ccg,hg}: + * gio/src/filelist.am: Add the sources wrapping the methods, + properties and signals and list the sources in the list of files to be + built. + * gio/src/gio_signals.defs: + * tools/extra_defs_gen/generate_defs_gio.cc: Add the + GDBUSInterfaceSkeleton GType to the properties and signals defs + generation tool and regenerate the .defs file. + * tools/m4/convert_gio.m4: Add the conversions for the wrapped + methods, properties and signals. + 2013-06-04 Kjell Ahlstedt <kjell.ahlstedt@bredband.net> Glib::MainContext: Fix a small error in the documentation of acquire(). diff --git a/gio/src/dbusinterfaceskeleton.ccg b/gio/src/dbusinterfaceskeleton.ccg new file mode 100644 index 00000000..e3e0f56a --- /dev/null +++ b/gio/src/dbusinterfaceskeleton.ccg @@ -0,0 +1,20 @@ +/* Copyright (C) 2013 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 <giomm/dbusconnection.h> +#include <giomm/dbusintrospection.h> +#include <giomm/dbusmethodinvocation.h> diff --git a/gio/src/dbusinterfaceskeleton.hg b/gio/src/dbusinterfaceskeleton.hg new file mode 100644 index 00000000..3a3c538d --- /dev/null +++ b/gio/src/dbusinterfaceskeleton.hg @@ -0,0 +1,86 @@ +/* Copyright (C) 2013 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/dbusinterface.h> + +_DEFS(giomm,gio) +_PINCLUDE(glibmm/private/object_p.h) +_PINCLUDE(gio/gio.h) //For the GDBusMethodInvocation type in the *_p.h file. + +namespace Gio +{ + +namespace DBus +{ + +_WRAP_ENUM(InterfaceSkeletonFlags, GDBusInterfaceSkeletonFlags, NO_GTYPE) + +class InterfaceInfo; +class Connection; +class MethodInvocation; + +_GMMPROC_EXTRA_NAMESPACE(DBus) + +/** Abstract base class for D-Bus interfaces on the service side. + * @newin{2,38} + */ +class InterfaceSkeleton +: public Glib::Object, + public Interface +{ + _CLASS_GOBJECT(InterfaceSkeleton, GDBusInterfaceSkeleton, G_DBUS_INTERFACE_SKELETON, Glib::Object, GObject) + _IMPLEMENTS_INTERFACE(Interface) + +public: + _WRAP_METHOD(void flush(), g_dbus_interface_skeleton_flush) + _WRAP_METHOD(Glib::RefPtr<InterfaceInfo> get_info() const, g_dbus_interface_skeleton_get_info) + + //TODO: _WRAP_METHOD(GDBusInterfaceVTable* get_vtable(), g_dbus_interface_skeleton_get_vtable) + + _WRAP_METHOD(Glib::VariantBase get_properties() const, g_dbus_interface_skeleton_get_properties) + _WRAP_METHOD(void export_interface_skeleton(const Glib::RefPtr<Connection>& connection, const Glib::ustring& object_path), g_dbus_interface_skeleton_export, errthrow) + _WRAP_METHOD(void unexport(), g_dbus_interface_skeleton_unexport) + _WRAP_METHOD(void unexport_from_connection(const Glib::RefPtr<Connection>& connection), g_dbus_interface_skeleton_unexport_from_connection) + + _WRAP_METHOD(Glib::RefPtr<Connection> get_connection(), g_dbus_interface_skeleton_get_connection) + _WRAP_METHOD(Glib::RefPtr<const Connection> get_connection() const, g_dbus_interface_skeleton_get_connection, constversion) + +#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<Connection> >',`Glib::ListHandler< Glib::RefPtr<Connection> >::list_to_vector($3, Glib::OWNERSHIP_DEEP)') + _WRAP_METHOD(std::vector< Glib::RefPtr<Connection> > get_connections(), g_dbus_interface_skeleton_get_connections) + +#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<const Connection> >',`Glib::ListHandler< Glib::RefPtr<const Connection> >::list_to_vector($3, Glib::OWNERSHIP_DEEP)') + _WRAP_METHOD(std::vector< Glib::RefPtr<const Connection> > get_connections() const, g_dbus_interface_skeleton_get_connections) + + _WRAP_METHOD(bool has_connection(const Glib::RefPtr<Connection>& connection) const, g_dbus_interface_skeleton_has_connection) + + _WRAP_METHOD(Glib::ustring get_object_path() const, g_dbus_interface_skeleton_get_object_path) + + _WRAP_METHOD(InterfaceSkeletonFlags get_flags() const, g_dbus_interface_skeleton_get_flags) + _WRAP_METHOD(void set_flags(InterfaceSkeletonFlags flags), g_dbus_interface_skeleton_set_flags) + + _WRAP_PROPERTY("g-flags", InterfaceSkeletonFlags) + +#m4 _CONVERSION(`GDBusMethodInvocation*',`const Glib::RefPtr<MethodInvocation>&',`Glib::wrap($3, true)') + _WRAP_SIGNAL(bool authorize_method(const Glib::RefPtr<MethodInvocation>& invocation), "g_authorize_method") + + //TODO: The virtual functions. +}; + +} // namespace DBus + +} // namespace Gio diff --git a/gio/src/filelist.am b/gio/src/filelist.am index 28f7782a..fbc0e335 100644 --- a/gio/src/filelist.am +++ b/gio/src/filelist.am @@ -39,6 +39,7 @@ giomm_files_any_hg = \ dbuserror.hg \ dbuserrorutils.hg \ dbusinterface.hg \ + dbusinterfaceskeleton.hg \ dbusinterfacevtable.hg \ dbusintrospection.hg \ dbusmenumodel.hg \ diff --git a/gio/src/gio_signals.defs b/gio/src/gio_signals.defs index 78d726a9..8b3cc751 100644 --- a/gio/src/gio_signals.defs +++ b/gio/src/gio_signals.defs @@ -818,6 +818,15 @@ (construct-only #t) ) +(define-property default-port + (of-object "GProxyAddressEnumerator") + (prop-type "GParamUInt") + (docs "The default port to use if uri does not specify one") + (readable #t) + (writable #t) + (construct-only #t) +) + (define-property connectable (of-object "GProxyAddressEnumerator") (prop-type "GParamObject") @@ -2210,6 +2219,26 @@ ;; From GDBusInterfaceInfo +;; From GDBusInterfaceSkeleton + +(define-signal g-authorize-method + (of-object "GDBusInterfaceSkeleton") + (return-type "gboolean") + (when "last") + (parameters + '("GDBusMethodInvocation*" "p0") + ) +) + +(define-property g-flags + (of-object "GDBusInterfaceSkeleton") + (prop-type "GParamFlags") + (docs "Flags for the interface skeleton") + (readable #t) + (writable #t) + (construct-only #f) +) + ;; From GDBusObject (define-signal interface-added diff --git a/tools/extra_defs_gen/generate_defs_gio.cc b/tools/extra_defs_gen/generate_defs_gio.cc index 6e63aea4..6d202bb2 100644 --- a/tools/extra_defs_gen/generate_defs_gio.cc +++ b/tools/extra_defs_gen/generate_defs_gio.cc @@ -141,6 +141,7 @@ int main(int, char**) << get_defs(G_TYPE_DBUS_SIGNAL_INFO) << get_defs(G_TYPE_DBUS_PROPERTY_INFO) << get_defs(G_TYPE_DBUS_INTERFACE_INFO) + << get_defs(G_TYPE_DBUS_INTERFACE_SKELETON) << get_defs(G_TYPE_DBUS_OBJECT) << get_defs(G_TYPE_DBUS_NODE_INFO) << get_defs(G_TYPE_DBUS_MESSAGE) diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4 index edc359b2..3a827ade 100644 --- a/tools/m4/convert_gio.m4 +++ b/tools/m4/convert_gio.m4 @@ -9,6 +9,7 @@ _CONV_ENUM(G,DataStreamByteOrder) _CONV_ENUM(G,DataStreamNewlineType) _CONV_ENUM(GDBus,CallFlags) _CONV_ENUM(GDBus,CapabilityFlags) +_CONV_ENUM(GDBus, InterfaceSkeletonFlags) _CONV_ENUM(GDBus,MessageFlags) _CONV_ENUM(GDBus,MessageHeaderField) _CONV_ENUM(GDBus,MessageType) @@ -123,6 +124,9 @@ _CONVERSION(`GDBusInterface*',`Glib::RefPtr<Gio::DBus::Interface>',`Glib::wrap($ _CONVERSION(`Glib::RefPtr<Gio::DBus::Interface>',`GDBusInterface*',`Glib::unwrap($3)') _CONVERSION(`const Glib::RefPtr<Gio::DBus::Interface>&',`GDBusInterface*',`Glib::unwrap($3)') +# DBusMethodInvocation +_CONVERSION(`const Glib::RefPtr<MethodInvocation>&',`GDBusMethodInvocation*',`Glib::unwrap($3)') + # DBusObject _CONVERSION(`GDBusObject*',`Glib::RefPtr<Gio::DBus::Object>',`Glib::wrap($3)') _CONVERSION(`const Glib::RefPtr<Gio::DBus::Object>&',`GDBusObject*',`Glib::unwrap($3)') |