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
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
|
/* RGBHistogramManipulator.c generated by valac 0.36.6, the Vala compiler
* generated from RGBHistogramManipulator.vala, do not modify */
/* Copyright 2016 Software Freedom Conservancy Inc.
*
* This software is licensed under the GNU LGPL (version 2.1 or later).
* See the COPYING file in this distribution.
*/
#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include "shotwell-graphics-processor.h"
#include <gdk/gdk.h>
#include <cairo.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#define TYPE_RGB_HISTOGRAM_MANIPULATOR (rgb_histogram_manipulator_get_type ())
#define RGB_HISTOGRAM_MANIPULATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_RGB_HISTOGRAM_MANIPULATOR, RGBHistogramManipulator))
#define RGB_HISTOGRAM_MANIPULATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_RGB_HISTOGRAM_MANIPULATOR, RGBHistogramManipulatorClass))
#define IS_RGB_HISTOGRAM_MANIPULATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_RGB_HISTOGRAM_MANIPULATOR))
#define IS_RGB_HISTOGRAM_MANIPULATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_RGB_HISTOGRAM_MANIPULATOR))
#define RGB_HISTOGRAM_MANIPULATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_RGB_HISTOGRAM_MANIPULATOR, RGBHistogramManipulatorClass))
typedef struct _RGBHistogramManipulator RGBHistogramManipulator;
typedef struct _RGBHistogramManipulatorClass RGBHistogramManipulatorClass;
typedef struct _RGBHistogramManipulatorPrivate RGBHistogramManipulatorPrivate;
#define RGB_HISTOGRAM_MANIPULATOR_TYPE_LOCATION_CODE (rgb_histogram_manipulator_location_code_get_type ())
#define _rgb_histogram_unref0(var) ((var == NULL) ? NULL : (var = (rgb_histogram_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
enum {
RGB_HISTOGRAM_MANIPULATOR_NUB_POSITION_CHANGED_SIGNAL,
RGB_HISTOGRAM_MANIPULATOR_LAST_SIGNAL
};
static guint rgb_histogram_manipulator_signals[RGB_HISTOGRAM_MANIPULATOR_LAST_SIGNAL] = {0};
#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 _RGBHistogramManipulator {
GtkDrawingArea parent_instance;
RGBHistogramManipulatorPrivate * priv;
};
struct _RGBHistogramManipulatorClass {
GtkDrawingAreaClass parent_class;
};
struct _RGBHistogramManipulatorPrivate {
gint left_nub_max;
gint right_nub_min;
RGBHistogram* histogram;
gint left_nub_position;
gint right_nub_position;
gboolean is_left_nub_tracking;
gboolean is_right_nub_tracking;
gint track_start_x;
gint track_nub_start_position;
gint offset;
};
typedef enum {
RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_LEFT_NUB,
RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_RIGHT_NUB,
RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_LEFT_TROUGH,
RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_RIGHT_TROUGH,
RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_INSENSITIVE_AREA
} RGBHistogramManipulatorLocationCode;
static gpointer rgb_histogram_manipulator_parent_class = NULL;
static GtkWidgetPath* rgb_histogram_manipulator_slider_draw_path;
static GtkWidgetPath* rgb_histogram_manipulator_slider_draw_path = NULL;
static GtkWidgetPath* rgb_histogram_manipulator_frame_draw_path;
static GtkWidgetPath* rgb_histogram_manipulator_frame_draw_path = NULL;
static gboolean rgb_histogram_manipulator_paths_setup;
static gboolean rgb_histogram_manipulator_paths_setup = FALSE;
GType rgb_histogram_manipulator_get_type (void) G_GNUC_CONST;
#define RGB_HISTOGRAM_MANIPULATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_RGB_HISTOGRAM_MANIPULATOR, RGBHistogramManipulatorPrivate))
enum {
RGB_HISTOGRAM_MANIPULATOR_DUMMY_PROPERTY
};
static GType rgb_histogram_manipulator_location_code_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
#define RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE 13
#define RGB_HISTOGRAM_MANIPULATOR_NUB_HALF_WIDTH (RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE / 2)
#define RGB_HISTOGRAM_MANIPULATOR_NUB_V_NUDGE 4
#define RGB_HISTOGRAM_MANIPULATOR_TROUGH_WIDTH (256 + (2 * RGB_HISTOGRAM_MANIPULATOR_NUB_HALF_WIDTH))
#define RGB_HISTOGRAM_MANIPULATOR_TROUGH_HEIGHT 4
#define RGB_HISTOGRAM_MANIPULATOR_TROUGH_BOTTOM_OFFSET 1
#define RGB_HISTOGRAM_MANIPULATOR_CONTROL_WIDTH (RGB_HISTOGRAM_MANIPULATOR_TROUGH_WIDTH + 2)
#define RGB_HISTOGRAM_MANIPULATOR_CONTROL_HEIGHT 118
#define RGB_HISTOGRAM_MANIPULATOR_NUB_V_POSITION (((((RGB_HISTOGRAM_MANIPULATOR_CONTROL_HEIGHT - RGB_HISTOGRAM_MANIPULATOR_TROUGH_HEIGHT) - RGB_HISTOGRAM_MANIPULATOR_TROUGH_BOTTOM_OFFSET) - ((RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE - RGB_HISTOGRAM_MANIPULATOR_TROUGH_HEIGHT) / 2)) - RGB_HISTOGRAM_MANIPULATOR_NUB_V_NUDGE) - 2)
RGBHistogramManipulator* rgb_histogram_manipulator_new (void);
RGBHistogramManipulator* rgb_histogram_manipulator_construct (GType object_type);
static gboolean rgb_histogram_manipulator_on_button_press (RGBHistogramManipulator* self, GdkEventButton* event_record);
static gboolean _rgb_histogram_manipulator_on_button_press_gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self);
static gboolean rgb_histogram_manipulator_on_button_release (RGBHistogramManipulator* self, GdkEventButton* event_record);
static gboolean _rgb_histogram_manipulator_on_button_release_gtk_widget_button_release_event (GtkWidget* _sender, GdkEventButton* event, gpointer self);
static gboolean rgb_histogram_manipulator_on_button_motion (RGBHistogramManipulator* self, GdkEventMotion* event_record);
static gboolean _rgb_histogram_manipulator_on_button_motion_gtk_widget_motion_notify_event (GtkWidget* _sender, GdkEventMotion* event, gpointer self);
static void rgb_histogram_manipulator_on_size_allocate (RGBHistogramManipulator* self, GtkAllocation* region);
static void _rgb_histogram_manipulator_on_size_allocate_gtk_widget_size_allocate (GtkWidget* _sender, GtkAllocation* allocation, gpointer self);
static RGBHistogramManipulatorLocationCode rgb_histogram_manipulator_hit_test_point (RGBHistogramManipulator* self, gint x, gint y);
static void rgb_histogram_manipulator_force_update (RGBHistogramManipulator* self);
static void rgb_histogram_manipulator_update_nub_extrema (RGBHistogramManipulator* self);
static gboolean rgb_histogram_manipulator_real_focus_out_event (GtkWidget* base, GdkEventFocus* event);
static gboolean rgb_histogram_manipulator_real_key_press_event (GtkWidget* base, GdkEventKey* event);
static gboolean rgb_histogram_manipulator_real_draw (GtkWidget* base, cairo_t* ctx);
static void rgb_histogram_manipulator_draw_histogram (RGBHistogramManipulator* self, cairo_t* ctx, GdkRectangle* area);
static void rgb_histogram_manipulator_draw_nub (RGBHistogramManipulator* self, cairo_t* ctx, GdkRectangle* area, gint position);
void rgb_histogram_manipulator_update_histogram (RGBHistogramManipulator* self, GdkPixbuf* source_pixbuf);
gint rgb_histogram_manipulator_get_left_nub_position (RGBHistogramManipulator* self);
gint rgb_histogram_manipulator_get_right_nub_position (RGBHistogramManipulator* self);
void rgb_histogram_manipulator_set_left_nub_position (RGBHistogramManipulator* self, gint user_nub_pos);
void rgb_histogram_manipulator_set_right_nub_position (RGBHistogramManipulator* self, gint user_nub_pos);
static void rgb_histogram_manipulator_finalize (GObject * obj);
static GType rgb_histogram_manipulator_location_code_get_type (void) {
static volatile gsize rgb_histogram_manipulator_location_code_type_id__volatile = 0;
if (g_once_init_enter (&rgb_histogram_manipulator_location_code_type_id__volatile)) {
static const GEnumValue values[] = {{RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_LEFT_NUB, "RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_LEFT_NUB", "left-nub"}, {RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_RIGHT_NUB, "RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_RIGHT_NUB", "right-nub"}, {RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_LEFT_TROUGH, "RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_LEFT_TROUGH", "left-trough"}, {RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_RIGHT_TROUGH, "RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_RIGHT_TROUGH", "right-trough"}, {RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_INSENSITIVE_AREA, "RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_INSENSITIVE_AREA", "insensitive-area"}, {0, NULL, NULL}};
GType rgb_histogram_manipulator_location_code_type_id;
rgb_histogram_manipulator_location_code_type_id = g_enum_register_static ("RGBHistogramManipulatorLocationCode", values);
g_once_init_leave (&rgb_histogram_manipulator_location_code_type_id__volatile, rgb_histogram_manipulator_location_code_type_id);
}
return rgb_histogram_manipulator_location_code_type_id__volatile;
}
static gboolean _rgb_histogram_manipulator_on_button_press_gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self) {
gboolean result;
result = rgb_histogram_manipulator_on_button_press ((RGBHistogramManipulator*) self, event);
#line 57 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return result;
#line 144 "RGBHistogramManipulator.c"
}
static gboolean _rgb_histogram_manipulator_on_button_release_gtk_widget_button_release_event (GtkWidget* _sender, GdkEventButton* event, gpointer self) {
gboolean result;
result = rgb_histogram_manipulator_on_button_release ((RGBHistogramManipulator*) self, event);
#line 58 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return result;
#line 153 "RGBHistogramManipulator.c"
}
static gboolean _rgb_histogram_manipulator_on_button_motion_gtk_widget_motion_notify_event (GtkWidget* _sender, GdkEventMotion* event, gpointer self) {
gboolean result;
result = rgb_histogram_manipulator_on_button_motion ((RGBHistogramManipulator*) self, event);
#line 59 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return result;
#line 162 "RGBHistogramManipulator.c"
}
static void _rgb_histogram_manipulator_on_size_allocate_gtk_widget_size_allocate (GtkWidget* _sender, GtkAllocation* allocation, gpointer self) {
#line 61 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
rgb_histogram_manipulator_on_size_allocate ((RGBHistogramManipulator*) self, allocation);
#line 169 "RGBHistogramManipulator.c"
}
RGBHistogramManipulator* rgb_histogram_manipulator_construct (GType object_type) {
RGBHistogramManipulator * self = NULL;
gboolean _tmp0_;
#line 36 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self = (RGBHistogramManipulator*) g_object_new (object_type, NULL);
#line 37 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
gtk_widget_set_size_request (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), RGB_HISTOGRAM_MANIPULATOR_CONTROL_WIDTH, RGB_HISTOGRAM_MANIPULATOR_CONTROL_HEIGHT);
#line 38 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_object_set (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), "can-focus", TRUE, NULL);
#line 40 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp0_ = rgb_histogram_manipulator_paths_setup;
#line 40 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (!_tmp0_) {
#line 186 "RGBHistogramManipulator.c"
GtkWidgetPath* _tmp1_;
GtkWidgetPath* _tmp2_;
GtkWidgetPath* _tmp3_;
GtkWidgetPath* _tmp4_;
GtkWidgetPath* _tmp5_;
#line 41 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp1_ = rgb_histogram_manipulator_slider_draw_path;
#line 41 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
gtk_widget_path_append_type (_tmp1_, gtk_scale_get_type ());
#line 42 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp2_ = rgb_histogram_manipulator_slider_draw_path;
#line 42 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
gtk_widget_path_iter_add_class (_tmp2_, 0, "scale");
#line 43 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp3_ = rgb_histogram_manipulator_slider_draw_path;
#line 43 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
gtk_widget_path_iter_add_class (_tmp3_, 0, "range");
#line 45 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp4_ = rgb_histogram_manipulator_frame_draw_path;
#line 45 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
gtk_widget_path_append_type (_tmp4_, gtk_frame_get_type ());
#line 46 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp5_ = rgb_histogram_manipulator_frame_draw_path;
#line 46 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
gtk_widget_path_iter_add_class (_tmp5_, 0, "default");
#line 48 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
rgb_histogram_manipulator_paths_setup = TRUE;
#line 214 "RGBHistogramManipulator.c"
}
#line 51 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
gtk_widget_add_events (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), (gint) GDK_BUTTON_PRESS_MASK);
#line 52 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
gtk_widget_add_events (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), (gint) GDK_BUTTON_RELEASE_MASK);
#line 53 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
gtk_widget_add_events (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), (gint) GDK_BUTTON_MOTION_MASK);
#line 54 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
gtk_widget_add_events (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), (gint) GDK_FOCUS_CHANGE_MASK);
#line 55 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
gtk_widget_add_events (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), (gint) GDK_KEY_PRESS_MASK);
#line 57 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), "button-press-event", (GCallback) _rgb_histogram_manipulator_on_button_press_gtk_widget_button_press_event, self, 0);
#line 58 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), "button-release-event", (GCallback) _rgb_histogram_manipulator_on_button_release_gtk_widget_button_release_event, self, 0);
#line 59 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), "motion-notify-event", (GCallback) _rgb_histogram_manipulator_on_button_motion_gtk_widget_motion_notify_event, self, 0);
#line 61 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), "size-allocate", (GCallback) _rgb_histogram_manipulator_on_size_allocate_gtk_widget_size_allocate, self, 0);
#line 36 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return self;
#line 236 "RGBHistogramManipulator.c"
}
RGBHistogramManipulator* rgb_histogram_manipulator_new (void) {
#line 36 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return rgb_histogram_manipulator_construct (TYPE_RGB_HISTOGRAM_MANIPULATOR);
#line 243 "RGBHistogramManipulator.c"
}
static void rgb_histogram_manipulator_on_size_allocate (RGBHistogramManipulator* self, GtkAllocation* region) {
GtkAllocation _tmp0_;
gint _tmp1_;
#line 64 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self));
#line 64 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_if_fail (region != NULL);
#line 65 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp0_ = *region;
#line 65 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp1_ = _tmp0_.width;
#line 65 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->offset = ((_tmp1_ - RGB_HISTOGRAM_GRAPHIC_WIDTH) - RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE) / 2;
#line 260 "RGBHistogramManipulator.c"
}
static RGBHistogramManipulatorLocationCode rgb_histogram_manipulator_hit_test_point (RGBHistogramManipulator* self, gint x, gint y) {
RGBHistogramManipulatorLocationCode result = 0;
gint _tmp0_;
gboolean _tmp1_ = FALSE;
gint _tmp2_;
gint _tmp3_;
gboolean _tmp6_ = FALSE;
gint _tmp7_;
gint _tmp8_;
gint _tmp11_;
gint _tmp12_;
gint _tmp13_;
gint _tmp14_;
gint _tmp15_;
gint _tmp16_;
gint _tmp17_;
gint _tmp18_;
gint _tmp19_;
#line 68 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_val_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self), 0);
#line 69 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp0_ = y;
#line 69 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (_tmp0_ < RGB_HISTOGRAM_MANIPULATOR_NUB_V_POSITION) {
#line 70 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
result = RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_INSENSITIVE_AREA;
#line 70 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return result;
#line 292 "RGBHistogramManipulator.c"
}
#line 72 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp2_ = x;
#line 72 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp3_ = self->priv->left_nub_position;
#line 72 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (_tmp2_ > _tmp3_) {
#line 300 "RGBHistogramManipulator.c"
gint _tmp4_;
gint _tmp5_;
#line 72 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp4_ = x;
#line 72 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp5_ = self->priv->left_nub_position;
#line 72 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp1_ = _tmp4_ < (_tmp5_ + RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE);
#line 309 "RGBHistogramManipulator.c"
} else {
#line 72 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp1_ = FALSE;
#line 313 "RGBHistogramManipulator.c"
}
#line 72 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (_tmp1_) {
#line 73 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
result = RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_LEFT_NUB;
#line 73 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return result;
#line 321 "RGBHistogramManipulator.c"
}
#line 75 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp7_ = x;
#line 75 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp8_ = self->priv->right_nub_position;
#line 75 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (_tmp7_ > _tmp8_) {
#line 329 "RGBHistogramManipulator.c"
gint _tmp9_;
gint _tmp10_;
#line 75 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp9_ = x;
#line 75 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp10_ = self->priv->right_nub_position;
#line 75 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp6_ = _tmp9_ < (_tmp10_ + RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE);
#line 338 "RGBHistogramManipulator.c"
} else {
#line 75 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp6_ = FALSE;
#line 342 "RGBHistogramManipulator.c"
}
#line 75 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (_tmp6_) {
#line 76 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
result = RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_RIGHT_NUB;
#line 76 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return result;
#line 350 "RGBHistogramManipulator.c"
}
#line 78 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp11_ = y;
#line 78 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (_tmp11_ < ((RGB_HISTOGRAM_MANIPULATOR_NUB_V_POSITION + RGB_HISTOGRAM_MANIPULATOR_NUB_V_NUDGE) + 1)) {
#line 79 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
result = RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_INSENSITIVE_AREA;
#line 79 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return result;
#line 360 "RGBHistogramManipulator.c"
}
#line 81 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp12_ = x;
#line 81 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp13_ = self->priv->left_nub_position;
#line 81 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp14_ = x;
#line 81 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp15_ = self->priv->left_nub_position;
#line 81 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp16_ = x;
#line 81 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp17_ = self->priv->right_nub_position;
#line 81 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp18_ = x;
#line 81 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp19_ = self->priv->right_nub_position;
#line 81 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (((_tmp12_ - _tmp13_) * (_tmp14_ - _tmp15_)) < ((_tmp16_ - _tmp17_) * (_tmp18_ - _tmp19_))) {
#line 83 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
result = RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_LEFT_TROUGH;
#line 83 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return result;
#line 384 "RGBHistogramManipulator.c"
} else {
#line 85 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
result = RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_RIGHT_TROUGH;
#line 85 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return result;
#line 390 "RGBHistogramManipulator.c"
}
}
static gboolean rgb_histogram_manipulator_on_button_press (RGBHistogramManipulator* self, GdkEventButton* event_record) {
gboolean result = FALSE;
GdkEventButton* _tmp0_;
GdkEventButton* _tmp1_;
gdouble _tmp2_;
gint _tmp3_;
RGBHistogramManipulatorLocationCode loc = 0;
GdkEventButton* _tmp4_;
gdouble _tmp5_;
GdkEventButton* _tmp6_;
gdouble _tmp7_;
RGBHistogramManipulatorLocationCode _tmp8_;
gboolean retval = FALSE;
RGBHistogramManipulatorLocationCode _tmp9_;
GdkEventButton* _tmp26_;
GdkEventButton* _tmp27_;
gdouble _tmp28_;
gint _tmp29_;
#line 88 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_val_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self), FALSE);
#line 88 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_val_if_fail (event_record != NULL, FALSE);
#line 91 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp0_ = event_record;
#line 91 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp1_ = event_record;
#line 91 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp2_ = _tmp1_->x;
#line 91 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp3_ = self->priv->offset;
#line 91 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp1_->x = _tmp2_ - _tmp3_;
#line 92 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp4_ = event_record;
#line 92 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp5_ = _tmp4_->x;
#line 92 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp6_ = event_record;
#line 92 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp7_ = _tmp6_->y;
#line 92 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp8_ = rgb_histogram_manipulator_hit_test_point (self, (gint) _tmp5_, (gint) _tmp7_);
#line 92 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
loc = _tmp8_;
#line 93 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
retval = TRUE;
#line 95 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp9_ = loc;
#line 95 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
switch (_tmp9_) {
#line 95 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
case RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_LEFT_NUB:
#line 447 "RGBHistogramManipulator.c"
{
GdkEventButton* _tmp10_;
gdouble _tmp11_;
gint _tmp12_;
#line 97 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp10_ = event_record;
#line 97 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp11_ = _tmp10_->x;
#line 97 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->track_start_x = (gint) _tmp11_;
#line 98 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp12_ = self->priv->left_nub_position;
#line 98 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->track_nub_start_position = _tmp12_;
#line 99 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->is_left_nub_tracking = TRUE;
#line 100 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
break;
#line 466 "RGBHistogramManipulator.c"
}
#line 95 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
case RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_RIGHT_NUB:
#line 470 "RGBHistogramManipulator.c"
{
GdkEventButton* _tmp13_;
gdouble _tmp14_;
gint _tmp15_;
#line 103 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp13_ = event_record;
#line 103 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp14_ = _tmp13_->x;
#line 103 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->track_start_x = (gint) _tmp14_;
#line 104 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp15_ = self->priv->right_nub_position;
#line 104 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->track_nub_start_position = _tmp15_;
#line 105 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->is_right_nub_tracking = TRUE;
#line 106 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
break;
#line 489 "RGBHistogramManipulator.c"
}
#line 95 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
case RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_LEFT_TROUGH:
#line 493 "RGBHistogramManipulator.c"
{
GdkEventButton* _tmp16_;
gdouble _tmp17_;
gint _tmp18_;
gint _tmp19_;
gint _tmp20_;
#line 109 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp16_ = event_record;
#line 109 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp17_ = _tmp16_->x;
#line 109 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->left_nub_position = ((gint) _tmp17_) - RGB_HISTOGRAM_MANIPULATOR_NUB_HALF_WIDTH;
#line 110 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp18_ = self->priv->left_nub_position;
#line 110 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp19_ = self->priv->left_nub_max;
#line 110 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp20_ = CLAMP (_tmp18_, 0, _tmp19_);
#line 110 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->left_nub_position = _tmp20_;
#line 111 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
rgb_histogram_manipulator_force_update (self);
#line 112 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_signal_emit (self, rgb_histogram_manipulator_signals[RGB_HISTOGRAM_MANIPULATOR_NUB_POSITION_CHANGED_SIGNAL], 0);
#line 113 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
rgb_histogram_manipulator_update_nub_extrema (self);
#line 114 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
break;
#line 522 "RGBHistogramManipulator.c"
}
#line 95 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
case RGB_HISTOGRAM_MANIPULATOR_LOCATION_CODE_RIGHT_TROUGH:
#line 526 "RGBHistogramManipulator.c"
{
GdkEventButton* _tmp21_;
gdouble _tmp22_;
gint _tmp23_;
gint _tmp24_;
gint _tmp25_;
#line 117 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp21_ = event_record;
#line 117 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp22_ = _tmp21_->x;
#line 117 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->right_nub_position = ((gint) _tmp22_) - RGB_HISTOGRAM_MANIPULATOR_NUB_HALF_WIDTH;
#line 118 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp23_ = self->priv->right_nub_position;
#line 118 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp24_ = self->priv->right_nub_min;
#line 118 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp25_ = CLAMP (_tmp23_, _tmp24_, 255);
#line 118 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->right_nub_position = _tmp25_;
#line 119 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
rgb_histogram_manipulator_force_update (self);
#line 120 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_signal_emit (self, rgb_histogram_manipulator_signals[RGB_HISTOGRAM_MANIPULATOR_NUB_POSITION_CHANGED_SIGNAL], 0);
#line 121 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
rgb_histogram_manipulator_update_nub_extrema (self);
#line 122 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
break;
#line 555 "RGBHistogramManipulator.c"
}
default:
{
#line 125 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
retval = FALSE;
#line 126 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
break;
#line 563 "RGBHistogramManipulator.c"
}
}
#line 130 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp26_ = event_record;
#line 130 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp27_ = event_record;
#line 130 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp28_ = _tmp27_->x;
#line 130 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp29_ = self->priv->offset;
#line 130 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp27_->x = _tmp28_ + _tmp29_;
#line 132 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
result = retval;
#line 132 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return result;
#line 580 "RGBHistogramManipulator.c"
}
static gboolean rgb_histogram_manipulator_on_button_release (RGBHistogramManipulator* self, GdkEventButton* event_record) {
gboolean result = FALSE;
gboolean _tmp0_ = FALSE;
gboolean _tmp1_;
#line 135 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_val_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self), FALSE);
#line 135 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_val_if_fail (event_record != NULL, FALSE);
#line 136 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp1_ = self->priv->is_left_nub_tracking;
#line 136 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (_tmp1_) {
#line 136 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp0_ = TRUE;
#line 598 "RGBHistogramManipulator.c"
} else {
gboolean _tmp2_;
#line 136 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp2_ = self->priv->is_right_nub_tracking;
#line 136 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp0_ = _tmp2_;
#line 605 "RGBHistogramManipulator.c"
}
#line 136 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (_tmp0_) {
#line 137 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_signal_emit (self, rgb_histogram_manipulator_signals[RGB_HISTOGRAM_MANIPULATOR_NUB_POSITION_CHANGED_SIGNAL], 0);
#line 138 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
rgb_histogram_manipulator_update_nub_extrema (self);
#line 613 "RGBHistogramManipulator.c"
}
#line 141 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->is_left_nub_tracking = FALSE;
#line 142 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->is_right_nub_tracking = FALSE;
#line 144 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
result = FALSE;
#line 144 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return result;
#line 623 "RGBHistogramManipulator.c"
}
static gboolean rgb_histogram_manipulator_on_button_motion (RGBHistogramManipulator* self, GdkEventMotion* event_record) {
gboolean result = FALSE;
gboolean _tmp0_ = FALSE;
gboolean _tmp1_;
GdkEventMotion* _tmp3_;
GdkEventMotion* _tmp4_;
gdouble _tmp5_;
gint _tmp6_;
gboolean _tmp7_;
GdkEventMotion* _tmp24_;
GdkEventMotion* _tmp25_;
gdouble _tmp26_;
gint _tmp27_;
#line 147 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_val_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self), FALSE);
#line 147 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_val_if_fail (event_record != NULL, FALSE);
#line 148 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp1_ = self->priv->is_left_nub_tracking;
#line 148 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (!_tmp1_) {
#line 648 "RGBHistogramManipulator.c"
gboolean _tmp2_;
#line 148 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp2_ = self->priv->is_right_nub_tracking;
#line 148 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp0_ = !_tmp2_;
#line 654 "RGBHistogramManipulator.c"
} else {
#line 148 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp0_ = FALSE;
#line 658 "RGBHistogramManipulator.c"
}
#line 148 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (_tmp0_) {
#line 149 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
result = FALSE;
#line 149 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return result;
#line 666 "RGBHistogramManipulator.c"
}
#line 151 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp3_ = event_record;
#line 151 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp4_ = event_record;
#line 151 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp5_ = _tmp4_->x;
#line 151 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp6_ = self->priv->offset;
#line 151 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp4_->x = _tmp5_ - _tmp6_;
#line 152 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp7_ = self->priv->is_left_nub_tracking;
#line 152 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (_tmp7_) {
#line 682 "RGBHistogramManipulator.c"
gint track_x_delta = 0;
GdkEventMotion* _tmp8_;
gdouble _tmp9_;
gint _tmp10_;
gint _tmp11_;
gint _tmp12_;
gint _tmp13_;
gint _tmp14_;
gint _tmp15_;
#line 153 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp8_ = event_record;
#line 153 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp9_ = _tmp8_->x;
#line 153 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp10_ = self->priv->track_start_x;
#line 153 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
track_x_delta = ((gint) _tmp9_) - _tmp10_;
#line 154 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp11_ = self->priv->track_nub_start_position;
#line 154 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp12_ = track_x_delta;
#line 154 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->left_nub_position = _tmp11_ + _tmp12_;
#line 155 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp13_ = self->priv->left_nub_position;
#line 155 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp14_ = self->priv->left_nub_max;
#line 155 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp15_ = CLAMP (_tmp13_, 0, _tmp14_);
#line 155 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->left_nub_position = _tmp15_;
#line 714 "RGBHistogramManipulator.c"
} else {
gint track_x_delta = 0;
GdkEventMotion* _tmp16_;
gdouble _tmp17_;
gint _tmp18_;
gint _tmp19_;
gint _tmp20_;
gint _tmp21_;
gint _tmp22_;
gint _tmp23_;
#line 157 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp16_ = event_record;
#line 157 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp17_ = _tmp16_->x;
#line 157 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp18_ = self->priv->track_start_x;
#line 157 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
track_x_delta = ((gint) _tmp17_) - _tmp18_;
#line 158 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp19_ = self->priv->track_nub_start_position;
#line 158 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp20_ = track_x_delta;
#line 158 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->right_nub_position = _tmp19_ + _tmp20_;
#line 159 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp21_ = self->priv->right_nub_position;
#line 159 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp22_ = self->priv->right_nub_min;
#line 159 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp23_ = CLAMP (_tmp21_, _tmp22_, 255);
#line 159 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->right_nub_position = _tmp23_;
#line 747 "RGBHistogramManipulator.c"
}
#line 162 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
rgb_histogram_manipulator_force_update (self);
#line 163 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp24_ = event_record;
#line 163 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp25_ = event_record;
#line 163 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp26_ = _tmp25_->x;
#line 163 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp27_ = self->priv->offset;
#line 163 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp25_->x = _tmp26_ + _tmp27_;
#line 165 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
result = TRUE;
#line 165 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return result;
#line 765 "RGBHistogramManipulator.c"
}
static gboolean rgb_histogram_manipulator_real_focus_out_event (GtkWidget* base, GdkEventFocus* event) {
RGBHistogramManipulator * self;
gboolean result = FALSE;
GdkEventFocus* _tmp0_;
gboolean _tmp1_;
#line 168 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_RGB_HISTOGRAM_MANIPULATOR, RGBHistogramManipulator);
#line 168 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_val_if_fail (event != NULL, FALSE);
#line 169 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp0_ = event;
#line 169 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp1_ = GTK_WIDGET_CLASS (rgb_histogram_manipulator_parent_class)->focus_out_event (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_drawing_area_get_type (), GtkDrawingArea), gtk_widget_get_type (), GtkWidget), _tmp0_);
#line 169 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (_tmp1_) {
#line 170 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
result = TRUE;
#line 170 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return result;
#line 788 "RGBHistogramManipulator.c"
}
#line 173 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
gtk_widget_queue_draw (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
#line 175 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
result = FALSE;
#line 175 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return result;
#line 796 "RGBHistogramManipulator.c"
}
static gboolean rgb_histogram_manipulator_real_key_press_event (GtkWidget* base, GdkEventKey* event) {
RGBHistogramManipulator * self;
gboolean result = FALSE;
GdkEventKey* _tmp0_;
gboolean _tmp1_;
gint delta = 0;
gboolean _tmp2_ = FALSE;
GdkEventKey* _tmp3_;
guint _tmp4_;
gboolean _tmp7_ = FALSE;
GdkEventKey* _tmp8_;
guint _tmp9_;
GdkEventKey* _tmp12_;
GdkModifierType _tmp13_;
gint _tmp15_;
GdkEventKey* _tmp16_;
GdkModifierType _tmp17_;
#line 178 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_RGB_HISTOGRAM_MANIPULATOR, RGBHistogramManipulator);
#line 178 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_val_if_fail (event != NULL, FALSE);
#line 179 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp0_ = event;
#line 179 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp1_ = GTK_WIDGET_CLASS (rgb_histogram_manipulator_parent_class)->key_press_event (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_drawing_area_get_type (), GtkDrawingArea), gtk_widget_get_type (), GtkWidget), _tmp0_);
#line 179 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (_tmp1_) {
#line 180 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
result = TRUE;
#line 180 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return result;
#line 831 "RGBHistogramManipulator.c"
}
#line 183 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
delta = 0;
#line 185 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp3_ = event;
#line 185 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp4_ = _tmp3_->keyval;
#line 185 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (_tmp4_ == ((guint) GDK_KEY_Left)) {
#line 185 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp2_ = TRUE;
#line 843 "RGBHistogramManipulator.c"
} else {
GdkEventKey* _tmp5_;
guint _tmp6_;
#line 185 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp5_ = event;
#line 185 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp6_ = _tmp5_->keyval;
#line 185 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp2_ = _tmp6_ == ((guint) GDK_KEY_Up);
#line 853 "RGBHistogramManipulator.c"
}
#line 185 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (_tmp2_) {
#line 186 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
delta = -1;
#line 859 "RGBHistogramManipulator.c"
}
#line 189 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp8_ = event;
#line 189 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp9_ = _tmp8_->keyval;
#line 189 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (_tmp9_ == ((guint) GDK_KEY_Right)) {
#line 189 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp7_ = TRUE;
#line 869 "RGBHistogramManipulator.c"
} else {
GdkEventKey* _tmp10_;
guint _tmp11_;
#line 189 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp10_ = event;
#line 189 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp11_ = _tmp10_->keyval;
#line 189 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp7_ = _tmp11_ == ((guint) GDK_KEY_Down);
#line 879 "RGBHistogramManipulator.c"
}
#line 189 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (_tmp7_) {
#line 190 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
delta = 1;
#line 885 "RGBHistogramManipulator.c"
}
#line 193 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp12_ = event;
#line 193 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp13_ = _tmp12_->state;
#line 193 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (!((_tmp13_ & GDK_CONTROL_MASK) == GDK_CONTROL_MASK)) {
#line 893 "RGBHistogramManipulator.c"
gint _tmp14_;
#line 194 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp14_ = delta;
#line 194 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
delta = _tmp14_ * 5;
#line 899 "RGBHistogramManipulator.c"
}
#line 197 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp15_ = delta;
#line 197 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (_tmp15_ == 0) {
#line 198 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
result = FALSE;
#line 198 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return result;
#line 909 "RGBHistogramManipulator.c"
}
#line 201 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp16_ = event;
#line 201 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp17_ = _tmp16_->state;
#line 201 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if ((_tmp17_ & GDK_SHIFT_MASK) == GDK_SHIFT_MASK) {
#line 917 "RGBHistogramManipulator.c"
gint _tmp18_;
gint _tmp19_;
gint _tmp20_;
gint _tmp21_;
gint _tmp22_;
#line 202 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp18_ = self->priv->right_nub_position;
#line 202 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp19_ = delta;
#line 202 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->right_nub_position = _tmp18_ + _tmp19_;
#line 203 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp20_ = self->priv->right_nub_position;
#line 203 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp21_ = self->priv->right_nub_min;
#line 203 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp22_ = CLAMP (_tmp20_, _tmp21_, 255);
#line 203 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->right_nub_position = _tmp22_;
#line 937 "RGBHistogramManipulator.c"
} else {
gint _tmp23_;
gint _tmp24_;
gint _tmp25_;
gint _tmp26_;
gint _tmp27_;
#line 205 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp23_ = self->priv->left_nub_position;
#line 205 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp24_ = delta;
#line 205 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->left_nub_position = _tmp23_ + _tmp24_;
#line 206 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp25_ = self->priv->left_nub_position;
#line 206 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp26_ = self->priv->left_nub_max;
#line 206 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp27_ = CLAMP (_tmp25_, 0, _tmp26_);
#line 206 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->left_nub_position = _tmp27_;
#line 958 "RGBHistogramManipulator.c"
}
#line 210 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_signal_emit (self, rgb_histogram_manipulator_signals[RGB_HISTOGRAM_MANIPULATOR_NUB_POSITION_CHANGED_SIGNAL], 0);
#line 211 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
rgb_histogram_manipulator_update_nub_extrema (self);
#line 212 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
rgb_histogram_manipulator_force_update (self);
#line 214 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
result = TRUE;
#line 214 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return result;
#line 970 "RGBHistogramManipulator.c"
}
static gboolean rgb_histogram_manipulator_real_draw (GtkWidget* base, cairo_t* ctx) {
RGBHistogramManipulator * self;
gboolean result = FALSE;
GtkBorder padding = {0};
GtkStyleContext* _tmp0_;
GtkBorder _tmp1_ = {0};
GdkRectangle area = {0};
GtkBorder _tmp2_;
gint16 _tmp3_;
gint _tmp4_;
GtkBorder _tmp5_;
gint16 _tmp6_;
GtkBorder _tmp7_;
gint16 _tmp8_;
GtkBorder _tmp9_;
gint16 _tmp10_;
gboolean _tmp11_;
gboolean _tmp12_;
cairo_t* _tmp23_;
GdkRectangle _tmp24_;
cairo_t* _tmp25_;
GdkRectangle _tmp26_;
gint _tmp27_;
cairo_t* _tmp28_;
GdkRectangle _tmp29_;
gint _tmp30_;
#line 217 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_RGB_HISTOGRAM_MANIPULATOR, RGBHistogramManipulator);
#line 217 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_val_if_fail (ctx != NULL, FALSE);
#line 218 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp0_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
#line 218 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
gtk_style_context_get_padding (_tmp0_, GTK_STATE_FLAG_NORMAL, &_tmp1_);
#line 218 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
padding = _tmp1_;
#line 220 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
memset (&area, 0, sizeof (GdkRectangle));
#line 221 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp2_ = padding;
#line 221 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp3_ = _tmp2_.left;
#line 221 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp4_ = self->priv->offset;
#line 221 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
area.x = _tmp3_ + _tmp4_;
#line 222 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp5_ = padding;
#line 222 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp6_ = _tmp5_.top;
#line 222 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
area.y = (gint) _tmp6_;
#line 223 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp7_ = padding;
#line 223 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp8_ = _tmp7_.right;
#line 223 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
area.width = RGB_HISTOGRAM_GRAPHIC_WIDTH + _tmp8_;
#line 224 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp9_ = padding;
#line 224 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp10_ = _tmp9_.bottom;
#line 224 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
area.height = RGB_HISTOGRAM_GRAPHIC_HEIGHT + _tmp10_;
#line 226 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_object_get (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), "has-focus", &_tmp11_, NULL);
#line 226 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp12_ = _tmp11_;
#line 226 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (_tmp12_) {
#line 1044 "RGBHistogramManipulator.c"
GtkStyleContext* _tmp13_;
cairo_t* _tmp14_;
GdkRectangle _tmp15_;
gint _tmp16_;
GdkRectangle _tmp17_;
gint _tmp18_;
GdkRectangle _tmp19_;
gint _tmp20_;
GdkRectangle _tmp21_;
gint _tmp22_;
#line 227 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp13_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
#line 227 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp14_ = ctx;
#line 227 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp15_ = area;
#line 227 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp16_ = _tmp15_.x;
#line 227 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp17_ = area;
#line 227 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp18_ = _tmp17_.y;
#line 227 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp19_ = area;
#line 227 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp20_ = _tmp19_.width;
#line 227 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp21_ = area;
#line 227 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp22_ = _tmp21_.height;
#line 227 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
gtk_render_focus (_tmp13_, _tmp14_, (gdouble) _tmp16_, (gdouble) _tmp18_, (gdouble) (_tmp20_ + RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE), (gdouble) ((_tmp22_ + RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE) + RGB_HISTOGRAM_MANIPULATOR_NUB_HALF_WIDTH));
#line 1077 "RGBHistogramManipulator.c"
}
#line 232 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp23_ = ctx;
#line 232 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp24_ = area;
#line 232 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
rgb_histogram_manipulator_draw_histogram (self, _tmp23_, &_tmp24_);
#line 233 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp25_ = ctx;
#line 233 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp26_ = area;
#line 233 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp27_ = self->priv->left_nub_position;
#line 233 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
rgb_histogram_manipulator_draw_nub (self, _tmp25_, &_tmp26_, _tmp27_);
#line 234 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp28_ = ctx;
#line 234 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp29_ = area;
#line 234 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp30_ = self->priv->right_nub_position;
#line 234 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
rgb_histogram_manipulator_draw_nub (self, _tmp28_, &_tmp29_, _tmp30_);
#line 236 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
result = TRUE;
#line 236 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return result;
#line 1105 "RGBHistogramManipulator.c"
}
static void rgb_histogram_manipulator_draw_histogram (RGBHistogramManipulator* self, cairo_t* ctx, GdkRectangle* area) {
RGBHistogram* _tmp0_;
GdkPixbuf* histogram_graphic = NULL;
RGBHistogram* _tmp1_;
GdkPixbuf* _tmp2_;
cairo_t* _tmp3_;
GdkPixbuf* _tmp4_;
GdkRectangle _tmp5_;
gint _tmp6_;
GdkRectangle _tmp7_;
gint _tmp8_;
cairo_t* _tmp9_;
gint _tmp10_;
gint _tmp22_;
#line 239 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self));
#line 239 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_if_fail (ctx != NULL);
#line 239 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_if_fail (area != NULL);
#line 240 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp0_ = self->priv->histogram;
#line 240 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (_tmp0_ == NULL) {
#line 241 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return;
#line 1135 "RGBHistogramManipulator.c"
}
#line 243 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp1_ = self->priv->histogram;
#line 243 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp2_ = rgb_histogram_get_graphic (_tmp1_);
#line 243 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
histogram_graphic = _tmp2_;
#line 245 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp3_ = ctx;
#line 245 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp4_ = histogram_graphic;
#line 245 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp5_ = *area;
#line 245 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp6_ = _tmp5_.x;
#line 245 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp7_ = *area;
#line 245 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp8_ = _tmp7_.y;
#line 245 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
gdk_cairo_set_source_pixbuf (_tmp3_, _tmp4_, (gdouble) (_tmp6_ + RGB_HISTOGRAM_MANIPULATOR_NUB_HALF_WIDTH), (gdouble) (_tmp8_ + 2));
#line 246 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp9_ = ctx;
#line 246 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
cairo_paint (_tmp9_);
#line 248 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp10_ = self->priv->left_nub_position;
#line 248 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (_tmp10_ > 0) {
#line 1165 "RGBHistogramManipulator.c"
cairo_t* _tmp11_;
GdkRectangle _tmp12_;
gint _tmp13_;
GdkRectangle _tmp14_;
gint _tmp15_;
gint _tmp16_;
GdkPixbuf* _tmp17_;
gint _tmp18_;
gint _tmp19_;
cairo_t* _tmp20_;
cairo_t* _tmp21_;
#line 249 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp11_ = ctx;
#line 249 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp12_ = *area;
#line 249 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp13_ = _tmp12_.x;
#line 249 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp14_ = *area;
#line 249 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp15_ = _tmp14_.y;
#line 249 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp16_ = self->priv->left_nub_position;
#line 249 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp17_ = histogram_graphic;
#line 249 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp18_ = gdk_pixbuf_get_height (_tmp17_);
#line 249 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp19_ = _tmp18_;
#line 249 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
cairo_rectangle (_tmp11_, (gdouble) (_tmp13_ + RGB_HISTOGRAM_MANIPULATOR_NUB_HALF_WIDTH), (gdouble) (_tmp15_ + 2), (gdouble) _tmp16_, (gdouble) _tmp19_);
#line 252 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp20_ = ctx;
#line 252 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
cairo_set_source_rgba (_tmp20_, 0.0, 0.0, 0.0, 0.45);
#line 253 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp21_ = ctx;
#line 253 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
cairo_fill (_tmp21_);
#line 1205 "RGBHistogramManipulator.c"
}
#line 256 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp22_ = self->priv->right_nub_position;
#line 256 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (_tmp22_ < 255) {
#line 1211 "RGBHistogramManipulator.c"
cairo_t* _tmp23_;
GdkRectangle _tmp24_;
gint _tmp25_;
gint _tmp26_;
GdkRectangle _tmp27_;
gint _tmp28_;
GdkPixbuf* _tmp29_;
gint _tmp30_;
gint _tmp31_;
gint _tmp32_;
GdkPixbuf* _tmp33_;
gint _tmp34_;
gint _tmp35_;
cairo_t* _tmp36_;
cairo_t* _tmp37_;
#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp23_ = ctx;
#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp24_ = *area;
#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp25_ = _tmp24_.x;
#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp26_ = self->priv->right_nub_position;
#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp27_ = *area;
#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp28_ = _tmp27_.y;
#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp29_ = histogram_graphic;
#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp30_ = gdk_pixbuf_get_width (_tmp29_);
#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp31_ = _tmp30_;
#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp32_ = self->priv->right_nub_position;
#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp33_ = histogram_graphic;
#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp34_ = gdk_pixbuf_get_height (_tmp33_);
#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp35_ = _tmp34_;
#line 257 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
cairo_rectangle (_tmp23_, (gdouble) ((_tmp25_ + _tmp26_) + RGB_HISTOGRAM_MANIPULATOR_NUB_HALF_WIDTH), (gdouble) (_tmp28_ + 2), (gdouble) (_tmp31_ - _tmp32_), (gdouble) _tmp35_);
#line 261 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp36_ = ctx;
#line 261 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
cairo_set_source_rgba (_tmp36_, 1.0, 1.0, 1.0, 0.45);
#line 262 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp37_ = ctx;
#line 262 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
cairo_fill (_tmp37_);
#line 1263 "RGBHistogramManipulator.c"
}
#line 239 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_g_object_unref0 (histogram_graphic);
#line 1267 "RGBHistogramManipulator.c"
}
static void rgb_histogram_manipulator_draw_nub (RGBHistogramManipulator* self, cairo_t* ctx, GdkRectangle* area, gint position) {
cairo_t* _tmp0_;
GdkRectangle _tmp1_;
gint _tmp2_;
gint _tmp3_;
GdkRectangle _tmp4_;
gint _tmp5_;
cairo_t* _tmp6_;
GdkRectangle _tmp7_;
gint _tmp8_;
gint _tmp9_;
GdkRectangle _tmp10_;
gint _tmp11_;
cairo_t* _tmp12_;
GdkRectangle _tmp13_;
gint _tmp14_;
gint _tmp15_;
GdkRectangle _tmp16_;
gint _tmp17_;
cairo_t* _tmp18_;
cairo_t* _tmp19_;
cairo_t* _tmp20_;
#line 266 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self));
#line 266 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_if_fail (ctx != NULL);
#line 266 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_if_fail (area != NULL);
#line 267 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp0_ = ctx;
#line 267 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp1_ = *area;
#line 267 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp2_ = _tmp1_.x;
#line 267 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp3_ = position;
#line 267 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp4_ = *area;
#line 267 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp5_ = _tmp4_.y;
#line 267 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
cairo_move_to (_tmp0_, (gdouble) (_tmp2_ + _tmp3_), (gdouble) ((_tmp5_ + RGB_HISTOGRAM_MANIPULATOR_NUB_V_POSITION) + RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE));
#line 268 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp6_ = ctx;
#line 268 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp7_ = *area;
#line 268 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp8_ = _tmp7_.x;
#line 268 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp9_ = position;
#line 268 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp10_ = *area;
#line 268 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp11_ = _tmp10_.y;
#line 268 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
cairo_line_to (_tmp6_, (gdouble) ((_tmp8_ + _tmp9_) + RGB_HISTOGRAM_MANIPULATOR_NUB_HALF_WIDTH), (gdouble) (_tmp11_ + RGB_HISTOGRAM_MANIPULATOR_NUB_V_POSITION));
#line 269 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp12_ = ctx;
#line 269 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp13_ = *area;
#line 269 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp14_ = _tmp13_.x;
#line 269 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp15_ = position;
#line 269 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp16_ = *area;
#line 269 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp17_ = _tmp16_.y;
#line 269 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
cairo_line_to (_tmp12_, (gdouble) ((_tmp14_ + _tmp15_) + RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE), (gdouble) ((_tmp17_ + RGB_HISTOGRAM_MANIPULATOR_NUB_V_POSITION) + RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE));
#line 270 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp18_ = ctx;
#line 270 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
cairo_close_path (_tmp18_);
#line 271 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp19_ = ctx;
#line 271 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
cairo_set_source_rgb (_tmp19_, 0.333, 0.333, 0.333);
#line 272 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp20_ = ctx;
#line 272 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
cairo_fill (_tmp20_);
#line 1353 "RGBHistogramManipulator.c"
}
static void rgb_histogram_manipulator_force_update (RGBHistogramManipulator* self) {
GdkWindow* _tmp0_;
#line 275 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self));
#line 276 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp0_ = gtk_widget_get_window (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
#line 276 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
gdk_window_invalidate_rect (_tmp0_, NULL, TRUE);
#line 1365 "RGBHistogramManipulator.c"
}
static void rgb_histogram_manipulator_update_nub_extrema (RGBHistogramManipulator* self) {
gint _tmp0_;
gint _tmp1_;
#line 279 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self));
#line 280 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp0_ = self->priv->left_nub_position;
#line 280 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->right_nub_min = (_tmp0_ + RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE) + 1;
#line 281 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp1_ = self->priv->right_nub_position;
#line 281 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->left_nub_max = (_tmp1_ - RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE) - 1;
#line 1382 "RGBHistogramManipulator.c"
}
void rgb_histogram_manipulator_update_histogram (RGBHistogramManipulator* self, GdkPixbuf* source_pixbuf) {
GdkPixbuf* _tmp0_;
RGBHistogram* _tmp1_;
#line 286 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self));
#line 286 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_if_fail (GDK_IS_PIXBUF (source_pixbuf));
#line 287 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp0_ = source_pixbuf;
#line 287 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp1_ = rgb_histogram_new (_tmp0_);
#line 287 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_rgb_histogram_unref0 (self->priv->histogram);
#line 287 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->histogram = _tmp1_;
#line 288 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
rgb_histogram_manipulator_force_update (self);
#line 1403 "RGBHistogramManipulator.c"
}
gint rgb_histogram_manipulator_get_left_nub_position (RGBHistogramManipulator* self) {
gint result = 0;
gint _tmp0_;
#line 291 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_val_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self), 0);
#line 292 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp0_ = self->priv->left_nub_position;
#line 292 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
result = _tmp0_;
#line 292 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return result;
#line 1418 "RGBHistogramManipulator.c"
}
gint rgb_histogram_manipulator_get_right_nub_position (RGBHistogramManipulator* self) {
gint result = 0;
gint _tmp0_;
#line 295 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_val_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self), 0);
#line 296 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp0_ = self->priv->right_nub_position;
#line 296 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
result = _tmp0_;
#line 296 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
return result;
#line 1433 "RGBHistogramManipulator.c"
}
void rgb_histogram_manipulator_set_left_nub_position (RGBHistogramManipulator* self, gint user_nub_pos) {
gboolean _tmp0_ = FALSE;
gint _tmp1_;
gint _tmp3_;
gint _tmp4_;
gint _tmp5_;
#line 299 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self));
#line 300 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp1_ = user_nub_pos;
#line 300 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (_tmp1_ >= 0) {
#line 1449 "RGBHistogramManipulator.c"
gint _tmp2_;
#line 300 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp2_ = user_nub_pos;
#line 300 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp0_ = _tmp2_ <= 255;
#line 1455 "RGBHistogramManipulator.c"
} else {
#line 300 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp0_ = FALSE;
#line 1459 "RGBHistogramManipulator.c"
}
#line 300 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_vala_assert (_tmp0_, "(user_nub_pos >= 0) && (user_nub_pos <= 255)");
#line 301 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp3_ = user_nub_pos;
#line 301 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp4_ = self->priv->left_nub_max;
#line 301 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp5_ = CLAMP (_tmp3_, 0, _tmp4_);
#line 301 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->left_nub_position = _tmp5_;
#line 302 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
rgb_histogram_manipulator_update_nub_extrema (self);
#line 1473 "RGBHistogramManipulator.c"
}
void rgb_histogram_manipulator_set_right_nub_position (RGBHistogramManipulator* self, gint user_nub_pos) {
gboolean _tmp0_ = FALSE;
gint _tmp1_;
gint _tmp3_;
gint _tmp4_;
gint _tmp5_;
#line 305 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_return_if_fail (IS_RGB_HISTOGRAM_MANIPULATOR (self));
#line 306 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp1_ = user_nub_pos;
#line 306 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
if (_tmp1_ >= 0) {
#line 1489 "RGBHistogramManipulator.c"
gint _tmp2_;
#line 306 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp2_ = user_nub_pos;
#line 306 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp0_ = _tmp2_ <= 255;
#line 1495 "RGBHistogramManipulator.c"
} else {
#line 306 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp0_ = FALSE;
#line 1499 "RGBHistogramManipulator.c"
}
#line 306 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_vala_assert (_tmp0_, "(user_nub_pos >= 0) && (user_nub_pos <= 255)");
#line 307 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp3_ = user_nub_pos;
#line 307 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp4_ = self->priv->right_nub_min;
#line 307 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp5_ = CLAMP (_tmp3_, _tmp4_, 255);
#line 307 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->right_nub_position = _tmp5_;
#line 308 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
rgb_histogram_manipulator_update_nub_extrema (self);
#line 1513 "RGBHistogramManipulator.c"
}
static void rgb_histogram_manipulator_class_init (RGBHistogramManipulatorClass * klass) {
GtkWidgetPath* _tmp0_;
GtkWidgetPath* _tmp1_;
#line 7 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
rgb_histogram_manipulator_parent_class = g_type_class_peek_parent (klass);
#line 7 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
g_type_class_add_private (klass, sizeof (RGBHistogramManipulatorPrivate));
#line 7 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
((GtkWidgetClass *) klass)->focus_out_event = (gboolean (*) (GtkWidget *, GdkEventFocus*)) rgb_histogram_manipulator_real_focus_out_event;
#line 7 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
((GtkWidgetClass *) klass)->key_press_event = (gboolean (*) (GtkWidget *, GdkEventKey*)) rgb_histogram_manipulator_real_key_press_event;
#line 7 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
((GtkWidgetClass *) klass)->draw = (gboolean (*) (GtkWidget *, cairo_t*)) rgb_histogram_manipulator_real_draw;
#line 7 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
G_OBJECT_CLASS (klass)->finalize = rgb_histogram_manipulator_finalize;
#line 7 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
rgb_histogram_manipulator_signals[RGB_HISTOGRAM_MANIPULATOR_NUB_POSITION_CHANGED_SIGNAL] = g_signal_new ("nub-position-changed", TYPE_RGB_HISTOGRAM_MANIPULATOR, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
#line 23 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp0_ = gtk_widget_path_new ();
#line 23 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
rgb_histogram_manipulator_slider_draw_path = _tmp0_;
#line 24 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_tmp1_ = gtk_widget_path_new ();
#line 24 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
rgb_histogram_manipulator_frame_draw_path = _tmp1_;
#line 1542 "RGBHistogramManipulator.c"
}
static void rgb_histogram_manipulator_instance_init (RGBHistogramManipulator * self) {
#line 7 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv = RGB_HISTOGRAM_MANIPULATOR_GET_PRIVATE (self);
#line 20 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->left_nub_max = (255 - RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE) - 1;
#line 21 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->right_nub_min = RGB_HISTOGRAM_MANIPULATOR_NUB_SIZE + 1;
#line 27 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->histogram = NULL;
#line 28 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->left_nub_position = 0;
#line 29 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->right_nub_position = 255;
#line 30 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->is_left_nub_tracking = FALSE;
#line 31 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->is_right_nub_tracking = FALSE;
#line 32 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->track_start_x = 0;
#line 33 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->track_nub_start_position = 0;
#line 34 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self->priv->offset = 0;
#line 1569 "RGBHistogramManipulator.c"
}
static void rgb_histogram_manipulator_finalize (GObject * obj) {
RGBHistogramManipulator * self;
#line 7 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_RGB_HISTOGRAM_MANIPULATOR, RGBHistogramManipulator);
#line 27 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
_rgb_histogram_unref0 (self->priv->histogram);
#line 7 "/home/jens/Source/shotwell/src/editing_tools/RGBHistogramManipulator.vala"
G_OBJECT_CLASS (rgb_histogram_manipulator_parent_class)->finalize (obj);
#line 1581 "RGBHistogramManipulator.c"
}
GType rgb_histogram_manipulator_get_type (void) {
static volatile gsize rgb_histogram_manipulator_type_id__volatile = 0;
if (g_once_init_enter (&rgb_histogram_manipulator_type_id__volatile)) {
static const GTypeInfo g_define_type_info = { sizeof (RGBHistogramManipulatorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rgb_histogram_manipulator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RGBHistogramManipulator), 0, (GInstanceInitFunc) rgb_histogram_manipulator_instance_init, NULL };
GType rgb_histogram_manipulator_type_id;
rgb_histogram_manipulator_type_id = g_type_register_static (gtk_drawing_area_get_type (), "RGBHistogramManipulator", &g_define_type_info, 0);
g_once_init_leave (&rgb_histogram_manipulator_type_id__volatile, rgb_histogram_manipulator_type_id);
}
return rgb_histogram_manipulator_type_id__volatile;
}
|