1 /* tracker-miner-mock.c generated by valac 0.18.1, the Vala compiler
2 * generated from tracker-miner-mock.vala, do not modify */
3
4 /**/
5 /* Copyright (C) 2010, Nokia*/
6 /**/
7 /* This program is free software; you can redistribute it and/or*/
8 /* modify it under the terms of the GNU General Public License*/
9 /* as published by the Free Software Foundation; either version 2*/
10 /* of the License, or (at your option) any later version.*/
11 /**/
12 /* This program is distributed in the hope that it will be useful,*/
13 /* but WITHOUT ANY WARRANTY; without even the implied warranty of*/
14 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the*/
15 /* GNU General Public License for more details.*/
16 /**/
17 /* You should have received a copy of the GNU General Public License*/
18 /* along with this program; if not, write to the Free Software*/
19 /* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA*/
20 /* 02110-1301, USA.*/
21 /**/
22
23 #include <glib.h>
24 #include <glib-object.h>
25 #include <stdlib.h>
26 #include <string.h>
27 #include <float.h>
28 #include <math.h>
29
30
31 #define TYPE_TRACKER_MINER_MOCK (tracker_miner_mock_get_type ())
32 #define TRACKER_MINER_MOCK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TRACKER_MINER_MOCK, TrackerMinerMock))
33 #define TRACKER_MINER_MOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TRACKER_MINER_MOCK, TrackerMinerMockClass))
34 #define IS_TRACKER_MINER_MOCK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TRACKER_MINER_MOCK))
35 #define IS_TRACKER_MINER_MOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TRACKER_MINER_MOCK))
36 #define TRACKER_MINER_MOCK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TRACKER_MINER_MOCK, TrackerMinerMockClass))
37
38 typedef struct _TrackerMinerMock TrackerMinerMock;
39 typedef struct _TrackerMinerMockClass TrackerMinerMockClass;
40 typedef struct _TrackerMinerMockPrivate TrackerMinerMockPrivate;
41 #define _g_free0(var) (var = (g_free (var), NULL))
42
43 struct _TrackerMinerMock {
44 GObject parent_instance;
45 TrackerMinerMockPrivate * priv;
46 gboolean is_paused;
47 };
48
49 struct _TrackerMinerMockClass {
50 GObjectClass parent_class;
51 };
52
53 struct _TrackerMinerMockPrivate {
54 gchar* _pause_reason;
55 gchar* _name;
56 gchar** _apps;
57 gint _apps_length1;
58 gint __apps_size_;
59 gchar** _reasons;
60 gint _reasons_length1;
61 gint __reasons_size_;
62 };
63
64
65 static gpointer tracker_miner_mock_parent_class = NULL;
66
67 GType tracker_miner_mock_get_type (void) G_GNUC_CONST;
68 #define TRACKER_MINER_MOCK_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_TRACKER_MINER_MOCK, TrackerMinerMockPrivate))
69 enum {
70 TRACKER_MINER_MOCK_DUMMY_PROPERTY,
71 TRACKER_MINER_MOCK_PAUSE_REASON,
72 TRACKER_MINER_MOCK_NAME,
73 TRACKER_MINER_MOCK_APPS,
74 TRACKER_MINER_MOCK_REASONS
75 };
76 TrackerMinerMock* tracker_miner_mock_new (const gchar* name);
77 TrackerMinerMock* tracker_miner_mock_construct (GType object_type, const gchar* name);
78 void tracker_miner_mock_set_name (TrackerMinerMock* self, const gchar* value);
79 void tracker_miner_mock_set_paused (TrackerMinerMock* self, gboolean paused);
80 gboolean tracker_miner_mock_get_paused (TrackerMinerMock* self);
81 void tracker_miner_mock_pause (TrackerMinerMock* self, const gchar* app, const gchar* reason);
82 static void _vala_array_add1 (gchar*** array, int* length, int* size, gchar* value);
83 static void _vala_array_add2 (gchar*** array, int* length, int* size, gchar* value);
84 void tracker_miner_mock_resume (TrackerMinerMock* self);
85 const gchar* tracker_miner_mock_get_pause_reason (TrackerMinerMock* self);
86 void tracker_miner_mock_set_pause_reason (TrackerMinerMock* self, const gchar* value);
87 const gchar* tracker_miner_mock_get_name (TrackerMinerMock* self);
88 gchar** tracker_miner_mock_get_apps (TrackerMinerMock* self, int* result_length1);
89 gchar** tracker_miner_mock_get_reasons (TrackerMinerMock* self, int* result_length1);
90 static void g_cclosure_user_marshal_VOID__STRING_STRING_DOUBLE (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
91 static void tracker_miner_mock_finalize (GObject* obj);
92 static void _vala_tracker_miner_mock_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
93 static void _vala_tracker_miner_mock_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
94 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
95 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
96
97
98 TrackerMinerMock* tracker_miner_mock_construct (GType object_type, const gchar* name) {
99 TrackerMinerMock * self = NULL;
100 const gchar* _tmp0_;
101 gchar** _tmp1_ = NULL;
102 gchar** _tmp2_ = NULL;
103 #line 37 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
104 g_return_val_if_fail (name != NULL, NULL);
105 #line 37 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
106 self = (TrackerMinerMock*) g_object_new (object_type, NULL);
107 #line 38 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
108 _tmp0_ = name;
109 #line 38 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
110 tracker_miner_mock_set_name (self, _tmp0_);
111 #line 39 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
112 _tmp1_ = g_new0 (gchar*, 0 + 1);
113 #line 39 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
114 self->priv->_apps = (_vala_array_free (self->priv->_apps, self->priv->_apps_length1, (GDestroyNotify) g_free), NULL);
115 #line 39 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
116 self->priv->_apps = _tmp1_;
117 #line 39 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
118 self->priv->_apps_length1 = 0;
119 #line 39 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
120 self->priv->__apps_size_ = self->priv->_apps_length1;
121 #line 40 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
122 _tmp2_ = g_new0 (gchar*, 0 + 1);
123 #line 40 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
124 self->priv->_reasons = (_vala_array_free (self->priv->_reasons, self->priv->_reasons_length1, (GDestroyNotify) g_free), NULL);
125 #line 40 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
126 self->priv->_reasons = _tmp2_;
127 #line 40 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
128 self->priv->_reasons_length1 = 0;
129 #line 40 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
130 self->priv->__reasons_size_ = self->priv->_reasons_length1;
131 #line 37 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
132 return self;
133 #line 134 "tracker-miner-mock.c"
134 }
135
136
137 TrackerMinerMock* tracker_miner_mock_new (const gchar* name) {
138 #line 37 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
139 return tracker_miner_mock_construct (TYPE_TRACKER_MINER_MOCK, name);
140 #line 141 "tracker-miner-mock.c"
141 }
142
143
144 void tracker_miner_mock_set_paused (TrackerMinerMock* self, gboolean paused) {
145 gboolean _tmp0_;
146 #line 43 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
147 g_return_if_fail (self != NULL);
148 #line 43 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
149 _tmp0_ = paused;
150 #line 43 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
151 self->is_paused = _tmp0_;
152 #line 153 "tracker-miner-mock.c"
153 }
154
155
156 gboolean tracker_miner_mock_get_paused (TrackerMinerMock* self) {
157 gboolean result = FALSE;
158 gboolean _tmp0_;
159 #line 44 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
160 g_return_val_if_fail (self != NULL, FALSE);
161 #line 44 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
162 _tmp0_ = self->is_paused;
163 #line 44 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
164 result = _tmp0_;
165 #line 44 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
166 return result;
167 #line 168 "tracker-miner-mock.c"
168 }
169
170
171 static void _vala_array_add1 (gchar*** array, int* length, int* size, gchar* value) {
172 #line 51 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
173 if ((*length) == (*size)) {
174 #line 51 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
175 *size = (*size) ? (2 * (*size)) : 4;
176 #line 51 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
177 *array = g_renew (gchar*, *array, (*size) + 1);
178 #line 179 "tracker-miner-mock.c"
179 }
180 #line 51 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
181 (*array)[(*length)++] = value;
182 #line 51 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
183 (*array)[*length] = NULL;
184 #line 185 "tracker-miner-mock.c"
185 }
186
187
188 static void _vala_array_add2 (gchar*** array, int* length, int* size, gchar* value) {
189 #line 57 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
190 if ((*length) == (*size)) {
191 #line 57 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
192 *size = (*size) ? (2 * (*size)) : 4;
193 #line 57 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
194 *array = g_renew (gchar*, *array, (*size) + 1);
195 #line 196 "tracker-miner-mock.c"
196 }
197 #line 57 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
198 (*array)[(*length)++] = value;
199 #line 57 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
200 (*array)[*length] = NULL;
201 #line 202 "tracker-miner-mock.c"
202 }
203
204
205 void tracker_miner_mock_pause (TrackerMinerMock* self, const gchar* app, const gchar* reason) {
206 gchar** _tmp0_;
207 gint _tmp0__length1;
208 gchar** _tmp7_;
209 gint _tmp7__length1;
210 #line 46 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
211 g_return_if_fail (self != NULL);
212 #line 46 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
213 g_return_if_fail (app != NULL);
214 #line 46 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
215 g_return_if_fail (reason != NULL);
216 #line 48 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
217 _tmp0_ = self->priv->_apps;
218 #line 48 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
219 _tmp0__length1 = self->priv->_apps_length1;
220 #line 48 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
221 if (_tmp0__length1 == 0) {
222 #line 223 "tracker-miner-mock.c"
223 const gchar* _tmp1_;
224 gchar* _tmp2_;
225 gchar** _tmp3_ = NULL;
226 #line 49 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
227 _tmp1_ = app;
228 #line 49 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
229 _tmp2_ = g_strdup (_tmp1_);
230 #line 49 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
231 _tmp3_ = g_new0 (gchar*, 1 + 1);
232 #line 49 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
233 _tmp3_[0] = _tmp2_;
234 #line 49 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
235 self->priv->_apps = (_vala_array_free (self->priv->_apps, self->priv->_apps_length1, (GDestroyNotify) g_free), NULL);
236 #line 49 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
237 self->priv->_apps = _tmp3_;
238 #line 49 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
239 self->priv->_apps_length1 = 1;
240 #line 49 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
241 self->priv->__apps_size_ = self->priv->_apps_length1;
242 #line 243 "tracker-miner-mock.c"
243 } else {
244 gchar** _tmp4_;
245 gint _tmp4__length1;
variable '_tmp4__length1' set but not used
(emitted by gcc)
246 const gchar* _tmp5_;
247 gchar* _tmp6_;
248 #line 51 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
249 _tmp4_ = self->priv->_apps;
250 #line 51 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
251 _tmp4__length1 = self->priv->_apps_length1;
252 #line 51 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
253 _tmp5_ = app;
254 #line 51 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
255 _tmp6_ = g_strdup (_tmp5_);
256 #line 51 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
257 _vala_array_add1 (&self->priv->_apps, &self->priv->_apps_length1, &self->priv->__apps_size_, _tmp6_);
258 #line 259 "tracker-miner-mock.c"
259 }
260 #line 54 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
261 _tmp7_ = self->priv->_reasons;
262 #line 54 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
263 _tmp7__length1 = self->priv->_reasons_length1;
264 #line 54 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
265 if (_tmp7__length1 == 0) {
266 #line 267 "tracker-miner-mock.c"
267 const gchar* _tmp8_;
268 gchar* _tmp9_;
269 gchar** _tmp10_ = NULL;
270 #line 55 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
271 _tmp8_ = reason;
272 #line 55 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
273 _tmp9_ = g_strdup (_tmp8_);
274 #line 55 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
275 _tmp10_ = g_new0 (gchar*, 1 + 1);
276 #line 55 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
277 _tmp10_[0] = _tmp9_;
278 #line 55 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
279 self->priv->_reasons = (_vala_array_free (self->priv->_reasons, self->priv->_reasons_length1, (GDestroyNotify) g_free), NULL);
280 #line 55 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
281 self->priv->_reasons = _tmp10_;
282 #line 55 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
283 self->priv->_reasons_length1 = 1;
284 #line 55 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
285 self->priv->__reasons_size_ = self->priv->_reasons_length1;
286 #line 287 "tracker-miner-mock.c"
287 } else {
288 gchar** _tmp11_;
289 gint _tmp11__length1;
290 const gchar* _tmp12_;
291 gchar* _tmp13_;
292 #line 57 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
293 _tmp11_ = self->priv->_reasons;
294 #line 57 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
295 _tmp11__length1 = self->priv->_reasons_length1;
296 #line 57 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
297 _tmp12_ = reason;
298 #line 57 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
299 _tmp13_ = g_strdup (_tmp12_);
300 #line 57 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
301 _vala_array_add2 (&self->priv->_reasons, &self->priv->_reasons_length1, &self->priv->__reasons_size_, _tmp13_);
302 #line 303 "tracker-miner-mock.c"
303 }
304 #line 59 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
305 self->is_paused = TRUE;
306 #line 60 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
307 g_signal_emit_by_name (self, "paused");
308 #line 309 "tracker-miner-mock.c"
309 }
310
311
312 void tracker_miner_mock_resume (TrackerMinerMock* self) {
313 #line 63 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
314 g_return_if_fail (self != NULL);
315 #line 64 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
316 self->priv->_apps = (_vala_array_free (self->priv->_apps, self->priv->_apps_length1, (GDestroyNotify) g_free), NULL);
317 #line 64 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
318 self->priv->_apps = NULL;
319 #line 64 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
320 self->priv->_apps_length1 = 0;
321 #line 64 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
322 self->priv->__apps_size_ = self->priv->_apps_length1;
323 #line 65 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
324 self->priv->_reasons = (_vala_array_free (self->priv->_reasons, self->priv->_reasons_length1, (GDestroyNotify) g_free), NULL);
325 #line 65 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
326 self->priv->_reasons = NULL;
327 #line 65 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
328 self->priv->_reasons_length1 = 0;
329 #line 65 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
330 self->priv->__reasons_size_ = self->priv->_reasons_length1;
331 #line 66 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
332 self->is_paused = FALSE;
333 #line 67 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
334 g_signal_emit_by_name (self, "resumed");
335 #line 336 "tracker-miner-mock.c"
336 }
337
338
339 const gchar* tracker_miner_mock_get_pause_reason (TrackerMinerMock* self) {
340 const gchar* result;
341 const gchar* _tmp0_;
342 #line 25 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
343 g_return_val_if_fail (self != NULL, NULL);
344 #line 25 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
345 _tmp0_ = self->priv->_pause_reason;
346 #line 25 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
347 result = _tmp0_;
348 #line 25 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
349 return result;
350 #line 351 "tracker-miner-mock.c"
351 }
352
353
354 void tracker_miner_mock_set_pause_reason (TrackerMinerMock* self, const gchar* value) {
355 const gchar* _tmp0_;
356 gchar* _tmp1_;
357 #line 25 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
358 g_return_if_fail (self != NULL);
359 #line 25 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
360 _tmp0_ = value;
361 #line 25 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
362 _tmp1_ = g_strdup (_tmp0_);
363 #line 25 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
364 _g_free0 (self->priv->_pause_reason);
365 #line 25 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
366 self->priv->_pause_reason = _tmp1_;
367 #line 25 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
368 g_object_notify ((GObject *) self, "pause-reason");
369 #line 370 "tracker-miner-mock.c"
370 }
371
372
373 const gchar* tracker_miner_mock_get_name (TrackerMinerMock* self) {
374 const gchar* result;
375 const gchar* _tmp0_;
376 #line 26 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
377 g_return_val_if_fail (self != NULL, NULL);
378 #line 26 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
379 _tmp0_ = self->priv->_name;
380 #line 26 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
381 result = _tmp0_;
382 #line 26 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
383 return result;
384 #line 385 "tracker-miner-mock.c"
385 }
386
387
388 void tracker_miner_mock_set_name (TrackerMinerMock* self, const gchar* value) {
389 const gchar* _tmp0_;
390 gchar* _tmp1_;
391 #line 26 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
392 g_return_if_fail (self != NULL);
393 #line 26 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
394 _tmp0_ = value;
395 #line 26 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
396 _tmp1_ = g_strdup (_tmp0_);
397 #line 26 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
398 _g_free0 (self->priv->_name);
399 #line 26 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
400 self->priv->_name = _tmp1_;
401 #line 26 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
402 g_object_notify ((GObject *) self, "name");
403 #line 404 "tracker-miner-mock.c"
404 }
405
406
407 gchar** tracker_miner_mock_get_apps (TrackerMinerMock* self, int* result_length1) {
408 gchar** result;
409 gchar** _tmp0_;
410 gint _tmp0__length1;
411 gchar** _tmp1_;
412 gint _tmp1__length1;
413 #line 27 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
414 g_return_val_if_fail (self != NULL, NULL);
415 #line 27 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
416 _tmp0_ = self->priv->_apps;
417 #line 27 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
418 _tmp0__length1 = self->priv->_apps_length1;
419 #line 27 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
420 _tmp1_ = _tmp0_;
421 #line 27 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
422 _tmp1__length1 = _tmp0__length1;
423 #line 27 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
424 if (result_length1) {
425 #line 27 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
426 *result_length1 = _tmp1__length1;
427 #line 428 "tracker-miner-mock.c"
428 }
429 #line 27 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
430 result = _tmp1_;
431 #line 27 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
432 return result;
433 #line 434 "tracker-miner-mock.c"
434 }
435
436
437 gchar** tracker_miner_mock_get_reasons (TrackerMinerMock* self, int* result_length1) {
438 gchar** result;
439 gchar** _tmp0_;
440 gint _tmp0__length1;
441 gchar** _tmp1_;
442 gint _tmp1__length1;
443 #line 28 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
444 g_return_val_if_fail (self != NULL, NULL);
445 #line 28 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
446 _tmp0_ = self->priv->_apps;
447 #line 28 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
448 _tmp0__length1 = self->priv->_apps_length1;
449 #line 28 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
450 _tmp1_ = _tmp0_;
451 #line 28 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
452 _tmp1__length1 = _tmp0__length1;
453 #line 28 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
454 if (result_length1) {
455 #line 28 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
456 *result_length1 = _tmp1__length1;
457 #line 458 "tracker-miner-mock.c"
458 }
459 #line 28 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
460 result = _tmp1_;
461 #line 28 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
462 return result;
463 #line 464 "tracker-miner-mock.c"
464 }
465
466
467 static void g_cclosure_user_marshal_VOID__STRING_STRING_DOUBLE (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
468 typedef void (*GMarshalFunc_VOID__STRING_STRING_DOUBLE) (gpointer data1, const char* arg_1, const char* arg_2, gdouble arg_3, gpointer data2);
469 register GMarshalFunc_VOID__STRING_STRING_DOUBLE callback;
470 register GCClosure * cc;
471 register gpointer data1;
472 register gpointer data2;
473 cc = (GCClosure *) closure;
474 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
475 g_return_if_fail (n_param_values == 4);
476 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
477 if (G_CCLOSURE_SWAP_DATA (closure)) {
478 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
479 data1 = closure->data;
480 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
481 data2 = param_values->data[0].v_pointer;
482 #line 483 "tracker-miner-mock.c"
483 } else {
484 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
485 data1 = param_values->data[0].v_pointer;
486 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
487 data2 = closure->data;
488 #line 489 "tracker-miner-mock.c"
489 }
490 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
491 callback = (GMarshalFunc_VOID__STRING_STRING_DOUBLE) (marshal_data ? marshal_data : cc->callback);
492 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
493 callback (data1, g_value_get_string (param_values + 1), g_value_get_string (param_values + 2), g_value_get_double (param_values + 3), data2);
494 #line 495 "tracker-miner-mock.c"
495 }
496
497
498 static void tracker_miner_mock_class_init (TrackerMinerMockClass * klass) {
499 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
500 tracker_miner_mock_parent_class = g_type_class_peek_parent (klass);
501 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
502 g_type_class_add_private (klass, sizeof (TrackerMinerMockPrivate));
503 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
504 G_OBJECT_CLASS (klass)->get_property = _vala_tracker_miner_mock_get_property;
505 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
506 G_OBJECT_CLASS (klass)->set_property = _vala_tracker_miner_mock_set_property;
507 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
508 G_OBJECT_CLASS (klass)->finalize = tracker_miner_mock_finalize;
509 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
510 g_object_class_install_property (G_OBJECT_CLASS (klass), TRACKER_MINER_MOCK_PAUSE_REASON, g_param_spec_string ("pause-reason", "pause-reason", "pause-reason", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
511 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
512 g_object_class_install_property (G_OBJECT_CLASS (klass), TRACKER_MINER_MOCK_NAME, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
513 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
514 g_object_class_install_property (G_OBJECT_CLASS (klass), TRACKER_MINER_MOCK_APPS, g_param_spec_boxed ("apps", "apps", "apps", G_TYPE_STRV, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
515 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
516 g_object_class_install_property (G_OBJECT_CLASS (klass), TRACKER_MINER_MOCK_REASONS, g_param_spec_boxed ("reasons", "reasons", "reasons", G_TYPE_STRV, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
517 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
518 g_signal_new ("progress", TYPE_TRACKER_MINER_MOCK, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_STRING_DOUBLE, G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_DOUBLE);
519 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
520 g_signal_new ("paused", TYPE_TRACKER_MINER_MOCK, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
521 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
522 g_signal_new ("resumed", TYPE_TRACKER_MINER_MOCK, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
523 #line 524 "tracker-miner-mock.c"
524 }
525
526
527 static void tracker_miner_mock_instance_init (TrackerMinerMock * self) {
528 gchar* _tmp0_;
529 gchar* _tmp1_;
530 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
531 self->priv = TRACKER_MINER_MOCK_GET_PRIVATE (self);
532 #line 25 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
533 _tmp0_ = g_strdup ("");
534 #line 25 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
535 self->priv->_pause_reason = _tmp0_;
536 #line 26 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
537 _tmp1_ = g_strdup ("");
538 #line 26 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
539 self->priv->_name = _tmp1_;
540 #line 541 "tracker-miner-mock.c"
541 }
542
543
544 static void tracker_miner_mock_finalize (GObject* obj) {
545 TrackerMinerMock * self;
546 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
547 self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_TRACKER_MINER_MOCK, TrackerMinerMock);
548 #line 25 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
549 _g_free0 (self->priv->_pause_reason);
550 #line 26 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
551 _g_free0 (self->priv->_name);
552 #line 34 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
553 self->priv->_apps = (_vala_array_free (self->priv->_apps, self->priv->_apps_length1, (GDestroyNotify) g_free), NULL);
554 #line 35 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
555 self->priv->_reasons = (_vala_array_free (self->priv->_reasons, self->priv->_reasons_length1, (GDestroyNotify) g_free), NULL);
556 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
557 G_OBJECT_CLASS (tracker_miner_mock_parent_class)->finalize (obj);
558 #line 559 "tracker-miner-mock.c"
559 }
560
561
562 GType tracker_miner_mock_get_type (void) {
563 static volatile gsize tracker_miner_mock_type_id__volatile = 0;
564 if (g_once_init_enter (&tracker_miner_mock_type_id__volatile)) {
565 static const GTypeInfo g_define_type_info = { sizeof (TrackerMinerMockClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tracker_miner_mock_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TrackerMinerMock), 0, (GInstanceInitFunc) tracker_miner_mock_instance_init, NULL };
566 GType tracker_miner_mock_type_id;
567 tracker_miner_mock_type_id = g_type_register_static (G_TYPE_OBJECT, "TrackerMinerMock", &g_define_type_info, 0);
568 g_once_init_leave (&tracker_miner_mock_type_id__volatile, tracker_miner_mock_type_id);
569 }
570 return tracker_miner_mock_type_id__volatile;
571 }
572
573
574 static void _vala_tracker_miner_mock_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
575 TrackerMinerMock * self;
576 self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_TRACKER_MINER_MOCK, TrackerMinerMock);
577 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
578 switch (property_id) {
579 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
580 case TRACKER_MINER_MOCK_PAUSE_REASON:
581 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
582 g_value_set_string (value, tracker_miner_mock_get_pause_reason (self));
583 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
584 break;
585 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
586 case TRACKER_MINER_MOCK_NAME:
587 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
588 g_value_set_string (value, tracker_miner_mock_get_name (self));
589 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
590 break;
591 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
592 case TRACKER_MINER_MOCK_APPS:
593 #line 594 "tracker-miner-mock.c"
594 {
595 int length;
596 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
597 g_value_set_boxed (value, tracker_miner_mock_get_apps (self, &length));
598 #line 599 "tracker-miner-mock.c"
599 }
600 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
601 break;
602 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
603 case TRACKER_MINER_MOCK_REASONS:
604 #line 605 "tracker-miner-mock.c"
605 {
606 int length;
607 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
608 g_value_set_boxed (value, tracker_miner_mock_get_reasons (self, &length));
609 #line 610 "tracker-miner-mock.c"
610 }
611 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
612 break;
613 #line 614 "tracker-miner-mock.c"
614 default:
615 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
616 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
617 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
618 break;
619 #line 620 "tracker-miner-mock.c"
620 }
621 }
622
623
624 static void _vala_tracker_miner_mock_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
625 TrackerMinerMock * self;
626 self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_TRACKER_MINER_MOCK, TrackerMinerMock);
627 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
628 switch (property_id) {
629 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
630 case TRACKER_MINER_MOCK_PAUSE_REASON:
631 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
632 tracker_miner_mock_set_pause_reason (self, g_value_get_string (value));
633 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
634 break;
635 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
636 case TRACKER_MINER_MOCK_NAME:
637 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
638 tracker_miner_mock_set_name (self, g_value_get_string (value));
639 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
640 break;
641 #line 642 "tracker-miner-mock.c"
642 default:
643 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
644 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
645 #line 22 "/home/martyn/Source/tracker/tests/libtracker-miner/tracker-miner-mock.vala"
646 break;
647 #line 648 "tracker-miner-mock.c"
648 }
649 }
650
651
652 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
653 if ((array != NULL) && (destroy_func != NULL)) {
654 int i;
655 for (i = 0; i < array_length; i = i + 1) {
656 if (((gpointer*) array)[i] != NULL) {
657 destroy_func (((gpointer*) array)[i]);
658 }
659 }
660 }
661 }
662
663
664 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
665 _vala_array_destroy (array, array_length, destroy_func);
666 g_free (array);
667 }