1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412
|
/* dbus_interface_info_client.c generated by valac, the Vala compiler
* generated from dbus_interface_info_client.vala, do not modify */
#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif
#define TYPE_TEST (test_get_type ())
#define TEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEST, Test))
#define IS_TEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEST))
#define TEST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_TEST, TestIface))
typedef struct _Test Test;
typedef struct _TestIface TestIface;
#define TYPE_TEST_PROXY (test_proxy_get_type ())
enum {
TEST_BAR_SIGNAL,
TEST_NUM_SIGNALS
};
static guint test_signals[TEST_NUM_SIGNALS] = {0};
typedef GDBusProxy TestProxy;
typedef GDBusProxyClass TestProxyClass;
#define _g_free0(var) (var = (g_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; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
struct _TestIface {
GTypeInterface parent_iface;
};
VALA_EXTERN GMainLoop* main_loop;
GMainLoop* main_loop = NULL;
VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
VALA_EXTERN GType test_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint test_register_object (void* object,
GDBusConnection* connection,
const gchar* path,
GError** error);
static GType test_get_type_once (void);
static void test_proxy_g_signal (GDBusProxy* proxy,
const gchar* sender_name,
const gchar* signal_name,
GVariant* parameters);
static void _dbus_handle_test_bar (Test* self,
GVariant* parameters);
static void test_proxy_test_interface_init (TestIface* iface);
static void test_dbus_interface_method_call (GDBusConnection* connection,
const gchar* sender,
const gchar* object_path,
const gchar* interface_name,
const gchar* method_name,
GVariant* parameters,
GDBusMethodInvocation* invocation,
gpointer user_data);
static GVariant* test_dbus_interface_get_property (GDBusConnection* connection,
const gchar* sender,
const gchar* object_path,
const gchar* interface_name,
const gchar* property_name,
GError** error,
gpointer user_data);
static gboolean test_dbus_interface_set_property (GDBusConnection* connection,
const gchar* sender,
const gchar* object_path,
const gchar* interface_name,
const gchar* property_name,
GVariant* value,
GError** error,
gpointer user_data);
static void _dbus_test_bar (GObject* _sender,
const gchar* j,
gpointer* _data);
static void _test_unregister_object (gpointer user_data);
static void _vala_main (void);
static gssize _vala_array_length (gpointer array);
static const GDBusMethodInfo * const _test_dbus_method_info[] = {NULL};
static const GDBusArgInfo _test_dbus_arg_info_bar_j = {-1, "j", "s", NULL};
static const GDBusArgInfo * const _test_dbus_arg_info_bar[] = {&_test_dbus_arg_info_bar_j, NULL};
static const GDBusSignalInfo _test_dbus_signal_info_bar = {-1, "Baz", (GDBusArgInfo **) (&_test_dbus_arg_info_bar), NULL};
static const GDBusSignalInfo * const _test_dbus_signal_info[] = {&_test_dbus_signal_info_bar, NULL};
static const GDBusPropertyInfo * const _test_dbus_property_info[] = {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};
static void
test_default_init (TestIface * iface,
gpointer iface_data)
{
test_signals[TEST_BAR_SIGNAL] = g_signal_new ("bar", TYPE_TEST, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
}
static GType
test_get_type_once (void)
{
static const GTypeInfo g_define_type_info = { sizeof (TestIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) test_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
GType test_type_id;
test_type_id = g_type_register_static (G_TYPE_INTERFACE, "Test", &g_define_type_info, 0);
g_type_interface_add_prerequisite (test_type_id, G_TYPE_OBJECT);
g_type_set_qdata (test_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) test_proxy_get_type);
g_type_set_qdata (test_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.example.Test");
g_type_set_qdata (test_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_test_dbus_interface_info));
g_type_set_qdata (test_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) test_register_object);
return test_type_id;
}
GType
test_get_type (void)
{
static volatile gsize test_type_id__once = 0;
if (g_once_init_enter (&test_type_id__once)) {
GType test_type_id;
test_type_id = test_get_type_once ();
g_once_init_leave (&test_type_id__once, test_type_id);
}
return test_type_id__once;
}
G_DEFINE_TYPE_EXTENDED (TestProxy, test_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (TYPE_TEST, test_proxy_test_interface_init) )
static void
test_proxy_class_init (TestProxyClass* klass)
{
G_DBUS_PROXY_CLASS (klass)->g_signal = test_proxy_g_signal;
}
static void
_dbus_handle_test_bar (Test* self,
GVariant* parameters)
{
GVariantIter _arguments_iter;
gchar* j = NULL;
GVariant* _tmp0_;
g_variant_iter_init (&_arguments_iter, parameters);
_tmp0_ = g_variant_iter_next_value (&_arguments_iter);
j = g_variant_dup_string (_tmp0_, NULL);
g_variant_unref (_tmp0_);
g_signal_emit_by_name (self, "bar", j);
_g_free0 (j);
}
static void
test_proxy_g_signal (GDBusProxy* proxy,
const gchar* sender_name,
const gchar* signal_name,
GVariant* parameters)
{
if (strcmp (signal_name, "Baz") == 0) {
_dbus_handle_test_bar ((Test*) proxy, parameters);
}
}
static void
test_proxy_init (TestProxy* self)
{
g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_test_dbus_interface_info));
}
static void
test_proxy_test_interface_init (TestIface* iface)
{
}
static void
test_dbus_interface_method_call (GDBusConnection* connection,
const gchar* sender,
const gchar* object_path,
const gchar* interface_name,
const gchar* method_name,
GVariant* parameters,
GDBusMethodInvocation* invocation,
gpointer user_data)
{
gpointer* data;
gpointer object;
data = user_data;
object = data[0];
g_object_unref (invocation);
}
static GVariant*
test_dbus_interface_get_property (GDBusConnection* connection,
const gchar* sender,
const gchar* object_path,
const gchar* interface_name,
const gchar* property_name,
GError** error,
gpointer user_data)
{
gpointer* data;
gpointer object;
data = user_data;
object = data[0];
return NULL;
}
static gboolean
test_dbus_interface_set_property (GDBusConnection* connection,
const gchar* sender,
const gchar* object_path,
const gchar* interface_name,
const gchar* property_name,
GVariant* value,
GError** error,
gpointer user_data)
{
gpointer* data;
gpointer object;
data = user_data;
object = data[0];
return FALSE;
}
static void
_dbus_test_bar (GObject* _sender,
const gchar* j,
gpointer* _data)
{
GDBusConnection * _connection;
const gchar * _path;
GVariant *_arguments;
GVariantBuilder _arguments_builder;
_connection = _data[1];
_path = _data[2];
g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (j));
_arguments = g_variant_builder_end (&_arguments_builder);
g_dbus_connection_emit_signal (_connection, NULL, _path, "org.example.Test", "Baz", _arguments, NULL);
}
guint
test_register_object (gpointer object,
GDBusConnection* connection,
const gchar* path,
GError** error)
{
guint result;
gpointer *data;
data = g_new (gpointer, 3);
data[0] = g_object_ref (object);
data[1] = g_object_ref (connection);
data[2] = g_strdup (path);
result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_test_dbus_interface_info), &_test_dbus_interface_vtable, data, _test_unregister_object, error);
if (!result) {
return 0;
}
g_signal_connect (object, "bar", (GCallback) _dbus_test_bar, data);
return result;
}
static void
_test_unregister_object (gpointer user_data)
{
gpointer* data;
data = user_data;
g_signal_handlers_disconnect_by_func (data[0], _dbus_test_bar, data);
g_object_unref (data[0]);
g_object_unref (data[1]);
g_free (data[2]);
g_free (data);
}
static void
_vala_main (void)
{
Test* test = NULL;
Test* _tmp0_;
GDBusProxy* proxy = NULL;
GDBusInterfaceInfo* iface_info = NULL;
GDBusProxy* _tmp1_;
GDBusInterfaceInfo* _tmp2_;
GDBusInterfaceInfo* _tmp3_;
GDBusInterfaceInfo* _tmp4_;
GDBusSignalInfo** _tmp5_;
gint _tmp5__length1;
GDBusInterfaceInfo* _tmp6_;
GDBusSignalInfo** _tmp7_;
gint _tmp7__length1;
GDBusSignalInfo* _tmp8_;
GDBusInterfaceInfo* _tmp9_;
GDBusSignalInfo** _tmp10_;
gint _tmp10__length1;
GDBusSignalInfo* _tmp11_;
const gchar* _tmp12_;
GDBusInterfaceInfo* _tmp13_;
GDBusSignalInfo** _tmp14_;
gint _tmp14__length1;
GDBusSignalInfo* _tmp15_;
GDBusArgInfo** _tmp16_;
gint _tmp16__length1;
GDBusInterfaceInfo* _tmp17_;
GDBusSignalInfo** _tmp18_;
gint _tmp18__length1;
GDBusSignalInfo* _tmp19_;
GDBusArgInfo** _tmp20_;
gint _tmp20__length1;
GDBusArgInfo* _tmp21_;
GDBusInterfaceInfo* _tmp22_;
GDBusSignalInfo** _tmp23_;
gint _tmp23__length1;
GDBusSignalInfo* _tmp24_;
GDBusArgInfo** _tmp25_;
gint _tmp25__length1;
GDBusArgInfo* _tmp26_;
const gchar* _tmp27_;
GDBusInterfaceInfo* _tmp28_;
void* _tmp29_;
GError* _inner_error0_ = NULL;
_tmp0_ = (Test*) g_initable_new (TYPE_TEST_PROXY, NULL, &_inner_error0_, "g-flags", 0, "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_;
if (G_UNLIKELY (_inner_error0_ != NULL)) {
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;
}
proxy = G_TYPE_CHECK_INSTANCE_CAST (test, g_dbus_proxy_get_type (), GDBusProxy);
_tmp1_ = proxy;
_tmp2_ = g_dbus_proxy_get_interface_info (_tmp1_);
iface_info = _tmp2_;
_tmp3_ = iface_info;
_vala_assert (_tmp3_ != NULL, "iface_info != null");
_tmp4_ = iface_info;
_tmp5_ = _tmp4_->signals;
_tmp5__length1 = _vala_array_length (_tmp4_->signals);
_vala_assert (_tmp5_ != NULL, "iface_info.signals != null");
_tmp6_ = iface_info;
_tmp7_ = _tmp6_->signals;
_tmp7__length1 = _vala_array_length (_tmp6_->signals);
_tmp8_ = _tmp7_[0];
_vala_assert (_tmp8_ != NULL, "iface_info.signals[0] != null");
_tmp9_ = iface_info;
_tmp10_ = _tmp9_->signals;
_tmp10__length1 = _vala_array_length (_tmp9_->signals);
_tmp11_ = _tmp10_[0];
_tmp12_ = _tmp11_->name;
_vala_assert (g_strcmp0 (_tmp12_, "Baz") == 0, "iface_info.signals[0].name == \"Baz\"");
_tmp13_ = iface_info;
_tmp14_ = _tmp13_->signals;
_tmp14__length1 = _vala_array_length (_tmp13_->signals);
_tmp15_ = _tmp14_[0];
_tmp16_ = _tmp15_->args;
_tmp16__length1 = _vala_array_length (_tmp15_->args);
_vala_assert (_tmp16_ != NULL, "iface_info.signals[0].args != null");
_tmp17_ = iface_info;
_tmp18_ = _tmp17_->signals;
_tmp18__length1 = _vala_array_length (_tmp17_->signals);
_tmp19_ = _tmp18_[0];
_tmp20_ = _tmp19_->args;
_tmp20__length1 = _vala_array_length (_tmp19_->args);
_tmp21_ = _tmp20_[0];
_vala_assert (_tmp21_ != NULL, "iface_info.signals[0].args[0] != null");
_tmp22_ = iface_info;
_tmp23_ = _tmp22_->signals;
_tmp23__length1 = _vala_array_length (_tmp22_->signals);
_tmp24_ = _tmp23_[0];
_tmp25_ = _tmp24_->args;
_tmp25__length1 = _vala_array_length (_tmp24_->args);
_tmp26_ = _tmp25_[0];
_tmp27_ = _tmp26_->signature;
_vala_assert (g_strcmp0 (_tmp27_, "s") == 0, "iface_info.signals[0].args[0].signature == \"s\"");
_tmp28_ = iface_info;
_tmp29_ = g_type_get_qdata (TYPE_TEST, g_quark_from_string ("vala-dbus-interface-info"));
_vala_assert (_tmp28_ == ((GDBusInterfaceInfo*) _tmp29_), "iface_info == (DBusInterfaceInfo?) typeof (Test).get_qdata (Quark.from_string (\"vala-dbus-interface-info\"))");
_g_object_unref0 (test);
}
int
main (int argc,
char ** argv)
{
_vala_main ();
return 0;
}
static gssize
_vala_array_length (gpointer array)
{
gssize length;
length = 0;
if (array) {
while (((gpointer*) array)[length]) {
length++;
}
}
return length;
}
|