mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-12 10:45:13 +01:00
GDBus: Use call() instead of invoke_method()
Lots of people been suggesting this. We still use MethodInvocation / method_invocation for handling incoming method calls so use call() instead of invoke_method() helps to separate the client and server facilities. Which is a good thing(tm).
This commit is contained in:
parent
728c4e38e7
commit
869b4c6833
@ -2361,10 +2361,10 @@ g_dbus_connection_get_guid
|
|||||||
g_dbus_connection_get_unique_name
|
g_dbus_connection_get_unique_name
|
||||||
g_dbus_connection_get_capabilities
|
g_dbus_connection_get_capabilities
|
||||||
g_dbus_connection_get_peer_credentials
|
g_dbus_connection_get_peer_credentials
|
||||||
GDBusInvokeMethodFlags
|
GDBusCallFlags
|
||||||
g_dbus_connection_invoke_method
|
g_dbus_connection_call
|
||||||
g_dbus_connection_invoke_method_finish
|
g_dbus_connection_call_finish
|
||||||
g_dbus_connection_invoke_method_sync
|
g_dbus_connection_call_sync
|
||||||
g_dbus_connection_emit_signal
|
g_dbus_connection_emit_signal
|
||||||
GDBusSignalCallback
|
GDBusSignalCallback
|
||||||
g_dbus_connection_signal_subscribe
|
g_dbus_connection_signal_subscribe
|
||||||
@ -2495,9 +2495,9 @@ g_dbus_proxy_get_cached_property_names
|
|||||||
g_dbus_proxy_get_cached_property
|
g_dbus_proxy_get_cached_property
|
||||||
g_dbus_proxy_set_interface_info
|
g_dbus_proxy_set_interface_info
|
||||||
g_dbus_proxy_get_interface_info
|
g_dbus_proxy_get_interface_info
|
||||||
g_dbus_proxy_invoke_method
|
g_dbus_proxy_call
|
||||||
g_dbus_proxy_invoke_method_finish
|
g_dbus_proxy_call_finish
|
||||||
g_dbus_proxy_invoke_method_sync
|
g_dbus_proxy_call_sync
|
||||||
<SUBSECTION Standard>
|
<SUBSECTION Standard>
|
||||||
G_DBUS_PROXY
|
G_DBUS_PROXY
|
||||||
G_IS_DBUS_PROXY
|
G_IS_DBUS_PROXY
|
||||||
|
@ -55,9 +55,9 @@
|
|||||||
<row><entry>dbus_g_connection_unregister_g_object()</entry><entry>g_dbus_connection_unregister_object()</entry></row>
|
<row><entry>dbus_g_connection_unregister_g_object()</entry><entry>g_dbus_connection_unregister_object()</entry></row>
|
||||||
<row><entry>dbus_g_object_type_install_info()</entry><entry>introspection data is installed while registering
|
<row><entry>dbus_g_object_type_install_info()</entry><entry>introspection data is installed while registering
|
||||||
an object, see g_dbus_connection_register_object()</entry></row>
|
an object, see g_dbus_connection_register_object()</entry></row>
|
||||||
<row><entry>dbus_g_proxy_begin_call()</entry><entry>g_dbus_proxy_invoke_method()</entry></row>
|
<row><entry>dbus_g_proxy_begin_call()</entry><entry>g_dbus_proxy_call()</entry></row>
|
||||||
<row><entry>dbus_g_proxy_end_call()</entry><entry>g_dbus_proxy_invoke_method_finish()</entry></row>
|
<row><entry>dbus_g_proxy_end_call()</entry><entry>g_dbus_proxy_call_finish()</entry></row>
|
||||||
<row><entry>dbus_g_proxy_call()</entry><entry>g_dbus_proxy_invoke_method_sync()</entry></row>
|
<row><entry>dbus_g_proxy_call()</entry><entry>g_dbus_proxy_call_sync()</entry></row>
|
||||||
<row><entry>dbus_g_error_domain_register()</entry><entry>g_dbus_error_register_error_domain()</entry></row>
|
<row><entry>dbus_g_error_domain_register()</entry><entry>g_dbus_error_register_error_domain()</entry></row>
|
||||||
<row><entry>dbus_g_error_has_name()</entry><entry>no direct equivalent, see g_dbus_error_get_remote_error()</entry></row>
|
<row><entry>dbus_g_error_has_name()</entry><entry>no direct equivalent, see g_dbus_error_get_remote_error()</entry></row>
|
||||||
<row><entry>dbus_g_method_return()</entry><entry>g_dbus_method_invocation_return_value()</entry></row>
|
<row><entry>dbus_g_method_return()</entry><entry>g_dbus_method_invocation_return_value()</entry></row>
|
||||||
|
@ -143,13 +143,13 @@ print_methods (GDBusConnection *c,
|
|||||||
guint m;
|
guint m;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
result = g_dbus_connection_invoke_method_sync (c,
|
result = g_dbus_connection_call_sync (c,
|
||||||
name,
|
name,
|
||||||
path,
|
path,
|
||||||
"org.freedesktop.DBus.Introspectable",
|
"org.freedesktop.DBus.Introspectable",
|
||||||
"Introspect",
|
"Introspect",
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
3000, /* 3 secs */
|
3000, /* 3 secs */
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -205,13 +205,13 @@ print_paths (GDBusConnection *c,
|
|||||||
guint n;
|
guint n;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
result = g_dbus_connection_invoke_method_sync (c,
|
result = g_dbus_connection_call_sync (c,
|
||||||
name,
|
name,
|
||||||
path,
|
path,
|
||||||
"org.freedesktop.DBus.Introspectable",
|
"org.freedesktop.DBus.Introspectable",
|
||||||
"Introspect",
|
"Introspect",
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
3000, /* 3 secs */
|
3000, /* 3 secs */
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -283,13 +283,13 @@ print_names (GDBusConnection *c,
|
|||||||
name_set = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
|
name_set = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
result = g_dbus_connection_invoke_method_sync (c,
|
result = g_dbus_connection_call_sync (c,
|
||||||
"org.freedesktop.DBus",
|
"org.freedesktop.DBus",
|
||||||
"/org/freedesktop/DBus",
|
"/org/freedesktop/DBus",
|
||||||
"org.freedesktop.DBus",
|
"org.freedesktop.DBus",
|
||||||
"ListNames",
|
"ListNames",
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
3000, /* 3 secs */
|
3000, /* 3 secs */
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -312,13 +312,13 @@ print_names (GDBusConnection *c,
|
|||||||
g_variant_unref (result);
|
g_variant_unref (result);
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
result = g_dbus_connection_invoke_method_sync (c,
|
result = g_dbus_connection_call_sync (c,
|
||||||
"org.freedesktop.DBus",
|
"org.freedesktop.DBus",
|
||||||
"/org/freedesktop/DBus",
|
"/org/freedesktop/DBus",
|
||||||
"org.freedesktop.DBus",
|
"org.freedesktop.DBus",
|
||||||
"ListActivatableNames",
|
"ListActivatableNames",
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
3000, /* 3 secs */
|
3000, /* 3 secs */
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -453,13 +453,13 @@ call_helper_get_method_in_signature (GDBusConnection *c,
|
|||||||
result = NULL;
|
result = NULL;
|
||||||
node_info = NULL;
|
node_info = NULL;
|
||||||
|
|
||||||
result = g_dbus_connection_invoke_method_sync (c,
|
result = g_dbus_connection_call_sync (c,
|
||||||
dest,
|
dest,
|
||||||
path,
|
path,
|
||||||
"org.freedesktop.DBus.Introspectable",
|
"org.freedesktop.DBus.Introspectable",
|
||||||
"Introspect",
|
"Introspect",
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
3000, /* 3 secs */
|
3000, /* 3 secs */
|
||||||
NULL,
|
NULL,
|
||||||
error);
|
error);
|
||||||
@ -825,13 +825,13 @@ handle_call (gint *argc,
|
|||||||
|
|
||||||
if (parameters != NULL)
|
if (parameters != NULL)
|
||||||
parameters = g_variant_ref_sink (parameters);
|
parameters = g_variant_ref_sink (parameters);
|
||||||
result = g_dbus_connection_invoke_method_sync (c,
|
result = g_dbus_connection_call_sync (c,
|
||||||
opt_call_dest,
|
opt_call_dest,
|
||||||
opt_call_object_path,
|
opt_call_object_path,
|
||||||
interface_name,
|
interface_name,
|
||||||
method_name,
|
method_name,
|
||||||
parameters,
|
parameters,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -1011,13 +1011,13 @@ dump_interface (GDBusConnection *c,
|
|||||||
if (c != NULL && name != NULL && object_path != NULL)
|
if (c != NULL && name != NULL && object_path != NULL)
|
||||||
{
|
{
|
||||||
GVariant *result;
|
GVariant *result;
|
||||||
result = g_dbus_connection_invoke_method_sync (c,
|
result = g_dbus_connection_call_sync (c,
|
||||||
name,
|
name,
|
||||||
object_path,
|
object_path,
|
||||||
"org.freedesktop.DBus.Properties",
|
"org.freedesktop.DBus.Properties",
|
||||||
"GetAll",
|
"GetAll",
|
||||||
g_variant_new ("(s)", o->name),
|
g_variant_new ("(s)", o->name),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
3000,
|
3000,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
@ -1259,13 +1259,13 @@ handle_introspect (gint *argc,
|
|||||||
if (request_completion)
|
if (request_completion)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
result = g_dbus_connection_invoke_method_sync (c,
|
result = g_dbus_connection_call_sync (c,
|
||||||
opt_introspect_dest,
|
opt_introspect_dest,
|
||||||
opt_introspect_object_path,
|
opt_introspect_object_path,
|
||||||
"org.freedesktop.DBus.Introspectable",
|
"org.freedesktop.DBus.Introspectable",
|
||||||
"Introspect",
|
"Introspect",
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
3000, /* 3 sec */
|
3000, /* 3 sec */
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
|
@ -351,7 +351,7 @@ mechanism_client_initiate (GDBusAuthMechanism *mechanism,
|
|||||||
|
|
||||||
/* return the uid */
|
/* return the uid */
|
||||||
#if defined(G_OS_UNIX)
|
#if defined(G_OS_UNIX)
|
||||||
initial_response = g_strdup_printf ("%" G_GINT64_FORMAT, g_credentials_get_unix_user (credentials, NULL));
|
initial_response = g_strdup_printf ("%" G_GINT64_FORMAT, (gint64) g_credentials_get_unix_user (credentials, NULL));
|
||||||
#elif defined(G_OS_WIN32)
|
#elif defined(G_OS_WIN32)
|
||||||
initial_response = g_strdup_printf ("%s", g_credentials_get_windows_user ());
|
initial_response = g_strdup_printf ("%s", g_credentials_get_windows_user ());
|
||||||
#else
|
#else
|
||||||
|
@ -1802,13 +1802,13 @@ initable_init (GInitable *initable,
|
|||||||
GVariant *hello_result;
|
GVariant *hello_result;
|
||||||
const gchar *s;
|
const gchar *s;
|
||||||
|
|
||||||
hello_result = g_dbus_connection_invoke_method_sync (connection,
|
hello_result = g_dbus_connection_call_sync (connection,
|
||||||
"org.freedesktop.DBus", /* name */
|
"org.freedesktop.DBus", /* name */
|
||||||
"/org/freedesktop/DBus", /* path */
|
"/org/freedesktop/DBus", /* path */
|
||||||
"org.freedesktop.DBus", /* interface */
|
"org.freedesktop.DBus", /* interface */
|
||||||
"Hello",
|
"Hello",
|
||||||
NULL, /* parameters */
|
NULL, /* parameters */
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL, /* TODO: cancellable */
|
NULL, /* TODO: cancellable */
|
||||||
&connection->priv->initialization_error);
|
&connection->priv->initialization_error);
|
||||||
@ -2274,7 +2274,7 @@ static guint _global_filter_id = 1;
|
|||||||
* worker thread. Also note that filters are rarely needed - use API
|
* worker thread. Also note that filters are rarely needed - use API
|
||||||
* such as g_dbus_connection_send_message_with_reply(),
|
* such as g_dbus_connection_send_message_with_reply(),
|
||||||
* g_dbus_connection_signal_subscribe() or
|
* g_dbus_connection_signal_subscribe() or
|
||||||
* g_dbus_connection_invoke_method() instead.
|
* g_dbus_connection_call() instead.
|
||||||
*
|
*
|
||||||
* Returns: A filter identifier that can be used with
|
* Returns: A filter identifier that can be used with
|
||||||
* g_dbus_connection_remove_filter().
|
* g_dbus_connection_remove_filter().
|
||||||
@ -3646,7 +3646,7 @@ handle_introspect (GDBusConnection *connection,
|
|||||||
|
|
||||||
/* called in thread where object was registered - no locks held */
|
/* called in thread where object was registered - no locks held */
|
||||||
static gboolean
|
static gboolean
|
||||||
invoke_method_in_idle_cb (gpointer user_data)
|
call_in_idle_cb (gpointer user_data)
|
||||||
{
|
{
|
||||||
GDBusMethodInvocation *invocation = G_DBUS_METHOD_INVOCATION (user_data);
|
GDBusMethodInvocation *invocation = G_DBUS_METHOD_INVOCATION (user_data);
|
||||||
GDBusInterfaceVTable *vtable;
|
GDBusInterfaceVTable *vtable;
|
||||||
@ -3753,7 +3753,7 @@ validate_and_maybe_schedule_method_call (GDBusConnection *connection,
|
|||||||
idle_source = g_idle_source_new ();
|
idle_source = g_idle_source_new ();
|
||||||
g_source_set_priority (idle_source, G_PRIORITY_DEFAULT);
|
g_source_set_priority (idle_source, G_PRIORITY_DEFAULT);
|
||||||
g_source_set_callback (idle_source,
|
g_source_set_callback (idle_source,
|
||||||
invoke_method_in_idle_cb,
|
call_in_idle_cb,
|
||||||
invocation,
|
invocation,
|
||||||
g_object_unref);
|
g_object_unref);
|
||||||
g_source_attach (idle_source, main_context);
|
g_source_attach (idle_source, main_context);
|
||||||
@ -4068,22 +4068,22 @@ g_dbus_connection_emit_signal (GDBusConnection *connection,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
add_invoke_method_flags (GDBusMessage *message,
|
add_call_flags (GDBusMessage *message,
|
||||||
GDBusInvokeMethodFlags flags)
|
GDBusCallFlags flags)
|
||||||
{
|
{
|
||||||
if (flags & G_DBUS_INVOKE_METHOD_FLAGS_NO_AUTO_START)
|
if (flags & G_DBUS_CALL_FLAGS_NO_AUTO_START)
|
||||||
g_dbus_message_set_flags (message, G_DBUS_MESSAGE_FLAGS_NO_AUTO_START);
|
g_dbus_message_set_flags (message, G_DBUS_MESSAGE_FLAGS_NO_AUTO_START);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* g_dbus_connection_invoke_method:
|
* g_dbus_connection_call:
|
||||||
* @connection: A #GDBusConnection.
|
* @connection: A #GDBusConnection.
|
||||||
* @bus_name: A unique or well-known bus name or %NULL if @connection is not a message bus connection.
|
* @bus_name: A unique or well-known bus name or %NULL if @connection is not a message bus connection.
|
||||||
* @object_path: Path of remote object.
|
* @object_path: Path of remote object.
|
||||||
* @interface_name: D-Bus interface to invoke method on.
|
* @interface_name: D-Bus interface to invoke method on.
|
||||||
* @method_name: The name of the method to invoke.
|
* @method_name: The name of the method to invoke.
|
||||||
* @parameters: A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
|
* @parameters: A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
|
||||||
* @flags: Flags from the #GDBusInvokeMethodFlags enumeration.
|
* @flags: Flags from the #GDBusCallFlags enumeration.
|
||||||
* @timeout_msec: The timeout in milliseconds or -1 to use the default timeout.
|
* @timeout_msec: The timeout in milliseconds or -1 to use the default timeout.
|
||||||
* @cancellable: A #GCancellable or %NULL.
|
* @cancellable: A #GCancellable or %NULL.
|
||||||
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
|
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
|
||||||
@ -4103,20 +4103,20 @@ add_invoke_method_flags (GDBusMessage *message,
|
|||||||
* This is an asynchronous method. When the operation is finished, @callback will be invoked
|
* This is an asynchronous method. When the operation is finished, @callback will be invoked
|
||||||
* in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
|
* in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
|
||||||
* of the thread you are calling this method from. You can then call
|
* of the thread you are calling this method from. You can then call
|
||||||
* g_dbus_connection_invoke_method_finish() to get the result of the operation.
|
* g_dbus_connection_call_finish() to get the result of the operation.
|
||||||
* See g_dbus_connection_invoke_method_sync() for the synchronous version of this
|
* See g_dbus_connection_call_sync() for the synchronous version of this
|
||||||
* function.
|
* function.
|
||||||
*
|
*
|
||||||
* Since: 2.26
|
* Since: 2.26
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
g_dbus_connection_invoke_method (GDBusConnection *connection,
|
g_dbus_connection_call (GDBusConnection *connection,
|
||||||
const gchar *bus_name,
|
const gchar *bus_name,
|
||||||
const gchar *object_path,
|
const gchar *object_path,
|
||||||
const gchar *interface_name,
|
const gchar *interface_name,
|
||||||
const gchar *method_name,
|
const gchar *method_name,
|
||||||
GVariant *parameters,
|
GVariant *parameters,
|
||||||
GDBusInvokeMethodFlags flags,
|
GDBusCallFlags flags,
|
||||||
gint timeout_msec,
|
gint timeout_msec,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
@ -4136,7 +4136,7 @@ g_dbus_connection_invoke_method (GDBusConnection *connection,
|
|||||||
object_path,
|
object_path,
|
||||||
interface_name,
|
interface_name,
|
||||||
method_name);
|
method_name);
|
||||||
add_invoke_method_flags (message, flags);
|
add_call_flags (message, flags);
|
||||||
if (parameters != NULL)
|
if (parameters != NULL)
|
||||||
g_dbus_message_set_body (message, parameters);
|
g_dbus_message_set_body (message, parameters);
|
||||||
|
|
||||||
@ -4187,12 +4187,12 @@ decode_method_reply (GDBusMessage *reply,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* g_dbus_connection_invoke_method_finish:
|
* g_dbus_connection_call_finish:
|
||||||
* @connection: A #GDBusConnection.
|
* @connection: A #GDBusConnection.
|
||||||
* @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_invoke_method().
|
* @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call().
|
||||||
* @error: Return location for error or %NULL.
|
* @error: Return location for error or %NULL.
|
||||||
*
|
*
|
||||||
* Finishes an operation started with g_dbus_connection_invoke_method().
|
* Finishes an operation started with g_dbus_connection_call().
|
||||||
*
|
*
|
||||||
* Returns: %NULL if @error is set. Otherwise a #GVariant tuple with
|
* Returns: %NULL if @error is set. Otherwise a #GVariant tuple with
|
||||||
* return values. Free with g_variant_unref().
|
* return values. Free with g_variant_unref().
|
||||||
@ -4200,7 +4200,7 @@ decode_method_reply (GDBusMessage *reply,
|
|||||||
* Since: 2.26
|
* Since: 2.26
|
||||||
*/
|
*/
|
||||||
GVariant *
|
GVariant *
|
||||||
g_dbus_connection_invoke_method_finish (GDBusConnection *connection,
|
g_dbus_connection_call_finish (GDBusConnection *connection,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
@ -4228,14 +4228,14 @@ g_dbus_connection_invoke_method_finish (GDBusConnection *connection,
|
|||||||
/* ---------------------------------------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* g_dbus_connection_invoke_method_sync:
|
* g_dbus_connection_call_sync:
|
||||||
* @connection: A #GDBusConnection.
|
* @connection: A #GDBusConnection.
|
||||||
* @bus_name: A unique or well-known bus name.
|
* @bus_name: A unique or well-known bus name.
|
||||||
* @object_path: Path of remote object.
|
* @object_path: Path of remote object.
|
||||||
* @interface_name: D-Bus interface to invoke method on.
|
* @interface_name: D-Bus interface to invoke method on.
|
||||||
* @method_name: The name of the method to invoke.
|
* @method_name: The name of the method to invoke.
|
||||||
* @parameters: A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
|
* @parameters: A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
|
||||||
* @flags: Flags from the #GDBusInvokeMethodFlags enumeration.
|
* @flags: Flags from the #GDBusCallFlags enumeration.
|
||||||
* @timeout_msec: The timeout in milliseconds or -1 to use the default timeout.
|
* @timeout_msec: The timeout in milliseconds or -1 to use the default timeout.
|
||||||
* @cancellable: A #GCancellable or %NULL.
|
* @cancellable: A #GCancellable or %NULL.
|
||||||
* @error: Return location for error or %NULL.
|
* @error: Return location for error or %NULL.
|
||||||
@ -4251,7 +4251,7 @@ g_dbus_connection_invoke_method_finish (GDBusConnection *connection,
|
|||||||
* fails with %G_IO_ERROR_INVALID_ARGUMENT.
|
* fails with %G_IO_ERROR_INVALID_ARGUMENT.
|
||||||
*
|
*
|
||||||
* The calling thread is blocked until a reply is received. See
|
* The calling thread is blocked until a reply is received. See
|
||||||
* g_dbus_connection_invoke_method() for the asynchronous version of
|
* g_dbus_connection_call() for the asynchronous version of
|
||||||
* this method.
|
* this method.
|
||||||
*
|
*
|
||||||
* Returns: %NULL if @error is set. Otherwise a #GVariant tuple with
|
* Returns: %NULL if @error is set. Otherwise a #GVariant tuple with
|
||||||
@ -4260,13 +4260,13 @@ g_dbus_connection_invoke_method_finish (GDBusConnection *connection,
|
|||||||
* Since: 2.26
|
* Since: 2.26
|
||||||
*/
|
*/
|
||||||
GVariant *
|
GVariant *
|
||||||
g_dbus_connection_invoke_method_sync (GDBusConnection *connection,
|
g_dbus_connection_call_sync (GDBusConnection *connection,
|
||||||
const gchar *bus_name,
|
const gchar *bus_name,
|
||||||
const gchar *object_path,
|
const gchar *object_path,
|
||||||
const gchar *interface_name,
|
const gchar *interface_name,
|
||||||
const gchar *method_name,
|
const gchar *method_name,
|
||||||
GVariant *parameters,
|
GVariant *parameters,
|
||||||
GDBusInvokeMethodFlags flags,
|
GDBusCallFlags flags,
|
||||||
gint timeout_msec,
|
gint timeout_msec,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GError **error)
|
GError **error)
|
||||||
@ -4291,7 +4291,7 @@ g_dbus_connection_invoke_method_sync (GDBusConnection *connection,
|
|||||||
object_path,
|
object_path,
|
||||||
interface_name,
|
interface_name,
|
||||||
method_name);
|
method_name);
|
||||||
add_invoke_method_flags (message, flags);
|
add_call_flags (message, flags);
|
||||||
if (parameters != NULL)
|
if (parameters != NULL)
|
||||||
g_dbus_message_set_body (message, parameters);
|
g_dbus_message_set_body (message, parameters);
|
||||||
|
|
||||||
|
@ -171,27 +171,27 @@ gboolean g_dbus_connection_emit_signal (GDBusConnection
|
|||||||
const gchar *signal_name,
|
const gchar *signal_name,
|
||||||
GVariant *parameters,
|
GVariant *parameters,
|
||||||
GError **error);
|
GError **error);
|
||||||
void g_dbus_connection_invoke_method (GDBusConnection *connection,
|
void g_dbus_connection_call (GDBusConnection *connection,
|
||||||
const gchar *bus_name,
|
const gchar *bus_name,
|
||||||
const gchar *object_path,
|
const gchar *object_path,
|
||||||
const gchar *interface_name,
|
const gchar *interface_name,
|
||||||
const gchar *method_name,
|
const gchar *method_name,
|
||||||
GVariant *parameters,
|
GVariant *parameters,
|
||||||
GDBusInvokeMethodFlags flags,
|
GDBusCallFlags flags,
|
||||||
gint timeout_msec,
|
gint timeout_msec,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
GVariant *g_dbus_connection_invoke_method_finish (GDBusConnection *connection,
|
GVariant *g_dbus_connection_call_finish (GDBusConnection *connection,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error);
|
GError **error);
|
||||||
GVariant *g_dbus_connection_invoke_method_sync (GDBusConnection *connection,
|
GVariant *g_dbus_connection_call_sync (GDBusConnection *connection,
|
||||||
const gchar *bus_name,
|
const gchar *bus_name,
|
||||||
const gchar *object_path,
|
const gchar *object_path,
|
||||||
const gchar *interface_name,
|
const gchar *interface_name,
|
||||||
const gchar *method_name,
|
const gchar *method_name,
|
||||||
GVariant *parameters,
|
GVariant *parameters,
|
||||||
GDBusInvokeMethodFlags flags,
|
GDBusCallFlags flags,
|
||||||
gint timeout_msec,
|
gint timeout_msec,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
@ -41,9 +41,9 @@
|
|||||||
* @include: gio/gio.h
|
* @include: gio/gio.h
|
||||||
*
|
*
|
||||||
* All facilities that return errors from remote methods (such as
|
* All facilities that return errors from remote methods (such as
|
||||||
* g_dbus_connection_invoke_method_sync()) use #GError to represent
|
* g_dbus_connection_call_sync()) use #GError to represent both D-Bus
|
||||||
* both D-Bus errors (e.g. errors returned from the other peer) and
|
* errors (e.g. errors returned from the other peer) and locally
|
||||||
* locally in-process generated errors.
|
* in-process generated errors.
|
||||||
*
|
*
|
||||||
* To check if a returned #GError is an error from a remote peer, use
|
* To check if a returned #GError is an error from a remote peer, use
|
||||||
* g_dbus_error_is_remote_error(). To get the actual D-Bus error name,
|
* g_dbus_error_is_remote_error(). To get the actual D-Bus error name,
|
||||||
@ -488,9 +488,10 @@ g_dbus_error_is_remote_error (const GError *error)
|
|||||||
*
|
*
|
||||||
* Gets the D-Bus error name used for @error, if any.
|
* Gets the D-Bus error name used for @error, if any.
|
||||||
*
|
*
|
||||||
* This function is guaranteed to return a D-Bus error name for all #GError<!-- -->s returned from
|
* This function is guaranteed to return a D-Bus error name for all
|
||||||
* functions handling remote method calls (e.g. g_dbus_connection_invoke_method_finish())
|
* #GError<!-- -->s returned from functions handling remote method
|
||||||
* unless g_dbus_error_strip_remote_error() has been used on @error.
|
* calls (e.g. g_dbus_connection_call_finish()) unless
|
||||||
|
* g_dbus_error_strip_remote_error() has been used on @error.
|
||||||
*
|
*
|
||||||
* Returns: An allocated string or %NULL if the D-Bus error name could not be found. Free with g_free().
|
* Returns: An allocated string or %NULL if the D-Bus error name could not be found. Free with g_free().
|
||||||
*
|
*
|
||||||
|
@ -294,7 +294,7 @@ request_name_cb (GObject *source_object,
|
|||||||
request_name_reply = 0;
|
request_name_reply = 0;
|
||||||
result = NULL;
|
result = NULL;
|
||||||
|
|
||||||
result = g_dbus_connection_invoke_method_finish (client->connection,
|
result = g_dbus_connection_call_finish (client->connection,
|
||||||
res,
|
res,
|
||||||
NULL);
|
NULL);
|
||||||
if (result != NULL)
|
if (result != NULL)
|
||||||
@ -395,7 +395,7 @@ has_connection (Client *client)
|
|||||||
client);
|
client);
|
||||||
|
|
||||||
/* attempt to acquire the name */
|
/* attempt to acquire the name */
|
||||||
g_dbus_connection_invoke_method (client->connection,
|
g_dbus_connection_call (client->connection,
|
||||||
"org.freedesktop.DBus", /* bus name */
|
"org.freedesktop.DBus", /* bus name */
|
||||||
"/org/freedesktop/DBus", /* object path */
|
"/org/freedesktop/DBus", /* object path */
|
||||||
"org.freedesktop.DBus", /* interface name */
|
"org.freedesktop.DBus", /* interface name */
|
||||||
@ -403,7 +403,7 @@ has_connection (Client *client)
|
|||||||
g_variant_new ("(su)",
|
g_variant_new ("(su)",
|
||||||
client->name,
|
client->name,
|
||||||
client->flags),
|
client->flags),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
(GAsyncReadyCallback) request_name_cb,
|
(GAsyncReadyCallback) request_name_cb,
|
||||||
@ -676,13 +676,13 @@ g_bus_unown_name (guint owner_id)
|
|||||||
* I believe this is a bug in the bus daemon.
|
* I believe this is a bug in the bus daemon.
|
||||||
*/
|
*/
|
||||||
error = NULL;
|
error = NULL;
|
||||||
result = g_dbus_connection_invoke_method_sync (client->connection,
|
result = g_dbus_connection_call_sync (client->connection,
|
||||||
"org.freedesktop.DBus", /* bus name */
|
"org.freedesktop.DBus", /* bus name */
|
||||||
"/org/freedesktop/DBus", /* object path */
|
"/org/freedesktop/DBus", /* object path */
|
||||||
"org.freedesktop.DBus", /* interface name */
|
"org.freedesktop.DBus", /* interface name */
|
||||||
"ReleaseName", /* method name */
|
"ReleaseName", /* method name */
|
||||||
g_variant_new ("(s)", client->name),
|
g_variant_new ("(s)", client->name),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
|
@ -331,7 +331,7 @@ get_name_owner_cb (GObject *source_object,
|
|||||||
name_owner = NULL;
|
name_owner = NULL;
|
||||||
result = NULL;
|
result = NULL;
|
||||||
|
|
||||||
result = g_dbus_connection_invoke_method_finish (client->connection,
|
result = g_dbus_connection_call_finish (client->connection,
|
||||||
res,
|
res,
|
||||||
NULL);
|
NULL);
|
||||||
if (result != NULL)
|
if (result != NULL)
|
||||||
@ -362,13 +362,13 @@ get_name_owner_cb (GObject *source_object,
|
|||||||
static void
|
static void
|
||||||
invoke_get_name_owner (Client *client)
|
invoke_get_name_owner (Client *client)
|
||||||
{
|
{
|
||||||
g_dbus_connection_invoke_method (client->connection,
|
g_dbus_connection_call (client->connection,
|
||||||
"org.freedesktop.DBus", /* bus name */
|
"org.freedesktop.DBus", /* bus name */
|
||||||
"/org/freedesktop/DBus", /* object path */
|
"/org/freedesktop/DBus", /* object path */
|
||||||
"org.freedesktop.DBus", /* interface name */
|
"org.freedesktop.DBus", /* interface name */
|
||||||
"GetNameOwner", /* method name */
|
"GetNameOwner", /* method name */
|
||||||
g_variant_new ("(s)", client->name),
|
g_variant_new ("(s)", client->name),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
(GAsyncReadyCallback) get_name_owner_cb,
|
(GAsyncReadyCallback) get_name_owner_cb,
|
||||||
@ -387,7 +387,7 @@ start_service_by_name_cb (GObject *source_object,
|
|||||||
|
|
||||||
result = NULL;
|
result = NULL;
|
||||||
|
|
||||||
result = g_dbus_connection_invoke_method_finish (client->connection,
|
result = g_dbus_connection_call_finish (client->connection,
|
||||||
res,
|
res,
|
||||||
NULL);
|
NULL);
|
||||||
if (result != NULL)
|
if (result != NULL)
|
||||||
@ -452,13 +452,13 @@ has_connection (Client *client)
|
|||||||
|
|
||||||
if (client->flags & G_BUS_NAME_WATCHER_FLAGS_AUTO_START)
|
if (client->flags & G_BUS_NAME_WATCHER_FLAGS_AUTO_START)
|
||||||
{
|
{
|
||||||
g_dbus_connection_invoke_method (client->connection,
|
g_dbus_connection_call (client->connection,
|
||||||
"org.freedesktop.DBus", /* bus name */
|
"org.freedesktop.DBus", /* bus name */
|
||||||
"/org/freedesktop/DBus", /* object path */
|
"/org/freedesktop/DBus", /* object path */
|
||||||
"org.freedesktop.DBus", /* interface name */
|
"org.freedesktop.DBus", /* interface name */
|
||||||
"StartServiceByName", /* method name */
|
"StartServiceByName", /* method name */
|
||||||
g_variant_new ("(su)", client->name, 0),
|
g_variant_new ("(su)", client->name, 0),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
(GAsyncReadyCallback) start_service_by_name_cb,
|
(GAsyncReadyCallback) start_service_by_name_cb,
|
||||||
|
@ -359,8 +359,8 @@ g_dbus_proxy_class_init (GDBusProxyClass *klass)
|
|||||||
* GDBusProxy:g-default-timeout:
|
* GDBusProxy:g-default-timeout:
|
||||||
*
|
*
|
||||||
* The timeout to use if -1 (specifying default timeout) is passed
|
* The timeout to use if -1 (specifying default timeout) is passed
|
||||||
* as @timeout_msec in the g_dbus_proxy_invoke_method() and
|
* as @timeout_msec in the g_dbus_proxy_call() and
|
||||||
* g_dbus_proxy_invoke_method_sync() functions.
|
* g_dbus_proxy_call_sync() functions.
|
||||||
*
|
*
|
||||||
* This allows applications to set a proxy-wide timeout for all
|
* This allows applications to set a proxy-wide timeout for all
|
||||||
* remote method invocations on the proxy. If this property is -1,
|
* remote method invocations on the proxy. If this property is -1,
|
||||||
@ -752,13 +752,13 @@ initable_init (GInitable *initable,
|
|||||||
if (!(proxy->priv->flags & G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES))
|
if (!(proxy->priv->flags & G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES))
|
||||||
{
|
{
|
||||||
/* load all properties synchronously */
|
/* load all properties synchronously */
|
||||||
result = g_dbus_connection_invoke_method_sync (proxy->priv->connection,
|
result = g_dbus_connection_call_sync (proxy->priv->connection,
|
||||||
proxy->priv->unique_bus_name,
|
proxy->priv->unique_bus_name,
|
||||||
proxy->priv->object_path,
|
proxy->priv->object_path,
|
||||||
"org.freedesktop.DBus.Properties",
|
"org.freedesktop.DBus.Properties",
|
||||||
"GetAll",
|
"GetAll",
|
||||||
g_variant_new ("(s)", proxy->priv->interface_name),
|
g_variant_new ("(s)", proxy->priv->interface_name),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1, /* timeout */
|
-1, /* timeout */
|
||||||
cancellable,
|
cancellable,
|
||||||
error);
|
error);
|
||||||
@ -796,7 +796,7 @@ get_all_cb (GDBusConnection *connection,
|
|||||||
GError *error;
|
GError *error;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
result = g_dbus_connection_invoke_method_finish (connection,
|
result = g_dbus_connection_call_finish (connection,
|
||||||
res,
|
res,
|
||||||
&error);
|
&error);
|
||||||
if (result == NULL)
|
if (result == NULL)
|
||||||
@ -833,13 +833,13 @@ async_initable_init_async (GAsyncInitable *initable,
|
|||||||
if (!(proxy->priv->flags & G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES))
|
if (!(proxy->priv->flags & G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES))
|
||||||
{
|
{
|
||||||
/* load all properties asynchronously */
|
/* load all properties asynchronously */
|
||||||
g_dbus_connection_invoke_method (proxy->priv->connection,
|
g_dbus_connection_call (proxy->priv->connection,
|
||||||
proxy->priv->unique_bus_name,
|
proxy->priv->unique_bus_name,
|
||||||
proxy->priv->object_path,
|
proxy->priv->object_path,
|
||||||
"org.freedesktop.DBus.Properties",
|
"org.freedesktop.DBus.Properties",
|
||||||
"GetAll",
|
"GetAll",
|
||||||
g_variant_new ("(s)", proxy->priv->interface_name),
|
g_variant_new ("(s)", proxy->priv->interface_name),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1, /* timeout */
|
-1, /* timeout */
|
||||||
cancellable,
|
cancellable,
|
||||||
(GAsyncReadyCallback) get_all_cb,
|
(GAsyncReadyCallback) get_all_cb,
|
||||||
@ -1148,8 +1148,8 @@ g_dbus_proxy_get_interface_name (GDBusProxy *proxy)
|
|||||||
* @proxy: A #GDBusProxy.
|
* @proxy: A #GDBusProxy.
|
||||||
*
|
*
|
||||||
* Gets the timeout to use if -1 (specifying default timeout) is
|
* Gets the timeout to use if -1 (specifying default timeout) is
|
||||||
* passed as @timeout_msec in the g_dbus_proxy_invoke_method() and
|
* passed as @timeout_msec in the g_dbus_proxy_call() and
|
||||||
* g_dbus_proxy_invoke_method_sync() functions.
|
* g_dbus_proxy_call_sync() functions.
|
||||||
*
|
*
|
||||||
* See the #GDBusProxy:g-default-timeout property for more details.
|
* See the #GDBusProxy:g-default-timeout property for more details.
|
||||||
*
|
*
|
||||||
@ -1170,8 +1170,8 @@ g_dbus_proxy_get_default_timeout (GDBusProxy *proxy)
|
|||||||
* @timeout_msec: Timeout in milliseconds.
|
* @timeout_msec: Timeout in milliseconds.
|
||||||
*
|
*
|
||||||
* Sets the timeout to use if -1 (specifying default timeout) is
|
* Sets the timeout to use if -1 (specifying default timeout) is
|
||||||
* passed as @timeout_msec in the g_dbus_proxy_invoke_method() and
|
* passed as @timeout_msec in the g_dbus_proxy_call() and
|
||||||
* g_dbus_proxy_invoke_method_sync() functions.
|
* g_dbus_proxy_call_sync() functions.
|
||||||
*
|
*
|
||||||
* See the #GDBusProxy:g-default-timeout property for more details.
|
* See the #GDBusProxy:g-default-timeout property for more details.
|
||||||
*
|
*
|
||||||
@ -1282,7 +1282,7 @@ reply_cb (GDBusConnection *connection,
|
|||||||
GError *error;
|
GError *error;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
value = g_dbus_connection_invoke_method_finish (connection,
|
value = g_dbus_connection_call_finish (connection,
|
||||||
res,
|
res,
|
||||||
&error);
|
&error);
|
||||||
if (error != NULL)
|
if (error != NULL)
|
||||||
@ -1359,11 +1359,11 @@ validate_method_return (const char *method_name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* g_dbus_proxy_invoke_method:
|
* g_dbus_proxy_call:
|
||||||
* @proxy: A #GDBusProxy.
|
* @proxy: A #GDBusProxy.
|
||||||
* @method_name: Name of method to invoke.
|
* @method_name: Name of method to invoke.
|
||||||
* @parameters: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
|
* @parameters: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
|
||||||
* @flags: Flags from the #GDBusInvokeMethodFlags enumeration.
|
* @flags: Flags from the #GDBusCallFlags enumeration.
|
||||||
* @timeout_msec: The timeout in milliseconds or -1 to use the proxy default timeout.
|
* @timeout_msec: The timeout in milliseconds or -1 to use the proxy default timeout.
|
||||||
* @cancellable: A #GCancellable or %NULL.
|
* @cancellable: A #GCancellable or %NULL.
|
||||||
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
|
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
|
||||||
@ -1386,17 +1386,17 @@ validate_method_return (const char *method_name,
|
|||||||
* This is an asynchronous method. When the operation is finished, @callback will be invoked
|
* This is an asynchronous method. When the operation is finished, @callback will be invoked
|
||||||
* in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
|
* in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
|
||||||
* of the thread you are calling this method from. You can then call
|
* of the thread you are calling this method from. You can then call
|
||||||
* g_dbus_proxy_invoke_method_finish() to get the result of the operation.
|
* g_dbus_proxy_call_finish() to get the result of the operation.
|
||||||
* See g_dbus_proxy_invoke_method_sync() for the
|
* See g_dbus_proxy_call_sync() for the
|
||||||
* synchronous version of this method.
|
* synchronous version of this method.
|
||||||
*
|
*
|
||||||
* Since: 2.26
|
* Since: 2.26
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
g_dbus_proxy_invoke_method (GDBusProxy *proxy,
|
g_dbus_proxy_call (GDBusProxy *proxy,
|
||||||
const gchar *method_name,
|
const gchar *method_name,
|
||||||
GVariant *parameters,
|
GVariant *parameters,
|
||||||
GDBusInvokeMethodFlags flags,
|
GDBusCallFlags flags,
|
||||||
gint timeout_msec,
|
gint timeout_msec,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
@ -1418,7 +1418,7 @@ g_dbus_proxy_invoke_method (GDBusProxy *proxy,
|
|||||||
simple = g_simple_async_result_new (G_OBJECT (proxy),
|
simple = g_simple_async_result_new (G_OBJECT (proxy),
|
||||||
callback,
|
callback,
|
||||||
user_data,
|
user_data,
|
||||||
g_dbus_proxy_invoke_method);
|
g_dbus_proxy_call);
|
||||||
|
|
||||||
was_split = maybe_split_method_name (method_name, &split_interface_name, &split_method_name);
|
was_split = maybe_split_method_name (method_name, &split_interface_name, &split_method_name);
|
||||||
target_method_name = was_split ? split_method_name : method_name;
|
target_method_name = was_split ? split_method_name : method_name;
|
||||||
@ -1429,7 +1429,7 @@ g_dbus_proxy_invoke_method (GDBusProxy *proxy,
|
|||||||
/* Just warn here */
|
/* Just warn here */
|
||||||
expected_method_info = lookup_method_info_or_warn (proxy, target_method_name);
|
expected_method_info = lookup_method_info_or_warn (proxy, target_method_name);
|
||||||
|
|
||||||
g_dbus_connection_invoke_method (proxy->priv->connection,
|
g_dbus_connection_call (proxy->priv->connection,
|
||||||
proxy->priv->unique_bus_name,
|
proxy->priv->unique_bus_name,
|
||||||
proxy->priv->object_path,
|
proxy->priv->object_path,
|
||||||
target_interface_name,
|
target_interface_name,
|
||||||
@ -1445,12 +1445,12 @@ g_dbus_proxy_invoke_method (GDBusProxy *proxy,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* g_dbus_proxy_invoke_method_finish:
|
* g_dbus_proxy_call_finish:
|
||||||
* @proxy: A #GDBusProxy.
|
* @proxy: A #GDBusProxy.
|
||||||
* @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_invoke_method().
|
* @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call().
|
||||||
* @error: Return location for error or %NULL.
|
* @error: Return location for error or %NULL.
|
||||||
*
|
*
|
||||||
* Finishes an operation started with g_dbus_proxy_invoke_method().
|
* Finishes an operation started with g_dbus_proxy_call().
|
||||||
*
|
*
|
||||||
* Returns: %NULL if @error is set. Otherwise a #GVariant tuple with
|
* Returns: %NULL if @error is set. Otherwise a #GVariant tuple with
|
||||||
* return values. Free with g_variant_unref().
|
* return values. Free with g_variant_unref().
|
||||||
@ -1458,7 +1458,7 @@ g_dbus_proxy_invoke_method (GDBusProxy *proxy,
|
|||||||
* Since: 2.26
|
* Since: 2.26
|
||||||
*/
|
*/
|
||||||
GVariant *
|
GVariant *
|
||||||
g_dbus_proxy_invoke_method_finish (GDBusProxy *proxy,
|
g_dbus_proxy_call_finish (GDBusProxy *proxy,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
@ -1471,7 +1471,7 @@ g_dbus_proxy_invoke_method_finish (GDBusProxy *proxy,
|
|||||||
g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
|
g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
|
||||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||||
|
|
||||||
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_dbus_proxy_invoke_method);
|
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_dbus_proxy_call);
|
||||||
|
|
||||||
value = NULL;
|
value = NULL;
|
||||||
|
|
||||||
@ -1497,11 +1497,11 @@ g_dbus_proxy_invoke_method_finish (GDBusProxy *proxy,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* g_dbus_proxy_invoke_method_sync:
|
* g_dbus_proxy_call_sync:
|
||||||
* @proxy: A #GDBusProxy.
|
* @proxy: A #GDBusProxy.
|
||||||
* @method_name: Name of method to invoke.
|
* @method_name: Name of method to invoke.
|
||||||
* @parameters: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
|
* @parameters: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
|
||||||
* @flags: Flags from the #GDBusInvokeMethodFlags enumeration.
|
* @flags: Flags from the #GDBusCallFlags enumeration.
|
||||||
* @timeout_msec: The timeout in milliseconds or -1 to use the proxy default timeout.
|
* @timeout_msec: The timeout in milliseconds or -1 to use the proxy default timeout.
|
||||||
* @cancellable: A #GCancellable or %NULL.
|
* @cancellable: A #GCancellable or %NULL.
|
||||||
* @error: Return location for error or %NULL.
|
* @error: Return location for error or %NULL.
|
||||||
@ -1520,7 +1520,7 @@ g_dbus_proxy_invoke_method_finish (GDBusProxy *proxy,
|
|||||||
* %G_IO_ERROR_INVALID_ARGUMENT.
|
* %G_IO_ERROR_INVALID_ARGUMENT.
|
||||||
*
|
*
|
||||||
* The calling thread is blocked until a reply is received. See
|
* The calling thread is blocked until a reply is received. See
|
||||||
* g_dbus_proxy_invoke_method() for the asynchronous version of this
|
* g_dbus_proxy_call() for the asynchronous version of this
|
||||||
* method.
|
* method.
|
||||||
*
|
*
|
||||||
* Returns: %NULL if @error is set. Otherwise a #GVariant tuple with
|
* Returns: %NULL if @error is set. Otherwise a #GVariant tuple with
|
||||||
@ -1529,10 +1529,10 @@ g_dbus_proxy_invoke_method_finish (GDBusProxy *proxy,
|
|||||||
* Since: 2.26
|
* Since: 2.26
|
||||||
*/
|
*/
|
||||||
GVariant *
|
GVariant *
|
||||||
g_dbus_proxy_invoke_method_sync (GDBusProxy *proxy,
|
g_dbus_proxy_call_sync (GDBusProxy *proxy,
|
||||||
const gchar *method_name,
|
const gchar *method_name,
|
||||||
GVariant *parameters,
|
GVariant *parameters,
|
||||||
GDBusInvokeMethodFlags flags,
|
GDBusCallFlags flags,
|
||||||
gint timeout_msec,
|
gint timeout_msec,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GError **error)
|
GError **error)
|
||||||
@ -1567,7 +1567,7 @@ g_dbus_proxy_invoke_method_sync (GDBusProxy *proxy,
|
|||||||
expected_method_info = NULL;
|
expected_method_info = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = g_dbus_connection_invoke_method_sync (proxy->priv->connection,
|
ret = g_dbus_connection_call_sync (proxy->priv->connection,
|
||||||
proxy->priv->unique_bus_name,
|
proxy->priv->unique_bus_name,
|
||||||
proxy->priv->object_path,
|
proxy->priv->object_path,
|
||||||
target_interface_name,
|
target_interface_name,
|
||||||
|
@ -126,21 +126,21 @@ GVariant *g_dbus_proxy_get_cached_property (GDBusProxy *pr
|
|||||||
GError **error);
|
GError **error);
|
||||||
gchar **g_dbus_proxy_get_cached_property_names (GDBusProxy *proxy,
|
gchar **g_dbus_proxy_get_cached_property_names (GDBusProxy *proxy,
|
||||||
GError **error);
|
GError **error);
|
||||||
void g_dbus_proxy_invoke_method (GDBusProxy *proxy,
|
void g_dbus_proxy_call (GDBusProxy *proxy,
|
||||||
const gchar *method_name,
|
const gchar *method_name,
|
||||||
GVariant *parameters,
|
GVariant *parameters,
|
||||||
GDBusInvokeMethodFlags flags,
|
GDBusCallFlags flags,
|
||||||
gint timeout_msec,
|
gint timeout_msec,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
GVariant *g_dbus_proxy_invoke_method_finish (GDBusProxy *proxy,
|
GVariant *g_dbus_proxy_call_finish (GDBusProxy *proxy,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error);
|
GError **error);
|
||||||
GVariant *g_dbus_proxy_invoke_method_sync (GDBusProxy *proxy,
|
GVariant *g_dbus_proxy_call_sync (GDBusProxy *proxy,
|
||||||
const gchar *method_name,
|
const gchar *method_name,
|
||||||
GVariant *parameters,
|
GVariant *parameters,
|
||||||
GDBusInvokeMethodFlags flags,
|
GDBusCallFlags flags,
|
||||||
gint timeout_msec,
|
gint timeout_msec,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
@ -994,7 +994,7 @@ g_bus_name_watcher_flags_get_type G_GNUC_CONST
|
|||||||
g_dbus_proxy_flags_get_type G_GNUC_CONST
|
g_dbus_proxy_flags_get_type G_GNUC_CONST
|
||||||
g_dbus_connection_flags_get_type G_GNUC_CONST
|
g_dbus_connection_flags_get_type G_GNUC_CONST
|
||||||
g_dbus_capability_flags_get_type G_GNUC_CONST
|
g_dbus_capability_flags_get_type G_GNUC_CONST
|
||||||
g_dbus_invoke_method_flags_get_type G_GNUC_CONST
|
g_dbus_call_flags_get_type G_GNUC_CONST
|
||||||
g_dbus_message_type_get_type G_GNUC_CONST
|
g_dbus_message_type_get_type G_GNUC_CONST
|
||||||
g_dbus_message_flags_get_type G_GNUC_CONST
|
g_dbus_message_flags_get_type G_GNUC_CONST
|
||||||
g_dbus_message_header_field_get_type G_GNUC_CONST
|
g_dbus_message_header_field_get_type G_GNUC_CONST
|
||||||
@ -1501,9 +1501,9 @@ g_dbus_connection_is_closed
|
|||||||
g_dbus_connection_set_exit_on_close
|
g_dbus_connection_set_exit_on_close
|
||||||
g_dbus_connection_close
|
g_dbus_connection_close
|
||||||
g_dbus_connection_emit_signal
|
g_dbus_connection_emit_signal
|
||||||
g_dbus_connection_invoke_method
|
g_dbus_connection_call
|
||||||
g_dbus_connection_invoke_method_finish
|
g_dbus_connection_call_finish
|
||||||
g_dbus_connection_invoke_method_sync
|
g_dbus_connection_call_sync
|
||||||
g_dbus_connection_signal_subscribe
|
g_dbus_connection_signal_subscribe
|
||||||
g_dbus_connection_signal_unsubscribe
|
g_dbus_connection_signal_unsubscribe
|
||||||
g_dbus_connection_add_filter
|
g_dbus_connection_add_filter
|
||||||
@ -1673,9 +1673,9 @@ g_dbus_proxy_get_object_path
|
|||||||
g_dbus_proxy_get_unique_bus_name
|
g_dbus_proxy_get_unique_bus_name
|
||||||
g_dbus_proxy_set_default_timeout
|
g_dbus_proxy_set_default_timeout
|
||||||
g_dbus_proxy_set_interface_info
|
g_dbus_proxy_set_interface_info
|
||||||
g_dbus_proxy_invoke_method
|
g_dbus_proxy_call
|
||||||
g_dbus_proxy_invoke_method_finish
|
g_dbus_proxy_call_finish
|
||||||
g_dbus_proxy_invoke_method_sync
|
g_dbus_proxy_call_sync
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -994,20 +994,20 @@ typedef enum {
|
|||||||
} GDBusCapabilityFlags;
|
} GDBusCapabilityFlags;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GDBusInvokeMethodFlags:
|
* GDBusCallFlags:
|
||||||
* @G_DBUS_INVOKE_METHOD_FLAGS_NONE: No flags set.
|
* @G_DBUS_CALL_FLAGS_NONE: No flags set.
|
||||||
* @G_DBUS_INVOKE_METHOD_FLAGS_NO_AUTO_START: The bus must not launch
|
* @G_DBUS_CALL_FLAGS_NO_AUTO_START: The bus must not launch
|
||||||
* an owner for the destination name in response to this method
|
* an owner for the destination name in response to this method
|
||||||
* invocation.
|
* invocation.
|
||||||
*
|
*
|
||||||
* Flags used in g_dbus_connection_invoke_method() and similar APIs.
|
* Flags used in g_dbus_connection_call() and similar APIs.
|
||||||
*
|
*
|
||||||
* Since: 2.26
|
* Since: 2.26
|
||||||
*/
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE = 0,
|
G_DBUS_CALL_FLAGS_NONE = 0,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NO_AUTO_START = (1<<0),
|
G_DBUS_CALL_FLAGS_NO_AUTO_START = (1<<0),
|
||||||
} GDBusInvokeMethodFlags;
|
} GDBusCallFlags;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GDBusMessageType:
|
* GDBusMessageType:
|
||||||
|
@ -118,7 +118,7 @@ msg_cb_expect_error_disconnected (GDBusConnection *connection,
|
|||||||
GVariant *result;
|
GVariant *result;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
result = g_dbus_connection_invoke_method_finish (connection,
|
result = g_dbus_connection_call_finish (connection,
|
||||||
res,
|
res,
|
||||||
&error);
|
&error);
|
||||||
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CLOSED);
|
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CLOSED);
|
||||||
@ -138,7 +138,7 @@ msg_cb_expect_error_unknown_method (GDBusConnection *connection,
|
|||||||
GVariant *result;
|
GVariant *result;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
result = g_dbus_connection_invoke_method_finish (connection,
|
result = g_dbus_connection_call_finish (connection,
|
||||||
res,
|
res,
|
||||||
&error);
|
&error);
|
||||||
g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD);
|
g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD);
|
||||||
@ -157,7 +157,7 @@ msg_cb_expect_success (GDBusConnection *connection,
|
|||||||
GVariant *result;
|
GVariant *result;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
result = g_dbus_connection_invoke_method_finish (connection,
|
result = g_dbus_connection_call_finish (connection,
|
||||||
res,
|
res,
|
||||||
&error);
|
&error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
@ -176,7 +176,7 @@ msg_cb_expect_error_cancelled (GDBusConnection *connection,
|
|||||||
GVariant *result;
|
GVariant *result;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
result = g_dbus_connection_invoke_method_finish (connection,
|
result = g_dbus_connection_call_finish (connection,
|
||||||
res,
|
res,
|
||||||
&error);
|
&error);
|
||||||
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED);
|
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED);
|
||||||
@ -196,7 +196,7 @@ msg_cb_expect_error_cancelled_2 (GDBusConnection *connection,
|
|||||||
GVariant *result;
|
GVariant *result;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
result = g_dbus_connection_invoke_method_finish (connection,
|
result = g_dbus_connection_call_finish (connection,
|
||||||
res,
|
res,
|
||||||
&error);
|
&error);
|
||||||
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED);
|
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED);
|
||||||
@ -229,13 +229,13 @@ test_connection_send (void)
|
|||||||
*/
|
*/
|
||||||
ca = g_cancellable_new ();
|
ca = g_cancellable_new ();
|
||||||
g_cancellable_cancel (ca);
|
g_cancellable_cancel (ca);
|
||||||
g_dbus_connection_invoke_method (c,
|
g_dbus_connection_call (c,
|
||||||
"org.freedesktop.DBus", /* bus_name */
|
"org.freedesktop.DBus", /* bus_name */
|
||||||
"/org/freedesktop/DBus", /* object path */
|
"/org/freedesktop/DBus", /* object path */
|
||||||
"org.freedesktop.DBus", /* interface name */
|
"org.freedesktop.DBus", /* interface name */
|
||||||
"GetId", /* method name */
|
"GetId", /* method name */
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
ca,
|
ca,
|
||||||
(GAsyncReadyCallback) msg_cb_expect_error_cancelled,
|
(GAsyncReadyCallback) msg_cb_expect_error_cancelled,
|
||||||
@ -246,13 +246,13 @@ test_connection_send (void)
|
|||||||
/*
|
/*
|
||||||
* Check that we get a reply to the GetId() method call.
|
* Check that we get a reply to the GetId() method call.
|
||||||
*/
|
*/
|
||||||
g_dbus_connection_invoke_method (c,
|
g_dbus_connection_call (c,
|
||||||
"org.freedesktop.DBus", /* bus_name */
|
"org.freedesktop.DBus", /* bus_name */
|
||||||
"/org/freedesktop/DBus", /* object path */
|
"/org/freedesktop/DBus", /* object path */
|
||||||
"org.freedesktop.DBus", /* interface name */
|
"org.freedesktop.DBus", /* interface name */
|
||||||
"GetId", /* method name */
|
"GetId", /* method name */
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
(GAsyncReadyCallback) msg_cb_expect_success,
|
(GAsyncReadyCallback) msg_cb_expect_success,
|
||||||
@ -262,13 +262,13 @@ test_connection_send (void)
|
|||||||
/*
|
/*
|
||||||
* Check that we get an error reply to the NonExistantMethod() method call.
|
* Check that we get an error reply to the NonExistantMethod() method call.
|
||||||
*/
|
*/
|
||||||
g_dbus_connection_invoke_method (c,
|
g_dbus_connection_call (c,
|
||||||
"org.freedesktop.DBus", /* bus_name */
|
"org.freedesktop.DBus", /* bus_name */
|
||||||
"/org/freedesktop/DBus", /* object path */
|
"/org/freedesktop/DBus", /* object path */
|
||||||
"org.freedesktop.DBus", /* interface name */
|
"org.freedesktop.DBus", /* interface name */
|
||||||
"NonExistantMethod", /* method name */
|
"NonExistantMethod", /* method name */
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
(GAsyncReadyCallback) msg_cb_expect_error_unknown_method,
|
(GAsyncReadyCallback) msg_cb_expect_error_unknown_method,
|
||||||
@ -279,13 +279,13 @@ test_connection_send (void)
|
|||||||
* Check that cancellation works when the message is already in flight.
|
* Check that cancellation works when the message is already in flight.
|
||||||
*/
|
*/
|
||||||
ca = g_cancellable_new ();
|
ca = g_cancellable_new ();
|
||||||
g_dbus_connection_invoke_method (c,
|
g_dbus_connection_call (c,
|
||||||
"org.freedesktop.DBus", /* bus_name */
|
"org.freedesktop.DBus", /* bus_name */
|
||||||
"/org/freedesktop/DBus", /* object path */
|
"/org/freedesktop/DBus", /* object path */
|
||||||
"org.freedesktop.DBus", /* interface name */
|
"org.freedesktop.DBus", /* interface name */
|
||||||
"GetId", /* method name */
|
"GetId", /* method name */
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
ca,
|
ca,
|
||||||
(GAsyncReadyCallback) msg_cb_expect_error_cancelled_2,
|
(GAsyncReadyCallback) msg_cb_expect_error_cancelled_2,
|
||||||
@ -302,13 +302,13 @@ test_connection_send (void)
|
|||||||
_g_assert_signal_received (c, "closed");
|
_g_assert_signal_received (c, "closed");
|
||||||
g_assert (g_dbus_connection_is_closed (c));
|
g_assert (g_dbus_connection_is_closed (c));
|
||||||
|
|
||||||
g_dbus_connection_invoke_method (c,
|
g_dbus_connection_call (c,
|
||||||
"org.freedesktop.DBus", /* bus_name */
|
"org.freedesktop.DBus", /* bus_name */
|
||||||
"/org/freedesktop/DBus", /* object path */
|
"/org/freedesktop/DBus", /* object path */
|
||||||
"org.freedesktop.DBus", /* interface name */
|
"org.freedesktop.DBus", /* interface name */
|
||||||
"GetId", /* method name */
|
"GetId", /* method name */
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
(GAsyncReadyCallback) msg_cb_expect_error_disconnected,
|
(GAsyncReadyCallback) msg_cb_expect_error_disconnected,
|
||||||
@ -456,13 +456,13 @@ test_connection_signals (void)
|
|||||||
*
|
*
|
||||||
* To ensure this is not the case, do a synchronous call on c1.
|
* To ensure this is not the case, do a synchronous call on c1.
|
||||||
*/
|
*/
|
||||||
result = g_dbus_connection_invoke_method_sync (c1,
|
result = g_dbus_connection_call_sync (c1,
|
||||||
"org.freedesktop.DBus", /* bus name */
|
"org.freedesktop.DBus", /* bus name */
|
||||||
"/org/freedesktop/DBus", /* object path */
|
"/org/freedesktop/DBus", /* object path */
|
||||||
"org.freedesktop.DBus", /* interface name */
|
"org.freedesktop.DBus", /* interface name */
|
||||||
"GetId", /* method name */
|
"GetId", /* method name */
|
||||||
NULL, /* parameters */
|
NULL, /* parameters */
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
|
@ -287,13 +287,13 @@ main (int argc, char *argv[])
|
|||||||
g_dbus_connection_get_capabilities (connection) & G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING);
|
g_dbus_connection_get_capabilities (connection) & G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING);
|
||||||
|
|
||||||
greeting = g_strdup_printf ("Hey, it's %" G_GUINT64_FORMAT " already!", (guint64) time (NULL));
|
greeting = g_strdup_printf ("Hey, it's %" G_GUINT64_FORMAT " already!", (guint64) time (NULL));
|
||||||
value = g_dbus_connection_invoke_method_sync (connection,
|
value = g_dbus_connection_call_sync (connection,
|
||||||
NULL, /* bus_name */
|
NULL, /* bus_name */
|
||||||
"/org/gtk/GDBus/TestObject",
|
"/org/gtk/GDBus/TestObject",
|
||||||
"org.gtk.GDBus.TestPeerInterface",
|
"org.gtk.GDBus.TestPeerInterface",
|
||||||
"HelloWorld",
|
"HelloWorld",
|
||||||
g_variant_new ("(s)", greeting),
|
g_variant_new ("(s)", greeting),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
|
@ -320,7 +320,7 @@ introspect_callback (GDBusProxy *proxy,
|
|||||||
GError *error;
|
GError *error;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
result = g_dbus_proxy_invoke_method_finish (proxy,
|
result = g_dbus_proxy_call_finish (proxy,
|
||||||
res,
|
res,
|
||||||
&error);
|
&error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
@ -359,10 +359,10 @@ get_nodes_at (GDBusConnection *c,
|
|||||||
|
|
||||||
/* do this async to avoid libdbus-1 deadlocks */
|
/* do this async to avoid libdbus-1 deadlocks */
|
||||||
xml_data = NULL;
|
xml_data = NULL;
|
||||||
g_dbus_proxy_invoke_method (proxy,
|
g_dbus_proxy_call (proxy,
|
||||||
"Introspect",
|
"Introspect",
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
(GAsyncReadyCallback) introspect_callback,
|
(GAsyncReadyCallback) introspect_callback,
|
||||||
@ -416,10 +416,10 @@ has_interface (GDBusConnection *c,
|
|||||||
|
|
||||||
/* do this async to avoid libdbus-1 deadlocks */
|
/* do this async to avoid libdbus-1 deadlocks */
|
||||||
xml_data = NULL;
|
xml_data = NULL;
|
||||||
g_dbus_proxy_invoke_method (proxy,
|
g_dbus_proxy_call (proxy,
|
||||||
"Introspect",
|
"Introspect",
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
(GAsyncReadyCallback) introspect_callback,
|
(GAsyncReadyCallback) introspect_callback,
|
||||||
@ -466,10 +466,10 @@ count_interfaces (GDBusConnection *c,
|
|||||||
|
|
||||||
/* do this async to avoid libdbus-1 deadlocks */
|
/* do this async to avoid libdbus-1 deadlocks */
|
||||||
xml_data = NULL;
|
xml_data = NULL;
|
||||||
g_dbus_proxy_invoke_method (proxy,
|
g_dbus_proxy_call (proxy,
|
||||||
"Introspect",
|
"Introspect",
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
(GAsyncReadyCallback) introspect_callback,
|
(GAsyncReadyCallback) introspect_callback,
|
||||||
@ -501,7 +501,7 @@ dyna_create_callback (GDBusProxy *proxy,
|
|||||||
GError *error;
|
GError *error;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
result = g_dbus_proxy_invoke_method_finish (proxy,
|
result = g_dbus_proxy_call_finish (proxy,
|
||||||
res,
|
res,
|
||||||
&error);
|
&error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
@ -537,10 +537,10 @@ dyna_create (GDBusConnection *c,
|
|||||||
g_assert (proxy != NULL);
|
g_assert (proxy != NULL);
|
||||||
|
|
||||||
/* do this async to avoid libdbus-1 deadlocks */
|
/* do this async to avoid libdbus-1 deadlocks */
|
||||||
g_dbus_proxy_invoke_method (proxy,
|
g_dbus_proxy_call (proxy,
|
||||||
"DynaCyber",
|
"DynaCyber",
|
||||||
g_variant_new ("()"),
|
g_variant_new ("()"),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
(GAsyncReadyCallback) dyna_create_callback,
|
(GAsyncReadyCallback) dyna_create_callback,
|
||||||
@ -760,10 +760,10 @@ test_dispatch_thread_func (gpointer user_data)
|
|||||||
|
|
||||||
/* generic interfaces */
|
/* generic interfaces */
|
||||||
error = NULL;
|
error = NULL;
|
||||||
value = g_dbus_proxy_invoke_method_sync (foo_proxy,
|
value = g_dbus_proxy_call_sync (foo_proxy,
|
||||||
"org.freedesktop.DBus.Peer.Ping",
|
"org.freedesktop.DBus.Peer.Ping",
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -773,10 +773,10 @@ test_dispatch_thread_func (gpointer user_data)
|
|||||||
|
|
||||||
/* user methods */
|
/* user methods */
|
||||||
error = NULL;
|
error = NULL;
|
||||||
value = g_dbus_proxy_invoke_method_sync (foo_proxy,
|
value = g_dbus_proxy_call_sync (foo_proxy,
|
||||||
"Method1",
|
"Method1",
|
||||||
g_variant_new ("(s)", "winwinwin"),
|
g_variant_new ("(s)", "winwinwin"),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -788,10 +788,10 @@ test_dispatch_thread_func (gpointer user_data)
|
|||||||
g_variant_unref (value);
|
g_variant_unref (value);
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
value = g_dbus_proxy_invoke_method_sync (foo_proxy,
|
value = g_dbus_proxy_call_sync (foo_proxy,
|
||||||
"Method2",
|
"Method2",
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -801,10 +801,10 @@ test_dispatch_thread_func (gpointer user_data)
|
|||||||
g_assert (value == NULL);
|
g_assert (value == NULL);
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
value = g_dbus_proxy_invoke_method_sync (foo_proxy,
|
value = g_dbus_proxy_call_sync (foo_proxy,
|
||||||
"Method2",
|
"Method2",
|
||||||
g_variant_new ("(s)", "failfailfail"),
|
g_variant_new ("(s)", "failfailfail"),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -814,10 +814,10 @@ test_dispatch_thread_func (gpointer user_data)
|
|||||||
g_assert (value == NULL);
|
g_assert (value == NULL);
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
value = g_dbus_proxy_invoke_method_sync (foo_proxy,
|
value = g_dbus_proxy_call_sync (foo_proxy,
|
||||||
"NonExistantMethod",
|
"NonExistantMethod",
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -828,12 +828,12 @@ test_dispatch_thread_func (gpointer user_data)
|
|||||||
|
|
||||||
/* user properties */
|
/* user properties */
|
||||||
error = NULL;
|
error = NULL;
|
||||||
value = g_dbus_proxy_invoke_method_sync (foo_proxy,
|
value = g_dbus_proxy_call_sync (foo_proxy,
|
||||||
"org.freedesktop.DBus.Properties.Get",
|
"org.freedesktop.DBus.Properties.Get",
|
||||||
g_variant_new ("(ss)",
|
g_variant_new ("(ss)",
|
||||||
"org.example.Foo",
|
"org.example.Foo",
|
||||||
"PropertyUno"),
|
"PropertyUno"),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -846,12 +846,12 @@ test_dispatch_thread_func (gpointer user_data)
|
|||||||
g_variant_unref (value);
|
g_variant_unref (value);
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
value = g_dbus_proxy_invoke_method_sync (foo_proxy,
|
value = g_dbus_proxy_call_sync (foo_proxy,
|
||||||
"org.freedesktop.DBus.Properties.Get",
|
"org.freedesktop.DBus.Properties.Get",
|
||||||
g_variant_new ("(ss)",
|
g_variant_new ("(ss)",
|
||||||
"org.example.Foo",
|
"org.example.Foo",
|
||||||
"ThisDoesntExist"),
|
"ThisDoesntExist"),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -861,12 +861,12 @@ test_dispatch_thread_func (gpointer user_data)
|
|||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
value = g_dbus_proxy_invoke_method_sync (foo_proxy,
|
value = g_dbus_proxy_call_sync (foo_proxy,
|
||||||
"org.freedesktop.DBus.Properties.Get",
|
"org.freedesktop.DBus.Properties.Get",
|
||||||
g_variant_new ("(ss)",
|
g_variant_new ("(ss)",
|
||||||
"org.example.Foo",
|
"org.example.Foo",
|
||||||
"NotReadable"),
|
"NotReadable"),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -876,13 +876,13 @@ test_dispatch_thread_func (gpointer user_data)
|
|||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
value = g_dbus_proxy_invoke_method_sync (foo_proxy,
|
value = g_dbus_proxy_call_sync (foo_proxy,
|
||||||
"org.freedesktop.DBus.Properties.Set",
|
"org.freedesktop.DBus.Properties.Set",
|
||||||
g_variant_new ("(ssv)",
|
g_variant_new ("(ssv)",
|
||||||
"org.example.Foo",
|
"org.example.Foo",
|
||||||
"NotReadable",
|
"NotReadable",
|
||||||
g_variant_new_string ("But Writable you are!")),
|
g_variant_new_string ("But Writable you are!")),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -892,13 +892,13 @@ test_dispatch_thread_func (gpointer user_data)
|
|||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
value = g_dbus_proxy_invoke_method_sync (foo_proxy,
|
value = g_dbus_proxy_call_sync (foo_proxy,
|
||||||
"org.freedesktop.DBus.Properties.Set",
|
"org.freedesktop.DBus.Properties.Set",
|
||||||
g_variant_new ("(ssv)",
|
g_variant_new ("(ssv)",
|
||||||
"org.example.Foo",
|
"org.example.Foo",
|
||||||
"NotWritable",
|
"NotWritable",
|
||||||
g_variant_new_uint32 (42)),
|
g_variant_new_uint32 (42)),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -908,11 +908,11 @@ test_dispatch_thread_func (gpointer user_data)
|
|||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
value = g_dbus_proxy_invoke_method_sync (foo_proxy,
|
value = g_dbus_proxy_call_sync (foo_proxy,
|
||||||
"org.freedesktop.DBus.Properties.GetAll",
|
"org.freedesktop.DBus.Properties.GetAll",
|
||||||
g_variant_new ("(s)",
|
g_variant_new ("(s)",
|
||||||
"org.example.Foo"),
|
"org.example.Foo"),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
|
@ -53,10 +53,10 @@ introspection_on_proxy_appeared (GDBusConnection *connection,
|
|||||||
/*
|
/*
|
||||||
* Invoke Introspect(), then parse the output.
|
* Invoke Introspect(), then parse the output.
|
||||||
*/
|
*/
|
||||||
result = g_dbus_proxy_invoke_method_sync (proxy,
|
result = g_dbus_proxy_call_sync (proxy,
|
||||||
"org.freedesktop.DBus.Introspectable.Introspect",
|
"org.freedesktop.DBus.Introspectable.Introspect",
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
|
@ -170,13 +170,13 @@ test_bus_own_name (void)
|
|||||||
c = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
|
c = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
|
||||||
g_assert (c != NULL);
|
g_assert (c != NULL);
|
||||||
g_assert (!g_dbus_connection_is_closed (c));
|
g_assert (!g_dbus_connection_is_closed (c));
|
||||||
result = g_dbus_connection_invoke_method_sync (c,
|
result = g_dbus_connection_call_sync (c,
|
||||||
"org.freedesktop.DBus", /* bus name */
|
"org.freedesktop.DBus", /* bus name */
|
||||||
"/org/freedesktop/DBus", /* object path */
|
"/org/freedesktop/DBus", /* object path */
|
||||||
"org.freedesktop.DBus", /* interface name */
|
"org.freedesktop.DBus", /* interface name */
|
||||||
"NameHasOwner", /* method name */
|
"NameHasOwner", /* method name */
|
||||||
g_variant_new ("(s)", name),
|
g_variant_new ("(s)", name),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -195,13 +195,13 @@ test_bus_own_name (void)
|
|||||||
/*
|
/*
|
||||||
* Check that the name was actually released.
|
* Check that the name was actually released.
|
||||||
*/
|
*/
|
||||||
result = g_dbus_connection_invoke_method_sync (c,
|
result = g_dbus_connection_call_sync (c,
|
||||||
"org.freedesktop.DBus", /* bus name */
|
"org.freedesktop.DBus", /* bus name */
|
||||||
"/org/freedesktop/DBus", /* object path */
|
"/org/freedesktop/DBus", /* object path */
|
||||||
"org.freedesktop.DBus", /* interface name */
|
"org.freedesktop.DBus", /* interface name */
|
||||||
"NameHasOwner", /* method name */
|
"NameHasOwner", /* method name */
|
||||||
g_variant_new ("(s)", name),
|
g_variant_new ("(s)", name),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
|
@ -537,10 +537,10 @@ test_peer (void)
|
|||||||
|
|
||||||
/* try invoking a method */
|
/* try invoking a method */
|
||||||
error = NULL;
|
error = NULL;
|
||||||
result = g_dbus_proxy_invoke_method_sync (proxy,
|
result = g_dbus_proxy_call_sync (proxy,
|
||||||
"HelloPeer",
|
"HelloPeer",
|
||||||
g_variant_new ("(s)", "Hey Peer!"),
|
g_variant_new ("(s)", "Hey Peer!"),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL, /* GCancellable */
|
NULL, /* GCancellable */
|
||||||
&error);
|
&error);
|
||||||
@ -556,10 +556,10 @@ test_peer (void)
|
|||||||
G_CALLBACK (on_proxy_signal_received),
|
G_CALLBACK (on_proxy_signal_received),
|
||||||
&data);
|
&data);
|
||||||
g_assert (!data.signal_received);
|
g_assert (!data.signal_received);
|
||||||
g_dbus_proxy_invoke_method (proxy,
|
g_dbus_proxy_call (proxy,
|
||||||
"EmitSignal",
|
"EmitSignal",
|
||||||
NULL, /* no arguments */
|
NULL, /* no arguments */
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL, /* GCancellable */
|
NULL, /* GCancellable */
|
||||||
NULL, /* GAsyncReadyCallback - we don't care about the result */
|
NULL, /* GAsyncReadyCallback - we don't care about the result */
|
||||||
@ -679,10 +679,10 @@ test_peer (void)
|
|||||||
server = NULL;
|
server = NULL;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
result = g_dbus_proxy_invoke_method_sync (proxy,
|
result = g_dbus_proxy_call_sync (proxy,
|
||||||
"HelloPeer",
|
"HelloPeer",
|
||||||
g_variant_new ("(s)", "Hey Again Peer!"),
|
g_variant_new ("(s)", "Hey Again Peer!"),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL, /* GCancellable */
|
NULL, /* GCancellable */
|
||||||
&error);
|
&error);
|
||||||
|
@ -46,10 +46,10 @@ test_methods (GDBusConnection *connection,
|
|||||||
|
|
||||||
/* check that we can invoke a method */
|
/* check that we can invoke a method */
|
||||||
error = NULL;
|
error = NULL;
|
||||||
result = g_dbus_proxy_invoke_method_sync (proxy,
|
result = g_dbus_proxy_call_sync (proxy,
|
||||||
"HelloWorld",
|
"HelloWorld",
|
||||||
g_variant_new ("(s)", "Hey"),
|
g_variant_new ("(s)", "Hey"),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -61,10 +61,10 @@ test_methods (GDBusConnection *connection,
|
|||||||
g_variant_unref (result);
|
g_variant_unref (result);
|
||||||
|
|
||||||
/* Check that we can completely recover the returned error */
|
/* Check that we can completely recover the returned error */
|
||||||
result = g_dbus_proxy_invoke_method_sync (proxy,
|
result = g_dbus_proxy_call_sync (proxy,
|
||||||
"HelloWorld",
|
"HelloWorld",
|
||||||
g_variant_new ("(s)", "Yo"),
|
g_variant_new ("(s)", "Yo"),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -81,10 +81,10 @@ test_methods (GDBusConnection *connection,
|
|||||||
|
|
||||||
/* Check that we get a timeout if the method handling is taking longer than timeout */
|
/* Check that we get a timeout if the method handling is taking longer than timeout */
|
||||||
error = NULL;
|
error = NULL;
|
||||||
result = g_dbus_proxy_invoke_method_sync (proxy,
|
result = g_dbus_proxy_call_sync (proxy,
|
||||||
"Sleep",
|
"Sleep",
|
||||||
g_variant_new ("(i)", 500 /* msec */),
|
g_variant_new ("(i)", 500 /* msec */),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
100 /* msec */,
|
100 /* msec */,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -97,10 +97,10 @@ test_methods (GDBusConnection *connection,
|
|||||||
g_assert_cmpint (g_dbus_proxy_get_default_timeout (proxy), ==, -1);
|
g_assert_cmpint (g_dbus_proxy_get_default_timeout (proxy), ==, -1);
|
||||||
|
|
||||||
/* the default timeout is 25000 msec so this should work */
|
/* the default timeout is 25000 msec so this should work */
|
||||||
result = g_dbus_proxy_invoke_method_sync (proxy,
|
result = g_dbus_proxy_call_sync (proxy,
|
||||||
"Sleep",
|
"Sleep",
|
||||||
g_variant_new ("(i)", 500 /* msec */),
|
g_variant_new ("(i)", 500 /* msec */),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1, /* use proxy default (e.g. -1 -> e.g. 25000 msec) */
|
-1, /* use proxy default (e.g. -1 -> e.g. 25000 msec) */
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -112,10 +112,10 @@ test_methods (GDBusConnection *connection,
|
|||||||
/* now set the proxy-default timeout to 250 msec and try the 500 msec call - this should FAIL */
|
/* now set the proxy-default timeout to 250 msec and try the 500 msec call - this should FAIL */
|
||||||
g_dbus_proxy_set_default_timeout (proxy, 250);
|
g_dbus_proxy_set_default_timeout (proxy, 250);
|
||||||
g_assert_cmpint (g_dbus_proxy_get_default_timeout (proxy), ==, 250);
|
g_assert_cmpint (g_dbus_proxy_get_default_timeout (proxy), ==, 250);
|
||||||
result = g_dbus_proxy_invoke_method_sync (proxy,
|
result = g_dbus_proxy_call_sync (proxy,
|
||||||
"Sleep",
|
"Sleep",
|
||||||
g_variant_new ("(i)", 500 /* msec */),
|
g_variant_new ("(i)", 500 /* msec */),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1, /* use proxy default (e.g. 250 msec) */
|
-1, /* use proxy default (e.g. 250 msec) */
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -166,12 +166,12 @@ test_properties (GDBusConnection *connection,
|
|||||||
* is received. Also check that the cache is updated.
|
* is received. Also check that the cache is updated.
|
||||||
*/
|
*/
|
||||||
variant2 = g_variant_new_byte (42);
|
variant2 = g_variant_new_byte (42);
|
||||||
result = g_dbus_proxy_invoke_method_sync (proxy,
|
result = g_dbus_proxy_call_sync (proxy,
|
||||||
"FrobSetProperty",
|
"FrobSetProperty",
|
||||||
g_variant_new ("(sv)",
|
g_variant_new ("(sv)",
|
||||||
"y",
|
"y",
|
||||||
variant2),
|
variant2),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -222,7 +222,7 @@ test_proxy_signals_on_emit_signal_cb (GDBusProxy *proxy,
|
|||||||
GVariant *result;
|
GVariant *result;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
result = g_dbus_proxy_invoke_method_finish (proxy,
|
result = g_dbus_proxy_call_finish (proxy,
|
||||||
res,
|
res,
|
||||||
&error);
|
&error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
@ -263,12 +263,12 @@ test_signals (GDBusConnection *connection,
|
|||||||
G_CALLBACK (test_proxy_signals_on_signal),
|
G_CALLBACK (test_proxy_signals_on_signal),
|
||||||
s);
|
s);
|
||||||
|
|
||||||
result = g_dbus_proxy_invoke_method_sync (proxy,
|
result = g_dbus_proxy_call_sync (proxy,
|
||||||
"EmitSignal",
|
"EmitSignal",
|
||||||
g_variant_new ("(so)",
|
g_variant_new ("(so)",
|
||||||
"Accept the next proposition you hear",
|
"Accept the next proposition you hear",
|
||||||
"/some/path"),
|
"/some/path"),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -296,12 +296,12 @@ test_signals (GDBusConnection *connection,
|
|||||||
"g-signal",
|
"g-signal",
|
||||||
G_CALLBACK (test_proxy_signals_on_signal),
|
G_CALLBACK (test_proxy_signals_on_signal),
|
||||||
s);
|
s);
|
||||||
g_dbus_proxy_invoke_method (proxy,
|
g_dbus_proxy_call (proxy,
|
||||||
"EmitSignal",
|
"EmitSignal",
|
||||||
g_variant_new ("(so)",
|
g_variant_new ("(so)",
|
||||||
"You will make a great programmer",
|
"You will make a great programmer",
|
||||||
"/some/other/path"),
|
"/some/other/path"),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
(GAsyncReadyCallback) test_proxy_signals_on_emit_signal_cb,
|
(GAsyncReadyCallback) test_proxy_signals_on_emit_signal_cb,
|
||||||
@ -324,10 +324,10 @@ test_bogus_method_return (GDBusConnection *connection,
|
|||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
GVariant *result;
|
GVariant *result;
|
||||||
|
|
||||||
result = g_dbus_proxy_invoke_method_sync (proxy,
|
result = g_dbus_proxy_call_sync (proxy,
|
||||||
"PairReturn",
|
"PairReturn",
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
|
@ -52,7 +52,7 @@ msg_cb_expect_success (GDBusConnection *connection,
|
|||||||
GVariant *result;
|
GVariant *result;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
result = g_dbus_connection_invoke_method_finish (connection,
|
result = g_dbus_connection_call_finish (connection,
|
||||||
res,
|
res,
|
||||||
&error);
|
&error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
@ -74,7 +74,7 @@ msg_cb_expect_error_cancelled (GDBusConnection *connection,
|
|||||||
GVariant *result;
|
GVariant *result;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
result = g_dbus_connection_invoke_method_finish (connection,
|
result = g_dbus_connection_call_finish (connection,
|
||||||
res,
|
res,
|
||||||
&error);
|
&error);
|
||||||
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED);
|
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED);
|
||||||
@ -131,13 +131,13 @@ test_delivery_in_thread_func (gpointer _data)
|
|||||||
/*
|
/*
|
||||||
* Check that we get a reply to the GetId() method call.
|
* Check that we get a reply to the GetId() method call.
|
||||||
*/
|
*/
|
||||||
g_dbus_connection_invoke_method (c,
|
g_dbus_connection_call (c,
|
||||||
"org.freedesktop.DBus", /* bus_name */
|
"org.freedesktop.DBus", /* bus_name */
|
||||||
"/org/freedesktop/DBus", /* object path */
|
"/org/freedesktop/DBus", /* object path */
|
||||||
"org.freedesktop.DBus", /* interface name */
|
"org.freedesktop.DBus", /* interface name */
|
||||||
"GetId", /* method name */
|
"GetId", /* method name */
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
(GAsyncReadyCallback) msg_cb_expect_success,
|
(GAsyncReadyCallback) msg_cb_expect_success,
|
||||||
@ -151,13 +151,13 @@ test_delivery_in_thread_func (gpointer _data)
|
|||||||
*/
|
*/
|
||||||
ca = g_cancellable_new ();
|
ca = g_cancellable_new ();
|
||||||
g_cancellable_cancel (ca);
|
g_cancellable_cancel (ca);
|
||||||
g_dbus_connection_invoke_method (c,
|
g_dbus_connection_call (c,
|
||||||
"org.freedesktop.DBus", /* bus_name */
|
"org.freedesktop.DBus", /* bus_name */
|
||||||
"/org/freedesktop/DBus", /* object path */
|
"/org/freedesktop/DBus", /* object path */
|
||||||
"org.freedesktop.DBus", /* interface name */
|
"org.freedesktop.DBus", /* interface name */
|
||||||
"GetId", /* method name */
|
"GetId", /* method name */
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
ca,
|
ca,
|
||||||
(GAsyncReadyCallback) msg_cb_expect_error_cancelled,
|
(GAsyncReadyCallback) msg_cb_expect_error_cancelled,
|
||||||
@ -169,13 +169,13 @@ test_delivery_in_thread_func (gpointer _data)
|
|||||||
* Check that cancellation works when the message is already in flight.
|
* Check that cancellation works when the message is already in flight.
|
||||||
*/
|
*/
|
||||||
ca = g_cancellable_new ();
|
ca = g_cancellable_new ();
|
||||||
g_dbus_connection_invoke_method (c,
|
g_dbus_connection_call (c,
|
||||||
"org.freedesktop.DBus", /* bus_name */
|
"org.freedesktop.DBus", /* bus_name */
|
||||||
"/org/freedesktop/DBus", /* object path */
|
"/org/freedesktop/DBus", /* object path */
|
||||||
"org.freedesktop.DBus", /* interface name */
|
"org.freedesktop.DBus", /* interface name */
|
||||||
"GetId", /* method name */
|
"GetId", /* method name */
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
ca,
|
ca,
|
||||||
(GAsyncReadyCallback) msg_cb_expect_error_cancelled,
|
(GAsyncReadyCallback) msg_cb_expect_error_cancelled,
|
||||||
@ -269,7 +269,7 @@ sleep_cb (GDBusProxy *proxy,
|
|||||||
GVariant *result;
|
GVariant *result;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
result = g_dbus_proxy_invoke_method_finish (proxy,
|
result = g_dbus_proxy_call_finish (proxy,
|
||||||
res,
|
res,
|
||||||
&error);
|
&error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
@ -302,10 +302,10 @@ test_sleep_in_thread_func (gpointer _data)
|
|||||||
if (data->async)
|
if (data->async)
|
||||||
{
|
{
|
||||||
//g_debug ("invoking async (%p)", g_thread_self ());
|
//g_debug ("invoking async (%p)", g_thread_self ());
|
||||||
g_dbus_proxy_invoke_method (data->proxy,
|
g_dbus_proxy_call (data->proxy,
|
||||||
"Sleep",
|
"Sleep",
|
||||||
g_variant_new ("(i)", data->msec),
|
g_variant_new ("(i)", data->msec),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
(GAsyncReadyCallback) sleep_cb,
|
(GAsyncReadyCallback) sleep_cb,
|
||||||
@ -321,10 +321,10 @@ test_sleep_in_thread_func (gpointer _data)
|
|||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
//g_debug ("invoking sync (%p)", g_thread_self ());
|
//g_debug ("invoking sync (%p)", g_thread_self ());
|
||||||
result = g_dbus_proxy_invoke_method_sync (data->proxy,
|
result = g_dbus_proxy_call_sync (data->proxy,
|
||||||
"Sleep",
|
"Sleep",
|
||||||
g_variant_new ("(i)", data->msec),
|
g_variant_new ("(i)", data->msec),
|
||||||
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user