[glibmm] Gio::DBusConnection: Add emit_signal().
- From: José Alburquerque <jaalburqu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] Gio::DBusConnection: Add emit_signal().
- Date: Mon, 22 Nov 2010 18:06:04 +0000 (UTC)
commit 16f7ae7f1151ea2a2deeb2ad9544c78c09360b9f
Author: José Alburquerque <jaalburqu svn gnome org>
Date: Mon Nov 22 13:01:20 2010 -0500
Gio::DBusConnection: Add emit_signal().
* gio/src/dbusconnection.{ccg,hg}: Add emit_signal() wrapping
g_dbus_connection_emit_signal().
* gio/src/dbusaddress.ccg: Typo.
ChangeLog | 8 ++++++++
gio/src/dbusaddress.ccg | 2 +-
gio/src/dbusconnection.ccg | 18 ++++++++++++++++++
gio/src/dbusconnection.hg | 23 +++++++++++++++++++++++
4 files changed, 50 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index cd9f36d..218ef88 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-11-22 José Alburquerque <jaalburqu svn gnome org>
+
+ Gio::DBusConnection: Add emit_signal().
+
+ * gio/src/dbusconnection.{ccg,hg}: Add emit_signal() wrapping
+ g_dbus_connection_emit_signal().
+ * gio/src/dbusaddress.ccg: Typo.
+
2010-11-19 José Alburquerque <jaalburqu svn gnome org>
Gio::DBus::Address: Wrap the gio dbus address API in this namespace.
diff --git a/gio/src/dbusaddress.ccg b/gio/src/dbusaddress.ccg
index 529f766..46ebb63 100644
--- a/gio/src/dbusaddress.ccg
+++ b/gio/src/dbusaddress.ccg
@@ -180,7 +180,7 @@ Glib::ustring get_for_bus_sync(BusType bus_type)
return result;
}
-}
+} // namespace Address
} // namespace DBus
diff --git a/gio/src/dbusconnection.ccg b/gio/src/dbusconnection.ccg
index e5078b7..28fb2a0 100644
--- a/gio/src/dbusconnection.ccg
+++ b/gio/src/dbusconnection.ccg
@@ -461,4 +461,22 @@ void DBusConnection::call_sync(
output.init(gvariant); // No need to take extra reference.
}
+void DBusConnection::emit_singal(
+ const Glib::ustring& object_path,
+ const Glib::ustring& interface_name,
+ const Glib::ustring& signal_name,
+ const Glib::ustring& destination_bus_name,
+ const Glib::VariantBase& parameters
+)
+{
+ GError* gerror = 0;
+
+ g_dbus_connection_emit_signal(gobj(),
+ destination_bus_name.c_str(), object_path.c_str(), interface_name.c_str(),
+ signal_name.c_str(), const_cast<GVariant*>(parameters.gobj()), &gerror);
+
+ if(gerror)
+ ::Glib::Error::throw_exception(gerror);
+}
+
} // namespace Gio
diff --git a/gio/src/dbusconnection.hg b/gio/src/dbusconnection.hg
index 6199a15..321de49 100644
--- a/gio/src/dbusconnection.hg
+++ b/gio/src/dbusconnection.hg
@@ -561,6 +561,29 @@ public:
const Glib::VariantType& reply_type = Glib::VariantType()
);
+ /** Emits a signal.
+ *
+ * This can only fail if @a parameters is not compatible with the D-Bus
+ * protocol.
+ *
+ * @param object_path Path of remote object.
+ * @param interface_name D-Bus interface to emit a signal on.
+ * @param signal_name The name of the signal to emit.
+ * @param destination_bus_name The unique bus name for the destination for
+ * the signal or <tt>0</tt> to emit to all listeners.
+ * @param parameters A Glib::VariantBase tuple with parameters for the
+ * signal or <tt>0</tt> if not passing parameters.
+ * @throw Glib::Error.
+ * @newin{2,28}
+ */
+ void emit_singal(
+ const Glib::ustring& object_path,
+ const Glib::ustring& interface_name,
+ const Glib::ustring& signal_name,
+ const Glib::ustring& destination_bus_name = Glib::ustring(),
+ const Glib::VariantBase& parameters = Glib::VariantBase()
+ );
+
_WRAP_METHOD(bool get_exit_on_close() const, g_dbus_connection_get_exit_on_close)
_WRAP_METHOD(void set_exit_on_close(bool exit_on_close = true), g_dbus_connection_set_exit_on_close)
_WRAP_METHOD(DBusCapabilityFlags get_capabilities() const, g_dbus_connection_get_capabilities)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]