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 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886
|
/* benchmark.c generated by valac 0.20.1, the Vala compiler
* generated from benchmark.vala, do not modify */
/* benchmark.vala
*
* Copyright © 2011 Collabora Ltd.
* By Seif Lotfy <seif@lotfy.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include "zeitgeist-engine.h"
#include "zeitgeist-datamodel.h"
#include "zeitgeist-internal.h"
#include <float.h>
#include <math.h>
#define ZEITGEIST_TYPE_REMOTE_BENCHMARKER (zeitgeist_remote_benchmarker_get_type ())
#define ZEITGEIST_REMOTE_BENCHMARKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ZEITGEIST_TYPE_REMOTE_BENCHMARKER, ZeitgeistRemoteBenchmarker))
#define ZEITGEIST_IS_REMOTE_BENCHMARKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ZEITGEIST_TYPE_REMOTE_BENCHMARKER))
#define ZEITGEIST_REMOTE_BENCHMARKER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ZEITGEIST_TYPE_REMOTE_BENCHMARKER, ZeitgeistRemoteBenchmarkerIface))
typedef struct _ZeitgeistRemoteBenchmarker ZeitgeistRemoteBenchmarker;
typedef struct _ZeitgeistRemoteBenchmarkerIface ZeitgeistRemoteBenchmarkerIface;
#define ZEITGEIST_TYPE_REMOTE_BENCHMARKER_PROXY (zeitgeist_remote_benchmarker_proxy_get_type ())
typedef GDBusProxy ZeitgeistRemoteBenchmarkerProxy;
typedef GDBusProxyClass ZeitgeistRemoteBenchmarkerProxyClass;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define ZEITGEIST_TYPE_BENCHMARKER (zeitgeist_benchmarker_get_type ())
#define ZEITGEIST_BENCHMARKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ZEITGEIST_TYPE_BENCHMARKER, ZeitgeistBenchmarker))
#define ZEITGEIST_BENCHMARKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ZEITGEIST_TYPE_BENCHMARKER, ZeitgeistBenchmarkerClass))
#define ZEITGEIST_IS_BENCHMARKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ZEITGEIST_TYPE_BENCHMARKER))
#define ZEITGEIST_IS_BENCHMARKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ZEITGEIST_TYPE_BENCHMARKER))
#define ZEITGEIST_BENCHMARKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ZEITGEIST_TYPE_BENCHMARKER, ZeitgeistBenchmarkerClass))
typedef struct _ZeitgeistBenchmarker ZeitgeistBenchmarker;
typedef struct _ZeitgeistBenchmarkerClass ZeitgeistBenchmarkerClass;
typedef struct _ZeitgeistBenchmarkerPrivate ZeitgeistBenchmarkerPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_timer_destroy0(var) ((var == NULL) ? NULL : (var = (g_timer_destroy (var), NULL)))
#define _g_ptr_array_unref0(var) ((var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL)))
typedef struct _ZeitgeistBenchmarkerFindEventsData ZeitgeistBenchmarkerFindEventsData;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
struct _ZeitgeistRemoteBenchmarkerIface {
GTypeInterface parent_iface;
void (*find_events) (ZeitgeistRemoteBenchmarker* self, GVariant* time_range, GVariant* event_templates, guint storage_state, guint num_events, guint result_type, GAsyncReadyCallback _callback_, gpointer _user_data_);
GHashTable* (*find_events_finish) (ZeitgeistRemoteBenchmarker* self, GAsyncResult* _res_, GError** error);
};
struct _ZeitgeistBenchmarker {
ZeitgeistExtension parent_instance;
ZeitgeistBenchmarkerPrivate * priv;
};
struct _ZeitgeistBenchmarkerClass {
ZeitgeistExtensionClass parent_class;
};
struct _ZeitgeistBenchmarkerPrivate {
guint registration_id;
};
struct _ZeitgeistBenchmarkerFindEventsData {
int _state_;
GObject* _source_object_;
GAsyncResult* _res_;
GSimpleAsyncResult* _async_result;
ZeitgeistBenchmarker* self;
GVariant* time_range;
GVariant* filter_templates;
guint storage_state;
guint num_events;
guint result_type;
GHashTable* result;
GHashFunc _tmp0_;
GEqualFunc _tmp1_;
GHashTable* _tmp2_;
GHashTable* data;
GTimer* _tmp3_;
GTimer* find_event_ids_timer;
GVariant* _tmp4_;
ZeitgeistTimeRange* _tmp5_;
ZeitgeistTimeRange* _tmp6_;
GVariant* _tmp7_;
GPtrArray* _tmp8_;
GPtrArray* _tmp9_;
ZeitgeistEngine* _tmp10_;
ZeitgeistEngine* _tmp11_;
ZeitgeistTimeRange* _tmp12_;
GPtrArray* _tmp13_;
guint _tmp14_;
guint _tmp15_;
guint _tmp16_;
gint _tmp17_;
guint32* _tmp18_;
guint32* _tmp19_;
gint _tmp19__length1;
guint32* ids;
gint ids_length1;
gint _ids_size_;
GTimer* _tmp20_;
gdouble _tmp21_;
gdouble find_event_ids_elapsed;
GTimer* _tmp22_;
GTimer* get_events_timer;
ZeitgeistEngine* _tmp23_;
ZeitgeistEngine* _tmp24_;
guint32* _tmp25_;
gint _tmp25__length1;
GPtrArray* _tmp26_;
GPtrArray* events;
GTimer* _tmp27_;
gdouble _tmp28_;
gdouble get_events_elapsed;
GTimer* _tmp29_;
GTimer* marsh_events_timer;
GPtrArray* _tmp30_;
GVariant* _tmp31_;
GVariant* marsh_events;
GTimer* _tmp32_;
gdouble _tmp33_;
gdouble marsh_events_elapsed;
gdouble _tmp34_;
gdouble _tmp35_;
gdouble _tmp36_;
gdouble find_events_elapsed;
GHashTable* _tmp37_;
gchar* _tmp38_;
gdouble _tmp39_;
GVariant* _tmp40_;
GHashTable* _tmp41_;
gchar* _tmp42_;
gdouble _tmp43_;
GVariant* _tmp44_;
GHashTable* _tmp45_;
gchar* _tmp46_;
gdouble _tmp47_;
GVariant* _tmp48_;
GHashTable* _tmp49_;
gchar* _tmp50_;
gdouble _tmp51_;
GVariant* _tmp52_;
GHashTable* _tmp53_;
gchar* _tmp54_;
GVariant* _tmp55_;
GVariant* _tmp56_;
GError * _inner_error_;
};
static GType zeitgeist_remote_benchmarker_type_id = 0;
static gpointer zeitgeist_benchmarker_parent_class = NULL;
static ZeitgeistRemoteBenchmarkerIface* zeitgeist_benchmarker_zeitgeist_remote_benchmarker_parent_iface = NULL;
static GType zeitgeist_benchmarker_type_id = 0;
GType zeitgeist_remote_benchmarker_proxy_get_type (void) G_GNUC_CONST;
guint zeitgeist_remote_benchmarker_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
GType zeitgeist_remote_benchmarker_get_type (void) G_GNUC_CONST;
GType zeitgeist_remote_benchmarker_register_type (GTypeModule * module);
void zeitgeist_remote_benchmarker_find_events (ZeitgeistRemoteBenchmarker* self, GVariant* time_range, GVariant* event_templates, guint storage_state, guint num_events, guint result_type, GAsyncReadyCallback _callback_, gpointer _user_data_);
GHashTable* zeitgeist_remote_benchmarker_find_events_finish (ZeitgeistRemoteBenchmarker* self, GAsyncResult* _res_, GError** error);
static void zeitgeist_remote_benchmarker_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters);
static void _vala_g_async_ready_callback (GObject *source_object, GAsyncResult *res, void *user_data);
static void zeitgeist_remote_benchmarker_proxy_find_events_async (ZeitgeistRemoteBenchmarker* self, GVariant* time_range, GVariant* event_templates, guint storage_state, guint num_events, guint result_type, GAsyncReadyCallback _callback_, gpointer _user_data_);
static GHashTable* zeitgeist_remote_benchmarker_proxy_find_events_finish (ZeitgeistRemoteBenchmarker* self, GAsyncResult* _res_, GError** error);
static void zeitgeist_remote_benchmarker_proxy_zeitgeist_remote_benchmarker_interface_init (ZeitgeistRemoteBenchmarkerIface* iface);
static void _dbus_zeitgeist_remote_benchmarker_find_events (ZeitgeistRemoteBenchmarker* self, GVariant* parameters, GDBusMethodInvocation* invocation);
static void _dbus_zeitgeist_remote_benchmarker_find_events_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_);
static void zeitgeist_remote_benchmarker_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* zeitgeist_remote_benchmarker_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 zeitgeist_remote_benchmarker_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 _zeitgeist_remote_benchmarker_unregister_object (gpointer user_data);
GType zeitgeist_benchmarker_get_type (void) G_GNUC_CONST;
GType zeitgeist_benchmarker_register_type (GTypeModule * module);
#define ZEITGEIST_BENCHMARKER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), ZEITGEIST_TYPE_BENCHMARKER, ZeitgeistBenchmarkerPrivate))
enum {
ZEITGEIST_BENCHMARKER_DUMMY_PROPERTY
};
static ZeitgeistBenchmarker* zeitgeist_benchmarker_new (void);
static ZeitgeistBenchmarker* zeitgeist_benchmarker_construct (GType object_type);
static void zeitgeist_benchmarker_real_find_events_data_free (gpointer _data);
static void zeitgeist_benchmarker_real_find_events (ZeitgeistRemoteBenchmarker* base, GVariant* time_range, GVariant* filter_templates, guint storage_state, guint num_events, guint result_type, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean zeitgeist_benchmarker_real_find_events_co (ZeitgeistBenchmarkerFindEventsData* _data_);
static void _g_free0_ (gpointer var);
static void _g_variant_unref0_ (gpointer var);
static void zeitgeist_benchmarker_real_unload (ZeitgeistExtension* base);
static GObject * zeitgeist_benchmarker_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void zeitgeist_benchmarker_finalize (GObject* obj);
GType zeitgeist_extension_register (GTypeModule* module);
static const GDBusArgInfo _zeitgeist_remote_benchmarker_dbus_arg_info_find_events_time_range = {-1, "time_range", "(xx)"};
static const GDBusArgInfo _zeitgeist_remote_benchmarker_dbus_arg_info_find_events_event_templates = {-1, "event_templates", "a(asaasay)"};
static const GDBusArgInfo _zeitgeist_remote_benchmarker_dbus_arg_info_find_events_storage_state = {-1, "storage_state", "u"};
static const GDBusArgInfo _zeitgeist_remote_benchmarker_dbus_arg_info_find_events_num_events = {-1, "num_events", "u"};
static const GDBusArgInfo _zeitgeist_remote_benchmarker_dbus_arg_info_find_events_result_type = {-1, "result_type", "u"};
static const GDBusArgInfo _zeitgeist_remote_benchmarker_dbus_arg_info_find_events_result = {-1, "result", "a{sv}"};
static const GDBusArgInfo * const _zeitgeist_remote_benchmarker_dbus_arg_info_find_events_in[] = {&_zeitgeist_remote_benchmarker_dbus_arg_info_find_events_time_range, &_zeitgeist_remote_benchmarker_dbus_arg_info_find_events_event_templates, &_zeitgeist_remote_benchmarker_dbus_arg_info_find_events_storage_state, &_zeitgeist_remote_benchmarker_dbus_arg_info_find_events_num_events, &_zeitgeist_remote_benchmarker_dbus_arg_info_find_events_result_type, NULL};
static const GDBusArgInfo * const _zeitgeist_remote_benchmarker_dbus_arg_info_find_events_out[] = {&_zeitgeist_remote_benchmarker_dbus_arg_info_find_events_result, NULL};
static const GDBusMethodInfo _zeitgeist_remote_benchmarker_dbus_method_info_find_events = {-1, "FindEvents", (GDBusArgInfo **) (&_zeitgeist_remote_benchmarker_dbus_arg_info_find_events_in), (GDBusArgInfo **) (&_zeitgeist_remote_benchmarker_dbus_arg_info_find_events_out)};
static const GDBusMethodInfo * const _zeitgeist_remote_benchmarker_dbus_method_info[] = {&_zeitgeist_remote_benchmarker_dbus_method_info_find_events, NULL};
static const GDBusSignalInfo * const _zeitgeist_remote_benchmarker_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _zeitgeist_remote_benchmarker_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _zeitgeist_remote_benchmarker_dbus_interface_info = {-1, "org.gnome.zeitgeist.Benchmark", (GDBusMethodInfo **) (&_zeitgeist_remote_benchmarker_dbus_method_info), (GDBusSignalInfo **) (&_zeitgeist_remote_benchmarker_dbus_signal_info), (GDBusPropertyInfo **) (&_zeitgeist_remote_benchmarker_dbus_property_info)};
static const GDBusInterfaceVTable _zeitgeist_remote_benchmarker_dbus_interface_vtable = {zeitgeist_remote_benchmarker_dbus_interface_method_call, zeitgeist_remote_benchmarker_dbus_interface_get_property, zeitgeist_remote_benchmarker_dbus_interface_set_property};
void zeitgeist_remote_benchmarker_find_events (ZeitgeistRemoteBenchmarker* self, GVariant* time_range, GVariant* event_templates, guint storage_state, guint num_events, guint result_type, GAsyncReadyCallback _callback_, gpointer _user_data_) {
ZEITGEIST_REMOTE_BENCHMARKER_GET_INTERFACE (self)->find_events (self, time_range, event_templates, storage_state, num_events, result_type, _callback_, _user_data_);
}
GHashTable* zeitgeist_remote_benchmarker_find_events_finish (ZeitgeistRemoteBenchmarker* self, GAsyncResult* _res_, GError** error) {
return ZEITGEIST_REMOTE_BENCHMARKER_GET_INTERFACE (self)->find_events_finish (self, _res_, error);
}
static void zeitgeist_remote_benchmarker_base_init (ZeitgeistRemoteBenchmarkerIface * iface) {
static gboolean initialized = FALSE;
if (!initialized) {
initialized = TRUE;
}
}
GType zeitgeist_remote_benchmarker_get_type (void) {
return zeitgeist_remote_benchmarker_type_id;
}
GType zeitgeist_remote_benchmarker_register_type (GTypeModule * module) {
static const GTypeInfo g_define_type_info = { sizeof (ZeitgeistRemoteBenchmarkerIface), (GBaseInitFunc) zeitgeist_remote_benchmarker_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
zeitgeist_remote_benchmarker_type_id = g_type_module_register_type (module, G_TYPE_INTERFACE, "ZeitgeistRemoteBenchmarker", &g_define_type_info, 0);
g_type_interface_add_prerequisite (zeitgeist_remote_benchmarker_type_id, G_TYPE_OBJECT);
g_type_set_qdata (zeitgeist_remote_benchmarker_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) zeitgeist_remote_benchmarker_proxy_get_type);
g_type_set_qdata (zeitgeist_remote_benchmarker_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.gnome.zeitgeist.Benchmark");
g_type_set_qdata (zeitgeist_remote_benchmarker_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) zeitgeist_remote_benchmarker_register_object);
return zeitgeist_remote_benchmarker_type_id;
}
G_DEFINE_TYPE_EXTENDED (ZeitgeistRemoteBenchmarkerProxy, zeitgeist_remote_benchmarker_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (ZEITGEIST_TYPE_REMOTE_BENCHMARKER, zeitgeist_remote_benchmarker_proxy_zeitgeist_remote_benchmarker_interface_init) )
static void zeitgeist_remote_benchmarker_proxy_class_init (ZeitgeistRemoteBenchmarkerProxyClass* klass) {
G_DBUS_PROXY_CLASS (klass)->g_signal = zeitgeist_remote_benchmarker_proxy_g_signal;
}
static void zeitgeist_remote_benchmarker_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters) {
}
static void zeitgeist_remote_benchmarker_proxy_init (ZeitgeistRemoteBenchmarkerProxy* self) {
}
static void _vala_g_async_ready_callback (GObject *source_object, GAsyncResult *res, void *user_data) {
g_simple_async_result_set_op_res_gpointer (user_data, g_object_ref (res), g_object_unref);
g_simple_async_result_complete (user_data);
g_object_unref (user_data);
}
static void zeitgeist_remote_benchmarker_proxy_find_events_async (ZeitgeistRemoteBenchmarker* self, GVariant* time_range, GVariant* event_templates, guint storage_state, guint num_events, guint result_type, GAsyncReadyCallback _callback_, gpointer _user_data_) {
GDBusMessage *_message;
GVariant *_arguments;
GVariantBuilder _arguments_builder;
_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.gnome.zeitgeist.Benchmark", "FindEvents");
g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
g_variant_builder_add_value (&_arguments_builder, time_range);
g_variant_builder_add_value (&_arguments_builder, event_templates);
g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (storage_state));
g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (num_events));
g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (result_type));
_arguments = g_variant_builder_end (&_arguments_builder);
g_dbus_message_set_body (_message, _arguments);
g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_simple_async_result_new ((GObject *) self, _callback_, _user_data_, NULL));
g_object_unref (_message);
}
static GHashTable* zeitgeist_remote_benchmarker_proxy_find_events_finish (ZeitgeistRemoteBenchmarker* self, GAsyncResult* _res_, GError** error) {
GDBusMessage *_reply_message;
GVariant *_reply;
GVariantIter _reply_iter;
GHashTable* _result;
GVariant* _tmp0_;
GHashTable* _tmp1_;
GVariantIter _tmp2_;
GVariant* _tmp3_;
GVariant* _tmp4_;
_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), g_simple_async_result_get_op_res_gpointer ((GSimpleAsyncResult *) _res_), error);
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);
_tmp0_ = g_variant_iter_next_value (&_reply_iter);
_tmp1_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
g_variant_iter_init (&_tmp2_, _tmp0_);
while (g_variant_iter_loop (&_tmp2_, "{?*}", &_tmp3_, &_tmp4_)) {
g_hash_table_insert (_tmp1_, g_variant_dup_string (_tmp3_, NULL), g_variant_get_variant (_tmp4_));
}
_result = _tmp1_;
g_variant_unref (_tmp0_);
g_object_unref (_reply_message);
return _result;
}
static void zeitgeist_remote_benchmarker_proxy_zeitgeist_remote_benchmarker_interface_init (ZeitgeistRemoteBenchmarkerIface* iface) {
iface->find_events = zeitgeist_remote_benchmarker_proxy_find_events_async;
iface->find_events_finish = zeitgeist_remote_benchmarker_proxy_find_events_finish;
}
static void _dbus_zeitgeist_remote_benchmarker_find_events (ZeitgeistRemoteBenchmarker* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
GVariantIter _arguments_iter;
GVariant* time_range = NULL;
GVariant* event_templates = NULL;
guint storage_state = 0U;
GVariant* _tmp5_;
guint num_events = 0U;
GVariant* _tmp6_;
guint result_type = 0U;
GVariant* _tmp7_;
g_variant_iter_init (&_arguments_iter, parameters);
time_range = g_variant_iter_next_value (&_arguments_iter);
event_templates = g_variant_iter_next_value (&_arguments_iter);
_tmp5_ = g_variant_iter_next_value (&_arguments_iter);
storage_state = g_variant_get_uint32 (_tmp5_);
g_variant_unref (_tmp5_);
_tmp6_ = g_variant_iter_next_value (&_arguments_iter);
num_events = g_variant_get_uint32 (_tmp6_);
g_variant_unref (_tmp6_);
_tmp7_ = g_variant_iter_next_value (&_arguments_iter);
result_type = g_variant_get_uint32 (_tmp7_);
g_variant_unref (_tmp7_);
zeitgeist_remote_benchmarker_find_events (self, time_range, event_templates, storage_state, num_events, result_type, (GAsyncReadyCallback) _dbus_zeitgeist_remote_benchmarker_find_events_ready, invocation);
_g_variant_unref0 (time_range);
_g_variant_unref0 (event_templates);
}
static void _dbus_zeitgeist_remote_benchmarker_find_events_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) {
GDBusMethodInvocation * invocation;
GError* error = NULL;
GDBusMessage* _reply_message;
GVariant* _reply;
GVariantBuilder _reply_builder;
GHashTable* result;
GVariantBuilder _tmp8_;
GHashTableIter _tmp9_;
gpointer _tmp10_;
gpointer _tmp11_;
invocation = _user_data_;
result = zeitgeist_remote_benchmarker_find_events_finish ((ZeitgeistRemoteBenchmarker*) source_object, _res_, &error);
if (error) {
g_dbus_method_invocation_return_gerror (invocation, error);
return;
}
_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);
g_hash_table_iter_init (&_tmp9_, result);
g_variant_builder_init (&_tmp8_, G_VARIANT_TYPE ("a{sv}"));
while (g_hash_table_iter_next (&_tmp9_, &_tmp10_, &_tmp11_)) {
gchar* _key;
GVariant* _value;
_key = (gchar*) _tmp10_;
_value = (GVariant*) _tmp11_;
g_variant_builder_add (&_tmp8_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
}
g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp8_));
_g_hash_table_unref0 (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);
}
static void zeitgeist_remote_benchmarker_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];
if (strcmp (method_name, "FindEvents") == 0) {
_dbus_zeitgeist_remote_benchmarker_find_events (object, parameters, invocation);
} else {
g_object_unref (invocation);
}
}
static GVariant* zeitgeist_remote_benchmarker_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 zeitgeist_remote_benchmarker_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;
}
guint zeitgeist_remote_benchmarker_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 *) (&_zeitgeist_remote_benchmarker_dbus_interface_info), &_zeitgeist_remote_benchmarker_dbus_interface_vtable, data, _zeitgeist_remote_benchmarker_unregister_object, error);
if (!result) {
return 0;
}
return result;
}
static void _zeitgeist_remote_benchmarker_unregister_object (gpointer user_data) {
gpointer* data;
data = user_data;
g_object_unref (data[0]);
g_object_unref (data[1]);
g_free (data[2]);
g_free (data);
}
static ZeitgeistBenchmarker* zeitgeist_benchmarker_construct (GType object_type) {
ZeitgeistBenchmarker * self = NULL;
self = (ZeitgeistBenchmarker*) g_object_new (object_type, NULL);
return self;
}
static ZeitgeistBenchmarker* zeitgeist_benchmarker_new (void) {
return zeitgeist_benchmarker_construct (ZEITGEIST_TYPE_BENCHMARKER);
}
static void zeitgeist_benchmarker_real_find_events_data_free (gpointer _data) {
ZeitgeistBenchmarkerFindEventsData* _data_;
_data_ = _data;
_g_variant_unref0 (_data_->time_range);
_g_variant_unref0 (_data_->filter_templates);
_g_hash_table_unref0 (_data_->result);
_g_object_unref0 (_data_->self);
g_slice_free (ZeitgeistBenchmarkerFindEventsData, _data_);
}
static gpointer _g_object_ref0 (gpointer self) {
return self ? g_object_ref (self) : NULL;
}
static gpointer _g_variant_ref0 (gpointer self) {
return self ? g_variant_ref (self) : NULL;
}
static void zeitgeist_benchmarker_real_find_events (ZeitgeistRemoteBenchmarker* base, GVariant* time_range, GVariant* filter_templates, guint storage_state, guint num_events, guint result_type, GAsyncReadyCallback _callback_, gpointer _user_data_) {
ZeitgeistBenchmarker * self;
ZeitgeistBenchmarkerFindEventsData* _data_;
ZeitgeistBenchmarker* _tmp0_;
GVariant* _tmp1_;
GVariant* _tmp2_;
GVariant* _tmp3_;
GVariant* _tmp4_;
guint _tmp5_;
guint _tmp6_;
guint _tmp7_;
self = (ZeitgeistBenchmarker*) base;
_data_ = g_slice_new0 (ZeitgeistBenchmarkerFindEventsData);
_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, zeitgeist_benchmarker_real_find_events);
g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, zeitgeist_benchmarker_real_find_events_data_free);
_tmp0_ = _g_object_ref0 (self);
_data_->self = _tmp0_;
_tmp1_ = time_range;
_tmp2_ = _g_variant_ref0 (_tmp1_);
_g_variant_unref0 (_data_->time_range);
_data_->time_range = _tmp2_;
_tmp3_ = filter_templates;
_tmp4_ = _g_variant_ref0 (_tmp3_);
_g_variant_unref0 (_data_->filter_templates);
_data_->filter_templates = _tmp4_;
_tmp5_ = storage_state;
_data_->storage_state = _tmp5_;
_tmp6_ = num_events;
_data_->num_events = _tmp6_;
_tmp7_ = result_type;
_data_->result_type = _tmp7_;
zeitgeist_benchmarker_real_find_events_co (_data_);
}
static GHashTable* zeitgeist_benchmarker_real_find_events_finish (ZeitgeistRemoteBenchmarker* base, GAsyncResult* _res_, GError** error) {
GHashTable* result;
ZeitgeistBenchmarkerFindEventsData* _data_;
if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
return NULL;
}
_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
result = _data_->result;
_data_->result = NULL;
return result;
}
static void _g_free0_ (gpointer var) {
var = (g_free (var), NULL);
}
static void _g_variant_unref0_ (gpointer var) {
(var == NULL) ? NULL : (var = (g_variant_unref (var), NULL));
}
static gboolean zeitgeist_benchmarker_real_find_events_co (ZeitgeistBenchmarkerFindEventsData* _data_) {
switch (_data_->_state_) {
case 0:
goto _state_0;
default:
g_assert_not_reached ();
}
_state_0:
_data_->_tmp0_ = g_str_hash;
_data_->_tmp1_ = g_str_equal;
_data_->_tmp2_ = g_hash_table_new_full (_data_->_tmp0_, _data_->_tmp1_, _g_free0_, _g_variant_unref0_);
_data_->data = _data_->_tmp2_;
_data_->_tmp3_ = g_timer_new ();
_data_->find_event_ids_timer = _data_->_tmp3_;
_data_->_tmp4_ = _data_->time_range;
_data_->_tmp5_ = zeitgeist_time_range_new_from_variant (_data_->_tmp4_, &_data_->_inner_error_);
_data_->_tmp6_ = _data_->_tmp5_;
if (_data_->_inner_error_ != NULL) {
g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
g_error_free (_data_->_inner_error_);
_g_timer_destroy0 (_data_->find_event_ids_timer);
_g_hash_table_unref0 (_data_->data);
if (_data_->_state_ == 0) {
g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
g_simple_async_result_complete (_data_->_async_result);
}
g_object_unref (_data_->_async_result);
return FALSE;
}
_data_->_tmp7_ = _data_->filter_templates;
_data_->_tmp8_ = NULL;
_data_->_tmp8_ = zeitgeist_events_from_variant (_data_->_tmp7_, &_data_->_inner_error_);
_data_->_tmp9_ = _data_->_tmp8_;
if (_data_->_inner_error_ != NULL) {
g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
g_error_free (_data_->_inner_error_);
_g_timer_destroy0 (_data_->find_event_ids_timer);
_g_hash_table_unref0 (_data_->data);
if (_data_->_state_ == 0) {
g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
g_simple_async_result_complete (_data_->_async_result);
}
g_object_unref (_data_->_async_result);
return FALSE;
}
_data_->_tmp10_ = zeitgeist_extension_get_engine ((ZeitgeistExtension*) _data_->self);
_data_->_tmp11_ = _data_->_tmp10_;
_data_->_tmp12_ = _data_->_tmp6_;
_data_->_tmp13_ = _data_->_tmp9_;
_data_->_tmp14_ = _data_->storage_state;
_data_->_tmp15_ = _data_->num_events;
_data_->_tmp16_ = _data_->result_type;
_data_->_tmp17_ = 0;
_data_->_tmp18_ = NULL;
_data_->_tmp18_ = zeitgeist_db_reader_find_event_ids ((ZeitgeistDbReader*) _data_->_tmp11_, _data_->_tmp12_, _data_->_tmp13_, _data_->_tmp14_, _data_->_tmp15_, _data_->_tmp16_, NULL, &_data_->_tmp17_, &_data_->_inner_error_);
_data_->_tmp19_ = _data_->_tmp18_;
_data_->_tmp19__length1 = _data_->_tmp17_;
_g_ptr_array_unref0 (_data_->_tmp13_);
_g_object_unref0 (_data_->_tmp12_);
_data_->ids = _data_->_tmp19_;
_data_->ids_length1 = _data_->_tmp19__length1;
_data_->_ids_size_ = _data_->ids_length1;
if (_data_->_inner_error_ != NULL) {
g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
g_error_free (_data_->_inner_error_);
_g_timer_destroy0 (_data_->find_event_ids_timer);
_g_hash_table_unref0 (_data_->data);
if (_data_->_state_ == 0) {
g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
g_simple_async_result_complete (_data_->_async_result);
}
g_object_unref (_data_->_async_result);
return FALSE;
}
_data_->_tmp20_ = _data_->find_event_ids_timer;
_data_->_tmp21_ = 0.0;
_data_->_tmp21_ = g_timer_elapsed (_data_->_tmp20_, NULL);
_data_->find_event_ids_elapsed = _data_->_tmp21_;
_data_->_tmp22_ = g_timer_new ();
_data_->get_events_timer = _data_->_tmp22_;
_data_->_tmp23_ = zeitgeist_extension_get_engine ((ZeitgeistExtension*) _data_->self);
_data_->_tmp24_ = _data_->_tmp23_;
_data_->_tmp25_ = _data_->ids;
_data_->_tmp25__length1 = _data_->ids_length1;
_data_->_tmp26_ = NULL;
_data_->_tmp26_ = zeitgeist_db_reader_get_events ((ZeitgeistDbReader*) _data_->_tmp24_, _data_->_tmp25_, _data_->_tmp25__length1, NULL, &_data_->_inner_error_);
_data_->events = _data_->_tmp26_;
if (_data_->_inner_error_ != NULL) {
g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
g_error_free (_data_->_inner_error_);
_g_timer_destroy0 (_data_->get_events_timer);
_data_->ids = (g_free (_data_->ids), NULL);
_g_timer_destroy0 (_data_->find_event_ids_timer);
_g_hash_table_unref0 (_data_->data);
if (_data_->_state_ == 0) {
g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
g_simple_async_result_complete (_data_->_async_result);
}
g_object_unref (_data_->_async_result);
return FALSE;
}
_data_->_tmp27_ = _data_->get_events_timer;
_data_->_tmp28_ = 0.0;
_data_->_tmp28_ = g_timer_elapsed (_data_->_tmp27_, NULL);
_data_->get_events_elapsed = _data_->_tmp28_;
_data_->_tmp29_ = g_timer_new ();
_data_->marsh_events_timer = _data_->_tmp29_;
_data_->_tmp30_ = _data_->events;
_data_->_tmp31_ = NULL;
_data_->_tmp31_ = zeitgeist_events_to_variant (_data_->_tmp30_);
_data_->marsh_events = _data_->_tmp31_;
_data_->_tmp32_ = _data_->marsh_events_timer;
_data_->_tmp33_ = 0.0;
_data_->_tmp33_ = g_timer_elapsed (_data_->_tmp32_, NULL);
_data_->marsh_events_elapsed = _data_->_tmp33_;
_data_->_tmp34_ = _data_->get_events_elapsed;
_data_->_tmp35_ = _data_->find_event_ids_elapsed;
_data_->_tmp36_ = _data_->marsh_events_elapsed;
_data_->find_events_elapsed = (_data_->_tmp34_ + _data_->_tmp35_) + _data_->_tmp36_;
_data_->_tmp37_ = _data_->data;
_data_->_tmp38_ = g_strdup ("find_event_ids");
_data_->_tmp39_ = _data_->find_event_ids_elapsed;
_data_->_tmp40_ = g_variant_new_double (_data_->_tmp39_);
g_variant_ref_sink (_data_->_tmp40_);
g_hash_table_insert (_data_->_tmp37_, _data_->_tmp38_, _data_->_tmp40_);
_data_->_tmp41_ = _data_->data;
_data_->_tmp42_ = g_strdup ("get_events");
_data_->_tmp43_ = _data_->get_events_elapsed;
_data_->_tmp44_ = g_variant_new_double (_data_->_tmp43_);
g_variant_ref_sink (_data_->_tmp44_);
g_hash_table_insert (_data_->_tmp41_, _data_->_tmp42_, _data_->_tmp44_);
_data_->_tmp45_ = _data_->data;
_data_->_tmp46_ = g_strdup ("find_events");
_data_->_tmp47_ = _data_->find_events_elapsed;
_data_->_tmp48_ = g_variant_new_double (_data_->_tmp47_);
g_variant_ref_sink (_data_->_tmp48_);
g_hash_table_insert (_data_->_tmp45_, _data_->_tmp46_, _data_->_tmp48_);
_data_->_tmp49_ = _data_->data;
_data_->_tmp50_ = g_strdup ("marsh_events");
_data_->_tmp51_ = _data_->marsh_events_elapsed;
_data_->_tmp52_ = g_variant_new_double (_data_->_tmp51_);
g_variant_ref_sink (_data_->_tmp52_);
g_hash_table_insert (_data_->_tmp49_, _data_->_tmp50_, _data_->_tmp52_);
_data_->_tmp53_ = _data_->data;
_data_->_tmp54_ = g_strdup ("events");
_data_->_tmp55_ = _data_->marsh_events;
_data_->_tmp56_ = _g_variant_ref0 (_data_->_tmp55_);
g_hash_table_insert (_data_->_tmp53_, _data_->_tmp54_, _data_->_tmp56_);
_data_->result = _data_->data;
_g_variant_unref0 (_data_->marsh_events);
_g_timer_destroy0 (_data_->marsh_events_timer);
_g_ptr_array_unref0 (_data_->events);
_g_timer_destroy0 (_data_->get_events_timer);
_data_->ids = (g_free (_data_->ids), NULL);
_g_timer_destroy0 (_data_->find_event_ids_timer);
if (_data_->_state_ == 0) {
g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
g_simple_async_result_complete (_data_->_async_result);
}
g_object_unref (_data_->_async_result);
return FALSE;
_g_variant_unref0 (_data_->marsh_events);
_g_timer_destroy0 (_data_->marsh_events_timer);
_g_ptr_array_unref0 (_data_->events);
_g_timer_destroy0 (_data_->get_events_timer);
_data_->ids = (g_free (_data_->ids), NULL);
_g_timer_destroy0 (_data_->find_event_ids_timer);
_g_hash_table_unref0 (_data_->data);
if (_data_->_state_ == 0) {
g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
g_simple_async_result_complete (_data_->_async_result);
}
g_object_unref (_data_->_async_result);
return FALSE;
}
static void zeitgeist_benchmarker_real_unload (ZeitgeistExtension* base) {
ZeitgeistBenchmarker * self;
guint _tmp5_;
GError * _inner_error_ = NULL;
self = (ZeitgeistBenchmarker*) base;
{
GDBusConnection* _tmp0_ = NULL;
GDBusConnection* connection;
guint _tmp1_;
_tmp0_ = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &_inner_error_);
connection = _tmp0_;
if (_inner_error_ != NULL) {
goto __catch0_g_error;
}
_tmp1_ = self->priv->registration_id;
if (_tmp1_ != ((guint) 0)) {
guint _tmp2_;
_tmp2_ = self->priv->registration_id;
g_dbus_connection_unregister_object (connection, _tmp2_);
self->priv->registration_id = (guint) 0;
}
_g_object_unref0 (connection);
}
goto __finally0;
__catch0_g_error:
{
GError* err = NULL;
GError* _tmp3_;
const gchar* _tmp4_;
err = _inner_error_;
_inner_error_ = NULL;
_tmp3_ = err;
_tmp4_ = _tmp3_->message;
g_warning ("benchmark.vala:107: %s", _tmp4_);
_g_error_free0 (err);
}
__finally0:
if (_inner_error_ != NULL) {
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
g_clear_error (&_inner_error_);
return;
}
_tmp5_ = ((GObject*) self)->ref_count;
g_debug ("benchmark.vala:110: %s, this.ref_count = %u", "Zeitgeist.Benchmarker.unload", _tmp5_);
}
static GObject * zeitgeist_benchmarker_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
GObject * obj;
GObjectClass * parent_class;
ZeitgeistBenchmarker * self;
GError * _inner_error_ = NULL;
parent_class = G_OBJECT_CLASS (zeitgeist_benchmarker_parent_class);
obj = parent_class->constructor (type, n_construct_properties, construct_properties);
self = G_TYPE_CHECK_INSTANCE_CAST (obj, ZEITGEIST_TYPE_BENCHMARKER, ZeitgeistBenchmarker);
{
GDBusConnection* _tmp0_ = NULL;
GDBusConnection* connection;
GDBusConnection* _tmp1_;
guint _tmp2_ = 0U;
guint _tmp3_;
_tmp0_ = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &_inner_error_);
connection = _tmp0_;
if (_inner_error_ != NULL) {
goto __catch1_g_error;
}
_tmp1_ = connection;
_tmp2_ = zeitgeist_remote_benchmarker_register_object ((ZeitgeistRemoteBenchmarker*) self, _tmp1_, "/org/gnome/zeitgeist/benchmark", &_inner_error_);
_tmp3_ = _tmp2_;
if (_inner_error_ != NULL) {
_g_object_unref0 (connection);
goto __catch1_g_error;
}
self->priv->registration_id = _tmp3_;
_g_object_unref0 (connection);
}
goto __finally1;
__catch1_g_error:
{
GError* err = NULL;
GError* _tmp4_;
const gchar* _tmp5_;
err = _inner_error_;
_inner_error_ = NULL;
_tmp4_ = err;
_tmp5_ = _tmp4_->message;
g_warning ("benchmark.vala:53: %s", _tmp5_);
_g_error_free0 (err);
}
__finally1:
if (_inner_error_ != NULL) {
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
g_clear_error (&_inner_error_);
}
return obj;
}
static void zeitgeist_benchmarker_class_init (ZeitgeistBenchmarkerClass * klass) {
zeitgeist_benchmarker_parent_class = g_type_class_peek_parent (klass);
g_type_class_add_private (klass, sizeof (ZeitgeistBenchmarkerPrivate));
ZEITGEIST_EXTENSION_CLASS (klass)->unload = zeitgeist_benchmarker_real_unload;
G_OBJECT_CLASS (klass)->constructor = zeitgeist_benchmarker_constructor;
G_OBJECT_CLASS (klass)->finalize = zeitgeist_benchmarker_finalize;
}
static void zeitgeist_benchmarker_zeitgeist_remote_benchmarker_interface_init (ZeitgeistRemoteBenchmarkerIface * iface) {
zeitgeist_benchmarker_zeitgeist_remote_benchmarker_parent_iface = g_type_interface_peek_parent (iface);
iface->find_events = (GHashTable* (*)(ZeitgeistRemoteBenchmarker*, GVariant*, GVariant*, guint, guint, guint, GError**)) zeitgeist_benchmarker_real_find_events;
iface->find_events_finish = zeitgeist_benchmarker_real_find_events_finish;
}
static void zeitgeist_benchmarker_instance_init (ZeitgeistBenchmarker * self) {
self->priv = ZEITGEIST_BENCHMARKER_GET_PRIVATE (self);
}
static void zeitgeist_benchmarker_finalize (GObject* obj) {
ZeitgeistBenchmarker * self;
self = G_TYPE_CHECK_INSTANCE_CAST (obj, ZEITGEIST_TYPE_BENCHMARKER, ZeitgeistBenchmarker);
G_OBJECT_CLASS (zeitgeist_benchmarker_parent_class)->finalize (obj);
}
GType zeitgeist_benchmarker_get_type (void) {
return zeitgeist_benchmarker_type_id;
}
GType zeitgeist_benchmarker_register_type (GTypeModule * module) {
static const GTypeInfo g_define_type_info = { sizeof (ZeitgeistBenchmarkerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) zeitgeist_benchmarker_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ZeitgeistBenchmarker), 0, (GInstanceInitFunc) zeitgeist_benchmarker_instance_init, NULL };
static const GInterfaceInfo zeitgeist_remote_benchmarker_info = { (GInterfaceInitFunc) zeitgeist_benchmarker_zeitgeist_remote_benchmarker_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
zeitgeist_benchmarker_type_id = g_type_module_register_type (module, ZEITGEIST_TYPE_EXTENSION, "ZeitgeistBenchmarker", &g_define_type_info, 0);
g_type_module_add_interface (module, zeitgeist_benchmarker_type_id, ZEITGEIST_TYPE_REMOTE_BENCHMARKER, &zeitgeist_remote_benchmarker_info);
return zeitgeist_benchmarker_type_id;
}
GType zeitgeist_extension_register (GTypeModule* module) {
GType result = 0UL;
g_return_val_if_fail (module != NULL, 0UL);
zeitgeist_remote_benchmarker_register_type (module);
zeitgeist_benchmarker_register_type (module);
result = ZEITGEIST_TYPE_BENCHMARKER;
return result;
}
|