void *signal_data;
GDBusProxyFunction proxy_added;
GDBusProxyFunction proxy_removed;
- void *proxy_data;
+ GDBusPropertyFunction property_changed;
+ void *user_data;
GList *proxy_list;
};
GDBusClient *client = proxy->client;
if (client->proxy_removed)
- client->proxy_removed(proxy, client->proxy_data);
+ client->proxy_removed(proxy, client->user_data);
modify_match(client->dbus_conn, "RemoveMatch",
proxy->match_rule);
prop = g_hash_table_lookup(proxy->prop_list, name);
if (prop != NULL) {
+ GDBusClient *client = proxy->client;
+
prop_entry_update(prop, &value);
+
+ if (client == NULL)
+ return;
+
+ if (client->property_changed)
+ client->property_changed(proxy, name, &value,
+ client->user_data);
return;
}
g_hash_table_remove(proxy->prop_list, name);
+ if (client->property_changed)
+ client->property_changed(proxy, name, NULL,
+ client->user_data);
+
dbus_message_iter_next(&entry);
}
}
update_properties(proxy, iter);
if (client->proxy_added)
- client->proxy_added(proxy, client->proxy_data);
+ client->proxy_added(proxy, client->user_data);
client->proxy_list = g_list_append(client->proxy_list, proxy);
}
}
gboolean g_dbus_client_set_proxy_handlers(GDBusClient *client,
- GDBusProxyFunction added,
- GDBusProxyFunction removed, void *user_data)
+ GDBusProxyFunction proxy_added,
+ GDBusProxyFunction proxy_removed,
+ GDBusPropertyFunction property_changed,
+ void *user_data)
{
if (client == NULL)
return FALSE;
- client->proxy_added = added;
- client->proxy_removed = removed;
- client->proxy_data = user_data;
+ client->proxy_added = proxy_added;
+ client->proxy_removed = proxy_removed;
+ client->property_changed = property_changed;
+ client->user_data = user_data;
return TRUE;
}
GDBusMessageFunction function, void *user_data);
typedef void (* GDBusProxyFunction) (GDBusProxy *proxy, void *user_data);
+typedef void (* GDBusPropertyFunction) (GDBusProxy *proxy, const char *name,
+ DBusMessageIter *iter, void *user_data);
gboolean g_dbus_client_set_proxy_handlers(GDBusClient *client,
- GDBusProxyFunction added,
- GDBusProxyFunction removed, void *user_data);
+ GDBusProxyFunction proxy_added,
+ GDBusProxyFunction proxy_removed,
+ GDBusPropertyFunction property_changed,
+ void *user_data);
#ifdef __cplusplus
}