const char *exported_properties; /**< Exported properties */
};
-void dbus_g_object_type_install_info (GType object_type,
- const DBusGObjectInfo *info);
+void dbus_g_object_type_install_info (GType object_type,
+ const DBusGObjectInfo *info);
void dbus_g_connection_register_g_object (DBusGConnection *connection,
const char *at_path,
const char *signal_name,
GCallback handler,
void *data);
+
+gboolean dbus_g_proxy_call (DBusGProxy *proxy,
+ const char *method,
+ GError **error,
+ GType first_arg_type,
+ ...);
+
+void dbus_g_proxy_call_no_reply (DBusGProxy *proxy,
+ const char *method,
+ GType first_arg_type,
+ ...);
+
DBusGPendingCall* dbus_g_proxy_begin_call (DBusGProxy *proxy,
const char *method,
GType first_arg_type,
GError **error,
GType first_arg_type,
...);
-void dbus_g_proxy_call_no_reply (DBusGProxy *proxy,
- const char *method,
- GType first_arg_type,
- ...);
const char* dbus_g_proxy_get_path (DBusGProxy *proxy);
const char* dbus_g_proxy_get_interface (DBusGProxy *proxy);
-gboolean dbus_g_proxy_invoke (DBusGProxy *proxy,
- const char *method,
- GError **error,
- GType first_arg_type,
- ...);
-
typedef struct _DBusGMethodInvocation DBusGMethodInvocation;
-void dbus_g_method_return (DBusGMethodInvocation *context, ...);
+void dbus_g_method_return (DBusGMethodInvocation *context, ...);
-void dbus_g_method_return_error (DBusGMethodInvocation *context, GError *error);
+void dbus_g_method_return_error (DBusGMethodInvocation *context, GError *error);
typedef struct {
DBusGProxy *proxy;
/* Call ListNames method, wait for reply */
error = NULL;
- if (!dbus_g_proxy_invoke (proxy, "ListNames", &error, G_TYPE_INVALID,
- G_TYPE_STRV, &name_list, G_TYPE_INVALID))
+ if (!dbus_g_proxy_call (proxy, "ListNames", &error, G_TYPE_INVALID,
+ G_TYPE_STRV, &name_list, G_TYPE_INVALID))
{
g_printerr ("Failed to complete ListNames call: %s\n",
error->message);
<title>Understanding method invocation</title>
<para>
You have a number of choices for method invocation. First, as
- used above, <literal>dbus_g_proxy_invoke</literal> sends a
+ used above, <literal>dbus_g_proxy_call</literal> sends a
method call to the remote object, and blocks until reply is
recieved. The outgoing arguments are specified in the varargs
array, terminated with <literal>G_TYPE_INVALID</literal>.
GArray *arr;
error = NULL;
- if (!dbus_g_proxy_invoke (proxy, "Foobar", &error,
- G_TYPE_INT, 42, G_TYPE_STRING, "hello",
- G_TYPE_INVALID,
- DBUS_TYPE_G_UCHAR_ARRAY, &arr, G_TYPE_INVALID))
+ if (!dbus_g_proxy_call (proxy, "Foobar", &error,
+ G_TYPE_INT, 42, G_TYPE_STRING, "hello",
+ G_TYPE_INVALID,
+ DBUS_TYPE_G_UCHAR_ARRAY, &arr, G_TYPE_INVALID))
{
g_printerr ("Failed to complete Foobar: %s\n",
error->message);
g_hash_table_insert (hash, "baz", "whee");
error = NULL;
- if (!dbus_g_proxy_invoke (proxy, "HashSize", &error,
- DBUS_TYPE_G_STRING_STRING_HASH, hash, G_TYPE_INVALID,
- G_TYPE_UINT, &ret, G_TYPE_INVALID))
+ if (!dbus_g_proxy_call (proxy, "HashSize", &error,
+ DBUS_TYPE_G_STRING_STRING_HASH, hash, G_TYPE_INVALID,
+ G_TYPE_UINT, &ret, G_TYPE_INVALID))
{
g_printerr ("Failed to complete HashSize: %s\n",
error->message);
char *strret;
error = NULL;
- if (!dbus_g_proxy_invoke (proxy, "GetStuff", &error,
- G_TYPE_INVALID,
- G_TYPE_BOOLEAN, &boolret,
- G_TYPE_STRING, &strret,
- G_TYPE_INVALID))
+ if (!dbus_g_proxy_call (proxy, "GetStuff", &error,
+ G_TYPE_INVALID,
+ G_TYPE_BOOLEAN, &boolret,
+ G_TYPE_STRING, &strret,
+ G_TYPE_INVALID))
{
g_printerr ("Failed to complete GetStuff: %s\n",
error->message);
strs_dynamic[3] = NULL;
error = NULL;
- if (!dbus_g_proxy_invoke (proxy, "TwoStrArrays", &error,
- G_TYPE_STRV, strs_static_p,
- G_TYPE_STRV, strs_dynamic,
- G_TYPE_INVALID,
- G_TYPE_INVALID))
+ if (!dbus_g_proxy_call (proxy, "TwoStrArrays", &error,
+ G_TYPE_STRV, strs_static_p,
+ G_TYPE_STRV, strs_dynamic,
+ G_TYPE_INVALID,
+ G_TYPE_INVALID))
{
g_printerr ("Failed to complete TwoStrArrays: %s\n",
error->message);
error = NULL;
blah = TRUE;
- if (!dbus_g_proxy_invoke (proxy, "GetStrs", &error,
- G_TYPE_BOOLEAN, blah,
- G_TYPE_INVALID,
- G_TYPE_STRV, &strs,
- G_TYPE_INVALID))
+ if (!dbus_g_proxy_call (proxy, "GetStrs", &error,
+ G_TYPE_BOOLEAN, blah,
+ G_TYPE_INVALID,
+ G_TYPE_STRV, &strs,
+ G_TYPE_INVALID))
{
g_printerr ("Failed to complete GetStrs: %s\n",
error->message);
g_value_set_string (&val, "hello world");
error = NULL;
- if (!dbus_g_proxy_invoke (proxy, "SendVariant", &error,
- G_TYPE_VALUE, &val, G_TYPE_INVALID,
- G_TYPE_INVALID))
+ if (!dbus_g_proxy_call (proxy, "SendVariant", &error,
+ G_TYPE_VALUE, &val, G_TYPE_INVALID,
+ G_TYPE_INVALID))
{
g_printerr ("Failed to complete SendVariant: %s\n",
error->message);
GValue val = {0, };
error = NULL;
- if (!dbus_g_proxy_invoke (proxy, "GetVariant", &error, G_TYPE_INVALID,
- G_TYPE_VALUE, &val, G_TYPE_INVALID))
+ if (!dbus_g_proxy_call (proxy, "GetVariant", &error, G_TYPE_INVALID,
+ G_TYPE_VALUE, &val, G_TYPE_INVALID))
{
g_printerr ("Failed to complete GetVariant: %s\n",
error->message);
/* Activate test servie */
g_print ("Activating TestSuiteGLibService\n");
error = NULL;
- if (!dbus_g_proxy_invoke (driver, "StartServiceByName", &error,
- G_TYPE_STRING,
- "org.freedesktop.DBus.TestSuiteGLibService",
- G_TYPE_UINT,
- 0,
- G_TYPE_INVALID,
- G_TYPE_UINT, &result,
- G_TYPE_INVALID)) {
+ if (!dbus_g_proxy_call (driver, "StartServiceByName", &error,
+ G_TYPE_STRING,
+ "org.freedesktop.DBus.TestSuiteGLibService",
+ G_TYPE_UINT,
+ 0,
+ G_TYPE_INVALID,
+ G_TYPE_UINT, &result,
+ G_TYPE_INVALID)) {
lose_gerror ("Failed to complete Activate call", error);
}
lose_gerror ("Failed to complete DoNothing call", error);
error = NULL;
- if (!dbus_g_proxy_invoke (proxy, "Increment", &error,
- G_TYPE_UINT, 42,
- G_TYPE_INVALID,
- G_TYPE_UINT, &v_UINT32_2,
- G_TYPE_INVALID))
+ if (!dbus_g_proxy_call (proxy, "Increment", &error,
+ G_TYPE_UINT, 42,
+ G_TYPE_INVALID,
+ G_TYPE_UINT, &v_UINT32_2,
+ G_TYPE_INVALID))
lose_gerror ("Failed to complete Increment call", error);
if (v_UINT32_2 != 43)
G_CALLBACK (frobnicate_signal_handler),
NULL, NULL);
- if (!dbus_g_proxy_invoke (proxy, "EmitFrobnicate", &error,
- G_TYPE_INVALID, G_TYPE_INVALID))
+ if (!dbus_g_proxy_call (proxy, "EmitFrobnicate", &error,
+ G_TYPE_INVALID, G_TYPE_INVALID))
lose_gerror ("Failed to complete EmitFrobnicate call", error);
if (n_times_frobnicate_received != 1)
lose ("Frobnicate signal received %d times, should have been 1", n_times_frobnicate_received);
- if (!dbus_g_proxy_invoke (proxy, "EmitFrobnicate", &error,
- G_TYPE_INVALID, G_TYPE_INVALID))
+ if (!dbus_g_proxy_call (proxy, "EmitFrobnicate", &error,
+ G_TYPE_INVALID, G_TYPE_INVALID))
lose_gerror ("Failed to complete EmitFrobnicate call", error);
dbus_g_connection_flush (connection);