regenerate artifacts
[moonshot-ui.git] / src / moonshot-custom-vbox.c
1 /* moonshot-custom-vbox.c generated by valac 0.10.4, the Vala compiler
2  * generated from moonshot-custom-vbox.vala, do not modify */
3
4
5 #include <glib.h>
6 #include <glib-object.h>
7 #include <gtk/gtk.h>
8
9
10 #define TYPE_CUSTOM_VBOX (custom_vbox_get_type ())
11 #define CUSTOM_VBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CUSTOM_VBOX, CustomVBox))
12 #define CUSTOM_VBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CUSTOM_VBOX, CustomVBoxClass))
13 #define IS_CUSTOM_VBOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CUSTOM_VBOX))
14 #define IS_CUSTOM_VBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CUSTOM_VBOX))
15 #define CUSTOM_VBOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CUSTOM_VBOX, CustomVBoxClass))
16
17 typedef struct _CustomVBox CustomVBox;
18 typedef struct _CustomVBoxClass CustomVBoxClass;
19 typedef struct _CustomVBoxPrivate CustomVBoxPrivate;
20
21 #define TYPE_ID_CARD_WIDGET (id_card_widget_get_type ())
22 #define ID_CARD_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ID_CARD_WIDGET, IdCardWidget))
23 #define ID_CARD_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ID_CARD_WIDGET, IdCardWidgetClass))
24 #define IS_ID_CARD_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ID_CARD_WIDGET))
25 #define IS_ID_CARD_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ID_CARD_WIDGET))
26 #define ID_CARD_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ID_CARD_WIDGET, IdCardWidgetClass))
27
28 typedef struct _IdCardWidget IdCardWidget;
29 typedef struct _IdCardWidgetClass IdCardWidgetClass;
30
31 #define TYPE_IDENTITY_MANAGER_VIEW (identity_manager_view_get_type ())
32 #define IDENTITY_MANAGER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IDENTITY_MANAGER_VIEW, IdentityManagerView))
33 #define IDENTITY_MANAGER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IDENTITY_MANAGER_VIEW, IdentityManagerViewClass))
34 #define IS_IDENTITY_MANAGER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IDENTITY_MANAGER_VIEW))
35 #define IS_IDENTITY_MANAGER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IDENTITY_MANAGER_VIEW))
36 #define IDENTITY_MANAGER_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IDENTITY_MANAGER_VIEW, IdentityManagerViewClass))
37
38 typedef struct _IdentityManagerView IdentityManagerView;
39 typedef struct _IdentityManagerViewClass IdentityManagerViewClass;
40 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
41 typedef struct _IdentityManagerViewPrivate IdentityManagerViewPrivate;
42
43 #define TYPE_IDENTITY_MANAGER_APP (identity_manager_app_get_type ())
44 #define IDENTITY_MANAGER_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IDENTITY_MANAGER_APP, IdentityManagerApp))
45 #define IDENTITY_MANAGER_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IDENTITY_MANAGER_APP, IdentityManagerAppClass))
46 #define IS_IDENTITY_MANAGER_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IDENTITY_MANAGER_APP))
47 #define IS_IDENTITY_MANAGER_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IDENTITY_MANAGER_APP))
48 #define IDENTITY_MANAGER_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IDENTITY_MANAGER_APP, IdentityManagerAppClass))
49
50 typedef struct _IdentityManagerApp IdentityManagerApp;
51 typedef struct _IdentityManagerAppClass IdentityManagerAppClass;
52
53 #define TYPE_IDENTITY_MANAGER_MODEL (identity_manager_model_get_type ())
54 #define IDENTITY_MANAGER_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IDENTITY_MANAGER_MODEL, IdentityManagerModel))
55 #define IDENTITY_MANAGER_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IDENTITY_MANAGER_MODEL, IdentityManagerModelClass))
56 #define IS_IDENTITY_MANAGER_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IDENTITY_MANAGER_MODEL))
57 #define IS_IDENTITY_MANAGER_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IDENTITY_MANAGER_MODEL))
58 #define IDENTITY_MANAGER_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IDENTITY_MANAGER_MODEL, IdentityManagerModelClass))
59
60 typedef struct _IdentityManagerModel IdentityManagerModel;
61 typedef struct _IdentityManagerModelClass IdentityManagerModelClass;
62
63 #define TYPE_IDENTITY_REQUEST (identity_request_get_type ())
64 #define IDENTITY_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IDENTITY_REQUEST, IdentityRequest))
65 #define IDENTITY_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IDENTITY_REQUEST, IdentityRequestClass))
66 #define IS_IDENTITY_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IDENTITY_REQUEST))
67 #define IS_IDENTITY_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IDENTITY_REQUEST))
68 #define IDENTITY_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IDENTITY_REQUEST, IdentityRequestClass))
69
70 typedef struct _IdentityRequest IdentityRequest;
71 typedef struct _IdentityRequestClass IdentityRequestClass;
72 #define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
73
74 struct _CustomVBox {
75         GtkVBox parent_instance;
76         CustomVBoxPrivate * priv;
77 };
78
79 struct _CustomVBoxClass {
80         GtkVBoxClass parent_class;
81 };
82
83 struct _CustomVBoxPrivate {
84         IdCardWidget* _current_idcard;
85         IdentityManagerView* main_window;
86 };
87
88 struct _IdentityManagerView {
89         GtkWindow parent_instance;
90         IdentityManagerViewPrivate * priv;
91         IdentityManagerApp* parent_app;
92         IdentityManagerModel* identities_manager;
93         GQueue* request_queue;
94 };
95
96 struct _IdentityManagerViewClass {
97         GtkWindowClass parent_class;
98 };
99
100
101 static gpointer custom_vbox_parent_class = NULL;
102
103 GType custom_vbox_get_type (void) G_GNUC_CONST;
104 GType id_card_widget_get_type (void) G_GNUC_CONST;
105 GType identity_manager_view_get_type (void) G_GNUC_CONST;
106 #define CUSTOM_VBOX_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_CUSTOM_VBOX, CustomVBoxPrivate))
107 enum  {
108         CUSTOM_VBOX_DUMMY_PROPERTY,
109         CUSTOM_VBOX_CURRENT_IDCARD
110 };
111 CustomVBox* custom_vbox_new (IdentityManagerView* window, gboolean homogeneous, gint spacing);
112 CustomVBox* custom_vbox_construct (GType object_type, IdentityManagerView* window, gboolean homogeneous, gint spacing);
113 void custom_vbox_receive_expanded_event (CustomVBox* self, IdCardWidget* id_card_widget);
114 void id_card_widget_collapse (IdCardWidget* self);
115 void custom_vbox_set_current_idcard (CustomVBox* self, IdCardWidget* value);
116 IdCardWidget* custom_vbox_get_current_idcard (CustomVBox* self);
117 gpointer identity_manager_app_ref (gpointer instance);
118 void identity_manager_app_unref (gpointer instance);
119 GParamSpec* param_spec_identity_manager_app (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
120 void value_set_identity_manager_app (GValue* value, gpointer v_object);
121 void value_take_identity_manager_app (GValue* value, gpointer v_object);
122 gpointer value_get_identity_manager_app (const GValue* value);
123 GType identity_manager_app_get_type (void) G_GNUC_CONST;
124 GType identity_manager_model_get_type (void) G_GNUC_CONST;
125 GType identity_request_get_type (void) G_GNUC_CONST;
126 GtkButton* id_card_widget_get_send_button (IdCardWidget* self);
127 void custom_vbox_add_id_card_widget (CustomVBox* self, IdCardWidget* id_card_widget);
128 void custom_vbox_remove_id_card_widget (CustomVBox* self, IdCardWidget* id_card_widget);
129 static void custom_vbox_finalize (GObject* obj);
130 static void custom_vbox_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
131 static void custom_vbox_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
132
133
134
135 static gpointer _g_object_ref0 (gpointer self) {
136         return self ? g_object_ref (self) : NULL;
137 }
138
139
140 #line 8 "moonshot-custom-vbox.vala"
141 CustomVBox* custom_vbox_construct (GType object_type, IdentityManagerView* window, gboolean homogeneous, gint spacing) {
142 #line 143 "moonshot-custom-vbox.c"
143         CustomVBox * self;
144         IdentityManagerView* _tmp0_;
145 #line 8 "moonshot-custom-vbox.vala"
146         g_return_val_if_fail (window != NULL, NULL);
147 #line 148 "moonshot-custom-vbox.c"
148         self = g_object_newv (object_type, 0, NULL);
149 #line 10 "moonshot-custom-vbox.vala"
150         self->priv->main_window = (_tmp0_ = _g_object_ref0 (window), _g_object_unref0 (self->priv->main_window), _tmp0_);
151 #line 11 "moonshot-custom-vbox.vala"
152         gtk_box_set_homogeneous ((GtkBox*) self, homogeneous);
153 #line 12 "moonshot-custom-vbox.vala"
154         gtk_box_set_spacing ((GtkBox*) self, spacing);
155 #line 156 "moonshot-custom-vbox.c"
156         return self;
157 }
158
159
160 #line 8 "moonshot-custom-vbox.vala"
161 CustomVBox* custom_vbox_new (IdentityManagerView* window, gboolean homogeneous, gint spacing) {
162 #line 8 "moonshot-custom-vbox.vala"
163         return custom_vbox_construct (TYPE_CUSTOM_VBOX, window, homogeneous, spacing);
164 #line 165 "moonshot-custom-vbox.c"
165 }
166
167
168 #line 15 "moonshot-custom-vbox.vala"
169 void custom_vbox_receive_expanded_event (CustomVBox* self, IdCardWidget* id_card_widget) {
170 #line 171 "moonshot-custom-vbox.c"
171         GList* list;
172         gboolean _tmp0_ = FALSE;
173 #line 15 "moonshot-custom-vbox.vala"
174         g_return_if_fail (self != NULL);
175 #line 15 "moonshot-custom-vbox.vala"
176         g_return_if_fail (id_card_widget != NULL);
177 #line 17 "moonshot-custom-vbox.vala"
178         list = gtk_container_get_children ((GtkContainer*) self);
179 #line 180 "moonshot-custom-vbox.c"
180         {
181                 GList* id_card_collection;
182                 GList* id_card_it;
183 #line 18 "moonshot-custom-vbox.vala"
184                 id_card_collection = list;
185 #line 186 "moonshot-custom-vbox.c"
186                 for (id_card_it = id_card_collection; id_card_it != NULL; id_card_it = id_card_it->next) {
187                         GtkWidget* id_card;
188 #line 18 "moonshot-custom-vbox.vala"
189                         id_card = _g_object_ref0 ((GtkWidget*) id_card_it->data);
190 #line 191 "moonshot-custom-vbox.c"
191                         {
192 #line 20 "moonshot-custom-vbox.vala"
193                                 if (id_card != GTK_WIDGET (id_card_widget)) {
194 #line 21 "moonshot-custom-vbox.vala"
195                                         id_card_widget_collapse (ID_CARD_WIDGET (id_card));
196 #line 197 "moonshot-custom-vbox.c"
197                                 }
198                                 _g_object_unref0 (id_card);
199                         }
200                 }
201         }
202 #line 23 "moonshot-custom-vbox.vala"
203         custom_vbox_set_current_idcard (self, id_card_widget);
204 #line 25 "moonshot-custom-vbox.vala"
205         if (self->priv->_current_idcard != NULL) {
206 #line 25 "moonshot-custom-vbox.vala"
207                 _tmp0_ = self->priv->main_window->request_queue->length > 0;
208 #line 209 "moonshot-custom-vbox.c"
209         } else {
210 #line 25 "moonshot-custom-vbox.vala"
211                 _tmp0_ = FALSE;
212 #line 213 "moonshot-custom-vbox.c"
213         }
214 #line 25 "moonshot-custom-vbox.vala"
215         if (_tmp0_) {
216 #line 26 "moonshot-custom-vbox.vala"
217                 gtk_widget_set_sensitive ((GtkWidget*) id_card_widget_get_send_button (self->priv->_current_idcard), TRUE);
218 #line 219 "moonshot-custom-vbox.c"
219         }
220         _g_list_free0 (list);
221 }
222
223
224 #line 29 "moonshot-custom-vbox.vala"
225 void custom_vbox_add_id_card_widget (CustomVBox* self, IdCardWidget* id_card_widget) {
226 #line 29 "moonshot-custom-vbox.vala"
227         g_return_if_fail (self != NULL);
228 #line 29 "moonshot-custom-vbox.vala"
229         g_return_if_fail (id_card_widget != NULL);
230 #line 31 "moonshot-custom-vbox.vala"
231         gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) id_card_widget, FALSE, FALSE, 0);
232 #line 233 "moonshot-custom-vbox.c"
233 }
234
235
236 #line 34 "moonshot-custom-vbox.vala"
237 void custom_vbox_remove_id_card_widget (CustomVBox* self, IdCardWidget* id_card_widget) {
238 #line 34 "moonshot-custom-vbox.vala"
239         g_return_if_fail (self != NULL);
240 #line 34 "moonshot-custom-vbox.vala"
241         g_return_if_fail (id_card_widget != NULL);
242 #line 36 "moonshot-custom-vbox.vala"
243         gtk_container_remove ((GtkContainer*) self, (GtkWidget*) id_card_widget);
244 #line 245 "moonshot-custom-vbox.c"
245 }
246
247
248 IdCardWidget* custom_vbox_get_current_idcard (CustomVBox* self) {
249         IdCardWidget* result;
250         g_return_val_if_fail (self != NULL, NULL);
251         result = self->priv->_current_idcard;
252 #line 5 "moonshot-custom-vbox.vala"
253         return result;
254 #line 255 "moonshot-custom-vbox.c"
255 }
256
257
258 void custom_vbox_set_current_idcard (CustomVBox* self, IdCardWidget* value) {
259         IdCardWidget* _tmp0_;
260         g_return_if_fail (self != NULL);
261         self->priv->_current_idcard = (_tmp0_ = _g_object_ref0 (value), _g_object_unref0 (self->priv->_current_idcard), _tmp0_);
262         g_object_notify ((GObject *) self, "current-idcard");
263 }
264
265
266 static void custom_vbox_class_init (CustomVBoxClass * klass) {
267         custom_vbox_parent_class = g_type_class_peek_parent (klass);
268         g_type_class_add_private (klass, sizeof (CustomVBoxPrivate));
269         G_OBJECT_CLASS (klass)->get_property = custom_vbox_get_property;
270         G_OBJECT_CLASS (klass)->set_property = custom_vbox_set_property;
271         G_OBJECT_CLASS (klass)->finalize = custom_vbox_finalize;
272         g_object_class_install_property (G_OBJECT_CLASS (klass), CUSTOM_VBOX_CURRENT_IDCARD, g_param_spec_object ("current-idcard", "current-idcard", "current-idcard", TYPE_ID_CARD_WIDGET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
273 }
274
275
276 static void custom_vbox_instance_init (CustomVBox * self) {
277         self->priv = CUSTOM_VBOX_GET_PRIVATE (self);
278         self->priv->_current_idcard = NULL;
279 }
280
281
282 static void custom_vbox_finalize (GObject* obj) {
283         CustomVBox * self;
284         self = CUSTOM_VBOX (obj);
285         _g_object_unref0 (self->priv->_current_idcard);
286         _g_object_unref0 (self->priv->main_window);
287         G_OBJECT_CLASS (custom_vbox_parent_class)->finalize (obj);
288 }
289
290
291 GType custom_vbox_get_type (void) {
292         static volatile gsize custom_vbox_type_id__volatile = 0;
293         if (g_once_init_enter (&custom_vbox_type_id__volatile)) {
294                 static const GTypeInfo g_define_type_info = { sizeof (CustomVBoxClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) custom_vbox_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CustomVBox), 0, (GInstanceInitFunc) custom_vbox_instance_init, NULL };
295                 GType custom_vbox_type_id;
296                 custom_vbox_type_id = g_type_register_static (GTK_TYPE_VBOX, "CustomVBox", &g_define_type_info, 0);
297                 g_once_init_leave (&custom_vbox_type_id__volatile, custom_vbox_type_id);
298         }
299         return custom_vbox_type_id__volatile;
300 }
301
302
303 static void custom_vbox_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
304         CustomVBox * self;
305         self = CUSTOM_VBOX (object);
306         switch (property_id) {
307                 case CUSTOM_VBOX_CURRENT_IDCARD:
308                 g_value_set_object (value, custom_vbox_get_current_idcard (self));
309                 break;
310                 default:
311                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
312                 break;
313         }
314 }
315
316
317 static void custom_vbox_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
318         CustomVBox * self;
319         self = CUSTOM_VBOX (object);
320         switch (property_id) {
321                 case CUSTOM_VBOX_CURRENT_IDCARD:
322                 custom_vbox_set_current_idcard (self, g_value_get_object (value));
323                 break;
324                 default:
325                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
326                 break;
327         }
328 }
329
330
331
332