summaryrefslogtreecommitdiff
path: root/src/Application.c
blob: edc55d205375ad57ce43fee5314ea1c95f3c9f71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
/* Application.c generated by valac 0.34.4, the Vala compiler
 * generated from Application.vala, do not modify */

/* Copyright 2016 Software Freedom Conservancy Inc.
 *
 * This software is licensed under the GNU Lesser General Public License
 * (version 2.1 or later).  See the COPYING file in this distribution.
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <gobject/gvaluecollector.h>


#define TYPE_APPLICATION (application_get_type ())
#define APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_APPLICATION, Application))
#define APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_APPLICATION, ApplicationClass))
#define IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_APPLICATION))
#define IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_APPLICATION))
#define APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_APPLICATION, ApplicationClass))

typedef struct _Application Application;
typedef struct _ApplicationClass ApplicationClass;
typedef struct _ApplicationPrivate ApplicationPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _application_unref0(var) ((var == NULL) ? NULL : (var = (application_unref (var), NULL)))

#define TYPE_PAGE_WINDOW (page_window_get_type ())
#define PAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PAGE_WINDOW, PageWindow))
#define PAGE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PAGE_WINDOW, PageWindowClass))
#define IS_PAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PAGE_WINDOW))
#define IS_PAGE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PAGE_WINDOW))
#define PAGE_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PAGE_WINDOW, PageWindowClass))

typedef struct _PageWindow PageWindow;
typedef struct _PageWindowClass PageWindowClass;

#define TYPE_APP_WINDOW (app_window_get_type ())
#define APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_APP_WINDOW, AppWindow))
#define APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_APP_WINDOW, AppWindowClass))
#define IS_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_APP_WINDOW))
#define IS_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_APP_WINDOW))
#define APP_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_APP_WINDOW, AppWindowClass))

typedef struct _AppWindow AppWindow;
typedef struct _AppWindowClass AppWindowClass;

#define TYPE_LIBRARY_WINDOW (library_window_get_type ())
#define LIBRARY_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LIBRARY_WINDOW, LibraryWindow))
#define LIBRARY_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LIBRARY_WINDOW, LibraryWindowClass))
#define IS_LIBRARY_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LIBRARY_WINDOW))
#define IS_LIBRARY_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LIBRARY_WINDOW))
#define LIBRARY_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LIBRARY_WINDOW, LibraryWindowClass))

typedef struct _LibraryWindow LibraryWindow;
typedef struct _LibraryWindowClass LibraryWindowClass;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _ParamSpecApplication ParamSpecApplication;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _Application {
	GTypeInstance parent_instance;
	volatile int ref_count;
	ApplicationPrivate * priv;
};

struct _ApplicationClass {
	GTypeClass parent_class;
	void (*finalize) (Application *self);
	void (*starting) (Application* self);
	void (*exiting) (Application* self, gboolean panicked);
	void (*init_done) (Application* self);
};

struct _ApplicationPrivate {
	GtkApplication* system_app;
	gint system_app_run_retval;
	gboolean direct;
	gboolean fixup_raw_thumbs;
	gboolean running;
	gboolean exiting_fired;
};

struct _ParamSpecApplication {
	GParamSpec parent_instance;
};


static gpointer application_parent_class = NULL;
static Application* application_instance;
static Application* application_instance = NULL;

gpointer application_ref (gpointer instance);
void application_unref (gpointer instance);
GParamSpec* param_spec_application (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_application (GValue* value, gpointer v_object);
void value_take_application (GValue* value, gpointer v_object);
gpointer value_get_application (const GValue* value);
GType application_get_type (void) G_GNUC_CONST;
#define APPLICATION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_APPLICATION, ApplicationPrivate))
enum  {
	APPLICATION_DUMMY_PROPERTY
};
void application_set_raw_thumbs_fix_required (Application* self, gboolean should_fixup);
gboolean application_get_raw_thumbs_fix_required (Application* self);
GtkApplication* application_get_system_app (Application* self);
static Application* application_new (gboolean is_direct);
static Application* application_construct (GType object_type, gboolean is_direct);
void application_panic (Application* self);
gint application_on_command_line (GApplicationCommandLine* acl);
static gint _application_on_command_line_g_application_command_line (GApplication* _sender, GApplicationCommandLine* command_line, gpointer self);
void application_on_activated (void);
static void _application_on_activated_g_application_activate (GApplication* _sender, gpointer self);
static void _application_on_activated_g_application_startup (GApplication* _sender, gpointer self);
void application_send_to_primary_instance (gchar** argv, int argv_length1);
Application* application_get_instance (void);
void application_present_primary_instance (void);
gboolean application_get_is_remote (void);
gboolean application_get_is_direct (void);
void application_set_accels_for_action (const gchar* action, gchar** accel, int accel_length1);
void application_set_menubar (GMenuModel* model);
GType page_window_get_type (void) G_GNUC_CONST;
GType app_window_get_type (void) G_GNUC_CONST;
GType library_window_get_type (void) G_GNUC_CONST;
AppWindow* app_window_get_instance (void);
LibraryWindow* library_window_get_app (void);
void library_window_mounted_camera_shell_notification (LibraryWindow* self, const gchar* uri, gboolean at_startup);
void application_init (gboolean is_direct);
void application_terminate (void);
void application_exit (Application* self);
void application_start (Application* self, gchar** argv, int argv_length1);
guint application_inhibit (Application* self, GtkApplicationInhibitFlags what, const gchar* reason);
void application_uninhibit (Application* self, guint cookie);
gint application_get_run_return_value (Application* self);
static void application_real_starting (Application* self);
static void application_real_exiting (Application* self, gboolean panicked);
static void application_real_init_done (Application* self);
static void application_finalize (Application* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


void application_set_raw_thumbs_fix_required (Application* self, gboolean should_fixup) {
	gboolean _tmp0_ = FALSE;
#line 24 "/home/jens/Source/shotwell/src/Application.vala"
	g_return_if_fail (IS_APPLICATION (self));
#line 25 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp0_ = should_fixup;
#line 25 "/home/jens/Source/shotwell/src/Application.vala"
	self->priv->fixup_raw_thumbs = _tmp0_;
#line 160 "Application.c"
}


gboolean application_get_raw_thumbs_fix_required (Application* self) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
#line 28 "/home/jens/Source/shotwell/src/Application.vala"
	g_return_val_if_fail (IS_APPLICATION (self), FALSE);
#line 29 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp0_ = self->priv->fixup_raw_thumbs;
#line 29 "/home/jens/Source/shotwell/src/Application.vala"
	result = _tmp0_;
#line 29 "/home/jens/Source/shotwell/src/Application.vala"
	return result;
#line 175 "Application.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 33 "/home/jens/Source/shotwell/src/Application.vala"
	return self ? g_object_ref (self) : NULL;
#line 182 "Application.c"
}


GtkApplication* application_get_system_app (Application* self) {
	GtkApplication* result = NULL;
	GtkApplication* _tmp0_ = NULL;
	GtkApplication* _tmp1_ = NULL;
#line 32 "/home/jens/Source/shotwell/src/Application.vala"
	g_return_val_if_fail (IS_APPLICATION (self), NULL);
#line 33 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp0_ = self->priv->system_app;
#line 33 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 33 "/home/jens/Source/shotwell/src/Application.vala"
	result = _tmp1_;
#line 33 "/home/jens/Source/shotwell/src/Application.vala"
	return result;
#line 200 "Application.c"
}


static gint _application_on_command_line_g_application_command_line (GApplication* _sender, GApplicationCommandLine* command_line, gpointer self) {
	gint result;
	result = application_on_command_line (command_line);
#line 65 "/home/jens/Source/shotwell/src/Application.vala"
	return result;
#line 209 "Application.c"
}


static void _application_on_activated_g_application_activate (GApplication* _sender, gpointer self) {
#line 68 "/home/jens/Source/shotwell/src/Application.vala"
	application_on_activated ();
#line 216 "Application.c"
}


static void _application_on_activated_g_application_startup (GApplication* _sender, gpointer self) {
#line 69 "/home/jens/Source/shotwell/src/Application.vala"
	application_on_activated ();
#line 223 "Application.c"
}


static Application* application_construct (GType object_type, gboolean is_direct) {
	Application* self = NULL;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	GtkApplication* _tmp7_ = NULL;
	GtkApplication* _tmp8_ = NULL;
	GError * _inner_error_ = NULL;
#line 39 "/home/jens/Source/shotwell/src/Application.vala"
	self = (Application*) g_type_create_instance (object_type);
#line 40 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp0_ = is_direct;
#line 40 "/home/jens/Source/shotwell/src/Application.vala"
	if (_tmp0_) {
#line 241 "Application.c"
		GtkApplication* _tmp1_ = NULL;
#line 45 "/home/jens/Source/shotwell/src/Application.vala"
		_tmp1_ = gtk_application_new ("org.yorba.shotwell-direct", G_APPLICATION_HANDLES_OPEN | G_APPLICATION_NON_UNIQUE);
#line 45 "/home/jens/Source/shotwell/src/Application.vala"
		_g_object_unref0 (self->priv->system_app);
#line 45 "/home/jens/Source/shotwell/src/Application.vala"
		self->priv->system_app = _tmp1_;
#line 249 "Application.c"
	} else {
		GtkApplication* _tmp2_ = NULL;
#line 51 "/home/jens/Source/shotwell/src/Application.vala"
		_tmp2_ = gtk_application_new ("org.yorba.shotwell", G_APPLICATION_HANDLES_OPEN | G_APPLICATION_HANDLES_COMMAND_LINE);
#line 51 "/home/jens/Source/shotwell/src/Application.vala"
		_g_object_unref0 (self->priv->system_app);
#line 51 "/home/jens/Source/shotwell/src/Application.vala"
		self->priv->system_app = _tmp2_;
#line 258 "Application.c"
	}
	{
		GtkApplication* _tmp3_ = NULL;
#line 57 "/home/jens/Source/shotwell/src/Application.vala"
		_tmp3_ = self->priv->system_app;
#line 57 "/home/jens/Source/shotwell/src/Application.vala"
		g_application_register (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, g_application_get_type (), GApplication), NULL, &_inner_error_);
#line 57 "/home/jens/Source/shotwell/src/Application.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 268 "Application.c"
			goto __catch559_g_error;
		}
	}
	goto __finally559;
	__catch559_g_error:
	{
		GError* e = NULL;
#line 56 "/home/jens/Source/shotwell/src/Application.vala"
		e = _inner_error_;
#line 56 "/home/jens/Source/shotwell/src/Application.vala"
		_inner_error_ = NULL;
#line 59 "/home/jens/Source/shotwell/src/Application.vala"
		application_panic (self);
#line 56 "/home/jens/Source/shotwell/src/Application.vala"
		_g_error_free0 (e);
#line 284 "Application.c"
	}
	__finally559:
#line 56 "/home/jens/Source/shotwell/src/Application.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 56 "/home/jens/Source/shotwell/src/Application.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 56 "/home/jens/Source/shotwell/src/Application.vala"
		g_clear_error (&_inner_error_);
#line 56 "/home/jens/Source/shotwell/src/Application.vala"
		return NULL;
#line 295 "Application.c"
	}
#line 62 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp4_ = is_direct;
#line 62 "/home/jens/Source/shotwell/src/Application.vala"
	self->priv->direct = _tmp4_;
#line 64 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp5_ = self->priv->direct;
#line 64 "/home/jens/Source/shotwell/src/Application.vala"
	if (!_tmp5_) {
#line 305 "Application.c"
		GtkApplication* _tmp6_ = NULL;
#line 65 "/home/jens/Source/shotwell/src/Application.vala"
		_tmp6_ = self->priv->system_app;
#line 65 "/home/jens/Source/shotwell/src/Application.vala"
		g_signal_connect (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, g_application_get_type (), GApplication), "command-line", (GCallback) _application_on_command_line_g_application_command_line, NULL);
#line 311 "Application.c"
	}
#line 68 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp7_ = self->priv->system_app;
#line 68 "/home/jens/Source/shotwell/src/Application.vala"
	g_signal_connect (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, g_application_get_type (), GApplication), "activate", (GCallback) _application_on_activated_g_application_activate, NULL);
#line 69 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp8_ = self->priv->system_app;
#line 69 "/home/jens/Source/shotwell/src/Application.vala"
	g_signal_connect (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, g_application_get_type (), GApplication), "startup", (GCallback) _application_on_activated_g_application_startup, NULL);
#line 39 "/home/jens/Source/shotwell/src/Application.vala"
	return self;
#line 323 "Application.c"
}


static Application* application_new (gboolean is_direct) {
#line 39 "/home/jens/Source/shotwell/src/Application.vala"
	return application_construct (TYPE_APPLICATION, is_direct);
#line 330 "Application.c"
}


/**
     * @brief This is a helper for library mode that should only be
     * called if we've gotten a camera mount and are _not_ the primary
     * instance.
     */
void application_send_to_primary_instance (gchar** argv, int argv_length1) {
	Application* _tmp0_ = NULL;
	Application* _tmp1_ = NULL;
	GtkApplication* _tmp2_ = NULL;
	gchar** _tmp3_ = NULL;
	gint _tmp3__length1 = 0;
#line 78 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp0_ = application_get_instance ();
#line 78 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp1_ = _tmp0_;
#line 78 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp2_ = _tmp1_->priv->system_app;
#line 78 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp3_ = argv;
#line 78 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp3__length1 = argv_length1;
#line 78 "/home/jens/Source/shotwell/src/Application.vala"
	g_application_run (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, g_application_get_type (), GApplication), _tmp3__length1, _tmp3_);
#line 78 "/home/jens/Source/shotwell/src/Application.vala"
	_application_unref0 (_tmp1_);
#line 359 "Application.c"
}


/**
     * @brief A helper for library mode that tells the primary
     * instance to bring its window to the foreground.  This
     * should only be called if we are _not_ the primary instance.
     */
void application_present_primary_instance (void) {
	Application* _tmp0_ = NULL;
	Application* _tmp1_ = NULL;
	GtkApplication* _tmp2_ = NULL;
#line 87 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp0_ = application_get_instance ();
#line 87 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp1_ = _tmp0_;
#line 87 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp2_ = _tmp1_->priv->system_app;
#line 87 "/home/jens/Source/shotwell/src/Application.vala"
	g_application_activate (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, g_application_get_type (), GApplication));
#line 87 "/home/jens/Source/shotwell/src/Application.vala"
	_application_unref0 (_tmp1_);
#line 382 "Application.c"
}


gboolean application_get_is_remote (void) {
	gboolean result = FALSE;
	Application* _tmp0_ = NULL;
	Application* _tmp1_ = NULL;
	GtkApplication* _tmp2_ = NULL;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_ = FALSE;
#line 91 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp0_ = application_get_instance ();
#line 91 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp1_ = _tmp0_;
#line 91 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp2_ = _tmp1_->priv->system_app;
#line 91 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp3_ = g_application_get_is_remote (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, g_application_get_type (), GApplication));
#line 91 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp4_ = _tmp3_;
#line 91 "/home/jens/Source/shotwell/src/Application.vala"
	_application_unref0 (_tmp1_);
#line 91 "/home/jens/Source/shotwell/src/Application.vala"
	result = _tmp4_;
#line 91 "/home/jens/Source/shotwell/src/Application.vala"
	return result;
#line 409 "Application.c"
}


gboolean application_get_is_direct (void) {
	gboolean result = FALSE;
	Application* _tmp0_ = NULL;
	Application* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
#line 95 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp0_ = application_get_instance ();
#line 95 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp1_ = _tmp0_;
#line 95 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp2_ = _tmp1_->priv->direct;
#line 95 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp3_ = _tmp2_;
#line 95 "/home/jens/Source/shotwell/src/Application.vala"
	_application_unref0 (_tmp1_);
#line 95 "/home/jens/Source/shotwell/src/Application.vala"
	result = _tmp3_;
#line 95 "/home/jens/Source/shotwell/src/Application.vala"
	return result;
#line 433 "Application.c"
}


void application_set_accels_for_action (const gchar* action, gchar** accel, int accel_length1) {
	Application* _tmp0_ = NULL;
	Application* _tmp1_ = NULL;
	GtkApplication* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	gchar** _tmp4_ = NULL;
	gint _tmp4__length1 = 0;
#line 98 "/home/jens/Source/shotwell/src/Application.vala"
	g_return_if_fail (action != NULL);
#line 99 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp0_ = application_get_instance ();
#line 99 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp1_ = _tmp0_;
#line 99 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp2_ = _tmp1_->priv->system_app;
#line 99 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp3_ = action;
#line 99 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp4_ = accel;
#line 99 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp4__length1 = accel_length1;
#line 99 "/home/jens/Source/shotwell/src/Application.vala"
	gtk_application_set_accels_for_action (_tmp2_, _tmp3_, _tmp4_);
#line 99 "/home/jens/Source/shotwell/src/Application.vala"
	_application_unref0 (_tmp1_);
#line 462 "Application.c"
}


void application_set_menubar (GMenuModel* model) {
	Application* _tmp0_ = NULL;
	Application* _tmp1_ = NULL;
	GtkApplication* _tmp2_ = NULL;
	GMenuModel* _tmp3_ = NULL;
#line 102 "/home/jens/Source/shotwell/src/Application.vala"
	g_return_if_fail ((model == NULL) || G_IS_MENU_MODEL (model));
#line 103 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp0_ = application_get_instance ();
#line 103 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp1_ = _tmp0_;
#line 103 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp2_ = _tmp1_->priv->system_app;
#line 103 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp3_ = model;
#line 103 "/home/jens/Source/shotwell/src/Application.vala"
	gtk_application_set_menubar (_tmp2_, _tmp3_);
#line 103 "/home/jens/Source/shotwell/src/Application.vala"
	_application_unref0 (_tmp1_);
#line 485 "Application.c"
}


/**
     * @brief Signal handler for GApplication's 'command-line' signal.
     *
     * The most likely scenario for this to be fired is if the user
     * either tried to run us twice in library mode, or we've just gotten
     * a camera/removable-storage mount; in either case, the remote instance
     * will trigger this and exit, and we'll need to bring the window back up...
     */
void application_on_activated (void) {
	Application* _tmp0_ = NULL;
	Application* _tmp1_ = NULL;
	LibraryWindow* lw = NULL;
	AppWindow* _tmp2_ = NULL;
	LibraryWindow* _tmp3_ = NULL;
	gboolean _tmp4_ = FALSE;
	LibraryWindow* _tmp5_ = NULL;
#line 115 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp0_ = application_get_instance ();
#line 115 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp1_ = _tmp0_;
#line 115 "/home/jens/Source/shotwell/src/Application.vala"
	_application_unref0 (_tmp1_);
#line 117 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp2_ = app_window_get_instance ();
#line 117 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp3_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, TYPE_LIBRARY_WINDOW) ? ((LibraryWindow*) _tmp2_) : NULL;
#line 117 "/home/jens/Source/shotwell/src/Application.vala"
	if (_tmp3_ == NULL) {
#line 117 "/home/jens/Source/shotwell/src/Application.vala"
		_g_object_unref0 (_tmp2_);
#line 519 "Application.c"
	}
#line 117 "/home/jens/Source/shotwell/src/Application.vala"
	lw = _tmp3_;
#line 118 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp5_ = lw;
#line 118 "/home/jens/Source/shotwell/src/Application.vala"
	if (_tmp5_ != NULL) {
#line 527 "Application.c"
		gboolean _tmp6_ = FALSE;
#line 118 "/home/jens/Source/shotwell/src/Application.vala"
		_tmp6_ = application_get_is_direct ();
#line 118 "/home/jens/Source/shotwell/src/Application.vala"
		_tmp4_ = !_tmp6_;
#line 533 "Application.c"
	} else {
#line 118 "/home/jens/Source/shotwell/src/Application.vala"
		_tmp4_ = FALSE;
#line 537 "Application.c"
	}
#line 118 "/home/jens/Source/shotwell/src/Application.vala"
	if (_tmp4_) {
#line 541 "Application.c"
		LibraryWindow* _tmp7_ = NULL;
		LibraryWindow* _tmp8_ = NULL;
#line 119 "/home/jens/Source/shotwell/src/Application.vala"
		_tmp7_ = library_window_get_app ();
#line 119 "/home/jens/Source/shotwell/src/Application.vala"
		_tmp8_ = _tmp7_;
#line 119 "/home/jens/Source/shotwell/src/Application.vala"
		gtk_window_present (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_window_get_type (), GtkWindow));
#line 119 "/home/jens/Source/shotwell/src/Application.vala"
		_g_object_unref0 (_tmp8_);
#line 552 "Application.c"
	}
#line 114 "/home/jens/Source/shotwell/src/Application.vala"
	_g_object_unref0 (lw);
#line 556 "Application.c"
}


/**
     * @brief Signal handler for GApplication's 'command-line' signal.
     *
     * Gets fired whenever a remote instance tries to run, usually
     * with an incoming camera connection.
     *
     * @note This does _not_ get called in direct-edit mode.
     */
gint application_on_command_line (GApplicationCommandLine* acl) {
	gint result = 0;
	gchar** argv = NULL;
	GApplicationCommandLine* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	gchar** _tmp2_ = NULL;
	gint argv_length1 = 0;
	gint _argv_size_ = 0;
	gchar** _tmp3_ = NULL;
	gint _tmp3__length1 = 0;
#line 131 "/home/jens/Source/shotwell/src/Application.vala"
	g_return_val_if_fail (G_IS_APPLICATION_COMMAND_LINE (acl), 0);
#line 132 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp0_ = acl;
#line 132 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp2_ = g_application_command_line_get_arguments (_tmp0_, &_tmp1_);
#line 132 "/home/jens/Source/shotwell/src/Application.vala"
	argv = _tmp2_;
#line 132 "/home/jens/Source/shotwell/src/Application.vala"
	argv_length1 = _tmp1_;
#line 132 "/home/jens/Source/shotwell/src/Application.vala"
	_argv_size_ = argv_length1;
#line 134 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp3_ = argv;
#line 134 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp3__length1 = argv_length1;
#line 134 "/home/jens/Source/shotwell/src/Application.vala"
	if (_tmp3_ != NULL) {
#line 596 "Application.c"
		gchar** _tmp4_ = NULL;
		gint _tmp4__length1 = 0;
#line 135 "/home/jens/Source/shotwell/src/Application.vala"
		_tmp4_ = argv;
#line 135 "/home/jens/Source/shotwell/src/Application.vala"
		_tmp4__length1 = argv_length1;
#line 603 "Application.c"
		{
			gchar** s_collection = NULL;
			gint s_collection_length1 = 0;
			gint _s_collection_size_ = 0;
			gint s_it = 0;
#line 135 "/home/jens/Source/shotwell/src/Application.vala"
			s_collection = _tmp4_;
#line 135 "/home/jens/Source/shotwell/src/Application.vala"
			s_collection_length1 = _tmp4__length1;
#line 135 "/home/jens/Source/shotwell/src/Application.vala"
			for (s_it = 0; s_it < _tmp4__length1; s_it = s_it + 1) {
#line 615 "Application.c"
				gchar* _tmp5_ = NULL;
				gchar* s = NULL;
#line 135 "/home/jens/Source/shotwell/src/Application.vala"
				_tmp5_ = g_strdup (s_collection[s_it]);
#line 135 "/home/jens/Source/shotwell/src/Application.vala"
				s = _tmp5_;
#line 622 "Application.c"
				{
					LibraryWindow* lw = NULL;
					AppWindow* _tmp6_ = NULL;
					LibraryWindow* _tmp7_ = NULL;
					LibraryWindow* _tmp8_ = NULL;
#line 136 "/home/jens/Source/shotwell/src/Application.vala"
					_tmp6_ = app_window_get_instance ();
#line 136 "/home/jens/Source/shotwell/src/Application.vala"
					_tmp7_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, TYPE_LIBRARY_WINDOW) ? ((LibraryWindow*) _tmp6_) : NULL;
#line 136 "/home/jens/Source/shotwell/src/Application.vala"
					if (_tmp7_ == NULL) {
#line 136 "/home/jens/Source/shotwell/src/Application.vala"
						_g_object_unref0 (_tmp6_);
#line 636 "Application.c"
					}
#line 136 "/home/jens/Source/shotwell/src/Application.vala"
					lw = _tmp7_;
#line 137 "/home/jens/Source/shotwell/src/Application.vala"
					_tmp8_ = lw;
#line 137 "/home/jens/Source/shotwell/src/Application.vala"
					if (_tmp8_ != NULL) {
#line 644 "Application.c"
						LibraryWindow* _tmp9_ = NULL;
						const gchar* _tmp10_ = NULL;
#line 138 "/home/jens/Source/shotwell/src/Application.vala"
						_tmp9_ = lw;
#line 138 "/home/jens/Source/shotwell/src/Application.vala"
						_tmp10_ = s;
#line 138 "/home/jens/Source/shotwell/src/Application.vala"
						library_window_mounted_camera_shell_notification (_tmp9_, _tmp10_, FALSE);
#line 653 "Application.c"
					}
#line 135 "/home/jens/Source/shotwell/src/Application.vala"
					_g_object_unref0 (lw);
#line 135 "/home/jens/Source/shotwell/src/Application.vala"
					_g_free0 (s);
#line 659 "Application.c"
				}
			}
		}
	}
#line 142 "/home/jens/Source/shotwell/src/Application.vala"
	application_on_activated ();
#line 143 "/home/jens/Source/shotwell/src/Application.vala"
	result = 0;
#line 143 "/home/jens/Source/shotwell/src/Application.vala"
	argv = (_vala_array_free (argv, argv_length1, (GDestroyNotify) g_free), NULL);
#line 143 "/home/jens/Source/shotwell/src/Application.vala"
	return result;
#line 672 "Application.c"
}


/**
     * @brief Initializes the Shotwell application object and prepares
     * it for use.
     *
     * @param is_direct Whether the application was invoked in direct
     * or in library mode; defaults to FALSE, that is, library mode.
     *
     * @note This MUST be called prior to calling get_instance(), as the
     * application needs to know what mode it was brought up in; failure to
     * call this first will lead to an assertion.
     */
void application_init (gboolean is_direct) {
	Application* _tmp0_ = NULL;
#line 158 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp0_ = application_instance;
#line 158 "/home/jens/Source/shotwell/src/Application.vala"
	if (_tmp0_ == NULL) {
#line 693 "Application.c"
		gboolean _tmp1_ = FALSE;
		Application* _tmp2_ = NULL;
#line 159 "/home/jens/Source/shotwell/src/Application.vala"
		_tmp1_ = is_direct;
#line 159 "/home/jens/Source/shotwell/src/Application.vala"
		_tmp2_ = application_new (_tmp1_);
#line 159 "/home/jens/Source/shotwell/src/Application.vala"
		_application_unref0 (application_instance);
#line 159 "/home/jens/Source/shotwell/src/Application.vala"
		application_instance = _tmp2_;
#line 704 "Application.c"
	}
}


void application_terminate (void) {
	Application* _tmp0_ = NULL;
	Application* _tmp1_ = NULL;
#line 163 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp0_ = application_get_instance ();
#line 163 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp1_ = _tmp0_;
#line 163 "/home/jens/Source/shotwell/src/Application.vala"
	application_exit (_tmp1_);
#line 163 "/home/jens/Source/shotwell/src/Application.vala"
	_application_unref0 (_tmp1_);
#line 720 "Application.c"
}


static gpointer _application_ref0 (gpointer self) {
#line 169 "/home/jens/Source/shotwell/src/Application.vala"
	return self ? application_ref (self) : NULL;
#line 727 "Application.c"
}


Application* application_get_instance (void) {
	Application* result = NULL;
	Application* _tmp0_ = NULL;
	Application* _tmp1_ = NULL;
	Application* _tmp2_ = NULL;
#line 167 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp0_ = application_instance;
#line 167 "/home/jens/Source/shotwell/src/Application.vala"
	_vala_assert (_tmp0_ != NULL, "instance != null");
#line 169 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp1_ = application_instance;
#line 169 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp2_ = _application_ref0 (_tmp1_);
#line 169 "/home/jens/Source/shotwell/src/Application.vala"
	result = _tmp2_;
#line 169 "/home/jens/Source/shotwell/src/Application.vala"
	return result;
#line 748 "Application.c"
}


void application_start (Application* self, gchar** argv, int argv_length1) {
	gboolean _tmp0_ = FALSE;
	AppWindow* _tmp1_ = NULL;
	AppWindow* _tmp2_ = NULL;
	GtkApplication* _tmp3_ = NULL;
	AppWindow* _tmp4_ = NULL;
	AppWindow* _tmp5_ = NULL;
	GtkApplication* _tmp6_ = NULL;
	gchar** _tmp7_ = NULL;
	gint _tmp7__length1 = 0;
	gint _tmp8_ = 0;
	gboolean _tmp9_ = FALSE;
	GtkApplication* _tmp12_ = NULL;
	guint _tmp13_ = 0U;
	GtkApplication* _tmp14_ = NULL;
	guint _tmp15_ = 0U;
#line 172 "/home/jens/Source/shotwell/src/Application.vala"
	g_return_if_fail (IS_APPLICATION (self));
#line 173 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp0_ = self->priv->running;
#line 173 "/home/jens/Source/shotwell/src/Application.vala"
	if (_tmp0_) {
#line 174 "/home/jens/Source/shotwell/src/Application.vala"
		return;
#line 776 "Application.c"
	}
#line 176 "/home/jens/Source/shotwell/src/Application.vala"
	self->priv->running = TRUE;
#line 178 "/home/jens/Source/shotwell/src/Application.vala"
	g_signal_emit_by_name (self, "starting");
#line 180 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp1_ = app_window_get_instance ();
#line 180 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp2_ = _tmp1_;
#line 180 "/home/jens/Source/shotwell/src/Application.vala"
	_vala_assert (_tmp2_ != NULL, "AppWindow.get_instance() != null");
#line 180 "/home/jens/Source/shotwell/src/Application.vala"
	_g_object_unref0 (_tmp2_);
#line 181 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp3_ = self->priv->system_app;
#line 181 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp4_ = app_window_get_instance ();
#line 181 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp5_ = _tmp4_;
#line 181 "/home/jens/Source/shotwell/src/Application.vala"
	gtk_application_add_window (_tmp3_, G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_window_get_type (), GtkWindow));
#line 181 "/home/jens/Source/shotwell/src/Application.vala"
	_g_object_unref0 (_tmp5_);
#line 182 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp6_ = self->priv->system_app;
#line 182 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp7_ = argv;
#line 182 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp7__length1 = argv_length1;
#line 182 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp8_ = g_application_run (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, g_application_get_type (), GApplication), _tmp7__length1, _tmp7_);
#line 182 "/home/jens/Source/shotwell/src/Application.vala"
	self->priv->system_app_run_retval = _tmp8_;
#line 184 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp9_ = self->priv->direct;
#line 184 "/home/jens/Source/shotwell/src/Application.vala"
	if (!_tmp9_) {
#line 814 "Application.c"
		GtkApplication* _tmp10_ = NULL;
		guint _tmp11_ = 0U;
#line 185 "/home/jens/Source/shotwell/src/Application.vala"
		_tmp10_ = self->priv->system_app;
#line 185 "/home/jens/Source/shotwell/src/Application.vala"
		g_signal_parse_name ("command-line", g_application_get_type (), &_tmp11_, NULL, FALSE);
#line 185 "/home/jens/Source/shotwell/src/Application.vala"
		g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, g_application_get_type (), GApplication), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp11_, 0, NULL, (GCallback) _application_on_command_line_g_application_command_line, NULL);
#line 823 "Application.c"
	}
#line 188 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp12_ = self->priv->system_app;
#line 188 "/home/jens/Source/shotwell/src/Application.vala"
	g_signal_parse_name ("activate", g_application_get_type (), &_tmp13_, NULL, FALSE);
#line 188 "/home/jens/Source/shotwell/src/Application.vala"
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, g_application_get_type (), GApplication), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp13_, 0, NULL, (GCallback) _application_on_activated_g_application_activate, NULL);
#line 189 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp14_ = self->priv->system_app;
#line 189 "/home/jens/Source/shotwell/src/Application.vala"
	g_signal_parse_name ("startup", g_application_get_type (), &_tmp15_, NULL, FALSE);
#line 189 "/home/jens/Source/shotwell/src/Application.vala"
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, g_application_get_type (), GApplication), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp15_, 0, NULL, (GCallback) _application_on_activated_g_application_startup, NULL);
#line 191 "/home/jens/Source/shotwell/src/Application.vala"
	self->priv->running = FALSE;
#line 839 "Application.c"
}


void application_exit (Application* self) {
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GtkApplication* _tmp3_ = NULL;
#line 194 "/home/jens/Source/shotwell/src/Application.vala"
	g_return_if_fail (IS_APPLICATION (self));
#line 197 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp1_ = self->priv->exiting_fired;
#line 197 "/home/jens/Source/shotwell/src/Application.vala"
	if (_tmp1_) {
#line 197 "/home/jens/Source/shotwell/src/Application.vala"
		_tmp0_ = TRUE;
#line 855 "Application.c"
	} else {
		gboolean _tmp2_ = FALSE;
#line 197 "/home/jens/Source/shotwell/src/Application.vala"
		_tmp2_ = self->priv->running;
#line 197 "/home/jens/Source/shotwell/src/Application.vala"
		_tmp0_ = !_tmp2_;
#line 862 "Application.c"
	}
#line 197 "/home/jens/Source/shotwell/src/Application.vala"
	if (_tmp0_) {
#line 198 "/home/jens/Source/shotwell/src/Application.vala"
		return;
#line 868 "Application.c"
	}
#line 200 "/home/jens/Source/shotwell/src/Application.vala"
	self->priv->exiting_fired = TRUE;
#line 202 "/home/jens/Source/shotwell/src/Application.vala"
	g_signal_emit_by_name (self, "exiting", FALSE);
#line 204 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp3_ = self->priv->system_app;
#line 204 "/home/jens/Source/shotwell/src/Application.vala"
	g_application_release (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, g_application_get_type (), GApplication));
#line 878 "Application.c"
}


void application_panic (Application* self) {
	gboolean _tmp0_ = FALSE;
#line 209 "/home/jens/Source/shotwell/src/Application.vala"
	g_return_if_fail (IS_APPLICATION (self));
#line 210 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp0_ = self->priv->exiting_fired;
#line 210 "/home/jens/Source/shotwell/src/Application.vala"
	if (!_tmp0_) {
#line 211 "/home/jens/Source/shotwell/src/Application.vala"
		self->priv->exiting_fired = TRUE;
#line 212 "/home/jens/Source/shotwell/src/Application.vala"
		g_signal_emit_by_name (self, "exiting", TRUE);
#line 894 "Application.c"
	}
#line 214 "/home/jens/Source/shotwell/src/Application.vala"
	exit (1);
#line 898 "Application.c"
}


/**
     * @brief Allows the caller to ask for some part of the desktop session's functionality to
     * be prevented from running; wrapper for Gtk.Application.inhibit().
     *
     * @note The return value is a 'cookie' that needs to be passed to 'uninhibit' to turn
     * off a requested inhibition and should be saved by the caller.
     */
guint application_inhibit (Application* self, GtkApplicationInhibitFlags what, const gchar* reason) {
	guint result = 0U;
	GtkApplication* _tmp0_ = NULL;
	AppWindow* _tmp1_ = NULL;
	AppWindow* _tmp2_ = NULL;
	GtkApplicationInhibitFlags _tmp3_ = 0;
	const gchar* _tmp4_ = NULL;
	guint _tmp5_ = 0U;
	guint _tmp6_ = 0U;
#line 224 "/home/jens/Source/shotwell/src/Application.vala"
	g_return_val_if_fail (IS_APPLICATION (self), 0U);
#line 225 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp0_ = self->priv->system_app;
#line 225 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp1_ = app_window_get_instance ();
#line 225 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp2_ = _tmp1_;
#line 225 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp3_ = what;
#line 225 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp4_ = reason;
#line 225 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp5_ = gtk_application_inhibit (_tmp0_, G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_window_get_type (), GtkWindow), _tmp3_, _tmp4_);
#line 225 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp6_ = _tmp5_;
#line 225 "/home/jens/Source/shotwell/src/Application.vala"
	_g_object_unref0 (_tmp2_);
#line 225 "/home/jens/Source/shotwell/src/Application.vala"
	result = _tmp6_;
#line 225 "/home/jens/Source/shotwell/src/Application.vala"
	return result;
#line 940 "Application.c"
}


/**
     * @brief Turns off a previously-requested inhibition. Wrapper for
     * Gtk.Application.uninhibit().
     */
void application_uninhibit (Application* self, guint cookie) {
	GtkApplication* _tmp0_ = NULL;
	guint _tmp1_ = 0U;
#line 232 "/home/jens/Source/shotwell/src/Application.vala"
	g_return_if_fail (IS_APPLICATION (self));
#line 233 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp0_ = self->priv->system_app;
#line 233 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp1_ = cookie;
#line 233 "/home/jens/Source/shotwell/src/Application.vala"
	gtk_application_uninhibit (_tmp0_, _tmp1_);
#line 959 "Application.c"
}


gint application_get_run_return_value (Application* self) {
	gint result = 0;
	gint _tmp0_ = 0;
#line 236 "/home/jens/Source/shotwell/src/Application.vala"
	g_return_val_if_fail (IS_APPLICATION (self), 0);
#line 237 "/home/jens/Source/shotwell/src/Application.vala"
	_tmp0_ = self->priv->system_app_run_retval;
#line 237 "/home/jens/Source/shotwell/src/Application.vala"
	result = _tmp0_;
#line 237 "/home/jens/Source/shotwell/src/Application.vala"
	return result;
#line 974 "Application.c"
}


static void application_real_starting (Application* self) {
}


static void application_real_exiting (Application* self, gboolean panicked) {
}


static void application_real_init_done (Application* self) {
}


static void value_application_init (GValue* value) {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	value->data[0].v_pointer = NULL;
#line 993 "Application.c"
}


static void value_application_free_value (GValue* value) {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	if (value->data[0].v_pointer) {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
		application_unref (value->data[0].v_pointer);
#line 1002 "Application.c"
	}
}


static void value_application_copy_value (const GValue* src_value, GValue* dest_value) {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	if (src_value->data[0].v_pointer) {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
		dest_value->data[0].v_pointer = application_ref (src_value->data[0].v_pointer);
#line 1012 "Application.c"
	} else {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
		dest_value->data[0].v_pointer = NULL;
#line 1016 "Application.c"
	}
}


static gpointer value_application_peek_pointer (const GValue* value) {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	return value->data[0].v_pointer;
#line 1024 "Application.c"
}


static gchar* value_application_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	if (collect_values[0].v_pointer) {
#line 1031 "Application.c"
		Application* object;
		object = collect_values[0].v_pointer;
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
		if (object->parent_instance.g_class == NULL) {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 1038 "Application.c"
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 1042 "Application.c"
		}
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
		value->data[0].v_pointer = application_ref (object);
#line 1046 "Application.c"
	} else {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
		value->data[0].v_pointer = NULL;
#line 1050 "Application.c"
	}
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	return NULL;
#line 1054 "Application.c"
}


static gchar* value_application_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	Application** object_p;
	object_p = collect_values[0].v_pointer;
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	if (!object_p) {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 1065 "Application.c"
	}
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	if (!value->data[0].v_pointer) {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
		*object_p = NULL;
#line 1071 "Application.c"
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
		*object_p = value->data[0].v_pointer;
#line 1075 "Application.c"
	} else {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
		*object_p = application_ref (value->data[0].v_pointer);
#line 1079 "Application.c"
	}
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	return NULL;
#line 1083 "Application.c"
}


GParamSpec* param_spec_application (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	ParamSpecApplication* spec;
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	g_return_val_if_fail (g_type_is_a (object_type, TYPE_APPLICATION), NULL);
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	G_PARAM_SPEC (spec)->value_type = object_type;
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	return G_PARAM_SPEC (spec);
#line 1097 "Application.c"
}


gpointer value_get_application (const GValue* value) {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_APPLICATION), NULL);
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	return value->data[0].v_pointer;
#line 1106 "Application.c"
}


void value_set_application (GValue* value, gpointer v_object) {
	Application* old;
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_APPLICATION));
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	old = value->data[0].v_pointer;
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	if (v_object) {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_APPLICATION));
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
		value->data[0].v_pointer = v_object;
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
		application_ref (value->data[0].v_pointer);
#line 1126 "Application.c"
	} else {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
		value->data[0].v_pointer = NULL;
#line 1130 "Application.c"
	}
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	if (old) {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
		application_unref (old);
#line 1136 "Application.c"
	}
}


void value_take_application (GValue* value, gpointer v_object) {
	Application* old;
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_APPLICATION));
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	old = value->data[0].v_pointer;
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	if (v_object) {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_APPLICATION));
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
		value->data[0].v_pointer = v_object;
#line 1155 "Application.c"
	} else {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
		value->data[0].v_pointer = NULL;
#line 1159 "Application.c"
	}
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	if (old) {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
		application_unref (old);
#line 1165 "Application.c"
	}
}


static void application_class_init (ApplicationClass * klass) {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	application_parent_class = g_type_class_peek_parent (klass);
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	((ApplicationClass *) klass)->finalize = application_finalize;
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	g_type_class_add_private (klass, sizeof (ApplicationPrivate));
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	((ApplicationClass *) klass)->starting = application_real_starting;
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	((ApplicationClass *) klass)->exiting = application_real_exiting;
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	((ApplicationClass *) klass)->init_done = application_real_init_done;
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	g_signal_new ("starting", TYPE_APPLICATION, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ApplicationClass, starting), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	g_signal_new ("exiting", TYPE_APPLICATION, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ApplicationClass, exiting), NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	g_signal_new ("init_done", TYPE_APPLICATION, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ApplicationClass, init_done), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
#line 1189 "Application.c"
}


static void application_instance_init (Application * self) {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	self->priv = APPLICATION_GET_PRIVATE (self);
#line 9 "/home/jens/Source/shotwell/src/Application.vala"
	self->priv->system_app = NULL;
#line 10 "/home/jens/Source/shotwell/src/Application.vala"
	self->priv->system_app_run_retval = 0;
#line 22 "/home/jens/Source/shotwell/src/Application.vala"
	self->priv->fixup_raw_thumbs = FALSE;
#line 36 "/home/jens/Source/shotwell/src/Application.vala"
	self->priv->running = FALSE;
#line 37 "/home/jens/Source/shotwell/src/Application.vala"
	self->priv->exiting_fired = FALSE;
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	self->ref_count = 1;
#line 1208 "Application.c"
}


static void application_finalize (Application* obj) {
	Application * self;
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_APPLICATION, Application);
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	g_signal_handlers_destroy (self);
#line 9 "/home/jens/Source/shotwell/src/Application.vala"
	_g_object_unref0 (self->priv->system_app);
#line 1220 "Application.c"
}


GType application_get_type (void) {
	static volatile gsize application_type_id__volatile = 0;
	if (g_once_init_enter (&application_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { value_application_init, value_application_free_value, value_application_copy_value, value_application_peek_pointer, "p", value_application_collect_value, "p", value_application_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (ApplicationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) application_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Application), 0, (GInstanceInitFunc) application_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType application_type_id;
		application_type_id = g_type_register_fundamental (g_type_fundamental_next (), "Application", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&application_type_id__volatile, application_type_id);
	}
	return application_type_id__volatile;
}


gpointer application_ref (gpointer instance) {
	Application* self;
	self = instance;
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	g_atomic_int_inc (&self->ref_count);
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	return instance;
#line 1245 "Application.c"
}


void application_unref (gpointer instance) {
	Application* self;
	self = instance;
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
		APPLICATION_GET_CLASS (self)->finalize (self);
#line 7 "/home/jens/Source/shotwell/src/Application.vala"
		g_type_free_instance ((GTypeInstance *) self);
#line 1258 "Application.c"
	}
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}