~ubuntu-branches/ubuntu/trusty/rygel/trusty

« back to all changes in this revision

Viewing changes to src/plugins/media-export/rygel-media-export-dbus-service.c

  • Committer: Package Import Robot
  • Author(s): Andreas Henriksson
  • Date: 2011-12-16 15:21:25 UTC
  • mfrom: (14.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20111216152125-qgn31dkfmhouhrf0
Upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* rygel-media-export-dbus-service.c generated by valac 0.12.0, the Vala compiler
 
1
/* rygel-media-export-dbus-service.c generated by valac 0.14.1, the Vala compiler
2
2
 * generated from rygel-media-export-dbus-service.vala, do not modify */
3
3
 
4
4
/*
23
23
 
24
24
#include <glib.h>
25
25
#include <glib-object.h>
 
26
#include <gio/gio.h>
26
27
#include <rygel.h>
27
28
#include <stdlib.h>
28
29
#include <string.h>
29
 
#include <gio/gio.h>
30
30
#include <glib/gi18n-lib.h>
31
31
 
32
32
 
127
127
static const GDBusInterfaceVTable _rygel_media_export_dbus_service_dbus_interface_vtable = {rygel_media_export_dbus_service_dbus_interface_method_call, rygel_media_export_dbus_service_dbus_interface_get_property, rygel_media_export_dbus_service_dbus_interface_set_property};
128
128
 
129
129
static gpointer _g_object_ref0 (gpointer self) {
 
130
#line 29 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
130
131
        return self ? g_object_ref (self) : NULL;
 
132
#line 133 "rygel-media-export-dbus-service.c"
131
133
}
132
134
 
133
135
 
134
136
RygelMediaExportDBusService* rygel_media_export_dbus_service_construct (GType object_type, RygelMediaExportRootContainer* root_container, GError** error) {
135
137
        RygelMediaExportDBusService * self = NULL;
136
138
        RygelMediaExportRootContainer* _tmp0_;
137
 
        GDBusConnection* _tmp1_ = NULL;
138
 
        GDBusConnection* connection;
139
 
        gboolean _tmp2_;
 
139
        RygelMediaExportRootContainer* _tmp1_;
140
140
        GError * _inner_error_ = NULL;
 
141
#line 28 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
141
142
        g_return_val_if_fail (root_container != NULL, NULL);
 
143
#line 28 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
142
144
        self = (RygelMediaExportDBusService*) g_object_new (object_type, NULL);
143
 
        _tmp0_ = _g_object_ref0 (root_container);
 
145
#line 29 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
146
        _tmp0_ = root_container;
 
147
#line 29 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
148
        _tmp1_ = _g_object_ref0 (_tmp0_);
 
149
#line 29 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
144
150
        _g_object_unref0 (self->priv->root_container);
145
 
        self->priv->root_container = _tmp0_;
146
 
        _tmp1_ = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &_inner_error_);
147
 
        connection = _tmp1_;
148
 
        if (_inner_error_ != NULL) {
149
 
                if (_inner_error_->domain == G_IO_ERROR) {
150
 
                        goto __catch39_g_io_error;
151
 
                }
152
 
                g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
153
 
                g_clear_error (&_inner_error_);
154
 
                return NULL;
155
 
        }
156
 
        _tmp2_ = G_LIKELY (connection != NULL);
157
 
        if (_tmp2_) {
158
 
                rygel_media_export_dbus_service_register_object (self, connection, RYGEL_MEDIA_EXPORT_DBUS_SERVICE_RYGEL_MEDIA_EXPORT_PATH, &_inner_error_);
 
151
#line 29 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
152
        self->priv->root_container = _tmp1_;
 
153
#line 154 "rygel-media-export-dbus-service.c"
 
154
        {
 
155
                GDBusConnection* _tmp2_ = NULL;
 
156
                GDBusConnection* connection;
 
157
                GDBusConnection* _tmp3_;
 
158
                gboolean _tmp4_ = FALSE;
 
159
#line 32 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
160
                _tmp2_ = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &_inner_error_);
 
161
#line 32 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
162
                connection = _tmp2_;
 
163
#line 32 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
159
164
                if (_inner_error_ != NULL) {
160
 
                        _g_object_unref0 (connection);
 
165
#line 32 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
161
166
                        if (_inner_error_->domain == G_IO_ERROR) {
 
167
#line 168 "rygel-media-export-dbus-service.c"
162
168
                                goto __catch39_g_io_error;
163
169
                        }
164
 
                        _g_object_unref0 (connection);
 
170
#line 32 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
165
171
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
172
#line 32 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
166
173
                        g_clear_error (&_inner_error_);
 
174
#line 32 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
167
175
                        return NULL;
168
 
                }
 
176
#line 177 "rygel-media-export-dbus-service.c"
 
177
                }
 
178
#line 34 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
179
                _tmp3_ = connection;
 
180
#line 34 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
181
                _tmp4_ = G_LIKELY (_tmp3_ != NULL);
 
182
#line 34 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
183
                if (_tmp4_) {
 
184
#line 185 "rygel-media-export-dbus-service.c"
 
185
                        GDBusConnection* _tmp5_;
 
186
#line 35 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
187
                        _tmp5_ = connection;
 
188
#line 35 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
189
                        rygel_media_export_dbus_service_register_object (self, _tmp5_, RYGEL_MEDIA_EXPORT_DBUS_SERVICE_RYGEL_MEDIA_EXPORT_PATH, &_inner_error_);
 
190
#line 35 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
191
                        if (_inner_error_ != NULL) {
 
192
#line 35 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
193
                                _g_object_unref0 (connection);
 
194
#line 35 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
195
                                if (_inner_error_->domain == G_IO_ERROR) {
 
196
#line 197 "rygel-media-export-dbus-service.c"
 
197
                                        goto __catch39_g_io_error;
 
198
                                }
 
199
#line 35 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
200
                                _g_object_unref0 (connection);
 
201
#line 35 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
202
                                g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
203
#line 35 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
204
                                g_clear_error (&_inner_error_);
 
205
#line 35 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
206
                                return NULL;
 
207
#line 208 "rygel-media-export-dbus-service.c"
 
208
                        }
 
209
                }
 
210
#line 31 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
211
                _g_object_unref0 (connection);
 
212
#line 213 "rygel-media-export-dbus-service.c"
169
213
        }
170
 
        _g_object_unref0 (connection);
171
214
        goto __finally39;
172
215
        __catch39_g_io_error:
173
216
        {
174
 
                GError * err;
175
 
                const gchar* _tmp3_ = NULL;
 
217
                GError* err = NULL;
 
218
                const gchar* _tmp6_ = NULL;
 
219
                GError* _tmp7_;
 
220
                const gchar* _tmp8_;
 
221
#line 31 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
176
222
                err = _inner_error_;
 
223
#line 31 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
177
224
                _inner_error_ = NULL;
178
 
                _tmp3_ = _ ("Failed to attach to D-Bus session bus: %s");
179
 
                g_warning (_tmp3_, err->message);
 
225
#line 38 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
226
                _tmp6_ = _ ("Failed to attach to D-Bus session bus: %s");
 
227
#line 38 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
228
                _tmp7_ = err;
 
229
#line 38 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
230
                _tmp8_ = _tmp7_->message;
 
231
#line 38 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
232
                g_warning (_tmp6_, _tmp8_);
 
233
#line 31 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
180
234
                _g_error_free0 (err);
 
235
#line 236 "rygel-media-export-dbus-service.c"
181
236
        }
182
237
        __finally39:
 
238
#line 31 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
183
239
        if (_inner_error_ != NULL) {
 
240
#line 31 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
184
241
                g_propagate_error (error, _inner_error_);
 
242
#line 31 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
185
243
                _g_object_unref0 (self);
 
244
#line 31 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
186
245
                return NULL;
 
246
#line 247 "rygel-media-export-dbus-service.c"
187
247
        }
 
248
#line 28 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
188
249
        return self;
 
250
#line 251 "rygel-media-export-dbus-service.c"
189
251
}
190
252
 
191
253
 
192
254
RygelMediaExportDBusService* rygel_media_export_dbus_service_new (RygelMediaExportRootContainer* root_container, GError** error) {
 
255
#line 28 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
193
256
        return rygel_media_export_dbus_service_construct (RYGEL_MEDIA_EXPORT_TYPE_DBUS_SERVICE, root_container, error);
 
257
#line 258 "rygel-media-export-dbus-service.c"
194
258
}
195
259
 
196
260
 
197
261
void rygel_media_export_dbus_service_AddUri (RygelMediaExportDBusService* self, const gchar* uri) {
 
262
        RygelMediaExportRootContainer* _tmp0_;
 
263
        const gchar* _tmp1_;
 
264
#line 43 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
198
265
        g_return_if_fail (self != NULL);
 
266
#line 43 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
199
267
        g_return_if_fail (uri != NULL);
200
 
        rygel_media_export_root_container_add_uri (self->priv->root_container, uri);
 
268
#line 44 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
269
        _tmp0_ = self->priv->root_container;
 
270
#line 44 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
271
        _tmp1_ = uri;
 
272
#line 44 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
273
        rygel_media_export_root_container_add_uri (_tmp0_, _tmp1_);
 
274
#line 275 "rygel-media-export-dbus-service.c"
201
275
}
202
276
 
203
277
 
204
278
void rygel_media_export_dbus_service_RemoveUri (RygelMediaExportDBusService* self, const gchar* uri) {
 
279
        RygelMediaExportRootContainer* _tmp0_;
 
280
        const gchar* _tmp1_;
 
281
#line 47 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
205
282
        g_return_if_fail (self != NULL);
 
283
#line 47 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
206
284
        g_return_if_fail (uri != NULL);
207
 
        rygel_media_export_root_container_remove_uri (self->priv->root_container, uri);
 
285
#line 48 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
286
        _tmp0_ = self->priv->root_container;
 
287
#line 48 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
288
        _tmp1_ = uri;
 
289
#line 48 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
290
        rygel_media_export_root_container_remove_uri (_tmp0_, _tmp1_);
 
291
#line 292 "rygel-media-export-dbus-service.c"
208
292
}
209
293
 
210
294
 
211
295
gchar** rygel_media_export_dbus_service_GetUris (RygelMediaExportDBusService* self, int* result_length1) {
212
296
        gchar** result = NULL;
213
 
        gint _tmp0_;
214
 
        gchar** _tmp1_ = NULL;
215
 
        gchar** _tmp2_;
 
297
        RygelMediaExportRootContainer* _tmp0_;
 
298
        gint _tmp1_ = 0;
 
299
        gchar** _tmp2_ = NULL;
 
300
        gchar** _tmp3_;
 
301
        gint _tmp3__length1;
 
302
#line 51 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
216
303
        g_return_val_if_fail (self != NULL, NULL);
217
 
        _tmp1_ = rygel_media_export_root_container_get_dynamic_uris (self->priv->root_container, &_tmp0_);
218
 
        _tmp2_ = _tmp1_;
219
 
        *result_length1 = _tmp0_;
220
 
        result = _tmp2_;
 
304
#line 52 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
305
        _tmp0_ = self->priv->root_container;
 
306
#line 52 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
307
        _tmp2_ = rygel_media_export_root_container_get_dynamic_uris (_tmp0_, &_tmp1_);
 
308
#line 52 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
309
        _tmp3_ = _tmp2_;
 
310
#line 52 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
311
        _tmp3__length1 = _tmp1_;
 
312
#line 52 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
313
        if (result_length1) {
 
314
#line 52 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
315
                *result_length1 = _tmp3__length1;
 
316
#line 317 "rygel-media-export-dbus-service.c"
 
317
        }
 
318
#line 52 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
 
319
        result = _tmp3_;
 
320
#line 52 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
221
321
        return result;
 
322
#line 323 "rygel-media-export-dbus-service.c"
222
323
}
223
324
 
224
325
 
225
326
static void rygel_media_export_dbus_service_class_init (RygelMediaExportDBusServiceClass * klass) {
 
327
#line 22 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
226
328
        rygel_media_export_dbus_service_parent_class = g_type_class_peek_parent (klass);
 
329
#line 22 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
227
330
        g_type_class_add_private (klass, sizeof (RygelMediaExportDBusServicePrivate));
 
331
#line 22 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
228
332
        G_OBJECT_CLASS (klass)->finalize = rygel_media_export_dbus_service_finalize;
 
333
#line 334 "rygel-media-export-dbus-service.c"
229
334
}
230
335
 
231
336
 
232
337
static void rygel_media_export_dbus_service_instance_init (RygelMediaExportDBusService * self) {
 
338
#line 22 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
233
339
        self->priv = RYGEL_MEDIA_EXPORT_DBUS_SERVICE_GET_PRIVATE (self);
 
340
#line 341 "rygel-media-export-dbus-service.c"
234
341
}
235
342
 
236
343
 
237
344
static void rygel_media_export_dbus_service_finalize (GObject* obj) {
238
345
        RygelMediaExportDBusService * self;
 
346
#line 22 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
239
347
        self = RYGEL_MEDIA_EXPORT_DBUS_SERVICE (obj);
 
348
#line 26 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
240
349
        _g_object_unref0 (self->priv->root_container);
 
350
#line 22 "/home/jens/Source/rygel/src/plugins/media-export/rygel-media-export-dbus-service.vala"
241
351
        G_OBJECT_CLASS (rygel_media_export_dbus_service_parent_class)->finalize (obj);
 
352
#line 353 "rygel-media-export-dbus-service.c"
242
353
}
243
354
 
244
355
 
325
436
                _tmp2_++;
326
437
        }
327
438
        g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp3_));
328
 
         result = (_vala_array_free ( result,  result_length1, (GDestroyNotify) g_free), NULL);
 
439
        result = (_vala_array_free (result, result_length1, (GDestroyNotify) g_free), NULL);
329
440
        _reply = g_variant_builder_end (&_reply_builder);
330
441
        g_dbus_message_set_body (_reply_message, _reply);
331
442
        g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);