~ubuntu-branches/ubuntu/precise/activity-log-manager/precise

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
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
/* history-widget.c generated by valac 0.14.2, the Vala compiler
 * generated from history-widget.vala, do not modify */

/* -*- Mode: vala; tab-width: 4; intend-tabs-mode: t -*- */
/* alm
 *
 * Copyright (C) Seif Lotfy 2012 <seif@lotfy.com>
 * Copyright (C) Manish Sinha 2012 <manishsinha@ubuntu.com>
 *
alm is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 * 
 * alm is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.";
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <zeitgeist.h>
#include <float.h>
#include <math.h>
#include <stdio.h>
#include <gio/gio.h>
#include <gdk/gdk.h>


#define ALM_TYPE_HISTORY_WIDGET (alm_history_widget_get_type ())
#define ALM_HISTORY_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ALM_TYPE_HISTORY_WIDGET, AlmHistoryWidget))
#define ALM_HISTORY_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ALM_TYPE_HISTORY_WIDGET, AlmHistoryWidgetClass))
#define ALM_IS_HISTORY_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ALM_TYPE_HISTORY_WIDGET))
#define ALM_IS_HISTORY_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ALM_TYPE_HISTORY_WIDGET))
#define ALM_HISTORY_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ALM_TYPE_HISTORY_WIDGET, AlmHistoryWidgetClass))

typedef struct _AlmHistoryWidget AlmHistoryWidget;
typedef struct _AlmHistoryWidgetClass AlmHistoryWidgetClass;
typedef struct _AlmHistoryWidgetPrivate AlmHistoryWidgetPrivate;

#define ALM_TYPE_CALENDAR_WIDGET (alm_calendar_widget_get_type ())
#define ALM_CALENDAR_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ALM_TYPE_CALENDAR_WIDGET, AlmCalendarWidget))
#define ALM_CALENDAR_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ALM_TYPE_CALENDAR_WIDGET, AlmCalendarWidgetClass))
#define ALM_IS_CALENDAR_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ALM_TYPE_CALENDAR_WIDGET))
#define ALM_IS_CALENDAR_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ALM_TYPE_CALENDAR_WIDGET))
#define ALM_CALENDAR_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ALM_TYPE_CALENDAR_WIDGET, AlmCalendarWidgetClass))

typedef struct _AlmCalendarWidget AlmCalendarWidget;
typedef struct _AlmCalendarWidgetClass AlmCalendarWidgetClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_array_unref0(var) ((var == NULL) ? NULL : (var = (g_array_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_ptr_array_unref0(var) ((var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL)))
typedef struct _AlmHistoryWidgetGetHistoryData AlmHistoryWidgetGetHistoryData;
typedef struct _AlmHistoryWidgetDeleteHistoryData AlmHistoryWidgetDeleteHistoryData;

#define ALM_TYPE_CALENDAR_DIALOG (alm_calendar_dialog_get_type ())
#define ALM_CALENDAR_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ALM_TYPE_CALENDAR_DIALOG, AlmCalendarDialog))
#define ALM_CALENDAR_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ALM_TYPE_CALENDAR_DIALOG, AlmCalendarDialogClass))
#define ALM_IS_CALENDAR_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ALM_TYPE_CALENDAR_DIALOG))
#define ALM_IS_CALENDAR_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ALM_TYPE_CALENDAR_DIALOG))
#define ALM_CALENDAR_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ALM_TYPE_CALENDAR_DIALOG, AlmCalendarDialogClass))

typedef struct _AlmCalendarDialog AlmCalendarDialog;
typedef struct _AlmCalendarDialogClass AlmCalendarDialogClass;
typedef struct _AlmCalendarDialogPrivate AlmCalendarDialogPrivate;
typedef struct _AlmCalendarWidgetPrivate AlmCalendarWidgetPrivate;
typedef struct _Block1Data Block1Data;
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
typedef struct _Block2Data Block2Data;

struct _AlmHistoryWidget {
	GtkBox parent_instance;
	AlmHistoryWidgetPrivate * priv;
};

struct _AlmHistoryWidgetClass {
	GtkBoxClass parent_class;
};

struct _AlmHistoryWidgetPrivate {
	GeeArrayList* past_records;
	AlmCalendarWidget* calendar_box;
	GtkButtonBox* button_box;
	ZeitgeistLog* zg_log;
	GtkComboBoxText* history_erase_kind;
};

struct _AlmHistoryWidgetGetHistoryData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	AlmHistoryWidget* self;
	ZeitgeistTimeRange* tr;
	GPtrArray* _tmp0_;
	GPtrArray* ptr_arr;
	GPtrArray* _tmp1_;
	ZeitgeistEvent* _tmp2_;
	ZeitgeistEvent* _tmp3_;
	ZeitgeistLog* _tmp4_;
	ZeitgeistTimeRange* _tmp5_;
	GPtrArray* _tmp6_;
	GArray* _tmp7_;
	GArray* ids;
	GError* err;
	GError* _tmp8_;
	const gchar* _tmp9_;
	GError * _inner_error_;
};

struct _AlmHistoryWidgetDeleteHistoryData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	AlmHistoryWidget* self;
	GArray* ids;
	FILE* _tmp0_;
	GArray* _tmp1_;
	guint _tmp2_;
	ZeitgeistLog* _tmp3_;
	GArray* _tmp4_;
	GArray* _tmp5_;
	gboolean _tmp6_;
	gboolean rs;
	GError* err;
	GError* _tmp7_;
	const gchar* _tmp8_;
	GError * _inner_error_;
};

struct _AlmCalendarDialog {
	GtkDialog parent_instance;
	AlmCalendarDialogPrivate * priv;
};

struct _AlmCalendarDialogClass {
	GtkDialogClass parent_class;
};

struct _AlmCalendarDialogPrivate {
	GtkCalendar* calendar;
};

struct _AlmCalendarWidget {
	GtkGrid parent_instance;
	AlmCalendarWidgetPrivate * priv;
};

struct _AlmCalendarWidgetClass {
	GtkGridClass parent_class;
};

struct _AlmCalendarWidgetPrivate {
	GtkEntry* start_entry;
	GtkEntry* end_entry;
	AlmCalendarDialog* start_dialog;
	AlmCalendarDialog* end_dialog;
};

struct _Block1Data {
	int _ref_count_;
	AlmCalendarWidget * self;
	GtkButton* start_button;
	GtkButton* end_button;
};

struct _Block2Data {
	int _ref_count_;
	AlmCalendarWidget * self;
	GtkWidget* widget;
	GtkEntry* entry;
	AlmCalendarDialog* dialog;
};


static gpointer alm_history_widget_parent_class = NULL;
static gpointer alm_calendar_dialog_parent_class = NULL;
static gpointer alm_calendar_widget_parent_class = NULL;

GType alm_history_widget_get_type (void) G_GNUC_CONST;
GType alm_calendar_widget_get_type (void) G_GNUC_CONST;
#define ALM_HISTORY_WIDGET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), ALM_TYPE_HISTORY_WIDGET, AlmHistoryWidgetPrivate))
enum  {
	ALM_HISTORY_WIDGET_DUMMY_PROPERTY
};
AlmHistoryWidget* alm_history_widget_new (void);
AlmHistoryWidget* alm_history_widget_construct (GType object_type);
void alm_history_widget_set_up_ui (AlmHistoryWidget* self);
static void __lambda4_ (AlmHistoryWidget* self);
static void alm_history_widget_on_history_combo_changed (AlmHistoryWidget* self, GtkComboBoxText* box);
static void ___lambda4__gtk_combo_box_changed (GtkComboBox* _sender, gpointer self);
AlmCalendarWidget* alm_calendar_widget_new (void);
AlmCalendarWidget* alm_calendar_widget_construct (GType object_type);
static void __lambda5_ (AlmHistoryWidget* self);
static void alm_history_widget_get_history (AlmHistoryWidget* self, ZeitgeistTimeRange* tr, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void alm_history_widget_get_history_finish (AlmHistoryWidget* self, GAsyncResult* _res_);
ZeitgeistTimeRange* alm_calendar_widget_get_range (AlmCalendarWidget* self);
static void ___lambda5__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void alm_history_widget_get_history_data_free (gpointer _data);
static gboolean alm_history_widget_get_history_co (AlmHistoryWidgetGetHistoryData* _data_);
static gboolean _alm_history_widget_get_history_co_gsource_func (gpointer self);
static void alm_history_widget_get_history_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void alm_history_widget_delete_history (AlmHistoryWidget* self, GArray* ids, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void alm_history_widget_delete_history_finish (AlmHistoryWidget* self, GAsyncResult* _res_);
static void alm_history_widget_delete_history_data_free (gpointer _data);
static gboolean alm_history_widget_delete_history_co (AlmHistoryWidgetDeleteHistoryData* _data_);
static gboolean _alm_history_widget_delete_history_co_gsource_func (gpointer self);
static void alm_history_widget_delete_history_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void alm_history_widget_insert_calendar (AlmHistoryWidget* self);
static void alm_history_widget_remove_calendar (AlmHistoryWidget* self);
static void alm_history_widget_finalize (GObject* obj);
GType alm_calendar_dialog_get_type (void) G_GNUC_CONST;
#define ALM_CALENDAR_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), ALM_TYPE_CALENDAR_DIALOG, AlmCalendarDialogPrivate))
enum  {
	ALM_CALENDAR_DIALOG_DUMMY_PROPERTY
};
AlmCalendarDialog* alm_calendar_dialog_new (void);
AlmCalendarDialog* alm_calendar_dialog_construct (GType object_type);
GtkCalendar* alm_calendar_dialog_get_calendar_widget (AlmCalendarDialog* self);
static void alm_calendar_dialog_finalize (GObject* obj);
#define ALM_CALENDAR_WIDGET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), ALM_TYPE_CALENDAR_WIDGET, AlmCalendarWidgetPrivate))
enum  {
	ALM_CALENDAR_WIDGET_DUMMY_PROPERTY
};
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (Block1Data* _data1_);
static void __lambda0_ (Block1Data* _data1_);
void alm_calendar_widget_on_clicked (AlmCalendarWidget* self, GtkWidget* widget, GtkEntry* entry, AlmCalendarDialog* dialog);
static void ___lambda0__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void __lambda3_ (Block1Data* _data1_);
static void ___lambda3__gtk_button_clicked (GtkButton* _sender, gpointer self);
void alm_calendar_widget_set_up_calendar (AlmCalendarWidget* self, GtkButton* widget, GtkEntry* entry, AlmCalendarDialog* dialog);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (Block2Data* _data2_);
static gboolean __lambda1_ (Block2Data* _data2_, GtkWidget* w, GdkEventFocus* e);
static gboolean ___lambda1__gtk_widget_focus_out_event (GtkWidget* _sender, GdkEventFocus* event, gpointer self);
static void __lambda2_ (Block2Data* _data2_);
static void ___lambda2__gtk_calendar_day_selected_double_click (GtkCalendar* _sender, gpointer self);
static void alm_calendar_widget_finalize (GObject* obj);


AlmHistoryWidget* alm_history_widget_construct (GType object_type) {
	AlmHistoryWidget * self = NULL;
	ZeitgeistLog* _tmp0_;
	GeeArrayList* _tmp1_;
	GeeArrayList* _tmp2_;
	GeeArrayList* _tmp3_;
	GeeArrayList* _tmp4_;
	GeeArrayList* _tmp5_;
	GeeArrayList* _tmp6_;
	self = (AlmHistoryWidget*) g_object_new (object_type, "orientation", GTK_ORIENTATION_VERTICAL, NULL);
	gtk_box_set_spacing ((GtkBox*) self, 8);
	gtk_container_set_border_width ((GtkContainer*) self, (guint) 12);
	_tmp0_ = zeitgeist_log_new ();
	_g_object_unref0 (self->priv->zg_log);
	self->priv->zg_log = _tmp0_;
	_tmp1_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL);
	_g_object_unref0 (self->priv->past_records);
	self->priv->past_records = _tmp1_;
	_tmp2_ = self->priv->past_records;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp2_, "the past hour");
	_tmp3_ = self->priv->past_records;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp3_, "the past day");
	_tmp4_ = self->priv->past_records;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp4_, "the past week");
	_tmp5_ = self->priv->past_records;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp5_, "all history");
	_tmp6_ = self->priv->past_records;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp6_, "custom");
	alm_history_widget_set_up_ui (self);
	return self;
}


AlmHistoryWidget* alm_history_widget_new (void) {
	return alm_history_widget_construct (ALM_TYPE_HISTORY_WIDGET);
}


static void __lambda4_ (AlmHistoryWidget* self) {
	GtkComboBoxText* _tmp0_;
	_tmp0_ = self->priv->history_erase_kind;
	alm_history_widget_on_history_combo_changed (self, _tmp0_);
}


static void ___lambda4__gtk_combo_box_changed (GtkComboBox* _sender, gpointer self) {
	__lambda4_ (self);
}


static void __lambda5_ (AlmHistoryWidget* self) {
	ZeitgeistTimeRange* tr = NULL;
	GtkComboBoxText* _tmp0_;
	gint _tmp1_ = 0;
	gint index;
	gint _tmp2_;
	_tmp0_ = self->priv->history_erase_kind;
	_tmp1_ = gtk_combo_box_get_active ((GtkComboBox*) _tmp0_);
	index = _tmp1_;
	_tmp2_ = index;
	if (_tmp2_ < 3) {
		gint range;
		gint _tmp3_;
		FILE* _tmp9_;
		GtkComboBoxText* _tmp10_;
		gint _tmp11_ = 0;
		gint64 _tmp12_ = 0LL;
		gint64 end;
		gint64 _tmp13_;
		gint _tmp14_;
		gint64 start;
		gint64 _tmp15_;
		gint64 _tmp16_;
		ZeitgeistTimeRange* _tmp17_;
		ZeitgeistTimeRange* _tmp18_;
		ZeitgeistTimeRange* _tmp19_;
		range = (60 * 60) * 1000;
		_tmp3_ = index;
		if (_tmp3_ == 0) {
			gint _tmp4_;
			_tmp4_ = range;
			range = 1 * _tmp4_;
		} else {
			gint _tmp5_;
			_tmp5_ = index;
			if (_tmp5_ == 1) {
				gint _tmp6_;
				_tmp6_ = range;
				range = _tmp6_ * 24;
			} else {
				gint _tmp7_;
				_tmp7_ = index;
				if (_tmp7_ == 2) {
					gint _tmp8_;
					_tmp8_ = range;
					range = (_tmp8_ * 24) * 7;
				}
			}
		}
		_tmp9_ = stdout;
		_tmp10_ = self->priv->history_erase_kind;
		_tmp11_ = gtk_combo_box_get_active ((GtkComboBox*) _tmp10_);
		fprintf (_tmp9_, "%i\n", _tmp11_);
		_tmp12_ = zeitgeist_timestamp_for_now ();
		end = _tmp12_;
		_tmp13_ = end;
		_tmp14_ = range;
		start = _tmp13_ - _tmp14_;
		_tmp15_ = start;
		_tmp16_ = end;
		_tmp17_ = zeitgeist_time_range_new (_tmp15_, _tmp16_);
		_tmp18_ = g_object_ref_sink (_tmp17_);
		_g_object_unref0 (tr);
		tr = _tmp18_;
		_tmp19_ = tr;
		alm_history_widget_get_history (self, _tmp19_, NULL, NULL);
	} else {
		gint _tmp20_;
		_tmp20_ = index;
		if (_tmp20_ == 3) {
			ZeitgeistTimeRange* _tmp21_;
			ZeitgeistTimeRange* _tmp22_;
			ZeitgeistTimeRange* _tmp23_;
			_tmp21_ = zeitgeist_time_range_new_anytime ();
			_tmp22_ = g_object_ref_sink (_tmp21_);
			_g_object_unref0 (tr);
			tr = _tmp22_;
			_tmp23_ = tr;
			alm_history_widget_get_history (self, _tmp23_, NULL, NULL);
		} else {
			gint _tmp24_;
			_tmp24_ = index;
			if (_tmp24_ == 4) {
				AlmCalendarWidget* _tmp25_;
				ZeitgeistTimeRange* _tmp26_ = NULL;
				ZeitgeistTimeRange* _tmp27_;
				_tmp25_ = self->priv->calendar_box;
				_tmp26_ = alm_calendar_widget_get_range (_tmp25_);
				_g_object_unref0 (tr);
				tr = _tmp26_;
				_tmp27_ = tr;
				alm_history_widget_get_history (self, _tmp27_, NULL, NULL);
			}
		}
	}
	_g_object_unref0 (tr);
}


static void ___lambda5__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda5_ (self);
}


void alm_history_widget_set_up_ui (AlmHistoryWidget* self) {
	GtkBox* _tmp0_;
	GtkBox* _tmp1_;
	GtkBox* top_box;
	GtkBox* _tmp2_;
	GtkBox* _tmp3_;
	GtkLabel* _tmp4_;
	GtkLabel* _tmp5_;
	GtkLabel* label;
	GtkLabel* _tmp6_;
	GtkLabel* _tmp7_;
	GtkBox* _tmp8_;
	GtkLabel* _tmp9_;
	GtkComboBoxText* _tmp10_;
	GtkComboBoxText* _tmp11_;
	FILE* _tmp12_;
	GtkComboBoxText* _tmp25_;
	GtkComboBoxText* _tmp26_;
	GtkBox* _tmp27_;
	GtkComboBoxText* _tmp28_;
	AlmCalendarWidget* _tmp29_;
	AlmCalendarWidget* _tmp30_;
	GtkButtonBox* _tmp31_;
	GtkButtonBox* _tmp32_;
	GtkButtonBox* _tmp33_;
	GtkBox* _tmp34_;
	GtkBox* _tmp35_;
	GtkButtonBox* _tmp36_;
	GtkButton* _tmp37_;
	GtkButton* _tmp38_;
	GtkButton* del_button;
	GtkButtonBox* _tmp39_;
	g_return_if_fail (self != NULL);
	_tmp0_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 20);
	_tmp1_ = g_object_ref_sink (_tmp0_);
	top_box = _tmp1_;
	_tmp2_ = top_box;
	gtk_widget_set_margin_top ((GtkWidget*) _tmp2_, 30);
	_tmp3_ = top_box;
	gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) _tmp3_, FALSE, FALSE, (guint) 0);
	_tmp4_ = (GtkLabel*) gtk_label_new (NULL);
	_tmp5_ = g_object_ref_sink (_tmp4_);
	label = _tmp5_;
	_tmp6_ = label;
	gtk_label_set_markup (_tmp6_, "<b>Forget files activity:</b>");
	_tmp7_ = label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp7_, (gfloat) 0, 0.5f);
	_tmp8_ = top_box;
	_tmp9_ = label;
	gtk_box_pack_start (_tmp8_, (GtkWidget*) _tmp9_, FALSE, FALSE, (guint) 0);
	_tmp10_ = (GtkComboBoxText*) gtk_combo_box_text_new ();
	_tmp11_ = g_object_ref_sink (_tmp10_);
	_g_object_unref0 (self->priv->history_erase_kind);
	self->priv->history_erase_kind = _tmp11_;
	_tmp12_ = stdout;
	fprintf (_tmp12_, "====>\n");
	{
		gint i;
		i = 0;
		{
			gboolean _tmp13_;
			_tmp13_ = TRUE;
			while (TRUE) {
				gboolean _tmp14_;
				gint _tmp16_;
				GeeArrayList* _tmp17_;
				gint _tmp18_;
				gint _tmp19_;
				GtkComboBoxText* _tmp20_;
				GeeArrayList* _tmp21_;
				gint _tmp22_;
				gpointer _tmp23_ = NULL;
				gchar* _tmp24_;
				_tmp14_ = _tmp13_;
				if (!_tmp14_) {
					gint _tmp15_;
					_tmp15_ = i;
					i = _tmp15_ + 1;
				}
				_tmp13_ = FALSE;
				_tmp16_ = i;
				_tmp17_ = self->priv->past_records;
				_tmp18_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp17_);
				_tmp19_ = _tmp18_;
				if (!(_tmp16_ < _tmp19_)) {
					break;
				}
				_tmp20_ = self->priv->history_erase_kind;
				_tmp21_ = self->priv->past_records;
				_tmp22_ = i;
				_tmp23_ = gee_abstract_list_get ((GeeAbstractList*) _tmp21_, _tmp22_);
				_tmp24_ = (gchar*) _tmp23_;
				gtk_combo_box_text_append (_tmp20_, "", _tmp24_);
				_g_free0 (_tmp24_);
			}
		}
	}
	_tmp25_ = self->priv->history_erase_kind;
	gtk_combo_box_set_active ((GtkComboBox*) _tmp25_, 0);
	_tmp26_ = self->priv->history_erase_kind;
	g_signal_connect_object ((GtkComboBox*) _tmp26_, "changed", (GCallback) ___lambda4__gtk_combo_box_changed, self, 0);
	_tmp27_ = top_box;
	_tmp28_ = self->priv->history_erase_kind;
	gtk_box_pack_end (_tmp27_, (GtkWidget*) _tmp28_, FALSE, FALSE, (guint) 0);
	_tmp29_ = alm_calendar_widget_new ();
	_tmp30_ = g_object_ref_sink (_tmp29_);
	_g_object_unref0 (self->priv->calendar_box);
	self->priv->calendar_box = _tmp30_;
	_tmp31_ = (GtkButtonBox*) gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
	_tmp32_ = g_object_ref_sink (_tmp31_);
	_g_object_unref0 (self->priv->button_box);
	self->priv->button_box = _tmp32_;
	_tmp33_ = self->priv->button_box;
	g_object_set (_tmp33_, "layout-style", GTK_BUTTONBOX_START, NULL);
	_tmp34_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	_tmp35_ = g_object_ref_sink (_tmp34_);
	gtk_box_pack_end ((GtkBox*) self, (GtkWidget*) _tmp35_, TRUE, TRUE, (guint) 0);
	_g_object_unref0 (_tmp35_);
	_tmp36_ = self->priv->button_box;
	gtk_box_pack_end ((GtkBox*) self, (GtkWidget*) _tmp36_, FALSE, FALSE, (guint) 0);
	_tmp37_ = (GtkButton*) gtk_button_new_from_stock (GTK_STOCK_DELETE);
	_tmp38_ = g_object_ref_sink (_tmp37_);
	del_button = _tmp38_;
	_tmp39_ = self->priv->button_box;
	gtk_box_pack_start ((GtkBox*) _tmp39_, (GtkWidget*) del_button, FALSE, FALSE, (guint) 0);
	g_signal_connect_object (del_button, "clicked", (GCallback) ___lambda5__gtk_button_clicked, self, 0);
	_g_object_unref0 (del_button);
	_g_object_unref0 (label);
	_g_object_unref0 (top_box);
}


static void alm_history_widget_get_history_data_free (gpointer _data) {
	AlmHistoryWidgetGetHistoryData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->tr);
	_g_object_unref0 (_data_->self);
	g_slice_free (AlmHistoryWidgetGetHistoryData, _data_);
}


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


static void alm_history_widget_get_history (AlmHistoryWidget* self, ZeitgeistTimeRange* tr, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	AlmHistoryWidgetGetHistoryData* _data_;
	AlmHistoryWidget* _tmp0_;
	ZeitgeistTimeRange* _tmp1_;
	ZeitgeistTimeRange* _tmp2_;
	_data_ = g_slice_new0 (AlmHistoryWidgetGetHistoryData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, alm_history_widget_get_history);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, alm_history_widget_get_history_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = tr;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->tr = _tmp2_;
	alm_history_widget_get_history_co (_data_);
}


static void alm_history_widget_get_history_finish (AlmHistoryWidget* self, GAsyncResult* _res_) {
	AlmHistoryWidgetGetHistoryData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean _alm_history_widget_get_history_co_gsource_func (gpointer self) {
	gboolean result;
	result = alm_history_widget_get_history_co (self);
	return result;
}


static void alm_history_widget_get_history_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	AlmHistoryWidgetGetHistoryData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	alm_history_widget_get_history_co (_data_);
}


static gboolean alm_history_widget_get_history_co (AlmHistoryWidgetGetHistoryData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	g_idle_add_full (G_PRIORITY_LOW, _alm_history_widget_get_history_co_gsource_func, _data_, NULL);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	_data_->_tmp0_ = g_ptr_array_new ();
	_data_->ptr_arr = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->ptr_arr;
	_data_->_tmp2_ = zeitgeist_event_new ();
	_data_->_tmp3_ = g_object_ref_sink (_data_->_tmp2_);
	g_ptr_array_add (_data_->_tmp1_, _data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp3_);
	{
		_data_->_tmp4_ = _data_->self->priv->zg_log;
		_data_->_tmp5_ = _data_->tr;
		_data_->_tmp6_ = _data_->ptr_arr;
		_data_->ptr_arr = NULL;
		_data_->_state_ = 2;
		zeitgeist_log_find_event_ids (_data_->_tmp4_, _data_->_tmp5_, _data_->_tmp6_, ZEITGEIST_STORAGE_STATE_ANY, (guint32) 0, 0, NULL, alm_history_widget_get_history_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp7_ = NULL;
		_data_->_tmp7_ = zeitgeist_log_find_event_ids_finish (_data_->_tmp4_, _data_->_res_, &_data_->_inner_error_);
		_data_->ids = _data_->_tmp7_;
		if (_data_->_inner_error_ != NULL) {
			goto __catch0_g_error;
		}
		alm_history_widget_delete_history (_data_->self, _data_->ids, NULL, NULL);
		_g_array_unref0 (_data_->ids);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->err = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp8_ = _data_->err;
		_data_->_tmp9_ = _data_->_tmp8_->message;
		g_warning ("history-widget.vala:133: %s", _data_->_tmp9_);
		_g_error_free0 (_data_->err);
	}
	__finally0:
	if (_data_->_inner_error_ != NULL) {
		_g_ptr_array_unref0 (_data_->ptr_arr);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	_g_ptr_array_unref0 (_data_->ptr_arr);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void alm_history_widget_delete_history_data_free (gpointer _data) {
	AlmHistoryWidgetDeleteHistoryData* _data_;
	_data_ = _data;
	_g_array_unref0 (_data_->ids);
	_g_object_unref0 (_data_->self);
	g_slice_free (AlmHistoryWidgetDeleteHistoryData, _data_);
}


static gpointer _g_array_ref0 (gpointer self) {
	return self ? g_array_ref (self) : NULL;
}


static void alm_history_widget_delete_history (AlmHistoryWidget* self, GArray* ids, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	AlmHistoryWidgetDeleteHistoryData* _data_;
	AlmHistoryWidget* _tmp0_;
	GArray* _tmp1_;
	GArray* _tmp2_;
	_data_ = g_slice_new0 (AlmHistoryWidgetDeleteHistoryData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, alm_history_widget_delete_history);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, alm_history_widget_delete_history_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = ids;
	_tmp2_ = _g_array_ref0 (_tmp1_);
	_data_->ids = _tmp2_;
	alm_history_widget_delete_history_co (_data_);
}


static void alm_history_widget_delete_history_finish (AlmHistoryWidget* self, GAsyncResult* _res_) {
	AlmHistoryWidgetDeleteHistoryData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean _alm_history_widget_delete_history_co_gsource_func (gpointer self) {
	gboolean result;
	result = alm_history_widget_delete_history_co (self);
	return result;
}


static void alm_history_widget_delete_history_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	AlmHistoryWidgetDeleteHistoryData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	alm_history_widget_delete_history_co (_data_);
}


static gboolean alm_history_widget_delete_history_co (AlmHistoryWidgetDeleteHistoryData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	g_idle_add_full (G_PRIORITY_LOW, _alm_history_widget_delete_history_co_gsource_func, _data_, NULL);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	{
		_data_->_tmp0_ = stdout;
		_data_->_tmp1_ = _data_->ids;
		_data_->_tmp2_ = _data_->_tmp1_->len;
		fprintf (_data_->_tmp0_, "%u\n", _data_->_tmp2_);
		_data_->_tmp3_ = _data_->self->priv->zg_log;
		_data_->_tmp4_ = _data_->ids;
		_data_->_tmp5_ = _g_array_ref0 (_data_->_tmp4_);
		_data_->_state_ = 2;
		zeitgeist_log_delete_events (_data_->_tmp3_, _data_->_tmp5_, NULL, alm_history_widget_delete_history_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp6_ = FALSE;
		_data_->_tmp6_ = zeitgeist_log_delete_events_finish (_data_->_tmp3_, _data_->_res_, &_data_->_inner_error_);
		_data_->rs = _data_->_tmp6_;
		if (_data_->_inner_error_ != NULL) {
			goto __catch1_g_error;
		}
	}
	goto __finally1;
	__catch1_g_error:
	{
		_data_->err = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp7_ = _data_->err;
		_data_->_tmp8_ = _data_->_tmp7_->message;
		g_warning ("history-widget.vala:146: %s", _data_->_tmp8_);
		_g_error_free0 (_data_->err);
	}
	__finally1:
	if (_data_->_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void alm_history_widget_insert_calendar (AlmHistoryWidget* self) {
	AlmCalendarWidget* _tmp0_;
	GtkWidget* _tmp1_ = NULL;
	AlmCalendarWidget* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->calendar_box;
	_tmp1_ = gtk_widget_get_parent ((GtkWidget*) _tmp0_);
	if (_tmp1_ == NULL) {
		AlmCalendarWidget* _tmp2_;
		_tmp2_ = self->priv->calendar_box;
		gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) _tmp2_, FALSE, FALSE, (guint) 9);
	}
	_tmp3_ = self->priv->calendar_box;
	gtk_widget_show_all ((GtkWidget*) _tmp3_);
}


static void alm_history_widget_remove_calendar (AlmHistoryWidget* self) {
	AlmCalendarWidget* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->calendar_box;
	gtk_widget_hide ((GtkWidget*) _tmp0_);
}


static void alm_history_widget_on_history_combo_changed (AlmHistoryWidget* self, GtkComboBoxText* box) {
	GtkComboBoxText* _tmp0_;
	const gchar* _tmp1_ = NULL;
	GtkComboBoxText* _tmp2_;
	const gchar* _tmp3_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (box != NULL);
	_tmp0_ = box;
	_tmp1_ = gtk_combo_box_text_get_active_text (_tmp0_);
	g_debug ("history-widget.vala:167: %s", _tmp1_);
	_tmp2_ = box;
	_tmp3_ = gtk_combo_box_text_get_active_text (_tmp2_);
	if (g_strcmp0 (_tmp3_, "custom") == 0) {
		alm_history_widget_insert_calendar (self);
	} else {
		alm_history_widget_remove_calendar (self);
	}
}


static void alm_history_widget_class_init (AlmHistoryWidgetClass * klass) {
	alm_history_widget_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (AlmHistoryWidgetPrivate));
	G_OBJECT_CLASS (klass)->finalize = alm_history_widget_finalize;
}


static void alm_history_widget_instance_init (AlmHistoryWidget * self) {
	self->priv = ALM_HISTORY_WIDGET_GET_PRIVATE (self);
}


static void alm_history_widget_finalize (GObject* obj) {
	AlmHistoryWidget * self;
	self = ALM_HISTORY_WIDGET (obj);
	_g_object_unref0 (self->priv->past_records);
	_g_object_unref0 (self->priv->calendar_box);
	_g_object_unref0 (self->priv->button_box);
	_g_object_unref0 (self->priv->zg_log);
	_g_object_unref0 (self->priv->history_erase_kind);
	G_OBJECT_CLASS (alm_history_widget_parent_class)->finalize (obj);
}


GType alm_history_widget_get_type (void) {
	static volatile gsize alm_history_widget_type_id__volatile = 0;
	if (g_once_init_enter (&alm_history_widget_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (AlmHistoryWidgetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) alm_history_widget_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AlmHistoryWidget), 0, (GInstanceInitFunc) alm_history_widget_instance_init, NULL };
		GType alm_history_widget_type_id;
		alm_history_widget_type_id = g_type_register_static (GTK_TYPE_BOX, "AlmHistoryWidget", &g_define_type_info, 0);
		g_once_init_leave (&alm_history_widget_type_id__volatile, alm_history_widget_type_id);
	}
	return alm_history_widget_type_id__volatile;
}


AlmCalendarDialog* alm_calendar_dialog_construct (GType object_type) {
	AlmCalendarDialog * self = NULL;
	GtkCalendar* _tmp0_;
	GtkCalendar* _tmp1_;
	GtkBox* _tmp2_ = NULL;
	GtkCalendar* _tmp3_;
	GValue _tmp4_ = {0};
	self = (AlmCalendarDialog*) g_object_new (object_type, NULL);
	_tmp0_ = (GtkCalendar*) gtk_calendar_new ();
	_tmp1_ = g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->calendar);
	self->priv->calendar = _tmp1_;
	_tmp2_ = gtk_dialog_get_content_area ((GtkDialog*) self);
	_tmp3_ = self->priv->calendar;
	gtk_container_add (GTK_CONTAINER (_tmp2_), (GtkWidget*) _tmp3_);
	gtk_window_set_decorated ((GtkWindow*) self, FALSE);
	gtk_window_set_position ((GtkWindow*) self, 0);
	g_value_init (&_tmp4_, G_TYPE_BOOLEAN);
	g_value_set_boolean (&_tmp4_, TRUE);
	g_object_set_property ((GObject*) self, "skip-taskbar-hint", &_tmp4_);
	G_IS_VALUE (&_tmp4_) ? (g_value_unset (&_tmp4_), NULL) : NULL;
	return self;
}


AlmCalendarDialog* alm_calendar_dialog_new (void) {
	return alm_calendar_dialog_construct (ALM_TYPE_CALENDAR_DIALOG);
}


GtkCalendar* alm_calendar_dialog_get_calendar_widget (AlmCalendarDialog* self) {
	GtkCalendar* result = NULL;
	GtkCalendar* _tmp0_;
	GtkCalendar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->calendar;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}


static void alm_calendar_dialog_class_init (AlmCalendarDialogClass * klass) {
	alm_calendar_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (AlmCalendarDialogPrivate));
	G_OBJECT_CLASS (klass)->finalize = alm_calendar_dialog_finalize;
}


static void alm_calendar_dialog_instance_init (AlmCalendarDialog * self) {
	self->priv = ALM_CALENDAR_DIALOG_GET_PRIVATE (self);
}


static void alm_calendar_dialog_finalize (GObject* obj) {
	AlmCalendarDialog * self;
	self = ALM_CALENDAR_DIALOG (obj);
	_g_object_unref0 (self->priv->calendar);
	G_OBJECT_CLASS (alm_calendar_dialog_parent_class)->finalize (obj);
}


GType alm_calendar_dialog_get_type (void) {
	static volatile gsize alm_calendar_dialog_type_id__volatile = 0;
	if (g_once_init_enter (&alm_calendar_dialog_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (AlmCalendarDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) alm_calendar_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AlmCalendarDialog), 0, (GInstanceInitFunc) alm_calendar_dialog_instance_init, NULL };
		GType alm_calendar_dialog_type_id;
		alm_calendar_dialog_type_id = g_type_register_static (GTK_TYPE_DIALOG, "AlmCalendarDialog", &g_define_type_info, 0);
		g_once_init_leave (&alm_calendar_dialog_type_id__volatile, alm_calendar_dialog_type_id);
	}
	return alm_calendar_dialog_type_id__volatile;
}


static Block1Data* block1_data_ref (Block1Data* _data1_) {
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}


static void block1_data_unref (Block1Data* _data1_) {
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		_g_object_unref0 (_data1_->self);
		_g_object_unref0 (_data1_->end_button);
		_g_object_unref0 (_data1_->start_button);
		g_slice_free (Block1Data, _data1_);
	}
}


static void __lambda0_ (Block1Data* _data1_) {
	AlmCalendarWidget * self;
	GtkEntry* _tmp0_;
	AlmCalendarDialog* _tmp1_;
	self = _data1_->self;
	_tmp0_ = self->priv->start_entry;
	_tmp1_ = self->priv->start_dialog;
	alm_calendar_widget_on_clicked (self, (GtkWidget*) _data1_->start_button, _tmp0_, _tmp1_);
}


static void ___lambda0__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda0_ (self);
}


static void __lambda3_ (Block1Data* _data1_) {
	AlmCalendarWidget * self;
	GtkEntry* _tmp0_;
	AlmCalendarDialog* _tmp1_;
	self = _data1_->self;
	_tmp0_ = self->priv->end_entry;
	_tmp1_ = self->priv->end_dialog;
	alm_calendar_widget_on_clicked (self, (GtkWidget*) _data1_->end_button, _tmp0_, _tmp1_);
}


static void ___lambda3__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda3_ (self);
}


AlmCalendarWidget* alm_calendar_widget_construct (GType object_type) {
	AlmCalendarWidget * self = NULL;
	Block1Data* _data1_;
	AlmCalendarDialog* _tmp0_;
	AlmCalendarDialog* _tmp1_;
	AlmCalendarDialog* _tmp2_;
	AlmCalendarDialog* _tmp3_;
	GtkBox* _tmp4_;
	GtkBox* _tmp5_;
	GtkBox* box1;
	GtkEntry* _tmp6_;
	GtkEntry* _tmp7_;
	GtkButton* _tmp8_;
	GtkButton* _tmp9_;
	GtkArrow* _tmp10_;
	GtkArrow* _tmp11_;
	GtkArrow* arrow1;
	GtkEntry* _tmp12_;
	GtkEntry* _tmp13_;
	GtkEntry* _tmp14_;
	GtkBox* _tmp15_;
	GtkBox* _tmp16_;
	GtkBox* box2;
	GtkEntry* _tmp17_;
	GtkEntry* _tmp18_;
	GtkButton* _tmp19_;
	GtkButton* _tmp20_;
	GtkArrow* _tmp21_;
	GtkArrow* _tmp22_;
	GtkArrow* arrow2;
	GtkEntry* _tmp23_;
	GtkEntry* _tmp24_;
	GtkEntry* _tmp25_;
	GtkLabel* _tmp26_;
	GtkLabel* _tmp27_;
	GtkLabel* start_label;
	GtkLabel* _tmp28_;
	GtkLabel* _tmp29_;
	GtkLabel* end_label;
	GtkEntry* _tmp30_;
	AlmCalendarDialog* _tmp31_;
	GtkEntry* _tmp32_;
	AlmCalendarDialog* _tmp33_;
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	self = (AlmCalendarWidget*) g_object_new (object_type, NULL);
	_data1_->self = g_object_ref (self);
	_tmp0_ = alm_calendar_dialog_new ();
	_tmp1_ = g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->start_dialog);
	self->priv->start_dialog = _tmp1_;
	_tmp2_ = alm_calendar_dialog_new ();
	_tmp3_ = g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->end_dialog);
	self->priv->end_dialog = _tmp3_;
	gtk_grid_set_row_spacing ((GtkGrid*) self, (guint) 9);
	gtk_grid_set_column_spacing ((GtkGrid*) self, (guint) 15);
	_tmp4_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	_tmp5_ = g_object_ref_sink (_tmp4_);
	box1 = _tmp5_;
	_tmp6_ = (GtkEntry*) gtk_entry_new ();
	_tmp7_ = g_object_ref_sink (_tmp6_);
	_g_object_unref0 (self->priv->start_entry);
	self->priv->start_entry = _tmp7_;
	_tmp8_ = (GtkButton*) gtk_button_new ();
	_tmp9_ = g_object_ref_sink (_tmp8_);
	_data1_->start_button = _tmp9_;
	_tmp10_ = (GtkArrow*) gtk_arrow_new (GTK_ARROW_DOWN, 0);
	_tmp11_ = g_object_ref_sink (_tmp10_);
	arrow1 = _tmp11_;
	gtk_container_add ((GtkContainer*) _data1_->start_button, (GtkWidget*) arrow1);
	_tmp12_ = self->priv->start_entry;
	gtk_editable_set_editable ((GtkEditable*) _tmp12_, FALSE);
	_tmp13_ = self->priv->start_entry;
	gtk_widget_set_size_request ((GtkWidget*) _tmp13_, 300, -1);
	_tmp14_ = self->priv->start_entry;
	gtk_box_pack_start (box1, (GtkWidget*) _tmp14_, TRUE, TRUE, (guint) 0);
	gtk_box_pack_start (box1, (GtkWidget*) _data1_->start_button, TRUE, TRUE, (guint) 0);
	g_signal_connect_data (_data1_->start_button, "clicked", (GCallback) ___lambda0__gtk_button_clicked, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	_tmp15_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	_tmp16_ = g_object_ref_sink (_tmp15_);
	box2 = _tmp16_;
	_tmp17_ = (GtkEntry*) gtk_entry_new ();
	_tmp18_ = g_object_ref_sink (_tmp17_);
	_g_object_unref0 (self->priv->end_entry);
	self->priv->end_entry = _tmp18_;
	_tmp19_ = (GtkButton*) gtk_button_new ();
	_tmp20_ = g_object_ref_sink (_tmp19_);
	_data1_->end_button = _tmp20_;
	_tmp21_ = (GtkArrow*) gtk_arrow_new (GTK_ARROW_DOWN, 0);
	_tmp22_ = g_object_ref_sink (_tmp21_);
	arrow2 = _tmp22_;
	gtk_container_add ((GtkContainer*) _data1_->end_button, (GtkWidget*) arrow2);
	_tmp23_ = self->priv->end_entry;
	gtk_editable_set_editable ((GtkEditable*) _tmp23_, FALSE);
	_tmp24_ = self->priv->end_entry;
	gtk_widget_set_size_request ((GtkWidget*) _tmp24_, 300, -1);
	_tmp25_ = self->priv->end_entry;
	gtk_box_pack_start (box2, (GtkWidget*) _tmp25_, TRUE, TRUE, (guint) 0);
	gtk_box_pack_start (box2, (GtkWidget*) _data1_->end_button, TRUE, TRUE, (guint) 0);
	g_signal_connect_data (_data1_->end_button, "clicked", (GCallback) ___lambda3__gtk_button_clicked, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	_tmp26_ = (GtkLabel*) gtk_label_new ("");
	_tmp27_ = g_object_ref_sink (_tmp26_);
	start_label = _tmp27_;
	gtk_label_set_markup (start_label, "<b>From:</b>");
	gtk_misc_set_alignment ((GtkMisc*) start_label, (gfloat) 0, (gfloat) (0 / 5));
	_tmp28_ = (GtkLabel*) gtk_label_new ("");
	_tmp29_ = g_object_ref_sink (_tmp28_);
	end_label = _tmp29_;
	gtk_label_set_markup (end_label, "<b>To:</b>");
	gtk_misc_set_alignment ((GtkMisc*) end_label, (gfloat) 0, (gfloat) (0 / 5));
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) start_label);
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) box1, 1, 0, 1, 1);
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) end_label, 0, 1, 1, 1);
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) box2, 1, 1, 1, 1);
	_tmp30_ = self->priv->start_entry;
	_tmp31_ = self->priv->start_dialog;
	alm_calendar_widget_set_up_calendar (self, _data1_->start_button, _tmp30_, _tmp31_);
	_tmp32_ = self->priv->end_entry;
	_tmp33_ = self->priv->end_dialog;
	alm_calendar_widget_set_up_calendar (self, _data1_->end_button, _tmp32_, _tmp33_);
	gtk_widget_show_all ((GtkWidget*) self);
	_g_object_unref0 (end_label);
	_g_object_unref0 (start_label);
	_g_object_unref0 (arrow2);
	_g_object_unref0 (box2);
	_g_object_unref0 (arrow1);
	_g_object_unref0 (box1);
	block1_data_unref (_data1_);
	_data1_ = NULL;
	return self;
}


AlmCalendarWidget* alm_calendar_widget_new (void) {
	return alm_calendar_widget_construct (ALM_TYPE_CALENDAR_WIDGET);
}


ZeitgeistTimeRange* alm_calendar_widget_get_range (AlmCalendarWidget* self) {
	ZeitgeistTimeRange* result = NULL;
	AlmCalendarDialog* _tmp0_;
	GtkCalendar* _tmp1_ = NULL;
	GtkCalendar* calendar;
	guint year = 0U;
	guint month = 0U;
	guint day = 0U;
	GtkCalendar* _tmp2_;
	guint _tmp3_ = 0U;
	guint _tmp4_ = 0U;
	guint _tmp5_ = 0U;
	guint _tmp6_;
	guint _tmp7_;
	guint _tmp8_;
	GDateTime* _tmp9_;
	GDateTime* date;
	GDateTime* _tmp10_;
	gint64 _tmp11_ = 0LL;
	gint64 start;
	FILE* _tmp12_;
	AlmCalendarDialog* _tmp13_;
	GtkCalendar* _tmp14_ = NULL;
	GtkCalendar* _tmp15_;
	guint _tmp16_ = 0U;
	guint _tmp17_ = 0U;
	guint _tmp18_ = 0U;
	guint _tmp19_;
	guint _tmp20_;
	guint _tmp21_;
	GDateTime* _tmp22_;
	GDateTime* _tmp23_;
	gint64 _tmp24_ = 0LL;
	gint64 end;
	FILE* _tmp25_;
	ZeitgeistTimeRange* _tmp26_;
	ZeitgeistTimeRange* _tmp27_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->start_dialog;
	_tmp1_ = alm_calendar_dialog_get_calendar_widget (_tmp0_);
	calendar = _tmp1_;
	_tmp2_ = calendar;
	gtk_calendar_get_date (_tmp2_, &_tmp3_, &_tmp4_, &_tmp5_);
	year = _tmp3_;
	month = _tmp4_;
	day = _tmp5_;
	_tmp6_ = year;
	_tmp7_ = month;
	_tmp8_ = day;
	_tmp9_ = g_date_time_new_local ((gint) _tmp6_, (gint) _tmp7_, (gint) _tmp8_, 0, 0, (gdouble) 0);
	date = _tmp9_;
	_tmp10_ = date;
	_tmp11_ = g_date_time_to_unix (_tmp10_);
	start = _tmp11_ * 1000;
	_tmp12_ = stdout;
	fprintf (_tmp12_, "11111111\n");
	_tmp13_ = self->priv->end_dialog;
	_tmp14_ = alm_calendar_dialog_get_calendar_widget (_tmp13_);
	_g_object_unref0 (calendar);
	calendar = _tmp14_;
	_tmp15_ = calendar;
	gtk_calendar_get_date (_tmp15_, &_tmp16_, &_tmp17_, &_tmp18_);
	year = _tmp16_;
	month = _tmp17_;
	day = _tmp18_;
	_tmp19_ = year;
	_tmp20_ = month;
	_tmp21_ = day;
	_tmp22_ = g_date_time_new_local ((gint) _tmp19_, (gint) _tmp20_, (gint) _tmp21_, 0, 0, (gdouble) 0);
	_g_date_time_unref0 (date);
	date = _tmp22_;
	_tmp23_ = date;
	_tmp24_ = g_date_time_to_unix (_tmp23_);
	end = _tmp24_ * 1000;
	_tmp25_ = stdout;
	fprintf (_tmp25_, "%lld - %lld \n", start, end);
	_tmp26_ = zeitgeist_time_range_new (start, end);
	_tmp27_ = g_object_ref_sink (_tmp26_);
	result = _tmp27_;
	_g_date_time_unref0 (date);
	_g_object_unref0 (calendar);
	return result;
}


void alm_calendar_widget_set_up_calendar (AlmCalendarWidget* self, GtkButton* widget, GtkEntry* entry, AlmCalendarDialog* dialog) {
	AlmCalendarDialog* _tmp0_;
	GtkCalendar* _tmp1_ = NULL;
	GtkCalendar* calendar;
	guint year = 0U;
	guint month = 0U;
	guint day = 0U;
	guint _tmp2_ = 0U;
	guint _tmp3_ = 0U;
	guint _tmp4_ = 0U;
	GDateTime* _tmp5_;
	GDateTime* date;
	gchar* _tmp6_ = NULL;
	gchar* date_string;
	FILE* _tmp7_;
	GtkEntry* _tmp8_;
	GtkButton* _tmp9_;
	AlmCalendarDialog* _tmp10_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	g_return_if_fail (entry != NULL);
	g_return_if_fail (dialog != NULL);
	_tmp0_ = dialog;
	_tmp1_ = alm_calendar_dialog_get_calendar_widget (_tmp0_);
	calendar = _tmp1_;
	gtk_calendar_get_date (calendar, &_tmp2_, &_tmp3_, &_tmp4_);
	year = _tmp2_;
	month = _tmp3_;
	day = _tmp4_;
	_tmp5_ = g_date_time_new_local ((gint) year, (gint) month, (gint) day, 0, 0, (gdouble) 0);
	date = _tmp5_;
	_tmp6_ = g_date_time_format (date, "%A, %d %B %Y");
	date_string = _tmp6_;
	_tmp7_ = stdout;
	fprintf (_tmp7_, "%u %u %u\n", year, month + 1, day);
	_tmp8_ = entry;
	gtk_entry_set_text (_tmp8_, date_string);
	_tmp9_ = widget;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp9_, TRUE);
	_tmp10_ = dialog;
	gtk_widget_hide ((GtkWidget*) _tmp10_);
	_g_free0 (date_string);
	_g_date_time_unref0 (date);
	_g_object_unref0 (calendar);
}


static Block2Data* block2_data_ref (Block2Data* _data2_) {
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}


static void block2_data_unref (Block2Data* _data2_) {
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		_g_object_unref0 (_data2_->self);
		_g_object_unref0 (_data2_->widget);
		_g_object_unref0 (_data2_->entry);
		_g_object_unref0 (_data2_->dialog);
		g_slice_free (Block2Data, _data2_);
	}
}


static gboolean __lambda1_ (Block2Data* _data2_, GtkWidget* w, GdkEventFocus* e) {
	AlmCalendarWidget * self;
	gboolean result = FALSE;
	AlmCalendarDialog* _tmp0_;
	GtkWidget* _tmp1_;
	self = _data2_->self;
	g_return_val_if_fail (w != NULL, FALSE);
	g_return_val_if_fail (e != NULL, FALSE);
	_tmp0_ = _data2_->dialog;
	gtk_widget_hide ((GtkWidget*) _tmp0_);
	_tmp1_ = _data2_->widget;
	gtk_widget_set_sensitive (_tmp1_, TRUE);
	result = FALSE;
	return result;
}


static gboolean ___lambda1__gtk_widget_focus_out_event (GtkWidget* _sender, GdkEventFocus* event, gpointer self) {
	gboolean result;
	result = __lambda1_ (self, _sender, event);
	return result;
}


static void __lambda2_ (Block2Data* _data2_) {
	AlmCalendarWidget * self;
	AlmCalendarDialog* _tmp0_;
	GtkCalendar* _tmp1_ = NULL;
	GtkCalendar* calendar;
	guint year = 0U;
	guint month = 0U;
	guint day = 0U;
	guint _tmp2_ = 0U;
	guint _tmp3_ = 0U;
	guint _tmp4_ = 0U;
	GDateTime* _tmp5_;
	GDateTime* date;
	gchar* _tmp6_ = NULL;
	gchar* date_string;
	FILE* _tmp7_;
	GtkEntry* _tmp8_;
	GtkWidget* _tmp9_;
	AlmCalendarDialog* _tmp10_;
	self = _data2_->self;
	_tmp0_ = _data2_->dialog;
	_tmp1_ = alm_calendar_dialog_get_calendar_widget (_tmp0_);
	calendar = _tmp1_;
	gtk_calendar_get_date (calendar, &_tmp2_, &_tmp3_, &_tmp4_);
	year = _tmp2_;
	month = _tmp3_;
	day = _tmp4_;
	_tmp5_ = g_date_time_new_local ((gint) year, (gint) month, (gint) day, 0, 0, (gdouble) 0);
	date = _tmp5_;
	_tmp6_ = g_date_time_format (date, "%A, %d %B %Y");
	date_string = _tmp6_;
	_tmp7_ = stdout;
	fprintf (_tmp7_, "%u %u %u\n", year, month + 1, day);
	_tmp8_ = _data2_->entry;
	gtk_entry_set_text (_tmp8_, date_string);
	_tmp9_ = _data2_->widget;
	gtk_widget_set_sensitive (_tmp9_, TRUE);
	_tmp10_ = _data2_->dialog;
	gtk_widget_hide ((GtkWidget*) _tmp10_);
	_g_free0 (date_string);
	_g_date_time_unref0 (date);
	_g_object_unref0 (calendar);
}


static void ___lambda2__gtk_calendar_day_selected_double_click (GtkCalendar* _sender, gpointer self) {
	__lambda2_ (self);
}


void alm_calendar_widget_on_clicked (AlmCalendarWidget* self, GtkWidget* widget, GtkEntry* entry, AlmCalendarDialog* dialog) {
	Block2Data* _data2_;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	GtkEntry* _tmp2_;
	GtkEntry* _tmp3_;
	AlmCalendarDialog* _tmp4_;
	AlmCalendarDialog* _tmp5_;
	AlmCalendarDialog* _tmp6_;
	GdkWindow* _tmp7_ = NULL;
	GdkWindow* _tmp8_;
	GdkWindow* parent_window;
	gint window_x = 0;
	gint window_y = 0;
	gint _tmp9_ = 0;
	gint _tmp10_ = 0;
	GtkAllocation allocation = {0};
	GtkEntry* _tmp11_;
	GtkAllocation _tmp12_ = {0};
	AlmCalendarDialog* _tmp13_;
	GtkAllocation _tmp14_;
	gint _tmp15_;
	GtkAllocation _tmp16_;
	gint _tmp17_;
	GtkAllocation _tmp18_;
	gint _tmp19_;
	AlmCalendarDialog* _tmp20_;
	GtkAllocation _tmp21_;
	gint _tmp22_;
	AlmCalendarDialog* _tmp23_;
	GtkWidget* _tmp24_;
	AlmCalendarDialog* _tmp25_;
	AlmCalendarDialog* _tmp26_;
	GtkCalendar* _tmp27_ = NULL;
	GtkCalendar* cal;
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	g_return_if_fail (entry != NULL);
	g_return_if_fail (dialog != NULL);
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	_data2_->self = g_object_ref (self);
	_tmp0_ = widget;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_data2_->widget = _tmp1_;
	_tmp2_ = entry;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_data2_->entry = _tmp3_;
	_tmp4_ = dialog;
	_tmp5_ = _g_object_ref0 (_tmp4_);
	_data2_->dialog = _tmp5_;
	_tmp6_ = _data2_->dialog;
	gtk_widget_show_all ((GtkWidget*) _tmp6_);
	_tmp7_ = gtk_widget_get_parent_window ((GtkWidget*) self);
	_tmp8_ = _g_object_ref0 (_tmp7_);
	parent_window = _tmp8_;
	gdk_window_get_position (parent_window, &_tmp9_, &_tmp10_);
	window_x = _tmp9_;
	window_y = _tmp10_;
	_tmp11_ = _data2_->entry;
	gtk_widget_get_allocation ((GtkWidget*) _tmp11_, &_tmp12_);
	allocation = _tmp12_;
	_tmp13_ = _data2_->dialog;
	_tmp14_ = allocation;
	_tmp15_ = _tmp14_.x;
	_tmp16_ = allocation;
	_tmp17_ = _tmp16_.y;
	_tmp18_ = allocation;
	_tmp19_ = _tmp18_.height;
	gtk_window_move ((GtkWindow*) _tmp13_, window_x + _tmp15_, (window_y + _tmp17_) + _tmp19_);
	_tmp20_ = _data2_->dialog;
	_tmp21_ = allocation;
	_tmp22_ = _tmp21_.width;
	gtk_widget_set_size_request ((GtkWidget*) _tmp20_, _tmp22_, -1);
	_tmp23_ = _data2_->dialog;
	gtk_window_set_resizable ((GtkWindow*) _tmp23_, FALSE);
	_tmp24_ = _data2_->widget;
	gtk_widget_set_sensitive (_tmp24_, FALSE);
	_tmp25_ = _data2_->dialog;
	g_signal_connect_data ((GtkWidget*) _tmp25_, "focus-out-event", (GCallback) ___lambda1__gtk_widget_focus_out_event, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, G_CONNECT_AFTER);
	_tmp26_ = _data2_->dialog;
	_tmp27_ = alm_calendar_dialog_get_calendar_widget (_tmp26_);
	cal = _tmp27_;
	g_signal_connect_data (cal, "day-selected-double-click", (GCallback) ___lambda2__gtk_calendar_day_selected_double_click, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
	_g_object_unref0 (cal);
	_g_object_unref0 (parent_window);
	block2_data_unref (_data2_);
	_data2_ = NULL;
}


static void alm_calendar_widget_class_init (AlmCalendarWidgetClass * klass) {
	alm_calendar_widget_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (AlmCalendarWidgetPrivate));
	G_OBJECT_CLASS (klass)->finalize = alm_calendar_widget_finalize;
}


static void alm_calendar_widget_instance_init (AlmCalendarWidget * self) {
	self->priv = ALM_CALENDAR_WIDGET_GET_PRIVATE (self);
}


static void alm_calendar_widget_finalize (GObject* obj) {
	AlmCalendarWidget * self;
	self = ALM_CALENDAR_WIDGET (obj);
	_g_object_unref0 (self->priv->start_entry);
	_g_object_unref0 (self->priv->end_entry);
	_g_object_unref0 (self->priv->start_dialog);
	_g_object_unref0 (self->priv->end_dialog);
	G_OBJECT_CLASS (alm_calendar_widget_parent_class)->finalize (obj);
}


GType alm_calendar_widget_get_type (void) {
	static volatile gsize alm_calendar_widget_type_id__volatile = 0;
	if (g_once_init_enter (&alm_calendar_widget_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (AlmCalendarWidgetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) alm_calendar_widget_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AlmCalendarWidget), 0, (GInstanceInitFunc) alm_calendar_widget_instance_init, NULL };
		GType alm_calendar_widget_type_id;
		alm_calendar_widget_type_id = g_type_register_static (GTK_TYPE_GRID, "AlmCalendarWidget", &g_define_type_info, 0);
		g_once_init_leave (&alm_calendar_widget_type_id__volatile, alm_calendar_widget_type_id);
	}
	return alm_calendar_widget_type_id__volatile;
}