run vala
[moonshot-ui.git] / src / moonshot-identity-request.c
1 /* moonshot-identity-request.c generated by valac 0.16.1, the Vala compiler
2  * generated from moonshot-identity-request.vala, do not modify */
3
4
5 #include <glib.h>
6 #include <glib-object.h>
7 #include <stdlib.h>
8 #include <string.h>
9
10
11 #define TYPE_IDENTITY_REQUEST (identity_request_get_type ())
12 #define IDENTITY_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IDENTITY_REQUEST, IdentityRequest))
13 #define IDENTITY_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IDENTITY_REQUEST, IdentityRequestClass))
14 #define IS_IDENTITY_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IDENTITY_REQUEST))
15 #define IS_IDENTITY_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IDENTITY_REQUEST))
16 #define IDENTITY_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IDENTITY_REQUEST, IdentityRequestClass))
17
18 typedef struct _IdentityRequest IdentityRequest;
19 typedef struct _IdentityRequestClass IdentityRequestClass;
20 typedef struct _IdentityRequestPrivate IdentityRequestPrivate;
21
22 #define TYPE_ID_CARD (id_card_get_type ())
23 #define ID_CARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ID_CARD, IdCard))
24 #define ID_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ID_CARD, IdCardClass))
25 #define IS_ID_CARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ID_CARD))
26 #define IS_ID_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ID_CARD))
27 #define ID_CARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ID_CARD, IdCardClass))
28
29 typedef struct _IdCard IdCard;
30 typedef struct _IdCardClass IdCardClass;
31
32 #define TYPE_IDENTITY_MANAGER_APP (identity_manager_app_get_type ())
33 #define IDENTITY_MANAGER_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IDENTITY_MANAGER_APP, IdentityManagerApp))
34 #define IDENTITY_MANAGER_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IDENTITY_MANAGER_APP, IdentityManagerAppClass))
35 #define IS_IDENTITY_MANAGER_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IDENTITY_MANAGER_APP))
36 #define IS_IDENTITY_MANAGER_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IDENTITY_MANAGER_APP))
37 #define IDENTITY_MANAGER_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IDENTITY_MANAGER_APP, IdentityManagerAppClass))
38
39 typedef struct _IdentityManagerApp IdentityManagerApp;
40 typedef struct _IdentityManagerAppClass IdentityManagerAppClass;
41 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
42 #define _identity_manager_app_unref0(var) ((var == NULL) ? NULL : (var = (identity_manager_app_unref (var), NULL)))
43 #define _g_free0(var) (var = (g_free (var), NULL))
44 #define __g_slist_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_slist_free__g_object_unref0_ (var), NULL)))
45 typedef struct _IdentityManagerAppPrivate IdentityManagerAppPrivate;
46
47 #define TYPE_IDENTITY_MANAGER_MODEL (identity_manager_model_get_type ())
48 #define IDENTITY_MANAGER_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IDENTITY_MANAGER_MODEL, IdentityManagerModel))
49 #define IDENTITY_MANAGER_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IDENTITY_MANAGER_MODEL, IdentityManagerModelClass))
50 #define IS_IDENTITY_MANAGER_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IDENTITY_MANAGER_MODEL))
51 #define IS_IDENTITY_MANAGER_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IDENTITY_MANAGER_MODEL))
52 #define IDENTITY_MANAGER_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IDENTITY_MANAGER_MODEL, IdentityManagerModelClass))
53
54 typedef struct _IdentityManagerModel IdentityManagerModel;
55 typedef struct _IdentityManagerModelClass IdentityManagerModelClass;
56
57 typedef void (*ReturnIdentityCallback) (IdentityRequest* request, void* user_data);
58 struct _IdentityRequest {
59         GObject parent_instance;
60         IdentityRequestPrivate * priv;
61         IdCard* id_card;
62         gboolean complete;
63         gboolean select_default;
64         gchar* nai;
65         gchar* password;
66         gchar* service;
67         GSList* candidates;
68 };
69
70 struct _IdentityRequestClass {
71         GObjectClass parent_class;
72 };
73
74 struct _IdentityRequestPrivate {
75         IdentityManagerApp* parent_app;
76         ReturnIdentityCallback callback;
77         gpointer callback_target;
78         GDestroyNotify callback_target_destroy_notify;
79 };
80
81 struct _IdentityManagerApp {
82         GTypeInstance parent_instance;
83         volatile int ref_count;
84         IdentityManagerAppPrivate * priv;
85         IdentityManagerModel* model;
86         IdCard* default_id_card;
87 };
88
89 struct _IdentityManagerAppClass {
90         GTypeClass parent_class;
91         void (*finalize) (IdentityManagerApp *self);
92 };
93
94
95 static gpointer identity_request_parent_class = NULL;
96
97 GType identity_request_get_type (void) G_GNUC_CONST;
98 GType id_card_get_type (void) G_GNUC_CONST;
99 gpointer identity_manager_app_ref (gpointer instance);
100 void identity_manager_app_unref (gpointer instance);
101 GParamSpec* param_spec_identity_manager_app (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
102 void value_set_identity_manager_app (GValue* value, gpointer v_object);
103 void value_take_identity_manager_app (GValue* value, gpointer v_object);
104 gpointer value_get_identity_manager_app (const GValue* value);
105 GType identity_manager_app_get_type (void) G_GNUC_CONST;
106 #define IDENTITY_REQUEST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_IDENTITY_REQUEST, IdentityRequestPrivate))
107 enum  {
108         IDENTITY_REQUEST_DUMMY_PROPERTY
109 };
110 static void _g_object_unref0_ (gpointer var);
111 static void _g_slist_free__g_object_unref0_ (GSList* self);
112 IdentityRequest* identity_request_new (IdentityManagerApp* app, const gchar* nai, const gchar* password, const gchar* service);
113 IdentityRequest* identity_request_construct (GType object_type, IdentityManagerApp* app, const gchar* nai, const gchar* password, const gchar* service);
114 IdentityRequest* identity_request_new_default (IdentityManagerApp* app);
115 IdentityRequest* identity_request_construct_default (GType object_type, IdentityManagerApp* app);
116 void identity_request_set_callback (IdentityRequest* self, ReturnIdentityCallback cb, void* cb_target, GDestroyNotify cb_target_destroy_notify);
117 gboolean identity_request_execute (IdentityRequest* self);
118 void identity_manager_app_select_identity (IdentityManagerApp* self, IdentityRequest* request);
119 void identity_request_return_identity (IdentityRequest* self, IdCard* id_card);
120 gchar** id_card_get_services (IdCard* self, int* result_length1);
121 void id_card_set_services (IdCard* self, gchar** value, int value_length1);
122 GType identity_manager_model_get_type (void) G_GNUC_CONST;
123 void identity_manager_model_update_card (IdentityManagerModel* self, IdCard* card);
124 static void identity_request_finalize (GObject* obj);
125 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
126 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
127
128
129 static void _g_object_unref0_ (gpointer var) {
130 #line 12 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
131         (var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
132 #line 133 "moonshot-identity-request.c"
133 }
134
135
136 static void _g_slist_free__g_object_unref0_ (GSList* self) {
137 #line 12 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
138         g_slist_foreach (self, (GFunc) _g_object_unref0_, NULL);
139 #line 12 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
140         g_slist_free (self);
141 #line 142 "moonshot-identity-request.c"
142 }
143
144
145 static gpointer _identity_manager_app_ref0 (gpointer self) {
146 #line 21 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
147         return self ? identity_manager_app_ref (self) : NULL;
148 #line 149 "moonshot-identity-request.c"
149 }
150
151
152 IdentityRequest* identity_request_construct (GType object_type, IdentityManagerApp* app, const gchar* nai, const gchar* password, const gchar* service) {
153         IdentityRequest * self = NULL;
154         IdentityManagerApp* _tmp0_;
155         IdentityManagerApp* _tmp1_;
156         const gchar* _tmp2_;
157         gchar* _tmp3_;
158         const gchar* _tmp4_;
159         gchar* _tmp5_;
160         const gchar* _tmp6_;
161         gchar* _tmp7_;
162 #line 16 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
163         g_return_val_if_fail (app != NULL, NULL);
164 #line 16 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
165         g_return_val_if_fail (nai != NULL, NULL);
166 #line 16 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
167         g_return_val_if_fail (password != NULL, NULL);
168 #line 16 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
169         g_return_val_if_fail (service != NULL, NULL);
170 #line 16 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
171         self = (IdentityRequest*) g_object_new (object_type, NULL);
172 #line 21 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
173         _tmp0_ = app;
174 #line 21 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
175         _tmp1_ = _identity_manager_app_ref0 (_tmp0_);
176 #line 21 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
177         _identity_manager_app_unref0 (self->priv->parent_app);
178 #line 21 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
179         self->priv->parent_app = _tmp1_;
180 #line 22 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
181         _tmp2_ = nai;
182 #line 22 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
183         _tmp3_ = g_strdup (_tmp2_);
184 #line 22 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
185         _g_free0 (self->nai);
186 #line 22 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
187         self->nai = _tmp3_;
188 #line 23 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
189         _tmp4_ = password;
190 #line 23 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
191         _tmp5_ = g_strdup (_tmp4_);
192 #line 23 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
193         _g_free0 (self->password);
194 #line 23 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
195         self->password = _tmp5_;
196 #line 24 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
197         _tmp6_ = service;
198 #line 24 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
199         _tmp7_ = g_strdup (_tmp6_);
200 #line 24 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
201         _g_free0 (self->service);
202 #line 24 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
203         self->service = _tmp7_;
204 #line 16 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
205         return self;
206 #line 207 "moonshot-identity-request.c"
207 }
208
209
210 IdentityRequest* identity_request_new (IdentityManagerApp* app, const gchar* nai, const gchar* password, const gchar* service) {
211 #line 16 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
212         return identity_request_construct (TYPE_IDENTITY_REQUEST, app, nai, password, service);
213 #line 214 "moonshot-identity-request.c"
214 }
215
216
217 IdentityRequest* identity_request_construct_default (GType object_type, IdentityManagerApp* app) {
218         IdentityRequest * self = NULL;
219         IdentityManagerApp* _tmp0_;
220         IdentityManagerApp* _tmp1_;
221 #line 27 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
222         g_return_val_if_fail (app != NULL, NULL);
223 #line 27 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
224         self = (IdentityRequest*) g_object_new (object_type, NULL);
225 #line 29 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
226         _tmp0_ = app;
227 #line 29 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
228         _tmp1_ = _identity_manager_app_ref0 (_tmp0_);
229 #line 29 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
230         _identity_manager_app_unref0 (self->priv->parent_app);
231 #line 29 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
232         self->priv->parent_app = _tmp1_;
233 #line 30 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
234         self->select_default = TRUE;
235 #line 27 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
236         return self;
237 #line 238 "moonshot-identity-request.c"
238 }
239
240
241 IdentityRequest* identity_request_new_default (IdentityManagerApp* app) {
242 #line 27 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
243         return identity_request_construct_default (TYPE_IDENTITY_REQUEST, app);
244 #line 245 "moonshot-identity-request.c"
245 }
246
247
248 void identity_request_set_callback (IdentityRequest* self, ReturnIdentityCallback cb, void* cb_target, GDestroyNotify cb_target_destroy_notify) {
249         ReturnIdentityCallback _tmp0_;
250         void* _tmp0__target;
251         GDestroyNotify _tmp0__target_destroy_notify;
252 #line 33 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
253         g_return_if_fail (self != NULL);
254 #line 36 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
255         _tmp0_ = cb;
256 #line 36 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
257         _tmp0__target = cb_target;
258 #line 36 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
259         _tmp0__target_destroy_notify = cb_target_destroy_notify;
260 #line 36 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
261         cb_target_destroy_notify = NULL;
262 #line 36 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
263         (self->priv->callback_target_destroy_notify == NULL) ? NULL : (self->priv->callback_target_destroy_notify (self->priv->callback_target), NULL);
264 #line 36 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
265         self->priv->callback = NULL;
266 #line 36 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
267         self->priv->callback_target = NULL;
268 #line 36 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
269         self->priv->callback_target_destroy_notify = NULL;
270 #line 36 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
271         self->priv->callback = _tmp0_;
272 #line 36 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
273         self->priv->callback_target = _tmp0__target;
274 #line 36 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
275         self->priv->callback_target_destroy_notify = _tmp0__target_destroy_notify;
276 #line 33 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
277         (cb_target_destroy_notify == NULL) ? NULL : (cb_target_destroy_notify (cb_target), NULL);
278 #line 33 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
279         cb = NULL;
280 #line 33 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
281         cb_target = NULL;
282 #line 33 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
283         cb_target_destroy_notify = NULL;
284 #line 285 "moonshot-identity-request.c"
285 }
286
287
288 gboolean identity_request_execute (IdentityRequest* self) {
289         gboolean result = FALSE;
290         IdentityManagerApp* _tmp0_;
291 #line 42 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
292         g_return_val_if_fail (self != NULL, FALSE);
293 #line 43 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
294         _tmp0_ = self->priv->parent_app;
295 #line 43 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
296         identity_manager_app_select_identity (_tmp0_, self);
297 #line 48 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
298         result = FALSE;
299 #line 48 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
300         return result;
301 #line 302 "moonshot-identity-request.c"
302 }
303
304
305 static gpointer _g_object_ref0 (gpointer self) {
306 #line 52 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
307         return self ? g_object_ref (self) : NULL;
308 #line 309 "moonshot-identity-request.c"
309 }
310
311
312 void identity_request_return_identity (IdentityRequest* self, IdCard* id_card) {
313         IdCard* _tmp0_;
314         IdCard* _tmp1_;
315         gboolean _tmp2_ = FALSE;
316         gboolean _tmp3_ = FALSE;
317         IdCard* _tmp4_;
318         gboolean _tmp6_;
319         gboolean _tmp8_;
320         ReturnIdentityCallback _tmp48_;
321         void* _tmp48__target;
322         ReturnIdentityCallback _tmp49_;
323         void* _tmp49__target;
324 #line 51 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
325         g_return_if_fail (self != NULL);
326 #line 52 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
327         _tmp0_ = id_card;
328 #line 52 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
329         _tmp1_ = _g_object_ref0 (_tmp0_);
330 #line 52 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
331         _g_object_unref0 (self->id_card);
332 #line 52 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
333         self->id_card = _tmp1_;
334 #line 53 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
335         self->complete = TRUE;
336 #line 56 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
337         _tmp4_ = id_card;
338 #line 56 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
339         if (_tmp4_ != NULL) {
340 #line 341 "moonshot-identity-request.c"
341                 const gchar* _tmp5_;
342 #line 56 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
343                 _tmp5_ = self->service;
344 #line 56 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
345                 _tmp3_ = _tmp5_ != NULL;
346 #line 347 "moonshot-identity-request.c"
347         } else {
348 #line 56 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
349                 _tmp3_ = FALSE;
350 #line 351 "moonshot-identity-request.c"
351         }
352 #line 56 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
353         _tmp6_ = _tmp3_;
354 #line 56 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
355         if (_tmp6_) {
356 #line 357 "moonshot-identity-request.c"
357                 const gchar* _tmp7_;
358 #line 56 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
359                 _tmp7_ = self->service;
360 #line 56 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
361                 _tmp2_ = g_strcmp0 (_tmp7_, "") != 0;
362 #line 363 "moonshot-identity-request.c"
363         } else {
364 #line 56 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
365                 _tmp2_ = FALSE;
366 #line 367 "moonshot-identity-request.c"
367         }
368 #line 56 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
369         _tmp8_ = _tmp2_;
370 #line 56 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
371         if (_tmp8_) {
372 #line 373 "moonshot-identity-request.c"
373                 gboolean duplicate_service;
374                 IdCard* _tmp9_;
375                 gchar** _tmp10_;
376                 gint _tmp10__length1;
377                 gchar** _tmp11_;
378                 gint _tmp11__length1;
379                 gboolean _tmp15_;
380 #line 58 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
381                 duplicate_service = FALSE;
382 #line 60 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
383                 _tmp9_ = id_card;
384 #line 60 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
385                 _tmp10_ = id_card_get_services (_tmp9_, &_tmp10__length1);
386 #line 60 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
387                 _tmp11_ = _tmp10_;
388 #line 60 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
389                 _tmp11__length1 = _tmp10__length1;
390 #line 391 "moonshot-identity-request.c"
391                 {
392                         gchar** service_collection = NULL;
393                         gint service_collection_length1 = 0;
394                         gint _service_collection_size_ = 0;
395                         gint service_it = 0;
396 #line 60 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
397                         service_collection = _tmp11_;
398 #line 60 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
399                         service_collection_length1 = _tmp11__length1;
400 #line 60 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
401                         for (service_it = 0; service_it < _tmp11__length1; service_it = service_it + 1) {
402 #line 403 "moonshot-identity-request.c"
403                                 gchar* _tmp12_;
404                                 gchar* service = NULL;
405 #line 60 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
406                                 _tmp12_ = g_strdup (service_collection[service_it]);
407 #line 60 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
408                                 service = _tmp12_;
409 #line 410 "moonshot-identity-request.c"
410                                 {
411                                         const gchar* _tmp13_;
412                                         const gchar* _tmp14_;
413 #line 62 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
414                                         _tmp13_ = service;
415 #line 62 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
416                                         _tmp14_ = self->service;
417 #line 62 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
418                                         if (g_strcmp0 (_tmp13_, _tmp14_) == 0) {
419 #line 63 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
420                                                 duplicate_service = TRUE;
421 #line 422 "moonshot-identity-request.c"
422                                         }
423 #line 60 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
424                                         _g_free0 (service);
425 #line 426 "moonshot-identity-request.c"
426                                 }
427                         }
428                 }
429 #line 65 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
430                 _tmp15_ = duplicate_service;
431 #line 65 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
432                 if (_tmp15_ == FALSE) {
433 #line 434 "moonshot-identity-request.c"
434                         IdCard* _tmp16_;
435                         gchar** _tmp17_;
436                         gint _tmp17__length1;
437                         gchar** _tmp18_;
438                         gint _tmp18__length1;
439                         gchar** _tmp19_ = NULL;
440                         gchar** services;
441                         gint services_length1;
442                         gint _services_size_;
443                         gchar** _tmp36_;
444                         gint _tmp36__length1;
445                         IdCard* _tmp37_;
446                         gchar** _tmp38_;
447                         gint _tmp38__length1;
448                         gchar** _tmp39_;
449                         gint _tmp39__length1;
450                         const gchar* _tmp40_;
451                         gchar* _tmp41_;
452                         gchar* _tmp42_;
453                         IdCard* _tmp43_;
454                         gchar** _tmp44_;
455                         gint _tmp44__length1;
456                         IdentityManagerApp* _tmp45_;
457                         IdentityManagerModel* _tmp46_;
458                         IdCard* _tmp47_;
459 #line 67 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
460                         _tmp16_ = id_card;
461 #line 67 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
462                         _tmp17_ = id_card_get_services (_tmp16_, &_tmp17__length1);
463 #line 67 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
464                         _tmp18_ = _tmp17_;
465 #line 67 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
466                         _tmp18__length1 = _tmp17__length1;
467 #line 67 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
468                         _tmp19_ = g_new0 (gchar*, (_tmp18__length1 + 1) + 1);
469 #line 67 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
470                         services = _tmp19_;
471 #line 67 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
472                         services_length1 = _tmp18__length1 + 1;
473 #line 67 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
474                         _services_size_ = services_length1;
475 #line 476 "moonshot-identity-request.c"
476                         {
477                                 gint i;
478 #line 69 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
479                                 i = 0;
480 #line 481 "moonshot-identity-request.c"
481                                 {
482                                         gboolean _tmp20_;
483 #line 69 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
484                                         _tmp20_ = TRUE;
485 #line 69 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
486                                         while (TRUE) {
487 #line 488 "moonshot-identity-request.c"
488                                                 gboolean _tmp21_;
489                                                 gint _tmp23_;
490                                                 IdCard* _tmp24_;
491                                                 gchar** _tmp25_;
492                                                 gint _tmp25__length1;
493                                                 gchar** _tmp26_;
494                                                 gint _tmp26__length1;
495                                                 gchar** _tmp27_;
496                                                 gint _tmp27__length1;
497                                                 gint _tmp28_;
498                                                 IdCard* _tmp29_;
499                                                 gchar** _tmp30_;
500                                                 gint _tmp30__length1;
501                                                 gchar** _tmp31_;
502                                                 gint _tmp31__length1;
503                                                 gint _tmp32_;
504                                                 const gchar* _tmp33_;
505                                                 gchar* _tmp34_;
506                                                 gchar* _tmp35_;
507 #line 69 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
508                                                 _tmp21_ = _tmp20_;
509 #line 69 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
510                                                 if (!_tmp21_) {
511 #line 512 "moonshot-identity-request.c"
512                                                         gint _tmp22_;
513 #line 69 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
514                                                         _tmp22_ = i;
515 #line 69 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
516                                                         i = _tmp22_ + 1;
517 #line 518 "moonshot-identity-request.c"
518                                                 }
519 #line 69 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
520                                                 _tmp20_ = FALSE;
521 #line 69 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
522                                                 _tmp23_ = i;
523 #line 69 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
524                                                 _tmp24_ = id_card;
525 #line 69 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
526                                                 _tmp25_ = id_card_get_services (_tmp24_, &_tmp25__length1);
527 #line 69 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
528                                                 _tmp26_ = _tmp25_;
529 #line 69 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
530                                                 _tmp26__length1 = _tmp25__length1;
531 #line 69 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
532                                                 if (!(_tmp23_ < _tmp26__length1)) {
533 #line 69 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
534                                                         break;
535 #line 536 "moonshot-identity-request.c"
536                                                 }
537 #line 70 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
538                                                 _tmp27_ = services;
539 #line 70 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
540                                                 _tmp27__length1 = services_length1;
541 #line 70 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
542                                                 _tmp28_ = i;
543 #line 70 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
544                                                 _tmp29_ = id_card;
545 #line 70 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
546                                                 _tmp30_ = id_card_get_services (_tmp29_, &_tmp30__length1);
547 #line 70 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
548                                                 _tmp31_ = _tmp30_;
549 #line 70 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
550                                                 _tmp31__length1 = _tmp30__length1;
551 #line 70 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
552                                                 _tmp32_ = i;
553 #line 70 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
554                                                 _tmp33_ = _tmp31_[_tmp32_];
555 #line 70 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
556                                                 _tmp34_ = g_strdup (_tmp33_);
557 #line 70 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
558                                                 _g_free0 (_tmp27_[_tmp28_]);
559 #line 70 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
560                                                 _tmp27_[_tmp28_] = _tmp34_;
561 #line 70 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
562                                                 _tmp35_ = _tmp27_[_tmp28_];
563 #line 564 "moonshot-identity-request.c"
564                                         }
565                                 }
566                         }
567 #line 72 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
568                         _tmp36_ = services;
569 #line 72 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
570                         _tmp36__length1 = services_length1;
571 #line 72 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
572                         _tmp37_ = id_card;
573 #line 72 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
574                         _tmp38_ = id_card_get_services (_tmp37_, &_tmp38__length1);
575 #line 72 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
576                         _tmp39_ = _tmp38_;
577 #line 72 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
578                         _tmp39__length1 = _tmp38__length1;
579 #line 72 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
580                         _tmp40_ = self->service;
581 #line 72 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
582                         _tmp41_ = g_strdup (_tmp40_);
583 #line 72 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
584                         _g_free0 (_tmp36_[_tmp39__length1]);
585 #line 72 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
586                         _tmp36_[_tmp39__length1] = _tmp41_;
587 #line 72 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
588                         _tmp42_ = _tmp36_[_tmp39__length1];
589 #line 73 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
590                         _tmp43_ = id_card;
591 #line 73 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
592                         _tmp44_ = services;
593 #line 73 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
594                         _tmp44__length1 = services_length1;
595 #line 73 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
596                         id_card_set_services (_tmp43_, _tmp44_, _tmp44__length1);
597 #line 75 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
598                         _tmp45_ = self->priv->parent_app;
599 #line 75 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
600                         _tmp46_ = _tmp45_->model;
601 #line 75 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
602                         _tmp47_ = id_card;
603 #line 75 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
604                         identity_manager_model_update_card (_tmp46_, _tmp47_);
605 #line 65 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
606                         services = (_vala_array_free (services, services_length1, (GDestroyNotify) g_free), NULL);
607 #line 608 "moonshot-identity-request.c"
608                 }
609         }
610 #line 79 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
611         _tmp48_ = self->priv->callback;
612 #line 79 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
613         _tmp48__target = self->priv->callback_target;
614 #line 79 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
615         g_return_if_fail (_tmp48_ != NULL);
616 #line 80 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
617         _tmp49_ = self->priv->callback;
618 #line 80 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
619         _tmp49__target = self->priv->callback_target;
620 #line 80 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
621         _tmp49_ (self, _tmp49__target);
622 #line 623 "moonshot-identity-request.c"
623 }
624
625
626 static void identity_request_class_init (IdentityRequestClass * klass) {
627 #line 3 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
628         identity_request_parent_class = g_type_class_peek_parent (klass);
629 #line 3 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
630         g_type_class_add_private (klass, sizeof (IdentityRequestPrivate));
631 #line 3 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
632         G_OBJECT_CLASS (klass)->finalize = identity_request_finalize;
633 #line 634 "moonshot-identity-request.c"
634 }
635
636
637 static void identity_request_instance_init (IdentityRequest * self) {
638 #line 3 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
639         self->priv = IDENTITY_REQUEST_GET_PRIVATE (self);
640 #line 4 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
641         self->id_card = NULL;
642 #line 5 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
643         self->complete = FALSE;
644 #line 6 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
645         self->select_default = FALSE;
646 #line 14 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
647         self->priv->callback = NULL;
648 #line 649 "moonshot-identity-request.c"
649 }
650
651
652 static void identity_request_finalize (GObject* obj) {
653         IdentityRequest * self;
654 #line 3 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
655         self = IDENTITY_REQUEST (obj);
656 #line 4 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
657         _g_object_unref0 (self->id_card);
658 #line 8 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
659         _identity_manager_app_unref0 (self->priv->parent_app);
660 #line 9 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
661         _g_free0 (self->nai);
662 #line 10 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
663         _g_free0 (self->password);
664 #line 11 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
665         _g_free0 (self->service);
666 #line 12 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
667         __g_slist_free__g_object_unref0_0 (self->candidates);
668 #line 14 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
669         (self->priv->callback_target_destroy_notify == NULL) ? NULL : (self->priv->callback_target_destroy_notify (self->priv->callback_target), NULL);
670 #line 14 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
671         self->priv->callback = NULL;
672 #line 14 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
673         self->priv->callback_target = NULL;
674 #line 14 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
675         self->priv->callback_target_destroy_notify = NULL;
676 #line 3 "/build/slave/packages-full/build/ui/src/moonshot-identity-request.vala"
677         G_OBJECT_CLASS (identity_request_parent_class)->finalize (obj);
678 #line 679 "moonshot-identity-request.c"
679 }
680
681
682 GType identity_request_get_type (void) {
683         static volatile gsize identity_request_type_id__volatile = 0;
684         if (g_once_init_enter (&identity_request_type_id__volatile)) {
685                 static const GTypeInfo g_define_type_info = { sizeof (IdentityRequestClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) identity_request_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (IdentityRequest), 0, (GInstanceInitFunc) identity_request_instance_init, NULL };
686                 GType identity_request_type_id;
687                 identity_request_type_id = g_type_register_static (G_TYPE_OBJECT, "IdentityRequest", &g_define_type_info, 0);
688                 g_once_init_leave (&identity_request_type_id__volatile, identity_request_type_id);
689         }
690         return identity_request_type_id__volatile;
691 }
692
693
694 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
695         if ((array != NULL) && (destroy_func != NULL)) {
696                 int i;
697                 for (i = 0; i < array_length; i = i + 1) {
698                         if (((gpointer*) array)[i] != NULL) {
699                                 destroy_func (((gpointer*) array)[i]);
700                         }
701                 }
702         }
703 }
704
705
706 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
707         _vala_array_destroy (array, array_length, destroy_func);
708         g_free (array);
709 }
710
711
712