~ubuntu-branches/ubuntu/quantal/gwibber/quantal-proposed

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
/* urlshorten.c generated by valac 0.16.1, the Vala compiler
 * generated from urlshorten.vala, do not modify */

/*
 * Copyright(C) 2010 Neil Jagdish Patel
 * Copyright(C) 2010 Canonical Ltd.
 *
 * This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License
 * version 3.0 as published by the Free Software Foundation.
 *
 * This library 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 Lesser General Public License version 3.0 for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see
 * <http://www.gnu.org/licenses/>.
 *
 * Authored by Neil Jagdish Patel <neil.patel@canonical.com>
 * Authored by Ken VaDine <ken.vandine@canonical.com>
 */

#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include "gwibber.h"


#define TYPE_URL_SHORTEN_INTERFACE (url_shorten_interface_get_type ())
#define URL_SHORTEN_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_URL_SHORTEN_INTERFACE, URLShortenInterface))
#define IS_URL_SHORTEN_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_URL_SHORTEN_INTERFACE))
#define URL_SHORTEN_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_URL_SHORTEN_INTERFACE, URLShortenInterfaceIface))

typedef struct _URLShortenInterface URLShortenInterface;
typedef struct _URLShortenInterfaceIface URLShortenInterfaceIface;

#define TYPE_URL_SHORTEN_INTERFACE_PROXY (url_shorten_interface_proxy_get_type ())
typedef GDBusProxy URLShortenInterfaceProxy;
typedef GDBusProxyClass URLShortenInterfaceProxyClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _URLShortenInterfaceIface {
	GTypeInterface parent_iface;
	gchar* (*Shorten) (URLShortenInterface* self, const gchar* url, GError** error);
};

struct _GwibberURLShortenPrivate {
	URLShortenInterface* url_service;
	GwibberUtils* utils;
};


static gpointer gwibber_url_shorten_parent_class = NULL;

GType url_shorten_interface_proxy_get_type (void) G_GNUC_CONST;
guint url_shorten_interface_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
GType url_shorten_interface_get_type (void) G_GNUC_CONST;
gchar* url_shorten_interface_Shorten (URLShortenInterface* self, const gchar* url, GError** error);
static void url_shorten_interface_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters);
static gchar* url_shorten_interface_proxy_Shorten (URLShortenInterface* self, const gchar* url, GError** error);
static void url_shorten_interface_proxy_url_shorten_interface_interface_init (URLShortenInterfaceIface* iface);
static void _dbus_url_shorten_interface_Shorten (URLShortenInterface* self, GVariant* parameters, GDBusMethodInvocation* invocation);
static void url_shorten_interface_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* url_shorten_interface_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 url_shorten_interface_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 _url_shorten_interface_unregister_object (gpointer user_data);
#define GWIBBER_URL_SHORTEN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GWIBBER_TYPE_URL_SHORTEN, GwibberURLShortenPrivate))
enum  {
	GWIBBER_URL_SHORTEN_DUMMY_PROPERTY
};
#define GWIBBER_URL_SHORTEN_url_name "com.Gwibber.URLShorten"
#define GWIBBER_URL_SHORTEN_url_path "/com/gwibber/URLShorten"
static GObject * gwibber_url_shorten_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
void gwibber_utils_setup (GwibberUtils* self, const gchar* name, GError** error);
static void _gwibber_url_shorten_url_available_gwibber_utils_available (GwibberUtils* _sender, gboolean up, gpointer self);
static void gwibber_url_shorten_finalize (GObject* obj);

static const GDBusArgInfo _url_shorten_interface_dbus_arg_info_Shorten_url = {-1, "url", "s"};
static const GDBusArgInfo _url_shorten_interface_dbus_arg_info_Shorten_result = {-1, "result", "s"};
static const GDBusArgInfo * const _url_shorten_interface_dbus_arg_info_Shorten_in[] = {&_url_shorten_interface_dbus_arg_info_Shorten_url, NULL};
static const GDBusArgInfo * const _url_shorten_interface_dbus_arg_info_Shorten_out[] = {&_url_shorten_interface_dbus_arg_info_Shorten_result, NULL};
static const GDBusMethodInfo _url_shorten_interface_dbus_method_info_Shorten = {-1, "Shorten", (GDBusArgInfo **) (&_url_shorten_interface_dbus_arg_info_Shorten_in), (GDBusArgInfo **) (&_url_shorten_interface_dbus_arg_info_Shorten_out)};
static const GDBusMethodInfo * const _url_shorten_interface_dbus_method_info[] = {&_url_shorten_interface_dbus_method_info_Shorten, NULL};
static const GDBusSignalInfo * const _url_shorten_interface_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _url_shorten_interface_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _url_shorten_interface_dbus_interface_info = {-1, "com.Gwibber.URLShorten", (GDBusMethodInfo **) (&_url_shorten_interface_dbus_method_info), (GDBusSignalInfo **) (&_url_shorten_interface_dbus_signal_info), (GDBusPropertyInfo **) (&_url_shorten_interface_dbus_property_info)};
static const GDBusInterfaceVTable _url_shorten_interface_dbus_interface_vtable = {url_shorten_interface_dbus_interface_method_call, url_shorten_interface_dbus_interface_get_property, url_shorten_interface_dbus_interface_set_property};

gchar* url_shorten_interface_Shorten (URLShortenInterface* self, const gchar* url, GError** error) {
#line 24 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 24 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	return URL_SHORTEN_INTERFACE_GET_INTERFACE (self)->Shorten (self, url, error);
#line 101 "urlshorten.c"
}


static void url_shorten_interface_base_init (URLShortenInterfaceIface * iface) {
#line 23 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	static gboolean initialized = FALSE;
#line 23 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	if (!initialized) {
#line 23 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		initialized = TRUE;
#line 112 "urlshorten.c"
	}
}


GType url_shorten_interface_get_type (void) {
	static volatile gsize url_shorten_interface_type_id__volatile = 0;
	if (g_once_init_enter (&url_shorten_interface_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (URLShortenInterfaceIface), (GBaseInitFunc) url_shorten_interface_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
		GType url_shorten_interface_type_id;
		url_shorten_interface_type_id = g_type_register_static (G_TYPE_INTERFACE, "URLShortenInterface", &g_define_type_info, 0);
		g_type_interface_add_prerequisite (url_shorten_interface_type_id, G_TYPE_OBJECT);
		g_type_set_qdata (url_shorten_interface_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) url_shorten_interface_proxy_get_type);
		g_type_set_qdata (url_shorten_interface_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "com.Gwibber.URLShorten");
		g_type_set_qdata (url_shorten_interface_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) url_shorten_interface_register_object);
		g_once_init_leave (&url_shorten_interface_type_id__volatile, url_shorten_interface_type_id);
	}
	return url_shorten_interface_type_id__volatile;
}


G_DEFINE_TYPE_EXTENDED (URLShortenInterfaceProxy, url_shorten_interface_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (TYPE_URL_SHORTEN_INTERFACE, url_shorten_interface_proxy_url_shorten_interface_interface_init) )
static void url_shorten_interface_proxy_class_init (URLShortenInterfaceProxyClass* klass) {
	G_DBUS_PROXY_CLASS (klass)->g_signal = url_shorten_interface_proxy_g_signal;
}


static void url_shorten_interface_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters) {
}


static void url_shorten_interface_proxy_init (URLShortenInterfaceProxy* self) {
}


static gchar* url_shorten_interface_proxy_Shorten (URLShortenInterface* self, const gchar* url, GError** error) {
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gchar* _result;
	GVariant* _tmp48_;
	G_IO_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "com.Gwibber.URLShorten", "Shorten");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (url));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	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);
	_tmp48_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_dup_string (_tmp48_, NULL);
	g_variant_unref (_tmp48_);
	g_object_unref (_reply_message);
	return _result;
}


static void url_shorten_interface_proxy_url_shorten_interface_interface_init (URLShortenInterfaceIface* iface) {
	iface->Shorten = url_shorten_interface_proxy_Shorten;
}


static void _dbus_url_shorten_interface_Shorten (URLShortenInterface* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* url = NULL;
	GVariant* _tmp49_;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gchar* result;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp49_ = g_variant_iter_next_value (&_arguments_iter);
	url = g_variant_dup_string (_tmp49_, NULL);
	g_variant_unref (_tmp49_);
	result = url_shorten_interface_Shorten (self, url, &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_variant_builder_add_value (&_reply_builder, g_variant_new_string (result));
	_g_free0 (result);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	_g_free0 (url);
	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 url_shorten_interface_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, "Shorten") == 0) {
		_dbus_url_shorten_interface_Shorten (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}


static GVariant* url_shorten_interface_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 url_shorten_interface_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 url_shorten_interface_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 *) (&_url_shorten_interface_dbus_interface_info), &_url_shorten_interface_dbus_interface_vtable, data, _url_shorten_interface_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}


static void _url_shorten_interface_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);
}


/**
         * com.Gwibber.URLShorten
         **/
gchar* gwibber_url_shorten_shorten (GwibberURLShorten* self, const gchar* url) {
	gchar* result = NULL;
	GError * _inner_error_ = NULL;
#line 66 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 66 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	g_return_val_if_fail (url != NULL, NULL);
#line 283 "urlshorten.c"
	{
		URLShortenInterface* _tmp0_;
		const gchar* _tmp1_;
		gchar* _tmp2_ = NULL;
		gchar* _tmp3_;
#line 70 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		_tmp0_ = self->priv->url_service;
#line 70 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		_tmp1_ = url;
#line 70 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		_tmp2_ = url_shorten_interface_Shorten (_tmp0_, _tmp1_, &_inner_error_);
#line 70 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		_tmp3_ = _tmp2_;
#line 70 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		if (_inner_error_ != NULL) {
#line 70 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
			if (_inner_error_->domain == G_IO_ERROR) {
#line 301 "urlshorten.c"
				goto __catch52_g_io_error;
			}
#line 70 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
			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);
#line 70 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
			g_clear_error (&_inner_error_);
#line 70 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
			return NULL;
#line 310 "urlshorten.c"
		}
#line 70 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		result = _tmp3_;
#line 70 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		return result;
#line 316 "urlshorten.c"
	}
	goto __finally52;
	__catch52_g_io_error:
	{
		GError* e = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		gchar* _tmp6_;
#line 68 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		e = _inner_error_;
#line 68 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		_inner_error_ = NULL;
#line 74 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		_tmp4_ = e;
#line 74 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		_tmp5_ = _tmp4_->message;
#line 74 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		g_warning ("urlshorten.vala:74: %s", _tmp5_);
#line 75 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		_tmp6_ = g_strdup ("Failed");
#line 75 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		result = _tmp6_;
#line 75 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		_g_error_free0 (e);
#line 75 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		return result;
#line 343 "urlshorten.c"
	}
	__finally52:
#line 68 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	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);
#line 68 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	g_clear_error (&_inner_error_);
#line 68 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	return NULL;
#line 352 "urlshorten.c"
}


void gwibber_url_shorten_url_available (GwibberURLShorten* self, gboolean is_up) {
	gboolean _tmp0_;
#line 79 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	g_return_if_fail (self != NULL);
#line 81 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	_tmp0_ = is_up;
#line 81 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	g_signal_emit_by_name (self, "is-available", _tmp0_);
#line 364 "urlshorten.c"
}


GwibberURLShorten* gwibber_url_shorten_construct (GType object_type) {
	GwibberURLShorten * self = NULL;
#line 29 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	self = (GwibberURLShorten*) g_object_new (object_type, NULL);
#line 29 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	return self;
#line 374 "urlshorten.c"
}


GwibberURLShorten* gwibber_url_shorten_new (void) {
#line 29 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	return gwibber_url_shorten_construct (GWIBBER_TYPE_URL_SHORTEN);
#line 381 "urlshorten.c"
}


static void _gwibber_url_shorten_url_available_gwibber_utils_available (GwibberUtils* _sender, gboolean up, gpointer self) {
#line 54 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	gwibber_url_shorten_url_available (self, up);
#line 388 "urlshorten.c"
}


static GObject * gwibber_url_shorten_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	GwibberURLShorten * self;
	GError * _inner_error_ = NULL;
#line 45 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	parent_class = G_OBJECT_CLASS (gwibber_url_shorten_parent_class);
#line 45 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
#line 45 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	self = GWIBBER_URL_SHORTEN (obj);
#line 403 "urlshorten.c"
	{
		URLShortenInterface* _tmp0_ = NULL;
		URLShortenInterface* _tmp1_;
		GwibberUtils* _tmp2_;
		GwibberUtils* _tmp3_;
		GwibberUtils* _tmp4_;
#line 49 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		_tmp0_ = g_initable_new (TYPE_URL_SHORTEN_INTERFACE_PROXY, NULL, &_inner_error_, "g-flags", 0, "g-name", GWIBBER_URL_SHORTEN_url_name, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", GWIBBER_URL_SHORTEN_url_path, "g-interface-name", "com.Gwibber.URLShorten", NULL);
#line 49 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		_tmp1_ = (URLShortenInterface*) _tmp0_;
#line 49 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		if (_inner_error_ != NULL) {
#line 49 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
			if (_inner_error_->domain == G_IO_ERROR) {
#line 418 "urlshorten.c"
				goto __catch53_g_io_error;
			}
#line 49 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
			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);
#line 49 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
			g_clear_error (&_inner_error_);
#line 425 "urlshorten.c"
		}
#line 49 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		_g_object_unref0 (self->priv->url_service);
#line 49 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		self->priv->url_service = _tmp1_;
#line 52 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		_tmp2_ = gwibber_utils_new ();
#line 52 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		_g_object_unref0 (self->priv->utils);
#line 52 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		self->priv->utils = _tmp2_;
#line 53 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		_tmp3_ = self->priv->utils;
#line 53 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		gwibber_utils_setup (_tmp3_, GWIBBER_URL_SHORTEN_url_name, &_inner_error_);
#line 53 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		if (_inner_error_ != NULL) {
#line 53 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
			if (_inner_error_->domain == G_IO_ERROR) {
#line 445 "urlshorten.c"
				goto __catch53_g_io_error;
			}
#line 53 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
			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);
#line 53 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
			g_clear_error (&_inner_error_);
#line 452 "urlshorten.c"
		}
#line 54 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		_tmp4_ = self->priv->utils;
#line 54 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		g_signal_connect_object (_tmp4_, "available", (GCallback) _gwibber_url_shorten_url_available_gwibber_utils_available, self, 0);
#line 458 "urlshorten.c"
	}
	goto __finally53;
	__catch53_g_io_error:
	{
		GError* e = NULL;
		GError* _tmp5_;
		const gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
#line 47 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		e = _inner_error_;
#line 47 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		_inner_error_ = NULL;
#line 58 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		_tmp5_ = e;
#line 58 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		_tmp6_ = _tmp5_->message;
#line 58 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		_tmp7_ = g_strconcat ("Unable to get Gwibber URLShorten: ", _tmp6_, NULL);
#line 58 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		_tmp8_ = _tmp7_;
#line 58 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		g_warning ("urlshorten.vala:58: %s", _tmp8_);
#line 58 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		_g_free0 (_tmp8_);
#line 47 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		_g_error_free0 (e);
#line 486 "urlshorten.c"
	}
	__finally53:
#line 47 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	if (_inner_error_ != NULL) {
#line 47 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		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);
#line 47 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
		g_clear_error (&_inner_error_);
#line 495 "urlshorten.c"
	}
#line 45 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	return obj;
#line 499 "urlshorten.c"
}


static void gwibber_url_shorten_class_init (GwibberURLShortenClass * klass) {
#line 29 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	gwibber_url_shorten_parent_class = g_type_class_peek_parent (klass);
#line 29 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	g_type_class_add_private (klass, sizeof (GwibberURLShortenPrivate));
#line 29 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	G_OBJECT_CLASS (klass)->constructor = gwibber_url_shorten_constructor;
#line 29 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	G_OBJECT_CLASS (klass)->finalize = gwibber_url_shorten_finalize;
#line 512 "urlshorten.c"
	/** 
	            URLShorten::is_available:
	            @arg0: The current state
	
	            Emitted when com.Gwibber.URLShorten availability state changes
	*/
#line 29 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	g_signal_new ("is_available", GWIBBER_TYPE_URL_SHORTEN, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
#line 521 "urlshorten.c"
}


static void gwibber_url_shorten_instance_init (GwibberURLShorten * self) {
#line 29 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	self->priv = GWIBBER_URL_SHORTEN_GET_PRIVATE (self);
#line 528 "urlshorten.c"
}


static void gwibber_url_shorten_finalize (GObject* obj) {
	GwibberURLShorten * self;
#line 29 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	self = GWIBBER_URL_SHORTEN (obj);
#line 34 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	_g_object_unref0 (self->priv->url_service);
#line 35 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	_g_object_unref0 (self->priv->utils);
#line 29 "/storage/1/src/gwibber/trunk/libgwibber/urlshorten.vala"
	G_OBJECT_CLASS (gwibber_url_shorten_parent_class)->finalize (obj);
#line 542 "urlshorten.c"
}


GType gwibber_url_shorten_get_type (void) {
	static volatile gsize gwibber_url_shorten_type_id__volatile = 0;
	if (g_once_init_enter (&gwibber_url_shorten_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GwibberURLShortenClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gwibber_url_shorten_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GwibberURLShorten), 0, (GInstanceInitFunc) gwibber_url_shorten_instance_init, NULL };
		GType gwibber_url_shorten_type_id;
		gwibber_url_shorten_type_id = g_type_register_static (G_TYPE_OBJECT, "GwibberURLShorten", &g_define_type_info, 0);
		g_once_init_leave (&gwibber_url_shorten_type_id__volatile, gwibber_url_shorten_type_id);
	}
	return gwibber_url_shorten_type_id__volatile;
}