New upstream version 1.0.3
[moonshot-ui.git] / src / moonshot-identity-request.c
1 /* moonshot-identity-request.c generated by valac 0.34.9, the Vala compiler
2  * generated from moonshot-identity-request.vala, do not modify */
3
4 /*
5  * Copyright (c) 2011-2016, JANET(UK)
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  *
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  *
19  * 3. Neither the name of JANET(UK) nor the names of its contributors
20  *    may be used to endorse or promote products derived from this software
21  *    without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
27  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33  * SUCH DAMAGE.
34 */
35
36 #include <glib.h>
37 #include <glib-object.h>
38 #include <stdlib.h>
39 #include <string.h>
40 #include <gee.h>
41 #include <gtk/gtk.h>
42
43
44 #define TYPE_IDENTITY_REQUEST (identity_request_get_type ())
45 #define IDENTITY_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IDENTITY_REQUEST, IdentityRequest))
46 #define IDENTITY_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IDENTITY_REQUEST, IdentityRequestClass))
47 #define IS_IDENTITY_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IDENTITY_REQUEST))
48 #define IS_IDENTITY_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IDENTITY_REQUEST))
49 #define IDENTITY_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IDENTITY_REQUEST, IdentityRequestClass))
50
51 typedef struct _IdentityRequest IdentityRequest;
52 typedef struct _IdentityRequestClass IdentityRequestClass;
53 typedef struct _IdentityRequestPrivate IdentityRequestPrivate;
54
55 #define TYPE_ID_CARD (id_card_get_type ())
56 #define ID_CARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ID_CARD, IdCard))
57 #define ID_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ID_CARD, IdCardClass))
58 #define IS_ID_CARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ID_CARD))
59 #define IS_ID_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ID_CARD))
60 #define ID_CARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ID_CARD, IdCardClass))
61
62 typedef struct _IdCard IdCard;
63 typedef struct _IdCardClass IdCardClass;
64
65 #define TYPE_IDENTITY_MANAGER_APP (identity_manager_app_get_type ())
66 #define IDENTITY_MANAGER_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IDENTITY_MANAGER_APP, IdentityManagerApp))
67 #define IDENTITY_MANAGER_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IDENTITY_MANAGER_APP, IdentityManagerAppClass))
68 #define IS_IDENTITY_MANAGER_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IDENTITY_MANAGER_APP))
69 #define IS_IDENTITY_MANAGER_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IDENTITY_MANAGER_APP))
70 #define IDENTITY_MANAGER_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IDENTITY_MANAGER_APP, IdentityManagerAppClass))
71
72 typedef struct _IdentityManagerApp IdentityManagerApp;
73 typedef struct _IdentityManagerAppClass IdentityManagerAppClass;
74
75 #define TYPE_MOONSHOT_LOGGER (moonshot_logger_get_type ())
76 #define MOONSHOT_LOGGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MOONSHOT_LOGGER, MoonshotLogger))
77 #define MOONSHOT_LOGGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MOONSHOT_LOGGER, MoonshotLoggerClass))
78 #define IS_MOONSHOT_LOGGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MOONSHOT_LOGGER))
79 #define IS_MOONSHOT_LOGGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MOONSHOT_LOGGER))
80 #define MOONSHOT_LOGGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MOONSHOT_LOGGER, MoonshotLoggerClass))
81
82 typedef struct _MoonshotLogger MoonshotLogger;
83 typedef struct _MoonshotLoggerClass MoonshotLoggerClass;
84 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
85 #define _identity_manager_app_unref0(var) ((var == NULL) ? NULL : (var = (identity_manager_app_unref (var), NULL)))
86 #define _g_free0(var) (var = (g_free (var), NULL))
87 #define __g_slist_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_slist_free__g_object_unref0_ (var), NULL)))
88 typedef struct _IdentityManagerAppPrivate IdentityManagerAppPrivate;
89
90 #define TYPE_IDENTITY_MANAGER_MODEL (identity_manager_model_get_type ())
91 #define IDENTITY_MANAGER_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IDENTITY_MANAGER_MODEL, IdentityManagerModel))
92 #define IDENTITY_MANAGER_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IDENTITY_MANAGER_MODEL, IdentityManagerModelClass))
93 #define IS_IDENTITY_MANAGER_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IDENTITY_MANAGER_MODEL))
94 #define IS_IDENTITY_MANAGER_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IDENTITY_MANAGER_MODEL))
95 #define IDENTITY_MANAGER_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IDENTITY_MANAGER_MODEL, IdentityManagerModelClass))
96
97 typedef struct _IdentityManagerModel IdentityManagerModel;
98 typedef struct _IdentityManagerModelClass IdentityManagerModelClass;
99
100 #define TYPE_IDENTITY_MANAGER_VIEW (identity_manager_view_get_type ())
101 #define IDENTITY_MANAGER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IDENTITY_MANAGER_VIEW, IdentityManagerView))
102 #define IDENTITY_MANAGER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IDENTITY_MANAGER_VIEW, IdentityManagerViewClass))
103 #define IS_IDENTITY_MANAGER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IDENTITY_MANAGER_VIEW))
104 #define IS_IDENTITY_MANAGER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IDENTITY_MANAGER_VIEW))
105 #define IDENTITY_MANAGER_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IDENTITY_MANAGER_VIEW, IdentityManagerViewClass))
106
107 typedef struct _IdentityManagerView IdentityManagerView;
108 typedef struct _IdentityManagerViewClass IdentityManagerViewClass;
109
110 typedef void (*ReturnIdentityCallback) (IdentityRequest* request, void* user_data);
111 struct _IdentityRequest {
112         GObject parent_instance;
113         IdentityRequestPrivate * priv;
114         IdCard* id_card;
115         gboolean complete;
116         gboolean select_default;
117         gchar* nai;
118         gchar* password;
119         gchar* service;
120         GSList* candidates;
121 };
122
123 struct _IdentityRequestClass {
124         GObjectClass parent_class;
125 };
126
127 struct _IdentityRequestPrivate {
128         IdentityManagerApp* parent_app;
129         ReturnIdentityCallback callback;
130         gpointer callback_target;
131         GDestroyNotify callback_target_destroy_notify;
132 };
133
134 struct _IdentityManagerApp {
135         GTypeInstance parent_instance;
136         volatile int ref_count;
137         IdentityManagerAppPrivate * priv;
138         IdentityManagerModel* model;
139         IdCard* default_id_card;
140         gboolean explicitly_launched;
141         IdentityManagerView* view;
142 };
143
144 struct _IdentityManagerAppClass {
145         GTypeClass parent_class;
146         void (*finalize) (IdentityManagerApp *self);
147 };
148
149
150 static gpointer identity_request_parent_class = NULL;
151 static MoonshotLogger* identity_request_logger;
152 static MoonshotLogger* identity_request_logger = NULL;
153
154 GType identity_request_get_type (void) G_GNUC_CONST;
155 GType id_card_get_type (void) G_GNUC_CONST;
156 gpointer identity_manager_app_ref (gpointer instance);
157 void identity_manager_app_unref (gpointer instance);
158 GParamSpec* param_spec_identity_manager_app (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
159 void value_set_identity_manager_app (GValue* value, gpointer v_object);
160 void value_take_identity_manager_app (GValue* value, gpointer v_object);
161 gpointer value_get_identity_manager_app (const GValue* value);
162 GType identity_manager_app_get_type (void) G_GNUC_CONST;
163 #define IDENTITY_REQUEST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_IDENTITY_REQUEST, IdentityRequestPrivate))
164 enum  {
165         IDENTITY_REQUEST_DUMMY_PROPERTY
166 };
167 GType moonshot_logger_get_type (void) G_GNUC_CONST;
168 MoonshotLogger* get_logger (const gchar* name);
169 static void _g_object_unref0_ (gpointer var);
170 static void _g_slist_free__g_object_unref0_ (GSList* self);
171 IdentityRequest* identity_request_new (IdentityManagerApp* app, const gchar* nai, const gchar* password, const gchar* service);
172 IdentityRequest* identity_request_construct (GType object_type, IdentityManagerApp* app, const gchar* nai, const gchar* password, const gchar* service);
173 IdentityRequest* identity_request_new_default (IdentityManagerApp* app);
174 IdentityRequest* identity_request_construct_default (GType object_type, IdentityManagerApp* app);
175 void identity_request_set_callback (IdentityRequest* self, ReturnIdentityCallback cb, void* cb_target, GDestroyNotify cb_target_destroy_notify);
176 gboolean identity_request_execute (IdentityRequest* self);
177 void identity_manager_app_select_identity (IdentityManagerApp* self, IdentityRequest* request);
178 void identity_request_return_identity (IdentityRequest* self, IdCard* id_card, gboolean update_card);
179 GeeArrayList* id_card_get_services (IdCard* self);
180 void moonshot_logger_trace (MoonshotLogger* self, const gchar* message, GError* e);
181 GType identity_manager_model_get_type (void) G_GNUC_CONST;
182 GType identity_manager_view_get_type (void) G_GNUC_CONST;
183 IdCard* identity_manager_model_update_card (IdentityManagerModel* self, IdCard* card);
184 static void identity_request_finalize (GObject* obj);
185
186
187 static void _g_object_unref0_ (gpointer var) {
188 #line 45 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
189         (var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
190 #line 191 "moonshot-identity-request.c"
191 }
192
193
194 static void _g_slist_free__g_object_unref0_ (GSList* self) {
195 #line 45 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
196         g_slist_foreach (self, (GFunc) _g_object_unref0_, NULL);
197 #line 45 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
198         g_slist_free (self);
199 #line 200 "moonshot-identity-request.c"
200 }
201
202
203 static gpointer _identity_manager_app_ref0 (gpointer self) {
204 #line 54 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
205         return self ? identity_manager_app_ref (self) : NULL;
206 #line 207 "moonshot-identity-request.c"
207 }
208
209
210 IdentityRequest* identity_request_construct (GType object_type, IdentityManagerApp* app, const gchar* nai, const gchar* password, const gchar* service) {
211         IdentityRequest * self = NULL;
212         IdentityManagerApp* _tmp0_ = NULL;
213         IdentityManagerApp* _tmp1_ = NULL;
214         const gchar* _tmp2_ = NULL;
215         gchar* _tmp3_ = NULL;
216         const gchar* _tmp4_ = NULL;
217         gchar* _tmp5_ = NULL;
218         const gchar* _tmp6_ = NULL;
219         gchar* _tmp7_ = NULL;
220 #line 49 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
221         g_return_val_if_fail (app != NULL, NULL);
222 #line 49 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
223         g_return_val_if_fail (nai != NULL, NULL);
224 #line 49 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
225         g_return_val_if_fail (password != NULL, NULL);
226 #line 49 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
227         g_return_val_if_fail (service != NULL, NULL);
228 #line 49 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
229         self = (IdentityRequest*) g_object_new (object_type, NULL);
230 #line 54 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
231         _tmp0_ = app;
232 #line 54 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
233         _tmp1_ = _identity_manager_app_ref0 (_tmp0_);
234 #line 54 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
235         _identity_manager_app_unref0 (self->priv->parent_app);
236 #line 54 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
237         self->priv->parent_app = _tmp1_;
238 #line 55 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
239         _tmp2_ = nai;
240 #line 55 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
241         _tmp3_ = g_strdup (_tmp2_);
242 #line 55 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
243         _g_free0 (self->nai);
244 #line 55 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
245         self->nai = _tmp3_;
246 #line 56 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
247         _tmp4_ = password;
248 #line 56 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
249         _tmp5_ = g_strdup (_tmp4_);
250 #line 56 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
251         _g_free0 (self->password);
252 #line 56 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
253         self->password = _tmp5_;
254 #line 57 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
255         _tmp6_ = service;
256 #line 57 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
257         _tmp7_ = g_strdup (_tmp6_);
258 #line 57 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
259         _g_free0 (self->service);
260 #line 57 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
261         self->service = _tmp7_;
262 #line 49 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
263         return self;
264 #line 265 "moonshot-identity-request.c"
265 }
266
267
268 IdentityRequest* identity_request_new (IdentityManagerApp* app, const gchar* nai, const gchar* password, const gchar* service) {
269 #line 49 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
270         return identity_request_construct (TYPE_IDENTITY_REQUEST, app, nai, password, service);
271 #line 272 "moonshot-identity-request.c"
272 }
273
274
275 IdentityRequest* identity_request_construct_default (GType object_type, IdentityManagerApp* app) {
276         IdentityRequest * self = NULL;
277         IdentityManagerApp* _tmp0_ = NULL;
278         IdentityManagerApp* _tmp1_ = NULL;
279 #line 60 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
280         g_return_val_if_fail (app != NULL, NULL);
281 #line 60 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
282         self = (IdentityRequest*) g_object_new (object_type, NULL);
283 #line 62 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
284         _tmp0_ = app;
285 #line 62 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
286         _tmp1_ = _identity_manager_app_ref0 (_tmp0_);
287 #line 62 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
288         _identity_manager_app_unref0 (self->priv->parent_app);
289 #line 62 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
290         self->priv->parent_app = _tmp1_;
291 #line 63 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
292         self->select_default = TRUE;
293 #line 60 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
294         return self;
295 #line 296 "moonshot-identity-request.c"
296 }
297
298
299 IdentityRequest* identity_request_new_default (IdentityManagerApp* app) {
300 #line 60 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
301         return identity_request_construct_default (TYPE_IDENTITY_REQUEST, app);
302 #line 303 "moonshot-identity-request.c"
303 }
304
305
306 void identity_request_set_callback (IdentityRequest* self, ReturnIdentityCallback cb, void* cb_target, GDestroyNotify cb_target_destroy_notify) {
307         ReturnIdentityCallback _tmp0_ = NULL;
308         void* _tmp0__target = NULL;
309         GDestroyNotify _tmp0__target_destroy_notify = NULL;
310 #line 66 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
311         g_return_if_fail (self != NULL);
312 #line 69 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
313         _tmp0_ = cb;
314 #line 69 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
315         _tmp0__target = cb_target;
316 #line 69 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
317         _tmp0__target_destroy_notify = cb_target_destroy_notify;
318 #line 69 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
319         cb = NULL;
320 #line 69 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
321         cb_target = NULL;
322 #line 69 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
323         cb_target_destroy_notify = NULL;
324 #line 69 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
325         (self->priv->callback_target_destroy_notify == NULL) ? NULL : (self->priv->callback_target_destroy_notify (self->priv->callback_target), NULL);
326 #line 69 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
327         self->priv->callback = NULL;
328 #line 69 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
329         self->priv->callback_target = NULL;
330 #line 69 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
331         self->priv->callback_target_destroy_notify = NULL;
332 #line 69 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
333         self->priv->callback = _tmp0_;
334 #line 69 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
335         self->priv->callback_target = _tmp0__target;
336 #line 69 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
337         self->priv->callback_target_destroy_notify = _tmp0__target_destroy_notify;
338 #line 66 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
339         (cb_target_destroy_notify == NULL) ? NULL : (cb_target_destroy_notify (cb_target), NULL);
340 #line 66 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
341         cb = NULL;
342 #line 66 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
343         cb_target = NULL;
344 #line 66 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
345         cb_target_destroy_notify = NULL;
346 #line 347 "moonshot-identity-request.c"
347 }
348
349
350 gboolean identity_request_execute (IdentityRequest* self) {
351         gboolean result = FALSE;
352         IdentityManagerApp* _tmp0_ = NULL;
353 #line 75 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
354         g_return_val_if_fail (self != NULL, FALSE);
355 #line 76 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
356         _tmp0_ = self->priv->parent_app;
357 #line 76 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
358         identity_manager_app_select_identity (_tmp0_, self);
359 #line 81 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
360         result = FALSE;
361 #line 81 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
362         return result;
363 #line 364 "moonshot-identity-request.c"
364 }
365
366
367 static gpointer _g_object_ref0 (gpointer self) {
368 #line 85 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
369         return self ? g_object_ref (self) : NULL;
370 #line 371 "moonshot-identity-request.c"
371 }
372
373
374 static gchar* bool_to_string (gboolean self) {
375         gchar* result = NULL;
376 #line 37 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
377         if (self) {
378 #line 379 "moonshot-identity-request.c"
379                 gchar* _tmp0_ = NULL;
380 #line 38 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
381                 _tmp0_ = g_strdup ("true");
382 #line 38 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
383                 result = _tmp0_;
384 #line 38 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
385                 return result;
386 #line 387 "moonshot-identity-request.c"
387         } else {
388                 gchar* _tmp1_ = NULL;
389 #line 40 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
390                 _tmp1_ = g_strdup ("false");
391 #line 40 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
392                 result = _tmp1_;
393 #line 40 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
394                 return result;
395 #line 396 "moonshot-identity-request.c"
396         }
397 }
398
399
400 void identity_request_return_identity (IdentityRequest* self, IdCard* id_card, gboolean update_card) {
401         IdCard* _tmp0_ = NULL;
402         IdCard* _tmp1_ = NULL;
403         gboolean _tmp2_ = FALSE;
404         gboolean _tmp3_ = FALSE;
405         gboolean _tmp4_ = FALSE;
406         gboolean _tmp5_ = FALSE;
407         ReturnIdentityCallback _tmp31_ = NULL;
408         void* _tmp31__target = NULL;
409         MoonshotLogger* _tmp32_ = NULL;
410         ReturnIdentityCallback _tmp33_ = NULL;
411         void* _tmp33__target = NULL;
412 #line 84 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
413         g_return_if_fail (self != NULL);
414 #line 85 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
415         _tmp0_ = id_card;
416 #line 85 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
417         _tmp1_ = _g_object_ref0 (_tmp0_);
418 #line 85 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
419         _g_object_unref0 (self->id_card);
420 #line 85 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
421         self->id_card = _tmp1_;
422 #line 86 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
423         self->complete = TRUE;
424 #line 89 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
425         _tmp5_ = update_card;
426 #line 89 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
427         if (_tmp5_) {
428 #line 429 "moonshot-identity-request.c"
429                 IdCard* _tmp6_ = NULL;
430 #line 89 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
431                 _tmp6_ = id_card;
432 #line 89 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
433                 _tmp4_ = _tmp6_ != NULL;
434 #line 435 "moonshot-identity-request.c"
435         } else {
436 #line 89 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
437                 _tmp4_ = FALSE;
438 #line 439 "moonshot-identity-request.c"
439         }
440 #line 89 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
441         if (_tmp4_) {
442 #line 443 "moonshot-identity-request.c"
443                 const gchar* _tmp7_ = NULL;
444 #line 89 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
445                 _tmp7_ = self->service;
446 #line 89 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
447                 _tmp3_ = _tmp7_ != NULL;
448 #line 449 "moonshot-identity-request.c"
449         } else {
450 #line 89 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
451                 _tmp3_ = FALSE;
452 #line 453 "moonshot-identity-request.c"
453         }
454 #line 89 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
455         if (_tmp3_) {
456 #line 457 "moonshot-identity-request.c"
457                 const gchar* _tmp8_ = NULL;
458 #line 89 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
459                 _tmp8_ = self->service;
460 #line 89 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
461                 _tmp2_ = g_strcmp0 (_tmp8_, "") != 0;
462 #line 463 "moonshot-identity-request.c"
463         } else {
464 #line 89 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
465                 _tmp2_ = FALSE;
466 #line 467 "moonshot-identity-request.c"
467         }
468 #line 89 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
469         if (_tmp2_) {
470 #line 471 "moonshot-identity-request.c"
471                 gboolean duplicate_service = FALSE;
472                 IdCard* _tmp9_ = NULL;
473                 GeeArrayList* _tmp10_ = NULL;
474                 GeeArrayList* _tmp11_ = NULL;
475                 const gchar* _tmp12_ = NULL;
476                 gboolean _tmp13_ = FALSE;
477                 MoonshotLogger* _tmp14_ = NULL;
478                 gboolean _tmp15_ = FALSE;
479                 gchar* _tmp16_ = NULL;
480                 gchar* _tmp17_ = NULL;
481                 gchar* _tmp18_ = NULL;
482                 gchar* _tmp19_ = NULL;
483                 gboolean _tmp20_ = FALSE;
484 #line 91 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
485                 _tmp9_ = id_card;
486 #line 91 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
487                 _tmp10_ = id_card_get_services (_tmp9_);
488 #line 91 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
489                 _tmp11_ = _tmp10_;
490 #line 91 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
491                 _tmp12_ = self->service;
492 #line 91 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
493                 _tmp13_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp11_, _tmp12_);
494 #line 91 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
495                 duplicate_service = _tmp13_;
496 #line 92 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
497                 _tmp14_ = identity_request_logger;
498 #line 92 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
499                 _tmp15_ = duplicate_service;
500 #line 92 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
501                 _tmp16_ = bool_to_string (_tmp15_);
502 #line 92 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
503                 _tmp17_ = _tmp16_;
504 #line 92 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
505                 _tmp18_ = g_strconcat ("return_identity: duplicate_service=", _tmp17_, NULL);
506 #line 92 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
507                 _tmp19_ = _tmp18_;
508 #line 92 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
509                 moonshot_logger_trace (_tmp14_, _tmp19_, NULL);
510 #line 92 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
511                 _g_free0 (_tmp19_);
512 #line 92 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
513                 _g_free0 (_tmp17_);
514 #line 93 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
515                 _tmp20_ = duplicate_service;
516 #line 93 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
517                 if (_tmp20_ == FALSE) {
518 #line 519 "moonshot-identity-request.c"
519                         MoonshotLogger* _tmp21_ = NULL;
520                         IdCard* _tmp22_ = NULL;
521                         GeeArrayList* _tmp23_ = NULL;
522                         GeeArrayList* _tmp24_ = NULL;
523                         const gchar* _tmp25_ = NULL;
524                         MoonshotLogger* _tmp26_ = NULL;
525                         IdentityManagerApp* _tmp27_ = NULL;
526                         IdentityManagerModel* _tmp28_ = NULL;
527                         IdCard* _tmp29_ = NULL;
528                         IdCard* _tmp30_ = NULL;
529 #line 95 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
530                         _tmp21_ = identity_request_logger;
531 #line 95 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
532                         moonshot_logger_trace (_tmp21_, "return_identity: calling add_service", NULL);
533 #line 96 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
534                         _tmp22_ = id_card;
535 #line 96 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
536                         _tmp23_ = id_card_get_services (_tmp22_);
537 #line 96 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
538                         _tmp24_ = _tmp23_;
539 #line 96 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
540                         _tmp25_ = self->service;
541 #line 96 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
542                         gee_abstract_collection_add ((GeeAbstractCollection*) _tmp24_, _tmp25_);
543 #line 97 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
544                         _tmp26_ = identity_request_logger;
545 #line 97 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
546                         moonshot_logger_trace (_tmp26_, "return_identity: back from add_service", NULL);
547 #line 99 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
548                         _tmp27_ = self->priv->parent_app;
549 #line 99 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
550                         _tmp28_ = _tmp27_->model;
551 #line 99 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
552                         _tmp29_ = id_card;
553 #line 99 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
554                         _tmp30_ = identity_manager_model_update_card (_tmp28_, _tmp29_);
555 #line 99 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
556                         _g_object_unref0 (self->id_card);
557 #line 99 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
558                         self->id_card = _tmp30_;
559 #line 560 "moonshot-identity-request.c"
560                 }
561         }
562 #line 103 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
563         _tmp31_ = self->priv->callback;
564 #line 103 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
565         _tmp31__target = self->priv->callback_target;
566 #line 103 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
567         g_return_if_fail (_tmp31_ != NULL);
568 #line 104 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
569         _tmp32_ = identity_request_logger;
570 #line 104 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
571         moonshot_logger_trace (_tmp32_, "return_identity: invoking callback", NULL);
572 #line 105 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
573         _tmp33_ = self->priv->callback;
574 #line 105 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
575         _tmp33__target = self->priv->callback_target;
576 #line 105 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
577         _tmp33_ (self, _tmp33__target);
578 #line 579 "moonshot-identity-request.c"
579 }
580
581
582 static void identity_request_class_init (IdentityRequestClass * klass) {
583         MoonshotLogger* _tmp0_ = NULL;
584 #line 34 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
585         identity_request_parent_class = g_type_class_peek_parent (klass);
586 #line 34 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
587         g_type_class_add_private (klass, sizeof (IdentityRequestPrivate));
588 #line 34 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
589         G_OBJECT_CLASS (klass)->finalize = identity_request_finalize;
590 #line 35 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
591         _tmp0_ = get_logger ("IdentityRequest");
592 #line 35 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
593         identity_request_logger = _tmp0_;
594 #line 595 "moonshot-identity-request.c"
595 }
596
597
598 static void identity_request_instance_init (IdentityRequest * self) {
599 #line 34 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
600         self->priv = IDENTITY_REQUEST_GET_PRIVATE (self);
601 #line 37 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
602         self->id_card = NULL;
603 #line 38 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
604         self->complete = FALSE;
605 #line 39 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
606         self->select_default = FALSE;
607 #line 47 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
608         self->priv->callback = NULL;
609 #line 47 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
610         self->priv->callback_target = self;
611 #line 47 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
612         self->priv->callback_target_destroy_notify = NULL;
613 #line 614 "moonshot-identity-request.c"
614 }
615
616
617 static void identity_request_finalize (GObject* obj) {
618         IdentityRequest * self;
619 #line 34 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
620         self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_IDENTITY_REQUEST, IdentityRequest);
621 #line 37 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
622         _g_object_unref0 (self->id_card);
623 #line 41 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
624         _identity_manager_app_unref0 (self->priv->parent_app);
625 #line 42 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
626         _g_free0 (self->nai);
627 #line 43 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
628         _g_free0 (self->password);
629 #line 44 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
630         _g_free0 (self->service);
631 #line 45 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
632         __g_slist_free__g_object_unref0_0 (self->candidates);
633 #line 47 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
634         (self->priv->callback_target_destroy_notify == NULL) ? NULL : (self->priv->callback_target_destroy_notify (self->priv->callback_target), NULL);
635 #line 47 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
636         self->priv->callback = NULL;
637 #line 47 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
638         self->priv->callback_target = NULL;
639 #line 47 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
640         self->priv->callback_target_destroy_notify = NULL;
641 #line 34 "/home/hartmans/moonshot/moonshot/ui/src/moonshot-identity-request.vala"
642         G_OBJECT_CLASS (identity_request_parent_class)->finalize (obj);
643 #line 644 "moonshot-identity-request.c"
644 }
645
646
647 GType identity_request_get_type (void) {
648         static volatile gsize identity_request_type_id__volatile = 0;
649         if (g_once_init_enter (&identity_request_type_id__volatile)) {
650                 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 };
651                 GType identity_request_type_id;
652                 identity_request_type_id = g_type_register_static (G_TYPE_OBJECT, "IdentityRequest", &g_define_type_info, 0);
653                 g_once_init_leave (&identity_request_type_id__volatile, identity_request_type_id);
654         }
655         return identity_request_type_id__volatile;
656 }
657
658
659