typedef GDBusProxy TestProxy;
typedef GDBusProxyClass TestProxyClass;
#define _g_free0(var) (var = (g_free (var), NULL))
+#define _g_variant_type_free0(var) ((var == NULL) ? NULL : (var = (g_variant_type_free (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
void (*test_void) (Test* self, GError** error);
gint (*test_int) (Test* self, gint i, gint* j, GError** error);
gchar* (*test_string) (Test* self, const gchar* s, gchar** t, GError** error);
+ GVariantType* (*test_signature) (Test* self, const GVariantType* tp1, GVariantType** tp2, GError** error);
gchar* (*get_test_property) (Test* self);
void (*set_test_property) (Test* self, const gchar* value);
gint (*get_test_int_property) (Test* self);
void (*set_test_int_property) (Test* self, gint value);
+ GVariantType* (*get_test_signature_property) (Test* self);
+ void (*set_test_signature_property) (Test* self, const GVariantType* value);
};
VALA_EXTERN GType test_proxy_get_type (void) G_GNUC_CONST ;
const gchar* s,
gchar** t,
GError** error);
+VALA_EXTERN GVariantType* test_test_signature (Test* self,
+ const GVariantType* tp1,
+ GVariantType** tp2,
+ GError** error);
VALA_EXTERN gchar* test_get_test_property (Test* self);
VALA_EXTERN void test_set_test_property (Test* self,
const gchar* value);
VALA_EXTERN gint test_get_test_int_property (Test* self);
VALA_EXTERN void test_set_test_int_property (Test* self,
gint value);
+VALA_EXTERN GVariantType* test_get_test_signature_property (Test* self);
+VALA_EXTERN void test_set_test_signature_property (Test* self,
+ const GVariantType* value);
static GType test_get_type_once (void);
static void test_proxy_g_signal (GDBusProxy* proxy,
const gchar* sender_name,
const gchar* s,
gchar** t,
GError** error);
+static GVariantType* test_proxy_test_signature (Test* self,
+ const GVariantType* tp1,
+ GVariantType** tp2,
+ GError** error);
static gchar* test_dbus_proxy_get_test_property (Test* self);
static void test_dbus_proxy_set_test_property (Test* self,
const gchar* value);
static gint test_dbus_proxy_get_test_int_property (Test* self);
static void test_dbus_proxy_set_test_int_property (Test* self,
gint value);
+static GVariantType* test_dbus_proxy_get_test_signature_property (Test* self);
+static void test_dbus_proxy_set_test_signature_property (Test* self,
+ const GVariantType* value);
static void test_proxy_test_interface_init (TestIface* iface);
static void _dbus_test_test_void (Test* self,
GVariant* _parameters_,
static void _dbus_test_test_string (Test* self,
GVariant* _parameters_,
GDBusMethodInvocation* invocation);
+static void _dbus_test_test_signature (Test* self,
+ GVariant* _parameters_,
+ GDBusMethodInvocation* invocation);
static void test_dbus_interface_method_call (GDBusConnection* connection,
const gchar* sender,
const gchar* object_path,
gpointer user_data);
static GVariant* _dbus_test_get_test_property (Test* self);
static GVariant* _dbus_test_get_test_int_property (Test* self);
+static GVariant* _dbus_test_get_test_signature_property (Test* self);
static gboolean test_dbus_interface_set_property (GDBusConnection* connection,
const gchar* sender,
const gchar* object_path,
GVariant* _value);
static void _dbus_test_set_test_int_property (Test* self,
GVariant* _value);
+static void _dbus_test_set_test_signature_property (Test* self,
+ GVariant* _value);
static void _test_unregister_object (gpointer user_data);
static void _vala_main (void);
static const GDBusArgInfo * const _test_dbus_arg_info_test_string_in[] = {&_test_dbus_arg_info_test_string_s, NULL};
static const GDBusArgInfo * const _test_dbus_arg_info_test_string_out[] = {&_test_dbus_arg_info_test_string_t, &_test_dbus_arg_info_test_string_result, NULL};
static const GDBusMethodInfo _test_dbus_method_info_test_string = {-1, "TestString", (GDBusArgInfo **) (&_test_dbus_arg_info_test_string_in), (GDBusArgInfo **) (&_test_dbus_arg_info_test_string_out), NULL};
-static const GDBusMethodInfo * const _test_dbus_method_info[] = {&_test_dbus_method_info_test_void, &_test_dbus_method_info_test_int, &_test_dbus_method_info_test_string, NULL};
+static const GDBusArgInfo _test_dbus_arg_info_test_signature_tp1 = {-1, "tp1", "g", NULL};
+static const GDBusArgInfo _test_dbus_arg_info_test_signature_tp2 = {-1, "tp2", "g", NULL};
+static const GDBusArgInfo _test_dbus_arg_info_test_signature_result = {-1, "result", "g", NULL};
+static const GDBusArgInfo * const _test_dbus_arg_info_test_signature_in[] = {&_test_dbus_arg_info_test_signature_tp1, NULL};
+static const GDBusArgInfo * const _test_dbus_arg_info_test_signature_out[] = {&_test_dbus_arg_info_test_signature_tp2, &_test_dbus_arg_info_test_signature_result, NULL};
+static const GDBusMethodInfo _test_dbus_method_info_test_signature = {-1, "TestSignature", (GDBusArgInfo **) (&_test_dbus_arg_info_test_signature_in), (GDBusArgInfo **) (&_test_dbus_arg_info_test_signature_out), NULL};
+static const GDBusMethodInfo * const _test_dbus_method_info[] = {&_test_dbus_method_info_test_void, &_test_dbus_method_info_test_int, &_test_dbus_method_info_test_string, &_test_dbus_method_info_test_signature, NULL};
static const GDBusSignalInfo * const _test_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo _test_dbus_property_info_test_property = {-1, "TestProperty", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL};
static const GDBusPropertyInfo _test_dbus_property_info_test_int_property = {-1, "TestIntProperty", "i", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL};
-static const GDBusPropertyInfo * const _test_dbus_property_info[] = {&_test_dbus_property_info_test_property, &_test_dbus_property_info_test_int_property, NULL};
+static const GDBusPropertyInfo _test_dbus_property_info_test_signature_property = {-1, "TestSignatureProperty", "g", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL};
+static const GDBusPropertyInfo * const _test_dbus_property_info[] = {&_test_dbus_property_info_test_property, &_test_dbus_property_info_test_int_property, &_test_dbus_property_info_test_signature_property, NULL};
static const GDBusInterfaceInfo _test_dbus_interface_info = {-1, "org.example.Test", (GDBusMethodInfo **) (&_test_dbus_method_info), (GDBusSignalInfo **) (&_test_dbus_signal_info), (GDBusPropertyInfo **) (&_test_dbus_property_info), NULL};
static const GDBusInterfaceVTable _test_dbus_interface_vtable = {test_dbus_interface_method_call, test_dbus_interface_get_property, test_dbus_interface_set_property};
return NULL;
}
+GVariantType*
+test_test_signature (Test* self,
+ const GVariantType* tp1,
+ GVariantType** tp2,
+ GError** error)
+{
+ TestIface* _iface_;
+ g_return_val_if_fail (IS_TEST (self), NULL);
+ _iface_ = TEST_GET_INTERFACE (self);
+ if (_iface_->test_signature) {
+ return _iface_->test_signature (self, tp1, tp2, error);
+ }
+ return NULL;
+}
+
gchar*
test_get_test_property (Test* self)
{
}
}
+GVariantType*
+test_get_test_signature_property (Test* self)
+{
+ TestIface* _iface_;
+ g_return_val_if_fail (IS_TEST (self), NULL);
+ _iface_ = TEST_GET_INTERFACE (self);
+ if (_iface_->get_test_signature_property) {
+ return _iface_->get_test_signature_property (self);
+ }
+ return NULL;
+}
+
+void
+test_set_test_signature_property (Test* self,
+ const GVariantType* value)
+{
+ TestIface* _iface_;
+ g_return_if_fail (IS_TEST (self));
+ _iface_ = TEST_GET_INTERFACE (self);
+ if (_iface_->set_test_signature_property) {
+ _iface_->set_test_signature_property (self, value);
+ }
+}
+
static void
test_default_init (TestIface * iface,
gpointer iface_data)
return _result;
}
+static GVariantType*
+test_proxy_test_signature (Test* self,
+ const GVariantType* tp1,
+ GVariantType** tp2,
+ GError** error)
+{
+ GDBusMessage *_message;
+ GVariant *_arguments;
+ GVariantBuilder _arguments_builder;
+ gchar* _tmp6_;
+ GDBusMessage *_reply_message;
+ GVariant *_reply;
+ GVariantIter _reply_iter;
+ GVariantType* _vala_tp2 = NULL;
+ GVariant* _tmp7_;
+ GVariantType* _result = NULL;
+ GVariant* _tmp8_;
+ G_IO_ERROR;
+ _message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.example.Test", "TestSignature");
+ g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
+ _tmp6_ = g_variant_type_dup_string (tp1);
+ g_variant_builder_add_value (&_arguments_builder, g_variant_new_from_data (G_VARIANT_TYPE_SIGNATURE, _tmp6_, strlen (_tmp6_) + 1, TRUE, g_free, _tmp6_));
+ _arguments = g_variant_builder_end (&_arguments_builder);
+ g_dbus_message_set_body (_message, _arguments);
+ _reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
+ g_object_unref (_message);
+ if (!_reply_message) {
+ return NULL;
+ }
+ if (g_dbus_message_to_gerror (_reply_message, error)) {
+ g_object_unref (_reply_message);
+ return NULL;
+ }
+ _reply = g_dbus_message_get_body (_reply_message);
+ g_variant_iter_init (&_reply_iter, _reply);
+ _tmp7_ = g_variant_iter_next_value (&_reply_iter);
+ _vala_tp2 = g_variant_type_new (g_variant_get_string (_tmp7_, NULL));
+ g_variant_unref (_tmp7_);
+ *tp2 = _vala_tp2;
+ _tmp8_ = g_variant_iter_next_value (&_reply_iter);
+ _result = g_variant_type_new (g_variant_get_string (_tmp8_, NULL));
+ g_variant_unref (_tmp8_);
+ g_object_unref (_reply_message);
+ return _result;
+}
+
static gchar*
test_dbus_proxy_get_test_property (Test* self)
{
_arguments = g_variant_builder_end (&_arguments_builder);
_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
if (!_reply) {
- gint _tmp6_ = 0;
- return _tmp6_;
+ gint _tmp9_ = 0;
+ return _tmp9_;
}
g_variant_get (_reply, "(v)", &_inner_reply);
g_variant_unref (_reply);
g_variant_unref (_reply);
}
+static GVariantType*
+test_dbus_proxy_get_test_signature_property (Test* self)
+{
+ GVariant *_inner_reply;
+ GVariantType* _result;
+ _inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "TestSignatureProperty");
+ if (!_inner_reply) {
+ GVariant *_arguments;
+ GVariant *_reply;
+ GVariantBuilder _arguments_builder;
+ g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
+ g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.example.Test"));
+ g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("TestSignatureProperty"));
+ _arguments = g_variant_builder_end (&_arguments_builder);
+ _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
+ if (!_reply) {
+ return NULL;
+ }
+ g_variant_get (_reply, "(v)", &_inner_reply);
+ g_variant_unref (_reply);
+ }
+ _result = g_variant_type_new (g_variant_get_string (_inner_reply, NULL));
+ g_variant_unref (_inner_reply);
+ return _result;
+}
+
+static void
+test_dbus_proxy_set_test_signature_property (Test* self,
+ const GVariantType* value)
+{
+ GVariant *_arguments;
+ GVariant *_reply;
+ GVariantBuilder _arguments_builder;
+ gchar* _tmp10_;
+ g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
+ g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.example.Test"));
+ g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("TestSignatureProperty"));
+ g_variant_builder_open (&_arguments_builder, G_VARIANT_TYPE_VARIANT);
+ _tmp10_ = g_variant_type_dup_string (value);
+ g_variant_builder_add_value (&_arguments_builder, g_variant_new_from_data (G_VARIANT_TYPE_SIGNATURE, _tmp10_, strlen (_tmp10_) + 1, TRUE, g_free, _tmp10_));
+ g_variant_builder_close (&_arguments_builder);
+ _arguments = g_variant_builder_end (&_arguments_builder);
+ _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Set", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
+ if (!_reply) {
+ return;
+ }
+ g_variant_unref (_reply);
+}
+
static void
test_proxy_test_interface_init (TestIface* iface)
{
iface->test_void = test_proxy_test_void;
iface->test_int = test_proxy_test_int;
iface->test_string = test_proxy_test_string;
+ iface->test_signature = test_proxy_test_signature;
iface->get_test_property = test_dbus_proxy_get_test_property;
iface->set_test_property = test_dbus_proxy_set_test_property;
iface->get_test_int_property = test_dbus_proxy_get_test_int_property;
iface->set_test_int_property = test_dbus_proxy_set_test_int_property;
+ iface->get_test_signature_property = test_dbus_proxy_get_test_signature_property;
+ iface->set_test_signature_property = test_dbus_proxy_set_test_signature_property;
}
static void
GError* error = NULL;
GVariantIter _arguments_iter;
gint i = 0;
- GVariant* _tmp7_;
+ GVariant* _tmp11_;
GDBusMessage* _reply_message = NULL;
GVariant* _reply;
GVariantBuilder _reply_builder;
gint j = 0;
gint result;
g_variant_iter_init (&_arguments_iter, _parameters_);
- _tmp7_ = g_variant_iter_next_value (&_arguments_iter);
- i = g_variant_get_int32 (_tmp7_);
- g_variant_unref (_tmp7_);
+ _tmp11_ = g_variant_iter_next_value (&_arguments_iter);
+ i = g_variant_get_int32 (_tmp11_);
+ g_variant_unref (_tmp11_);
result = test_test_int (self, i, &j, &error);
if (error) {
g_dbus_method_invocation_take_error (invocation, error);
GError* error = NULL;
GVariantIter _arguments_iter;
gchar* s = NULL;
- GVariant* _tmp8_;
+ GVariant* _tmp12_;
GDBusMessage* _reply_message = NULL;
GVariant* _reply;
GVariantBuilder _reply_builder;
gchar* t = NULL;
gchar* result;
g_variant_iter_init (&_arguments_iter, _parameters_);
- _tmp8_ = g_variant_iter_next_value (&_arguments_iter);
- s = g_variant_dup_string (_tmp8_, NULL);
- g_variant_unref (_tmp8_);
+ _tmp12_ = g_variant_iter_next_value (&_arguments_iter);
+ s = g_variant_dup_string (_tmp12_, NULL);
+ g_variant_unref (_tmp12_);
result = test_test_string (self, s, &t, &error);
if (error) {
g_dbus_method_invocation_take_error (invocation, error);
;
}
+static void
+_dbus_test_test_signature (Test* self,
+ GVariant* _parameters_,
+ GDBusMethodInvocation* invocation)
+{
+ GError* error = NULL;
+ GVariantIter _arguments_iter;
+ GVariantType* tp1 = NULL;
+ GVariant* _tmp13_;
+ GDBusMessage* _reply_message = NULL;
+ GVariant* _reply;
+ GVariantBuilder _reply_builder;
+ GVariantType* tp2 = NULL;
+ gchar* _tmp14_;
+ GVariantType* result;
+ gchar* _tmp15_;
+ g_variant_iter_init (&_arguments_iter, _parameters_);
+ _tmp13_ = g_variant_iter_next_value (&_arguments_iter);
+ tp1 = g_variant_type_new (g_variant_get_string (_tmp13_, NULL));
+ g_variant_unref (_tmp13_);
+ result = test_test_signature (self, tp1, &tp2, &error);
+ if (error) {
+ g_dbus_method_invocation_take_error (invocation, error);
+ goto _error;
+ }
+ _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
+ g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
+ _tmp14_ = g_variant_type_dup_string (tp2);
+ g_variant_builder_add_value (&_reply_builder, g_variant_new_from_data (G_VARIANT_TYPE_SIGNATURE, _tmp14_, strlen (_tmp14_) + 1, TRUE, g_free, _tmp14_));
+ _tmp15_ = g_variant_type_dup_string (result);
+ g_variant_builder_add_value (&_reply_builder, g_variant_new_from_data (G_VARIANT_TYPE_SIGNATURE, _tmp15_, strlen (_tmp15_) + 1, TRUE, g_free, _tmp15_));
+ _g_variant_type_free0 (result);
+ _reply = g_variant_builder_end (&_reply_builder);
+ g_dbus_message_set_body (_reply_message, _reply);
+ g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
+ g_object_unref (invocation);
+ g_object_unref (_reply_message);
+ _error:
+ _g_variant_type_free0 (tp1);
+ _g_variant_type_free0 (tp2);
+ ;
+}
+
static void
test_dbus_interface_method_call (GDBusConnection* connection,
const gchar* sender,
_dbus_test_test_int (object, parameters, invocation);
} else if (strcmp (method_name, "TestString") == 0) {
_dbus_test_test_string (object, parameters, invocation);
+ } else if (strcmp (method_name, "TestSignature") == 0) {
+ _dbus_test_test_signature (object, parameters, invocation);
} else {
g_object_unref (invocation);
}
return _reply;
}
+static GVariant*
+_dbus_test_get_test_signature_property (Test* self)
+{
+ GVariantType* result;
+ GVariant* _reply;
+ gchar* _tmp16_;
+ result = test_get_test_signature_property (self);
+ _tmp16_ = g_variant_type_dup_string (result);
+ _reply = g_variant_new_from_data (G_VARIANT_TYPE_SIGNATURE, _tmp16_, strlen (_tmp16_) + 1, TRUE, g_free, _tmp16_);
+ _g_variant_type_free0 (result);
+ return _reply;
+}
+
static GVariant*
test_dbus_interface_get_property (GDBusConnection* connection,
const gchar* sender,
return _dbus_test_get_test_property (object);
} else if (strcmp (property_name, "TestIntProperty") == 0) {
return _dbus_test_get_test_int_property (object);
+ } else if (strcmp (property_name, "TestSignatureProperty") == 0) {
+ return _dbus_test_get_test_signature_property (object);
}
return NULL;
}
test_set_test_int_property (self, value);
}
+static void
+_dbus_test_set_test_signature_property (Test* self,
+ GVariant* _value)
+{
+ GVariantType* value = NULL;
+ value = g_variant_type_new (g_variant_get_string (_value, NULL));
+ test_set_test_signature_property (self, value);
+ _g_variant_type_free0 (value);
+}
+
static gboolean
test_dbus_interface_set_property (GDBusConnection* connection,
const gchar* sender,
} else if (strcmp (property_name, "TestIntProperty") == 0) {
_dbus_test_set_test_int_property (object, value);
return TRUE;
+ } else if (strcmp (property_name, "TestSignatureProperty") == 0) {
+ _dbus_test_set_test_signature_property (object, value);
+ return TRUE;
}
return FALSE;
}
gchar* _tmp10_;
const gchar* _tmp11_;
const gchar* _tmp12_;
- Test* _tmp13_;
+ GVariantType* tp1 = NULL;
+ GVariantType* tp2 = NULL;
+ GVariantType* _tmp13_ = NULL;
Test* _tmp14_;
- gchar* _tmp15_;
- gchar* _tmp16_;
- const gchar* _tmp17_;
- Test* _tmp18_;
- Test* _tmp19_;
- gint _tmp20_;
- gint _tmp21_;
+ GVariantType* _tmp15_;
+ GVariantType* _tmp16_;
+ GVariantType* _tmp17_ = NULL;
+ GVariantType* _tmp18_;
+ GVariantType* _tmp19_;
+ GVariantType* _tmp20_;
+ const GVariantType* _tmp21_;
+ gchar* _tmp22_;
+ gchar* _tmp23_;
+ const GVariantType* _tmp24_;
+ gchar* _tmp25_;
+ gchar* _tmp26_;
+ Test* _tmp27_;
+ Test* _tmp28_;
+ gchar* _tmp29_;
+ gchar* _tmp30_;
+ const gchar* _tmp31_;
+ Test* _tmp32_;
+ Test* _tmp33_;
+ gint _tmp34_;
+ gint _tmp35_;
+ Test* _tmp36_;
+ const GVariantType* _tmp37_;
+ Test* _tmp38_;
+ GVariantType* _tmp39_;
+ GVariantType* _tmp40_;
+ const GVariantType* _tmp41_;
+ const GVariantType* _tmp42_;
GError* _inner_error0_ = NULL;
_tmp0_ = (Test*) g_initable_new (TYPE_TEST_PROXY, NULL, &_inner_error0_, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, "g-name", "org.example.Test", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/example/test", "g-interface-name", "org.example.Test", NULL);
test = (Test*) _tmp0_;
_vala_assert (g_strcmp0 (_tmp11_, "world") == 0, "t == \"world\"");
_tmp12_ = u;
_vala_assert (g_strcmp0 (_tmp12_, "vala") == 0, "u == \"vala\"");
- _tmp13_ = test;
- test_set_test_property (_tmp13_, "hello");
_tmp14_ = test;
- _tmp15_ = test_get_test_property (_tmp14_);
+ _tmp15_ = g_variant_type_new ("a(bgha{sv})");
_tmp16_ = _tmp15_;
+ _tmp18_ = test_test_signature (_tmp14_, _tmp16_, &_tmp17_, &_inner_error0_);
+ _g_variant_type_free0 (tp2);
+ tp2 = _tmp17_;
+ _tmp19_ = _tmp18_;
+ _g_variant_type_free0 (_tmp16_);
+ _tmp13_ = _tmp19_;
+ if (G_UNLIKELY (_inner_error0_ != NULL)) {
+ _g_variant_type_free0 (tp2);
+ _g_variant_type_free0 (tp1);
+ _g_free0 (_tmp6_);
+ _g_free0 (u);
+ _g_free0 (t);
+ _g_object_unref0 (test);
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
+ g_clear_error (&_inner_error0_);
+ return;
+ }
+ _tmp20_ = _tmp13_;
+ _tmp13_ = NULL;
+ _g_variant_type_free0 (tp1);
+ tp1 = _tmp20_;
+ _tmp21_ = tp1;
+ _tmp22_ = g_variant_type_dup_string (_tmp21_);
+ _tmp23_ = _tmp22_;
+ _vala_assert (g_strcmp0 (_tmp23_, "aaaas") == 0, "tp1.dup_string () == \"aaaas\"");
+ _g_free0 (_tmp23_);
+ _tmp24_ = tp2;
+ _tmp25_ = g_variant_type_dup_string (_tmp24_);
+ _tmp26_ = _tmp25_;
+ _vala_assert (g_strcmp0 (_tmp26_, "(ibt)") == 0, "tp2.dup_string () == \"(ibt)\"");
+ _g_free0 (_tmp26_);
+ _tmp27_ = test;
+ test_set_test_property (_tmp27_, "hello");
+ _tmp28_ = test;
+ _tmp29_ = test_get_test_property (_tmp28_);
+ _tmp30_ = _tmp29_;
_g_free0 (t);
- t = _tmp16_;
- _tmp17_ = t;
- _vala_assert (g_strcmp0 (_tmp17_, "hello") == 0, "t == \"hello\"");
- _tmp18_ = test;
- test_set_test_int_property (_tmp18_, 42);
- _tmp19_ = test;
- _tmp20_ = test_get_test_int_property (_tmp19_);
- _tmp21_ = _tmp20_;
- j = _tmp21_;
+ t = _tmp30_;
+ _tmp31_ = t;
+ _vala_assert (g_strcmp0 (_tmp31_, "hello") == 0, "t == \"hello\"");
+ _tmp32_ = test;
+ test_set_test_int_property (_tmp32_, 42);
+ _tmp33_ = test;
+ _tmp34_ = test_get_test_int_property (_tmp33_);
+ _tmp35_ = _tmp34_;
+ j = _tmp35_;
_vala_assert (j == 42, "j == 42");
+ _tmp36_ = test;
+ _tmp37_ = tp2;
+ test_set_test_signature_property (_tmp36_, _tmp37_);
+ _tmp38_ = test;
+ _tmp39_ = test_get_test_signature_property (_tmp38_);
+ _tmp40_ = _tmp39_;
+ _g_variant_type_free0 (tp1);
+ tp1 = _tmp40_;
+ _tmp41_ = tp1;
+ _tmp42_ = tp2;
+ _vala_assert (g_variant_type_equal (_tmp41_, _tmp42_), "tp1.equal (tp2)");
+ _g_variant_type_free0 (_tmp13_);
+ _g_variant_type_free0 (tp2);
+ _g_variant_type_free0 (tp1);
_g_free0 (_tmp6_);
_g_free0 (u);
_g_free0 (t);
TEST_0_PROPERTY,
TEST_TEST_PROPERTY_PROPERTY,
TEST_TEST_INT_PROPERTY_PROPERTY,
+ TEST_TEST_SIGNATURE_PROPERTY_PROPERTY,
TEST_NUM_PROPERTIES
};
static GParamSpec* test_properties[TEST_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
+#define _g_variant_type_free0(var) ((var == NULL) ? NULL : (var = (g_variant_type_free (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _g_main_loop_unref0(var) ((var == NULL) ? NULL : (var = (g_main_loop_unref (var), NULL)))
struct _TestPrivate {
gchar* _test_property;
gint _test_int_property;
+ GVariantType* _test_signature_property;
};
static gint Test_private_offset;
VALA_EXTERN gchar* test_test_string (Test* self,
const gchar* s,
gchar** t);
+VALA_EXTERN GVariantType* test_test_signature (Test* self,
+ const GVariantType* tp1,
+ GVariantType** tp2);
VALA_EXTERN Test* test_new (void);
VALA_EXTERN Test* test_construct (GType object_type);
VALA_EXTERN gchar* test_get_test_property (Test* self);
VALA_EXTERN gint test_get_test_int_property (Test* self);
VALA_EXTERN void test_set_test_int_property (Test* self,
gint value);
+VALA_EXTERN GVariantType* test_get_test_signature_property (Test* self);
+VALA_EXTERN void test_set_test_signature_property (Test* self,
+ const GVariantType* value);
static void test_finalize (GObject * obj);
static GType test_get_type_once (void);
static void _vala_test_get_property (GObject * object,
static void _dbus_test_test_string (Test* self,
GVariant* _parameters_,
GDBusMethodInvocation* invocation);
+static void _dbus_test_test_signature (Test* self,
+ GVariant* _parameters_,
+ GDBusMethodInvocation* invocation);
static void test_dbus_interface_method_call (GDBusConnection* connection,
const gchar* sender,
const gchar* object_path,
gpointer user_data);
static GVariant* _dbus_test_get_test_property (Test* self);
static GVariant* _dbus_test_get_test_int_property (Test* self);
+static GVariant* _dbus_test_get_test_signature_property (Test* self);
static gboolean test_dbus_interface_set_property (GDBusConnection* connection,
const gchar* sender,
const gchar* object_path,
GVariant* _value);
static void _dbus_test_set_test_int_property (Test* self,
GVariant* _value);
+static void _dbus_test_set_test_signature_property (Test* self,
+ GVariant* _value);
static void _test_unregister_object (gpointer user_data);
VALA_EXTERN void client_exit (GPid pid,
gint status);
static const GDBusArgInfo * const _test_dbus_arg_info_test_string_in[] = {&_test_dbus_arg_info_test_string_s, NULL};
static const GDBusArgInfo * const _test_dbus_arg_info_test_string_out[] = {&_test_dbus_arg_info_test_string_t, &_test_dbus_arg_info_test_string_result, NULL};
static const GDBusMethodInfo _test_dbus_method_info_test_string = {-1, "TestString", (GDBusArgInfo **) (&_test_dbus_arg_info_test_string_in), (GDBusArgInfo **) (&_test_dbus_arg_info_test_string_out), NULL};
-static const GDBusMethodInfo * const _test_dbus_method_info[] = {&_test_dbus_method_info_test_void, &_test_dbus_method_info_test_int, &_test_dbus_method_info_test_string, NULL};
+static const GDBusArgInfo _test_dbus_arg_info_test_signature_tp1 = {-1, "tp1", "g", NULL};
+static const GDBusArgInfo _test_dbus_arg_info_test_signature_tp2 = {-1, "tp2", "g", NULL};
+static const GDBusArgInfo _test_dbus_arg_info_test_signature_result = {-1, "result", "g", NULL};
+static const GDBusArgInfo * const _test_dbus_arg_info_test_signature_in[] = {&_test_dbus_arg_info_test_signature_tp1, NULL};
+static const GDBusArgInfo * const _test_dbus_arg_info_test_signature_out[] = {&_test_dbus_arg_info_test_signature_tp2, &_test_dbus_arg_info_test_signature_result, NULL};
+static const GDBusMethodInfo _test_dbus_method_info_test_signature = {-1, "TestSignature", (GDBusArgInfo **) (&_test_dbus_arg_info_test_signature_in), (GDBusArgInfo **) (&_test_dbus_arg_info_test_signature_out), NULL};
+static const GDBusMethodInfo * const _test_dbus_method_info[] = {&_test_dbus_method_info_test_void, &_test_dbus_method_info_test_int, &_test_dbus_method_info_test_string, &_test_dbus_method_info_test_signature, NULL};
static const GDBusSignalInfo * const _test_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo _test_dbus_property_info_test_property = {-1, "TestProperty", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL};
static const GDBusPropertyInfo _test_dbus_property_info_test_int_property = {-1, "TestIntProperty", "i", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL};
-static const GDBusPropertyInfo * const _test_dbus_property_info[] = {&_test_dbus_property_info_test_property, &_test_dbus_property_info_test_int_property, NULL};
+static const GDBusPropertyInfo _test_dbus_property_info_test_signature_property = {-1, "TestSignatureProperty", "g", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL};
+static const GDBusPropertyInfo * const _test_dbus_property_info[] = {&_test_dbus_property_info_test_property, &_test_dbus_property_info_test_int_property, &_test_dbus_property_info_test_signature_property, NULL};
static const GDBusInterfaceInfo _test_dbus_interface_info = {-1, "org.example.Test", (GDBusMethodInfo **) (&_test_dbus_method_info), (GDBusSignalInfo **) (&_test_dbus_signal_info), (GDBusPropertyInfo **) (&_test_dbus_property_info), NULL};
static const GDBusInterfaceVTable _test_dbus_interface_vtable = {test_dbus_interface_method_call, test_dbus_interface_get_property, test_dbus_interface_set_property};
return result;
}
+static gpointer
+_g_variant_type_copy0 (gpointer self)
+{
+ return self ? g_variant_type_copy (self) : NULL;
+}
+
+GVariantType*
+test_test_signature (Test* self,
+ const GVariantType* tp1,
+ GVariantType** tp2)
+{
+ GVariantType* _vala_tp2 = NULL;
+ gchar* _tmp0_;
+ gchar* _tmp1_;
+ const GVariantType* _tmp2_;
+ GVariantType* _tmp3_;
+ const GVariantType* _tmp4_;
+ GVariantType* _tmp5_;
+ const GVariantType* _tmp6_;
+ GVariantType* _tmp7_;
+ GVariantType** _tmp8_;
+ GVariantType** _tmp9_;
+ gint _tmp9__length1;
+ GVariantType* _tmp10_;
+ const GVariantType* _tmp11_;
+ GVariantType* _tmp12_;
+ GVariantType* _tmp13_;
+ GVariantType* _tmp14_;
+ GVariantType* _tmp15_;
+ GVariantType* _tmp16_;
+ GVariantType* _tmp17_;
+ GVariantType* result;
+ g_return_val_if_fail (IS_TEST (self), NULL);
+ g_return_val_if_fail (tp1 != NULL, NULL);
+ _tmp0_ = g_variant_type_dup_string (tp1);
+ _tmp1_ = _tmp0_;
+ _vala_assert (g_strcmp0 (_tmp1_, "a(bgha{sv})") == 0, "tp1.dup_string () == \"a(bgha{sv})\"");
+ _g_free0 (_tmp1_);
+ _tmp2_ = G_VARIANT_TYPE_INT32;
+ _tmp3_ = _g_variant_type_copy0 (_tmp2_);
+ _tmp4_ = G_VARIANT_TYPE_BOOLEAN;
+ _tmp5_ = _g_variant_type_copy0 (_tmp4_);
+ _tmp6_ = G_VARIANT_TYPE_UINT64;
+ _tmp7_ = _g_variant_type_copy0 (_tmp6_);
+ _tmp8_ = g_new0 (GVariantType*, 3 + 1);
+ _tmp8_[0] = _tmp3_;
+ _tmp8_[1] = _tmp5_;
+ _tmp8_[2] = _tmp7_;
+ _tmp9_ = _tmp8_;
+ _tmp9__length1 = 3;
+ _tmp10_ = g_variant_type_new_tuple (_tmp9_, 3);
+ _g_variant_type_free0 (_vala_tp2);
+ _vala_tp2 = _tmp10_;
+ _tmp9_ = (_vala_array_free (_tmp9_, _tmp9__length1, (GDestroyNotify) g_variant_type_free), NULL);
+ _tmp11_ = G_VARIANT_TYPE_STRING_ARRAY;
+ _tmp12_ = g_variant_type_new_array (_tmp11_);
+ _tmp13_ = _tmp12_;
+ _tmp14_ = g_variant_type_new_array (_tmp13_);
+ _tmp15_ = _tmp14_;
+ _tmp16_ = g_variant_type_new_array (_tmp15_);
+ _tmp17_ = _tmp16_;
+ _g_variant_type_free0 (_tmp15_);
+ _g_variant_type_free0 (_tmp13_);
+ result = _tmp17_;
+ if (tp2) {
+ *tp2 = _vala_tp2;
+ } else {
+ _g_variant_type_free0 (_vala_tp2);
+ }
+ return result;
+}
+
Test*
test_construct (GType object_type)
{
}
}
+GVariantType*
+test_get_test_signature_property (Test* self)
+{
+ GVariantType* result;
+ const GVariantType* _tmp0_;
+ GVariantType* _tmp1_;
+ g_return_val_if_fail (IS_TEST (self), NULL);
+ _tmp0_ = self->priv->_test_signature_property;
+ _tmp1_ = _g_variant_type_copy0 (_tmp0_);
+ result = _tmp1_;
+ return result;
+}
+
+void
+test_set_test_signature_property (Test* self,
+ const GVariantType* value)
+{
+ GVariantType* old_value;
+ g_return_if_fail (IS_TEST (self));
+ old_value = test_get_test_signature_property (self);
+ if (old_value != value) {
+ GVariantType* _tmp0_;
+ _tmp0_ = _g_variant_type_copy0 (value);
+ _g_variant_type_free0 (self->priv->_test_signature_property);
+ self->priv->_test_signature_property = _tmp0_;
+ g_object_notify_by_pspec ((GObject *) self, test_properties[TEST_TEST_SIGNATURE_PROPERTY_PROPERTY]);
+ }
+ _g_variant_type_free0 (old_value);
+}
+
static void
test_class_init (TestClass * klass,
gpointer klass_data)
G_OBJECT_CLASS (klass)->finalize = test_finalize;
g_object_class_install_property (G_OBJECT_CLASS (klass), TEST_TEST_PROPERTY_PROPERTY, test_properties[TEST_TEST_PROPERTY_PROPERTY] = g_param_spec_string ("test-property", "test-property", "test-property", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
g_object_class_install_property (G_OBJECT_CLASS (klass), TEST_TEST_INT_PROPERTY_PROPERTY, test_properties[TEST_TEST_INT_PROPERTY_PROPERTY] = g_param_spec_int ("test-int-property", "test-int-property", "test-int-property", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), TEST_TEST_SIGNATURE_PROPERTY_PROPERTY, test_properties[TEST_TEST_SIGNATURE_PROPERTY_PROPERTY] = g_param_spec_boxed ("test-signature-property", "test-signature-property", "test-signature-property", G_TYPE_VARIANT_TYPE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}
static void
Test * self;
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_TEST, Test);
_g_free0 (self->priv->_test_property);
+ _g_variant_type_free0 (self->priv->_test_signature_property);
G_OBJECT_CLASS (test_parent_class)->finalize (obj);
}
case TEST_TEST_INT_PROPERTY_PROPERTY:
g_value_set_int (value, test_get_test_int_property (self));
break;
+ case TEST_TEST_SIGNATURE_PROPERTY_PROPERTY:
+ g_value_take_boxed (value, test_get_test_signature_property (self));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
case TEST_TEST_INT_PROPERTY_PROPERTY:
test_set_test_int_property (self, g_value_get_int (value));
break;
+ case TEST_TEST_SIGNATURE_PROPERTY_PROPERTY:
+ test_set_test_signature_property (self, g_value_get_boxed (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
_g_free0 (t);
}
+static void
+_dbus_test_test_signature (Test* self,
+ GVariant* _parameters_,
+ GDBusMethodInvocation* invocation)
+{
+ GError* error = NULL;
+ GVariantIter _arguments_iter;
+ GVariantType* tp1 = NULL;
+ GVariant* _tmp2_;
+ GDBusMessage* _reply_message = NULL;
+ GVariant* _reply;
+ GVariantBuilder _reply_builder;
+ GVariantType* tp2 = NULL;
+ gchar* _tmp3_;
+ GVariantType* result;
+ gchar* _tmp4_;
+ g_variant_iter_init (&_arguments_iter, _parameters_);
+ _tmp2_ = g_variant_iter_next_value (&_arguments_iter);
+ tp1 = g_variant_type_new (g_variant_get_string (_tmp2_, NULL));
+ g_variant_unref (_tmp2_);
+ result = test_test_signature (self, tp1, &tp2);
+ _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
+ g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
+ _tmp3_ = g_variant_type_dup_string (tp2);
+ g_variant_builder_add_value (&_reply_builder, g_variant_new_from_data (G_VARIANT_TYPE_SIGNATURE, _tmp3_, strlen (_tmp3_) + 1, TRUE, g_free, _tmp3_));
+ _tmp4_ = g_variant_type_dup_string (result);
+ g_variant_builder_add_value (&_reply_builder, g_variant_new_from_data (G_VARIANT_TYPE_SIGNATURE, _tmp4_, strlen (_tmp4_) + 1, TRUE, g_free, _tmp4_));
+ _g_variant_type_free0 (result);
+ _reply = g_variant_builder_end (&_reply_builder);
+ g_dbus_message_set_body (_reply_message, _reply);
+ g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
+ g_object_unref (invocation);
+ g_object_unref (_reply_message);
+ _g_variant_type_free0 (tp1);
+ _g_variant_type_free0 (tp2);
+}
+
static void
test_dbus_interface_method_call (GDBusConnection* connection,
const gchar* sender,
_dbus_test_test_int (object, parameters, invocation);
} else if (strcmp (method_name, "TestString") == 0) {
_dbus_test_test_string (object, parameters, invocation);
+ } else if (strcmp (method_name, "TestSignature") == 0) {
+ _dbus_test_test_signature (object, parameters, invocation);
} else {
g_object_unref (invocation);
}
return _reply;
}
+static GVariant*
+_dbus_test_get_test_signature_property (Test* self)
+{
+ GVariantType* result;
+ GVariant* _reply;
+ gchar* _tmp5_;
+ result = test_get_test_signature_property (self);
+ _tmp5_ = g_variant_type_dup_string (result);
+ _reply = g_variant_new_from_data (G_VARIANT_TYPE_SIGNATURE, _tmp5_, strlen (_tmp5_) + 1, TRUE, g_free, _tmp5_);
+ _g_variant_type_free0 (result);
+ return _reply;
+}
+
static GVariant*
test_dbus_interface_get_property (GDBusConnection* connection,
const gchar* sender,
return _dbus_test_get_test_property (object);
} else if (strcmp (property_name, "TestIntProperty") == 0) {
return _dbus_test_get_test_int_property (object);
+ } else if (strcmp (property_name, "TestSignatureProperty") == 0) {
+ return _dbus_test_get_test_signature_property (object);
}
return NULL;
}
test_set_test_int_property (self, value);
}
+static void
+_dbus_test_set_test_signature_property (Test* self,
+ GVariant* _value)
+{
+ GVariantType* value = NULL;
+ value = g_variant_type_new (g_variant_get_string (_value, NULL));
+ test_set_test_signature_property (self, value);
+ _g_variant_type_free0 (value);
+}
+
static gboolean
test_dbus_interface_set_property (GDBusConnection* connection,
const gchar* sender,
} else if (strcmp (property_name, "TestIntProperty") == 0) {
_dbus_test_set_test_int_property (object, value);
return TRUE;
+ } else if (strcmp (property_name, "TestSignatureProperty") == 0) {
+ _dbus_test_set_test_signature_property (object, value);
+ return TRUE;
}
return FALSE;
}