summaryrefslogtreecommitdiff
path: root/gio/src/dbusproxy.hg
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2012-10-01 10:22:46 +0200
committerMurray Cumming <murrayc@murrayc.com>2012-10-01 10:22:46 +0200
commit66703486a401170afa2cac33abeb3c88940ddd14 (patch)
treedee829df9ae03bfd7220439662bc678b4998d60d /gio/src/dbusproxy.hg
parentf6ffd05365161b7b21e1a7a22d20a7ecf3576e0f (diff)
downloadglibmm-66703486a401170afa2cac33abeb3c88940ddd14.tar.gz
DBus::Proxy: Add call(), call_sync() and call_finish() for unix_fd_list.
* gio/src/dbusproxy.[hg|ccg]: Add method overloads for the call methods that take a GUnixFDList. This is based on the similar methods in dbusconnection.[hg|ccg].
Diffstat (limited to 'gio/src/dbusproxy.hg')
-rw-r--r--gio/src/dbusproxy.hg72
1 files changed, 72 insertions, 0 deletions
diff --git a/gio/src/dbusproxy.hg b/gio/src/dbusproxy.hg
index a17db055..156fdfb5 100644
--- a/gio/src/dbusproxy.hg
+++ b/gio/src/dbusproxy.hg
@@ -291,6 +291,7 @@ public:
*/
_WRAP_METHOD(Glib::VariantContainerBase call_finish(const Glib::RefPtr<AsyncResult>& res), g_dbus_proxy_call_finish, errthrow)
+//TODO: Use _WRAP_METHOD() for this?
/** Synchronously invokes the method_name method on proxy.
* See call(), the asynchronous version of this method for more information.
*
@@ -322,6 +323,77 @@ public:
CallFlags flags = Gio::DBus::CALL_FLAGS_NONE
);
+
+#ifdef G_OS_LINUX
+//TODO: Use _WRAP_METHOD() for this?
+ /** Like call() but also takes a GUnixFDList object.
+ * This method is only available on UNIX.
+ *
+ * This is an asynchronous method. When the operation is finished, callback
+ * will be invoked in the thread-default main loop of the thread you are
+ * calling this method from. You can then call call_with_unix_fd_finish() to
+ * get the result of the operation. See call_sync() for the synchronous
+ * version of this function.
+ *
+ * @param method_name The name of the method to invoke.
+ * @param parameters A Glib::VariantContainerBase tuple with parameters for the
+ * method or <tt>0</tt> if not passing parameters.
+ * @param slot A SlotAsyncReady to call when the request is satisfied.
+ * @param cancellable A Cancellable.
+ * @param fd_list A UnixFDList.
+ * @param timeout_msec The timeout in milliseconds, -1 to use the default
+ * timeout or G_MAXINT for no timeout.
+ * @param flags Flags from the Gio::DBus::CallFlags enumeration.
+ * @newin{2,34}
+ */
+ void call(
+ const Glib::ustring& method_name,
+ const Glib::VariantContainerBase& parameters,
+ const SlotAsyncReady& slot,
+ const Glib::RefPtr<Cancellable>& cancellable,
+ const Glib::RefPtr<UnixFDList>& fd_list,
+ int timeout_msec = -1,
+ CallFlags flags = Gio::DBus::CALL_FLAGS_NONE);
+ _IGNORE(g_dbus_proxy_call_with_unix_fd_list)
+
+ /** A non-cancellable version of call() (with a UnixFDList).
+ * @newin{2,34}
+ */
+ void call(
+ const Glib::ustring& object_path,
+ const Glib::ustring& interface_name,
+ const Glib::ustring& method_name,
+ const Glib::VariantContainerBase& parameters,
+ const SlotAsyncReady& slot,
+ const Glib::RefPtr<UnixFDList>& fd_list,
+ const Glib::ustring& bus_name = Glib::ustring(),
+ int timeout_msec = -1,
+ CallFlags flags = Gio::DBus::CALL_FLAGS_NONE,
+ const Glib::VariantType& reply_type = Glib::VariantType());
+#endif // G_OS_LINUX
+
+ /** Finishes an operation started with call() (with a UnixFDList).
+ * @param res A AsyncResult obtained from the SlotAsyncReady passed to
+ * call().
+ * @result A Variant tuple with return values.
+ * @throw Glib::Error.
+ * @newin{2,34}
+ */
+ _WRAP_METHOD(Glib::VariantContainerBase call_finish(const Glib::RefPtr<AsyncResult>& res{.}, Glib::RefPtr<UnixFDList>& out_fd_list{.>>}), g_dbus_proxy_call_with_unix_fd_list_finish, errthrow)
+
+ _WRAP_METHOD(
+ Glib::VariantContainerBase call_sync(
+ const Glib::ustring& method_name{.},
+ const Glib::VariantContainerBase& parameters{.},
+ const Glib::RefPtr<Cancellable>& cancellable{.?},
+ const Glib::RefPtr<UnixFDList>& fd_list{.},
+ Glib::RefPtr<UnixFDList>& out_fd_list{.>>},
+ int timeout_msec{.} = -1,
+ CallFlags flags{.} = Gio::DBus::CALL_FLAGS_NONE
+ ),
+ g_dbus_proxy_call_with_unix_fd_list_sync, errthrow
+ )
+
//_WRAP_PROPERTY("g-bus-type", BusType) // write-only construct-only
_WRAP_PROPERTY("g-connection", Glib::RefPtr<Connection>)
_WRAP_PROPERTY("g-default-timeout", int)