1
/* extension-collection.c generated by valac 0.14.0, the Vala compiler
2
* generated from extension-collection.vala, do not modify */
4
/* extension-collection.vala
6
* Copyright © 2011 Michal Hruby <michal.mhr@gmail.com>
8
* This program is free software: you can redistribute it and/or modify
9
* it under the terms of the GNU Lesser General Public License as published by
10
* the Free Software Foundation, either version 2.1 of the License, or
11
* (at your option) any later version.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU Lesser General Public License
19
* along with this program. If not, see <http://www.gnu.org/licenses/>.
24
#include <glib-object.h>
27
#include <glib/gstdio.h>
30
#define ZEITGEIST_TYPE_EXTENSION_COLLECTION (zeitgeist_extension_collection_get_type ())
31
#define ZEITGEIST_EXTENSION_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ZEITGEIST_TYPE_EXTENSION_COLLECTION, ZeitgeistExtensionCollection))
32
#define ZEITGEIST_EXTENSION_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ZEITGEIST_TYPE_EXTENSION_COLLECTION, ZeitgeistExtensionCollectionClass))
33
#define ZEITGEIST_IS_EXTENSION_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ZEITGEIST_TYPE_EXTENSION_COLLECTION))
34
#define ZEITGEIST_IS_EXTENSION_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ZEITGEIST_TYPE_EXTENSION_COLLECTION))
35
#define ZEITGEIST_EXTENSION_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ZEITGEIST_TYPE_EXTENSION_COLLECTION, ZeitgeistExtensionCollectionClass))
37
typedef struct _ZeitgeistExtensionCollection ZeitgeistExtensionCollection;
38
typedef struct _ZeitgeistExtensionCollectionClass ZeitgeistExtensionCollectionClass;
39
typedef struct _ZeitgeistExtensionCollectionPrivate ZeitgeistExtensionCollectionPrivate;
41
#define ZEITGEIST_TYPE_EXTENSION (zeitgeist_extension_get_type ())
42
#define ZEITGEIST_EXTENSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ZEITGEIST_TYPE_EXTENSION, ZeitgeistExtension))
43
#define ZEITGEIST_EXTENSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ZEITGEIST_TYPE_EXTENSION, ZeitgeistExtensionClass))
44
#define ZEITGEIST_IS_EXTENSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ZEITGEIST_TYPE_EXTENSION))
45
#define ZEITGEIST_IS_EXTENSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ZEITGEIST_TYPE_EXTENSION))
46
#define ZEITGEIST_EXTENSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ZEITGEIST_TYPE_EXTENSION, ZeitgeistExtensionClass))
48
typedef struct _ZeitgeistExtension ZeitgeistExtension;
49
typedef struct _ZeitgeistExtensionClass ZeitgeistExtensionClass;
51
#define ZEITGEIST_TYPE_ENGINE (zeitgeist_engine_get_type ())
52
#define ZEITGEIST_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ZEITGEIST_TYPE_ENGINE, ZeitgeistEngine))
53
#define ZEITGEIST_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ZEITGEIST_TYPE_ENGINE, ZeitgeistEngineClass))
54
#define ZEITGEIST_IS_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ZEITGEIST_TYPE_ENGINE))
55
#define ZEITGEIST_IS_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ZEITGEIST_TYPE_ENGINE))
56
#define ZEITGEIST_ENGINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ZEITGEIST_TYPE_ENGINE, ZeitgeistEngineClass))
58
typedef struct _ZeitgeistEngine ZeitgeistEngine;
59
typedef struct _ZeitgeistEngineClass ZeitgeistEngineClass;
60
#define _g_ptr_array_unref0(var) ((var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL)))
62
#define ZEITGEIST_TYPE_EVENT (zeitgeist_event_get_type ())
63
#define ZEITGEIST_EVENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ZEITGEIST_TYPE_EVENT, ZeitgeistEvent))
64
#define ZEITGEIST_EVENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ZEITGEIST_TYPE_EVENT, ZeitgeistEventClass))
65
#define ZEITGEIST_IS_EVENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ZEITGEIST_TYPE_EVENT))
66
#define ZEITGEIST_IS_EVENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ZEITGEIST_TYPE_EVENT))
67
#define ZEITGEIST_EVENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ZEITGEIST_TYPE_EVENT, ZeitgeistEventClass))
69
typedef struct _ZeitgeistEvent ZeitgeistEvent;
70
typedef struct _ZeitgeistEventClass ZeitgeistEventClass;
72
#define ZEITGEIST_TYPE_EXTENSION_LOADER (zeitgeist_extension_loader_get_type ())
73
#define ZEITGEIST_EXTENSION_LOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ZEITGEIST_TYPE_EXTENSION_LOADER, ZeitgeistExtensionLoader))
74
#define ZEITGEIST_EXTENSION_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ZEITGEIST_TYPE_EXTENSION_LOADER, ZeitgeistExtensionLoaderClass))
75
#define ZEITGEIST_IS_EXTENSION_LOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ZEITGEIST_TYPE_EXTENSION_LOADER))
76
#define ZEITGEIST_IS_EXTENSION_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ZEITGEIST_TYPE_EXTENSION_LOADER))
77
#define ZEITGEIST_EXTENSION_LOADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ZEITGEIST_TYPE_EXTENSION_LOADER, ZeitgeistExtensionLoaderClass))
79
typedef struct _ZeitgeistExtensionLoader ZeitgeistExtensionLoader;
80
typedef struct _ZeitgeistExtensionLoaderClass ZeitgeistExtensionLoaderClass;
82
#define ZEITGEIST_TYPE_BUILTIN_EXTENSION (zeitgeist_builtin_extension_get_type ())
83
#define ZEITGEIST_BUILTIN_EXTENSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ZEITGEIST_TYPE_BUILTIN_EXTENSION, ZeitgeistBuiltinExtension))
84
#define ZEITGEIST_BUILTIN_EXTENSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ZEITGEIST_TYPE_BUILTIN_EXTENSION, ZeitgeistBuiltinExtensionClass))
85
#define ZEITGEIST_IS_BUILTIN_EXTENSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ZEITGEIST_TYPE_BUILTIN_EXTENSION))
86
#define ZEITGEIST_IS_BUILTIN_EXTENSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ZEITGEIST_TYPE_BUILTIN_EXTENSION))
87
#define ZEITGEIST_BUILTIN_EXTENSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ZEITGEIST_TYPE_BUILTIN_EXTENSION, ZeitgeistBuiltinExtensionClass))
89
typedef struct _ZeitgeistBuiltinExtension ZeitgeistBuiltinExtension;
90
typedef struct _ZeitgeistBuiltinExtensionClass ZeitgeistBuiltinExtensionClass;
91
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
92
#define _g_dir_close0(var) ((var == NULL) ? NULL : (var = (g_dir_close (var), NULL)))
93
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
95
#define ZEITGEIST_TYPE_MODULE_LOADER (zeitgeist_module_loader_get_type ())
96
#define ZEITGEIST_MODULE_LOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ZEITGEIST_TYPE_MODULE_LOADER, ZeitgeistModuleLoader))
97
#define ZEITGEIST_MODULE_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ZEITGEIST_TYPE_MODULE_LOADER, ZeitgeistModuleLoaderClass))
98
#define ZEITGEIST_IS_MODULE_LOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ZEITGEIST_TYPE_MODULE_LOADER))
99
#define ZEITGEIST_IS_MODULE_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ZEITGEIST_TYPE_MODULE_LOADER))
100
#define ZEITGEIST_MODULE_LOADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ZEITGEIST_TYPE_MODULE_LOADER, ZeitgeistModuleLoaderClass))
102
typedef struct _ZeitgeistModuleLoader ZeitgeistModuleLoader;
103
typedef struct _ZeitgeistModuleLoaderClass ZeitgeistModuleLoaderClass;
104
#define _g_free0(var) (var = (g_free (var), NULL))
106
struct _ZeitgeistExtensionCollection {
107
GObject parent_instance;
108
ZeitgeistExtensionCollectionPrivate * priv;
111
struct _ZeitgeistExtensionCollectionClass {
112
GObjectClass parent_class;
115
struct _ZeitgeistExtensionCollectionPrivate {
116
GPtrArray* extensions;
117
ZeitgeistEngine* _engine;
120
typedef GType (*ZeitgeistRegisterExtensionFunc) (GTypeModule* module);
122
static gpointer zeitgeist_extension_collection_parent_class = NULL;
124
GType zeitgeist_extension_collection_get_type (void) G_GNUC_CONST;
125
GType zeitgeist_extension_get_type (void) G_GNUC_CONST;
126
GType zeitgeist_engine_get_type (void) G_GNUC_CONST;
127
#define ZEITGEIST_EXTENSION_COLLECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), ZEITGEIST_TYPE_EXTENSION_COLLECTION, ZeitgeistExtensionCollectionPrivate))
129
ZEITGEIST_EXTENSION_COLLECTION_DUMMY_PROPERTY,
130
ZEITGEIST_EXTENSION_COLLECTION_ENGINE
132
static void _zeitgeist_extension_collection___lambda3_ (ZeitgeistExtensionCollection* self, ZeitgeistExtension* ext);
133
void zeitgeist_extension_unload (ZeitgeistExtension* self);
134
static void __zeitgeist_extension_collection___lambda3__gfunc (gconstpointer data, gpointer self);
135
ZeitgeistExtensionCollection* zeitgeist_extension_collection_new (ZeitgeistEngine* engine);
136
ZeitgeistExtensionCollection* zeitgeist_extension_collection_construct (GType object_type, ZeitgeistEngine* engine);
137
gchar** zeitgeist_extension_collection_get_extension_names (ZeitgeistExtensionCollection* self, int* result_length1);
138
static void _vala_array_add2 (gchar*** array, int* length, int* size, gchar* value);
139
static void _vala_array_add3 (gchar*** array, int* length, int* size, gchar* value);
140
GType zeitgeist_event_get_type (void) G_GNUC_CONST;
141
void zeitgeist_extension_collection_call_pre_insert_events (ZeitgeistExtensionCollection* self, GPtrArray* events, const char* sender);
142
void zeitgeist_extension_pre_insert_events (ZeitgeistExtension* self, GPtrArray* events, const char* sender);
143
void zeitgeist_extension_collection_call_post_insert_events (ZeitgeistExtensionCollection* self, GPtrArray* events, const char* sender);
144
void zeitgeist_extension_post_insert_events (ZeitgeistExtension* self, GPtrArray* events, const char* sender);
145
guint32* zeitgeist_extension_collection_call_pre_delete_events (ZeitgeistExtensionCollection* self, guint32* event_ids, int event_ids_length1, const char* sender, int* result_length1);
146
guint32* zeitgeist_extension_pre_delete_events (ZeitgeistExtension* self, guint32* ids, int ids_length1, const char* sender, int* result_length1);
147
void zeitgeist_extension_collection_call_post_delete_events (ZeitgeistExtensionCollection* self, guint32* event_ids, int event_ids_length1, const char* sender);
148
void zeitgeist_extension_post_delete_events (ZeitgeistExtension* self, guint32* ids, int ids_length1, const char* sender);
149
ZeitgeistEngine* zeitgeist_extension_collection_get_engine (ZeitgeistExtensionCollection* self);
150
static void zeitgeist_extension_collection_set_engine (ZeitgeistExtensionCollection* self, ZeitgeistEngine* value);
151
static GObject * zeitgeist_extension_collection_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
152
static void _g_object_unref0_ (gpointer var);
153
GType zeitgeist_data_source_registry_init (GTypeModule* mod);
154
static GType _zeitgeist_data_source_registry_init_zeitgeist_register_extension_func (GTypeModule* module);
155
GType zeitgeist_blacklist_init (GTypeModule* mod);
156
static GType _zeitgeist_blacklist_init_zeitgeist_register_extension_func (GTypeModule* module);
157
GType zeitgeist_histogram_init (GTypeModule* mod);
158
static GType _zeitgeist_histogram_init_zeitgeist_register_extension_func (GTypeModule* module);
159
GType zeitgeist_storage_monitor_init (GTypeModule* mod);
160
static GType _zeitgeist_storage_monitor_init_zeitgeist_register_extension_func (GTypeModule* module);
161
GType zeitgeist_fts_init (GTypeModule* mod);
162
static GType _zeitgeist_fts_init_zeitgeist_register_extension_func (GTypeModule* module);
163
ZeitgeistBuiltinExtension* zeitgeist_builtin_extension_new (ZeitgeistRegisterExtensionFunc func);
164
ZeitgeistBuiltinExtension* zeitgeist_builtin_extension_construct (GType object_type, ZeitgeistRegisterExtensionFunc func);
165
GType zeitgeist_extension_loader_get_type (void) G_GNUC_CONST;
166
GType zeitgeist_builtin_extension_get_type (void) G_GNUC_CONST;
167
ZeitgeistExtension* zeitgeist_extension_loader_create_instance (ZeitgeistExtensionLoader* self, ZeitgeistEngine* engine);
168
const gchar* zeitgeist_utils_get_local_extensions_path (void);
169
ZeitgeistModuleLoader* zeitgeist_module_loader_new (const gchar* module_path);
170
ZeitgeistModuleLoader* zeitgeist_module_loader_construct (GType object_type, const gchar* module_path);
171
GType zeitgeist_module_loader_get_type (void) G_GNUC_CONST;
172
static void zeitgeist_extension_collection_finalize (GObject* obj);
173
static void _vala_zeitgeist_extension_collection_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
174
static void _vala_zeitgeist_extension_collection_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
175
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
176
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
179
static void _zeitgeist_extension_collection___lambda3_ (ZeitgeistExtensionCollection* self, ZeitgeistExtension* ext) {
180
ZeitgeistExtension* _tmp0_;
181
g_return_if_fail (ext != NULL);
183
zeitgeist_extension_unload (_tmp0_);
187
static void __zeitgeist_extension_collection___lambda3__gfunc (gconstpointer data, gpointer self) {
188
_zeitgeist_extension_collection___lambda3_ (self, data);
192
ZeitgeistExtensionCollection* zeitgeist_extension_collection_construct (GType object_type, ZeitgeistEngine* engine) {
193
ZeitgeistExtensionCollection * self = NULL;
194
ZeitgeistEngine* _tmp0_;
195
g_return_val_if_fail (engine != NULL, NULL);
197
self = (ZeitgeistExtensionCollection*) g_object_new (object_type, "engine", _tmp0_, NULL);
202
ZeitgeistExtensionCollection* zeitgeist_extension_collection_new (ZeitgeistEngine* engine) {
203
return zeitgeist_extension_collection_construct (ZEITGEIST_TYPE_EXTENSION_COLLECTION, engine);
207
static gint g_ptr_array_get_length (GPtrArray* self) {
210
g_return_val_if_fail (self != NULL, 0);
212
result = (gint) _tmp0_;
217
static void g_ptr_array_set_length (GPtrArray* self, gint value) {
219
g_return_if_fail (self != NULL);
221
g_ptr_array_set_size (self, _tmp0_);
225
static glong string_strnlen (gchar* str, glong maxlen) {
229
gchar* _tmp2_ = NULL;
234
_tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_);
237
if (_tmp3_ == NULL) {
247
result = (glong) (_tmp5_ - _tmp6_);
253
static gchar* string_substring (const gchar* self, glong offset, glong len) {
254
gchar* result = NULL;
255
glong string_length = 0L;
256
gboolean _tmp0_ = FALSE;
266
gchar* _tmp23_ = NULL;
267
g_return_val_if_fail (self != NULL, NULL);
269
if (_tmp1_ >= ((glong) 0)) {
272
_tmp0_ = _tmp2_ >= ((glong) 0);
283
_tmp6_ = string_strnlen ((gchar*) self, _tmp4_ + _tmp5_);
284
string_length = _tmp6_;
288
_tmp7_ = strlen (self);
290
string_length = (glong) _tmp8_;
293
if (_tmp9_ < ((glong) 0)) {
297
_tmp10_ = string_length;
299
offset = _tmp10_ + _tmp11_;
301
g_return_val_if_fail (_tmp12_ >= ((glong) 0), NULL);
306
_tmp14_ = string_length;
307
g_return_val_if_fail (_tmp13_ <= _tmp14_, NULL);
310
if (_tmp15_ < ((glong) 0)) {
313
_tmp16_ = string_length;
315
len = _tmp16_ - _tmp17_;
319
_tmp20_ = string_length;
320
g_return_val_if_fail ((_tmp18_ + _tmp19_) <= _tmp20_, NULL);
323
_tmp23_ = g_strndup (((gchar*) self) + _tmp21_, (gsize) _tmp22_);
329
static void _vala_array_add2 (gchar*** array, int* length, int* size, gchar* value) {
330
if ((*length) == (*size)) {
331
*size = (*size) ? (2 * (*size)) : 4;
332
*array = g_renew (gchar*, *array, (*size) + 1);
334
(*array)[(*length)++] = value;
335
(*array)[*length] = NULL;
339
static void _vala_array_add3 (gchar*** array, int* length, int* size, gchar* value) {
340
if ((*length) == (*size)) {
341
*size = (*size) ? (2 * (*size)) : 4;
342
*array = g_renew (gchar*, *array, (*size) + 1);
344
(*array)[(*length)++] = value;
345
(*array)[*length] = NULL;
349
gchar** zeitgeist_extension_collection_get_extension_names (ZeitgeistExtensionCollection* self, int* result_length1) {
350
gchar** result = NULL;
351
gchar** _tmp0_ = NULL;
353
gint _result__length1;
354
gint __result__size_;
356
gint _tmp21__length1;
357
g_return_val_if_fail (self != NULL, NULL);
358
_tmp0_ = g_new0 (gchar*, 0 + 1);
360
_result__length1 = 0;
361
__result__size_ = _result__length1;
376
gconstpointer _tmp10_ = NULL;
378
const gchar* _tmp12_ = NULL;
379
const gchar* ext_name;
380
const gchar* _tmp13_;
381
gboolean _tmp14_ = FALSE;
390
_tmp5_ = self->priv->extensions;
391
_tmp6_ = g_ptr_array_get_length (_tmp5_);
393
if (!(_tmp4_ < _tmp7_)) {
396
_tmp8_ = self->priv->extensions;
398
_tmp10_ = g_ptr_array_index (_tmp8_, (guint) _tmp9_);
399
_tmp11_ = G_TYPE_FROM_INSTANCE ((GObject*) ((ZeitgeistExtension*) _tmp10_));
400
_tmp12_ = g_type_name (_tmp11_);
403
_tmp14_ = g_str_has_prefix (_tmp13_, "Zeitgeist");
406
gint _tmp15__length1;
407
const gchar* _tmp16_;
408
gchar* _tmp17_ = NULL;
410
_tmp15__length1 = _result__length1;
412
_tmp17_ = string_substring (_tmp16_, (glong) 9, (glong) (-1));
413
_vala_array_add2 (&_result_, &_result__length1, &__result__size_, _tmp17_);
416
gint _tmp18__length1;
417
const gchar* _tmp19_;
420
_tmp18__length1 = _result__length1;
422
_tmp20_ = g_strdup (_tmp19_);
423
_vala_array_add3 (&_result_, &_result__length1, &__result__size_, _tmp20_);
429
_tmp21__length1 = _result__length1;
430
if (result_length1) {
431
*result_length1 = _tmp21__length1;
438
void zeitgeist_extension_collection_call_pre_insert_events (ZeitgeistExtensionCollection* self, GPtrArray* events, const char* sender) {
447
g_return_if_fail (self != NULL);
448
g_return_if_fail (events != NULL);
450
_tmp1_ = g_ptr_array_get_length (_tmp0_);
467
gconstpointer _tmp12_ = NULL;
478
_tmp7_ = self->priv->extensions;
479
_tmp8_ = g_ptr_array_get_length (_tmp7_);
481
if (!(_tmp6_ < _tmp9_)) {
484
_tmp10_ = self->priv->extensions;
486
_tmp12_ = g_ptr_array_index (_tmp10_, (guint) _tmp11_);
489
zeitgeist_extension_pre_insert_events ((ZeitgeistExtension*) _tmp12_, _tmp13_, _tmp14_);
493
_tmp15_ = num_events;
495
_tmp17_ = g_ptr_array_get_length (_tmp16_);
497
g_assert (_tmp15_ == _tmp18_);
501
void zeitgeist_extension_collection_call_post_insert_events (ZeitgeistExtensionCollection* self, GPtrArray* events, const char* sender) {
510
g_return_if_fail (self != NULL);
511
g_return_if_fail (events != NULL);
513
_tmp1_ = g_ptr_array_get_length (_tmp0_);
530
gconstpointer _tmp12_ = NULL;
541
_tmp7_ = self->priv->extensions;
542
_tmp8_ = g_ptr_array_get_length (_tmp7_);
544
if (!(_tmp6_ < _tmp9_)) {
547
_tmp10_ = self->priv->extensions;
549
_tmp12_ = g_ptr_array_index (_tmp10_, (guint) _tmp11_);
552
zeitgeist_extension_post_insert_events ((ZeitgeistExtension*) _tmp12_, _tmp13_, _tmp14_);
556
_tmp15_ = num_events;
558
_tmp17_ = g_ptr_array_get_length (_tmp16_);
560
g_assert (_tmp15_ == _tmp18_);
564
guint32* zeitgeist_extension_collection_call_pre_delete_events (ZeitgeistExtensionCollection* self, guint32* event_ids, int event_ids_length1, const char* sender, int* result_length1) {
565
guint32* result = NULL;
567
gint _tmp16__length1;
569
gint _tmp17__length1;
570
g_return_val_if_fail (self != NULL, NULL);
585
gconstpointer _tmp9_ = NULL;
587
gint _tmp10__length1;
590
guint32* _tmp13_ = NULL;
591
guint32* filtered_ids;
592
gint filtered_ids_length1;
593
gint _filtered_ids_size_;
595
gint _tmp14__length1;
604
_tmp4_ = self->priv->extensions;
605
_tmp5_ = g_ptr_array_get_length (_tmp4_);
607
if (!(_tmp3_ < _tmp6_)) {
610
_tmp7_ = self->priv->extensions;
612
_tmp9_ = g_ptr_array_index (_tmp7_, (guint) _tmp8_);
614
_tmp10__length1 = event_ids_length1;
616
_tmp13_ = zeitgeist_extension_pre_delete_events ((ZeitgeistExtension*) _tmp9_, _tmp10_, _tmp10__length1, _tmp11_, &_tmp12_);
617
filtered_ids = _tmp13_;
618
filtered_ids_length1 = _tmp12_;
619
_filtered_ids_size_ = filtered_ids_length1;
620
_tmp14_ = filtered_ids;
621
_tmp14__length1 = filtered_ids_length1;
622
if (_tmp14_ != NULL) {
624
gint _tmp15__length1;
625
_tmp15_ = filtered_ids;
626
_tmp15__length1 = filtered_ids_length1;
628
event_ids_length1 = _tmp15__length1;
630
filtered_ids = (g_free (filtered_ids), NULL);
635
_tmp16__length1 = event_ids_length1;
637
_tmp17__length1 = _tmp16__length1;
638
if (result_length1) {
639
*result_length1 = _tmp17__length1;
646
void zeitgeist_extension_collection_call_post_delete_events (ZeitgeistExtensionCollection* self, guint32* event_ids, int event_ids_length1, const char* sender) {
647
g_return_if_fail (self != NULL);
662
gconstpointer _tmp9_ = NULL;
664
gint _tmp10__length1;
674
_tmp4_ = self->priv->extensions;
675
_tmp5_ = g_ptr_array_get_length (_tmp4_);
677
if (!(_tmp3_ < _tmp6_)) {
680
_tmp7_ = self->priv->extensions;
682
_tmp9_ = g_ptr_array_index (_tmp7_, (guint) _tmp8_);
684
_tmp10__length1 = event_ids_length1;
686
zeitgeist_extension_post_delete_events ((ZeitgeistExtension*) _tmp9_, _tmp10_, _tmp10__length1, _tmp11_);
693
ZeitgeistEngine* zeitgeist_extension_collection_get_engine (ZeitgeistExtensionCollection* self) {
694
ZeitgeistEngine* result;
695
ZeitgeistEngine* _tmp0_;
696
g_return_val_if_fail (self != NULL, NULL);
697
_tmp0_ = self->priv->_engine;
703
static void zeitgeist_extension_collection_set_engine (ZeitgeistExtensionCollection* self, ZeitgeistEngine* value) {
704
ZeitgeistEngine* _tmp0_;
705
g_return_if_fail (self != NULL);
707
self->priv->_engine = _tmp0_;
708
g_object_notify ((GObject *) self, "engine");
712
static void _g_object_unref0_ (gpointer var) {
713
(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
717
static GType _zeitgeist_data_source_registry_init_zeitgeist_register_extension_func (GTypeModule* module) {
719
result = zeitgeist_data_source_registry_init (module);
724
static GType _zeitgeist_blacklist_init_zeitgeist_register_extension_func (GTypeModule* module) {
726
result = zeitgeist_blacklist_init (module);
731
static GType _zeitgeist_histogram_init_zeitgeist_register_extension_func (GTypeModule* module) {
733
result = zeitgeist_histogram_init (module);
738
static GType _zeitgeist_storage_monitor_init_zeitgeist_register_extension_func (GTypeModule* module) {
740
result = zeitgeist_storage_monitor_init (module);
745
static GType _zeitgeist_fts_init_zeitgeist_register_extension_func (GTypeModule* module) {
747
result = zeitgeist_fts_init (module);
752
static gpointer _g_object_ref0 (gpointer self) {
753
return self ? g_object_ref (self) : NULL;
757
static GObject * zeitgeist_extension_collection_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
759
GObjectClass * parent_class;
760
ZeitgeistExtensionCollection * self;
761
ZeitgeistExtension* extension = NULL;
763
ZeitgeistRegisterExtensionFunc* _tmp1_ = NULL;
764
ZeitgeistRegisterExtensionFunc* builtins;
765
gint builtins_length1;
766
gint _builtins_size_;
767
ZeitgeistRegisterExtensionFunc* _tmp2_;
769
const gchar* _tmp12_ = NULL;
770
const gchar* ext_dir1;
771
const gchar* _tmp13_;
772
gboolean _tmp14_ = FALSE;
773
GDir* user_ext_dir = NULL;
775
GError * _inner_error_ = NULL;
776
parent_class = G_OBJECT_CLASS (zeitgeist_extension_collection_parent_class);
777
obj = parent_class->constructor (type, n_construct_properties, construct_properties);
778
self = ZEITGEIST_EXTENSION_COLLECTION (obj);
779
_tmp0_ = g_ptr_array_new_with_free_func (_g_object_unref0_);
780
_g_ptr_array_unref0 (self->priv->extensions);
781
self->priv->extensions = _tmp0_;
782
_tmp1_ = g_new0 (ZeitgeistRegisterExtensionFunc, 5);
783
_tmp1_[0] = _zeitgeist_data_source_registry_init_zeitgeist_register_extension_func;
784
_tmp1_[1] = _zeitgeist_blacklist_init_zeitgeist_register_extension_func;
785
_tmp1_[2] = _zeitgeist_histogram_init_zeitgeist_register_extension_func;
786
_tmp1_[3] = _zeitgeist_storage_monitor_init_zeitgeist_register_extension_func;
787
_tmp1_[4] = _zeitgeist_fts_init_zeitgeist_register_extension_func;
789
builtins_length1 = 5;
790
_builtins_size_ = builtins_length1;
792
_tmp2__length1 = builtins_length1;
794
ZeitgeistRegisterExtensionFunc* func_collection = NULL;
795
gint func_collection_length1 = 0;
796
gint _func_collection_size_ = 0;
798
func_collection = _tmp2_;
799
func_collection_length1 = _tmp2__length1;
800
for (func_it = 0; func_it < _tmp2__length1; func_it = func_it + 1) {
801
ZeitgeistRegisterExtensionFunc func = NULL;
802
func = func_collection[func_it];
804
ZeitgeistRegisterExtensionFunc _tmp3_;
805
ZeitgeistBuiltinExtension* _tmp4_;
806
ZeitgeistExtensionLoader* builtin;
807
ZeitgeistExtensionLoader* _tmp5_;
808
ZeitgeistEngine* _tmp6_;
809
ZeitgeistExtension* _tmp7_ = NULL;
810
ZeitgeistExtension* _tmp8_;
812
_tmp4_ = zeitgeist_builtin_extension_new (_tmp3_);
813
builtin = (ZeitgeistExtensionLoader*) _tmp4_;
815
_tmp6_ = self->priv->_engine;
816
_tmp7_ = zeitgeist_extension_loader_create_instance (_tmp5_, _tmp6_);
817
_g_object_unref0 (extension);
820
if (_tmp8_ != NULL) {
822
ZeitgeistExtension* _tmp10_;
823
ZeitgeistExtension* _tmp11_;
824
_tmp9_ = self->priv->extensions;
826
_tmp11_ = _g_object_ref0 (_tmp10_);
827
g_ptr_array_add (_tmp9_, _tmp11_);
829
_g_object_unref0 (builtin);
833
_tmp12_ = zeitgeist_utils_get_local_extensions_path ();
836
_tmp14_ = g_file_test (_tmp13_, G_FILE_TEST_IS_DIR | G_FILE_TEST_EXISTS);
838
builtins = (g_free (builtins), NULL);
839
_g_object_unref0 (extension);
843
const gchar* _tmp15_;
844
GDir* _tmp16_ = NULL;
847
_tmp16_ = g_dir_open (_tmp15_, (guint) 0, &_inner_error_);
849
if (_inner_error_ != NULL) {
850
goto __catch7_g_error;
852
_g_dir_close0 (user_ext_dir);
853
user_ext_dir = _tmp17_;
860
const gchar* _tmp19_;
862
_inner_error_ = NULL;
864
_tmp19_ = _tmp18_->message;
865
g_warning ("extension-collection.vala:74: Couldn't open local extensions directory" \
870
if (_inner_error_ != NULL) {
871
_g_dir_close0 (user_ext_dir);
872
builtins = (g_free (builtins), NULL);
873
_g_object_unref0 (extension);
874
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);
875
g_clear_error (&_inner_error_);
877
_tmp20_ = user_ext_dir;
878
if (_tmp20_ != NULL) {
880
const gchar* _tmp22_ = NULL;
881
const gchar* file_name;
882
_tmp21_ = user_ext_dir;
883
_tmp22_ = g_dir_read_name (_tmp21_);
886
const gchar* _tmp23_;
887
const gchar* _tmp24_;
888
gboolean _tmp25_ = FALSE;
890
const gchar* _tmp42_ = NULL;
892
if (!(_tmp23_ != NULL)) {
896
_tmp25_ = g_str_has_suffix (_tmp24_, ".so");
898
const gchar* _tmp26_;
899
const gchar* _tmp27_;
900
gchar* _tmp28_ = NULL;
902
const gchar* _tmp29_;
903
const gchar* _tmp30_;
904
ZeitgeistModuleLoader* _tmp31_;
905
ZeitgeistModuleLoader* loader;
906
ZeitgeistModuleLoader* _tmp32_;
907
ZeitgeistEngine* _tmp33_;
908
ZeitgeistExtension* _tmp34_ = NULL;
909
ZeitgeistExtension* _tmp35_;
912
_tmp28_ = g_build_filename (_tmp26_, _tmp27_, NULL);
915
g_debug ("extension-collection.vala:85: Loading extension: \"%s\"", _tmp29_);
917
_tmp31_ = zeitgeist_module_loader_new (_tmp30_);
920
_tmp33_ = self->priv->_engine;
921
_tmp34_ = zeitgeist_extension_loader_create_instance ((ZeitgeistExtensionLoader*) _tmp32_, _tmp33_);
922
_g_object_unref0 (extension);
925
if (_tmp35_ != NULL) {
927
ZeitgeistExtension* _tmp37_;
928
ZeitgeistExtension* _tmp38_;
929
_tmp36_ = self->priv->extensions;
931
_tmp38_ = _g_object_ref0 (_tmp37_);
932
g_ptr_array_add (_tmp36_, _tmp38_);
934
_g_object_unref0 (loader);
937
const gchar* _tmp39_;
938
const gchar* _tmp40_;
941
g_debug ("extension-collection.vala:93: Ignored file \"%s/%s\"", _tmp39_, _tmp40_);
943
_tmp41_ = user_ext_dir;
944
_tmp42_ = g_dir_read_name (_tmp41_);
948
_g_dir_close0 (user_ext_dir);
949
builtins = (g_free (builtins), NULL);
950
_g_object_unref0 (extension);
955
static void zeitgeist_extension_collection_class_init (ZeitgeistExtensionCollectionClass * klass) {
956
zeitgeist_extension_collection_parent_class = g_type_class_peek_parent (klass);
957
g_type_class_add_private (klass, sizeof (ZeitgeistExtensionCollectionPrivate));
958
G_OBJECT_CLASS (klass)->get_property = _vala_zeitgeist_extension_collection_get_property;
959
G_OBJECT_CLASS (klass)->set_property = _vala_zeitgeist_extension_collection_set_property;
960
G_OBJECT_CLASS (klass)->constructor = zeitgeist_extension_collection_constructor;
961
G_OBJECT_CLASS (klass)->finalize = zeitgeist_extension_collection_finalize;
962
g_object_class_install_property (G_OBJECT_CLASS (klass), ZEITGEIST_EXTENSION_COLLECTION_ENGINE, g_param_spec_object ("engine", "engine", "engine", ZEITGEIST_TYPE_ENGINE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
966
static void zeitgeist_extension_collection_instance_init (ZeitgeistExtensionCollection * self) {
967
self->priv = ZEITGEIST_EXTENSION_COLLECTION_GET_PRIVATE (self);
971
static void zeitgeist_extension_collection_finalize (GObject* obj) {
972
ZeitgeistExtensionCollection * self;
974
self = ZEITGEIST_EXTENSION_COLLECTION (obj);
975
_tmp0_ = self->priv->extensions;
976
g_ptr_array_foreach (_tmp0_, __zeitgeist_extension_collection___lambda3__gfunc, self);
977
_g_ptr_array_unref0 (self->priv->extensions);
978
G_OBJECT_CLASS (zeitgeist_extension_collection_parent_class)->finalize (obj);
982
GType zeitgeist_extension_collection_get_type (void) {
983
static volatile gsize zeitgeist_extension_collection_type_id__volatile = 0;
984
if (g_once_init_enter (&zeitgeist_extension_collection_type_id__volatile)) {
985
static const GTypeInfo g_define_type_info = { sizeof (ZeitgeistExtensionCollectionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) zeitgeist_extension_collection_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ZeitgeistExtensionCollection), 0, (GInstanceInitFunc) zeitgeist_extension_collection_instance_init, NULL };
986
GType zeitgeist_extension_collection_type_id;
987
zeitgeist_extension_collection_type_id = g_type_register_static (G_TYPE_OBJECT, "ZeitgeistExtensionCollection", &g_define_type_info, 0);
988
g_once_init_leave (&zeitgeist_extension_collection_type_id__volatile, zeitgeist_extension_collection_type_id);
990
return zeitgeist_extension_collection_type_id__volatile;
994
static void _vala_zeitgeist_extension_collection_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
995
ZeitgeistExtensionCollection * self;
996
self = ZEITGEIST_EXTENSION_COLLECTION (object);
997
switch (property_id) {
998
case ZEITGEIST_EXTENSION_COLLECTION_ENGINE:
999
g_value_set_object (value, zeitgeist_extension_collection_get_engine (self));
1002
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
1008
static void _vala_zeitgeist_extension_collection_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
1009
ZeitgeistExtensionCollection * self;
1010
self = ZEITGEIST_EXTENSION_COLLECTION (object);
1011
switch (property_id) {
1012
case ZEITGEIST_EXTENSION_COLLECTION_ENGINE:
1013
zeitgeist_extension_collection_set_engine (self, g_value_get_object (value));
1016
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
1022
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
1023
if ((array != NULL) && (destroy_func != NULL)) {
1025
for (i = 0; i < array_length; i = i + 1) {
1026
if (((gpointer*) array)[i] != NULL) {
1027
destroy_func (((gpointer*) array)[i]);
1034
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
1035
_vala_array_destroy (array, array_length, destroy_func);