}
static void
+receive_variant_cb(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
+{
+ Eina_Value *v, variant, array;
+ unsigned i;
+
+ printf("4 - receive a variant with an array of strings\n");
+ if (edbus_message_error_get(msg, NULL, NULL))
+ {
+ printf("Message error\n\n");
+ return;
+ }
+
+ v = edbus_message_to_eina_value(msg);
+
+ eina_value_struct_value_get(v, "arg0", &variant);
+ eina_value_struct_value_get(&variant, "arg0", &array);
+ for (i = 0; i < eina_value_array_count(&array); i++)
+ {
+ const char *txt;
+ eina_value_array_get(&array, i, &txt);
+ printf("\t%s\n", txt);
+ }
+
+ eina_value_flush(&array);
+ eina_value_flush(&variant);
+ eina_value_free(v);
+}
+
+static void
_property_removed(void *data, EDBus_Proxy *proxy, void *event_info)
{
EDBus_Proxy_Event_Property_Removed *event = event_info;
edbus_proxy_properties_monitor(proxy, EINA_TRUE);
ecore_timer_add(10, _read_cache, proxy);
+ edbus_proxy_call(proxy, "ReceiveVariantData", receive_variant_cb, NULL, -1, "");
+
ecore_main_loop_begin();
edbus_proxy_event_callback_del(proxy, EDBUS_PROXY_EVENT_PROPERTY_CHANGED,
}
static EDBus_Message *
+_receive_variant(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
+{
+ EDBus_Message *reply = edbus_message_method_return_new(msg);
+ EDBus_Message_Iter *var, *array, *main_iter;
+
+ main_iter = edbus_message_iter_get(reply);
+ var = edbus_message_iter_container_new(main_iter, 'v', "as");
+ edbus_message_iter_arguments_set(var, "as", &array);
+
+ edbus_message_iter_arguments_set(array, "s", "item1");
+ edbus_message_iter_arguments_set(array, "s", "item2");
+ edbus_message_iter_arguments_set(array, "s", "item3");
+
+ edbus_message_iter_container_close(var, array);
+ edbus_message_iter_container_close(main_iter, var);
+
+ return reply;
+}
+
+static EDBus_Message *
_send_variant(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
{
EDBus_Message *reply = edbus_message_method_return_new(msg);
NULL, _send_variant
},
{
+ "ReceiveVariantData", NULL, EDBUS_ARGS({"v", "variant_data"}),
+ _receive_variant
+ },
+ {
"SendArrayInt", NULL,
EDBUS_ARGS({"ai", "array_of_int"}), _send_array_int, 0
},