From 30fe652caeb61c41de256d94f9d5b264bd8e6152 Mon Sep 17 00:00:00 2001 From: "raveit65 (via Travis CI)" Date: Wed, 14 Feb 2024 00:09:13 +0000 Subject: Deploy mate-desktop/eom to github.com/mate-desktop/eom.git:gh-pages --- .../0.html | 3893 ++++++ .../1.html | 615 + .../10.html | 541 + .../100.html | 609 + .../11.html | 3417 ++++++ .../12.html | 659 ++ .../13.html | 365 + .../14.html | 587 + .../15.html | 367 + .../16.html | 607 + .../17.html | 409 + .../18.html | 721 ++ .../19.html | 379 + .../2.html | 419 + .../20.html | 411 + .../21.html | 415 + .../22.html | 463 + .../23.html | 385 + .../24.html | 785 ++ .../25.html | 351 + .../26.html | 681 ++ .../27.html | 497 + .../28.html | 361 + .../29.html | 329 + .../3.html | 359 + .../30.html | 357 + .../31.html | 355 + .../32.html | 383 + .../33.html | 1295 ++ .../34.html | 875 ++ .../35.html | 363 + .../36.html | 1601 +++ .../37.html | 389 + .../38.html | 555 + .../39.html | 387 + .../4.html | 1567 +++ .../40.html | 353 + .../41.html | 395 + .../42.html | 383 + .../43.html | 395 + .../44.html | 311 + .../45.html | 681 ++ .../46.html | 949 ++ .../47.html | 353 + .../48.html | 277 + .../49.html | 1253 ++ .../5.html | 2195 ++++ .../50.html | 281 + .../51.html | 1293 ++ .../52.html | 431 + .../53.html | 531 + .../54.html | 5169 ++++++++ .../55.html | 285 + .../56.html | 461 + .../57.html | 333 + .../58.html | 321 + .../59.html | 449 + .../6.html | 279 + .../60.html | 2153 ++++ .../61.html | 2091 ++++ .../62.html | 435 + .../63.html | 389 + .../64.html | 1603 +++ .../65.html | 1565 +++ .../66.html | 1597 +++ .../67.html | 499 + .../68.html | 1321 +++ .../69.html | 359 + .../7.html | 279 + .../70.html | 509 + .../71.html | 515 + .../72.html | 365 + .../73.html | 913 ++ .../74.html | 2391 ++++ .../75.html | 2485 ++++ .../76.html | 1279 ++ .../77.html | 335 + .../78.html | 1989 ++++ .../79.html | 1833 +++ .../8.html | 429 + .../80.html | 855 ++ .../81.html | 273 + .../82.html | 5015 ++++++++ .../83.html | 313 + .../84.html | 341 + .../85.html | 1415 +++ .../86.html | 399 + .../87.html | 373 + .../88.html | 529 + .../89.html | 1459 +++ .../9.html | 2295 ++++ .../90.html | 2373 ++++ .../91.html | 1321 +++ .../92.html | 1129 ++ .../93.html | 2197 ++++ .../94.html | 1229 ++ .../95.html | 375 + .../96.html | 411 + .../97.html | 11723 +++++++++++++++++++ .../98.html | 605 + .../99.html | 469 + .../index.html | 867 ++ .../stats.html | 200 + .../style.css | 177 + 104 files changed, 105807 insertions(+) create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/0.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/1.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/10.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/100.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/11.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/12.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/13.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/14.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/15.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/16.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/17.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/18.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/19.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/2.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/20.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/21.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/22.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/23.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/24.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/25.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/26.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/27.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/28.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/29.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/3.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/30.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/31.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/32.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/33.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/34.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/35.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/36.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/37.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/38.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/39.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/4.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/40.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/41.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/42.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/43.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/44.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/45.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/46.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/47.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/48.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/49.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/5.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/50.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/51.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/52.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/53.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/54.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/55.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/56.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/57.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/58.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/59.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/6.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/60.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/61.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/62.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/63.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/64.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/65.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/66.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/67.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/68.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/69.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/7.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/70.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/71.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/72.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/73.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/74.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/75.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/76.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/77.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/78.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/79.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/8.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/80.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/81.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/82.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/83.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/84.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/85.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/86.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/87.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/88.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/89.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/9.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/90.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/91.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/92.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/93.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/94.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/95.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/96.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/97.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/98.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/99.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/index.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/stats.html create mode 100644 2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/style.css (limited to '2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master') diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/0.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/0.html new file mode 100644 index 0000000..9bcc25d --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/0.html @@ -0,0 +1,3893 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
   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
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+1682
+1683
+1684
+1685
+1686
+1687
+1688
+1689
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699
+1700
+1701
+1702
+1703
+1704
+1705
+1706
+1707
+1708
+1709
+1710
+1711
+1712
+1713
+1714
+1715
+1716
+1717
+1718
+1719
+1720
+1721
+1722
+1723
+1724
+1725
+1726
+1727
+1728
+1729
+1730
+1731
+1732
+1733
+1734
+1735
+1736
+1737
+1738
+1739
+1740
+1741
+1742
+1743
+1744
+1745
+1746
+1747
+1748
+1749
+1750
+1751
+1752
+1753
+1754
+1755
+1756
+1757
+1758
+1759
+1760
+1761
+1762
+1763
+1764
+1765
+1766
+1767
+1768
+1769
+1770
+1771
+1772
+1773
+1774
+1775
+1776
+1777
+1778
+1779
+1780
+1781
+1782
+1783
+1784
+1785
+1786
+1787
+1788
+1789
+1790
+1791
+1792
+1793
+1794
+1795
+1796
+1797
+1798
+1799
+1800
+1801
+1802
+1803
+1804
+1805
+1806
+1807
+1808
+1809
+1810
+1811
+1812
+1813
+1814
+1815
+1816
+1817
+1818
+1819
+1820
+1821
+1822
+1823
+1824
+1825
+1826
+1827
+1828
/*
+ *  Copyright (C) 2003, 2004  Marco Pesenti Gritti
+ *  Copyright (C) 2003, 2004, 2005  Christian Persch
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This program 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 General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  $Id: egg-editable-toolbar.c 937 2009-04-07 11:16:53Z friemann $
+ */
+
+#include "config.h"<--- Include file: "config.h" not found.
+
+#include "egg-editable-toolbar.h"
+#include "egg-toolbars-model.h"
+#include "egg-toolbar-editor.h"
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+static GdkPixbuf * new_separator_pixbuf         (void);
+
+#define MIN_TOOLBAR_HEIGHT 20
+#define EGG_ITEM_NAME      "egg-item-name"
+#define STOCK_DRAG_MODE    "stock_drag-mode"
+
+static const GtkTargetEntry dest_drag_types[] = {
+  {EGG_TOOLBAR_ITEM_TYPE, GTK_TARGET_SAME_APP, 0},
+};
+
+enum
+{
+  PROP_0,
+  PROP_TOOLBARS_MODEL,
+  PROP_UI_MANAGER,
+  PROP_POPUP_PATH,
+  PROP_SELECTED,
+  PROP_EDIT_MODE
+};
+
+enum
+{
+  ACTION_REQUEST,
+  LAST_SIGNAL
+};
+
+static guint egg_editable_toolbar_signals[LAST_SIGNAL] = { 0 };
+
+struct _EggEditableToolbarPrivate
+{
+  GtkUIManager *manager;
+  EggToolbarsModel *model;
+  guint edit_mode;
+  gboolean save_hidden;
+  GtkWidget *fixed_toolbar;
+
+  GtkWidget *selected;
+  GtkActionGroup *actions;
+
+  guint visibility_id;
+  GList *visibility_paths;
+  GPtrArray *visibility_actions;
+
+  char *popup_path;
+
+  guint        dnd_pending;
+  GtkToolbar  *dnd_toolbar;
+  GtkToolItem *dnd_toolitem;
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (EggEditableToolbar, egg_editable_toolbar, GTK_TYPE_BOX)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
+
+static int
+get_dock_position (EggEditableToolbar *etoolbar,
+                   GtkWidget *dock)
+{
+  GList *l;
+  int result;
+
+  l = gtk_container_get_children (GTK_CONTAINER (etoolbar));
+  result = g_list_index (l, dock);
+  g_list_free (l);
+
+  return result;
+}
+
+static int
+get_toolbar_position (EggEditableToolbar *etoolbar, GtkWidget *toolbar)
+{
+  return get_dock_position (etoolbar, gtk_widget_get_parent (toolbar));
+}
+
+static int
+get_n_toolbars (EggEditableToolbar *etoolbar)
+{
+  GList *l;
+  int result;
+
+  l = gtk_container_get_children (GTK_CONTAINER (etoolbar));
+  result = g_list_length (l);
+  g_list_free (l);
+
+  return result;
+}
+
+static GtkWidget *
+get_dock_nth (EggEditableToolbar *etoolbar,
+	      int                 position)
+{
+  GList *l;
+  GtkWidget *result;
+
+  l = gtk_container_get_children (GTK_CONTAINER (etoolbar));
+  result = g_list_nth_data (l, position);
+  g_list_free (l);
+
+  return result;
+}
+
+static GtkWidget *
+get_toolbar_nth (EggEditableToolbar *etoolbar,
+		 int                 position)
+{
+  GList *l;
+  GtkWidget *dock;
+  GtkWidget *result;
+
+  dock = get_dock_nth (etoolbar, position);
+  g_return_val_if_fail (dock != NULL, NULL);
+
+  l = gtk_container_get_children (GTK_CONTAINER (dock));
+  result = GTK_WIDGET (l->data);
+  g_list_free (l);
+
+  return result;
+}
+
+static GtkAction *
+find_action (EggEditableToolbar *etoolbar,
+	     const char         *name)
+{
+  GList *l;
+  GtkAction *action = NULL;
+
+  l = gtk_ui_manager_get_action_groups (etoolbar->priv->manager);
+
+  g_return_val_if_fail (name != NULL, NULL);
+
+  for (; l != NULL; l = l->next)
+    {
+      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+      GtkAction *tmp;
+
+      tmp = gtk_action_group_get_action (GTK_ACTION_GROUP (l->data), name);
+      if (tmp)
+        action = tmp;
+      G_GNUC_END_IGNORE_DEPRECATIONS;
+    }
+
+  return action;
+}
+
+static void
+drag_data_delete_cb (GtkWidget          *widget,
+		     GdkDragContext     *context,
+		     EggEditableToolbar *etoolbar)
+{
+  int pos, toolbar_pos;
+
+  widget = gtk_widget_get_ancestor (widget, GTK_TYPE_TOOL_ITEM);
+  g_return_if_fail (widget != NULL);
+  g_return_if_fail (EGG_IS_EDITABLE_TOOLBAR (etoolbar));
+
+  pos = gtk_toolbar_get_item_index (GTK_TOOLBAR (gtk_widget_get_parent (widget)),
+				    GTK_TOOL_ITEM (widget));
+  toolbar_pos = get_toolbar_position (etoolbar, gtk_widget_get_parent (widget));
+
+  egg_toolbars_model_remove_item (etoolbar->priv->model,
+				  toolbar_pos, pos);
+}
+
+static void
+drag_begin_cb (GtkWidget          *widget,
+	       GdkDragContext     *context,
+	       EggEditableToolbar *etoolbar)
+{
+  GtkAction *action;
+  const gchar *action_name;
+  gint flags;
+
+  gtk_widget_hide (widget);
+
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+  action = gtk_activatable_get_related_action (GTK_ACTIVATABLE (widget));
+
+  if (action == NULL) return;
+
+  action_name = gtk_action_get_name (action);
+  G_GNUC_END_IGNORE_DEPRECATIONS;
+
+  flags = egg_toolbars_model_get_name_flags (etoolbar->priv->model,
+                                             action_name);
+  if (!(flags & EGG_TB_MODEL_NAME_INFINITE))
+    {
+      flags &= ~EGG_TB_MODEL_NAME_USED;
+      egg_toolbars_model_set_name_flags (etoolbar->priv->model,
+                                         action_name,
+                                         flags);
+    }
+}
+
+static void
+drag_end_cb (GtkWidget          *widget,
+	     GdkDragContext     *context,
+	     EggEditableToolbar *etoolbar)
+{
+  GtkAction *action;
+  const gchar *action_name;
+  gint flags;
+
+  if (gtk_widget_get_parent (widget) != NULL)
+    {
+      gtk_widget_show (widget);
+
+      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+      action = gtk_activatable_get_related_action (GTK_ACTIVATABLE (widget));
+
+      if (action == NULL) return;
+
+      action_name = gtk_action_get_name (action);
+      G_GNUC_END_IGNORE_DEPRECATIONS;
+
+      flags = egg_toolbars_model_get_name_flags (etoolbar->priv->model,
+                                                 action_name);
+      if (!(flags & EGG_TB_MODEL_NAME_INFINITE))
+        {
+          flags |= EGG_TB_MODEL_NAME_USED;
+          egg_toolbars_model_set_name_flags (etoolbar->priv->model,
+                                             action_name,
+                                             flags);
+        }
+    }
+}
+
+static void
+drag_data_get_cb (GtkWidget          *widget,
+		  GdkDragContext     *context,
+		  GtkSelectionData   *selection_data,
+		  guint               info,
+		  guint32             time,
+		  EggEditableToolbar *etoolbar)
+{
+  EggToolbarsModel *model;
+  const char *name;
+  char *data;
+
+  g_return_if_fail (EGG_IS_EDITABLE_TOOLBAR (etoolbar));
+  model = egg_editable_toolbar_get_model (etoolbar);
+
+  name = g_object_get_data (G_OBJECT (widget), EGG_ITEM_NAME);
+  if (name == NULL)
+    {
+      name = g_object_get_data (G_OBJECT (gtk_widget_get_parent (widget)), EGG_ITEM_NAME);
+      g_return_if_fail (name != NULL);
+    }
+
+  data = egg_toolbars_model_get_data (model, gtk_selection_data_get_target (selection_data), name);
+  if (data != NULL)
+    {
+      gtk_selection_data_set (selection_data, gtk_selection_data_get_target (selection_data), 8, (unsigned char *)data, strlen (data));
+      g_free (data);
+    }
+}
+
+static void
+move_item_cb (GtkAction          *action,
+              EggEditableToolbar *etoolbar)
+{
+  GtkWidget *toolitem = gtk_widget_get_ancestor (egg_editable_toolbar_get_selected (etoolbar), GTK_TYPE_TOOL_ITEM);
+  GtkTargetList *list = gtk_target_list_new (dest_drag_types, G_N_ELEMENTS (dest_drag_types));
+
+  GdkEvent *realevent = gtk_get_current_event();
+  GdkEventMotion event;
+  event.type = GDK_MOTION_NOTIFY;
+  event.window = realevent->any.window;
+  event.send_event = FALSE;
+  event.axes = NULL;
+  event.time = gdk_event_get_time (realevent);
+  gdk_event_get_state (realevent, &event.state);
+  gdk_event_get_coords (realevent, &event.x, &event.y);
+  gdk_event_get_root_coords (realevent, &event.x_root, &event.y_root);
+
+  gtk_drag_begin_with_coordinates (toolitem,
+                                   list,
+                                   GDK_ACTION_MOVE,
+                                   1,
+                                   (GdkEvent *)&event,
+                                   event.x,
+                                   event.y);
+  gtk_target_list_unref (list);
+}
+
+static void
+remove_item_cb (GtkAction          *action,
+                EggEditableToolbar *etoolbar)
+{
+  GtkWidget *toolitem = gtk_widget_get_ancestor (egg_editable_toolbar_get_selected (etoolbar), GTK_TYPE_TOOL_ITEM);
+  int pos, toolbar_pos;
+
+  toolbar_pos = get_toolbar_position (etoolbar, gtk_widget_get_parent (toolitem));
+  pos = gtk_toolbar_get_item_index (GTK_TOOLBAR (gtk_widget_get_parent (toolitem)),
+				    GTK_TOOL_ITEM (toolitem));
+
+  egg_toolbars_model_remove_item (etoolbar->priv->model,
+			          toolbar_pos, pos);
+
+  if (egg_toolbars_model_n_items (etoolbar->priv->model, toolbar_pos) == 0)
+    {
+      egg_toolbars_model_remove_toolbar (etoolbar->priv->model, toolbar_pos);
+    }
+}
+
+static void
+remove_toolbar_cb (GtkAction          *action,
+		   EggEditableToolbar *etoolbar)
+{
+  GtkWidget *selected = egg_editable_toolbar_get_selected (etoolbar);
+  GtkWidget *toolbar = gtk_widget_get_ancestor (selected, GTK_TYPE_TOOLBAR);
+  int toolbar_pos;
+
+  toolbar_pos = get_toolbar_position (etoolbar, toolbar);
+  egg_toolbars_model_remove_toolbar (etoolbar->priv->model, toolbar_pos);
+}
+
+static void
+popup_context_deactivate (GtkMenuShell *menu,
+			  EggEditableToolbar *etoolbar)
+{
+  egg_editable_toolbar_set_selected (etoolbar, NULL);
+  g_object_notify (G_OBJECT (etoolbar), "selected");
+}
+
+static void
+popup_context_menu_cb (GtkWidget          *toolbar,
+                       gint		   x,
+                       gint		   y,
+                       gint                button_number,
+                       EggEditableToolbar *etoolbar)
+{
+  if (etoolbar->priv->popup_path != NULL)
+    {
+      GtkMenu *menu;
+
+      egg_editable_toolbar_set_selected (etoolbar, toolbar);
+      g_object_notify (G_OBJECT (etoolbar), "selected");
+
+      menu = GTK_MENU (gtk_ui_manager_get_widget (etoolbar->priv->manager,
+						  etoolbar->priv->popup_path));
+      g_return_if_fail (menu != NULL);
+      gtk_menu_popup_at_pointer (menu, NULL);
+      g_signal_connect_object (menu, "selection-done",
+			       G_CALLBACK (popup_context_deactivate),
+			       etoolbar, 0);
+    }
+}
+
+static gboolean
+button_press_event_cb (GtkWidget *widget,
+                       GdkEventButton *event,
+                       EggEditableToolbar *etoolbar)
+{
+  if (event->button == 3 && etoolbar->priv->popup_path != NULL)
+    {
+      GtkMenu *menu;
+
+      egg_editable_toolbar_set_selected (etoolbar, widget);
+      g_object_notify (G_OBJECT (etoolbar), "selected");
+
+      menu = GTK_MENU (gtk_ui_manager_get_widget (etoolbar->priv->manager,
+						  etoolbar->priv->popup_path));
+      g_return_val_if_fail (menu != NULL, FALSE);
+      gtk_menu_popup_at_pointer (menu, (const GdkEvent*) event);
+      g_signal_connect_object (menu, "selection-done",
+			       G_CALLBACK (popup_context_deactivate),
+			       etoolbar, 0);
+
+      return TRUE;
+    }
+
+  return FALSE;
+}
+
+static void
+configure_item_sensitivity (GtkToolItem *item, EggEditableToolbar *etoolbar)
+{
+  GtkAction *action;
+  char *name;
+
+  name = g_object_get_data (G_OBJECT (item), EGG_ITEM_NAME);
+  action = name ? find_action (etoolbar, name) : NULL;
+
+  if (action)
+    {
+      g_object_notify (G_OBJECT (action), "sensitive");
+    }
+
+  gtk_tool_item_set_use_drag_window (item,
+				     (etoolbar->priv->edit_mode > 0) ||
+				     GTK_IS_SEPARATOR_TOOL_ITEM (item));
+
+}
+
+static void
+configure_item_cursor (GtkToolItem *item,
+		       EggEditableToolbar *etoolbar)
+{
+  EggEditableToolbarPrivate *priv = etoolbar->priv;
+  GtkWidget *widget = GTK_WIDGET (item);
+
+  if (gtk_widget_get_window (widget) != NULL)
+    {
+      if (priv->edit_mode > 0)
+        {
+          GdkCursor *cursor;
+	  GdkScreen *screen;
+          GdkPixbuf *pixbuf = NULL;
+
+	  screen = gtk_widget_get_screen (GTK_WIDGET (etoolbar));
+
+          cursor = gdk_cursor_new_for_display (gdk_screen_get_display (screen),
+					       GDK_HAND2);
+          gdk_window_set_cursor (gtk_widget_get_window (widget), cursor);
+          g_object_unref (cursor);
+
+          gtk_drag_source_set (widget, GDK_BUTTON1_MASK, dest_drag_types,
+                               G_N_ELEMENTS (dest_drag_types), GDK_ACTION_MOVE);
+          if (GTK_IS_SEPARATOR_TOOL_ITEM (item))
+            {
+              pixbuf = new_separator_pixbuf ();
+            }
+          else
+            {
+              char *icon_name=NULL;
+              char *stock_id=NULL;
+              GtkAction *action;
+              char *name;
+
+              name = g_object_get_data (G_OBJECT (widget), EGG_ITEM_NAME);
+              action = name ? find_action (etoolbar, name) : NULL;
+
+              if (action)
+                {
+                   g_object_get (action,
+                                 "icon-name", &icon_name,
+                                 "stock-id", &stock_id,
+                                 NULL);
+                }
+              if (icon_name)
+                {
+                  GtkIconTheme *icon_theme;
+                  gint width, height;
+
+                  icon_theme = gtk_icon_theme_get_for_screen (screen);
+
+                  if (!gtk_icon_size_lookup (GTK_ICON_SIZE_LARGE_TOOLBAR,
+                                             &width, &height))
+                    {
+                      width = height = 24;
+                    }
+
+                  pixbuf = gtk_icon_theme_load_icon (icon_theme, icon_name,
+                                                     MIN (width, height), 0, NULL);
+                }
+              else if (stock_id)
+                {
+                  pixbuf = gtk_widget_render_icon (widget, stock_id,
+	                                           GTK_ICON_SIZE_LARGE_TOOLBAR, NULL);
+                }
+              g_free (icon_name);
+              g_free (stock_id);
+            }
+
+          if (G_UNLIKELY (!pixbuf))
+            {
+              return;
+            }
+          gtk_drag_source_set_icon_pixbuf (widget, pixbuf);
+          g_object_unref (pixbuf);
+
+        }
+      else
+        {
+          gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET(item)), NULL);
+        }
+    }
+}
+
+static void
+configure_item_tooltip (GtkToolItem *item)
+{
+  GtkAction *action;
+
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+  action = gtk_activatable_get_related_action (GTK_ACTIVATABLE (item));
+  G_GNUC_END_IGNORE_DEPRECATIONS;
+
+  if (action != NULL)
+    {
+      g_object_notify (G_OBJECT (action), "tooltip");
+    }
+}
+
+static void
+connect_widget_signals (GtkWidget *proxy, EggEditableToolbar *etoolbar)
+{
+  if (GTK_IS_CONTAINER (proxy))
+    {
+       gtk_container_forall (GTK_CONTAINER (proxy),
+			     (GtkCallback) connect_widget_signals,
+			     (gpointer) etoolbar);
+    }
+
+  if (GTK_IS_TOOL_ITEM (proxy))
+    {
+      g_signal_connect_object (proxy, "drag_begin",
+			       G_CALLBACK (drag_begin_cb),
+			       etoolbar, 0);
+      g_signal_connect_object (proxy, "drag_end",
+			       G_CALLBACK (drag_end_cb),
+			       etoolbar, 0);
+      g_signal_connect_object (proxy, "drag_data_get",
+			       G_CALLBACK (drag_data_get_cb),
+			       etoolbar, 0);
+      g_signal_connect_object (proxy, "drag_data_delete",
+			       G_CALLBACK (drag_data_delete_cb),
+			       etoolbar, 0);
+    }
+
+  if (GTK_IS_BUTTON (proxy) || GTK_IS_TOOL_ITEM (proxy))
+    {
+      g_signal_connect_object (proxy, "button-press-event",
+			       G_CALLBACK (button_press_event_cb),
+			       etoolbar, 0);
+    }
+}
+
+static void
+action_sensitive_cb (GtkAction   *action,
+                     GParamSpec  *pspec,
+                     GtkToolItem *item)
+{
+  EggEditableToolbar *etoolbar;
+  GtkWidget *ancestor = gtk_widget_get_ancestor (GTK_WIDGET (item), EGG_TYPE_EDITABLE_TOOLBAR);
+
+  if (!ancestor)
+    return;
+
+  etoolbar = EGG_EDITABLE_TOOLBAR (ancestor);
+
+  if (etoolbar->priv->edit_mode > 0)
+    {
+      gtk_widget_set_sensitive (GTK_WIDGET (item), TRUE);
+    }
+}
+
+static GtkToolItem *
+create_item_from_action (EggEditableToolbar *etoolbar,
+			 const char *name)
+{
+  GtkToolItem *item;
+
+  g_return_val_if_fail (name != NULL, NULL);
+
+  if (strcmp (name, "_separator") == 0)
+    {
+      item = gtk_separator_tool_item_new ();
+    }
+  else
+    {
+      GtkAction *action = find_action (etoolbar, name);
+      if (action == NULL) return NULL;
+
+      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+      item = GTK_TOOL_ITEM (gtk_action_create_tool_item (action));
+
+      /* Normally done on-demand by the GtkUIManager, but no
+       * such demand may have been made yet, so do it ourselves.
+       */
+      gtk_action_set_accel_group
+        (action, gtk_ui_manager_get_accel_group(etoolbar->priv->manager));
+      G_GNUC_END_IGNORE_DEPRECATIONS;
+
+      g_signal_connect_object (action, "notify::sensitive",
+                               G_CALLBACK (action_sensitive_cb), item, 0);
+    }
+
+  gtk_widget_show (GTK_WIDGET (item));
+
+  g_object_set_data_full (G_OBJECT (item), EGG_ITEM_NAME,
+                          g_strdup (name), g_free);
+
+  return item;
+}
+
+static GtkToolItem *
+create_item_from_position (EggEditableToolbar *etoolbar,
+                           int                 toolbar_position,
+                           int                 position)
+{
+  GtkToolItem *item;
+  const char *name;
+
+  name = egg_toolbars_model_item_nth (etoolbar->priv->model, toolbar_position, position);
+  item = create_item_from_action (etoolbar, name);
+
+  return item;
+}
+
+static void
+toolbar_drag_data_received_cb (GtkToolbar         *toolbar,
+                               GdkDragContext     *context,
+                               gint                x,
+                               gint                y,
+                               GtkSelectionData   *selection_data,
+                               guint               info,
+                               guint               time,
+                               EggEditableToolbar *etoolbar)
+{
+  /* This function can be called for two reasons
+   *
+   *  (1) drag_motion() needs an item to pass to
+   *      gtk_toolbar_set_drop_highlight_item(). We can
+   *      recognize this case by etoolbar->priv->pending being TRUE
+   *      We should just create an item and return.
+   *
+   *  (2) The drag has finished, and drag_drop() wants us to
+   *      actually add a new item to the toolbar.
+   */
+
+  GdkAtom type = gtk_selection_data_get_data_type (selection_data);
+  const char *data = (char *)gtk_selection_data_get_data (selection_data);
+
+  int ipos = -1;
+  char *name = NULL;
+  gboolean used = FALSE;
+
+  /* Find out where the drop is occurring, and the name of what is being dropped. */
+  if (gtk_selection_data_get_length (selection_data) >= 0)
+    {
+      ipos = gtk_toolbar_get_drop_index (toolbar, x, y);
+      name = egg_toolbars_model_get_name (etoolbar->priv->model, type, data, FALSE);
+      if (name != NULL)
+	{
+	  used = ((egg_toolbars_model_get_name_flags (etoolbar->priv->model, name) & EGG_TB_MODEL_NAME_USED) != 0);
+        }
+    }
+
+  /* If we just want a highlight item, then . */
+  if (etoolbar->priv->dnd_pending > 0)
+    {
+      etoolbar->priv->dnd_pending--;
+
+      if (name != NULL && etoolbar->priv->dnd_toolbar == toolbar && !used)
+        {
+          etoolbar->priv->dnd_toolitem = create_item_from_action (etoolbar, name);
+          gtk_toolbar_set_drop_highlight_item (etoolbar->priv->dnd_toolbar,
+                                               etoolbar->priv->dnd_toolitem, ipos);
+        }
+    }
+  else
+    {
+      gtk_toolbar_set_drop_highlight_item (toolbar, NULL, 0);
+      etoolbar->priv->dnd_toolbar = NULL;
+      etoolbar->priv->dnd_toolitem = NULL;
+
+      /* If we don't have a name to use yet, try to create one. */
+      if (name == NULL && gtk_selection_data_get_length (selection_data) >= 0)
+        {
+          name = egg_toolbars_model_get_name (etoolbar->priv->model, type, data, TRUE);
+        }
+
+      if (name != NULL && !used)
+        {
+          gint tpos = get_toolbar_position (etoolbar, GTK_WIDGET (toolbar));
+          egg_toolbars_model_add_item (etoolbar->priv->model, tpos, ipos, name);
+          gtk_drag_finish (context, TRUE, gdk_drag_context_get_selected_action (context) == GDK_ACTION_MOVE, time);
+        }
+      else
+        {
+          gtk_drag_finish (context, FALSE, gdk_drag_context_get_selected_action (context) == GDK_ACTION_MOVE, time);
+        }
+    }
+
+  g_free (name);
+}
+
+static gboolean
+toolbar_drag_drop_cb (GtkToolbar         *toolbar,
+		      GdkDragContext     *context,
+		      gint                x,
+		      gint                y,
+		      guint               time,
+		      EggEditableToolbar *etoolbar)
+{
+  GdkAtom target;
+
+  target = gtk_drag_dest_find_target (GTK_WIDGET (toolbar), context, NULL);
+  if (target != GDK_NONE)
+    {
+      gtk_drag_get_data (GTK_WIDGET (toolbar), context, target, time);
+      return TRUE;
+    }
+
+  return FALSE;
+}
+
+static gboolean
+toolbar_drag_motion_cb (GtkToolbar         *toolbar,
+		        GdkDragContext     *context,
+		        gint                x,
+		        gint                y,
+		        guint               time,
+		        EggEditableToolbar *etoolbar)
+{
+  GdkAtom target = gtk_drag_dest_find_target (GTK_WIDGET (toolbar), context, NULL);
+  if (target == GDK_NONE)
+    {
+      gdk_drag_status (context, 0, time);
+      return FALSE;
+    }
+
+  /* Make ourselves the current dnd toolbar, and request a highlight item. */
+  if (etoolbar->priv->dnd_toolbar != toolbar)
+    {
+      etoolbar->priv->dnd_toolbar = toolbar;
+      etoolbar->priv->dnd_toolitem = NULL;
+      etoolbar->priv->dnd_pending++;
+      gtk_drag_get_data (GTK_WIDGET (toolbar), context, target, time);
+    }
+
+  /* If a highlight item is available, use it. */
+  else if (etoolbar->priv->dnd_toolitem)
+    {
+      gint ipos = gtk_toolbar_get_drop_index (etoolbar->priv->dnd_toolbar, x, y);
+      gtk_toolbar_set_drop_highlight_item (etoolbar->priv->dnd_toolbar,
+                                           etoolbar->priv->dnd_toolitem, ipos);
+    }
+
+  gdk_drag_status (context, gdk_drag_context_get_suggested_action (context), time);
+
+  return TRUE;
+}
+
+static void
+toolbar_drag_leave_cb (GtkToolbar         *toolbar,
+		       GdkDragContext     *context,
+		       guint               time,
+		       EggEditableToolbar *etoolbar)
+{
+  gtk_toolbar_set_drop_highlight_item (toolbar, NULL, 0);
+
+  /* If we were the current dnd toolbar target, remove the item. */
+  if (etoolbar->priv->dnd_toolbar == toolbar)
+    {
+      etoolbar->priv->dnd_toolbar = NULL;
+      etoolbar->priv->dnd_toolitem = NULL;
+    }
+}
+
+static void
+configure_drag_dest (EggEditableToolbar *etoolbar,
+                     GtkToolbar         *toolbar)
+{
+  EggToolbarsItemType *type;
+  GtkTargetList *targets;
+  GList *list;
+
+  /* Make every toolbar able to receive drag-drops. */
+  gtk_drag_dest_set (GTK_WIDGET (toolbar), 0,
+		     dest_drag_types, G_N_ELEMENTS (dest_drag_types),
+		     GDK_ACTION_MOVE | GDK_ACTION_COPY);
+
+  /* Add any specialist drag-drop abilities. */
+  targets = gtk_drag_dest_get_target_list (GTK_WIDGET (toolbar));
+  list = egg_toolbars_model_get_types (etoolbar->priv->model);
+  while (list)
+  {
+    type = list->data;
+    if (type->new_name != NULL || type->get_name != NULL)
+      gtk_target_list_add (targets, type->type, 0, 0);
+    list = list->next;
+  }
+}
+
+static void
+toggled_visibility_cb (GtkToggleAction *action,
+		       EggEditableToolbar *etoolbar)
+{
+  EggEditableToolbarPrivate *priv = etoolbar->priv;
+  GtkWidget *dock;
+  EggTbModelFlags flags;
+  gboolean visible;
+  gint i;
+
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+  visible = gtk_toggle_action_get_active (action);
+  G_GNUC_END_IGNORE_DEPRECATIONS;
+  for (i = 0; i < priv->visibility_actions->len; i++)
+    if (g_ptr_array_index (priv->visibility_actions, i) == action)
+      break;
+
+  g_return_if_fail (i < priv->visibility_actions->len);
+
+  dock = get_dock_nth (etoolbar, i);
+  if (visible)
+    {
+      gtk_widget_show (dock);
+    }
+  else
+    {
+      gtk_widget_hide (dock);
+    }
+
+  if (priv->save_hidden)
+    {
+      flags = egg_toolbars_model_get_flags (priv->model, i);
+
+      if (visible)
+        {
+	  flags &= ~(EGG_TB_MODEL_HIDDEN);
+	}
+      else
+	{
+	  flags |=  (EGG_TB_MODEL_HIDDEN);
+	}
+
+      egg_toolbars_model_set_flags (priv->model, i, flags);
+    }
+}
+
+static void
+toolbar_visibility_refresh (EggEditableToolbar *etoolbar)
+{
+  EggEditableToolbarPrivate *priv = etoolbar->priv;
+  gint n_toolbars, n_items, i, j, k;
+  GtkToggleAction *toggle_action;
+  GList *list;
+  GString *string;
+  gboolean showing;
+  char action_name[40];
+  char *action_label;
+  char *tmp;
+
+  if (priv == NULL || priv->model == NULL || priv->manager == NULL ||
+      priv->visibility_paths == NULL || priv->actions == NULL)
+    {
+      return;
+    }
+
+  if (priv->visibility_actions == NULL)
+    {
+      priv->visibility_actions = g_ptr_array_new ();
+    }
+
+  if (priv->visibility_id != 0)
+    {
+      gtk_ui_manager_remove_ui (priv->manager, priv->visibility_id);
+    }
+
+  priv->visibility_id = gtk_ui_manager_new_merge_id (priv->manager);
+
+  showing = gtk_widget_get_visible (GTK_WIDGET (etoolbar));
+
+  n_toolbars = egg_toolbars_model_n_toolbars (priv->model);
+  for (i = 0; i < n_toolbars; i++)
+    {
+      string = g_string_sized_new (0);
+      n_items = egg_toolbars_model_n_items (priv->model, i);
+      for (k = 0, j = 0; j < n_items; j++)
+        {
+          GValue value = { 0, };
+          GtkAction *action;
+          const char *name;
+
+          name = egg_toolbars_model_item_nth (priv->model, i, j);
+          if (name == NULL) continue;
+          action = find_action (etoolbar, name);
+          if (action == NULL) continue;
+
+          g_value_init (&value, G_TYPE_STRING);
+          g_object_get_property (G_OBJECT (action), "label", &value);
+          name = g_value_get_string (&value);
+          if (name == NULL)
+	    {
+		g_value_unset (&value);
+		continue;
+	    }
+	  k += g_utf8_strlen (name, -1) + 2;
+	  if (j > 0)
+	    {
+	      g_string_append (string, ", ");
+	      if (j > 1 && k > 25)
+		{
+		  g_value_unset (&value);
+		  break;
+		}
+	    }
+	  g_string_append (string, name);
+	  g_value_unset (&value);
+	}
+      if (j < n_items)
+        {
+	  g_string_append (string, " ...");
+        }
+
+      tmp = g_string_free (string, FALSE);
+      for (j = 0, k = 0; tmp[j]; j++)
+      {
+	if (tmp[j] == '_') continue;
+	tmp[k] = tmp[j];
+	k++;
+      }
+      tmp[k] = 0;
+      /* Translaters: This string is for a toggle to display a toolbar.
+       * The name of the toolbar is automatically computed from the widgets
+       * on the toolbar, and is placed at the %s. Note the _ before the %s
+       * which is used to add mnemonics. We know that this is likely to
+       * produce duplicates, but don't worry about it. If your language
+       * normally has a mnemonic at the start, please use the _. If not,
+       * please remove. */
+      action_label = g_strdup_printf (_("Show “_%s”"), tmp);
+      g_free (tmp);
+
+      sprintf(action_name, "ToolbarToggle%d", i);
+
+      if (i >= priv->visibility_actions->len)
+        {
+          G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+          toggle_action = gtk_toggle_action_new (action_name, action_label, NULL, NULL);
+          G_GNUC_END_IGNORE_DEPRECATIONS;
+          g_ptr_array_add (priv->visibility_actions, toggle_action);
+          g_signal_connect_object (toggle_action, "toggled",
+                                   G_CALLBACK (toggled_visibility_cb),
+                                   etoolbar, 0);
+          G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+          gtk_action_group_add_action (priv->actions, GTK_ACTION (toggle_action));
+          G_GNUC_END_IGNORE_DEPRECATIONS;
+        }
+      else
+        {
+	  toggle_action = g_ptr_array_index (priv->visibility_actions, i);
+	  g_object_set (toggle_action, "label", action_label, NULL);
+        }
+
+      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+      gtk_action_set_visible (GTK_ACTION (toggle_action),
+                              (egg_toolbars_model_get_flags (priv->model, i)
+                               & EGG_TB_MODEL_NOT_REMOVABLE) == 0);
+      gtk_action_set_sensitive (GTK_ACTION (toggle_action), showing);
+      gtk_toggle_action_set_active (toggle_action, gtk_widget_get_visible
+                                    (get_dock_nth (etoolbar, i)));
+      G_GNUC_END_IGNORE_DEPRECATIONS;
+
+      for (list = priv->visibility_paths; list != NULL; list = g_list_next (list))
+        {
+	  gtk_ui_manager_add_ui (priv->manager, priv->visibility_id,
+				 (const char *)list->data, action_name, action_name,
+				 GTK_UI_MANAGER_MENUITEM, FALSE);
+	}
+
+      g_free (action_label);
+    }
+
+  gtk_ui_manager_ensure_update (priv->manager);
+
+  while (i < priv->visibility_actions->len)
+    {
+      toggle_action = g_ptr_array_index (priv->visibility_actions, i);
+      g_ptr_array_remove_index_fast (priv->visibility_actions, i);
+      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+      gtk_action_group_remove_action (priv->actions, GTK_ACTION (toggle_action));
+      G_GNUC_END_IGNORE_DEPRECATIONS;
+      i++;
+    }
+}
+
+static GtkWidget *
+create_dock (EggEditableToolbar *etoolbar)
+{
+  GtkWidget *toolbar, *hbox;
+
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+
+  toolbar = gtk_toolbar_new ();
+  gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar), TRUE);
+  gtk_widget_show (toolbar);
+  gtk_box_pack_start (GTK_BOX (hbox), toolbar, TRUE, TRUE, 0);
+
+  g_signal_connect (toolbar, "drag_drop",
+		    G_CALLBACK (toolbar_drag_drop_cb), etoolbar);
+  g_signal_connect (toolbar, "drag_motion",
+		    G_CALLBACK (toolbar_drag_motion_cb), etoolbar);
+  g_signal_connect (toolbar, "drag_leave",
+		    G_CALLBACK (toolbar_drag_leave_cb), etoolbar);
+
+  g_signal_connect (toolbar, "drag_data_received",
+		    G_CALLBACK (toolbar_drag_data_received_cb), etoolbar);
+  g_signal_connect (toolbar, "popup_context_menu",
+		    G_CALLBACK (popup_context_menu_cb), etoolbar);
+
+  configure_drag_dest (etoolbar, GTK_TOOLBAR (toolbar));
+
+  return hbox;
+}
+
+static void
+set_fixed_style (EggEditableToolbar *t, GtkToolbarStyle style)
+{
+  g_return_if_fail (GTK_IS_TOOLBAR (t->priv->fixed_toolbar));
+  gtk_toolbar_set_style (GTK_TOOLBAR (t->priv->fixed_toolbar),
+  			 style == GTK_TOOLBAR_ICONS ? GTK_TOOLBAR_BOTH_HORIZ : style);
+}
+
+static void
+unset_fixed_style (EggEditableToolbar *t)
+{
+  g_return_if_fail (GTK_IS_TOOLBAR (t->priv->fixed_toolbar));
+  gtk_toolbar_unset_style (GTK_TOOLBAR (t->priv->fixed_toolbar));
+}
+
+static void
+toolbar_changed_cb (EggToolbarsModel   *model,
+	            int                 position,
+	            EggEditableToolbar *etoolbar)
+{
+  GtkWidget *toolbar;
+  EggTbModelFlags flags;
+  GtkToolbarStyle style;
+
+  flags = egg_toolbars_model_get_flags (model, position);
+  toolbar = get_toolbar_nth (etoolbar, position);
+
+  if (flags & EGG_TB_MODEL_ICONS)
+  {
+    style = GTK_TOOLBAR_ICONS;
+  }
+  else if (flags & EGG_TB_MODEL_TEXT)
+  {
+    style = GTK_TOOLBAR_TEXT;
+  }
+  else if (flags & EGG_TB_MODEL_BOTH)
+  {
+    style = GTK_TOOLBAR_BOTH;
+  }
+  else if (flags & EGG_TB_MODEL_BOTH_HORIZ)
+  {
+    style = GTK_TOOLBAR_BOTH_HORIZ;
+  }
+  else
+  {
+    gtk_toolbar_unset_style (GTK_TOOLBAR (toolbar));
+    if (position == 0 && etoolbar->priv->fixed_toolbar)
+      {
+        unset_fixed_style (etoolbar);
+      }
+    return;
+  }
+
+  gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), style);
+  if (position == 0 && etoolbar->priv->fixed_toolbar)
+    {
+      set_fixed_style (etoolbar, style);
+    }
+
+  toolbar_visibility_refresh (etoolbar);
+}
+
+static void
+unparent_fixed (EggEditableToolbar *etoolbar)
+{
+  GtkWidget *toolbar, *dock;
+  g_return_if_fail (GTK_IS_TOOLBAR (etoolbar->priv->fixed_toolbar));
+
+  toolbar = etoolbar->priv->fixed_toolbar;
+  dock = get_dock_nth (etoolbar, 0);
+
+  if (dock && gtk_widget_get_parent (toolbar) != NULL)
+    {
+      gtk_container_remove (GTK_CONTAINER (dock), toolbar);
+    }
+}
+
+static void
+update_fixed (EggEditableToolbar *etoolbar)
+{
+  GtkWidget *toolbar, *dock;
+
+  if (!etoolbar->priv->fixed_toolbar)
+    return;
+
+  toolbar = etoolbar->priv->fixed_toolbar;
+  dock = get_dock_nth (etoolbar, 0);
+
+  if (dock && gtk_widget_get_parent (toolbar) == NULL)
+    {
+      gtk_box_pack_end (GTK_BOX (dock), toolbar, FALSE, TRUE, 0);
+
+      gtk_widget_show (toolbar);
+
+      gtk_widget_set_size_request (dock, -1, -1);
+      gtk_widget_queue_resize_no_redraw (dock);
+    }
+}
+
+static void
+toolbar_added_cb (EggToolbarsModel   *model,
+	          int                 position,
+	          EggEditableToolbar *etoolbar)
+{
+  GtkWidget *dock;
+
+  dock = create_dock (etoolbar);
+  if ((egg_toolbars_model_get_flags (model, position) & EGG_TB_MODEL_HIDDEN) == 0)
+    gtk_widget_show (dock);
+
+  gtk_widget_set_size_request (dock, -1, MIN_TOOLBAR_HEIGHT);
+
+  gtk_box_pack_start (GTK_BOX (etoolbar), dock, TRUE, TRUE, 0);
+
+  gtk_box_reorder_child (GTK_BOX (etoolbar), dock, position);
+
+  gtk_widget_show_all (dock);
+
+  update_fixed (etoolbar);
+
+  toolbar_visibility_refresh (etoolbar);
+}
+
+static void
+toolbar_removed_cb (EggToolbarsModel   *model,
+	            int                 position,
+	            EggEditableToolbar *etoolbar)
+{
+  GtkWidget *dock;
+
+  if (position == 0 && etoolbar->priv->fixed_toolbar != NULL)
+    {
+      unparent_fixed (etoolbar);
+    }
+
+  dock = get_dock_nth (etoolbar, position);
+  gtk_widget_destroy (dock);
+
+  update_fixed (etoolbar);
+
+  toolbar_visibility_refresh (etoolbar);
+}
+
+static void
+item_added_cb (EggToolbarsModel   *model,
+	       int                 tpos,
+	       int                 ipos,
+	       EggEditableToolbar *etoolbar)
+{
+  GtkWidget *dock;
+  GtkWidget *toolbar;
+  GtkToolItem *item;
+
+  toolbar = get_toolbar_nth (etoolbar, tpos);
+  item = create_item_from_position (etoolbar, tpos, ipos);
+  if (item == NULL) return;
+
+  gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, ipos);
+
+  connect_widget_signals (GTK_WIDGET (item), etoolbar);
+  configure_item_tooltip (item);
+  configure_item_cursor (item, etoolbar);
+  configure_item_sensitivity (item, etoolbar);
+
+  dock = get_dock_nth (etoolbar, tpos);
+  gtk_widget_set_size_request (dock, -1, -1);
+  gtk_widget_queue_resize_no_redraw (dock);
+
+  toolbar_visibility_refresh (etoolbar);
+}
+
+static void
+item_removed_cb (EggToolbarsModel   *model,
+	         int                 toolbar_position,
+	         int                 position,
+	         EggEditableToolbar *etoolbar)
+{
+  EggEditableToolbarPrivate *priv = etoolbar->priv;
+
+  GtkWidget *toolbar;
+  GtkWidget *item;
+
+  toolbar = get_toolbar_nth (etoolbar, toolbar_position);
+  item = GTK_WIDGET (gtk_toolbar_get_nth_item
+	(GTK_TOOLBAR (toolbar), position));
+  g_return_if_fail (item != NULL);
+
+  if (item == priv->selected)
+    {
+      /* FIXME */
+    }
+
+  gtk_container_remove (GTK_CONTAINER (toolbar), item);
+
+  toolbar_visibility_refresh (etoolbar);
+}
+
+static void
+egg_editable_toolbar_build (EggEditableToolbar *etoolbar)
+{
+  int i, l, n_items, n_toolbars;
+  EggToolbarsModel *model = etoolbar->priv->model;
+
+  g_return_if_fail (model != NULL);
+  g_return_if_fail (etoolbar->priv->manager != NULL);
+
+  n_toolbars = egg_toolbars_model_n_toolbars (model);
+
+  for (i = 0; i < n_toolbars; i++)
+    {
+      GtkWidget *toolbar, *dock;
+
+      dock = create_dock (etoolbar);
+      if ((egg_toolbars_model_get_flags (model, i) & EGG_TB_MODEL_HIDDEN) == 0)
+        gtk_widget_show (dock);
+      gtk_box_pack_start (GTK_BOX (etoolbar), dock, TRUE, TRUE, 0);
+      toolbar = get_toolbar_nth (etoolbar, i);
+
+      n_items = egg_toolbars_model_n_items (model, i);
+      for (l = 0; l < n_items; l++)
+        {
+          GtkToolItem *item;
+
+          item = create_item_from_position (etoolbar, i, l);
+          if (item)
+            {
+	      gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, l);
+
+              connect_widget_signals (GTK_WIDGET (item), etoolbar);
+	      configure_item_tooltip (item);
+              configure_item_sensitivity (item, etoolbar);
+            }
+          else
+            {
+              egg_toolbars_model_remove_item (model, i, l);
+              l--;
+              n_items--;
+            }
+        }
+
+      if (n_items == 0)
+        {
+            gtk_widget_set_size_request (dock, -1, MIN_TOOLBAR_HEIGHT);
+        }
+    }
+
+  update_fixed (etoolbar);
+
+  /* apply styles */
+  for (i = 0; i < n_toolbars; i ++)
+    {
+      toolbar_changed_cb (model, i, etoolbar);
+    }
+}
+
+static void
+egg_editable_toolbar_disconnect_model (EggEditableToolbar *toolbar)
+{
+  EggToolbarsModel *model = toolbar->priv->model;
+
+  g_signal_handlers_disconnect_by_func
+    (model, G_CALLBACK (item_added_cb), toolbar);
+  g_signal_handlers_disconnect_by_func
+    (model, G_CALLBACK (item_removed_cb), toolbar);
+  g_signal_handlers_disconnect_by_func
+    (model, G_CALLBACK (toolbar_added_cb), toolbar);
+  g_signal_handlers_disconnect_by_func
+    (model, G_CALLBACK (toolbar_removed_cb), toolbar);
+  g_signal_handlers_disconnect_by_func
+    (model, G_CALLBACK (toolbar_changed_cb), toolbar);
+}
+
+static void
+egg_editable_toolbar_deconstruct (EggEditableToolbar *toolbar)
+{
+  EggToolbarsModel *model = toolbar->priv->model;
+  GList *children;
+
+  g_return_if_fail (model != NULL);
+
+  if (toolbar->priv->fixed_toolbar)
+    {
+       unset_fixed_style (toolbar);
+       unparent_fixed (toolbar);
+    }
+
+  children = gtk_container_get_children (GTK_CONTAINER (toolbar));
+  g_list_free_full (children, (GDestroyNotify) gtk_widget_destroy);
+}
+
+void
+egg_editable_toolbar_set_model (EggEditableToolbar *etoolbar,
+				EggToolbarsModel   *model)
+{
+  EggEditableToolbarPrivate *priv = etoolbar->priv;
+
+  if (priv->model == model) return;
+
+  if (priv->model)
+    {
+      egg_editable_toolbar_disconnect_model (etoolbar);
+      egg_editable_toolbar_deconstruct (etoolbar);
+
+      g_object_unref (priv->model);
+    }
+
+  priv->model = g_object_ref (model);
+
+  egg_editable_toolbar_build (etoolbar);
+
+  toolbar_visibility_refresh (etoolbar);
+
+  g_signal_connect (model, "item_added",
+		    G_CALLBACK (item_added_cb), etoolbar);
+  g_signal_connect (model, "item_removed",
+		    G_CALLBACK (item_removed_cb), etoolbar);
+  g_signal_connect (model, "toolbar_added",
+		    G_CALLBACK (toolbar_added_cb), etoolbar);
+  g_signal_connect (model, "toolbar_removed",
+		    G_CALLBACK (toolbar_removed_cb), etoolbar);
+  g_signal_connect (model, "toolbar_changed",
+		    G_CALLBACK (toolbar_changed_cb), etoolbar);
+}
+
+static void
+egg_editable_toolbar_init (EggEditableToolbar *etoolbar)
+{
+  gtk_orientable_set_orientation (GTK_ORIENTABLE (etoolbar),
+                                  GTK_ORIENTATION_VERTICAL);
+
+  EggEditableToolbarPrivate *priv;
+
+  priv = etoolbar->priv = egg_editable_toolbar_get_instance_private (etoolbar);
+
+  priv->save_hidden = TRUE;
+
+  g_signal_connect (etoolbar, "notify::visible",
+		    G_CALLBACK (toolbar_visibility_refresh), NULL);
+}
+
+static void
+egg_editable_toolbar_dispose (GObject *object)
+{
+  EggEditableToolbar *etoolbar = EGG_EDITABLE_TOOLBAR (object);
+  EggEditableToolbarPrivate *priv = etoolbar->priv;
+  GList *children;
+
+  if (priv->fixed_toolbar != NULL)
+    {
+      g_object_unref (priv->fixed_toolbar);
+      priv->fixed_toolbar = NULL;
+    }
+
+  if (priv->visibility_paths)
+    {
+      children = priv->visibility_paths;
+      g_list_free_full (children, g_free);
+      priv->visibility_paths = NULL;
+    }
+
+  g_free (priv->popup_path);
+  priv->popup_path = NULL;
+
+  if (priv->manager != NULL)
+    {
+      if (priv->visibility_id)
+        {
+	  gtk_ui_manager_remove_ui (priv->manager, priv->visibility_id);
+	  priv->visibility_id = 0;
+	}
+
+      g_object_unref (priv->manager);
+      priv->manager = NULL;
+    }
+
+  if (priv->model)
+    {
+      egg_editable_toolbar_disconnect_model (etoolbar);
+      g_object_unref (priv->model);
+      priv->model = NULL;
+    }
+
+  G_OBJECT_CLASS (egg_editable_toolbar_parent_class)->dispose (object);
+}
+
+static void
+egg_editable_toolbar_set_ui_manager (EggEditableToolbar *etoolbar,
+				     GtkUIManager       *manager)
+{
+  static const GtkActionEntry actions[] = {
+    { "MoveToolItem", STOCK_DRAG_MODE, N_("_Move on Toolbar"), NULL,
+      N_("Move the selected item on the toolbar"), G_CALLBACK (move_item_cb) },
+    { "RemoveToolItem", "list-remove", N_("_Remove from Toolbar"), NULL,
+      N_("Remove the selected item from the toolbar"), G_CALLBACK (remove_item_cb) },
+    { "RemoveToolbar", "edit-delete", N_("_Delete Toolbar"), NULL,
+      N_("Remove the selected toolbar"), G_CALLBACK (remove_toolbar_cb) },
+  };
+
+  etoolbar->priv->manager = g_object_ref (manager);
+
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+  etoolbar->priv->actions = gtk_action_group_new ("ToolbarActions");
+  gtk_action_group_set_translation_domain (etoolbar->priv->actions, GETTEXT_PACKAGE);
+  gtk_action_group_add_actions (etoolbar->priv->actions, actions,
+		 		G_N_ELEMENTS (actions), etoolbar);
+  G_GNUC_END_IGNORE_DEPRECATIONS;
+  gtk_ui_manager_insert_action_group (manager, etoolbar->priv->actions, -1);
+  g_object_unref (etoolbar->priv->actions);
+
+  toolbar_visibility_refresh (etoolbar);
+}
+
+GtkWidget * egg_editable_toolbar_get_selected (EggEditableToolbar   *etoolbar)
+{
+  return etoolbar->priv->selected;
+}
+
+void
+egg_editable_toolbar_set_selected (EggEditableToolbar *etoolbar,
+				   GtkWidget          *widget)
+{
+  GtkWidget *toolbar, *toolitem;
+  gboolean editable;
+
+  etoolbar->priv->selected = widget;
+
+  toolbar = (widget != NULL) ? gtk_widget_get_ancestor (widget, GTK_TYPE_TOOLBAR) : NULL;
+  toolitem = (widget != NULL) ? gtk_widget_get_ancestor (widget, GTK_TYPE_TOOL_ITEM) : NULL;
+
+  if(toolbar != NULL)
+    {
+      gint tpos = get_toolbar_position (etoolbar, toolbar);
+      editable = ((egg_toolbars_model_get_flags (etoolbar->priv->model, tpos) & EGG_TB_MODEL_NOT_EDITABLE) == 0);
+    }
+  else
+    {
+      editable = FALSE;
+    }
+
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+  gtk_action_set_visible (find_action (etoolbar, "RemoveToolbar"), (toolbar != NULL) && (etoolbar->priv->edit_mode > 0));
+  gtk_action_set_visible (find_action (etoolbar, "RemoveToolItem"), (toolitem != NULL) && editable);
+  gtk_action_set_visible (find_action (etoolbar, "MoveToolItem"), (toolitem != NULL) && editable);
+  G_GNUC_END_IGNORE_DEPRECATIONS;
+}
+
+static void
+set_edit_mode (EggEditableToolbar *etoolbar,
+	       gboolean mode)
+{
+  EggEditableToolbarPrivate *priv = etoolbar->priv;
+  int i, l, n_items;
+
+  i = priv->edit_mode;
+  if (mode)
+    {
+      priv->edit_mode++;
+    }
+  else
+    {
+      g_return_if_fail (priv->edit_mode > 0);
+      priv->edit_mode--;
+    }
+  i *= priv->edit_mode;
+
+  if (i == 0)
+    {
+      for (i = get_n_toolbars (etoolbar)-1; i >= 0; i--)
+        {
+          GtkWidget *toolbar;
+
+          toolbar = get_toolbar_nth (etoolbar, i);
+          n_items = gtk_toolbar_get_n_items (GTK_TOOLBAR (toolbar));
+
+          if (n_items == 0 && priv->edit_mode == 0)
+            {
+              egg_toolbars_model_remove_toolbar (priv->model, i);
+            }
+          else
+            {
+              for (l = 0; l < n_items; l++)
+                {
+                  GtkToolItem *item;
+
+                  item = gtk_toolbar_get_nth_item (GTK_TOOLBAR (toolbar), l);
+
+                  configure_item_cursor (item, etoolbar);
+                  configure_item_sensitivity (item, etoolbar);
+                }
+            }
+        }
+    }
+}
+
+static void
+egg_editable_toolbar_set_property (GObject      *object,
+				   guint         prop_id,
+				   const GValue *value,
+				   GParamSpec   *pspec)
+{
+  EggEditableToolbar *etoolbar = EGG_EDITABLE_TOOLBAR (object);
+
+  switch (prop_id)
+    {
+    case PROP_UI_MANAGER:
+      egg_editable_toolbar_set_ui_manager (etoolbar, g_value_get_object (value));
+      break;
+    case PROP_TOOLBARS_MODEL:
+      egg_editable_toolbar_set_model (etoolbar, g_value_get_object (value));
+      break;
+    case PROP_SELECTED:
+      egg_editable_toolbar_set_selected (etoolbar, g_value_get_object (value));
+      break;
+    case PROP_POPUP_PATH:
+      etoolbar->priv->popup_path = g_strdup (g_value_get_string (value));
+      break;
+    case PROP_EDIT_MODE:
+      set_edit_mode (etoolbar, g_value_get_boolean (value));
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+    }
+}
+
+static void
+egg_editable_toolbar_get_property (GObject    *object,
+				   guint       prop_id,
+				   GValue     *value,
+				   GParamSpec *pspec)
+{
+  EggEditableToolbar *etoolbar = EGG_EDITABLE_TOOLBAR (object);
+
+  switch (prop_id)
+    {
+    case PROP_UI_MANAGER:
+      g_value_set_object (value, etoolbar->priv->manager);
+      break;
+    case PROP_TOOLBARS_MODEL:
+      g_value_set_object (value, etoolbar->priv->model);
+      break;
+    case PROP_SELECTED:
+      g_value_set_object (value, etoolbar->priv->selected);
+      break;
+    case PROP_EDIT_MODE:
+      g_value_set_boolean (value, etoolbar->priv->edit_mode>0);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+    }
+}
+
+static void
+egg_editable_toolbar_class_init (EggEditableToolbarClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+  object_class->dispose = egg_editable_toolbar_dispose;
+  object_class->set_property = egg_editable_toolbar_set_property;
+  object_class->get_property = egg_editable_toolbar_get_property;
+
+  egg_editable_toolbar_signals[ACTION_REQUEST] =
+    g_signal_new ("action_request",
+		  G_OBJECT_CLASS_TYPE (object_class),
+		  G_SIGNAL_RUN_LAST,
+		  G_STRUCT_OFFSET (EggEditableToolbarClass, action_request),
+		  NULL, NULL, g_cclosure_marshal_VOID__STRING,
+		  G_TYPE_NONE, 1, G_TYPE_STRING);
+
+  g_object_class_install_property (object_class,
+				   PROP_UI_MANAGER,
+				   g_param_spec_object ("ui-manager",
+							"UI-Mmanager",
+							"UI Manager",
+							GTK_TYPE_UI_MANAGER,
+							G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
+  g_object_class_install_property (object_class,
+				   PROP_TOOLBARS_MODEL,
+				   g_param_spec_object ("model",
+							"Model",
+							"Toolbars Model",
+							EGG_TYPE_TOOLBARS_MODEL,
+							G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
+  g_object_class_install_property (object_class,
+				   PROP_SELECTED,
+				   g_param_spec_object ("selected",
+							"Selected",
+							"Selected toolitem",
+							GTK_TYPE_TOOL_ITEM,
+							G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
+
+  g_object_class_install_property (object_class,
+				   PROP_POPUP_PATH,
+				   g_param_spec_string ("popup-path",
+							"popup-path",
+							"popup-path",
+							NULL,
+							G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
+
+  g_object_class_install_property (object_class,
+				   PROP_EDIT_MODE,
+				   g_param_spec_boolean ("edit-mode",
+							 "Edit-Mode",
+							 "Edit Mode",
+							 FALSE,
+							 G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
+}
+
+GtkWidget *
+egg_editable_toolbar_new (GtkUIManager *manager,
+                          const char *popup_path)
+{
+    return GTK_WIDGET (g_object_new (EGG_TYPE_EDITABLE_TOOLBAR,
+                                     "ui-manager", manager,
+                                     "popup-path", popup_path,
+                                     NULL));
+}
+
+GtkWidget *
+egg_editable_toolbar_new_with_model (GtkUIManager *manager,
+ 				     EggToolbarsModel *model,
+                                     const char *popup_path)
+{
+  return GTK_WIDGET (g_object_new (EGG_TYPE_EDITABLE_TOOLBAR,
+                                   "ui-manager", manager,
+                                   "model", model,
+                                   "popup-path", popup_path,
+				   NULL));
+}
+
+gboolean
+egg_editable_toolbar_get_edit_mode (EggEditableToolbar *etoolbar)
+{
+  EggEditableToolbarPrivate *priv = etoolbar->priv;
+
+  return priv->edit_mode > 0;
+}
+
+void
+egg_editable_toolbar_set_edit_mode (EggEditableToolbar *etoolbar,
+				    gboolean mode)
+{
+  set_edit_mode (etoolbar, mode);
+  g_object_notify (G_OBJECT (etoolbar), "edit-mode");
+}
+
+void
+egg_editable_toolbar_add_visibility (EggEditableToolbar *etoolbar,
+				     const char *path)
+{
+  etoolbar->priv->visibility_paths = g_list_prepend
+	  (etoolbar->priv->visibility_paths, g_strdup (path));
+}
+
+void
+egg_editable_toolbar_show (EggEditableToolbar *etoolbar,
+			   const char *name)
+{
+  EggEditableToolbarPrivate *priv = etoolbar->priv;
+  EggToolbarsModel *model = priv->model;
+  int i, n_toolbars;
+
+  n_toolbars = egg_toolbars_model_n_toolbars (model);
+  for (i = 0; i < n_toolbars; i++)
+    {
+      const char *toolbar_name;
+
+      toolbar_name = egg_toolbars_model_toolbar_nth (model, i);
+      if (strcmp (toolbar_name, name) == 0)
+        {
+          gtk_widget_show (get_dock_nth (etoolbar, i));
+        }
+    }
+}
+
+void
+egg_editable_toolbar_hide (EggEditableToolbar *etoolbar,
+			   const char *name)
+{
+  EggEditableToolbarPrivate *priv = etoolbar->priv;
+  EggToolbarsModel *model = priv->model;
+  int i, n_toolbars;
+
+  n_toolbars = egg_toolbars_model_n_toolbars (model);
+  for (i = 0; i < n_toolbars; i++)
+    {
+      const char *toolbar_name;
+
+      toolbar_name = egg_toolbars_model_toolbar_nth (model, i);
+      if (strcmp (toolbar_name, name) == 0)
+      {
+        gtk_widget_hide (get_dock_nth (etoolbar, i));
+      }
+    }
+}
+
+void
+egg_editable_toolbar_set_fixed (EggEditableToolbar *etoolbar,
+				GtkToolbar *toolbar)
+{
+  EggEditableToolbarPrivate *priv = etoolbar->priv;
+
+  g_return_if_fail (!toolbar || GTK_IS_TOOLBAR (toolbar));
+
+  if (priv->fixed_toolbar)
+    {
+      unparent_fixed (etoolbar);
+      g_object_unref (priv->fixed_toolbar);
+      priv->fixed_toolbar = NULL;
+    }
+
+  if (toolbar)
+    {
+      priv->fixed_toolbar = GTK_WIDGET (toolbar);
+      gtk_toolbar_set_show_arrow (toolbar, FALSE);
+      g_object_ref_sink (toolbar);
+    }
+
+  update_fixed (etoolbar);
+}
+
+#define DEFAULT_ICON_HEIGHT 20
+
+/* We should probably experiment some more with this.
+ * Right now the rendered icon is pretty good for most
+ * themes. However, the icon is slightly large for themes
+ * with large toolbar icons.
+ */
+static GdkPixbuf *
+new_pixbuf_from_widget (GtkWidget *widget)
+{
+  GtkWidget *window;
+  GdkPixbuf *pixbuf;
+  gint icon_height;
+
+  if (!gtk_icon_size_lookup (GTK_ICON_SIZE_LARGE_TOOLBAR,
+                             NULL,
+                             &icon_height))
+    {
+      icon_height = DEFAULT_ICON_HEIGHT;
+    }
+
+  window = gtk_offscreen_window_new ();
+  /* Set the width to -1 as we want the separator to be as thin as possible. */
+  gtk_widget_set_size_request (widget, -1, icon_height);
+  gtk_container_add (GTK_CONTAINER (window), widget);
+  gtk_widget_show_all (window);
+
+  /* Process the waiting events to have the widget actually drawn */
+  gdk_window_process_updates (gtk_widget_get_window (window), TRUE);
+  pixbuf = gtk_offscreen_window_get_pixbuf (GTK_OFFSCREEN_WINDOW (window));
+  gtk_widget_destroy (window);
+
+  return pixbuf;
+}
+
+static GdkPixbuf *
+new_separator_pixbuf (void)
+{
+  GtkWidget *separator;
+  GdkPixbuf *pixbuf;
+
+  separator = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
+  pixbuf = new_pixbuf_from_widget (separator);
+  return pixbuf;
+}
+
+static void
+update_separator_image (GtkImage *image)
+{
+  GdkPixbuf *pixbuf = new_separator_pixbuf ();
+  gtk_image_set_from_pixbuf (GTK_IMAGE (image), pixbuf);
+  g_object_unref (pixbuf);
+}
+
+static gboolean
+style_set_cb (GtkWidget *widget,
+              GtkStyle *previous_style,
+              GtkImage *image)
+{
+
+  update_separator_image (image);
+  return FALSE;
+}
+
+GtkWidget *
+_egg_editable_toolbar_new_separator_image (void)
+{
+  GtkWidget *image = gtk_image_new ();
+  update_separator_image (GTK_IMAGE (image));
+  g_signal_connect (G_OBJECT (image), "style_set",
+		    G_CALLBACK (style_set_cb), GTK_IMAGE (image));
+
+  return image;
+}
+
+EggToolbarsModel *
+egg_editable_toolbar_get_model (EggEditableToolbar *etoolbar)
+{
+  return etoolbar->priv->model;
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/1.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/1.html new file mode 100644 index 0000000..9e8fc36 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/1.html @@ -0,0 +1,615 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/*
+ *  Copyright (C) 2003-2004 Marco Pesenti Gritti
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This program 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 General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  $Id: egg-toolbars-model.h 929 2009-02-19 14:49:56Z friemann $
+ */
+
+#ifndef EGG_TOOLBARS_MODEL_H
+#define EGG_TOOLBARS_MODEL_H
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gdk/gdk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+#define EGG_TYPE_TOOLBARS_MODEL             (egg_toolbars_model_get_type ())
+#define EGG_TOOLBARS_MODEL(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_TOOLBARS_MODEL, EggToolbarsModel))
+#define EGG_TOOLBARS_MODEL_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_TOOLBARS_MODEL, EggToolbarsModelClass))
+#define EGG_IS_TOOLBARS_MODEL(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_TOOLBARS_MODEL))
+#define EGG_IS_TOOLBARS_MODEL_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_TOOLBARS_MODEL))
+#define EGG_TOOLBARS_MODEL_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_TOOLBARS_MODEL, EggToolbarsModelClass))
+
+typedef struct EggToolbarsModel		EggToolbarsModel;
+typedef struct EggToolbarsModelPrivate	EggToolbarsModelPrivate;
+typedef struct EggToolbarsModelClass	EggToolbarsModelClass;
+
+#define EGG_TOOLBAR_ITEM_TYPE "application/x-toolbar-item"
+
+typedef enum
+{
+  EGG_TB_MODEL_NOT_REMOVABLE	 = 1 << 0,
+  EGG_TB_MODEL_NOT_EDITABLE	 = 1 << 1,
+  EGG_TB_MODEL_BOTH		 = 1 << 2,
+  EGG_TB_MODEL_BOTH_HORIZ	 = 1 << 3,
+  EGG_TB_MODEL_ICONS		 = 1 << 4,
+  EGG_TB_MODEL_TEXT		 = 1 << 5,
+  EGG_TB_MODEL_STYLES_MASK	 = 0x3C,
+  EGG_TB_MODEL_ACCEPT_ITEMS_ONLY = 1 << 6,
+  EGG_TB_MODEL_HIDDEN            = 1 << 7
+} EggTbModelFlags;
+
+typedef enum
+{
+  EGG_TB_MODEL_NAME_USED         = 1 << 0,
+  EGG_TB_MODEL_NAME_INFINITE     = 1 << 1,
+  EGG_TB_MODEL_NAME_KNOWN        = 1 << 2
+} EggTbModelNameFlags;
+
+struct EggToolbarsModel
+{
+  GObject parent_object;
+
+  /*< private >*/
+  EggToolbarsModelPrivate *priv;
+};
+
+struct EggToolbarsModelClass
+{
+  GObjectClass parent_class;
+
+  /* Signals */
+  void (* item_added)      (EggToolbarsModel *model,
+			    int toolbar_position,
+			    int position);
+  void (* item_removed)    (EggToolbarsModel *model,
+			    int toolbar_position,
+			    int position);
+  void (* toolbar_added)   (EggToolbarsModel *model,
+			    int position);
+  void (* toolbar_changed) (EggToolbarsModel *model,
+			    int position);
+  void (* toolbar_removed) (EggToolbarsModel *model,
+			    int position);
+
+  /* Virtual Table */
+  gboolean (* add_item)    (EggToolbarsModel *t,
+			    int	              toolbar_position,
+			    int               position,
+			    const char       *name);
+};
+
+typedef struct EggToolbarsItemType EggToolbarsItemType;
+
+struct EggToolbarsItemType
+{
+  GdkAtom type;
+
+  gboolean (* has_data) (EggToolbarsItemType *type,
+                         const char          *name);
+  char *   (* get_data) (EggToolbarsItemType *type,
+                         const char          *name);
+
+  char *   (* new_name) (EggToolbarsItemType *type,
+                         const char          *data);
+  char *   (* get_name) (EggToolbarsItemType *type,
+                         const char          *data);
+};
+
+GType		  egg_toolbars_model_get_type       (void);
+EggToolbarsModel *egg_toolbars_model_new	    (void);
+gboolean          egg_toolbars_model_load_names     (EggToolbarsModel *model,
+						     const char *xml_file);
+gboolean          egg_toolbars_model_load_toolbars  (EggToolbarsModel *model,
+						     const char *xml_file);
+void              egg_toolbars_model_save_toolbars  (EggToolbarsModel *model,
+						     const char *xml_file,
+						     const char *version);
+
+/* Functions for manipulating the types of portable data this toolbar understands. */
+GList *           egg_toolbars_model_get_types      (EggToolbarsModel *model);
+void              egg_toolbars_model_set_types      (EggToolbarsModel *model,
+                                                     GList            *types);
+
+/* Functions for converting between name and portable data. */
+char *            egg_toolbars_model_get_name       (EggToolbarsModel *model,
+                                                     GdkAtom           type,
+                                                     const char       *data,
+                                                     gboolean          create);
+char *            egg_toolbars_model_get_data       (EggToolbarsModel *model,
+                                                     GdkAtom           type,
+                                                     const char       *name);
+
+/* Functions for retrieving what items are available for adding to the toolbars. */
+GPtrArray *       egg_toolbars_model_get_name_avail (EggToolbarsModel *model);
+gint              egg_toolbars_model_get_name_flags (EggToolbarsModel *model,
+						     const char *name);
+void              egg_toolbars_model_set_name_flags (EggToolbarsModel *model,
+						     const char *name,
+						     gint flags);
+
+/* Functions for manipulating flags on individual toolbars. */
+EggTbModelFlags   egg_toolbars_model_get_flags      (EggToolbarsModel *model,
+						     int               toolbar_position);
+void              egg_toolbars_model_set_flags      (EggToolbarsModel *model,
+						     int	       toolbar_position,
+						     EggTbModelFlags   flags);
+
+/* Functions for adding and removing toolbars. */
+int               egg_toolbars_model_add_toolbar    (EggToolbarsModel *model,
+						     int               position,
+						     const char       *name);
+void		  egg_toolbars_model_remove_toolbar (EggToolbarsModel *model,
+						     int               position);
+
+/* Functions for adding, removing and moving items. */
+gboolean	  egg_toolbars_model_add_item       (EggToolbarsModel *model,
+						     int	       toolbar_position,
+				                     int               position,
+						     const char       *name);
+void		  egg_toolbars_model_remove_item    (EggToolbarsModel *model,
+						     int               toolbar_position,
+						     int               position);
+void		  egg_toolbars_model_move_item      (EggToolbarsModel *model,
+						     int               toolbar_position,
+						     int               position,
+						     int	       new_toolbar_position,
+						     int               new_position);
+void		  egg_toolbars_model_delete_item    (EggToolbarsModel *model,
+						     const char       *name);
+
+/* Functions for accessing the names of items. */
+int		  egg_toolbars_model_n_items	    (EggToolbarsModel *model,
+						     int               toolbar_position);
+const char *      egg_toolbars_model_item_nth	    (EggToolbarsModel *model,
+						     int	       toolbar_position,
+						     int               position);
+
+/* Functions for accessing the names of toolbars. */
+int		  egg_toolbars_model_n_toolbars	    (EggToolbarsModel *model);
+const char	 *egg_toolbars_model_toolbar_nth    (EggToolbarsModel *model,
+						     int               position);
+
+G_END_DECLS
+
+#endif
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/10.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/10.html new file mode 100644 index 0000000..6891220 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/10.html @@ -0,0 +1,541 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  GThumb
+ *
+ *  Copyright (C) 2001, 2002 The Free Software Foundation, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/* based upon file transupp.h from the libjpeg package, original copyright
+ * note follows:
+ *
+ * transupp.h
+ *
+ * Copyright (C) 1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains declarations for image transformation routines and
+ * other utility code used by the jpegtran sample application.  These are
+ * NOT part of the core JPEG library.  But we keep these routines separate
+ * from jpegtran.c to ease the task of maintaining jpegtran-like programs
+ * that have other user interfaces.
+ *
+ * NOTE: all the routines declared here have very specific requirements
+ * about when they are to be executed during the reading and writing of the
+ * source and destination files.  See the comments in transupp.c, or see
+ * jpegtran.c for an example of correct usage.
+ */
+
+/*
+ * Codes for supported types of image transformations.
+ */
+
+#ifdef HAVE_LIBJPEG
+
+#ifndef TRANSUPP_H
+#define TRANSUPP_H
+
+#include <jpeglib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+typedef enum {
+	JXFORM_NONE,		/* no transformation */
+	JXFORM_FLIP_H,		/* horizontal flip */
+	JXFORM_FLIP_V,		/* vertical flip */
+	JXFORM_TRANSPOSE,	/* transpose across UL-to-LR axis */
+	JXFORM_TRANSVERSE,	/* transpose across UR-to-LL axis */
+	JXFORM_ROT_90,		/* 90-degree clockwise rotation */
+	JXFORM_ROT_180,		/* 180-degree rotation */
+	JXFORM_ROT_270		/* 270-degree clockwise (or 90 ccw) */
+} JXFORM_CODE;
+
+/*
+ * Although rotating and flipping data expressed as DCT coefficients is not
+ * hard, there is an asymmetry in the JPEG format specification for images
+ * whose dimensions aren't multiples of the iMCU size.  The right and bottom
+ * image edges are padded out to the next iMCU boundary with junk data; but
+ * no padding is possible at the top and left edges.  If we were to flip
+ * the whole image including the pad data, then pad garbage would become
+ * visible at the top and/or left, and real pixels would disappear into the
+ * pad margins --- perhaps permanently, since encoders & decoders may not
+ * bother to preserve DCT blocks that appear to be completely outside the
+ * nominal image area.  So, we have to exclude any partial iMCUs from the
+ * basic transformation.
+ *
+ * Transpose is the only transformation that can handle partial iMCUs at the
+ * right and bottom edges completely cleanly.  flip_h can flip partial iMCUs
+ * at the bottom, but leaves any partial iMCUs at the right edge untouched.
+ * Similarly flip_v leaves any partial iMCUs at the bottom edge untouched.
+ * The other transforms are defined as combinations of these basic transforms
+ * and process edge blocks in a way that preserves the equivalence.
+ *
+ * The "trim" option causes untransformable partial iMCUs to be dropped;
+ * this is not strictly lossless, but it usually gives the best-looking
+ * result for odd-size images.  Note that when this option is active,
+ * the expected mathematical equivalences between the transforms may not hold.
+ * (For example, -rot 270 -trim trims only the bottom edge, but -rot 90 -trim
+ * followed by -rot 180 -trim trims both edges.)
+ *
+ * We also offer a "force to grayscale" option, which simply discards the
+ * chrominance channels of a YCbCr image.  This is lossless in the sense that
+ * the luminance channel is preserved exactly.  It's not the same kind of
+ * thing as the rotate/flip transformations, but it's convenient to handle it
+ * as part of this package, mainly because the transformation routines have to
+ * be aware of the option to know how many components to work on.
+ */
+
+typedef struct {
+  /* Options: set by caller */
+  JXFORM_CODE transform;	/* image transform operator */
+  boolean trim;			/* if TRUE, trim partial MCUs as needed */
+  boolean force_grayscale;	/* if TRUE, convert color image to grayscale */
+
+  /* Internal workspace: caller should not touch these */
+  int num_components;		/* # of components in workspace */
+  jvirt_barray_ptr * workspace_coef_arrays; /* workspace for transformations */
+} jpeg_transform_info;
+
+/* Request any required workspace */
+void jtransform_request_workspace   (j_decompress_ptr     srcinfo,
+				     jpeg_transform_info *info);
+
+/* Adjust output image parameters */
+
+jvirt_barray_ptr * jtransform_adjust_parameters (j_decompress_ptr     srcinfo,
+						 j_compress_ptr       dstinfo,
+						 jvirt_barray_ptr    *src_coef_arrays,
+						 jpeg_transform_info *info);
+
+/* Execute the actual transformation, if any */
+void jtransform_execute_transformation (j_decompress_ptr     srcinfo,
+					j_compress_ptr       dstinfo,
+					jvirt_barray_ptr    *src_coef_arrays,
+					jpeg_transform_info *info);
+
+/*
+ * Support for copying optional markers from source to destination file.
+ */
+
+typedef enum {
+	JCOPYOPT_NONE,		/* copy no optional markers */
+	JCOPYOPT_COMMENTS,	/* copy only comment (COM) markers */
+	JCOPYOPT_ALL		/* copy all optional markers */
+} JCOPY_OPTION;
+
+#define JCOPYOPT_DEFAULT  JCOPYOPT_COMMENTS	/* recommended default */
+
+/* Setup decompression object to save desired markers in memory */
+void jcopy_markers_setup (j_decompress_ptr srcinfo,
+			  JCOPY_OPTION     option);
+
+/* Copy markers saved in the given source object to the destination object */
+void jcopy_markers_execute (j_decompress_ptr srcinfo,
+			    j_compress_ptr   dstinfo,
+			    JCOPY_OPTION     option);
+
+#endif /* TRANSUPP_H */
+
+#endif /* HAVE_LIBJPEG */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/100.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/100.html new file mode 100644 index 0000000..439f86b --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/100.html @@ -0,0 +1,609 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* gcc eom-thumbnailer.c `pkg-config --cflags --libs glib-2.0 gio-2.0 MagickWand` -lm -o eom-thumbnailer */
+/*
+ * Copyright (C) 2020-2021 MATE developers
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Authors: Robert Buj <rbuj@fedoraproject.org>
+ *
+ */
+
+#define _GNU_SOURCE
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"<--- Include file: "config.h" not found.
+#endif
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <math.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <stdlib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#ifdef HAVE_IMAGEMAGICK7
+#include <MagickWand/MagickWand.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+#ifdef HAVE_IMAGEMAGICK6
+#include <wand/magick_wand.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+static int output_size = 256;
+static gboolean g_fatal_warnings = FALSE;
+static char **filenames = NULL;
+
+static char *
+get_target_uri (GFile *file)
+{
+	GFileInfo *info;
+	char *target;
+
+	info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_TARGET_URI, G_FILE_QUERY_INFO_NONE, NULL, NULL);
+	if (info == NULL)
+		return NULL;
+	target = g_strdup (g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_TARGET_URI));
+	g_object_unref (info);
+
+	return target;
+}
+
+static char *
+get_target_path (GFile *input)
+{
+	if (g_file_has_uri_scheme (input, "trash") != FALSE ||
+	    g_file_has_uri_scheme (input, "recent") != FALSE) {
+		GFile *file;
+		char *input_uri;
+		char *input_path;
+
+		input_uri = get_target_uri (input);
+		file = g_file_new_for_uri (input_uri);
+		g_free (input_uri);
+		input_path = g_file_get_path (file);
+		g_object_unref (file);
+		return input_path;
+	}
+	return g_file_get_path (input);
+}
+
+static const GOptionEntry entries[] = {
+	{ "size", 's', 0, G_OPTION_ARG_INT, &output_size, "Size of the thumbnail in pixels", NULL },
+	{"g-fatal-warnings", '\0', 0, G_OPTION_ARG_NONE, &g_fatal_warnings, "Make all warnings fatal", NULL},
+	{ G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_FILENAME_ARRAY, &filenames, NULL, "[INPUT FILE] [OUTPUT FILE]" },
+	{ 0, '\0', 0, G_OPTION_ARG_NONE, 0, 0, 0 }
+};
+
+int main (int argc, char **argv)
+{
+	MagickBooleanType status;
+	MagickWand *magick_wand;
+	char *input_filename;
+	GError *error = NULL;
+	GOptionContext *context;
+	GFile *input;
+	const char *output;
+	size_t width, height;
+
+	/* Options parsing */
+	context = g_option_context_new ("- thumbnail images");
+	g_option_context_add_main_entries (context, entries, NULL);
+
+	(void) g_option_context_parse (context, &argc, &argv, &error);
+	g_option_context_free (context);
+	if (error) {
+		g_warning ("Couldn't parse command-line options: %s", error->message);
+		g_error_free (error);
+		goto arguments_error;
+	}
+
+	/* Set fatal warnings if required */
+	if (g_fatal_warnings) {
+		GLogLevelFlags fatal_mask;
+
+		fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK);
+		fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL;
+		g_log_set_always_fatal (fatal_mask);
+	}
+
+	if (filenames == NULL || g_strv_length (filenames) != 2) {
+		g_print ("Expects an input and an output file\n");
+		goto arguments_error;
+	}
+
+	if (output_size < 1) {
+		g_warning ("Size cannot be smaller than 1 pixel");
+		goto arguments_error;
+	}
+
+	input = g_file_new_for_commandline_arg (filenames[0]);
+	input_filename = get_target_path (input);
+	g_object_unref (input);
+	if (input_filename == NULL) {
+		g_warning ("Could not get file path for %s", filenames[0]);
+		goto arguments_error;
+	}
+
+	output = filenames[1];
+
+	/* Read an image */
+	MagickWandGenesis ();
+	magick_wand = NewMagickWand ();
+	status = MagickReadImage (magick_wand, input_filename);
+	g_free (input_filename);
+	if (status == MagickFalse) {
+		g_warning ("Could not load input file %s", filenames[0]);
+		goto imagemagick_error;
+	}
+
+	/* Get the image's width and height */
+	width = MagickGetImageWidth (magick_wand);
+	height = MagickGetImageHeight (magick_wand);
+
+	/* Thumbnail */
+	if ((height > output_size) || (width > output_size)) {
+		double scale;
+		scale = (double) output_size / MAX (width, height);
+		MagickThumbnailImage (magick_wand,
+                                      (size_t) floor (width * scale + 0.5),
+                                      (size_t) floor (height * scale + 0.5));
+	}
+
+	/* Write the image then destroy it */
+	status = MagickWriteImages (magick_wand, output, MagickTrue);
+	if (status == MagickFalse) {
+		g_warning ("Could not save output file %s", output);
+		goto imagemagick_error;
+	}
+	g_strfreev (filenames);
+	if (magick_wand)
+		DestroyMagickWand (magick_wand);
+	MagickWandTerminus ();
+
+	return 0;
+
+arguments_error:
+	if (filenames)
+		g_strfreev (filenames);
+	return 1;
+
+imagemagick_error:
+	g_strfreev (filenames);
+	if (magick_wand)
+		DestroyMagickWand (magick_wand);
+	return 1;
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/11.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/11.html new file mode 100644 index 0000000..565d2d0 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/11.html @@ -0,0 +1,3417 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
   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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  GThumb
+ *
+ *  Copyright (C) 2001, 2002 The Free Software Foundation, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/* based upon file transupp.c from the libjpeg package, original copyright
+ * note follows:
+ *
+ *
+ * transupp.c
+ *
+ * Copyright (C) 1997-2009, Thomas G. Lane, Guido Vollbeding.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains image transformation routines and other utility code
+ * used by the jpegtran sample application.  These are NOT part of the core
+ * JPEG library.  But we keep these routines separate from jpegtran.c to
+ * ease the task of maintaining jpegtran-like programs that have other user
+ * interfaces.
+ */
+
+/* Although this file really shouldn't have access to the library internals,
+ * it's helpful to let it call jround_up() and jcopy_block_row().
+ */
+#define JPEG_INTERNALS
+
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <stdio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <jpeglib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "transupp-8a.h"	/* My own external interface */
+#include <ctype.h>		/* to declare isdigit() */<--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#if TRANSFORMS_SUPPORTED
+
+/*
+ * Lossless image transformation routines.  These routines work on DCT
+ * coefficient arrays and thus do not require any lossy decompression
+ * or recompression of the image.
+ * Thanks to Guido Vollbeding for the initial design and code of this feature,
+ * and to Ben Jackson for introducing the cropping feature.
+ *
+ * Horizontal flipping is done in-place, using a single top-to-bottom
+ * pass through the virtual source array.  It will thus be much the
+ * fastest option for images larger than main memory.
+ *
+ * The other routines require a set of destination virtual arrays, so they
+ * need twice as much memory as jpegtran normally does.  The destination
+ * arrays are always written in normal scan order (top to bottom) because
+ * the virtual array manager expects this.  The source arrays will be scanned
+ * in the corresponding order, which means multiple passes through the source
+ * arrays for most of the transforms.  That could result in much thrashing
+ * if the image is larger than main memory.
+ *
+ * If cropping or trimming is involved, the destination arrays may be smaller
+ * than the source arrays.  Note it is not possible to do horizontal flip
+ * in-place when a nonzero Y crop offset is specified, since we'd have to move
+ * data from one block row to another but the virtual array manager doesn't
+ * guarantee we can touch more than one row at a time.  So in that case,
+ * we have to use a separate destination array.
+ *
+ * Some notes about the operating environment of the individual transform
+ * routines:
+ * 1. Both the source and destination virtual arrays are allocated from the
+ *    source JPEG object, and therefore should be manipulated by calling the
+ *    source's memory manager.
+ * 2. The destination's component count should be used.  It may be smaller
+ *    than the source's when forcing to grayscale.
+ * 3. Likewise the destination's sampling factors should be used.  When
+ *    forcing to grayscale the destination's sampling factors will be all 1,
+ *    and we may as well take that as the effective iMCU size.
+ * 4. When "trim" is in effect, the destination's dimensions will be the
+ *    trimmed values but the source's will be untrimmed.
+ * 5. When "crop" is in effect, the destination's dimensions will be the
+ *    cropped values but the source's will be uncropped.  Each transform
+ *    routine is responsible for picking up source data starting at the
+ *    correct X and Y offset for the crop region.  (The X and Y offsets
+ *    passed to the transform routines are measured in iMCU blocks of the
+ *    destination.)
+ * 6. All the routines assume that the source and destination buffers are
+ *    padded out to a full iMCU boundary.  This is true, although for the
+ *    source buffer it is an undocumented property of jdcoefct.c.
+ */
+
+LOCAL(void)
+do_crop (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	 JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
+	 jvirt_barray_ptr *src_coef_arrays,
+	 jvirt_barray_ptr *dst_coef_arrays)
+/* Crop.  This is only used when no rotate/flip is requested with the crop. */
+{
+  JDIMENSION dst_blk_y, x_crop_blocks, y_crop_blocks;
+  int ci, offset_y;
+  JBLOCKARRAY src_buffer, dst_buffer;
+  jpeg_component_info *compptr;
+
+  /* We simply have to copy the right amount of data (the destination's
+   * image size) starting at the given X and Y offsets in the source.
+   */
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
+    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
+    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+	 dst_blk_y += compptr->v_samp_factor) {
+      dst_buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
+	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+      src_buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, src_coef_arrays[ci],
+	 dst_blk_y + y_crop_blocks,
+	 (JDIMENSION) compptr->v_samp_factor, FALSE);
+      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+	jcopy_block_row(src_buffer[offset_y] + x_crop_blocks,
+			dst_buffer[offset_y],
+			compptr->width_in_blocks);
+      }
+    }
+  }
+}
+
+LOCAL(void)
+do_flip_h_no_crop (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+		   JDIMENSION x_crop_offset,
+		   jvirt_barray_ptr *src_coef_arrays)
+/* Horizontal flip; done in-place, so no separate dest array is required.
+ * NB: this only works when y_crop_offset is zero.
+ */
+{
+  JDIMENSION MCU_cols, comp_width, blk_x, blk_y, x_crop_blocks;
+  int ci, k, offset_y;
+  JBLOCKARRAY buffer;
+  JCOEFPTR ptr1, ptr2;
+  JCOEF temp1, temp2;
+  jpeg_component_info *compptr;
+
+  /* Horizontal mirroring of DCT blocks is accomplished by swapping
+   * pairs of blocks in-place.  Within a DCT block, we perform horizontal
+   * mirroring by changing the signs of odd-numbered columns.
+   * Partial iMCUs at the right edge are left untouched.
+   */
+  MCU_cols = srcinfo->output_width /
+    (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
+
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    comp_width = MCU_cols * compptr->h_samp_factor;
+    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
+    for (blk_y = 0; blk_y < compptr->height_in_blocks;
+	 blk_y += compptr->v_samp_factor) {
+      buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, src_coef_arrays[ci], blk_y,
+	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+	/* Do the mirroring */
+	for (blk_x = 0; blk_x * 2 < comp_width; blk_x++) {
+	  ptr1 = buffer[offset_y][blk_x];
+	  ptr2 = buffer[offset_y][comp_width - blk_x - 1];
+	  /* this unrolled loop doesn't need to know which row it's on... */
+	  for (k = 0; k < DCTSIZE2; k += 2) {
+	    temp1 = *ptr1;	/* swap even column */
+	    temp2 = *ptr2;
+	    *ptr1++ = temp2;
+	    *ptr2++ = temp1;
+	    temp1 = *ptr1;	/* swap odd column with sign change */
+	    temp2 = *ptr2;
+	    *ptr1++ = -temp2;
+	    *ptr2++ = -temp1;
+	  }
+	}
+	if (x_crop_blocks > 0) {
+	  /* Now left-justify the portion of the data to be kept.
+	   * We can't use a single jcopy_block_row() call because that routine
+	   * depends on memcpy(), whose behavior is unspecified for overlapping
+	   * source and destination areas.  Sigh.
+	   */
+	  for (blk_x = 0; blk_x < compptr->width_in_blocks; blk_x++) {
+	    jcopy_block_row(buffer[offset_y] + blk_x + x_crop_blocks,
+			    buffer[offset_y] + blk_x,
+			    (JDIMENSION) 1);
+	  }
+	}
+      }
+    }
+  }
+}
+
+LOCAL(void)
+do_flip_h (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	   JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
+	   jvirt_barray_ptr *src_coef_arrays,
+	   jvirt_barray_ptr *dst_coef_arrays)
+/* Horizontal flip in general cropping case */
+{
+  JDIMENSION MCU_cols, comp_width, dst_blk_x, dst_blk_y;
+  JDIMENSION x_crop_blocks, y_crop_blocks;
+  int ci, k, offset_y;
+  JBLOCKARRAY src_buffer, dst_buffer;
+  JBLOCKROW src_row_ptr, dst_row_ptr;
+  JCOEFPTR src_ptr, dst_ptr;
+  jpeg_component_info *compptr;
+
+  /* Here we must output into a separate array because we can't touch
+   * different rows of a single virtual array simultaneously.  Otherwise,
+   * this is essentially the same as the routine above.
+   */
+  MCU_cols = srcinfo->output_width /
+    (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
+
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    comp_width = MCU_cols * compptr->h_samp_factor;
+    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
+    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
+    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+	 dst_blk_y += compptr->v_samp_factor) {
+      dst_buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
+	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+      src_buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, src_coef_arrays[ci],
+	 dst_blk_y + y_crop_blocks,
+	 (JDIMENSION) compptr->v_samp_factor, FALSE);
+      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+	dst_row_ptr = dst_buffer[offset_y];
+	src_row_ptr = src_buffer[offset_y];
+	for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {
+	  if (x_crop_blocks + dst_blk_x < comp_width) {
+	    /* Do the mirrorable blocks */
+	    dst_ptr = dst_row_ptr[dst_blk_x];
+	    src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];
+	    /* this unrolled loop doesn't need to know which row it's on... */
+	    for (k = 0; k < DCTSIZE2; k += 2) {
+	      *dst_ptr++ = *src_ptr++;	 /* copy even column */
+	      *dst_ptr++ = - *src_ptr++; /* copy odd column with sign change */
+	    }
+	  } else {
+	    /* Copy last partial block(s) verbatim */
+	    jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks,
+			    dst_row_ptr + dst_blk_x,
+			    (JDIMENSION) 1);
+	  }
+	}
+      }
+    }
+  }
+}
+
+LOCAL(void)
+do_flip_v (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	   JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
+	   jvirt_barray_ptr *src_coef_arrays,
+	   jvirt_barray_ptr *dst_coef_arrays)
+/* Vertical flip */
+{
+  JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;
+  JDIMENSION x_crop_blocks, y_crop_blocks;
+  int ci, i, j, offset_y;
+  JBLOCKARRAY src_buffer, dst_buffer;
+  JBLOCKROW src_row_ptr, dst_row_ptr;
+  JCOEFPTR src_ptr, dst_ptr;
+  jpeg_component_info *compptr;
+
+  /* We output into a separate array because we can't touch different
+   * rows of the source virtual array simultaneously.  Otherwise, this
+   * is a pretty straightforward analog of horizontal flip.
+   * Within a DCT block, vertical mirroring is done by changing the signs
+   * of odd-numbered rows.
+   * Partial iMCUs at the bottom edge are copied verbatim.
+   */
+  MCU_rows = srcinfo->output_height /
+    (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
+
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    comp_height = MCU_rows * compptr->v_samp_factor;
+    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
+    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
+    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+	 dst_blk_y += compptr->v_samp_factor) {
+      dst_buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
+	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+      if (y_crop_blocks + dst_blk_y < comp_height) {
+	/* Row is within the mirrorable area. */
+	src_buffer = (*srcinfo->mem->access_virt_barray)
+	  ((j_common_ptr) srcinfo, src_coef_arrays[ci],
+	   comp_height - y_crop_blocks - dst_blk_y -
+	   (JDIMENSION) compptr->v_samp_factor,
+	   (JDIMENSION) compptr->v_samp_factor, FALSE);
+      } else {
+	/* Bottom-edge blocks will be copied verbatim. */
+	src_buffer = (*srcinfo->mem->access_virt_barray)
+	  ((j_common_ptr) srcinfo, src_coef_arrays[ci],
+	   dst_blk_y + y_crop_blocks,
+	   (JDIMENSION) compptr->v_samp_factor, FALSE);
+      }
+      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+	if (y_crop_blocks + dst_blk_y < comp_height) {
+	  /* Row is within the mirrorable area. */
+	  dst_row_ptr = dst_buffer[offset_y];
+	  src_row_ptr = src_buffer[compptr->v_samp_factor - offset_y - 1];
+	  src_row_ptr += x_crop_blocks;
+	  for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
+	       dst_blk_x++) {
+	    dst_ptr = dst_row_ptr[dst_blk_x];
+	    src_ptr = src_row_ptr[dst_blk_x];
+	    for (i = 0; i < DCTSIZE; i += 2) {
+	      /* copy even row */
+	      for (j = 0; j < DCTSIZE; j++)
+		*dst_ptr++ = *src_ptr++;
+	      /* copy odd row with sign change */
+	      for (j = 0; j < DCTSIZE; j++)
+		*dst_ptr++ = - *src_ptr++;
+	    }
+	  }
+	} else {
+	  /* Just copy row verbatim. */
+	  jcopy_block_row(src_buffer[offset_y] + x_crop_blocks,
+			  dst_buffer[offset_y],
+			  compptr->width_in_blocks);
+	}
+      }
+    }
+  }
+}
+
+LOCAL(void)
+do_transpose (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	      JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
+	      jvirt_barray_ptr *src_coef_arrays,
+	      jvirt_barray_ptr *dst_coef_arrays)
+/* Transpose source into destination */
+{
+  JDIMENSION dst_blk_x, dst_blk_y, x_crop_blocks, y_crop_blocks;
+  int ci, i, j, offset_x, offset_y;
+  JBLOCKARRAY src_buffer, dst_buffer;
+  JCOEFPTR src_ptr, dst_ptr;
+  jpeg_component_info *compptr;
+
+  /* Transposing pixels within a block just requires transposing the
+   * DCT coefficients.
+   * Partial iMCUs at the edges require no special treatment; we simply
+   * process all the available DCT blocks for every component.
+   */
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
+    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
+    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+	 dst_blk_y += compptr->v_samp_factor) {
+      dst_buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
+	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+	for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
+	     dst_blk_x += compptr->h_samp_factor) {
+	  src_buffer = (*srcinfo->mem->access_virt_barray)
+	    ((j_common_ptr) srcinfo, src_coef_arrays[ci],
+	     dst_blk_x + x_crop_blocks,
+	     (JDIMENSION) compptr->h_samp_factor, FALSE);
+	  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {
+	    dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
+	    src_ptr = src_buffer[offset_x][dst_blk_y + offset_y + y_crop_blocks];
+	    for (i = 0; i < DCTSIZE; i++)
+	      for (j = 0; j < DCTSIZE; j++)
+		dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+	  }
+	}
+      }
+    }
+  }
+}
+
+LOCAL(void)
+do_rot_90 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	   JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
+	   jvirt_barray_ptr *src_coef_arrays,
+	   jvirt_barray_ptr *dst_coef_arrays)
+/* 90 degree rotation is equivalent to
+ *   1. Transposing the image;
+ *   2. Horizontal mirroring.
+ * These two steps are merged into a single processing routine.
+ */
+{
+  JDIMENSION MCU_cols, comp_width, dst_blk_x, dst_blk_y;
+  JDIMENSION x_crop_blocks, y_crop_blocks;
+  int ci, i, j, offset_x, offset_y;
+  JBLOCKARRAY src_buffer, dst_buffer;
+  JCOEFPTR src_ptr, dst_ptr;
+  jpeg_component_info *compptr;
+
+  /* Because of the horizontal mirror step, we can't process partial iMCUs
+   * at the (output) right edge properly.  They just get transposed and
+   * not mirrored.
+   */
+  MCU_cols = srcinfo->output_height /
+    (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
+
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    comp_width = MCU_cols * compptr->h_samp_factor;
+    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
+    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
+    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+	 dst_blk_y += compptr->v_samp_factor) {
+      dst_buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
+	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+	for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
+	     dst_blk_x += compptr->h_samp_factor) {
+	  if (x_crop_blocks + dst_blk_x < comp_width) {
+	    /* Block is within the mirrorable area. */
+	    src_buffer = (*srcinfo->mem->access_virt_barray)
+	      ((j_common_ptr) srcinfo, src_coef_arrays[ci],
+	       comp_width - x_crop_blocks - dst_blk_x -
+	       (JDIMENSION) compptr->h_samp_factor,
+	       (JDIMENSION) compptr->h_samp_factor, FALSE);
+	  } else {
+	    /* Edge blocks are transposed but not mirrored. */
+	    src_buffer = (*srcinfo->mem->access_virt_barray)
+	      ((j_common_ptr) srcinfo, src_coef_arrays[ci],
+	       dst_blk_x + x_crop_blocks,
+	       (JDIMENSION) compptr->h_samp_factor, FALSE);
+	  }
+	  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {
+	    dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
+	    if (x_crop_blocks + dst_blk_x < comp_width) {
+	      /* Block is within the mirrorable area. */
+	      src_ptr = src_buffer[compptr->h_samp_factor - offset_x - 1]
+		[dst_blk_y + offset_y + y_crop_blocks];
+	      for (i = 0; i < DCTSIZE; i++) {
+		for (j = 0; j < DCTSIZE; j++)
+		  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+		i++;
+		for (j = 0; j < DCTSIZE; j++)
+		  dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
+	      }
+	    } else {
+	      /* Edge blocks are transposed but not mirrored. */
+	      src_ptr = src_buffer[offset_x]
+		[dst_blk_y + offset_y + y_crop_blocks];
+	      for (i = 0; i < DCTSIZE; i++)
+		for (j = 0; j < DCTSIZE; j++)
+		  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+	    }
+	  }
+	}
+      }
+    }
+  }
+}
+
+LOCAL(void)
+do_rot_270 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	    JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
+	    jvirt_barray_ptr *src_coef_arrays,
+	    jvirt_barray_ptr *dst_coef_arrays)
+/* 270 degree rotation is equivalent to
+ *   1. Horizontal mirroring;
+ *   2. Transposing the image.
+ * These two steps are merged into a single processing routine.
+ */
+{
+  JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;
+  JDIMENSION x_crop_blocks, y_crop_blocks;
+  int ci, i, j, offset_x, offset_y;
+  JBLOCKARRAY src_buffer, dst_buffer;
+  JCOEFPTR src_ptr, dst_ptr;
+  jpeg_component_info *compptr;
+
+  /* Because of the horizontal mirror step, we can't process partial iMCUs
+   * at the (output) bottom edge properly.  They just get transposed and
+   * not mirrored.
+   */
+  MCU_rows = srcinfo->output_width /
+    (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
+
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    comp_height = MCU_rows * compptr->v_samp_factor;
+    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
+    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
+    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+	 dst_blk_y += compptr->v_samp_factor) {
+      dst_buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
+	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+	for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
+	     dst_blk_x += compptr->h_samp_factor) {
+	  src_buffer = (*srcinfo->mem->access_virt_barray)
+	    ((j_common_ptr) srcinfo, src_coef_arrays[ci],
+	     dst_blk_x + x_crop_blocks,
+	     (JDIMENSION) compptr->h_samp_factor, FALSE);
+	  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {
+	    dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
+	    if (y_crop_blocks + dst_blk_y < comp_height) {
+	      /* Block is within the mirrorable area. */
+	      src_ptr = src_buffer[offset_x]
+		[comp_height - y_crop_blocks - dst_blk_y - offset_y - 1];
+	      for (i = 0; i < DCTSIZE; i++) {
+		for (j = 0; j < DCTSIZE; j++) {
+		  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+		  j++;
+		  dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
+		}
+	      }
+	    } else {
+	      /* Edge blocks are transposed but not mirrored. */
+	      src_ptr = src_buffer[offset_x]
+		[dst_blk_y + offset_y + y_crop_blocks];
+	      for (i = 0; i < DCTSIZE; i++)
+		for (j = 0; j < DCTSIZE; j++)
+		  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+	    }
+	  }
+	}
+      }
+    }
+  }
+}
+
+LOCAL(void)
+do_rot_180 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	    JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
+	    jvirt_barray_ptr *src_coef_arrays,
+	    jvirt_barray_ptr *dst_coef_arrays)
+/* 180 degree rotation is equivalent to
+ *   1. Vertical mirroring;
+ *   2. Horizontal mirroring.
+ * These two steps are merged into a single processing routine.
+ */
+{
+  JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;
+  JDIMENSION x_crop_blocks, y_crop_blocks;
+  int ci, i, j, offset_y;
+  JBLOCKARRAY src_buffer, dst_buffer;
+  JBLOCKROW src_row_ptr, dst_row_ptr;
+  JCOEFPTR src_ptr, dst_ptr;
+  jpeg_component_info *compptr;
+
+  MCU_cols = srcinfo->output_width /
+    (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
+  MCU_rows = srcinfo->output_height /
+    (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
+
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    comp_width = MCU_cols * compptr->h_samp_factor;
+    comp_height = MCU_rows * compptr->v_samp_factor;
+    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
+    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
+    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+	 dst_blk_y += compptr->v_samp_factor) {
+      dst_buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
+	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+      if (y_crop_blocks + dst_blk_y < comp_height) {
+	/* Row is within the vertically mirrorable area. */
+	src_buffer = (*srcinfo->mem->access_virt_barray)
+	  ((j_common_ptr) srcinfo, src_coef_arrays[ci],
+	   comp_height - y_crop_blocks - dst_blk_y -
+	   (JDIMENSION) compptr->v_samp_factor,
+	   (JDIMENSION) compptr->v_samp_factor, FALSE);
+      } else {
+	/* Bottom-edge rows are only mirrored horizontally. */
+	src_buffer = (*srcinfo->mem->access_virt_barray)
+	  ((j_common_ptr) srcinfo, src_coef_arrays[ci],
+	   dst_blk_y + y_crop_blocks,
+	   (JDIMENSION) compptr->v_samp_factor, FALSE);
+      }
+      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+	dst_row_ptr = dst_buffer[offset_y];
+	if (y_crop_blocks + dst_blk_y < comp_height) {
+	  /* Row is within the mirrorable area. */
+	  src_row_ptr = src_buffer[compptr->v_samp_factor - offset_y - 1];
+	  for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {
+	    dst_ptr = dst_row_ptr[dst_blk_x];
+	    if (x_crop_blocks + dst_blk_x < comp_width) {
+	      /* Process the blocks that can be mirrored both ways. */
+	      src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];
+	      for (i = 0; i < DCTSIZE; i += 2) {
+		/* For even row, negate every odd column. */
+		for (j = 0; j < DCTSIZE; j += 2) {
+		  *dst_ptr++ = *src_ptr++;
+		  *dst_ptr++ = - *src_ptr++;
+		}
+		/* For odd row, negate every even column. */
+		for (j = 0; j < DCTSIZE; j += 2) {
+		  *dst_ptr++ = - *src_ptr++;
+		  *dst_ptr++ = *src_ptr++;
+		}
+	      }
+	    } else {
+	      /* Any remaining right-edge blocks are only mirrored vertically. */
+	      src_ptr = src_row_ptr[x_crop_blocks + dst_blk_x];
+	      for (i = 0; i < DCTSIZE; i += 2) {
+		for (j = 0; j < DCTSIZE; j++)
+		  *dst_ptr++ = *src_ptr++;
+		for (j = 0; j < DCTSIZE; j++)
+		  *dst_ptr++ = - *src_ptr++;
+	      }
+	    }
+	  }
+	} else {
+	  /* Remaining rows are just mirrored horizontally. */
+	  src_row_ptr = src_buffer[offset_y];
+	  for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {
+	    if (x_crop_blocks + dst_blk_x < comp_width) {
+	      /* Process the blocks that can be mirrored. */
+	      dst_ptr = dst_row_ptr[dst_blk_x];
+	      src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];
+	      for (i = 0; i < DCTSIZE2; i += 2) {
+		*dst_ptr++ = *src_ptr++;
+		*dst_ptr++ = - *src_ptr++;
+	      }
+	    } else {
+	      /* Any remaining right-edge blocks are only copied. */
+	      jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks,
+			      dst_row_ptr + dst_blk_x,
+			      (JDIMENSION) 1);
+	    }
+	  }
+	}
+      }
+    }
+  }
+}
+
+LOCAL(void)
+do_transverse (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	       JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
+	       jvirt_barray_ptr *src_coef_arrays,
+	       jvirt_barray_ptr *dst_coef_arrays)
+/* Transverse transpose is equivalent to
+ *   1. 180 degree rotation;
+ *   2. Transposition;
+ * or
+ *   1. Horizontal mirroring;
+ *   2. Transposition;
+ *   3. Horizontal mirroring.
+ * These steps are merged into a single processing routine.
+ */
+{
+  JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;
+  JDIMENSION x_crop_blocks, y_crop_blocks;
+  int ci, i, j, offset_x, offset_y;
+  JBLOCKARRAY src_buffer, dst_buffer;
+  JCOEFPTR src_ptr, dst_ptr;
+  jpeg_component_info *compptr;
+
+  MCU_cols = srcinfo->output_height /
+    (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
+  MCU_rows = srcinfo->output_width /
+    (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
+
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    comp_width = MCU_cols * compptr->h_samp_factor;
+    comp_height = MCU_rows * compptr->v_samp_factor;
+    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
+    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
+    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+	 dst_blk_y += compptr->v_samp_factor) {
+      dst_buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
+	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+	for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
+	     dst_blk_x += compptr->h_samp_factor) {
+	  if (x_crop_blocks + dst_blk_x < comp_width) {
+	    /* Block is within the mirrorable area. */
+	    src_buffer = (*srcinfo->mem->access_virt_barray)
+	      ((j_common_ptr) srcinfo, src_coef_arrays[ci],
+	       comp_width - x_crop_blocks - dst_blk_x -
+	       (JDIMENSION) compptr->h_samp_factor,
+	       (JDIMENSION) compptr->h_samp_factor, FALSE);
+	  } else {
+	    src_buffer = (*srcinfo->mem->access_virt_barray)
+	      ((j_common_ptr) srcinfo, src_coef_arrays[ci],
+	       dst_blk_x + x_crop_blocks,
+	       (JDIMENSION) compptr->h_samp_factor, FALSE);
+	  }
+	  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {
+	    dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
+	    if (y_crop_blocks + dst_blk_y < comp_height) {
+	      if (x_crop_blocks + dst_blk_x < comp_width) {
+		/* Block is within the mirrorable area. */
+		src_ptr = src_buffer[compptr->h_samp_factor - offset_x - 1]
+		  [comp_height - y_crop_blocks - dst_blk_y - offset_y - 1];
+		for (i = 0; i < DCTSIZE; i++) {
+		  for (j = 0; j < DCTSIZE; j++) {
+		    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+		    j++;
+		    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
+		  }
+		  i++;
+		  for (j = 0; j < DCTSIZE; j++) {
+		    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
+		    j++;
+		    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+		  }
+		}
+	      } else {
+		/* Right-edge blocks are mirrored in y only */
+		src_ptr = src_buffer[offset_x]
+		  [comp_height - y_crop_blocks - dst_blk_y - offset_y - 1];
+		for (i = 0; i < DCTSIZE; i++) {
+		  for (j = 0; j < DCTSIZE; j++) {
+		    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+		    j++;
+		    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
+		  }
+		}
+	      }
+	    } else {
+	      if (x_crop_blocks + dst_blk_x < comp_width) {
+		/* Bottom-edge blocks are mirrored in x only */
+		src_ptr = src_buffer[compptr->h_samp_factor - offset_x - 1]
+		  [dst_blk_y + offset_y + y_crop_blocks];
+		for (i = 0; i < DCTSIZE; i++) {
+		  for (j = 0; j < DCTSIZE; j++)
+		    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+		  i++;
+		  for (j = 0; j < DCTSIZE; j++)
+		    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
+		}
+	      } else {
+		/* At lower right corner, just transpose, no mirroring */
+		src_ptr = src_buffer[offset_x]
+		  [dst_blk_y + offset_y + y_crop_blocks];
+		for (i = 0; i < DCTSIZE; i++)
+		  for (j = 0; j < DCTSIZE; j++)
+		    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+	      }
+	    }
+	  }
+	}
+      }
+    }
+  }
+}
+
+/* Parse an unsigned integer: subroutine for jtransform_parse_crop_spec.
+ * Returns TRUE if valid integer found, FALSE if not.
+ * *strptr is advanced over the digit string, and *result is set to its value.
+ */
+
+LOCAL(boolean)
+jt_read_integer (const char ** strptr, JDIMENSION * result)
+{
+  const char * ptr = *strptr;
+  JDIMENSION val = 0;
+
+  for (; isdigit(*ptr); ptr++) {
+    val = val * 10 + (JDIMENSION) (*ptr - '0');
+  }
+  *result = val;
+  if (ptr == *strptr)
+    return FALSE;		/* oops, no digits */
+  *strptr = ptr;
+  return TRUE;
+}
+
+/* Parse a crop specification (written in X11 geometry style).
+ * The routine returns TRUE if the spec string is valid, FALSE if not.
+ *
+ * The crop spec string should have the format
+ *	<width>x<height>{+-}<xoffset>{+-}<yoffset>
+ * where width, height, xoffset, and yoffset are unsigned integers.
+ * Each of the elements can be omitted to indicate a default value.
+ * (A weakness of this style is that it is not possible to omit xoffset
+ * while specifying yoffset, since they look alike.)
+ *
+ * This code is loosely based on XParseGeometry from the X11 distribution.
+ */
+
+GLOBAL(boolean)
+jtransform_parse_crop_spec (jpeg_transform_info *info, const char *spec)
+{
+  info->crop = FALSE;
+  info->crop_width_set = JCROP_UNSET;
+  info->crop_height_set = JCROP_UNSET;
+  info->crop_xoffset_set = JCROP_UNSET;
+  info->crop_yoffset_set = JCROP_UNSET;
+
+  if (isdigit(*spec)) {
+    /* fetch width */
+    if (! jt_read_integer(&spec, &info->crop_width))
+      return FALSE;
+    info->crop_width_set = JCROP_POS;
+  }
+  if (*spec == 'x' || *spec == 'X') {
+    /* fetch height */
+    spec++;
+    if (! jt_read_integer(&spec, &info->crop_height))
+      return FALSE;
+    info->crop_height_set = JCROP_POS;
+  }
+  if (*spec == '+' || *spec == '-') {
+    /* fetch xoffset */
+    info->crop_xoffset_set = (*spec == '-') ? JCROP_NEG : JCROP_POS;
+    spec++;
+    if (! jt_read_integer(&spec, &info->crop_xoffset))
+      return FALSE;
+  }
+  if (*spec == '+' || *spec == '-') {
+    /* fetch yoffset */
+    info->crop_yoffset_set = (*spec == '-') ? JCROP_NEG : JCROP_POS;
+    spec++;
+    if (! jt_read_integer(&spec, &info->crop_yoffset))
+      return FALSE;
+  }
+  /* We had better have gotten to the end of the string. */
+  if (*spec != '\0')
+    return FALSE;
+  info->crop = TRUE;
+  return TRUE;
+}
+
+/* Trim off any partial iMCUs on the indicated destination edge */
+
+LOCAL(void)
+trim_right_edge (jpeg_transform_info *info, JDIMENSION full_width)
+{
+  JDIMENSION MCU_cols;
+
+  MCU_cols = info->output_width / info->iMCU_sample_width;
+  if (MCU_cols > 0 && info->x_crop_offset + MCU_cols ==
+      full_width / info->iMCU_sample_width)
+    info->output_width = MCU_cols * info->iMCU_sample_width;
+}
+
+LOCAL(void)
+trim_bottom_edge (jpeg_transform_info *info, JDIMENSION full_height)
+{
+  JDIMENSION MCU_rows;
+
+  MCU_rows = info->output_height / info->iMCU_sample_height;
+  if (MCU_rows > 0 && info->y_crop_offset + MCU_rows ==
+      full_height / info->iMCU_sample_height)
+    info->output_height = MCU_rows * info->iMCU_sample_height;
+}
+
+/* Request any required workspace.
+ *
+ * This routine figures out the size that the output image will be
+ * (which implies that all the transform parameters must be set before
+ * it is called).
+ *
+ * We allocate the workspace virtual arrays from the source decompression
+ * object, so that all the arrays (both the original data and the workspace)
+ * will be taken into account while making memory management decisions.
+ * Hence, this routine must be called after jpeg_read_header (which reads
+ * the image dimensions) and before jpeg_read_coefficients (which realizes
+ * the source's virtual arrays).
+ *
+ * This function returns FALSE right away if -perfect is given
+ * and transformation is not perfect.  Otherwise returns TRUE.
+ */
+
+GLOBAL(boolean)
+jtransform_request_workspace (j_decompress_ptr srcinfo,
+			      jpeg_transform_info *info)
+{
+  jvirt_barray_ptr *coef_arrays;
+  boolean need_workspace, transpose_it;
+  jpeg_component_info *compptr;
+  JDIMENSION xoffset, yoffset;
+  JDIMENSION width_in_iMCUs, height_in_iMCUs;
+  JDIMENSION width_in_blocks, height_in_blocks;
+  int ci, h_samp_factor, v_samp_factor;
+
+  /* Determine number of components in output image */
+  if (info->force_grayscale &&
+      srcinfo->jpeg_color_space == JCS_YCbCr &&
+      srcinfo->num_components == 3)
+    /* We'll only process the first component */
+    info->num_components = 1;
+  else
+    /* Process all the components */
+    info->num_components = srcinfo->num_components;
+
+  /* Compute output image dimensions and related values. */
+  jpeg_core_output_dimensions(srcinfo);
+
+  /* Return right away if -perfect is given and transformation is not perfect.
+   */
+  if (info->perfect) {
+    if (info->num_components == 1) {
+      if (!jtransform_perfect_transform(srcinfo->output_width,
+	  srcinfo->output_height,
+	  srcinfo->min_DCT_h_scaled_size,
+	  srcinfo->min_DCT_v_scaled_size,
+	  info->transform))
+	return FALSE;
+    } else {
+      if (!jtransform_perfect_transform(srcinfo->output_width,
+	  srcinfo->output_height,
+	  srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size,
+	  srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size,
+	  info->transform))
+	return FALSE;
+    }
+  }
+
+  /* If there is only one output component, force the iMCU size to be 1;
+   * else use the source iMCU size.  (This allows us to do the right thing
+   * when reducing color to grayscale, and also provides a handy way of
+   * cleaning up "funny" grayscale images whose sampling factors are not 1x1.)
+   */
+  switch (info->transform) {
+  case JXFORM_TRANSPOSE:
+  case JXFORM_TRANSVERSE:
+  case JXFORM_ROT_90:
+  case JXFORM_ROT_270:
+    info->output_width = srcinfo->output_height;
+    info->output_height = srcinfo->output_width;
+    if (info->num_components == 1) {
+      info->iMCU_sample_width = srcinfo->min_DCT_v_scaled_size;
+      info->iMCU_sample_height = srcinfo->min_DCT_h_scaled_size;
+    } else {
+      info->iMCU_sample_width =
+	srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size;
+      info->iMCU_sample_height =
+	srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size;
+    }
+    break;
+  default:
+    info->output_width = srcinfo->output_width;
+    info->output_height = srcinfo->output_height;
+    if (info->num_components == 1) {
+      info->iMCU_sample_width = srcinfo->min_DCT_h_scaled_size;
+      info->iMCU_sample_height = srcinfo->min_DCT_v_scaled_size;
+    } else {
+      info->iMCU_sample_width =
+	srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size;
+      info->iMCU_sample_height =
+	srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size;
+    }
+    break;
+  }
+
+  /* If cropping has been requested, compute the crop area's position and
+   * dimensions, ensuring that its upper left corner falls at an iMCU boundary.
+   */
+  if (info->crop) {
+    /* Insert default values for unset crop parameters */
+    if (info->crop_xoffset_set == JCROP_UNSET)
+      info->crop_xoffset = 0;	/* default to +0 */
+    if (info->crop_yoffset_set == JCROP_UNSET)
+      info->crop_yoffset = 0;	/* default to +0 */
+    if (info->crop_xoffset >= info->output_width ||
+	info->crop_yoffset >= info->output_height)
+      ERREXIT(srcinfo, JERR_BAD_CROP_SPEC);
+    if (info->crop_width_set == JCROP_UNSET)
+      info->crop_width = info->output_width - info->crop_xoffset;
+    if (info->crop_height_set == JCROP_UNSET)
+      info->crop_height = info->output_height - info->crop_yoffset;
+    /* Ensure parameters are valid */
+    if (info->crop_width <= 0 || info->crop_width > info->output_width ||
+	info->crop_height <= 0 || info->crop_height > info->output_height ||
+	info->crop_xoffset > info->output_width - info->crop_width ||
+	info->crop_yoffset > info->output_height - info->crop_height)
+      ERREXIT(srcinfo, JERR_BAD_CROP_SPEC);
+    /* Convert negative crop offsets into regular offsets */
+    if (info->crop_xoffset_set == JCROP_NEG)
+      xoffset = info->output_width - info->crop_width - info->crop_xoffset;
+    else
+      xoffset = info->crop_xoffset;
+    if (info->crop_yoffset_set == JCROP_NEG)
+      yoffset = info->output_height - info->crop_height - info->crop_yoffset;
+    else
+      yoffset = info->crop_yoffset;
+    /* Now adjust so that upper left corner falls at an iMCU boundary */
+    info->output_width =
+      info->crop_width + (xoffset % info->iMCU_sample_width);
+    info->output_height =
+      info->crop_height + (yoffset % info->iMCU_sample_height);
+    /* Save x/y offsets measured in iMCUs */
+    info->x_crop_offset = xoffset / info->iMCU_sample_width;
+    info->y_crop_offset = yoffset / info->iMCU_sample_height;
+  } else {
+    info->x_crop_offset = 0;
+    info->y_crop_offset = 0;
+  }
+
+  /* Figure out whether we need workspace arrays,
+   * and if so whether they are transposed relative to the source.
+   */
+  need_workspace = FALSE;
+  transpose_it = FALSE;
+  switch (info->transform) {
+  case JXFORM_NONE:
+    if (info->x_crop_offset != 0 || info->y_crop_offset != 0)
+      need_workspace = TRUE;
+    /* No workspace needed if neither cropping nor transforming */
+    break;
+  case JXFORM_FLIP_H:
+    if (info->trim)
+      trim_right_edge(info, srcinfo->output_width);
+    if (info->y_crop_offset != 0)
+      need_workspace = TRUE;
+    /* do_flip_h_no_crop doesn't need a workspace array */
+    break;
+  case JXFORM_FLIP_V:
+    if (info->trim)
+      trim_bottom_edge(info, srcinfo->output_height);
+    /* Need workspace arrays having same dimensions as source image. */
+    need_workspace = TRUE;
+    break;
+  case JXFORM_TRANSPOSE:
+    /* transpose does NOT have to trim anything */
+    /* Need workspace arrays having transposed dimensions. */
+    need_workspace = TRUE;
+    transpose_it = TRUE;
+    break;
+  case JXFORM_TRANSVERSE:
+    if (info->trim) {
+      trim_right_edge(info, srcinfo->output_height);
+      trim_bottom_edge(info, srcinfo->output_width);
+    }
+    /* Need workspace arrays having transposed dimensions. */
+    need_workspace = TRUE;
+    transpose_it = TRUE;
+    break;
+  case JXFORM_ROT_90:
+    if (info->trim)
+      trim_right_edge(info, srcinfo->output_height);
+    /* Need workspace arrays having transposed dimensions. */
+    need_workspace = TRUE;
+    transpose_it = TRUE;
+    break;
+  case JXFORM_ROT_180:
+    if (info->trim) {
+      trim_right_edge(info, srcinfo->output_width);
+      trim_bottom_edge(info, srcinfo->output_height);
+    }
+    /* Need workspace arrays having same dimensions as source image. */
+    need_workspace = TRUE;
+    break;
+  case JXFORM_ROT_270:
+    if (info->trim)
+      trim_bottom_edge(info, srcinfo->output_width);
+    /* Need workspace arrays having transposed dimensions. */
+    need_workspace = TRUE;
+    transpose_it = TRUE;
+    break;
+  }
+
+  /* Allocate workspace if needed.
+   * Note that we allocate arrays padded out to the next iMCU boundary,
+   * so that transform routines need not worry about missing edge blocks.
+   */
+  if (need_workspace) {
+    coef_arrays = (jvirt_barray_ptr *)
+      (*srcinfo->mem->alloc_small) ((j_common_ptr) srcinfo, JPOOL_IMAGE,
+		sizeof(jvirt_barray_ptr) * info->num_components);
+    width_in_iMCUs = (JDIMENSION)
+      jdiv_round_up((long) info->output_width,
+		    (long) info->iMCU_sample_width);
+    height_in_iMCUs = (JDIMENSION)
+      jdiv_round_up((long) info->output_height,
+		    (long) info->iMCU_sample_height);
+    for (ci = 0; ci < info->num_components; ci++) {
+      compptr = srcinfo->comp_info + ci;
+      if (info->num_components == 1) {
+	/* we're going to force samp factors to 1x1 in this case */
+	h_samp_factor = v_samp_factor = 1;
+      } else if (transpose_it) {
+	h_samp_factor = compptr->v_samp_factor;
+	v_samp_factor = compptr->h_samp_factor;
+      } else {
+	h_samp_factor = compptr->h_samp_factor;
+	v_samp_factor = compptr->v_samp_factor;
+      }
+      width_in_blocks = width_in_iMCUs * h_samp_factor;
+      height_in_blocks = height_in_iMCUs * v_samp_factor;
+      coef_arrays[ci] = (*srcinfo->mem->request_virt_barray)
+	((j_common_ptr) srcinfo, JPOOL_IMAGE, FALSE,
+	 width_in_blocks, height_in_blocks, (JDIMENSION) v_samp_factor);
+    }
+    info->workspace_coef_arrays = coef_arrays;
+  } else
+    info->workspace_coef_arrays = NULL;
+
+  return TRUE;
+}
+
+/* Transpose destination image parameters */
+
+LOCAL(void)
+transpose_critical_parameters (j_compress_ptr dstinfo)
+{
+  int tblno, i, j, ci, itemp;
+  jpeg_component_info *compptr;
+  JQUANT_TBL *qtblptr;
+  JDIMENSION jtemp;
+  UINT16 qtemp;
+
+  /* Transpose image dimensions */
+  jtemp = dstinfo->image_width;
+  dstinfo->image_width = dstinfo->image_height;
+  dstinfo->image_height = jtemp;
+  itemp = dstinfo->min_DCT_h_scaled_size;
+  dstinfo->min_DCT_h_scaled_size = dstinfo->min_DCT_v_scaled_size;
+  dstinfo->min_DCT_v_scaled_size = itemp;
+
+  /* Transpose sampling factors */
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    itemp = compptr->h_samp_factor;
+    compptr->h_samp_factor = compptr->v_samp_factor;
+    compptr->v_samp_factor = itemp;
+  }
+
+  /* Transpose quantization tables */
+  for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {
+    qtblptr = dstinfo->quant_tbl_ptrs[tblno];
+    if (qtblptr != NULL) {
+      for (i = 0; i < DCTSIZE; i++) {
+	for (j = 0; j < i; j++) {
+	  qtemp = qtblptr->quantval[i*DCTSIZE+j];
+	  qtblptr->quantval[i*DCTSIZE+j] = qtblptr->quantval[j*DCTSIZE+i];
+	  qtblptr->quantval[j*DCTSIZE+i] = qtemp;
+	}
+      }
+    }
+  }
+}
+
+/* Adjust Exif image parameters.
+ *
+ * We try to adjust the Tags ExifImageWidth and ExifImageHeight if possible.
+ */
+
+LOCAL(void)
+adjust_exif_parameters (JOCTET FAR * data, unsigned int length,
+			JDIMENSION new_width, JDIMENSION new_height)
+{
+  boolean is_motorola; /* Flag for byte order */
+  unsigned int number_of_tags, tagnum;
+  unsigned int firstoffset, offset;
+  JDIMENSION new_value;
+
+  if (length < 12) return; /* Length of an IFD entry */
+
+  /* Discover byte order */
+  if (GETJOCTET(data[0]) == 0x49 && GETJOCTET(data[1]) == 0x49)
+    is_motorola = FALSE;
+  else if (GETJOCTET(data[0]) == 0x4D && GETJOCTET(data[1]) == 0x4D)
+    is_motorola = TRUE;
+  else
+    return;
+
+  /* Check Tag Mark */
+  if (is_motorola) {
+    if (GETJOCTET(data[2]) != 0) return;
+    if (GETJOCTET(data[3]) != 0x2A) return;
+  } else {
+    if (GETJOCTET(data[3]) != 0) return;
+    if (GETJOCTET(data[2]) != 0x2A) return;
+  }
+
+  /* Get first IFD offset (offset to IFD0) */
+  if (is_motorola) {
+    if (GETJOCTET(data[4]) != 0) return;
+    if (GETJOCTET(data[5]) != 0) return;
+    firstoffset = GETJOCTET(data[6]);
+    firstoffset <<= 8;
+    firstoffset += GETJOCTET(data[7]);
+  } else {
+    if (GETJOCTET(data[7]) != 0) return;
+    if (GETJOCTET(data[6]) != 0) return;
+    firstoffset = GETJOCTET(data[5]);
+    firstoffset <<= 8;
+    firstoffset += GETJOCTET(data[4]);
+  }
+  if (firstoffset > length - 2) return; /* check end of data segment */
+
+  /* Get the number of directory entries contained in this IFD */
+  if (is_motorola) {
+    number_of_tags = GETJOCTET(data[firstoffset]);
+    number_of_tags <<= 8;
+    number_of_tags += GETJOCTET(data[firstoffset+1]);
+  } else {
+    number_of_tags = GETJOCTET(data[firstoffset+1]);
+    number_of_tags <<= 8;
+    number_of_tags += GETJOCTET(data[firstoffset]);
+  }
+  if (number_of_tags == 0) return;
+  firstoffset += 2;
+
+  /* Search for ExifSubIFD offset Tag in IFD0 */
+  for (;;) {
+    if (firstoffset > length - 12) return; /* check end of data segment */
+    /* Get Tag number */
+    if (is_motorola) {
+      tagnum = GETJOCTET(data[firstoffset]);
+      tagnum <<= 8;
+      tagnum += GETJOCTET(data[firstoffset+1]);
+    } else {
+      tagnum = GETJOCTET(data[firstoffset+1]);
+      tagnum <<= 8;
+      tagnum += GETJOCTET(data[firstoffset]);
+    }
+    if (tagnum == 0x8769) break; /* found ExifSubIFD offset Tag */
+    if (--number_of_tags == 0) return;
+    firstoffset += 12;
+  }
+
+  /* Get the ExifSubIFD offset */
+  if (is_motorola) {
+    if (GETJOCTET(data[firstoffset+8]) != 0) return;
+    if (GETJOCTET(data[firstoffset+9]) != 0) return;
+    offset = GETJOCTET(data[firstoffset+10]);
+    offset <<= 8;
+    offset += GETJOCTET(data[firstoffset+11]);
+  } else {
+    if (GETJOCTET(data[firstoffset+11]) != 0) return;
+    if (GETJOCTET(data[firstoffset+10]) != 0) return;
+    offset = GETJOCTET(data[firstoffset+9]);
+    offset <<= 8;
+    offset += GETJOCTET(data[firstoffset+8]);
+  }
+  if (offset > length - 2) return; /* check end of data segment */
+
+  /* Get the number of directory entries contained in this SubIFD */
+  if (is_motorola) {
+    number_of_tags = GETJOCTET(data[offset]);
+    number_of_tags <<= 8;
+    number_of_tags += GETJOCTET(data[offset+1]);
+  } else {
+    number_of_tags = GETJOCTET(data[offset+1]);
+    number_of_tags <<= 8;
+    number_of_tags += GETJOCTET(data[offset]);
+  }
+  if (number_of_tags < 2) return;
+  offset += 2;
+
+  /* Search for ExifImageWidth and ExifImageHeight Tags in this SubIFD */
+  do {
+    if (offset > length - 12) return; /* check end of data segment */
+    /* Get Tag number */
+    if (is_motorola) {
+      tagnum = GETJOCTET(data[offset]);
+      tagnum <<= 8;
+      tagnum += GETJOCTET(data[offset+1]);
+    } else {
+      tagnum = GETJOCTET(data[offset+1]);
+      tagnum <<= 8;
+      tagnum += GETJOCTET(data[offset]);
+    }
+    if (tagnum == 0xA002 || tagnum == 0xA003) {
+      if (tagnum == 0xA002)
+	new_value = new_width; /* ExifImageWidth Tag */
+      else
+	new_value = new_height; /* ExifImageHeight Tag */
+      if (is_motorola) {
+	data[offset+2] = 0; /* Format = unsigned long (4 octets) */
+	data[offset+3] = 4;
+	data[offset+4] = 0; /* Number Of Components = 1 */
+	data[offset+5] = 0;
+	data[offset+6] = 0;
+	data[offset+7] = 1;
+	data[offset+8] = 0;
+	data[offset+9] = 0;
+	data[offset+10] = (JOCTET)((new_value >> 8) & 0xFF);
+	data[offset+11] = (JOCTET)(new_value & 0xFF);
+      } else {
+	data[offset+2] = 4; /* Format = unsigned long (4 octets) */
+	data[offset+3] = 0;
+	data[offset+4] = 1; /* Number Of Components = 1 */
+	data[offset+5] = 0;
+	data[offset+6] = 0;
+	data[offset+7] = 0;
+	data[offset+8] = (JOCTET)(new_value & 0xFF);
+	data[offset+9] = (JOCTET)((new_value >> 8) & 0xFF);
+	data[offset+10] = 0;
+	data[offset+11] = 0;
+      }
+    }
+    offset += 12;
+  } while (--number_of_tags);
+}
+
+/* Adjust output image parameters as needed.
+ *
+ * This must be called after jpeg_copy_critical_parameters()
+ * and before jpeg_write_coefficients().
+ *
+ * The return value is the set of virtual coefficient arrays to be written
+ * (either the ones allocated by jtransform_request_workspace, or the
+ * original source data arrays).  The caller will need to pass this value
+ * to jpeg_write_coefficients().
+ */
+
+GLOBAL(jvirt_barray_ptr *)
+jtransform_adjust_parameters (j_decompress_ptr srcinfo,
+			      j_compress_ptr dstinfo,
+			      jvirt_barray_ptr *src_coef_arrays,
+			      jpeg_transform_info *info)
+{
+  /* If force-to-grayscale is requested, adjust destination parameters */
+  if (info->force_grayscale) {
+    /* First, ensure we have YCbCr or grayscale data, and that the source's
+     * Y channel is full resolution.  (No reasonable person would make Y
+     * be less than full resolution, so actually coping with that case
+     * isn't worth extra code space.  But we check it to avoid crashing.)
+     */
+    if (((dstinfo->jpeg_color_space == JCS_YCbCr &&
+	  dstinfo->num_components == 3) ||
+	 (dstinfo->jpeg_color_space == JCS_GRAYSCALE &&
+	  dstinfo->num_components == 1)) &&
+	srcinfo->comp_info[0].h_samp_factor == srcinfo->max_h_samp_factor &&
+	srcinfo->comp_info[0].v_samp_factor == srcinfo->max_v_samp_factor) {
+      /* We use jpeg_set_colorspace to make sure subsidiary settings get fixed
+       * properly.  Among other things, it sets the target h_samp_factor &
+       * v_samp_factor to 1, which typically won't match the source.
+       * We have to preserve the source's quantization table number, however.
+       */
+      int sv_quant_tbl_no = dstinfo->comp_info[0].quant_tbl_no;
+      jpeg_set_colorspace(dstinfo, JCS_GRAYSCALE);
+      dstinfo->comp_info[0].quant_tbl_no = sv_quant_tbl_no;
+    } else {
+      /* Sorry, can't do it */
+      ERREXIT(dstinfo, JERR_CONVERSION_NOTIMPL);
+    }
+  } else if (info->num_components == 1) {
+    /* For a single-component source, we force the destination sampling factors
+     * to 1x1, with or without force_grayscale.  This is useful because some
+     * decoders choke on grayscale images with other sampling factors.
+     */
+    dstinfo->comp_info[0].h_samp_factor = 1;
+    dstinfo->comp_info[0].v_samp_factor = 1;
+  }
+
+  /* Correct the destination's image dimensions as necessary
+   * for rotate/flip, resize, and crop operations.
+   */
+  dstinfo->jpeg_width = info->output_width;
+  dstinfo->jpeg_height = info->output_height;
+
+  /* Transpose destination image parameters */
+  switch (info->transform) {
+  case JXFORM_TRANSPOSE:
+  case JXFORM_TRANSVERSE:
+  case JXFORM_ROT_90:
+  case JXFORM_ROT_270:
+    transpose_critical_parameters(dstinfo);
+    break;
+  default:
+    break;
+  }
+
+  /* Adjust Exif properties */
+  if (srcinfo->marker_list != NULL &&
+      srcinfo->marker_list->marker == JPEG_APP0+1 &&
+      srcinfo->marker_list->data_length >= 6 &&
+      GETJOCTET(srcinfo->marker_list->data[0]) == 0x45 &&
+      GETJOCTET(srcinfo->marker_list->data[1]) == 0x78 &&
+      GETJOCTET(srcinfo->marker_list->data[2]) == 0x69 &&
+      GETJOCTET(srcinfo->marker_list->data[3]) == 0x66 &&
+      GETJOCTET(srcinfo->marker_list->data[4]) == 0 &&
+      GETJOCTET(srcinfo->marker_list->data[5]) == 0) {
+    /* Suppress output of JFIF marker */
+    dstinfo->write_JFIF_header = FALSE;
+    /* Adjust Exif image parameters */
+    if (dstinfo->jpeg_width != srcinfo->image_width ||
+	dstinfo->jpeg_height != srcinfo->image_height)
+      /* Align data segment to start of TIFF structure for parsing */
+      adjust_exif_parameters(srcinfo->marker_list->data + 6,
+	srcinfo->marker_list->data_length - 6,
+	dstinfo->jpeg_width, dstinfo->jpeg_height);
+  }
+
+  /* Return the appropriate output data set */
+  if (info->workspace_coef_arrays != NULL)
+    return info->workspace_coef_arrays;
+  return src_coef_arrays;
+}
+
+/* Execute the actual transformation, if any.
+ *
+ * This must be called *after* jpeg_write_coefficients, because it depends
+ * on jpeg_write_coefficients to have computed subsidiary values such as
+ * the per-component width and height fields in the destination object.
+ *
+ * Note that some transformations will modify the source data arrays!
+ */
+
+GLOBAL(void)
+jtransform_execute_transform (j_decompress_ptr srcinfo,
+			      j_compress_ptr dstinfo,
+			      jvirt_barray_ptr *src_coef_arrays,
+			      jpeg_transform_info *info)
+{
+  jvirt_barray_ptr *dst_coef_arrays = info->workspace_coef_arrays;
+
+  /* Note: conditions tested here should match those in switch statement
+   * in jtransform_request_workspace()
+   */
+  switch (info->transform) {
+  case JXFORM_NONE:
+    if (info->x_crop_offset != 0 || info->y_crop_offset != 0)
+      do_crop(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
+	      src_coef_arrays, dst_coef_arrays);
+    break;
+  case JXFORM_FLIP_H:
+    if (info->y_crop_offset != 0)
+      do_flip_h(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
+		src_coef_arrays, dst_coef_arrays);
+    else
+      do_flip_h_no_crop(srcinfo, dstinfo, info->x_crop_offset,
+			src_coef_arrays);
+    break;
+  case JXFORM_FLIP_V:
+    do_flip_v(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
+	      src_coef_arrays, dst_coef_arrays);
+    break;
+  case JXFORM_TRANSPOSE:
+    do_transpose(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
+		 src_coef_arrays, dst_coef_arrays);
+    break;
+  case JXFORM_TRANSVERSE:
+    do_transverse(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
+		  src_coef_arrays, dst_coef_arrays);
+    break;
+  case JXFORM_ROT_90:
+    do_rot_90(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
+	      src_coef_arrays, dst_coef_arrays);
+    break;
+  case JXFORM_ROT_180:
+    do_rot_180(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
+	       src_coef_arrays, dst_coef_arrays);
+    break;
+  case JXFORM_ROT_270:
+    do_rot_270(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
+	       src_coef_arrays, dst_coef_arrays);
+    break;
+  }
+}
+
+/* jtransform_perfect_transform
+ *
+ * Determine whether lossless transformation is perfectly
+ * possible for a specified image and transformation.
+ *
+ * Inputs:
+ *   image_width, image_height: source image dimensions.
+ *   MCU_width, MCU_height: pixel dimensions of MCU.
+ *   transform: transformation identifier.
+ * Parameter sources from initialized jpeg_struct
+ * (after reading source header):
+ *   image_width = cinfo.image_width
+ *   image_height = cinfo.image_height
+ *   MCU_width = cinfo.max_h_samp_factor * cinfo.block_size
+ *   MCU_height = cinfo.max_v_samp_factor * cinfo.block_size
+ * Result:
+ *   TRUE = perfect transformation possible
+ *   FALSE = perfect transformation not possible
+ *           (may use custom action then)
+ */
+
+GLOBAL(boolean)
+jtransform_perfect_transform(JDIMENSION image_width, JDIMENSION image_height,
+			     int MCU_width, int MCU_height,
+			     JXFORM_CODE transform)
+{
+  boolean result = TRUE; /* initialize TRUE */
+
+  switch (transform) {
+  case JXFORM_FLIP_H:
+  case JXFORM_ROT_270:
+    if (image_width % (JDIMENSION) MCU_width)
+      result = FALSE;
+    break;
+  case JXFORM_FLIP_V:
+  case JXFORM_ROT_90:
+    if (image_height % (JDIMENSION) MCU_height)
+      result = FALSE;
+    break;
+  case JXFORM_TRANSVERSE:
+  case JXFORM_ROT_180:
+    if (image_width % (JDIMENSION) MCU_width)
+      result = FALSE;
+    if (image_height % (JDIMENSION) MCU_height)
+      result = FALSE;
+    break;
+  default:
+    break;
+  }
+
+  return result;
+}
+
+#endif /* TRANSFORMS_SUPPORTED */
+
+/* Setup decompression object to save desired markers in memory.
+ * This must be called before jpeg_read_header() to have the desired effect.
+ */
+
+GLOBAL(void)
+jcopy_markers_setup (j_decompress_ptr srcinfo, JCOPY_OPTION option)
+{
+#ifdef SAVE_MARKERS_SUPPORTED
+  int m;
+
+  /* Save comments except under NONE option */
+  if (option != JCOPYOPT_NONE) {
+    jpeg_save_markers(srcinfo, JPEG_COM, 0xFFFF);
+  }
+  /* Save all types of APPn markers iff ALL option */
+  if (option == JCOPYOPT_ALL) {
+    for (m = 0; m < 16; m++)
+      jpeg_save_markers(srcinfo, JPEG_APP0 + m, 0xFFFF);
+  }
+#endif /* SAVE_MARKERS_SUPPORTED */
+}
+
+/* Copy markers saved in the given source object to the destination object.
+ * This should be called just after jpeg_start_compress() or
+ * jpeg_write_coefficients().
+ * Note that those routines will have written the SOI, and also the
+ * JFIF APP0 or Adobe APP14 markers if selected.
+ */
+
+GLOBAL(void)
+jcopy_markers_execute (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+		       JCOPY_OPTION option)
+{
+  jpeg_saved_marker_ptr marker;
+
+  /* In the current implementation, we don't actually need to examine the
+   * option flag here; we just copy everything that got saved.
+   * But to avoid confusion, we do not output JFIF and Adobe APP14 markers
+   * if the encoder library already wrote one.
+   */
+  for (marker = srcinfo->marker_list; marker != NULL; marker = marker->next) {
+    if (dstinfo->write_JFIF_header &&
+	marker->marker == JPEG_APP0 &&
+	marker->data_length >= 5 &&
+	GETJOCTET(marker->data[0]) == 0x4A &&
+	GETJOCTET(marker->data[1]) == 0x46 &&
+	GETJOCTET(marker->data[2]) == 0x49 &&
+	GETJOCTET(marker->data[3]) == 0x46 &&
+	GETJOCTET(marker->data[4]) == 0)
+      continue;			/* reject duplicate JFIF */
+    if (dstinfo->write_Adobe_marker &&
+	marker->marker == JPEG_APP0+14 &&
+	marker->data_length >= 5 &&
+	GETJOCTET(marker->data[0]) == 0x41 &&
+	GETJOCTET(marker->data[1]) == 0x64 &&
+	GETJOCTET(marker->data[2]) == 0x6F &&
+	GETJOCTET(marker->data[3]) == 0x62 &&
+	GETJOCTET(marker->data[4]) == 0x65)
+      continue;			/* reject duplicate Adobe */
+#ifdef NEED_FAR_POINTERS
+    /* We could use jpeg_write_marker if the data weren't FAR... */
+    {
+      unsigned int i;
+      jpeg_write_m_header(dstinfo, marker->marker, marker->data_length);
+      for (i = 0; i < marker->data_length; i++)
+	jpeg_write_m_byte(dstinfo, marker->data[i]);
+    }
+#else
+    jpeg_write_marker(dstinfo, marker->marker,
+		      marker->data, marker->data_length);
+#endif
+  }
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/12.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/12.html new file mode 100644 index 0000000..44be18c --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/12.html @@ -0,0 +1,659 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/*
+ * transupp.h
+ *
+ * Copyright (C) 1997-2009, Thomas G. Lane, Guido Vollbeding.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains declarations for image transformation routines and
+ * other utility code used by the jpegtran sample application.  These are
+ * NOT part of the core JPEG library.  But we keep these routines separate
+ * from jpegtran.c to ease the task of maintaining jpegtran-like programs
+ * that have other user interfaces.
+ *
+ * NOTE: all the routines declared here have very specific requirements
+ * about when they are to be executed during the reading and writing of the
+ * source and destination files.  See the comments in transupp.c, or see
+ * jpegtran.c for an example of correct usage.
+ */
+
+/* If you happen not to want the image transform support, disable it here */
+#ifndef TRANSFORMS_SUPPORTED
+#define TRANSFORMS_SUPPORTED 1		/* 0 disables transform code */
+#endif
+
+/*
+ * Although rotating and flipping data expressed as DCT coefficients is not
+ * hard, there is an asymmetry in the JPEG format specification for images
+ * whose dimensions aren't multiples of the iMCU size.  The right and bottom
+ * image edges are padded out to the next iMCU boundary with junk data; but
+ * no padding is possible at the top and left edges.  If we were to flip
+ * the whole image including the pad data, then pad garbage would become
+ * visible at the top and/or left, and real pixels would disappear into the
+ * pad margins --- perhaps permanently, since encoders & decoders may not
+ * bother to preserve DCT blocks that appear to be completely outside the
+ * nominal image area.  So, we have to exclude any partial iMCUs from the
+ * basic transformation.
+ *
+ * Transpose is the only transformation that can handle partial iMCUs at the
+ * right and bottom edges completely cleanly.  flip_h can flip partial iMCUs
+ * at the bottom, but leaves any partial iMCUs at the right edge untouched.
+ * Similarly flip_v leaves any partial iMCUs at the bottom edge untouched.
+ * The other transforms are defined as combinations of these basic transforms
+ * and process edge blocks in a way that preserves the equivalence.
+ *
+ * The "trim" option causes untransformable partial iMCUs to be dropped;
+ * this is not strictly lossless, but it usually gives the best-looking
+ * result for odd-size images.  Note that when this option is active,
+ * the expected mathematical equivalences between the transforms may not hold.
+ * (For example, -rot 270 -trim trims only the bottom edge, but -rot 90 -trim
+ * followed by -rot 180 -trim trims both edges.)
+ *
+ * We also offer a lossless-crop option, which discards data outside a given
+ * image region but losslessly preserves what is inside.  Like the rotate and
+ * flip transforms, lossless crop is restricted by the JPEG format: the upper
+ * left corner of the selected region must fall on an iMCU boundary.  If this
+ * does not hold for the given crop parameters, we silently move the upper left
+ * corner up and/or left to make it so, simultaneously increasing the region
+ * dimensions to keep the lower right crop corner unchanged.  (Thus, the
+ * output image covers at least the requested region, but may cover more.)
+ *
+ * We also provide a lossless-resize option, which is kind of a lossless-crop
+ * operation in the DCT coefficient block domain - it discards higher-order
+ * coefficients and losslessly preserves lower-order coefficients of a
+ * sub-block.
+ *
+ * Rotate/flip transform, resize, and crop can be requested together in a
+ * single invocation.  The crop is applied last --- that is, the crop region
+ * is specified in terms of the destination image after transform/resize.
+ *
+ * We also offer a "force to grayscale" option, which simply discards the
+ * chrominance channels of a YCbCr image.  This is lossless in the sense that
+ * the luminance channel is preserved exactly.  It's not the same kind of
+ * thing as the rotate/flip transformations, but it's convenient to handle it
+ * as part of this package, mainly because the transformation routines have to
+ * be aware of the option to know how many components to work on.
+ */
+
+#ifndef TRANSUPP_H
+#define TRANSUPP_H
+
+/* Short forms of external names for systems with brain-damaged linkers. */
+
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+#define jtransform_parse_crop_spec	jTrParCrop
+#define jtransform_request_workspace	jTrRequest
+#define jtransform_adjust_parameters	jTrAdjust
+#define jtransform_execute_transform	jTrExec
+#define jtransform_perfect_transform	jTrPerfect
+#define jcopy_markers_setup		jCMrkSetup
+#define jcopy_markers_execute		jCMrkExec
+#endif /* NEED_SHORT_EXTERNAL_NAMES */
+
+/*
+ * Codes for supported types of image transformations.
+ */
+
+typedef enum {
+	JXFORM_NONE,		/* no transformation */
+	JXFORM_FLIP_H,		/* horizontal flip */
+	JXFORM_FLIP_V,		/* vertical flip */
+	JXFORM_TRANSPOSE,	/* transpose across UL-to-LR axis */
+	JXFORM_TRANSVERSE,	/* transpose across UR-to-LL axis */
+	JXFORM_ROT_90,		/* 90-degree clockwise rotation */
+	JXFORM_ROT_180,		/* 180-degree rotation */
+	JXFORM_ROT_270		/* 270-degree clockwise (or 90 ccw) */
+} JXFORM_CODE;
+
+/*
+ * Codes for crop parameters, which can individually be unspecified,
+ * positive, or negative.  (Negative width or height makes no sense, though.)
+ */
+
+typedef enum {
+	JCROP_UNSET,
+	JCROP_POS,
+	JCROP_NEG
+} JCROP_CODE;
+
+/*
+ * Transform parameters struct.
+ * NB: application must not change any elements of this struct after
+ * calling jtransform_request_workspace.
+ */
+
+typedef struct {
+  /* Options: set by caller */
+  JXFORM_CODE transform;	/* image transform operator */
+  boolean perfect;		/* if TRUE, fail if partial MCUs are requested */
+  boolean trim;			/* if TRUE, trim partial MCUs as needed */
+  boolean force_grayscale;	/* if TRUE, convert color image to grayscale */
+  boolean crop;			/* if TRUE, crop source image */
+
+  /* Crop parameters: application need not set these unless crop is TRUE.
+   * These can be filled in by jtransform_parse_crop_spec().
+   */
+  JDIMENSION crop_width;	/* Width of selected region */
+  JCROP_CODE crop_width_set;
+  JDIMENSION crop_height;	/* Height of selected region */
+  JCROP_CODE crop_height_set;
+  JDIMENSION crop_xoffset;	/* X offset of selected region */
+  JCROP_CODE crop_xoffset_set;	/* (negative measures from right edge) */
+  JDIMENSION crop_yoffset;	/* Y offset of selected region */
+  JCROP_CODE crop_yoffset_set;	/* (negative measures from bottom edge) */
+
+  /* Internal workspace: caller should not touch these */
+  int num_components;		/* # of components in workspace */
+  jvirt_barray_ptr * workspace_coef_arrays; /* workspace for transformations */
+  JDIMENSION output_width;	/* cropped destination dimensions */
+  JDIMENSION output_height;
+  JDIMENSION x_crop_offset;	/* destination crop offsets measured in iMCUs */
+  JDIMENSION y_crop_offset;
+  int iMCU_sample_width;	/* destination iMCU size */
+  int iMCU_sample_height;
+} jpeg_transform_info;
+
+#if TRANSFORMS_SUPPORTED
+
+/* Parse a crop specification (written in X11 geometry style) */
+EXTERN(boolean) jtransform_parse_crop_spec<--- There is an unknown macro here somewhere. Configuration is required. If EXTERN is a macro then please configure it.
+	JPP((jpeg_transform_info *info, const char *spec));
+/* Request any required workspace */
+EXTERN(boolean) jtransform_request_workspace
+	JPP((j_decompress_ptr srcinfo, jpeg_transform_info *info));
+/* Adjust output image parameters */
+EXTERN(jvirt_barray_ptr *) jtransform_adjust_parameters
+	JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	     jvirt_barray_ptr *src_coef_arrays,
+	     jpeg_transform_info *info));
+/* Execute the actual transformation, if any */
+EXTERN(void) jtransform_execute_transform
+	JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	     jvirt_barray_ptr *src_coef_arrays,
+	     jpeg_transform_info *info));
+/* Determine whether lossless transformation is perfectly
+ * possible for a specified image and transformation.
+ */
+EXTERN(boolean) jtransform_perfect_transform
+	JPP((JDIMENSION image_width, JDIMENSION image_height,
+	     int MCU_width, int MCU_height,
+	     JXFORM_CODE transform));
+
+/* jtransform_execute_transform used to be called
+ * jtransform_execute_transformation, but some compilers complain about
+ * routine names that long.  This macro is here to avoid breaking any
+ * old source code that uses the original name...
+ */
+#define jtransform_execute_transformation	jtransform_execute_transform
+
+#endif /* TRANSFORMS_SUPPORTED */
+
+/*
+ * Support for copying optional markers from source to destination file.
+ */
+
+typedef enum {
+	JCOPYOPT_NONE,		/* copy no optional markers */
+	JCOPYOPT_COMMENTS,	/* copy only comment (COM) markers */
+	JCOPYOPT_ALL		/* copy all optional markers */
+} JCOPY_OPTION;
+
+#define JCOPYOPT_DEFAULT  JCOPYOPT_COMMENTS	/* recommended default */
+
+/* Setup decompression object to save desired markers in memory */
+EXTERN(void) jcopy_markers_setup
+	JPP((j_decompress_ptr srcinfo, JCOPY_OPTION option));
+/* Copy markers saved in the given source object to the destination object */
+EXTERN(void) jcopy_markers_execute
+	JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	     JCOPY_OPTION option));
+
+#endif /* TRANSUPP_H */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/13.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/13.html new file mode 100644 index 0000000..77afe51 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/13.html @@ -0,0 +1,365 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
#ifndef __EOM_FULLSCREEN_PLUGIN_H__
+#define __EOM_FULLSCREEN_PLUGIN_H__
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libpeas/peas-extension-base.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libpeas/peas-object-module.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <eom-window.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+/*
+ * Type checking and casting macros
+ */
+#define EOM_TYPE_FULLSCREEN_PLUGIN \
+	(eom_fullscreen_plugin_get_type())
+#define EOM_FULLSCREEN_PLUGIN(o) \
+	(G_TYPE_CHECK_INSTANCE_CAST((o), EOM_TYPE_FULLSCREEN_PLUGIN, EomFullscreenPlugin))
+#define EOM_FULLSCREEN_PLUGIN_CLASS(k) \
+	G_TYPE_CHECK_CLASS_CAST((k), EOM_TYPE_FULLSCREEN_PLUGIN, EomFullscreenPluginClass))
+#define EOM_IS_FULLSCREEN_PLUGIN(o) \
+	(G_TYPE_CHECK_INSTANCE_TYPE((o), EOM_TYPE_FULLSCREEN_PLUGIN))
+#define EOM_IS_FULLSCREEN_PLUGIN_CLASS(k) \
+	(G_TYPE_CHECK_CLASS_TYPE((k), EOM_TYPE_FULLSCREEN_PLUGIN))
+#define EOM_FULLSCREEN_PLUGIN_GET_CLASS(o) \
+	(G_TYPE_INSTANCE_GET_CLASS((o), EOM_TYPE_FULLSCREEN_PLUGIN, EomFullscreenPluginClass))
+
+/* Private structure type */
+typedef struct _EomFullscreenPluginPrivate EomFullscreenPluginPrivate;
+
+/*
+ * Main object structure
+ */
+typedef struct _EomFullscreenPlugin EomFullscreenPlugin;
+
+struct _EomFullscreenPlugin {
+	PeasExtensionBase parent_instance;
+
+	EomWindow *window;
+	gulong signal_id;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _EomFullscreenPluginClass EomFullscreenPluginClass;
+
+struct _EomFullscreenPluginClass {
+	PeasExtensionBaseClass parent_class;
+};
+
+/*
+ * Public methods
+ */
+GType eom_fullscreen_plugin_get_type (void) G_GNUC_CONST;
+
+/* All the plugins must implement this function */
+G_MODULE_EXPORT void peas_register_types (PeasObjectModule *module);
+
+G_END_DECLS
+
+#endif /* __EOM_FULLSCREEN_PLUGIN_H__ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/14.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/14.html new file mode 100644 index 0000000..8058618 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/14.html @@ -0,0 +1,587 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include "eom-fullscreen-plugin.h"
+
+#include <gmodule.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libpeas/peas-activatable.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <eom-debug.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <eom-window.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <eom-window-activatable.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+static void eom_window_activatable_iface_init (EomWindowActivatableInterface *iface);
+
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (EomFullscreenPlugin,
+                                eom_fullscreen_plugin,
+                                PEAS_TYPE_EXTENSION_BASE,
+                                0,
+                                G_IMPLEMENT_INTERFACE_DYNAMIC (EOM_TYPE_WINDOW_ACTIVATABLE,
+                                                               eom_window_activatable_iface_init))
+
+enum {
+	PROP_0,
+	PROP_WINDOW
+};
+
+static gboolean
+on_button_press (GtkWidget      *button,
+                 GdkEventButton *event,<--- Parameter 'event' can be declared as pointer to const
+                 EomWindow      *window)
+{
+	if (event->button == 1 && event->type == GDK_2BUTTON_PRESS)
+	{
+		EomWindowMode mode = eom_window_get_mode (window);
+
+		if (mode == EOM_WINDOW_MODE_SLIDESHOW || mode == EOM_WINDOW_MODE_FULLSCREEN)
+		{
+			eom_window_set_mode (window, EOM_WINDOW_MODE_NORMAL);
+		}
+		else if (mode == EOM_WINDOW_MODE_NORMAL)
+		{
+			eom_window_set_mode (window, EOM_WINDOW_MODE_FULLSCREEN);
+		}
+
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+static void
+eom_fullscreen_plugin_set_property (GObject      *object,
+                                    guint         prop_id,
+                                    const GValue *value,
+                                    GParamSpec   *pspec)
+{
+	EomFullscreenPlugin *plugin = EOM_FULLSCREEN_PLUGIN (object);
+
+	switch (prop_id)
+	{
+	case PROP_WINDOW:
+		plugin->window = EOM_WINDOW (g_value_dup_object (value));
+		break;
+
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+		break;
+	}
+}
+
+static void
+eom_fullscreen_plugin_get_property (GObject    *object,
+                                    guint       prop_id,
+                                    GValue     *value,
+                                    GParamSpec *pspec)
+{
+	EomFullscreenPlugin *plugin = EOM_FULLSCREEN_PLUGIN (object);
+
+	switch (prop_id)
+	{
+	case PROP_WINDOW:
+		g_value_set_object (value, plugin->window);
+		break;
+
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+		break;
+	}
+}
+
+static void
+eom_fullscreen_plugin_init (EomFullscreenPlugin *plugin)
+{
+	eom_debug_message (DEBUG_PLUGINS, "EomFullscreenPlugin initializing");
+}
+
+static void
+eom_fullscreen_plugin_dispose (GObject *object)
+{
+	EomFullscreenPlugin *plugin = EOM_FULLSCREEN_PLUGIN (object);
+
+	eom_debug_message (DEBUG_PLUGINS, "EomFullscreenPlugin disposing");
+
+	if (plugin->window != NULL) {
+		g_object_unref (plugin->window);
+		plugin->window = NULL;
+	}
+
+	G_OBJECT_CLASS (eom_fullscreen_plugin_parent_class)->dispose (object);
+}
+
+static void
+eom_fullscreen_plugin_activate (EomWindowActivatable *activatable)
+{
+	EomFullscreenPlugin *plugin = EOM_FULLSCREEN_PLUGIN (activatable);
+	GtkWidget *view = eom_window_get_view (plugin->window);
+
+	eom_debug (DEBUG_PLUGINS);
+
+	plugin->signal_id = g_signal_connect (view, "button-press-event",
+	                                      G_CALLBACK (on_button_press),<--- You might need to cast the function pointer here
+	                                      plugin->window);
+}
+
+static void
+eom_fullscreen_plugin_deactivate (EomWindowActivatable *activatable)
+{
+	EomFullscreenPlugin *plugin = EOM_FULLSCREEN_PLUGIN (activatable);
+	GtkWidget *view = eom_window_get_view (plugin->window);
+
+#if GLIB_CHECK_VERSION(2,62,0)
+	g_clear_signal_handler (&plugin->signal_id, view);
+#else
+	if (plugin->signal_id != 0) {
+		g_signal_handler_disconnect (view, plugin->signal_id);
+		plugin->signal_id = 0;
+	}
+#endif
+}
+
+static void
+eom_fullscreen_plugin_class_init (EomFullscreenPluginClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	object_class->dispose = eom_fullscreen_plugin_dispose;
+	object_class->set_property = eom_fullscreen_plugin_set_property;
+	object_class->get_property = eom_fullscreen_plugin_get_property;
+
+	g_object_class_override_property (object_class, PROP_WINDOW, "window");
+}
+
+static void
+eom_fullscreen_plugin_class_finalize (EomFullscreenPluginClass *klass)
+{
+	/* dummy function - used by G_DEFINE_DYNAMIC_TYPE_EXTENDED */
+}
+
+static void
+eom_window_activatable_iface_init (EomWindowActivatableInterface *iface)
+{
+	iface->activate = eom_fullscreen_plugin_activate;
+	iface->deactivate = eom_fullscreen_plugin_deactivate;
+}
+
+G_MODULE_EXPORT void
+peas_register_types (PeasObjectModule *module)
+{
+	eom_fullscreen_plugin_register_type (G_TYPE_MODULE (module));
+	peas_object_module_register_extension_type (module,
+	                                            EOM_TYPE_WINDOW_ACTIVATABLE,
+	                                            EOM_TYPE_FULLSCREEN_PLUGIN);
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/15.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/15.html new file mode 100644 index 0000000..4170364 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/15.html @@ -0,0 +1,367 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
#ifndef __EOM_RELOAD_PLUGIN_H__
+#define __EOM_RELOAD_PLUGIN_H__
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libpeas/peas-extension-base.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libpeas/peas-object-module.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <eom-window.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+/*
+ * Type checking and casting macros
+ */
+#define EOM_TYPE_RELOAD_PLUGIN \
+	(eom_reload_plugin_get_type())
+#define EOM_RELOAD_PLUGIN(o) \
+	(G_TYPE_CHECK_INSTANCE_CAST((o), EOM_TYPE_RELOAD_PLUGIN, EomReloadPlugin))
+#define EOM_RELOAD_PLUGIN_CLASS(k) \
+	(G_TYPE_CHECK_CLASS_CAST((k), EOM_TYPE_RELOAD_PLUGIN, EomReloadPluginClass))
+#define EOM_IS_RELOAD_PLUGIN(o) \
+	(G_TYPE_CHECK_INSTANCE_TYPE((o), EOM_TYPE_RELOAD_PLUGIN))
+#define EOM_IS_RELOAD_PLUGIN_CLASS(k) \
+	(G_TYPE_CHECK_CLASS_TYPE((k), EOM_TYPE_RELOAD_PLUGIN))
+#define EOM_RELOAD_PLUGIN_GET_CLASS(o) \
+	(G_TYPE_INSTANCE_GET_CLASS((o), EOM_TYPE_RELOAD_PLUGIN, EomReloadPluginClass))
+
+/* Private structure type */
+typedef struct _EomReloadPluginPrivate EomReloadPluginPrivate;
+
+/*
+ * Main object structure
+ */
+typedef struct _EomReloadPlugin EomReloadPlugin;
+
+struct _EomReloadPlugin {
+	PeasExtensionBase parent_instance;
+
+	EomWindow *window;
+	GtkActionGroup *ui_action_group;
+	guint ui_id;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _EomReloadPluginClass EomReloadPluginClass;
+
+struct _EomReloadPluginClass {
+	PeasExtensionBaseClass parent_class;
+};
+
+/*
+ * Public methods
+ */
+GType eom_reload_plugin_get_type (void) G_GNUC_CONST;
+
+/* All the plugins must implement this function */
+G_MODULE_EXPORT void peas_register_types (PeasObjectModule *module);
+
+G_END_DECLS
+
+#endif /* __EOM_RELOAD_PLUGIN_H__ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/16.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/16.html new file mode 100644 index 0000000..27fcacb --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/16.html @@ -0,0 +1,607 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include "eom-reload-plugin.h"
+
+#include <gmodule.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libpeas/peas-activatable.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <eom-debug.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <eom-window.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <eom-window-activatable.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+static void eom_window_activatable_iface_init (EomWindowActivatableInterface *iface);
+
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (EomReloadPlugin,
+                                eom_reload_plugin,
+                                PEAS_TYPE_EXTENSION_BASE,
+                                0,
+                                G_IMPLEMENT_INTERFACE_DYNAMIC (EOM_TYPE_WINDOW_ACTIVATABLE,
+                                                               eom_window_activatable_iface_init))
+
+enum {
+	PROP_0,
+	PROP_WINDOW
+};
+
+static void
+reload_cb (GtkAction *action,
+           EomWindow *window)
+{
+	eom_window_reload_image (window);
+}
+
+static const gchar* const ui_definition = "<ui><menubar name=\"MainMenu\">"
+	"<menu name=\"ToolsMenu\" action=\"Tools\"><separator/>"
+	"<menuitem name=\"EomPluginReload\" action=\"EomPluginRunReload\"/>"
+	"<separator/></menu></menubar>"
+	"<popup name=\"ViewPopup\"><separator/>"
+	"<menuitem action=\"EomPluginRunReload\"/><separator/>"
+	"</popup></ui>";
+
+static const GtkActionEntry action_entries[] = {
+	{ "EomPluginRunReload", "view-refresh", N_("Reload Image"), "R", N_("Reload current image"), G_CALLBACK (reload_cb) }
+};
+
+static void
+eom_reload_plugin_set_property (GObject      *object,
+                                guint         prop_id,
+                                const GValue *value,
+                                GParamSpec   *pspec)
+{
+	EomReloadPlugin *plugin = EOM_RELOAD_PLUGIN (object);
+
+	switch (prop_id)
+	{
+	case PROP_WINDOW:
+		plugin->window = EOM_WINDOW (g_value_dup_object (value));
+		break;
+
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+		break;
+	}
+}
+
+static void
+eom_reload_plugin_get_property (GObject    *object,
+                                guint       prop_id,
+                                GValue     *value,
+                                GParamSpec *pspec)
+{
+	EomReloadPlugin *plugin = EOM_RELOAD_PLUGIN (object);
+
+	switch (prop_id)
+	{
+	case PROP_WINDOW:
+		g_value_set_object (value, plugin->window);
+		break;
+
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+		break;
+	}
+}
+
+static void
+eom_reload_plugin_init (EomReloadPlugin *plugin)
+{
+	eom_debug_message (DEBUG_PLUGINS, "EomReloadPlugin initializing");
+}
+
+static void
+eom_reload_plugin_dispose (GObject *object)
+{
+	EomReloadPlugin *plugin = EOM_RELOAD_PLUGIN (object);
+
+	eom_debug_message (DEBUG_PLUGINS, "EomReloadPlugin disposing");
+
+	if (plugin->window != NULL) {
+		g_object_unref (plugin->window);
+		plugin->window = NULL;
+	}
+
+	G_OBJECT_CLASS (eom_reload_plugin_parent_class)->dispose (object);
+}
+
+static void
+eom_reload_plugin_activate (EomWindowActivatable *activatable)
+{
+	EomReloadPlugin *plugin = EOM_RELOAD_PLUGIN (activatable);
+	GtkUIManager *manager;
+
+	eom_debug (DEBUG_PLUGINS);
+
+	manager = eom_window_get_ui_manager (plugin->window);
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	plugin->ui_action_group = gtk_action_group_new ("EomReloadPluginActions");
+
+#ifdef ENABLE_NLS
+	gtk_action_group_set_translation_domain (plugin->ui_action_group, GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
+
+	gtk_action_group_add_actions (plugin->ui_action_group, action_entries,
+	                              G_N_ELEMENTS (action_entries), plugin->window);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+
+	gtk_ui_manager_insert_action_group (manager, plugin->ui_action_group, -1);
+
+	plugin->ui_id = gtk_ui_manager_add_ui_from_string (manager, ui_definition, -1, NULL);
+	g_warn_if_fail (plugin->ui_id != 0);
+}
+
+static void
+eom_reload_plugin_deactivate (EomWindowActivatable *activatable)
+{
+	EomReloadPlugin *plugin = EOM_RELOAD_PLUGIN (activatable);
+	GtkUIManager *manager;
+
+	eom_debug (DEBUG_PLUGINS);
+
+	manager = eom_window_get_ui_manager (plugin->window);
+
+	gtk_ui_manager_remove_ui (manager, plugin->ui_id);
+
+	gtk_ui_manager_remove_action_group (manager, plugin->ui_action_group);
+
+	gtk_ui_manager_ensure_update (manager);
+}
+
+static void
+eom_reload_plugin_class_init (EomReloadPluginClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	object_class->dispose = eom_reload_plugin_dispose;
+	object_class->set_property = eom_reload_plugin_set_property;
+	object_class->get_property = eom_reload_plugin_get_property;
+
+	g_object_class_override_property (object_class, PROP_WINDOW, "window");
+}
+
+static void
+eom_reload_plugin_class_finalize (EomReloadPluginClass *klass)
+{
+	/* dummy function - used by G_DEFINE_DYNAMIC_TYPE_EXTENDED */
+}
+
+static void
+eom_window_activatable_iface_init (EomWindowActivatableInterface *iface)
+{
+	iface->activate = eom_reload_plugin_activate;
+	iface->deactivate = eom_reload_plugin_deactivate;
+}
+
+G_MODULE_EXPORT void
+peas_register_types (PeasObjectModule *module)
+{
+	eom_reload_plugin_register_type (G_TYPE_MODULE (module));
+	peas_object_module_register_extension_type (module,
+	                                            EOM_TYPE_WINDOW_ACTIVATABLE,
+	                                            EOM_TYPE_RELOAD_PLUGIN);
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/17.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/17.html new file mode 100644 index 0000000..6f90b1f --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/17.html @@ -0,0 +1,409 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/* Statusbar Date -- Shows the EXIF date in EOM's statusbar
+ *
+ * Copyright (C) 2008 The Free Software Foundation
+ *
+ * Author: Claudio Saavedra  <csaavedra@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __EOM_STATUSBAR_DATE_PLUGIN_H__
+#define __EOM_STATUSBAR_DATE_PLUGIN_H__
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libpeas/peas-extension-base.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libpeas/peas-object-module.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <eom-window.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+/*
+ * Type checking and casting macros
+ */
+#define EOM_TYPE_STATUSBAR_DATE_PLUGIN \
+	(eom_statusbar_date_plugin_get_type())
+#define EOM_STATUSBAR_DATE_PLUGIN(o) \
+	(G_TYPE_CHECK_INSTANCE_CAST((o), EOM_TYPE_STATUSBAR_DATE_PLUGIN, EomStatusbarDatePlugin))
+#define EOM_STATUSBAR_DATE_PLUGIN_CLASS(k) \
+	G_TYPE_CHECK_CLASS_CAST((k), EOM_TYPE_STATUSBAR_DATE_PLUGIN, EomStatusbarDatePluginClass))
+#define EOM_IS_STATUSBAR_DATE_PLUGIN(o) \
+	(G_TYPE_CHECK_INSTANCE_TYPE((o), EOM_TYPE_STATUSBAR_DATE_PLUGIN))
+#define EOM_IS_STATUSBAR_DATE_PLUGIN_CLASS(k) \
+	(G_TYPE_CHECK_CLASS_TYPE((k), EOM_TYPE_STATUSBAR_DATE_PLUGIN))
+#define EOM_STATUSBAR_DATE_PLUGIN_GET_CLASS(o) \
+	(G_TYPE_INSTANCE_GET_CLASS((o), EOM_TYPE_STATUSBAR_DATE_PLUGIN, EomStatusbarDatePluginClass))
+
+/* Private structure type */
+typedef struct _EomStatusbarDatePluginPrivate EomStatusbarDatePluginPrivate;
+
+/*
+ * Main object structure
+ */
+typedef struct _EomStatusbarDatePlugin EomStatusbarDatePlugin;
+
+struct _EomStatusbarDatePlugin {
+	PeasExtensionBase parent_instance;
+
+	EomWindow *window;
+	GtkWidget *statusbar_date;
+	gulong signal_id;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _EomStatusbarDatePluginClass	EomStatusbarDatePluginClass;
+
+struct _EomStatusbarDatePluginClass {
+	PeasExtensionBaseClass parent_class;
+};
+
+/*
+ * Public methods
+ */
+GType eom_statusbar_date_plugin_get_type (void) G_GNUC_CONST;
+
+/* All the plugins must implement this function */
+G_MODULE_EXPORT void peas_register_types (PeasObjectModule *module);
+
+G_END_DECLS
+
+#endif /* __EOM_STATUSBAR_DATE_PLUGIN_H__ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/18.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/18.html new file mode 100644 index 0000000..2656259 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/18.html @@ -0,0 +1,721 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Statusbar Date -- Shows the EXIF date in EOM's statusbar
+ *
+ * Copyright (C) 2008 The Free Software Foundation
+ *
+ * Author: Claudio Saavedra  <csaavedra@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include "eom-statusbar-date-plugin.h"
+
+#include <gmodule.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libpeas/peas-activatable.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <eom-debug.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <eom-image.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <eom-thumb-view.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <eom-exif-util.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <eom-window.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <eom-window-activatable.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+static void eom_window_activatable_iface_init (EomWindowActivatableInterface *iface);
+
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (EomStatusbarDatePlugin,
+                                eom_statusbar_date_plugin,
+                                PEAS_TYPE_EXTENSION_BASE,
+                                0,
+                                G_IMPLEMENT_INTERFACE_DYNAMIC (EOM_TYPE_WINDOW_ACTIVATABLE,
+                                                               eom_window_activatable_iface_init))
+
+enum {
+	PROP_0,
+	PROP_WINDOW
+};
+
+static void
+statusbar_set_date (GtkStatusbar *statusbar,
+                    EomThumbView *view)
+{
+	EomImage *image;
+	gchar *date = NULL;
+	gchar time_buffer[32];
+	ExifData *exif_data;
+
+	if (eom_thumb_view_get_n_selected (view) == 0)
+	{
+		return;
+	}
+
+	image = eom_thumb_view_get_first_selected_image (view);
+
+	gtk_statusbar_pop (statusbar, 0);
+
+	if (!eom_image_has_data (image, EOM_IMAGE_DATA_EXIF))
+	{
+		if (!eom_image_load (image, EOM_IMAGE_DATA_EXIF, NULL, NULL))
+		{
+			gtk_widget_hide (GTK_WIDGET (statusbar));
+		}
+	}
+
+	exif_data = eom_image_get_exif_info (image);
+
+	if (exif_data)
+	{
+		date = eom_exif_util_format_date (eom_exif_data_get_value (exif_data, EXIF_TAG_DATE_TIME_ORIGINAL, time_buffer, 32));
+		eom_exif_data_free (exif_data);
+	}
+
+	if (date)
+	{
+		gtk_statusbar_push (statusbar, 0, date);
+		gtk_widget_show (GTK_WIDGET (statusbar));
+		g_free (date);
+	}
+	else
+	{
+		gtk_widget_hide (GTK_WIDGET (statusbar));
+	}
+}
+
+static void
+selection_changed_cb (EomThumbView           *view,
+                      EomStatusbarDatePlugin *plugin)
+{
+	statusbar_set_date (GTK_STATUSBAR (plugin->statusbar_date), view);
+}
+
+static void
+eom_statusbar_date_plugin_set_property (GObject      *object,
+                                        guint         prop_id,
+                                        const GValue *value,
+                                        GParamSpec   *pspec)
+{
+	EomStatusbarDatePlugin *plugin = EOM_STATUSBAR_DATE_PLUGIN (object);
+
+	switch (prop_id)
+	{
+	case PROP_WINDOW:
+		plugin->window = EOM_WINDOW (g_value_dup_object (value));
+		break;
+
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+		break;
+	}
+}
+
+static void
+eom_statusbar_date_plugin_get_property (GObject    *object,
+                                        guint       prop_id,
+                                        GValue     *value,
+                                        GParamSpec *pspec)
+{
+	EomStatusbarDatePlugin *plugin = EOM_STATUSBAR_DATE_PLUGIN (object);
+
+	switch (prop_id)
+	{
+	case PROP_WINDOW:
+		g_value_set_object (value, plugin->window);
+		break;
+
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+		break;
+	}
+}
+
+static void
+eom_statusbar_date_plugin_init (EomStatusbarDatePlugin *plugin)
+{
+	eom_debug_message (DEBUG_PLUGINS, "EomStatusbarDatePlugin initializing");
+}
+
+static void
+eom_statusbar_date_plugin_dispose (GObject *object)
+{
+	EomStatusbarDatePlugin *plugin = EOM_STATUSBAR_DATE_PLUGIN (object);
+
+	eom_debug_message (DEBUG_PLUGINS, "EomStatusbarDatePlugin disposing");
+
+	if (plugin->window != NULL) {
+		g_object_unref (plugin->window);
+		plugin->window = NULL;
+	}
+
+	G_OBJECT_CLASS (eom_statusbar_date_plugin_parent_class)->dispose (object);
+}
+
+static void
+eom_statusbar_date_plugin_activate (EomWindowActivatable *activatable)
+{
+	EomStatusbarDatePlugin *plugin = EOM_STATUSBAR_DATE_PLUGIN (activatable);
+	EomWindow *window = plugin->window;
+	GtkWidget *statusbar = eom_window_get_statusbar (window);
+	GtkWidget *thumbview = eom_window_get_thumb_view (window);
+
+	eom_debug (DEBUG_PLUGINS);
+
+	plugin->statusbar_date = gtk_statusbar_new ();
+	gtk_widget_set_size_request (plugin->statusbar_date, 200, 10);
+	gtk_widget_set_margin_top (GTK_WIDGET (plugin->statusbar_date), 0);
+	gtk_widget_set_margin_bottom (GTK_WIDGET (plugin->statusbar_date), 0);
+	gtk_box_pack_end (GTK_BOX (statusbar), plugin->statusbar_date, FALSE, FALSE, 0);
+
+	plugin->signal_id = g_signal_connect_after (G_OBJECT (thumbview), "selection_changed",
+	                                            G_CALLBACK (selection_changed_cb), plugin);
+
+	statusbar_set_date (GTK_STATUSBAR (plugin->statusbar_date),
+	                    EOM_THUMB_VIEW (eom_window_get_thumb_view (window)));
+}
+
+static void
+eom_statusbar_date_plugin_deactivate (EomWindowActivatable *activatable)
+{
+	EomStatusbarDatePlugin *plugin = EOM_STATUSBAR_DATE_PLUGIN (activatable);
+	EomWindow *window = plugin->window;
+	GtkWidget *statusbar = eom_window_get_statusbar (window);
+	GtkWidget *view = eom_window_get_thumb_view (window);
+
+#if GLIB_CHECK_VERSION(2,62,0)
+	g_clear_signal_handler (&plugin->signal_id, view);
+#else
+	if (plugin->signal_id != 0) {
+		g_signal_handler_disconnect (view, plugin->signal_id);
+		plugin->signal_id = 0;
+	}
+#endif
+
+	gtk_container_remove (GTK_CONTAINER (statusbar), plugin->statusbar_date);
+}
+
+static void
+eom_statusbar_date_plugin_class_init (EomStatusbarDatePluginClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	object_class->dispose = eom_statusbar_date_plugin_dispose;
+	object_class->set_property = eom_statusbar_date_plugin_set_property;
+	object_class->get_property = eom_statusbar_date_plugin_get_property;
+
+	g_object_class_override_property (object_class, PROP_WINDOW, "window");
+}
+
+static void
+eom_statusbar_date_plugin_class_finalize (EomStatusbarDatePluginClass *klass)
+{
+	/* dummy function - used by G_DEFINE_DYNAMIC_TYPE_EXTENDED */
+}
+
+static void
+eom_window_activatable_iface_init (EomWindowActivatableInterface *iface)
+{
+	iface->activate = eom_statusbar_date_plugin_activate;
+	iface->deactivate = eom_statusbar_date_plugin_deactivate;
+}
+
+G_MODULE_EXPORT void
+peas_register_types (PeasObjectModule *module)
+{
+	eom_statusbar_date_plugin_register_type (G_TYPE_MODULE (module));
+	peas_object_module_register_extension_type (module,
+	                                            EOM_TYPE_WINDOW_ACTIVATABLE,
+	                                            EOM_TYPE_STATUSBAR_DATE_PLUGIN);
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/19.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/19.html new file mode 100644 index 0000000..91a0778 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/19.html @@ -0,0 +1,379 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/*
+ * eom-application-activatable.h
+ * This file is part of eom
+ *
+ * Author: Felix Riemann <friemann@gnome.org>
+ *
+ * Copyright (C) 2012 Felix Riemann
+ * Copyright (C) 2013-2021 MATE developers
+ *
+ * Base on code by:
+ * 	- Steve Frécinaux <code@istique.net>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+#ifndef __EOM_APPLICATION_ACTIVATABLE_H__
+#define __EOM_APPLICATION_ACTIVATABLE_H__
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+#define EOM_TYPE_APPLICATION_ACTIVATABLE (eom_application_activatable_get_type ())
+#define EOM_APPLICATION_ACTIVATABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+                                          EOM_TYPE_APPLICATION_ACTIVATABLE, \
+                                          EomApplicationActivatable))
+#define EOM_APPLICATION_ACTIVATABLE_IFACE(obj) \
+                                          (G_TYPE_CHECK_CLASS_CAST ((obj), \
+                                           EOM_TYPE_APPLICATION_ACTIVATABLE, \
+                                           EomApplicationActivatableInterface))
+#define EOM_IS_APPLICATION_ACTIVATABLE(obj) \
+                                          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+                                           EOM_TYPE_APPLICATION_ACTIVATABLE))
+#define EOM_APPLICATION_ACTIVATABLE_GET_IFACE(obj) \
+                                        (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \
+                                         EOM_TYPE_APPLICATION_ACTIVATABLE, \
+                                         EomApplicationActivatableInterface))
+
+typedef struct _EomApplicationActivatable		EomApplicationActivatable;
+typedef struct _EomApplicationActivatableInterface	EomApplicationActivatableInterface;
+
+struct _EomApplicationActivatableInterface
+{
+	GTypeInterface g_iface;
+
+	/* vfuncs */
+
+    void	(*activate)	(EomApplicationActivatable *activatable);
+    void	(*deactivate)	(EomApplicationActivatable *activatable);
+};
+
+GType	eom_application_activatable_get_type     (void) G_GNUC_CONST;
+
+void	eom_application_activatable_activate     (EomApplicationActivatable *activatable);
+void	eom_application_activatable_deactivate   (EomApplicationActivatable *activatable);
+
+G_END_DECLS
+#endif /* __EOM_APPLICATION_ACTIVATABLE_H__ */
+
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/2.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/2.html new file mode 100644 index 0000000..26d5880 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/2.html @@ -0,0 +1,419 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/*
+ *  Copyright (C) 2003, 2004  Marco Pesenti Gritti
+ *  Copyright (C) 2003, 2004, 2005  Christian Persch
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This program 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 General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  $Id: egg-editable-toolbar.h 891 2008-08-08 21:14:52Z friemann $
+ */
+
+#ifndef EGG_EDITABLE_TOOLBAR_H
+#define EGG_EDITABLE_TOOLBAR_H
+
+#include "egg-toolbars-model.h"
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+#define EGG_TYPE_EDITABLE_TOOLBAR             (egg_editable_toolbar_get_type ())
+#define EGG_EDITABLE_TOOLBAR(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_EDITABLE_TOOLBAR, EggEditableToolbar))
+#define EGG_EDITABLE_TOOLBAR_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_EDITABLE_TOOLBAR, EggEditableToolbarClass))
+#define EGG_IS_EDITABLE_TOOLBAR(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_EDITABLE_TOOLBAR))
+#define EGG_IS_EDITABLE_TOOLBAR_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_EDITABLE_TOOLBAR))
+#define EGG_EDITABLE_TOOLBAR_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_EDITABLE_TOOLBAR, EggEditableToolbarClass))
+
+typedef struct _EggEditableToolbar        EggEditableToolbar;
+typedef struct _EggEditableToolbarPrivate EggEditableToolbarPrivate;
+typedef struct _EggEditableToolbarClass   EggEditableToolbarClass;
+
+struct _EggEditableToolbar
+{
+  GtkVBox parent_object;
+
+  /*< private >*/
+  EggEditableToolbarPrivate *priv;
+};
+
+struct _EggEditableToolbarClass
+{
+  GtkVBoxClass parent_class;
+
+  void (* action_request) (EggEditableToolbar *etoolbar,
+			   const char *action_name);
+};
+
+GType               egg_editable_toolbar_get_type        (void);
+GtkWidget	   *egg_editable_toolbar_new		 (GtkUIManager         *manager,
+							  const char           *visibility_path);
+GtkWidget	   *egg_editable_toolbar_new_with_model	 (GtkUIManager         *manager,
+							  EggToolbarsModel     *model,
+							  const char           *visibility_path);
+void		    egg_editable_toolbar_set_model       (EggEditableToolbar   *etoolbar,
+							  EggToolbarsModel     *model);
+EggToolbarsModel   *egg_editable_toolbar_get_model       (EggEditableToolbar   *etoolbar);
+GtkUIManager       *egg_editable_toolbar_get_manager     (EggEditableToolbar   *etoolbar);
+void		    egg_editable_toolbar_set_edit_mode	 (EggEditableToolbar   *etoolbar,
+							  gboolean              mode);
+gboolean	    egg_editable_toolbar_get_edit_mode	 (EggEditableToolbar   *etoolbar);
+void		    egg_editable_toolbar_show		 (EggEditableToolbar   *etoolbar,
+							  const char           *name);
+void		    egg_editable_toolbar_hide		 (EggEditableToolbar   *etoolbar,
+							  const char           *name);
+void		    egg_editable_toolbar_set_fixed       (EggEditableToolbar   *etoolbar,
+							  GtkToolbar           *fixed_toolbar);
+
+GtkWidget *         egg_editable_toolbar_get_selected    (EggEditableToolbar   *etoolbar);
+void                egg_editable_toolbar_set_selected    (EggEditableToolbar   *etoolbar,
+							  GtkWidget            *widget);
+
+void              egg_editable_toolbar_add_visibility    (EggEditableToolbar   *etoolbar,
+							  const char           *path);
+
+/* Private Functions */
+
+GtkWidget 	   *_egg_editable_toolbar_new_separator_image (void);
+
+G_END_DECLS
+
+#endif
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/20.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/20.html new file mode 100644 index 0000000..16edc47 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/20.html @@ -0,0 +1,411 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/*
+ * eom-application-activatable.c
+ * This file is part of eom
+ *
+ * Author: Felix Riemann <friemann@gnome.org>
+ *
+ * Copyright (C) 2012 Felix Riemann
+ * Copyright (C) 2013-2021 MATE developers
+ *
+ * Base on code by:
+ * 	- Steve Frécinaux <code@istique.net>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"<--- Include file: "config.h" not found.
+#endif
+
+#include "eom-application-activatable.h"
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "eom-application.h"
+
+G_DEFINE_INTERFACE(EomApplicationActivatable, eom_application_activatable, G_TYPE_OBJECT)
+
+void
+eom_application_activatable_default_init (EomApplicationActivatableInterface *iface)
+{
+	static gboolean initialized = FALSE;
+
+	if (!initialized) {
+		/**
+         * EomApplicationActivatable:app:
+		 *
+         * This is the #EomApplication this #EomApplicationActivatable instance
+		 * should be attached to.
+		 */
+		g_object_interface_install_property (iface,
+                g_param_spec_object ("app", "Application",
+                             "The EomApplication this instance it attached to",
+                             EOM_TYPE_APPLICATION,
+						     G_PARAM_READWRITE |
+						     G_PARAM_CONSTRUCT_ONLY |
+						     G_PARAM_STATIC_STRINGS));
+		initialized = TRUE;
+	}
+}
+
+void
+eom_application_activatable_activate (EomApplicationActivatable *activatable)
+{
+    EomApplicationActivatableInterface *iface;
+
+    g_return_if_fail (EOM_IS_APPLICATION_ACTIVATABLE (activatable));
+
+    iface = EOM_APPLICATION_ACTIVATABLE_GET_IFACE (activatable);
+
+	if (G_LIKELY (iface->activate != NULL))
+		iface->activate (activatable);
+}
+
+void
+eom_application_activatable_deactivate (EomApplicationActivatable *activatable)
+{
+    EomApplicationActivatableInterface *iface;
+
+    g_return_if_fail (EOM_IS_APPLICATION_ACTIVATABLE (activatable));
+
+    iface = EOM_APPLICATION_ACTIVATABLE_GET_IFACE (activatable);
+
+	if (G_LIKELY (iface->deactivate != NULL))
+		iface->deactivate (activatable);
+}
+
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/21.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/21.html new file mode 100644 index 0000000..114fc52 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/21.html @@ -0,0 +1,415 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/* Eye Of Mate - Application Facade
+ *
+ * Copyright (C) 2006 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on evince code (shell/ev-application.h) by:
+ * 	- Martin Kretzschmar <martink@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __EOM_APPLICATION_H__
+#define __EOM_APPLICATION_H__
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <libpeas/peas-extension-set.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "eom-window.h"
+
+G_BEGIN_DECLS
+
+typedef struct _EomApplication EomApplication;
+typedef struct _EomApplicationClass EomApplicationClass;
+typedef struct _EomApplicationPrivate EomApplicationPrivate;
+
+#define EOM_TYPE_APPLICATION            (eom_application_get_type ())
+#define EOM_APPLICATION(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), EOM_TYPE_APPLICATION, EomApplication))
+#define EOM_APPLICATION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  EOM_TYPE_APPLICATION, EomApplicationClass))
+#define EOM_IS_APPLICATION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), EOM_TYPE_APPLICATION))
+#define EOM_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  EOM_TYPE_APPLICATION))
+#define EOM_APPLICATION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  EOM_TYPE_APPLICATION, EomApplicationClass))
+
+#define EOM_APP				(eom_application_get_instance ())
+
+struct _EomApplication {
+	GtkApplication base_instance;
+
+	EomApplicationPrivate *priv;
+};
+
+struct _EomApplicationClass {
+	GtkApplicationClass parent_class;
+};
+
+GType	          eom_application_get_type	      (void) G_GNUC_CONST;
+
+EomApplication   *eom_application_get_instance        (void);
+
+gboolean          eom_application_open_window         (EomApplication   *application,
+						       guint             timestamp,
+						       EomStartupFlags   flags,
+						       GError          **error);
+
+gboolean          eom_application_open_uri_list      (EomApplication   *application,
+						      GSList           *uri_list,
+						      guint             timestamp,
+						      EomStartupFlags   flags,
+						      GError          **error);
+
+gboolean          eom_application_open_file_list     (EomApplication  *application,
+						      GSList          *file_list,
+						      guint           timestamp,
+						      EomStartupFlags flags,
+						      GError         **error);
+
+gboolean          eom_application_open_uris           (EomApplication *application,
+						       gchar         **uris,
+						       guint           timestamp,
+						       EomStartupFlags flags,
+						       GError        **error);
+
+G_END_DECLS
+
+#endif /* __EOM_APPLICATION_H__ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/22.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/22.html new file mode 100644 index 0000000..0bc2acb --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/22.html @@ -0,0 +1,463 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye Of Mate - Image Store
+ *
+ * Copyright (C) 2006-2007 The Free Software Foundation
+ *
+ * Author: Claudio Saavedra <csaavedra@alumnos.utalca.cl>
+ *
+ * Based on code by: Jens Finke <jens@triq.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef EOM_LIST_STORE_H
+#define EOM_LIST_STORE_H
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+#ifndef __EOM_IMAGE_DECLR__
+#define __EOM_IMAGE_DECLR__
+  typedef struct _EomImage EomImage;
+#endif
+
+typedef struct _EomListStore EomListStore;
+typedef struct _EomListStoreClass EomListStoreClass;
+typedef struct _EomListStorePrivate EomListStorePrivate;
+
+#define EOM_TYPE_LIST_STORE            eom_list_store_get_type()
+#define EOM_LIST_STORE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), EOM_TYPE_LIST_STORE, EomListStore))
+#define EOM_LIST_STORE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  EOM_TYPE_LIST_STORE, EomListStoreClass))
+#define EOM_IS_LIST_STORE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EOM_TYPE_LIST_STORE))
+#define EOM_IS_LIST_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  EOM_TYPE_LIST_STORE))
+#define EOM_LIST_STORE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  EOM_TYPE_LIST_STORE, EomListStoreClass))
+
+#define EOM_LIST_STORE_THUMB_SIZE 90
+
+typedef enum {
+	EOM_LIST_STORE_THUMBNAIL = 0,
+	EOM_LIST_STORE_THUMB_SET,
+	EOM_LIST_STORE_EOM_IMAGE,
+	EOM_LIST_STORE_EOM_JOB,
+	EOM_LIST_STORE_NUM_COLUMNS
+} EomListStoreColumn;
+
+struct _EomListStore {
+        GtkListStore parent;
+	EomListStorePrivate *priv;
+};
+
+struct _EomListStoreClass {
+        GtkListStoreClass parent_class;
+
+	/* Padding for future expansion */
+	void (* _eom_reserved1) (void);
+	void (* _eom_reserved2) (void);
+	void (* _eom_reserved3) (void);
+	void (* _eom_reserved4) (void);
+};
+
+GType           eom_list_store_get_type 	     (void) G_GNUC_CONST;
+
+GtkListStore   *eom_list_store_new 		     (void);
+
+GtkListStore   *eom_list_store_new_from_glist 	     (GList *list);
+
+void            eom_list_store_append_image 	     (EomListStore *store,
+						      EomImage     *image);
+
+void            eom_list_store_add_files 	     (EomListStore *store,
+						      GList        *file_list);
+
+void            eom_list_store_remove_image 	     (EomListStore *store,
+						      EomImage     *image);
+
+gint            eom_list_store_get_pos_by_image      (EomListStore *store,
+						      EomImage     *image);
+
+EomImage       *eom_list_store_get_image_by_pos      (EomListStore *store,
+						      gint   pos);
+
+gint            eom_list_store_get_pos_by_iter 	     (EomListStore *store,
+						      GtkTreeIter  *iter);
+
+gint            eom_list_store_length                (EomListStore *store);
+
+gint            eom_list_store_get_initial_pos 	     (EomListStore *store);
+
+void            eom_list_store_thumbnail_set         (EomListStore *store,
+						      GtkTreeIter *iter);
+
+void            eom_list_store_thumbnail_unset       (EomListStore *store,
+						      GtkTreeIter *iter);
+
+void            eom_list_store_thumbnail_refresh     (EomListStore *store,
+						      GtkTreeIter *iter);
+
+G_END_DECLS
+
+#endif
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/23.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/23.html new file mode 100644 index 0000000..1e8cf08 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/23.html @@ -0,0 +1,385 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
#ifndef _EOM_TRANSFORM_H_
+#define _EOM_TRANSFORM_H_
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gdk-pixbuf/gdk-pixbuf.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+#ifndef __EOM_JOB_DECLR__
+#define __EOM_JOB_DECLR__
+typedef struct _EomJob EomJob;
+#endif
+
+typedef enum {
+	EOM_TRANSFORM_NONE,
+	EOM_TRANSFORM_ROT_90,
+	EOM_TRANSFORM_ROT_180,
+	EOM_TRANSFORM_ROT_270,
+	EOM_TRANSFORM_FLIP_HORIZONTAL,
+	EOM_TRANSFORM_FLIP_VERTICAL,
+	EOM_TRANSFORM_TRANSPOSE,
+	EOM_TRANSFORM_TRANSVERSE
+} EomTransformType;
+
+#define EOM_TYPE_TRANSFORM          (eom_transform_get_type ())
+#define EOM_TRANSFORM(o)            (G_TYPE_CHECK_INSTANCE_CAST ((o), EOM_TYPE_TRANSFORM, EomTransform))
+#define EOM_TRANSFORM_CLASS(k)      (G_TYPE_CHECK_CLASS_CAST((k), EOM_TYPE_TRANSFORM, EomTransformClass))
+#define EOM_IS_TRANSFORM(o)         (G_TYPE_CHECK_INSTANCE_TYPE ((o), EOM_TYPE_TRANSFORM))
+#define EOM_IS_TRANSFORM_CLASS(k)   (G_TYPE_CHECK_CLASS_TYPE ((k), EOM_TYPE_TRANSFORM))
+#define EOM_TRANSFORM_GET_CLASS(o)  (G_TYPE_INSTANCE_GET_CLASS ((o), EOM_TYPE_TRANSFORM, EomTransformClass))
+
+/* =========================================
+
+    GObjecat wrapper around an affine transformation
+
+   ----------------------------------------*/
+
+typedef struct _EomTransform EomTransform;
+typedef struct _EomTransformClass EomTransformClass;
+typedef struct _EomTransformPrivate EomTransformPrivate;
+
+struct _EomTransform {
+	GObject parent;
+
+	EomTransformPrivate *priv;
+};
+
+struct _EomTransformClass {
+	GObjectClass parent_klass;
+};
+
+GType         eom_transform_get_type (void) G_GNUC_CONST;
+
+GdkPixbuf*    eom_transform_apply   (EomTransform *trans, GdkPixbuf *pixbuf, EomJob *job);
+EomTransform* eom_transform_reverse (EomTransform *trans);
+EomTransform* eom_transform_compose (EomTransform *trans, EomTransform *compose);
+gboolean      eom_transform_is_identity (EomTransform *trans);
+
+EomTransform* eom_transform_identity_new (void);
+EomTransform* eom_transform_rotate_new (int degree);
+EomTransform* eom_transform_flip_new   (EomTransformType type /* only EOM_TRANSFORM_FLIP_* are valid */);
+#if 0
+EomTransform* eom_transform_scale_new  (double sx, double sy);
+#endif
+EomTransform* eom_transform_new (EomTransformType trans);
+
+EomTransformType eom_transform_get_transform_type (EomTransform *trans);
+
+gboolean         eom_transform_get_affine (EomTransform *trans, cairo_matrix_t *affine);
+
+G_END_DECLS
+
+#endif /* _EOM_TRANSFORM_H_ */
+
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/24.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/24.html new file mode 100644 index 0000000..507bc5e --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/24.html @@ -0,0 +1,785 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye Of Mate - Jobs
+ *
+ * Copyright (C) 2006 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on evince code (shell/ev-jobs.h) by:
+ * 	- Martin Kretzschmar <martink@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __EOM_JOBS_H__
+#define __EOM_JOBS_H__
+
+#include "eom-list-store.h"
+#include "eom-transform.h"
+#include "eom-enums.h"
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gdk-pixbuf/gdk-pixbuf.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+#ifndef __EOM_IMAGE_DECLR__
+#define __EOM_IMAGE_DECLR__
+  typedef struct _EomImage EomImage;
+#endif
+
+#ifndef __EOM_URI_CONVERTER_DECLR__
+#define __EOM_URI_CONVERTER_DECLR__
+typedef struct _EomURIConverter EomURIConverter;
+#endif
+
+#ifndef __EOM_JOB_DECLR__
+#define __EOM_JOB_DECLR__
+typedef struct _EomJob EomJob;
+#endif
+typedef struct _EomJobClass EomJobClass;
+
+typedef struct _EomJobThumbnail EomJobThumbnail;
+typedef struct _EomJobThumbnailClass EomJobThumbnailClass;
+
+typedef struct _EomJobLoad EomJobLoad;
+typedef struct _EomJobLoadClass EomJobLoadClass;
+
+typedef struct _EomJobModel EomJobModel;
+typedef struct _EomJobModelClass EomJobModelClass;
+
+typedef struct _EomJobTransform EomJobTransform;
+typedef struct _EomJobTransformClass EomJobTransformClass;
+
+typedef struct _EomJobSave EomJobSave;
+typedef struct _EomJobSaveClass EomJobSaveClass;
+
+typedef struct _EomJobSaveAs EomJobSaveAs;
+typedef struct _EomJobSaveAsClass EomJobSaveAsClass;
+
+typedef struct _EomJobCopy EomJobCopy;
+typedef struct _EomJobCopyClass EomJobCopyClass;
+
+#define EOM_TYPE_JOB		       (eom_job_get_type())
+#define EOM_JOB(obj)		       (G_TYPE_CHECK_INSTANCE_CAST((obj), EOM_TYPE_JOB, EomJob))
+#define EOM_JOB_CLASS(klass)	       (G_TYPE_CHECK_CLASS_CAST((klass),  EOM_TYPE_JOB, EomJobClass))
+#define EOM_IS_JOB(obj)	               (G_TYPE_CHECK_INSTANCE_TYPE((obj), EOM_TYPE_JOB))
+#define EOM_JOB_GET_CLASS(obj)         (G_TYPE_INSTANCE_GET_CLASS ((obj), EOM_TYPE_JOB, EomJobClass))
+
+#define EOM_TYPE_JOB_THUMBNAIL	       (eom_job_thumbnail_get_type())
+#define EOM_JOB_THUMBNAIL(obj)	       (G_TYPE_CHECK_INSTANCE_CAST((obj), EOM_TYPE_JOB_THUMBNAIL, EomJobThumbnail))
+#define EOM_JOB_THUMBNAIL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),  EOM_TYPE_JOB_THUMBNAIL, EomJobThumbnailClass))
+#define EOM_IS_JOB_THUMBNAIL(obj)      (G_TYPE_CHECK_INSTANCE_TYPE((obj), EOM_TYPE_JOB_THUMBNAIL))
+
+#define EOM_TYPE_JOB_LOAD	       (eom_job_load_get_type())
+#define EOM_JOB_LOAD(obj)	       (G_TYPE_CHECK_INSTANCE_CAST((obj), EOM_TYPE_JOB_LOAD, EomJobLoad))
+#define EOM_JOB_LOAD_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass),  EOM_TYPE_JOB_LOAD, EomJobLoadClass))
+#define EOM_IS_JOB_LOAD(obj)	       (G_TYPE_CHECK_INSTANCE_TYPE((obj), EOM_TYPE_JOB_LOAD))
+
+#define EOM_TYPE_JOB_MODEL	       (eom_job_model_get_type())
+#define EOM_JOB_MODEL(obj)	       (G_TYPE_CHECK_INSTANCE_CAST((obj), EOM_TYPE_JOB_MODEL, EomJobModel))
+#define EOM_JOB_MODEL_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass),  EOM_TYPE_JOB_MODEL, EomJobModelClass))
+#define EOM_IS_JOB_MODEL(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), EOM_TYPE_JOB_MODEL))
+
+#define EOM_TYPE_JOB_TRANSFORM	       (eom_job_transform_get_type())
+#define EOM_JOB_TRANSFORM(obj)	       (G_TYPE_CHECK_INSTANCE_CAST((obj), EOM_TYPE_JOB_TRANSFORM, EomJobTransform))
+#define EOM_JOB_TRANSFORM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),  EOM_TYPE_JOB_TRANSFORM, EomJobTransformClass))
+#define EOM_IS_JOB_TRANSFORM(obj)      (G_TYPE_CHECK_INSTANCE_TYPE((obj), EOM_TYPE_JOB_TRANSFORM))
+
+#define EOM_TYPE_JOB_SAVE              (eom_job_save_get_type())
+#define EOM_JOB_SAVE(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), EOM_TYPE_JOB_SAVE, EomJobSave))
+#define EOM_JOB_SAVE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), EOM_TYPE_JOB_SAVE, EomJobSaveClass))
+#define EOM_IS_JOB_SAVE(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), EOM_TYPE_JOB_SAVE))
+#define EOM_JOB_SAVE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), EOM_TYPE_JOB_SAVE, EomJobSaveClass))
+
+#define EOM_TYPE_JOB_SAVE_AS           (eom_job_save_as_get_type())
+#define EOM_JOB_SAVE_AS(obj)           (G_TYPE_CHECK_INSTANCE_CAST((obj), EOM_TYPE_JOB_SAVE_AS, EomJobSaveAs))
+#define EOM_JOB_SAVE_AS_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST((klass), EOM_TYPE_JOB_SAVE_AS, EomJobSaveAsClass))
+#define EOM_IS_JOB_SAVE_AS(obj)        (G_TYPE_CHECK_INSTANCE_TYPE((obj), EOM_TYPE_JOB_SAVE_AS))
+
+#define EOM_TYPE_JOB_COPY	       (eom_job_copy_get_type())
+#define EOM_JOB_COPY(obj)	       (G_TYPE_CHECK_INSTANCE_CAST((obj), EOM_TYPE_JOB_COPY, EomJobCopy))
+#define EOM_JOB_COPY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),  EOM_TYPE_JOB_COPY, EomJobCopyClass))
+#define EOM_IS_JOB_COPY(obj)      (G_TYPE_CHECK_INSTANCE_TYPE((obj), EOM_TYPE_JOB_COPY))
+
+struct _EomJob
+{
+	GObject  parent;
+
+	GError   *error;
+	GMutex   *mutex;
+	float     progress;
+	gboolean  finished;
+};
+
+struct _EomJobClass
+{
+	GObjectClass parent_class;
+
+	void    (* finished) (EomJob *job);
+	void    (* progress) (EomJob *job, float progress);
+	void    (*run)       (EomJob *job);
+};
+
+struct _EomJobThumbnail
+{
+	EomJob       parent;
+	EomImage    *image;
+	GdkPixbuf   *thumbnail;
+};
+
+struct _EomJobThumbnailClass
+{
+	EomJobClass parent_class;
+};
+
+struct _EomJobLoad
+{
+	EomJob        parent;
+	EomImage     *image;
+	EomImageData  data;
+};
+
+struct _EomJobLoadClass
+{
+	EomJobClass parent_class;
+};
+
+struct _EomJobModel
+{
+	EomJob        parent;
+	EomListStore *store;
+	GSList       *file_list;
+};
+
+struct _EomJobModelClass
+{
+        EomJobClass parent_class;
+};
+
+struct _EomJobTransform
+{
+	EomJob        parent;
+	GList        *images;
+	EomTransform *trans;
+};
+
+struct _EomJobTransformClass
+{
+        EomJobClass parent_class;
+};
+
+typedef enum {
+	EOM_SAVE_RESPONSE_NONE,
+	EOM_SAVE_RESPONSE_RETRY,
+	EOM_SAVE_RESPONSE_SKIP,
+	EOM_SAVE_RESPONSE_OVERWRITE,
+	EOM_SAVE_RESPONSE_CANCEL,
+	EOM_SAVE_RESPONSE_LAST
+} EomJobSaveResponse;
+
+struct _EomJobSave
+{
+	EomJob    parent;
+	GList	 *images;
+	guint      current_pos;
+	EomImage *current_image;
+};
+
+struct _EomJobSaveClass
+{
+	EomJobClass parent_class;
+};
+
+struct _EomJobSaveAs
+{
+	EomJobSave       parent;
+	EomURIConverter *converter;
+	GFile           *file;
+};
+
+struct _EomJobSaveAsClass
+{
+	EomJobSaveClass parent;
+};
+
+struct _EomJobCopy
+{
+	EomJob parent;
+	GList *images;
+	guint current_pos;
+	gchar *dest;
+};
+
+struct _EomJobCopyClass
+{
+	EomJobClass parent_class;
+};
+
+/* base job class */
+GType           eom_job_get_type           (void) G_GNUC_CONST;
+void            eom_job_finished           (EomJob          *job);
+void            eom_job_run                (EomJob          *job);
+void            eom_job_set_progress       (EomJob          *job,
+					    float            progress);
+
+/* EomJobThumbnail */
+GType           eom_job_thumbnail_get_type (void) G_GNUC_CONST;
+EomJob         *eom_job_thumbnail_new      (EomImage     *image);
+
+/* EomJobLoad */
+GType           eom_job_load_get_type      (void) G_GNUC_CONST;
+EomJob 	       *eom_job_load_new 	   (EomImage        *image,
+					    EomImageData     data);
+
+/* EomJobModel */
+GType 		eom_job_model_get_type     (void) G_GNUC_CONST;
+EomJob 	       *eom_job_model_new          (GSList          *file_list);
+
+/* EomJobTransform */
+GType 		eom_job_transform_get_type (void) G_GNUC_CONST;
+EomJob 	       *eom_job_transform_new      (GList           *images,
+					    EomTransform    *trans);
+
+/* EomJobSave */
+GType		eom_job_save_get_type      (void) G_GNUC_CONST;
+EomJob         *eom_job_save_new           (GList           *images);
+
+/* EomJobSaveAs */
+GType		eom_job_save_as_get_type   (void) G_GNUC_CONST;
+EomJob         *eom_job_save_as_new        (GList           *images,
+					    EomURIConverter *converter,
+					    GFile           *file);
+
+/* EomJobCopy */
+GType          eom_job_copy_get_type      (void) G_GNUC_CONST;
+EomJob        *eom_job_copy_new           (GList            *images,
+					   const gchar      *dest);
+
+G_END_DECLS
+
+#endif /* __EOM_JOBS_H__ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/25.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/25.html new file mode 100644 index 0000000..01b7a2c --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/25.html @@ -0,0 +1,351 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
#ifndef _EOM_IMAGE_SAVE_INFO_H_
+#define _EOM_IMAGE_SAVE_INFO_H_
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gdk-pixbuf/gdk-pixbuf.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+#ifndef __EOM_IMAGE_DECLR__
+#define __EOM_IMAGE_DECLR__
+typedef struct _EomImage EomImage;
+#endif
+
+#define EOM_TYPE_IMAGE_SAVE_INFO            (eom_image_save_info_get_type ())
+#define EOM_IMAGE_SAVE_INFO(o)         (G_TYPE_CHECK_INSTANCE_CAST ((o), EOM_TYPE_IMAGE_SAVE_INFO, EomImageSaveInfo))
+#define EOM_IMAGE_SAVE_INFO_CLASS(k)   (G_TYPE_CHECK_CLASS_CAST((k), EOM_TYPE_IMAGE_SAVE_INFO, EomImageSaveInfoClass))
+#define EOM_IS_IMAGE_SAVE_INFO(o)         (G_TYPE_CHECK_INSTANCE_TYPE ((o), EOM_TYPE_IMAGE_SAVE_INFO))
+#define EOM_IS_IMAGE_SAVE_INFO_CLASS(k)   (G_TYPE_CHECK_CLASS_TYPE ((k), EOM_TYPE_IMAGE_SAVE_INFO))
+#define EOM_IMAGE_SAVE_INFO_GET_CLASS(o)  (G_TYPE_INSTANCE_GET_CLASS ((o), EOM_TYPE_IMAGE_SAVE_INFO, EomImageSaveInfoClass))
+
+typedef struct _EomImageSaveInfo EomImageSaveInfo;
+typedef struct _EomImageSaveInfoClass EomImageSaveInfoClass;
+
+struct _EomImageSaveInfo {
+	GObject parent;
+
+	GFile       *file;
+	char        *format;
+	gboolean     exists;
+	gboolean     local;
+	gboolean     has_metadata;
+	gboolean     modified;
+	gboolean     overwrite;
+
+	float        jpeg_quality; /* valid range: [0.0 ... 1.0] */
+};
+
+struct _EomImageSaveInfoClass {
+	GObjectClass parent_klass;
+};
+
+#define EOM_FILE_FORMAT_JPEG   "jpeg"
+
+GType             eom_image_save_info_get_type         (void) G_GNUC_CONST;
+
+EomImageSaveInfo *eom_image_save_info_new_from_image   (EomImage        *image);
+
+EomImageSaveInfo *eom_image_save_info_new_from_uri     (const char      *uri,
+						       GdkPixbufFormat  *format);
+
+EomImageSaveInfo *eom_image_save_info_new_from_file    (GFile           *file,
+						       GdkPixbufFormat  *format);
+
+G_END_DECLS
+
+#endif /* _EOM_IMAGE_SAVE_INFO_H_ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/26.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/26.html new file mode 100644 index 0000000..8686d85 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/26.html @@ -0,0 +1,681 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye Of Mate - Image
+ *
+ * Copyright (C) 2007 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __EOM_IMAGE_H__
+#define __EOM_IMAGE_H__
+
+#include "eom-jobs.h"
+#include "eom-window.h"
+#include "eom-transform.h"
+#include "eom-image-save-info.h"
+#include "eom-enums.h"
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gdk-pixbuf/gdk-pixbuf.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#ifdef HAVE_EXIF
+#include <libexif/exif-data.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "eom-exif-util.h"
+#endif
+
+#ifdef HAVE_LCMS
+#include <lcms2.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#ifdef HAVE_EXEMPI
+#include <exempi/xmp.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#ifdef HAVE_RSVG
+#include <librsvg/rsvg.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+G_BEGIN_DECLS
+
+#ifndef __EOM_IMAGE_DECLR__
+#define __EOM_IMAGE_DECLR__
+typedef struct _EomImage EomImage;
+#endif
+typedef struct _EomImageClass EomImageClass;
+typedef struct _EomImagePrivate EomImagePrivate;
+
+#define EOM_TYPE_IMAGE            (eom_image_get_type ())
+#define EOM_IMAGE(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), EOM_TYPE_IMAGE, EomImage))
+#define EOM_IMAGE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  EOM_TYPE_IMAGE, EomImageClass))
+#define EOM_IS_IMAGE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), EOM_TYPE_IMAGE))
+#define EOM_IS_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  EOM_TYPE_IMAGE))
+#define EOM_IMAGE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  EOM_TYPE_IMAGE, EomImageClass))
+
+typedef enum {
+	EOM_IMAGE_ERROR_SAVE_NOT_LOCAL,
+	EOM_IMAGE_ERROR_NOT_LOADED,
+	EOM_IMAGE_ERROR_VFS,
+	EOM_IMAGE_ERROR_FILE_EXISTS,
+	EOM_IMAGE_ERROR_TMP_FILE_FAILED,
+	EOM_IMAGE_ERROR_GENERIC,
+	EOM_IMAGE_ERROR_UNKNOWN
+} EomImageError;
+
+#define EOM_IMAGE_ERROR eom_image_error_quark ()
+
+typedef enum {
+	EOM_IMAGE_STATUS_UNKNOWN,
+	EOM_IMAGE_STATUS_LOADING,
+	EOM_IMAGE_STATUS_LOADED,
+	EOM_IMAGE_STATUS_SAVING,
+	EOM_IMAGE_STATUS_FAILED
+} EomImageStatus;
+
+typedef enum {
+  EOM_IMAGE_METADATA_NOT_READ,
+  EOM_IMAGE_METADATA_NOT_AVAILABLE,
+  EOM_IMAGE_METADATA_READY
+} EomImageMetadataStatus;
+
+struct _EomImage {
+	GObject parent;
+
+	EomImagePrivate *priv;
+};
+
+struct _EomImageClass {
+	GObjectClass parent_class;
+
+	void (* changed) 	   (EomImage *img);
+
+	void (* size_prepared)     (EomImage *img,
+				    int       width,
+				    int       height);
+
+	void (* thumbnail_changed) (EomImage *img);
+
+	void (* save_progress)     (EomImage *img,
+				    gfloat    progress);
+
+	void (* next_frame)        (EomImage *img,
+				    gint delay);
+
+	void (* file_changed)      (EomImage *img);
+};
+
+GType	          eom_image_get_type	             (void) G_GNUC_CONST;
+
+GQuark            eom_image_error_quark              (void);
+
+EomImage         *eom_image_new_file                 (GFile *file, const gchar *caption);
+
+gboolean          eom_image_load                     (EomImage   *img,
+					              EomImageData data2read,
+					              EomJob     *job,
+					              GError    **error);
+
+void              eom_image_cancel_load              (EomImage   *img);
+
+gboolean          eom_image_has_data                 (EomImage   *img,
+					              EomImageData data);
+
+void              eom_image_data_ref                 (EomImage   *img);
+
+void              eom_image_data_unref               (EomImage   *img);
+
+void              eom_image_set_thumbnail            (EomImage   *img,
+					              GdkPixbuf  *pixbuf);
+
+gboolean          eom_image_save_as_by_info          (EomImage   *img,
+		      			              EomImageSaveInfo *source,
+		      			              EomImageSaveInfo *target,
+		      			              GError    **error);
+
+gboolean          eom_image_save_by_info             (EomImage   *img,
+					              EomImageSaveInfo *source,
+					              GError    **error);
+
+GdkPixbuf*        eom_image_get_pixbuf               (EomImage   *img);
+
+GdkPixbuf*        eom_image_get_thumbnail            (EomImage   *img);
+
+void              eom_image_get_size                 (EomImage   *img,
+					              gint       *width,
+					              gint       *height);
+
+goffset           eom_image_get_bytes                (EomImage   *img);
+
+gboolean          eom_image_is_modified              (EomImage   *img);
+
+void              eom_image_modified                 (EomImage   *img);
+
+const gchar*      eom_image_get_caption              (EomImage   *img);
+
+const gchar      *eom_image_get_collate_key          (EomImage   *img);
+
+#ifdef HAVE_EXIF
+ExifData*         eom_image_get_exif_info            (EomImage   *img);
+#endif
+
+gpointer          eom_image_get_xmp_info             (EomImage   *img);
+
+GFile*            eom_image_get_file                 (EomImage   *img);
+
+gchar*            eom_image_get_uri_for_display      (EomImage   *img);
+
+EomImageStatus    eom_image_get_status               (EomImage   *img);
+
+EomImageMetadataStatus eom_image_get_metadata_status (EomImage   *img);
+
+void              eom_image_transform                (EomImage   *img,
+						      EomTransform *trans,
+						      EomJob     *job);
+
+void              eom_image_autorotate               (EomImage   *img);
+
+#ifdef HAVE_LCMS
+cmsHPROFILE       eom_image_get_profile              (EomImage    *img);
+
+void              eom_image_apply_display_profile    (EomImage    *img,
+						      cmsHPROFILE  display_profile);
+#endif
+
+void              eom_image_undo                     (EomImage   *img);
+
+GList		 *eom_image_get_supported_mime_types (void);
+
+gboolean          eom_image_is_supported_mime_type   (const char *mime_type);
+
+gboolean          eom_image_is_animation             (EomImage *img);
+
+gboolean          eom_image_start_animation          (EomImage *img);
+
+#ifdef HAVE_RSVG
+gboolean          eom_image_is_svg                   (EomImage *img);
+RsvgHandle       *eom_image_get_svg                  (EomImage *img);
+#endif
+
+EomTransform     *eom_image_get_transform            (EomImage *img);
+EomTransform     *eom_image_get_autorotate_transform (EomImage *img);
+
+gboolean          eom_image_is_jpeg                  (EomImage *img);
+
+void              eom_image_file_changed             (EomImage *img);
+gboolean          eom_image_is_file_changed         (EomImage *img);
+
+G_END_DECLS
+
+#endif /* __EOM_IMAGE_H__ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/27.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/27.html new file mode 100644 index 0000000..cb2850b --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/27.html @@ -0,0 +1,497 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye of Mate - Main Window
+ *
+ * Copyright (C) 2000-2008 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on code by:
+ * 	- Federico Mena-Quintero <federico@gnu.org>
+ *	- Jens Finke <jens@gnome.org>
+ * Based on evince code (shell/ev-window.c) by:
+ * 	- Martin Kretzschmar <martink@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __EOM_WINDOW_H__
+#define __EOM_WINDOW_H__
+
+#include "eom-list-store.h"
+#include "eom-image.h"
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+typedef struct _EomWindow EomWindow;
+typedef struct _EomWindowClass EomWindowClass;
+typedef struct _EomWindowPrivate EomWindowPrivate;
+
+#define EOM_TYPE_WINDOW            (eom_window_get_type ())
+#define EOM_WINDOW(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), EOM_TYPE_WINDOW, EomWindow))
+#define EOM_WINDOW_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  EOM_TYPE_WINDOW, EomWindowClass))
+#define EOM_IS_WINDOW(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EOM_TYPE_WINDOW))
+#define EOM_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  EOM_TYPE_WINDOW))
+#define EOM_WINDOW_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  EOM_TYPE_WINDOW, EomWindowClass))
+
+#define EOM_WINDOW_ERROR           (eom_window_error_quark ())
+
+typedef enum {
+	EOM_WINDOW_MODE_UNKNOWN,
+	EOM_WINDOW_MODE_NORMAL,
+	EOM_WINDOW_MODE_FULLSCREEN,
+	EOM_WINDOW_MODE_SLIDESHOW
+} EomWindowMode;
+
+typedef enum {
+	EOM_WINDOW_COLLECTION_POS_BOTTOM,
+	EOM_WINDOW_COLLECTION_POS_LEFT,
+	EOM_WINDOW_COLLECTION_POS_TOP,
+	EOM_WINDOW_COLLECTION_POS_RIGHT
+} EomWindowCollectionPos;
+
+//TODO
+typedef enum {
+	EOM_WINDOW_ERROR_CONTROL_NOT_FOUND,
+	EOM_WINDOW_ERROR_UI_NOT_FOUND,
+	EOM_WINDOW_ERROR_NO_PERSIST_FILE_INTERFACE,
+	EOM_WINDOW_ERROR_IO,
+	EOM_WINDOW_ERROR_TRASH_NOT_FOUND,
+	EOM_WINDOW_ERROR_GENERIC,
+	EOM_WINDOW_ERROR_UNKNOWN
+} EomWindowError;
+
+typedef enum {
+	EOM_STARTUP_FULLSCREEN         = 1 << 0,
+	EOM_STARTUP_SLIDE_SHOW         = 1 << 1,
+	EOM_STARTUP_DISABLE_COLLECTION = 1 << 2
+} EomStartupFlags;
+
+struct _EomWindow {
+	GtkApplicationWindow win;
+
+	EomWindowPrivate *priv;
+};
+
+struct _EomWindowClass {
+	GtkApplicationWindowClass parent_class;
+
+	void (* prepared) (EomWindow *window);
+};
+
+GType         eom_window_get_type  	(void) G_GNUC_CONST;
+
+GtkWidget    *eom_window_new		(EomStartupFlags  flags);
+
+EomWindowMode eom_window_get_mode       (EomWindow       *window);
+
+void          eom_window_set_mode       (EomWindow       *window,
+					 EomWindowMode    mode);
+
+GtkUIManager *eom_window_get_ui_manager (EomWindow       *window);
+
+EomListStore *eom_window_get_store      (EomWindow       *window);
+
+GtkWidget    *eom_window_get_view       (EomWindow       *window);
+
+GtkWidget    *eom_window_get_sidebar    (EomWindow       *window);
+
+GtkWidget    *eom_window_get_thumb_view (EomWindow       *window);
+
+GtkWidget    *eom_window_get_thumb_nav  (EomWindow       *window);
+
+GtkWidget    *eom_window_get_statusbar  (EomWindow       *window);
+
+EomImage     *eom_window_get_image      (EomWindow       *window);
+
+void          eom_window_open_file_list	(EomWindow       *window,
+					 GSList          *file_list);
+
+gboolean      eom_window_is_empty 	(EomWindow       *window);
+
+void          eom_window_reload_image (EomWindow *window);
+GtkWidget    *eom_window_get_properties_dialog (EomWindow *window);
+G_END_DECLS
+
+#endif
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/28.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/28.html new file mode 100644 index 0000000..8a2c9ad --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/28.html @@ -0,0 +1,361 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/* Eye Of Mate - EXIF Utilities
+ *
+ * Copyright (C) 2006-2007 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ * Author: Claudio Saavedra <csaavedra@alumnos.utalca.cl>
+ * Author: Felix Riemann <felix@hsgheli.de>
+ *
+ * Based on code by:
+ *	- Jens Finke <jens@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __EOM_EXIF_UTIL_H__
+#define __EOM_EXIF_UTIL_H__
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libexif/exif-data.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+#define EOM_TYPE_EXIF_DATA eom_exif_data_get_type()
+
+gchar       *eom_exif_util_format_date           (const gchar *date);
+void         eom_exif_util_format_datetime_label (GtkLabel *label,
+                                                  ExifData *exif_data,
+                                                  gint tag_id,
+                                                  const gchar *format);
+void         eom_exif_util_set_label_text        (GtkLabel *label,
+                                                  ExifData *exif_data,
+                                                  gint tag_id);
+
+void         eom_exif_util_set_focal_length_label_text (GtkLabel *label,
+                                                        ExifData *exif_data);
+
+const gchar *eom_exif_data_get_value             (ExifData *exif_data,
+                                                  gint tag_id, gchar *buffer,
+                                                  guint buf_size);
+
+GType        eom_exif_data_get_type              (void) G_GNUC_CONST;
+
+ExifData    *eom_exif_data_copy                  (ExifData *data);
+void         eom_exif_data_free                  (ExifData *data);
+
+G_END_DECLS
+
+#endif /* __EOM_EXIF_UTIL_H__ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/29.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/29.html new file mode 100644 index 0000000..fc98b35 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/29.html @@ -0,0 +1,329 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/* Eye Of Mate - Session Handler
+ *
+ * Copyright (C) 2006 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on gedit code (gedit/gedit-session.h) by:
+ * 	- Gedit Team
+ * 	- Federico Mena-Quintero <federico@ximian.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __EOM_SESSION_H__
+#define __EOM_SESSION_H__
+
+#include "eom-application.h"
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+G_GNUC_INTERNAL
+void 		eom_session_init 		(EomApplication *application);
+
+G_GNUC_INTERNAL
+gboolean 	eom_session_is_restored 	(void);
+
+G_GNUC_INTERNAL
+gboolean 	eom_session_load 		(void);
+
+G_END_DECLS
+
+#endif /* __EOM_SESSION_H__ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/3.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/3.html new file mode 100644 index 0000000..fac57be --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/3.html @@ -0,0 +1,359 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/*
+ *  Copyright (C) 2003 Marco Pesenti Gritti
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This program 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 General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef EGG_TOOLBAR_EDITOR_H
+#define EGG_TOOLBAR_EDITOR_H
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "egg-toolbars-model.h"
+
+G_BEGIN_DECLS
+
+typedef struct EggToolbarEditorClass EggToolbarEditorClass;
+
+#define EGG_TYPE_TOOLBAR_EDITOR             (egg_toolbar_editor_get_type ())
+#define EGG_TOOLBAR_EDITOR(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_TOOLBAR_EDITOR, EggToolbarEditor))
+#define EGG_TOOLBAR_EDITOR_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_TOOLBAR_EDITOR, EggToolbarEditorClass))
+#define EGG_IS_TOOLBAR_EDITOR(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_TOOLBAR_EDITOR))
+#define EGG_IS_TOOLBAR_EDITOR_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_TOOLBAR_EDITOR))
+#define EGG_TOOLBAR_EDITOR_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_TOOLBAR_EDITOR, EggToolbarEditorClass))
+
+typedef struct EggToolbarEditor EggToolbarEditor;
+typedef struct EggToolbarEditorPrivate EggToolbarEditorPrivate;
+
+struct EggToolbarEditor
+{
+  GtkVBox parent_object;
+
+  /*< private >*/
+  EggToolbarEditorPrivate *priv;
+};
+
+struct EggToolbarEditorClass
+{
+  GtkVBoxClass parent_class;
+};
+
+GType             egg_toolbar_editor_get_type     (void);
+GtkWidget        *egg_toolbar_editor_new          (GtkUIManager *manager,
+						   EggToolbarsModel *model);
+void		  egg_toolbar_editor_set_model	  (EggToolbarEditor *t,
+						   EggToolbarsModel *model);
+
+G_END_DECLS
+
+#endif
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/30.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/30.html new file mode 100644 index 0000000..21f1b36 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/30.html @@ -0,0 +1,357 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/* Eye Of Gnome - Application Facade (internal)
+ *
+ * Copyright (C) 2006-2012 The Free Software Foundation
+ * Copyright (C) 2013-2021 MATE developers
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on evince code (shell/ev-application.h) by:
+ * 	- Martin Kretzschmar <martink@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __EOM_APPLICATION_INTERNAL_H__
+#define __EOM_APPLICATION_INTERNAL_H__
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <libpeas/peas-extension-set.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "eom-application.h"
+#include "eom-plugin-engine.h"
+#include "egg-toolbars-model.h"<--- Include file: "egg-toolbars-model.h" not found.
+#include "eom-window.h"
+
+G_BEGIN_DECLS
+
+struct _EomApplicationPrivate {
+	EggToolbarsModel *toolbars_model;
+	gchar            *toolbars_file;
+	EomPluginEngine  *plugin_engine;
+
+	EomStartupFlags   flags;
+
+	PeasExtensionSet *extensions;
+};
+
+EggToolbarsModel *eom_application_get_toolbars_model  (EomApplication *application);
+
+void              eom_application_save_toolbars_model (EomApplication *application);
+
+void              eom_application_reset_toolbars_model (EomApplication *app);
+
+G_END_DECLS
+
+#endif /* __EOM_APPLICATION_INTERNAL_H__ */
+
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/31.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/31.html new file mode 100644 index 0000000..c59fdbd --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/31.html @@ -0,0 +1,355 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/* Eye Of Mate - EOM Plugin Engine
+ *
+ * Copyright (C) 2007 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on gedit code (gedit/gedit-plugins-engine.h) by:
+ * 	- Paolo Maggi <paolo@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __EOM_PLUGIN_ENGINE_H__
+#define __EOM_PLUGIN_ENGINE_H__
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libpeas/peas-engine.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+typedef struct _EomPluginEngine EomPluginEngine;
+typedef struct _EomPluginEngineClass EomPluginEngineClass;
+typedef struct _EomPluginEnginePrivate EomPluginEnginePrivate;
+
+#define EOM_TYPE_PLUGIN_ENGINE            eom_plugin_engine_get_type()
+#define EOM_PLUGIN_ENGINE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), EOM_TYPE_PLUGIN_ENGINE, EomPluginEngine))
+#define EOM_PLUGIN_ENGINE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), EOM_TYPE_PLUGIN_ENGINE, EomPluginEngineClass))
+#define EOM_IS_PLUGIN_ENGINE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EOM_TYPE_PLUGIN_ENGINE))
+#define EOM_IS_PLUGIN_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EOM_TYPE_PLUGIN_ENGINE))
+#define EOM_PLUGIN_ENGINE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), EOM_TYPE_PLUGIN_ENGINE, EomPluginEngineClass))
+
+struct _EomPluginEngine {
+	PeasEngine parent;
+	EomPluginEnginePrivate *priv;
+};
+
+struct _EomPluginEngineClass {
+	PeasEngineClass parent_class;
+};
+
+GType eom_plugin_engine_get_type (void) G_GNUC_CONST;
+
+EomPluginEngine* eom_plugin_engine_new (void);
+
+G_END_DECLS
+
+#endif  /* __EOM_PLUGIN_ENGINE_H__ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/32.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/32.html new file mode 100644 index 0000000..b26c969 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/32.html @@ -0,0 +1,383 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/* Eye Of Mate - General Utilities
+ *
+ * Copyright (C) 2006 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on code by:
+ *	- Jens Finke <jens@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __EOM_UTIL_H__
+#define __EOM_UTIL_H__
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+G_GNUC_INTERNAL
+void     eom_util_show_help                  (const gchar *section,
+					      GtkWindow   *parent);
+
+G_GNUC_INTERNAL
+gchar   *eom_util_make_valid_utf8            (const gchar *name);
+
+G_GNUC_INTERNAL
+GSList  *eom_util_parse_uri_string_list_to_file_list (const gchar *uri_list);
+
+G_GNUC_INTERNAL
+GSList  *eom_util_string_list_to_file_list    (GSList *string_list);
+
+G_GNUC_INTERNAL
+GSList  *eom_util_strings_to_file_list        (gchar **strings);
+
+G_GNUC_INTERNAL
+GSList  *eom_util_string_array_to_list       (const gchar **files,
+	 				      gboolean create_uri);
+
+G_GNUC_INTERNAL
+gchar  **eom_util_string_array_make_absolute (gchar **files);
+
+G_GNUC_INTERNAL
+const    gchar *eom_util_dot_dir             (void);
+
+G_GNUC_INTERNAL
+char *  eom_util_filename_get_extension      (const char * filename_with_extension);
+
+G_GNUC_INTERNAL
+gboolean eom_util_file_is_persistent (GFile *file);
+
+G_GNUC_INTERNAL
+void     eom_util_show_file_in_filemanager   (GFile *file,
+                                              GtkWindow *toplevel);
+
+gboolean eom_notebook_scroll_event_cb        (GtkWidget      *notebook,
+                                              GdkEventScroll *event);
+
+G_END_DECLS
+
+#endif /* __EOM_UTIL_H__ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/33.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/33.html new file mode 100644 index 0000000..678860d --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/33.html @@ -0,0 +1,1295 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye Of Mate - Application Facade
+ *
+ * Copyright (C) 2006 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on evince code (shell/ev-application.h) by:
+ * 	- Martin Kretzschmar <martink@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"<--- Include file: "config.h" not found.
+#endif
+
+#include "eom-image.h"
+#include "eom-session.h"
+#include "eom-window.h"
+#include "eom-application.h"
+#include "eom-application-activatable.h"
+#include "eom-application-internal.h"
+#include "eom-util.h"
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gdk/gdkx.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define APPLICATION_SERVICE_NAME "org.mate.eom.ApplicationService"
+
+static void eom_application_load_accelerators (void);
+static void eom_application_save_accelerators (void);
+
+G_DEFINE_TYPE_WITH_PRIVATE (EomApplication, eom_application, GTK_TYPE_APPLICATION);
+
+static void
+eom_application_activate (GApplication *application)
+{
+	eom_application_open_window (EOM_APPLICATION (application),
+				     GDK_CURRENT_TIME,
+				     EOM_APPLICATION (application)->priv->flags,
+				     NULL);
+}
+
+static void
+eom_application_open (GApplication *application,
+		      GFile       **files,
+		      gint          n_files,
+		      const gchar  *hint)
+{
+	GSList *list = NULL;
+
+	while (n_files--)
+		list = g_slist_prepend (list, files[n_files]);
+
+	eom_application_open_file_list (EOM_APPLICATION (application),
+					list, GDK_CURRENT_TIME,
+					EOM_APPLICATION (application)->priv->flags,
+					NULL);
+}
+
+static void
+eom_application_finalize (GObject *object)
+{
+	EomApplication *application = EOM_APPLICATION (object);
+	EomApplicationPrivate *priv = application->priv;
+
+	if (priv->toolbars_model) {
+		g_object_unref (priv->toolbars_model);
+		priv->toolbars_model = NULL;
+		g_free (priv->toolbars_file);
+		priv->toolbars_file = NULL;
+	}
+
+	g_clear_object (&priv->extensions);
+
+	if (priv->plugin_engine) {
+		g_object_unref (priv->plugin_engine);
+		priv->plugin_engine = NULL;
+	}
+	eom_application_save_accelerators ();
+}
+
+static void
+eom_application_add_platform_data (GApplication *application,
+				   GVariantBuilder *builder)
+{
+	EomApplication *app = EOM_APPLICATION (application);
+
+	G_APPLICATION_CLASS (eom_application_parent_class)->add_platform_data (application,
+									       builder);
+
+	if (app->priv->flags) {
+		g_variant_builder_add (builder, "{sv}",
+				       "eom-application-startup-flags",
+				       g_variant_new_byte (app->priv->flags));
+	}
+}
+
+static void
+eom_application_before_emit (GApplication *application,
+			     GVariant *platform_data)
+{
+	GVariantIter iter;
+	const gchar *key;
+	GVariant *value;
+
+	EOM_APPLICATION (application)->priv->flags = 0;
+	g_variant_iter_init (&iter, platform_data);
+	while (g_variant_iter_loop (&iter, "{&sv}", &key, &value)) {
+		if (strcmp (key, "eom-application-startup-flags") == 0) {
+			EOM_APPLICATION (application)->priv->flags = g_variant_get_byte (value);
+		}
+	}
+
+	G_APPLICATION_CLASS (eom_application_parent_class)->before_emit (application,
+									 platform_data);
+}
+
+static void
+eom_application_class_init (EomApplicationClass *eom_application_class)
+{
+	GApplicationClass *application_class;
+	GObjectClass *object_class;
+
+	application_class = (GApplicationClass *) eom_application_class;
+	object_class = (GObjectClass *) eom_application_class;
+
+	object_class->finalize = eom_application_finalize;
+
+	application_class->activate = eom_application_activate;
+	application_class->open = eom_application_open;
+	application_class->add_platform_data = eom_application_add_platform_data;
+	application_class->before_emit = eom_application_before_emit;
+}
+
+static void
+on_extension_added (PeasExtensionSet *set,
+                    PeasPluginInfo   *info,
+                    PeasExtension    *exten,
+                    EomApplication   *app)
+{
+	eom_application_activatable_activate (EOM_APPLICATION_ACTIVATABLE (exten));
+}
+
+static void
+on_extension_removed (PeasExtensionSet *set,
+                      PeasPluginInfo   *info,
+                      PeasExtension    *exten,
+                      EomApplication   *app)
+{
+	eom_application_activatable_deactivate (EOM_APPLICATION_ACTIVATABLE (exten));
+}
+
+static void
+eom_application_init (EomApplication *eom_application)
+{
+	EomApplicationPrivate *priv;
+	const gchar *dot_dir = eom_util_dot_dir ();
+
+	eom_session_init (eom_application);
+
+	eom_application->priv = eom_application_get_instance_private (eom_application);
+	priv = eom_application->priv;
+
+	priv->toolbars_model = egg_toolbars_model_new ();
+	priv->plugin_engine = eom_plugin_engine_new ();
+	priv->flags = 0;
+
+	egg_toolbars_model_load_names (priv->toolbars_model,
+				       EOM_DATA_DIR "/eom-toolbar.xml");
+
+	if (G_LIKELY (dot_dir != NULL))
+		priv->toolbars_file = g_build_filename
+			(dot_dir, "eom_toolbar.xml", NULL);
+
+	if (!dot_dir || !egg_toolbars_model_load_toolbars (priv->toolbars_model,
+					       priv->toolbars_file)) {
+
+		egg_toolbars_model_load_toolbars (priv->toolbars_model,
+						  EOM_DATA_DIR "/eom-toolbar.xml");
+	}
+
+	egg_toolbars_model_set_flags (priv->toolbars_model, 0,
+				      EGG_TB_MODEL_NOT_REMOVABLE);
+
+	eom_application_load_accelerators ();
+
+	priv->extensions = peas_extension_set_new (
+	                           PEAS_ENGINE (priv->plugin_engine),
+	                           EOM_TYPE_APPLICATION_ACTIVATABLE,
+	                           "app",  EOM_APPLICATION (eom_application),
+	                           NULL);
+	peas_extension_set_call (priv->extensions, "activate");
+	g_signal_connect (priv->extensions, "extension-added",
+	                  G_CALLBACK (on_extension_added), eom_application);
+	g_signal_connect (priv->extensions, "extension-removed",
+	                  G_CALLBACK (on_extension_removed), eom_application);
+}
+
+/**
+ * eom_application_get_instance:
+ *
+ * Returns a singleton instance of #EomApplication currently running.
+ * If not running yet, it will create one.
+ *
+ * Returns: (transfer none): a running #EomApplication.
+ **/
+EomApplication *
+eom_application_get_instance (void)
+{
+	static EomApplication *instance;
+
+	if (!instance) {
+		instance = EOM_APPLICATION (g_object_new (EOM_TYPE_APPLICATION,
+							  "application-id", APPLICATION_SERVICE_NAME,
+							  "flags", G_APPLICATION_HANDLES_OPEN,
+							  NULL));
+	}
+
+	return instance;
+}
+
+static EomWindow *
+eom_application_get_empty_window (EomApplication *application)
+{
+	EomWindow *empty_window = NULL;
+	GList *windows;
+	GList *l;
+
+	g_return_val_if_fail (EOM_IS_APPLICATION (application), NULL);
+
+	windows = gtk_application_get_windows (GTK_APPLICATION (application));
+
+	for (l = windows; l != NULL; l = l->next) {
+		EomWindow *window = EOM_WINDOW (l->data);
+
+		if (eom_window_is_empty (window)) {
+			empty_window = window;
+			break;
+		}
+	}
+
+	return empty_window;
+}
+
+/**
+ * eom_application_open_window:
+ * @application: An #EomApplication.
+ * @timestamp: The timestamp of the user interaction which triggered this call
+ * (see gtk_window_present_with_time()).
+ * @flags: A set of #EomStartupFlags influencing a new windows' state.
+ * @error: Return location for a #GError, or NULL to ignore errors.
+ *
+ * Opens and presents an empty #EomWindow to the user. If there is
+ * an empty window already open, this will be used. Otherwise, a
+ * new one will be instantiated.
+ *
+ * Returns: %FALSE if @application is invalid, %TRUE otherwise
+ **/
+gboolean
+eom_application_open_window (EomApplication  *application,
+			     guint32         timestamp,
+			     EomStartupFlags flags,
+			     GError        **error)
+{
+	GtkWidget *new_window = NULL;
+
+	new_window = GTK_WIDGET (eom_application_get_empty_window (application));
+
+	if (new_window == NULL) {
+		new_window = eom_window_new (flags);
+	}
+
+	g_return_val_if_fail (EOM_IS_APPLICATION (application), FALSE);
+
+	gtk_window_present_with_time (GTK_WINDOW (new_window),
+				      timestamp);
+
+	return TRUE;
+}
+
+static EomWindow *
+eom_application_get_file_window (EomApplication *application, GFile *file)
+{
+	EomWindow *file_window = NULL;
+	GList *windows;
+	GList *l;
+
+	g_return_val_if_fail (file != NULL, NULL);
+	g_return_val_if_fail (EOM_IS_APPLICATION (application), NULL);
+
+	windows = gtk_window_list_toplevels ();
+
+	for (l = windows; l != NULL; l = l->next) {
+		if (EOM_IS_WINDOW (l->data)) {
+			EomWindow *window = EOM_WINDOW (l->data);
+
+			if (!eom_window_is_empty (window)) {
+				EomImage *image = eom_window_get_image (window);
+				GFile *window_file;
+
+				window_file = eom_image_get_file (image);
+				if (g_file_equal (window_file, file)) {
+					file_window = window;
+					break;
+				}
+			}
+		}
+	}
+
+	g_list_free (windows);
+
+	return file_window;
+}
+
+static void
+eom_application_show_window (EomWindow *window, gpointer user_data)
+{
+	if (!gtk_widget_get_realized (GTK_WIDGET (window)))
+		gtk_widget_realize (GTK_WIDGET (window));
+
+	gtk_window_present_with_time (GTK_WINDOW (window),
+				      GPOINTER_TO_UINT (user_data));
+}
+
+/**
+ * eom_application_open_file_list:
+ * @application: An #EomApplication.
+ * @file_list: (element-type GFile): A list of #GFile<!-- -->s
+ * @timestamp: The timestamp of the user interaction which triggered this call
+ * (see gtk_window_present_with_time()).
+ * @flags: A set of #EomStartupFlags influencing a new windows' state.
+ * @error: Return location for a #GError, or NULL to ignore errors.
+ *
+ * Opens a list of files in a #EomWindow. If an #EomWindow displaying the first
+ * image in the list is already open, this will be used. Otherwise, an empty
+ * #EomWindow is used, either already existing or newly created.
+ *
+ * Returns: Currently always %TRUE.
+ **/
+gboolean
+eom_application_open_file_list (EomApplication  *application,
+				GSList          *file_list,
+				guint           timestamp,
+				EomStartupFlags flags,
+				GError         **error)
+{
+	EomWindow *new_window = NULL;
+
+	if (file_list != NULL)
+		new_window = eom_application_get_file_window (application,
+							      (GFile *) file_list->data);
+
+	if (new_window != NULL) {
+		gtk_window_present_with_time (GTK_WINDOW (new_window),
+					      timestamp);
+		return TRUE;
+	}
+
+	new_window = eom_application_get_empty_window (application);
+
+	if (new_window == NULL) {
+		new_window = EOM_WINDOW (eom_window_new (flags));
+	}
+
+	g_signal_connect (new_window,
+			  "prepared",
+			  G_CALLBACK (eom_application_show_window),
+			  GUINT_TO_POINTER (timestamp));
+
+	eom_window_open_file_list (new_window, file_list);
+
+	return TRUE;
+}
+
+/**
+ * eom_application_open_uri_list:
+ * @application: An #EomApplication.
+ * @uri_list: (element-type utf8): A list of URIs.
+ * @timestamp: The timestamp of the user interaction which triggered this call
+ * (see gtk_window_present_with_time()).
+ * @flags: A set of #EomStartupFlags influencing a new windows' state.
+ * @error: Return location for a #GError, or NULL to ignore errors.
+ *
+ * Opens a list of images, from a list of URIs. See
+ * eom_application_open_file_list() for details.
+ *
+ * Returns: Currently always %TRUE.
+ **/
+gboolean
+eom_application_open_uri_list (EomApplication  *application,
+ 			       GSList          *uri_list,
+ 			       guint           timestamp,
+ 			       EomStartupFlags flags,
+ 			       GError         **error)
+{
+ 	GSList *file_list = NULL;
+
+ 	g_return_val_if_fail (EOM_IS_APPLICATION (application), FALSE);
+
+ 	file_list = eom_util_string_list_to_file_list (uri_list);
+
+ 	return eom_application_open_file_list (application,
+					       file_list,
+					       timestamp,
+					       flags,
+					       error);
+}
+
+/**
+ * eom_application_open_uris:
+ * @application: an #EomApplication
+ * @uris:  A #GList of URI strings.
+ * @timestamp: The timestamp of the user interaction which triggered this call
+ * (see gtk_window_present_with_time()).
+ * @flags: A set of #EomStartupFlags influencing a new windows' state.
+ * @error: Return location for a #GError, or NULL to ignore errors.
+ *
+ * Opens a list of images, from a list of URI strings. See
+ * eom_application_open_file_list() for details.
+ *
+ * Returns: Currently always %TRUE.
+ **/
+gboolean
+eom_application_open_uris (EomApplication  *application,
+ 			   gchar          **uris,
+ 			   guint           timestamp,
+ 			   EomStartupFlags flags,
+ 			   GError        **error)
+{
+ 	GSList *file_list = NULL;
+
+ 	file_list = eom_util_strings_to_file_list (uris);
+
+ 	return eom_application_open_file_list (application, file_list, timestamp,
+						    flags, error);
+}
+
+/**
+ * eom_application_get_toolbars_model:
+ * @application: An #EomApplication.
+ *
+ * Retrieves the #EggToolbarsModel for the toolbar in #EomApplication.
+ *
+ * Returns: (transfer none): An #EggToolbarsModel.
+ **/
+EggToolbarsModel *
+eom_application_get_toolbars_model (EomApplication *application)
+{
+	g_return_val_if_fail (EOM_IS_APPLICATION (application), NULL);
+
+	return application->priv->toolbars_model;
+}
+
+/**
+ * eom_application_save_toolbars_model:
+ * @application: An #EomApplication.
+ *
+ * Causes the saving of the model of the toolbar in #EomApplication to a file.
+ **/
+void
+eom_application_save_toolbars_model (EomApplication *application)
+{
+	if (G_LIKELY(application->priv->toolbars_file != NULL))
+        	egg_toolbars_model_save_toolbars (application->priv->toolbars_model,
+				 	          application->priv->toolbars_file,
+						  "1.0");
+}
+
+/**
+ * eom_application_reset_toolbars_model:
+ * @app: an #EomApplication
+ *
+ * Restores the toolbars model to the defaults.
+ **/
+void
+eom_application_reset_toolbars_model (EomApplication *app)
+{
+	EomApplicationPrivate *priv;
+	g_return_if_fail (EOM_IS_APPLICATION (app));
+
+	priv = app->priv;
+
+	g_object_unref (app->priv->toolbars_model);
+
+	priv->toolbars_model = egg_toolbars_model_new ();
+
+	egg_toolbars_model_load_names (priv->toolbars_model,
+				       EOM_DATA_DIR "/eom-toolbar.xml");
+	egg_toolbars_model_load_toolbars (priv->toolbars_model,
+					  EOM_DATA_DIR "/eom-toolbar.xml");
+	egg_toolbars_model_set_flags (priv->toolbars_model, 0,
+				      EGG_TB_MODEL_NOT_REMOVABLE);
+}
+
+static void
+eom_application_load_accelerators (void)
+{
+		gchar* accelfile = g_build_filename(g_get_user_config_dir(), "mate", "accels", "eom", NULL);
+
+	/* gtk_accel_map_load does nothing if the file does not exist */
+	gtk_accel_map_load (accelfile);
+	g_free (accelfile);
+}
+
+static void
+eom_application_save_accelerators (void)
+{
+		gchar* accelfile = g_build_filename(g_get_user_config_dir(), "mate", "accels", "eom", NULL);
+
+	gtk_accel_map_save (accelfile);
+	g_free (accelfile);
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/34.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/34.html new file mode 100644 index 0000000..1fbf6ce --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/34.html @@ -0,0 +1,875 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/*
+ * eom-clipboard-handler.c
+ * This file is part of eom
+ *
+ * Author: Felix Riemann <friemann@gnome.org>
+ *
+ * Copyright (C) 2010 GNOME Foundation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gdk-pixbuf/gdk-pixbuf.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "eom-clipboard-handler.h"
+
+enum {
+	PROP_0,
+	PROP_PIXBUF,
+	PROP_URI
+};
+
+enum {
+	TARGET_PIXBUF,
+	TARGET_TEXT,
+	TARGET_URI
+};
+
+struct _EomClipboardHandlerPrivate {
+	GdkPixbuf *pixbuf;
+	gchar     *uri;
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (EomClipboardHandler, eom_clipboard_handler, G_TYPE_INITIALLY_UNOWNED)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
+
+static GdkPixbuf*
+eom_clipboard_handler_get_pixbuf (EomClipboardHandler *handler)
+{
+	g_return_val_if_fail (EOM_IS_CLIPBOARD_HANDLER (handler), NULL);
+
+	return handler->priv->pixbuf;
+}
+
+static const gchar *
+eom_clipboard_handler_get_uri (EomClipboardHandler *handler)
+{
+	g_return_val_if_fail (EOM_IS_CLIPBOARD_HANDLER (handler), NULL);
+
+	return handler->priv->uri;
+}
+
+static void
+eom_clipboard_handler_set_pixbuf (EomClipboardHandler *handler, GdkPixbuf *pixbuf)
+{
+	g_return_if_fail (EOM_IS_CLIPBOARD_HANDLER (handler));
+	g_return_if_fail (pixbuf == NULL || GDK_IS_PIXBUF (pixbuf));
+
+	if (handler->priv->pixbuf == pixbuf)
+		return;
+
+	if (handler->priv->pixbuf)
+		g_object_unref (handler->priv->pixbuf);
+
+	handler->priv->pixbuf = g_object_ref (pixbuf);
+
+	g_object_notify (G_OBJECT (handler), "pixbuf");
+}
+
+static void
+eom_clipboard_handler_set_uri (EomClipboardHandler *handler, const gchar *uri)
+{
+	g_return_if_fail (EOM_IS_CLIPBOARD_HANDLER (handler));
+
+	if (handler->priv->uri != NULL)
+		g_free (handler->priv->uri);
+
+	handler->priv->uri = g_strdup (uri);
+	g_object_notify (G_OBJECT (handler), "uri");
+}
+
+static void
+eom_clipboard_handler_get_property (GObject *object, guint property_id,
+				    GValue *value, GParamSpec *pspec)
+{
+	EomClipboardHandler *handler;
+
+	g_return_if_fail (EOM_IS_CLIPBOARD_HANDLER (object));
+
+	handler = EOM_CLIPBOARD_HANDLER (object);
+
+	switch (property_id) {
+	case PROP_PIXBUF:
+		g_value_set_object (value,
+				    eom_clipboard_handler_get_pixbuf (handler));
+		break;
+	case PROP_URI:
+		g_value_set_string (value,
+				    eom_clipboard_handler_get_uri (handler));
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+	}
+}
+
+static void
+eom_clipboard_handler_set_property (GObject *object, guint property_id,
+				    const GValue *value, GParamSpec *pspec)
+{
+	EomClipboardHandler *handler;
+
+	g_return_if_fail (EOM_IS_CLIPBOARD_HANDLER (object));
+
+	handler = EOM_CLIPBOARD_HANDLER (object);
+
+	switch (property_id) {
+	case PROP_PIXBUF:
+	{
+		GdkPixbuf *pixbuf;
+
+		pixbuf = g_value_get_object (value);
+		eom_clipboard_handler_set_pixbuf (handler, pixbuf);
+		break;
+	}
+	case PROP_URI:
+	{
+		const gchar *uri;
+
+		uri = g_value_get_string (value);
+		eom_clipboard_handler_set_uri (handler, uri);
+		break;
+	}
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+	}
+
+}
+
+static void
+eom_clipboard_handler_dispose (GObject *obj)
+{
+	EomClipboardHandlerPrivate *priv;
+
+	g_return_if_fail (EOM_IS_CLIPBOARD_HANDLER (obj));
+
+	priv = EOM_CLIPBOARD_HANDLER (obj)->priv;
+
+	if (priv->pixbuf != NULL) {
+		g_object_unref (priv->pixbuf);
+		priv->pixbuf = NULL;
+	}
+	if (priv->uri) {
+		g_free (priv->uri);
+		priv->uri = NULL;
+	}
+
+	G_OBJECT_CLASS (eom_clipboard_handler_parent_class)->dispose (obj);
+}
+
+static void
+eom_clipboard_handler_init (EomClipboardHandler *handler)
+{
+	handler->priv = eom_clipboard_handler_get_instance_private (handler);
+}
+
+static void
+eom_clipboard_handler_class_init (EomClipboardHandlerClass *klass)
+{
+	GObjectClass *g_obj_class = G_OBJECT_CLASS (klass);
+
+	g_obj_class->get_property = eom_clipboard_handler_get_property;
+	g_obj_class->set_property = eom_clipboard_handler_set_property;
+	g_obj_class->dispose = eom_clipboard_handler_dispose;
+
+	g_object_class_install_property (
+		g_obj_class, PROP_PIXBUF,
+		g_param_spec_object ("pixbuf", NULL, NULL, GDK_TYPE_PIXBUF,
+				     G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
+				     G_PARAM_STATIC_STRINGS));
+
+	g_object_class_install_property (
+		g_obj_class, PROP_URI,
+		g_param_spec_string ("uri", NULL, NULL, NULL,
+				     G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
+				     G_PARAM_STATIC_STRINGS));
+}
+
+EomClipboardHandler*
+eom_clipboard_handler_new (EomImage *img)
+{
+	GObject *obj;
+	GFile *file;
+	GdkPixbuf *pbuf;
+	gchar *uri;
+
+	g_object_ref (img);
+	pbuf = eom_image_get_pixbuf (img);
+	file = eom_image_get_file (img);
+	uri = g_file_get_uri (file);
+	obj = g_object_new (EOM_TYPE_CLIPBOARD_HANDLER,
+			    "pixbuf", pbuf,
+			    "uri", uri,
+			    NULL);
+	g_free (uri);
+	g_object_unref (file);
+	g_object_unref (pbuf);
+	g_object_unref (img);
+
+	return EOM_CLIPBOARD_HANDLER (obj);
+
+}
+
+static void
+eom_clipboard_handler_get_func (GtkClipboard *clipboard,
+				GtkSelectionData *selection,
+				guint info, gpointer owner)
+{
+	EomClipboardHandler *handler;
+
+	g_return_if_fail (EOM_IS_CLIPBOARD_HANDLER (owner));
+
+	handler = EOM_CLIPBOARD_HANDLER (owner);
+
+	switch (info) {
+	case TARGET_PIXBUF:
+	{
+		GdkPixbuf *pixbuf = eom_clipboard_handler_get_pixbuf (handler);
+		g_object_ref (pixbuf);
+		gtk_selection_data_set_pixbuf (selection, pixbuf);
+		g_object_unref (pixbuf);
+		break;
+	}
+	case TARGET_TEXT:
+	{
+		gtk_selection_data_set_text (selection,
+					     eom_clipboard_handler_get_uri (handler),
+					     -1);
+		break;
+	}
+	case TARGET_URI:
+	{
+		gchar *uris[2];
+		uris[0] = g_strdup (eom_clipboard_handler_get_uri (handler));
+		uris[1] = NULL;
+
+		gtk_selection_data_set_uris (selection, uris);
+		g_free (uris[0]);
+		break;
+	}
+	default:
+		g_return_if_reached ();
+	}
+
+}
+
+static void
+eom_clipboard_handler_clear_func (GtkClipboard *clipboard, gpointer owner)
+{
+	g_return_if_fail (EOM_IS_CLIPBOARD_HANDLER (owner));
+
+	g_object_unref (G_OBJECT (owner));
+}
+
+void
+eom_clipboard_handler_copy_to_clipboard (EomClipboardHandler *handler,
+					 GtkClipboard *clipboard)
+{
+	GtkTargetList *tlist;
+	GtkTargetEntry *targets;
+	gint n_targets = 0;
+	gboolean set = FALSE;
+
+	tlist = gtk_target_list_new (NULL, 0);
+
+	if (handler->priv->pixbuf != NULL)
+		gtk_target_list_add_image_targets (tlist, TARGET_PIXBUF, TRUE);
+
+	if (handler->priv->uri != NULL) {
+		gtk_target_list_add_text_targets (tlist, TARGET_TEXT);
+		gtk_target_list_add_uri_targets (tlist, TARGET_URI);
+	}
+
+	targets = gtk_target_table_new_from_list (tlist, &n_targets);
+
+	// We need to take ownership here if nobody else did
+	g_object_ref_sink (handler);
+
+	if (n_targets > 0) {
+		set = gtk_clipboard_set_with_owner (clipboard,
+						    targets, n_targets,
+						    eom_clipboard_handler_get_func,
+						    eom_clipboard_handler_clear_func,
+						    G_OBJECT (handler));
+
+	}
+
+	if (!set) {
+		gtk_clipboard_clear (clipboard);
+		g_object_unref (handler);
+	}
+
+	gtk_target_table_free (targets, n_targets);
+	gtk_target_list_unref (tlist);
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/35.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/35.html new file mode 100644 index 0000000..addced9 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/35.html @@ -0,0 +1,363 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/*
+ * eom-clipboard-handler.h
+ * This file is part of eom
+ *
+ * Author: Felix Riemann <friemann@gnome.org>
+ *
+ * Copyright (C) 2010 GNOME Foundation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+#ifndef __EOM_CLIPBOARD_HANDLER_H__
+#define __EOM_CLIPBOARD_HANDLER_H__
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "eom-image.h"
+
+G_BEGIN_DECLS
+
+#define EOM_TYPE_CLIPBOARD_HANDLER          (eom_clipboard_handler_get_type ())
+#define EOM_CLIPBOARD_HANDLER(o)            (G_TYPE_CHECK_INSTANCE_CAST ((o), EOM_TYPE_CLIPBOARD_HANDLER, EomClipboardHandler))
+#define EOM_CLIPBOARD_HANDLER_CLASS(k)      (G_TYPE_CHECK_CLASS_CAST((k), EOM_TYPE_CLIPBOARD_HANDLER, EomClipboardHandlerClass))
+#define EOM_IS_CLIPBOARD_HANDLER(o)         (G_TYPE_CHECK_INSTANCE_TYPE ((o), EOM_TYPE_CLIPBOARD_HANDLER))
+#define EOM_IS_CLIPBOARD_HANDLER_CLASS(k)   (G_TYPE_CHECK_CLASS_TYPE ((k), EOM_TYPE_CLIPBOARD_HANDLER))
+#define EOM_CLIPBOARD_HANDLER_GET_CLASS(o)  (G_TYPE_INSTANCE_GET_CLASS ((o), EOM_TYPE_CLIPBOARD_HANDLER, EomClipboardHandlerClass))
+
+typedef struct _EomClipboardHandler EomClipboardHandler;
+typedef struct _EomClipboardHandlerClass EomClipboardHandlerClass;
+typedef struct _EomClipboardHandlerPrivate EomClipboardHandlerPrivate;
+
+struct _EomClipboardHandler {
+	GObject parent;
+
+	EomClipboardHandlerPrivate *priv;
+};
+
+struct _EomClipboardHandlerClass {
+	GObjectClass parent_klass;
+};
+
+GType eom_clipboard_handler_get_type (void) G_GNUC_CONST;
+
+EomClipboardHandler* eom_clipboard_handler_new (EomImage *img);
+
+void eom_clipboard_handler_copy_to_clipboard (EomClipboardHandler *handler,
+					      GtkClipboard *clipboard);
+
+G_END_DECLS
+#endif /* __EOM_CLIPBOARD_HANDLER_H__ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/36.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/36.html new file mode 100644 index 0000000..62c9954 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/36.html @@ -0,0 +1,1601 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/*
+ * eom-close-confirmation-dialog.c
+ * This file is part of eom
+ *
+ * Author: Marcus Carlson <marcus@mejlamej.nu>
+ *
+ * Based on gedit code (gedit/gedit-close-confirmation.c) by gedit Team
+ *
+ * Copyright (C) 2004-2009 GNOME Foundation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "eom-close-confirmation-dialog.h"
+#include <eom-window.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+/* Properties */
+enum
+{
+	PROP_0,
+	PROP_UNSAVED_IMAGES
+};
+
+/* Mode */
+enum
+{
+	SINGLE_IMG_MODE,
+	MULTIPLE_IMGS_MODE
+};
+
+/* Columns */
+enum
+{
+	SAVE_COLUMN,
+	IMAGE_COLUMN,
+	NAME_COLUMN,
+	IMG_COLUMN, /* a handy pointer to the image */
+	N_COLUMNS
+};
+
+struct _EomCloseConfirmationDialogPrivate
+{
+	GList       *unsaved_images;
+
+	GList       *selected_images;
+
+	GtkTreeModel *list_store;
+	GtkCellRenderer *toggle_renderer;
+};
+
+#define GET_MODE(priv) (((priv->unsaved_images != NULL) && \
+			 (priv->unsaved_images->next == NULL)) ? \
+			  SINGLE_IMG_MODE : MULTIPLE_IMGS_MODE)
+
+#define IMAGE_COLUMN_HEIGHT 40
+
+G_DEFINE_TYPE_WITH_PRIVATE (EomCloseConfirmationDialog, eom_close_confirmation_dialog, GTK_TYPE_DIALOG)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
+
+static void 	 set_unsaved_image 		(EomCloseConfirmationDialog *dlg,
+						 const GList                  *list);
+
+static GList 	*get_selected_imgs 		(GtkTreeModel                 *store);
+
+static GdkPixbuf *
+eom_close_confirmation_dialog_get_icon (const gchar *icon_name)
+{
+	GError *error = NULL;
+	GtkIconTheme *icon_theme;
+	GdkPixbuf *pixbuf;
+
+	icon_theme = gtk_icon_theme_get_default ();
+
+	pixbuf = gtk_icon_theme_load_icon (icon_theme,
+					   icon_name,
+					   IMAGE_COLUMN_HEIGHT,
+					   0,
+					   &error);
+
+	if (!pixbuf) {
+		g_warning ("Couldn't load icon: %s", error->message);
+		g_error_free (error);
+	}
+
+	return pixbuf;
+}
+
+static GdkPixbuf*
+get_nothumb_pixbuf (void)
+{
+	static GOnce nothumb_once = G_ONCE_INIT;
+	g_once (&nothumb_once, (GThreadFunc) eom_close_confirmation_dialog_get_icon, "image-x-generic");
+	return GDK_PIXBUF (g_object_ref (nothumb_once.retval));
+}
+
+/*  Since we connect in the costructor we are sure this handler will be called
+ *  before the user ones
+ */
+static void
+response_cb (EomCloseConfirmationDialog *dlg,
+             gint                        response_id,
+             gpointer                    data)
+{
+	EomCloseConfirmationDialogPrivate *priv;
+
+	g_return_if_fail (EOM_IS_CLOSE_CONFIRMATION_DIALOG (dlg));
+
+	priv = dlg->priv;
+
+	if (priv->selected_images != NULL)
+		g_list_free (priv->selected_images);
+
+	if (response_id == GTK_RESPONSE_YES)
+	{
+		if (GET_MODE (priv) == SINGLE_IMG_MODE)
+		{
+			priv->selected_images =
+				g_list_copy (priv->unsaved_images);
+		}
+		else
+		{
+			g_return_if_fail (priv->list_store);
+
+			priv->selected_images =
+				get_selected_imgs (priv->list_store);
+		}
+	}
+	else
+		priv->selected_images = NULL;
+}
+
+static void
+add_buttons (EomCloseConfirmationDialog *dlg)
+{
+	gtk_dialog_add_button (GTK_DIALOG (dlg),
+			       _("Close _without Saving"),
+			       GTK_RESPONSE_NO);
+
+	gtk_dialog_add_button (GTK_DIALOG (dlg),
+			       "gtk-cancel", GTK_RESPONSE_CANCEL);
+
+	gtk_dialog_add_button (GTK_DIALOG (dlg),
+			       "gtk-save",
+			       GTK_RESPONSE_YES);
+
+	gtk_dialog_set_default_response	(GTK_DIALOG (dlg),
+					 GTK_RESPONSE_YES);
+}
+
+static void
+eom_close_confirmation_dialog_init (EomCloseConfirmationDialog *dlg)
+{
+	AtkObject *atk_obj;
+
+	dlg->priv = eom_close_confirmation_dialog_get_instance_private (dlg);
+
+	gtk_container_set_border_width (GTK_CONTAINER (dlg), 5);
+	gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), 14);
+	gtk_window_set_resizable (GTK_WINDOW (dlg), FALSE);
+	gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dlg), TRUE);
+
+	gtk_window_set_title (GTK_WINDOW (dlg), "");
+
+	gtk_window_set_modal (GTK_WINDOW (dlg), TRUE);
+	gtk_window_set_destroy_with_parent (GTK_WINDOW (dlg), TRUE);
+
+	atk_obj = gtk_widget_get_accessible (GTK_WIDGET (dlg));
+	atk_object_set_role (atk_obj, ATK_ROLE_ALERT);
+	atk_object_set_name (atk_obj, _("Question"));
+
+	g_signal_connect (dlg,
+			  "response",
+			  G_CALLBACK (response_cb),
+			  NULL);
+}
+
+static void
+eom_close_confirmation_dialog_finalize (GObject *object)
+{
+	EomCloseConfirmationDialogPrivate *priv;
+
+	priv = EOM_CLOSE_CONFIRMATION_DIALOG (object)->priv;
+
+	if (priv->unsaved_images != NULL)
+		g_list_free (priv->unsaved_images);
+
+	if (priv->selected_images != NULL)
+		g_list_free (priv->selected_images);
+
+	/* Call the parent's destructor */
+	G_OBJECT_CLASS (eom_close_confirmation_dialog_parent_class)->finalize (object);
+}
+
+static void
+eom_close_confirmation_dialog_set_property (GObject      *object,
+					      guint         prop_id,
+					      const GValue *value,
+					      GParamSpec   *pspec)
+{
+	EomCloseConfirmationDialog *dlg;
+
+	dlg = EOM_CLOSE_CONFIRMATION_DIALOG (object);
+
+	switch (prop_id)
+	{
+		case PROP_UNSAVED_IMAGES:
+			set_unsaved_image (dlg, g_value_get_pointer (value));
+			break;
+
+		default:
+			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+			break;
+	}
+}
+
+static void
+eom_close_confirmation_dialog_get_property (GObject    *object,
+					      guint       prop_id,
+					      GValue     *value,
+					      GParamSpec *pspec)
+{
+	EomCloseConfirmationDialogPrivate *priv;
+
+	priv = EOM_CLOSE_CONFIRMATION_DIALOG (object)->priv;
+
+	switch( prop_id )
+	{
+		case PROP_UNSAVED_IMAGES:
+			g_value_set_pointer (value, priv->unsaved_images);
+			break;
+
+		default:
+			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+			break;
+	}
+}
+
+static void
+eom_close_confirmation_dialog_class_init (EomCloseConfirmationDialogClass *klass)
+{
+	GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+	gobject_class->set_property = eom_close_confirmation_dialog_set_property;
+	gobject_class->get_property = eom_close_confirmation_dialog_get_property;
+	gobject_class->finalize = eom_close_confirmation_dialog_finalize;
+
+	g_object_class_install_property (gobject_class,
+					 PROP_UNSAVED_IMAGES,
+					 g_param_spec_pointer ("unsaved_images",
+						 	       "Unsaved Images",
+							       "List of Unsaved Images",
+							       (G_PARAM_READWRITE |
+							        G_PARAM_CONSTRUCT_ONLY)));
+}
+
+static GList *
+get_selected_imgs (GtkTreeModel *store)
+{
+	GList       *list;
+	gboolean     valid;
+	GtkTreeIter  iter;
+
+	list = NULL;
+	valid = gtk_tree_model_get_iter_first (store, &iter);
+
+	while (valid)
+	{
+		gboolean to_save;
+		EomImage *img;
+
+		gtk_tree_model_get (store, &iter,
+				    SAVE_COLUMN, &to_save,
+				    IMG_COLUMN, &img,
+				    -1);
+		if (to_save)
+			list = g_list_prepend (list, img);
+
+		valid = gtk_tree_model_iter_next (store, &iter);
+	}
+
+	list = g_list_reverse (list);
+
+	return list;
+}
+
+GList *
+eom_close_confirmation_dialog_get_selected_images (EomCloseConfirmationDialog *dlg)
+{
+	g_return_val_if_fail (EOM_IS_CLOSE_CONFIRMATION_DIALOG (dlg), NULL);
+
+	return g_list_copy (dlg->priv->selected_images);
+}
+
+GtkWidget *
+eom_close_confirmation_dialog_new (GtkWindow *parent,
+				   GList     *unsaved_images)
+{
+	GtkWidget *dlg;
+	GtkWindowGroup *wg;
+
+	g_return_val_if_fail (unsaved_images != NULL, NULL);
+
+	dlg = GTK_WIDGET (g_object_new (EOM_TYPE_CLOSE_CONFIRMATION_DIALOG,
+				        "unsaved_images", unsaved_images,
+				        NULL));
+	g_return_val_if_fail (dlg != NULL, NULL);
+
+	if (parent != NULL)
+	{
+		wg = gtk_window_get_group (parent);
+
+		/* gtk_window_get_group returns a default group when the given
+		 * window doesn't have a group. Explicitly add the window to
+		 * the group here to make sure it's actually in the returned
+		 * group. It makes no difference if it is already. */
+		gtk_window_group_add_window (wg, parent);
+		gtk_window_group_add_window (wg, GTK_WINDOW (dlg));
+
+		gtk_window_set_transient_for (GTK_WINDOW (dlg), parent);
+	}
+
+	return dlg;
+}
+
+GtkWidget *
+eom_close_confirmation_dialog_new_single (GtkWindow     *parent,
+					  EomImage	*image)
+{
+	GtkWidget *dlg;
+	GList *unsaved_images;
+	g_return_val_if_fail (image != NULL, NULL);
+
+	unsaved_images = g_list_prepend (NULL, image);
+
+	dlg = eom_close_confirmation_dialog_new (parent,
+						 unsaved_images);
+
+	g_list_free (unsaved_images);
+
+	return dlg;
+}
+
+static gchar *
+get_text_secondary_label (EomImage *image)
+{
+	gchar *secondary_msg;
+
+	secondary_msg = g_strdup (_("If you don't save, your changes will be lost."));
+
+	return secondary_msg;
+}
+
+static void
+build_single_img_dialog (EomCloseConfirmationDialog *dlg)
+{
+	GtkWidget     *hbox;
+	GtkWidget     *vbox;
+	GtkWidget     *primary_label;
+	GtkWidget     *secondary_label;
+	GtkWidget     *image;
+	EomImage      *img;
+	const gchar   *image_name;
+	gchar         *str;
+	gchar         *markup_str;
+
+	g_return_if_fail (dlg->priv->unsaved_images->data != NULL);
+	img = EOM_IMAGE (dlg->priv->unsaved_images->data);
+
+	/* Image */
+	image = gtk_image_new_from_icon_name ("dialog-warning",
+					  GTK_ICON_SIZE_DIALOG);
+	gtk_widget_set_valign (image, GTK_ALIGN_START);
+
+	/* Primary label */
+	primary_label = gtk_label_new (NULL);
+	gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE);
+	gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE);
+	gtk_label_set_max_width_chars (GTK_LABEL (primary_label), 88);
+	gtk_label_set_xalign (GTK_LABEL (primary_label), 0.0);
+	gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE);
+
+	image_name = eom_image_get_caption (img);
+
+	str = g_markup_printf_escaped (_("Save changes to image \"%s\" before closing?"),
+				       image_name);
+	markup_str = g_strconcat ("<span weight=\"bold\" size=\"larger\">", str, "</span>", NULL);
+	g_free (str);
+
+	gtk_label_set_markup (GTK_LABEL (primary_label), markup_str);
+	g_free (markup_str);
+
+	/* Secondary label */
+	str = get_text_secondary_label (img);
+
+	secondary_label = gtk_label_new (str);
+	g_free (str);
+	gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE);
+	gtk_label_set_xalign (GTK_LABEL (secondary_label), 0.0);
+	gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE);
+
+	hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
+	gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
+
+	gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
+
+	vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
+
+	gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
+
+	gtk_box_pack_start (GTK_BOX (vbox), primary_label, FALSE, FALSE, 0);
+
+	gtk_box_pack_start (GTK_BOX (vbox), secondary_label, FALSE, FALSE, 0);
+
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))),
+			    hbox,
+	                    FALSE,
+			    FALSE,
+			    0);
+
+	add_buttons (dlg);
+
+	gtk_widget_show_all (hbox);
+}
+
+static void
+populate_model (GtkTreeModel *store, GList *imgs)
+{
+	GtkTreeIter iter;
+
+	while (imgs != NULL)
+	{
+		EomImage *img;
+		const gchar *name;
+		GdkPixbuf *buf = NULL;
+		GdkPixbuf *buf_scaled = NULL;
+
+		img = EOM_IMAGE (imgs->data);
+
+		name = eom_image_get_caption (img);
+		buf = eom_image_get_thumbnail (img);
+
+		if (buf) {
+			int height;
+			int width;
+			double ratio;
+
+			height = gdk_pixbuf_get_height (buf);
+			ratio = IMAGE_COLUMN_HEIGHT / (double) height;
+			width = gdk_pixbuf_get_width (buf);
+			buf_scaled = gdk_pixbuf_scale_simple (buf,
+			                                      (int) (ratio * (double) width),
+			                                      IMAGE_COLUMN_HEIGHT,
+			                                      GDK_INTERP_BILINEAR);
+		} else
+			buf_scaled = get_nothumb_pixbuf ();
+
+		gtk_list_store_append (GTK_LIST_STORE (store), &iter);
+		gtk_list_store_set (GTK_LIST_STORE (store), &iter,
+				    SAVE_COLUMN, TRUE,
+				    IMAGE_COLUMN, buf_scaled,
+				    NAME_COLUMN, name,
+				    IMG_COLUMN, img,
+			            -1);
+
+		imgs = g_list_next (imgs);
+		g_object_unref (buf_scaled);
+	}
+}
+
+static void
+save_toggled (GtkCellRendererToggle *renderer, gchar *path_str, GtkTreeModel *store)
+{
+	GtkTreePath *path = gtk_tree_path_new_from_string (path_str);
+	GtkTreeIter iter;
+	gboolean active;
+
+	gtk_tree_model_get_iter (store, &iter, path);
+	gtk_tree_model_get (store, &iter, SAVE_COLUMN, &active, -1);
+
+	active ^= 1;
+
+	gtk_list_store_set (GTK_LIST_STORE (store), &iter,
+			    SAVE_COLUMN, active, -1);
+
+	gtk_tree_path_free (path);
+}
+
+static GtkWidget *
+create_treeview (EomCloseConfirmationDialogPrivate *priv)
+{
+	GtkListStore *store;
+	GtkWidget *treeview;
+	GtkCellRenderer *renderer;
+	GtkTreeViewColumn *column;
+
+	treeview = gtk_tree_view_new ();
+	gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE);
+	gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview), FALSE);
+
+	/* Create and populate the model */
+	store = gtk_list_store_new (N_COLUMNS, G_TYPE_BOOLEAN, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_POINTER);
+	populate_model (GTK_TREE_MODEL (store), priv->unsaved_images);
+
+	/* Set model to the treeview */
+	gtk_tree_view_set_model (GTK_TREE_VIEW (treeview), GTK_TREE_MODEL (store));
+	g_object_unref (store);
+
+	priv->list_store = GTK_TREE_MODEL (store);
+
+	/* Add columns */
+	priv->toggle_renderer = renderer = gtk_cell_renderer_toggle_new ();
+	g_signal_connect (renderer, "toggled",
+			  G_CALLBACK (save_toggled), store);
+
+	column = gtk_tree_view_column_new_with_attributes ("Save?",
+							   renderer,
+							   "active",
+							   SAVE_COLUMN,
+							   NULL);
+	gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
+
+	renderer = gtk_cell_renderer_pixbuf_new ();
+
+	column = gtk_tree_view_column_new_with_attributes ("Image",
+							   renderer,
+							   "pixbuf",
+							   IMAGE_COLUMN,
+							   NULL);
+	gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
+
+	renderer = gtk_cell_renderer_text_new ();
+	column = gtk_tree_view_column_new_with_attributes ("Name",
+							   renderer,
+							   "text",
+							   NAME_COLUMN,
+							   NULL);
+	gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
+
+	return treeview;
+}
+
+static void
+build_multiple_imgs_dialog (EomCloseConfirmationDialog *dlg)
+{
+	EomCloseConfirmationDialogPrivate *priv;
+	GtkWidget *hbox;
+	GtkWidget *image;
+	GtkWidget *vbox;
+	GtkWidget *primary_label;
+	GtkWidget *vbox2;
+	GtkWidget *select_label;
+	GtkWidget *scrolledwindow;
+	GtkWidget *treeview;
+	GtkWidget *secondary_label;
+	gchar     *str;
+	gchar     *markup_str;
+
+	priv = dlg->priv;
+
+	hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
+	gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
+  	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))),
+			    hbox, TRUE, TRUE, 0);
+
+	/* Image */
+	image = gtk_image_new_from_icon_name ("dialog-warning",
+					  GTK_ICON_SIZE_DIALOG);
+	gtk_widget_set_valign (image, GTK_ALIGN_START);
+	gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
+
+	vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
+	gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
+
+	/* Primary label */
+	primary_label = gtk_label_new (NULL);
+	gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE);
+	gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE);
+	gtk_label_set_max_width_chars (GTK_LABEL (primary_label), 88);
+	gtk_label_set_xalign (GTK_LABEL (primary_label), 0.0);
+	gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE);
+
+	str = g_strdup_printf (
+			ngettext ("There is %d image with unsaved changes. "
+				  "Save changes before closing?",
+				  "There are %d images with unsaved changes. "
+				  "Save changes before closing?",
+				  g_list_length (priv->unsaved_images)),
+			g_list_length (priv->unsaved_images));
+
+	markup_str = g_strconcat ("<span weight=\"bold\" size=\"larger\">", str, "</span>", NULL);
+	g_free (str);
+
+	gtk_label_set_markup (GTK_LABEL (primary_label), markup_str);
+	g_free (markup_str);
+	gtk_box_pack_start (GTK_BOX (vbox), primary_label, FALSE, FALSE, 0);
+
+	vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
+	gtk_box_pack_start (GTK_BOX (vbox), vbox2, FALSE, FALSE, 0);
+
+	select_label = gtk_label_new_with_mnemonic (_("S_elect the images you want to save:"));
+
+	gtk_box_pack_start (GTK_BOX (vbox2), select_label, FALSE, FALSE, 0);
+	gtk_label_set_line_wrap (GTK_LABEL (select_label), TRUE);
+	gtk_label_set_xalign (GTK_LABEL (select_label), 0.0);
+
+	scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
+	gtk_box_pack_start (GTK_BOX (vbox2), scrolledwindow, TRUE, TRUE, 0);
+	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow),
+					GTK_POLICY_AUTOMATIC,
+					GTK_POLICY_AUTOMATIC);
+	gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow),
+					     GTK_SHADOW_IN);
+
+	treeview = create_treeview (priv);
+	gtk_container_add (GTK_CONTAINER (scrolledwindow), treeview);
+	gtk_widget_set_size_request (scrolledwindow, 260, 120);
+
+	/* Secondary label */
+	secondary_label = gtk_label_new (_("If you don't save, "
+					   "all your changes will be lost."));
+
+	gtk_box_pack_start (GTK_BOX (vbox2), secondary_label, FALSE, FALSE, 0);
+	gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE);
+	gtk_label_set_xalign (GTK_LABEL (secondary_label), 0.0);
+	gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE);
+
+	gtk_label_set_mnemonic_widget (GTK_LABEL (select_label), treeview);
+
+	add_buttons (dlg);
+
+	gtk_widget_show_all (hbox);
+}
+
+static void
+set_unsaved_image (EomCloseConfirmationDialog *dlg,
+		   const GList                *list)
+{
+	EomCloseConfirmationDialogPrivate *priv;
+
+	g_return_if_fail (list != NULL);
+
+	priv = dlg->priv;
+	g_return_if_fail (priv->unsaved_images == NULL);
+
+	priv->unsaved_images = g_list_copy ((GList *)list);
+
+	if (GET_MODE (priv) == SINGLE_IMG_MODE)
+	{
+		build_single_img_dialog (dlg);
+	}
+	else
+	{
+		build_multiple_imgs_dialog (dlg);
+	}
+}
+
+const GList *
+eom_close_confirmation_dialog_get_unsaved_images (EomCloseConfirmationDialog *dlg)
+{
+	g_return_val_if_fail (EOM_IS_CLOSE_CONFIRMATION_DIALOG (dlg), NULL);
+
+	return dlg->priv->unsaved_images;
+}
+
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/37.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/37.html new file mode 100644 index 0000000..b4a1126 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/37.html @@ -0,0 +1,389 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/*
+ * eom-close-confirmation-dialog.h
+ * This file is part of eom
+ *
+ * Author: Marcus Carlson <marcus@mejlamej.nu>
+ *
+ * Based on gedit code (gedit/gedit-close-confirmation.h) by gedit Team
+ *
+ * Copyright (C) 2004-2009 GNOME Foundation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __EOM_CLOSE_CONFIRMATION_DIALOG_H__
+#define __EOM_CLOSE_CONFIRMATION_DIALOG_H__
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <eom-image.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define EOM_TYPE_CLOSE_CONFIRMATION_DIALOG		(eom_close_confirmation_dialog_get_type ())
+#define EOM_CLOSE_CONFIRMATION_DIALOG(obj)		(G_TYPE_CHECK_INSTANCE_CAST ((obj), EOM_TYPE_CLOSE_CONFIRMATION_DIALOG, EomCloseConfirmationDialog))
+#define EOM_CLOSE_CONFIRMATION_DIALOG_CLASS(klass)	(G_TYPE_CHECK_CLASS_CAST ((klass), EOM_TYPE_CLOSE_CONFIRMATION_DIALOG, EomCloseConfirmationDialogClass))
+#define EOM_IS_CLOSE_CONFIRMATION_DIALOG(obj)		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), EOM_TYPE_CLOSE_CONFIRMATION_DIALOG))
+#define EOM_IS_CLOSE_CONFIRMATION_DIALOG_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE ((klass), EOM_TYPE_CLOSE_CONFIRMATION_DIALOG))
+#define EOM_CLOSE_CONFIRMATION_DIALOG_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS ((obj),EOM_TYPE_CLOSE_CONFIRMATION_DIALOG, EomCloseConfirmationDialogClass))
+
+typedef struct _EomCloseConfirmationDialog 		EomCloseConfirmationDialog;
+typedef struct _EomCloseConfirmationDialogClass 	EomCloseConfirmationDialogClass;
+typedef struct _EomCloseConfirmationDialogPrivate 	EomCloseConfirmationDialogPrivate;
+
+struct _EomCloseConfirmationDialog
+{
+	GtkDialog parent;
+
+	/*< private > */
+	EomCloseConfirmationDialogPrivate *priv;
+};
+
+struct _EomCloseConfirmationDialogClass
+{
+	GtkDialogClass parent_class;
+};
+
+G_GNUC_INTERNAL
+GType 		 eom_close_confirmation_dialog_get_type		(void) G_GNUC_CONST;
+
+G_GNUC_INTERNAL
+GtkWidget	*eom_close_confirmation_dialog_new			(GtkWindow     *parent,
+									 GList         *unsaved_documents);
+G_GNUC_INTERNAL
+GtkWidget 	*eom_close_confirmation_dialog_new_single 		(GtkWindow     *parent,
+									 EomImage      *image);
+
+G_GNUC_INTERNAL
+const GList	*eom_close_confirmation_dialog_get_unsaved_images	(EomCloseConfirmationDialog *dlg);
+
+G_GNUC_INTERNAL
+GList		*eom_close_confirmation_dialog_get_selected_images	(EomCloseConfirmationDialog *dlg);
+
+#endif /* __EOM_CLOSE_CONFIRMATION_DIALOG_H__ */
+
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/38.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/38.html new file mode 100644 index 0000000..ce9a0cf --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/38.html @@ -0,0 +1,555 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye Of Mate - Debugging
+ *
+ * Copyright (C) 2007 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on gedit code (gedit/gedit-debug.h) by:
+ * 	- Alex Roberts <bse@error.fsnet.co.uk>
+ *	- Evan Lawrence <evan@worldpath.net>
+ *	- Chema Celorio <chema@celorio.com>
+ *	- Paolo Maggi <paolo@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <stdio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "eom-debug.h"
+
+#define ENABLE_PROFILING
+
+#ifdef ENABLE_PROFILING
+static GTimer *timer = NULL;
+static gdouble last = 0.0;
+#endif
+
+static EomDebug debug = EOM_DEBUG_NO_DEBUG;
+
+void
+eom_debug_init (void)
+{
+	if (g_getenv ("EOM_DEBUG") != NULL)
+	{
+		/* Enable all debugging */
+		debug = ~EOM_DEBUG_NO_DEBUG;
+		goto out;
+	}
+
+	if (g_getenv ("EOM_DEBUG_WINDOW") != NULL)
+		debug = debug | EOM_DEBUG_WINDOW;
+
+	if (g_getenv ("EOM_DEBUG_VIEW") != NULL)
+		debug = debug | EOM_DEBUG_VIEW;
+
+	if (g_getenv ("EOM_DEBUG_JOBS") != NULL)
+		debug = debug | EOM_DEBUG_JOBS;
+
+	if (g_getenv ("EOM_DEBUG_THUMBNAIL") != NULL)
+		debug = debug | EOM_DEBUG_THUMBNAIL;
+
+	if (g_getenv ("EOM_DEBUG_IMAGE_DATA") != NULL)
+		debug = debug | EOM_DEBUG_IMAGE_DATA;
+
+	if (g_getenv ("EOM_DEBUG_IMAGE_LOAD") != NULL)
+		debug = debug | EOM_DEBUG_IMAGE_LOAD;
+
+	if (g_getenv ("EOM_DEBUG_IMAGE_SAVE") != NULL)
+		debug = debug | EOM_DEBUG_IMAGE_SAVE;
+
+	if (g_getenv ("EOM_DEBUG_LIST_STORE") != NULL)
+		debug = debug | EOM_DEBUG_LIST_STORE;
+
+	if (g_getenv ("EOM_DEBUG_PREFERENCES") != NULL)
+		debug = debug | EOM_DEBUG_PREFERENCES;
+
+	if (g_getenv ("EOM_DEBUG_PRINTING") != NULL)
+		debug = debug | EOM_DEBUG_PRINTING;
+
+	if (g_getenv ("EOM_DEBUG_LCMS") != NULL)
+		debug = debug | EOM_DEBUG_LCMS;
+
+	if (g_getenv ("EOM_DEBUG_PLUGINS") != NULL)
+		debug = debug | EOM_DEBUG_PLUGINS;
+
+out:
+
+#ifdef ENABLE_PROFILING
+	if (debug != EOM_DEBUG_NO_DEBUG)
+		timer = g_timer_new ();
+#endif
+	return;
+}
+
+void
+eom_debug_message (EomDebug   section,
+		   const gchar      *file,
+		   gint              line,
+		   const gchar      *function,
+		   const gchar      *format, ...)
+{
+	if (G_UNLIKELY (debug & section))
+	{
+#ifdef ENABLE_PROFILING
+		gdouble seconds;
+		g_return_if_fail (timer != NULL);
+#endif
+
+		va_list args;
+		gchar *msg;
+
+		g_return_if_fail (format != NULL);
+
+		va_start (args, format);
+		msg = g_strdup_vprintf (format, args);
+		va_end (args);
+
+#ifdef ENABLE_PROFILING
+		seconds = g_timer_elapsed (timer, NULL);
+		g_print ("[%f (%f)] %s:%d (%s) %s\n",
+			 seconds, seconds - last,  file, line, function, msg);
+		last = seconds;
+#else
+		g_print ("%s:%d (%s) %s\n", file, line, function, msg);
+#endif
+
+		fflush (stdout);
+
+		g_free (msg);
+	}
+}
+
+void eom_debug (EomDebug  section,
+		  const gchar       *file,
+		  gint               line,
+		  const gchar       *function)
+{
+	if (G_UNLIKELY (debug & section))
+	{
+#ifdef ENABLE_PROFILING
+		gdouble seconds;
+
+		g_return_if_fail (timer != NULL);
+
+		seconds = g_timer_elapsed (timer, NULL);
+		g_print ("[%f (%f)] %s:%d (%s)\n",
+			 seconds, seconds - last, file, line, function);
+		last = seconds;
+#else
+		g_print ("%s:%d (%s)\n", file, line, function);
+#endif
+		fflush (stdout);
+	}
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/39.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/39.html new file mode 100644 index 0000000..0cd4990 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/39.html @@ -0,0 +1,387 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/* Eye Of Mate - Debugging
+ *
+ * Copyright (C) 2007 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on gedit code (gedit/gedit-debug.h) by:
+ * 	- Alex Roberts <bse@error.fsnet.co.uk>
+ *	- Evan Lawrence <evan@worldpath.net>
+ *	- Chema Celorio <chema@celorio.com>
+ *	- Paolo Maggi <paolo@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __EOM_DEBUG_H__
+#define __EOM_DEBUG_H__
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+typedef enum {
+	EOM_DEBUG_NO_DEBUG           = 0,
+	EOM_DEBUG_WINDOW       = 1 << 0,
+	EOM_DEBUG_VIEW         = 1 << 1,
+	EOM_DEBUG_JOBS         = 1 << 2,
+	EOM_DEBUG_THUMBNAIL    = 1 << 3,
+	EOM_DEBUG_IMAGE_DATA   = 1 << 4,
+	EOM_DEBUG_IMAGE_LOAD   = 1 << 5,
+	EOM_DEBUG_IMAGE_SAVE   = 1 << 6,
+	EOM_DEBUG_LIST_STORE   = 1 << 7,
+	EOM_DEBUG_PREFERENCES  = 1 << 8,
+	EOM_DEBUG_PRINTING     = 1 << 9,
+	EOM_DEBUG_LCMS         = 1 << 10,
+	EOM_DEBUG_PLUGINS      = 1 << 11
+} EomDebug;
+
+#define	DEBUG_WINDOW		EOM_DEBUG_WINDOW,      __FILE__, __LINE__, G_STRFUNC
+#define	DEBUG_VIEW		EOM_DEBUG_VIEW,        __FILE__, __LINE__, G_STRFUNC
+#define	DEBUG_JOBS		EOM_DEBUG_JOBS,        __FILE__, __LINE__, G_STRFUNC
+#define	DEBUG_THUMBNAIL		EOM_DEBUG_THUMBNAIL,   __FILE__, __LINE__, G_STRFUNC
+#define	DEBUG_IMAGE_DATA	EOM_DEBUG_IMAGE_DATA,  __FILE__, __LINE__, G_STRFUNC
+#define	DEBUG_IMAGE_LOAD	EOM_DEBUG_IMAGE_LOAD,  __FILE__, __LINE__, G_STRFUNC
+#define	DEBUG_IMAGE_SAVE	EOM_DEBUG_IMAGE_SAVE,  __FILE__, __LINE__, G_STRFUNC
+#define	DEBUG_LIST_STORE	EOM_DEBUG_LIST_STORE,  __FILE__, __LINE__, G_STRFUNC
+#define	DEBUG_PREFERENCES	EOM_DEBUG_PREFERENCES, __FILE__, __LINE__, G_STRFUNC
+#define	DEBUG_PRINTING		EOM_DEBUG_PRINTING,    __FILE__, __LINE__, G_STRFUNC
+#define	DEBUG_LCMS 		EOM_DEBUG_LCMS,        __FILE__, __LINE__, G_STRFUNC
+#define	DEBUG_PLUGINS 		EOM_DEBUG_PLUGINS,     __FILE__, __LINE__, G_STRFUNC
+
+void   eom_debug_init        (void);
+
+void   eom_debug             (EomDebug    section,
+          	              const gchar       *file,
+          	              gint               line,
+          	              const gchar       *function);
+
+void   eom_debug_message     (EomDebug    section,
+			      const gchar       *file,
+			      gint               line,
+			      const gchar       *function,
+			      const gchar       *format, ...) G_GNUC_PRINTF(5, 6);
+
+#endif /* __EOM_DEBUG_H__ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/4.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/4.html new file mode 100644 index 0000000..f0c2f43 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/4.html @@ -0,0 +1,1567 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/*
+ *  Copyright (C) 2003 Marco Pesenti Gritti
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This program 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 General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  $Id: egg-toolbar-editor.c 929 2009-02-19 14:49:56Z friemann $
+ */
+
+#include "config.h"<--- Include file: "config.h" not found.
+
+#include "egg-toolbar-editor.h"
+#include "egg-editable-toolbar.h"
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libxml/tree.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+static const GtkTargetEntry dest_drag_types[] = {
+  {EGG_TOOLBAR_ITEM_TYPE, GTK_TARGET_SAME_APP, 0},
+};
+
+static const GtkTargetEntry source_drag_types[] = {
+  {EGG_TOOLBAR_ITEM_TYPE, GTK_TARGET_SAME_APP, 0},
+};
+
+static void egg_toolbar_editor_finalize         (GObject *object);
+static void update_editor_sheet                 (EggToolbarEditor *editor);
+
+enum
+{
+  PROP_0,
+  PROP_UI_MANAGER,
+  PROP_TOOLBARS_MODEL
+};
+
+enum
+{
+  SIGNAL_HANDLER_ITEM_ADDED,
+  SIGNAL_HANDLER_ITEM_REMOVED,
+  SIGNAL_HANDLER_TOOLBAR_REMOVED,
+  SIGNAL_HANDLER_LIST_SIZE  /* Array size */
+};
+
+struct EggToolbarEditorPrivate
+{
+  GtkUIManager *manager;
+  EggToolbarsModel *model;
+
+  GtkWidget *grid;
+  GtkWidget *scrolled_window;
+  GList     *actions_list;
+  GList     *factory_list;
+
+  /* These handlers need to be sanely disconnected when switching models */
+  gulong     sig_handlers[SIGNAL_HANDLER_LIST_SIZE];
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (EggToolbarEditor, egg_toolbar_editor, GTK_TYPE_BOX)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
+
+static gint
+compare_items (gconstpointer a,
+               gconstpointer b)
+{
+  const GtkWidget *item1 = a;
+  const GtkWidget *item2 = b;
+
+  char *key1 = g_object_get_data (G_OBJECT (item1),
+                                  "egg-collate-key");
+  char *key2 = g_object_get_data (G_OBJECT (item2),
+                                  "egg-collate-key");
+
+  return strcmp (key1, key2);
+}
+
+static GtkAction *
+find_action (EggToolbarEditor *t,
+	     const char       *name)
+{
+  GList *l;
+  GtkAction *action = NULL;
+
+  l = gtk_ui_manager_get_action_groups (t->priv->manager);
+
+  g_return_val_if_fail (EGG_IS_TOOLBAR_EDITOR (t), NULL);
+  g_return_val_if_fail (name != NULL, NULL);
+
+  for (; l != NULL; l = l->next)
+    {
+      GtkAction *tmp;
+
+      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+      tmp = gtk_action_group_get_action (GTK_ACTION_GROUP (l->data), name);
+      G_GNUC_END_IGNORE_DEPRECATIONS;
+      if (tmp)
+	action = tmp;
+    }
+
+  return action;
+}
+
+static void
+egg_toolbar_editor_set_ui_manager (EggToolbarEditor *t,
+				   GtkUIManager     *manager)
+{
+  g_return_if_fail (GTK_IS_UI_MANAGER (manager));
+
+  t->priv->manager = g_object_ref (manager);
+}
+
+static void
+item_added_or_removed_cb (EggToolbarsModel   *model,
+                          int                 tpos,
+                          int                 ipos,
+                          EggToolbarEditor   *editor)
+{
+  update_editor_sheet (editor);
+}
+
+static void
+toolbar_removed_cb (EggToolbarsModel   *model,
+	            int                 position,
+	            EggToolbarEditor   *editor)
+{
+  update_editor_sheet (editor);
+}
+
+static void
+egg_toolbar_editor_disconnect_model (EggToolbarEditor *t)
+{
+  EggToolbarEditorPrivate *priv = t->priv;
+  EggToolbarsModel *model = priv->model;
+  gulong handler;
+  int i;
+
+  for (i = 0; i < SIGNAL_HANDLER_LIST_SIZE; i++)
+    {
+      handler = priv->sig_handlers[i];
+
+      if (handler != 0)
+        {
+	  if (g_signal_handler_is_connected (model, handler))
+	    {
+	      g_signal_handler_disconnect (model, handler);
+	    }
+
+	  priv->sig_handlers[i] = 0;
+        }
+    }
+}
+
+void
+egg_toolbar_editor_set_model (EggToolbarEditor *t,
+			      EggToolbarsModel *model)
+{
+  EggToolbarEditorPrivate *priv;
+
+  g_return_if_fail (EGG_IS_TOOLBAR_EDITOR (t));
+  g_return_if_fail (model != NULL);
+
+  priv = t->priv;
+
+  if (priv->model)
+    {
+      if (G_UNLIKELY (priv->model == model)) return;
+
+      egg_toolbar_editor_disconnect_model (t);
+      g_object_unref (priv->model);
+    }
+
+  priv->model = g_object_ref (model);
+
+  update_editor_sheet (t);
+
+  priv->sig_handlers[SIGNAL_HANDLER_ITEM_ADDED] =
+    g_signal_connect_object (model, "item_added",
+			     G_CALLBACK (item_added_or_removed_cb), t, 0);
+  priv->sig_handlers[SIGNAL_HANDLER_ITEM_REMOVED] =
+    g_signal_connect_object (model, "item_removed",
+			     G_CALLBACK (item_added_or_removed_cb), t, 0);
+  priv->sig_handlers[SIGNAL_HANDLER_TOOLBAR_REMOVED] =
+    g_signal_connect_object (model, "toolbar_removed",
+			     G_CALLBACK (toolbar_removed_cb), t, 0);
+}
+
+static void
+egg_toolbar_editor_set_property (GObject      *object,
+				 guint         prop_id,
+				 const GValue *value,
+				 GParamSpec   *pspec)
+{
+  EggToolbarEditor *t = EGG_TOOLBAR_EDITOR (object);
+
+  switch (prop_id)
+    {
+    case PROP_UI_MANAGER:
+      egg_toolbar_editor_set_ui_manager (t, g_value_get_object (value));
+      break;
+    case PROP_TOOLBARS_MODEL:
+      egg_toolbar_editor_set_model (t, g_value_get_object (value));
+      break;
+    }
+}
+
+static void
+egg_toolbar_editor_get_property (GObject    *object,
+				 guint       prop_id,
+				 GValue     *value,
+				 GParamSpec *pspec)
+{
+  EggToolbarEditor *t = EGG_TOOLBAR_EDITOR (object);
+
+  switch (prop_id)
+    {
+    case PROP_UI_MANAGER:
+      g_value_set_object (value, t->priv->manager);
+      break;
+    case PROP_TOOLBARS_MODEL:
+      g_value_set_object (value, t->priv->model);
+      break;
+    }
+}
+
+static void
+egg_toolbar_editor_class_init (EggToolbarEditorClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+  object_class->finalize = egg_toolbar_editor_finalize;
+  object_class->set_property = egg_toolbar_editor_set_property;
+  object_class->get_property = egg_toolbar_editor_get_property;
+
+  g_object_class_install_property (object_class,
+				   PROP_UI_MANAGER,
+				   g_param_spec_object ("ui-manager",
+							"UI-Manager",
+							"UI Manager",
+							GTK_TYPE_UI_MANAGER,
+							G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB |
+							G_PARAM_CONSTRUCT_ONLY));
+ g_object_class_install_property (object_class,
+				  PROP_TOOLBARS_MODEL,
+				  g_param_spec_object ("model",
+						       "Model",
+						       "Toolbars Model",
+						       EGG_TYPE_TOOLBARS_MODEL,
+						       G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB |
+						       G_PARAM_CONSTRUCT));
+
+  GtkWidgetClass *widget_class  = GTK_WIDGET_CLASS (klass);
+  gtk_widget_class_set_css_name (widget_class, "EggToolbarEditor");
+}
+
+static void
+egg_toolbar_editor_finalize (GObject *object)
+{
+  EggToolbarEditor *editor = EGG_TOOLBAR_EDITOR (object);
+
+  if (editor->priv->manager)
+    {
+      g_object_unref (editor->priv->manager);
+    }
+
+  if (editor->priv->model)
+    {
+      egg_toolbar_editor_disconnect_model (editor);
+      g_object_unref (editor->priv->model);
+    }
+
+  g_list_free (editor->priv->actions_list);
+  g_list_free (editor->priv->factory_list);
+
+  G_OBJECT_CLASS (egg_toolbar_editor_parent_class)->finalize (object);
+}
+
+GtkWidget *
+egg_toolbar_editor_new (GtkUIManager *manager,
+			EggToolbarsModel *model)
+{
+  return GTK_WIDGET (g_object_new (EGG_TYPE_TOOLBAR_EDITOR,
+				   "ui-manager", manager,
+				   "model", model,
+				   NULL));
+}
+
+static void
+drag_begin_cb (GtkWidget          *widget,
+	       GdkDragContext     *context)
+{
+  gtk_widget_hide (widget);
+}
+
+static void
+drag_end_cb (GtkWidget          *widget,
+	     GdkDragContext     *context)
+{
+  gtk_widget_show (widget);
+}
+
+static void
+drag_data_get_cb (GtkWidget          *widget,
+		  GdkDragContext     *context,
+		  GtkSelectionData   *selection_data,
+		  guint               info,
+		  guint32             time,
+		  EggToolbarEditor   *editor)
+{
+  const char *target;
+
+  target = g_object_get_data (G_OBJECT (widget), "egg-item-name");
+  g_return_if_fail (target != NULL);
+
+  gtk_selection_data_set (selection_data, gtk_selection_data_get_target (selection_data), 8,
+			  (const guchar *) target, strlen (target));
+}
+
+static gchar *
+elide_underscores (const gchar *original)
+{
+  gchar *q, *result;
+  const gchar *p;
+  gboolean last_underscore;
+
+  q = result = g_malloc (strlen (original) + 1);
+  last_underscore = FALSE;
+
+  for (p = original; *p; p++)
+    {
+      if (!last_underscore && *p == '_')
+	last_underscore = TRUE;
+      else
+	{
+	  last_underscore = FALSE;
+	  *q++ = *p;
+	}
+    }
+
+  *q = '\0';
+
+  return result;
+}
+
+static void
+set_drag_cursor (GtkWidget *widget)
+{
+  GdkCursor *cursor;
+  GdkScreen *screen;
+
+  screen = gtk_widget_get_screen (widget);
+
+  cursor = gdk_cursor_new_for_display (gdk_screen_get_display (screen),
+				       GDK_HAND2);
+  gdk_window_set_cursor (gtk_widget_get_window (widget), cursor);
+  g_object_unref (cursor);
+}
+
+static void
+event_box_realize_cb (GtkWidget *widget, GtkImage *icon)
+{
+  GtkImageType type;
+
+  set_drag_cursor (widget);
+
+  type = gtk_image_get_storage_type (icon);
+  if (type == GTK_IMAGE_STOCK)
+    {
+      gchar *stock_id;
+      GdkPixbuf *pixbuf;
+
+      gtk_image_get_stock (icon, &stock_id, NULL);
+      pixbuf = gtk_widget_render_icon (widget, stock_id,
+	                               GTK_ICON_SIZE_LARGE_TOOLBAR, NULL);
+      gtk_drag_source_set_icon_pixbuf (widget, pixbuf);
+      g_object_unref (pixbuf);
+    }
+  else if (type == GTK_IMAGE_ICON_NAME)
+    {
+      const gchar *icon_name;
+      GdkScreen *screen;
+      GtkIconTheme *icon_theme;
+      gint width, height;
+      GdkPixbuf *pixbuf;
+
+      gtk_image_get_icon_name (icon, &icon_name, NULL);
+      screen = gtk_widget_get_screen (widget);
+      icon_theme = gtk_icon_theme_get_for_screen (screen);
+
+      if (!gtk_icon_size_lookup (GTK_ICON_SIZE_LARGE_TOOLBAR,
+                                 &width, &height))
+        {
+	  width = height = 24;
+	}
+
+      pixbuf = gtk_icon_theme_load_icon (icon_theme, icon_name,
+                                         MIN (width, height), 0, NULL);
+      if (G_UNLIKELY (!pixbuf))
+        return;
+
+      gtk_drag_source_set_icon_pixbuf (widget, pixbuf);
+      g_object_unref (pixbuf);
+
+    }
+  else if (type == GTK_IMAGE_PIXBUF)
+    {
+      GdkPixbuf *pixbuf = gtk_image_get_pixbuf (icon);
+      gtk_drag_source_set_icon_pixbuf (widget, pixbuf);
+    }
+}
+
+static GtkWidget *
+editor_create_item (EggToolbarEditor *editor,
+		    GtkImage	     *icon,
+		    const char       *label_text,
+		    GdkDragAction     action)
+{
+  GtkWidget *event_box;
+  GtkWidget *vbox;
+  GtkWidget *label;
+  gchar *label_no_mnemonic = NULL;
+
+  event_box = gtk_event_box_new ();
+  gtk_event_box_set_visible_window (GTK_EVENT_BOX (event_box), FALSE);
+  gtk_widget_show (event_box);
+  gtk_drag_source_set (event_box,
+		       GDK_BUTTON1_MASK,
+		       source_drag_types, G_N_ELEMENTS (source_drag_types), action);
+  g_signal_connect (event_box, "drag_data_get",
+		    G_CALLBACK (drag_data_get_cb), editor);
+  g_signal_connect_after (event_box, "realize",
+		          G_CALLBACK (event_box_realize_cb), icon);
+
+  if (action == GDK_ACTION_MOVE)
+    {
+      g_signal_connect (event_box, "drag_begin",
+		        G_CALLBACK (drag_begin_cb), NULL);
+      g_signal_connect (event_box, "drag_end",
+		        G_CALLBACK (drag_end_cb), NULL);
+    }
+
+  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+  gtk_widget_show (vbox);
+  gtk_container_add (GTK_CONTAINER (event_box), vbox);
+
+  gtk_widget_show (GTK_WIDGET (icon));
+  gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (icon), FALSE, TRUE, 0);
+  label_no_mnemonic = elide_underscores (label_text);
+  label = gtk_label_new (label_no_mnemonic);
+  g_free (label_no_mnemonic);
+  gtk_widget_show (label);
+  gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
+
+  return event_box;
+}
+
+static GtkWidget *
+editor_create_item_from_name (EggToolbarEditor *editor,
+                              const char *      name,
+                              GdkDragAction     drag_action)
+{
+  GtkWidget *item;
+  const char *item_name;
+  char *short_label;
+  const char *collate_key;
+
+  if (strcmp (name, "_separator") == 0)
+    {
+      GtkWidget *icon;
+
+      icon = _egg_editable_toolbar_new_separator_image ();
+      short_label = _("Separator");
+      item_name = g_strdup (name);
+      collate_key = g_utf8_collate_key (short_label, -1);
+      item = editor_create_item (editor, GTK_IMAGE (icon),
+                                 short_label, drag_action);
+    }
+  else
+    {
+      GtkAction *action;
+      GtkWidget *icon;
+      char *stock_id, *icon_name = NULL;
+
+      action = find_action (editor, name);
+      g_return_val_if_fail (action != NULL, NULL);
+
+      g_object_get (action,
+                    "icon-name", &icon_name,
+                    "stock-id", &stock_id,
+		    "short-label", &short_label,
+		    NULL);
+
+      /* This is a workaround to catch named icons. */
+      if (icon_name)
+        icon = gtk_image_new_from_icon_name (icon_name,
+	                                     GTK_ICON_SIZE_LARGE_TOOLBAR);
+      else
+        icon = gtk_image_new_from_icon_name (stock_id ? stock_id : "gtk-dnd",
+                                             GTK_ICON_SIZE_LARGE_TOOLBAR);
+
+      item_name = g_strdup (name);
+      collate_key = g_utf8_collate_key (short_label, -1);
+      item = editor_create_item (editor, GTK_IMAGE (icon),
+                                 short_label, drag_action);
+
+      g_free (short_label);
+      g_free (stock_id);
+      g_free (icon_name);
+    }
+
+  g_object_set_data_full (G_OBJECT (item), "egg-collate-key",
+                          (gpointer) collate_key, g_free);
+  g_object_set_data_full (G_OBJECT (item), "egg-item-name",
+                          (gpointer) item_name, g_free);
+
+  return item;
+}
+
+static gint
+append_grid (GtkGrid *grid, GList *items, gint y, gint width)
+{
+  if (items != NULL)
+    {
+      gint x = 0;
+      GtkWidget *item;
+
+      if (y > 0)
+        {
+          item = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
+          gtk_widget_set_hexpand (item, TRUE);
+          gtk_widget_set_vexpand (item, FALSE);
+          gtk_widget_show (item);
+
+          gtk_grid_attach (grid, item, 0, y, width, 1);
+          y++;
+        }
+
+      for (; items != NULL; items = items->next)
+        {
+          item = items->data;
+          gtk_widget_set_hexpand (item, FALSE);
+          gtk_widget_set_vexpand (item, FALSE);
+          gtk_widget_show (item);
+
+          if (x >= width)
+            {
+              x = 0;
+              y++;
+            }
+          gtk_grid_attach (grid, item, x, y, 1, 1);
+          x++;
+        }
+
+      y++;
+    }
+  return y;
+}
+
+static void
+update_editor_sheet (EggToolbarEditor *editor)
+{
+  gint y;
+  GPtrArray *items;
+  GList *to_move = NULL, *to_copy = NULL;
+  GtkWidget *grid;
+  GtkWidget *viewport;
+
+  g_return_if_fail (EGG_IS_TOOLBAR_EDITOR (editor));
+
+  /* Create new grid. */
+  grid = gtk_grid_new ();
+  editor->priv->grid = grid;
+  gtk_container_set_border_width (GTK_CONTAINER (grid), 12);
+  gtk_grid_set_row_spacing (GTK_GRID (grid), 24);
+  gtk_widget_show (grid);
+  gtk_drag_dest_set (grid, GTK_DEST_DEFAULT_ALL,
+		     dest_drag_types, G_N_ELEMENTS (dest_drag_types),
+                     GDK_ACTION_MOVE | GDK_ACTION_COPY);
+
+  /* Build two lists of items (one for copying, one for moving). */
+  items = egg_toolbars_model_get_name_avail (editor->priv->model);
+  while (items->len > 0)
+    {
+      GtkWidget *item;
+      const char *name;
+      gint flags;
+
+      name = g_ptr_array_index (items, 0);
+      g_ptr_array_remove_index_fast (items, 0);
+
+      flags = egg_toolbars_model_get_name_flags (editor->priv->model, name);
+      if ((flags & EGG_TB_MODEL_NAME_INFINITE) == 0)
+        {
+          item = editor_create_item_from_name (editor, name, GDK_ACTION_MOVE);
+          if (item != NULL)
+            to_move = g_list_insert_sorted (to_move, item, compare_items);
+        }
+      else
+        {
+          item = editor_create_item_from_name (editor, name, GDK_ACTION_COPY);
+          if (item != NULL)
+            to_copy = g_list_insert_sorted (to_copy, item, compare_items);
+        }
+    }
+
+  /* Add them to the sheet. */
+  y = 0;
+  y = append_grid (GTK_GRID (grid), to_move, y, 4);
+  y = append_grid (GTK_GRID (grid), to_copy, y, 4);
+
+  g_list_free (to_move);
+  g_list_free (to_copy);
+  g_ptr_array_free (items, TRUE);
+
+  /* Delete old table/grid. */
+  viewport = gtk_bin_get_child (GTK_BIN (editor->priv->scrolled_window));
+  if (viewport)
+    {
+      gtk_container_remove (GTK_CONTAINER (viewport),
+                            gtk_bin_get_child (GTK_BIN (viewport)));
+    }
+
+  /* Add grid to window. */
+  gtk_scrolled_window_add_with_viewport
+    (GTK_SCROLLED_WINDOW (editor->priv->scrolled_window), grid);
+}
+
+static void
+setup_editor (EggToolbarEditor *editor)
+{
+  GtkWidget *scrolled_window;
+
+  gtk_orientable_set_orientation (GTK_ORIENTABLE (editor),
+                                  GTK_ORIENTATION_VERTICAL);
+
+  gtk_container_set_border_width (GTK_CONTAINER (editor), 12);
+  scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+  editor->priv->scrolled_window = scrolled_window;
+  gtk_widget_show (scrolled_window);
+  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
+				  GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+  gtk_box_pack_start (GTK_BOX (editor), scrolled_window, TRUE, TRUE, 0);
+}
+
+static void
+egg_toolbar_editor_init (EggToolbarEditor *t)
+{
+  t->priv = egg_toolbar_editor_get_instance_private (t);
+
+  t->priv->manager = NULL;
+  t->priv->actions_list = NULL;
+
+  setup_editor (t);
+}
+
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/40.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/40.html new file mode 100644 index 0000000..7318616 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/40.html @@ -0,0 +1,353 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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

+/* This file is generated by glib-mkenums, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */
+
+#ifndef __EOM_ENUM_TYPES_H__
+#define __EOM_ENUM_TYPES_H__
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+/* Enumerations from "eom-debug.h" */
+#define EOM_TYPE_DEBUG	(eom_debug_get_type())
+GType eom_debug_get_type	(void) G_GNUC_CONST;
+/* Enumerations from "eom-enums.h" */
+#define EOM_TYPE_IMAGE_DATA	(eom_image_data_get_type())
+GType eom_image_data_get_type	(void) G_GNUC_CONST;
+/* Enumerations from "eom-image.h" */
+#define EOM_TYPE_IMAGE_ERROR	(eom_image_error_get_type())
+GType eom_image_error_get_type	(void) G_GNUC_CONST;
+#define EOM_TYPE_IMAGE_STATUS	(eom_image_status_get_type())
+GType eom_image_status_get_type	(void) G_GNUC_CONST;
+#define EOM_TYPE_IMAGE_METADATA_STATUS	(eom_image_metadata_status_get_type())
+GType eom_image_metadata_status_get_type	(void) G_GNUC_CONST;
+/* Enumerations from "eom-jobs.h" */
+#define EOM_TYPE_JOB_SAVE_RESPONSE	(eom_job_save_response_get_type())
+GType eom_job_save_response_get_type	(void) G_GNUC_CONST;
+/* Enumerations from "eom-list-store.h" */
+#define EOM_TYPE_LIST_STORE_COLUMN	(eom_list_store_column_get_type())
+GType eom_list_store_column_get_type	(void) G_GNUC_CONST;
+/* Enumerations from "eom-properties-dialog.h" */
+#define EOM_TYPE_PROPERTIES_DIALOG_PAGE	(eom_properties_dialog_page_get_type())
+GType eom_properties_dialog_page_get_type	(void) G_GNUC_CONST;
+/* Enumerations from "eom-scroll-view.h" */
+#define EOM_TYPE_TRANSPARENCY_STYLE	(eom_transparency_style_get_type())
+GType eom_transparency_style_get_type	(void) G_GNUC_CONST;
+/* Enumerations from "eom-thumb-nav.h" */
+#define EOM_TYPE_THUMB_NAV_MODE	(eom_thumb_nav_mode_get_type())
+GType eom_thumb_nav_mode_get_type	(void) G_GNUC_CONST;
+/* Enumerations from "eom-thumb-view.h" */
+#define EOM_TYPE_THUMB_VIEW_SELECTION_CHANGE	(eom_thumb_view_selection_change_get_type())
+GType eom_thumb_view_selection_change_get_type	(void) G_GNUC_CONST;
+/* Enumerations from "eom-transform.h" */
+#define EOM_TYPE_TRANSFORM_TYPE	(eom_transform_type_get_type())
+GType eom_transform_type_get_type	(void) G_GNUC_CONST;
+/* Enumerations from "eom-window.h" */
+#define EOM_TYPE_WINDOW_MODE	(eom_window_mode_get_type())
+GType eom_window_mode_get_type	(void) G_GNUC_CONST;
+#define EOM_TYPE_WINDOW_COLLECTION_POS	(eom_window_collection_pos_get_type())
+GType eom_window_collection_pos_get_type	(void) G_GNUC_CONST;
+#define EOM_TYPE_WINDOW_ERROR	(eom_window_error_get_type())
+GType eom_window_error_get_type	(void) G_GNUC_CONST;
+#define EOM_TYPE_STARTUP_FLAGS	(eom_startup_flags_get_type())
+GType eom_startup_flags_get_type	(void) G_GNUC_CONST;
+G_END_DECLS
+
+#endif /* __EOM_ENUM_TYPES_H__ */
+
+/* Generated data ends here */
+
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/41.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/41.html new file mode 100644 index 0000000..912d790 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/41.html @@ -0,0 +1,395 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/* Eye Of Mate - Image Properties Dialog
+ *
+ * Copyright (C) 2006 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __EOM_PROPERTIES_DIALOG_H__
+#define __EOM_PROPERTIES_DIALOG_H__
+
+#include "eom-image.h"
+#include "eom-thumb-view.h"
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+typedef struct _EomPropertiesDialog EomPropertiesDialog;
+typedef struct _EomPropertiesDialogClass EomPropertiesDialogClass;
+typedef struct _EomPropertiesDialogPrivate EomPropertiesDialogPrivate;
+
+#define EOM_TYPE_PROPERTIES_DIALOG            (eom_properties_dialog_get_type ())
+#define EOM_PROPERTIES_DIALOG(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), EOM_TYPE_PROPERTIES_DIALOG, EomPropertiesDialog))
+#define EOM_PROPERTIES_DIALOG_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  EOM_TYPE_PROPERTIES_DIALOG, EomPropertiesDialogClass))
+#define EOM_IS_PROPERTIES_DIALOG(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), EOM_TYPE_PROPERTIES_DIALOG))
+#define EOM_IS_PROPERTIES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  EOM_TYPE_PROPERTIES_DIALOG))
+#define EOM_PROPERTIES_DIALOG_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  EOM_TYPE_PROPERTIES_DIALOG, EomPropertiesDialogClass))
+
+typedef enum {
+	EOM_PROPERTIES_DIALOG_PAGE_GENERAL = 0,
+	EOM_PROPERTIES_DIALOG_PAGE_EXIF,
+	EOM_PROPERTIES_DIALOG_PAGE_DETAILS,
+	EOM_PROPERTIES_DIALOG_N_PAGES
+} EomPropertiesDialogPage;
+
+struct _EomPropertiesDialog {
+	GtkDialog dialog;
+
+	EomPropertiesDialogPrivate *priv;
+};
+
+struct _EomPropertiesDialogClass {
+	GtkDialogClass parent_class;
+};
+
+GType	    eom_properties_dialog_get_type	(void) G_GNUC_CONST;
+
+GtkWidget   *eom_properties_dialog_new	  	(GtkWindow               *parent,
+                                             EomThumbView            *thumbview,
+                                             GtkAction               *next_image_action,
+                                             GtkAction               *previous_image_action);
+
+void	    eom_properties_dialog_update  	(EomPropertiesDialog     *prop,
+						 EomImage                *image);
+
+void	    eom_properties_dialog_set_page  	(EomPropertiesDialog     *prop,
+						 EomPropertiesDialogPage  page);
+
+void	    eom_properties_dialog_set_netbook_mode (EomPropertiesDialog *dlg,
+						    gboolean enable);
+G_END_DECLS
+
+#endif /* __EOM_PROPERTIES_DIALOG_H__ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/42.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/42.html new file mode 100644 index 0000000..c636778 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/42.html @@ -0,0 +1,383 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
#ifndef _EOM_SCROLL_VIEW_H_
+#define _EOM_SCROLL_VIEW_H_
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "eom-image.h"
+
+G_BEGIN_DECLS
+
+typedef struct _EomScrollView EomScrollView;
+typedef struct _EomScrollViewClass EomScrollViewClass;
+typedef struct _EomScrollViewPrivate EomScrollViewPrivate;
+
+#define EOM_TYPE_SCROLL_VIEW              (eom_scroll_view_get_type ())
+#define EOM_SCROLL_VIEW(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), EOM_TYPE_SCROLL_VIEW, EomScrollView))
+#define EOM_SCROLL_VIEW_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), EOM_TYPE_SCROLL_VIEW, EomScrollViewClass))
+#define EOM_IS_SCROLL_VIEW(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EOM_TYPE_SCROLL_VIEW))
+#define EOM_IS_SCROLL_VIEW_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), EOM_TYPE_SCROLL_VIEW))
+
+struct _EomScrollView {
+	GtkGrid base_instance;
+
+	EomScrollViewPrivate *priv;
+};
+
+struct _EomScrollViewClass {
+	GtkGridClass parent_class;
+
+	void (* zoom_changed) (EomScrollView *view, double zoom);
+};
+
+typedef enum {
+	EOM_TRANSP_BACKGROUND,
+	EOM_TRANSP_CHECKED,
+	EOM_TRANSP_COLOR
+} EomTransparencyStyle;
+
+GType    eom_scroll_view_get_type         (void) G_GNUC_CONST;
+GtkWidget* eom_scroll_view_new            (void);
+
+/* loading stuff */
+void     eom_scroll_view_set_image        (EomScrollView *view, EomImage *image);
+EomImage* eom_scroll_view_get_image       (EomScrollView *view);
+
+/* general properties */
+void     eom_scroll_view_set_scroll_wheel_zoom (EomScrollView *view, gboolean scroll_wheel_zoom);
+void     eom_scroll_view_set_zoom_upscale (EomScrollView *view, gboolean upscale);
+void     eom_scroll_view_set_zoom_multiplier (EomScrollView *view, gdouble multiplier);
+void     eom_scroll_view_set_antialiasing_in (EomScrollView *view, gboolean state);
+void     eom_scroll_view_set_antialiasing_out (EomScrollView *view, gboolean state);
+void     eom_scroll_view_set_transparency_color (EomScrollView *view, GdkRGBA *color);
+void     eom_scroll_view_set_transparency (EomScrollView *view, EomTransparencyStyle style);
+gboolean eom_scroll_view_scrollbars_visible (EomScrollView *view);
+void	 eom_scroll_view_set_popup (EomScrollView *view, GtkMenu *menu);
+void	 eom_scroll_view_set_background_color (EomScrollView *view,
+					       const GdkRGBA *color);
+void	 eom_scroll_view_override_bg_color (EomScrollView *view,
+					    const GdkRGBA *color);
+void     eom_scroll_view_set_use_bg_color (EomScrollView *view, gboolean use);
+/* zoom api */
+void     eom_scroll_view_zoom_in          (EomScrollView *view, gboolean smooth);
+void     eom_scroll_view_zoom_out         (EomScrollView *view, gboolean smooth);
+void     eom_scroll_view_zoom_fit         (EomScrollView *view);
+void     eom_scroll_view_set_zoom         (EomScrollView *view, double zoom);
+double   eom_scroll_view_get_zoom         (EomScrollView *view);
+gboolean eom_scroll_view_get_zoom_is_min  (EomScrollView *view);
+gboolean eom_scroll_view_get_zoom_is_max  (EomScrollView *view);
+void     eom_scroll_view_show_cursor      (EomScrollView *view);
+void     eom_scroll_view_hide_cursor      (EomScrollView *view);
+
+G_END_DECLS
+
+#endif /* _EOM_SCROLL_VIEW_H_ */
+
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/43.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/43.html new file mode 100644 index 0000000..bb26e0d --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/43.html @@ -0,0 +1,395 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/* Eye Of Mate - Thumbnail Navigator
+ *
+ * Copyright (C) 2006 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __EOM_THUMB_NAV_H__
+#define __EOM_THUMB_NAV_H__
+
+#include "eom-thumb-view.h"
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+typedef struct _EomThumbNav EomThumbNav;
+typedef struct _EomThumbNavClass EomThumbNavClass;
+typedef struct _EomThumbNavPrivate EomThumbNavPrivate;
+
+#define EOM_TYPE_THUMB_NAV            (eom_thumb_nav_get_type ())
+#define EOM_THUMB_NAV(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), EOM_TYPE_THUMB_NAV, EomThumbNav))
+#define EOM_THUMB_NAV_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  EOM_TYPE_THUMB_NAV, EomThumbNavClass))
+#define EOM_IS_THUMB_NAV(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), EOM_TYPE_THUMB_NAV))
+#define EOM_IS_THUMB_NAV_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  EOM_TYPE_THUMB_NAV))
+#define EOM_THUMB_NAV_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  EOM_TYPE_THUMB_NAV, EomThumbNavClass))
+
+typedef enum {
+	EOM_THUMB_NAV_MODE_ONE_ROW,
+	EOM_THUMB_NAV_MODE_ONE_COLUMN,
+	EOM_THUMB_NAV_MODE_MULTIPLE_ROWS,
+	EOM_THUMB_NAV_MODE_MULTIPLE_COLUMNS
+} EomThumbNavMode;
+
+struct _EomThumbNav {
+	GtkBox base_instance;
+
+	EomThumbNavPrivate *priv;
+};
+
+struct _EomThumbNavClass {
+	GtkBoxClass parent_class;
+};
+
+GType	         eom_thumb_nav_get_type          (void) G_GNUC_CONST;
+
+GtkWidget       *eom_thumb_nav_new               (GtkWidget         *thumbview,
+						  EomThumbNavMode    mode,
+	             			          gboolean           show_buttons);
+
+gboolean         eom_thumb_nav_get_show_buttons  (EomThumbNav       *nav);
+
+void             eom_thumb_nav_set_show_buttons  (EomThumbNav       *nav,
+                                                  gboolean           show_buttons);
+
+EomThumbNavMode  eom_thumb_nav_get_mode          (EomThumbNav       *nav);
+
+void             eom_thumb_nav_set_mode          (EomThumbNav       *nav,
+                                                  EomThumbNavMode    mode);
+
+G_END_DECLS
+
+#endif /* __EOM_THUMB_NAV_H__ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/44.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/44.html new file mode 100644 index 0000000..7b34cdd --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/44.html @@ -0,0 +1,311 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/* Eye Of Mate - Erro Message Area
+ *
+ * Copyright (C) 2007 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on gedit code (gedit/gedit-message-area.h) by:
+ * 	- Paolo Maggi <paolo@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __EOM_ERROR_MESSAGE_AREA__
+#define __EOM_ERROR_MESSAGE_AREA__
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+GtkWidget   *eom_image_load_error_message_area_new   (const gchar       *caption,
+						      const GError      *error);
+
+GtkWidget   *eom_no_images_error_message_area_new    (GFile *file);
+
+#endif /* __EOM_ERROR_MESSAGE_AREA__ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/45.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/45.html new file mode 100644 index 0000000..787faf0 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/45.html @@ -0,0 +1,681 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye Of Mate - Erro Message Area
+ *
+ * Copyright (C) 2007 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on gedit code (gedit/gedit-message-area.h) by:
+ * 	- Paolo Maggi <paolo@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include "eom-error-message-area.h"
+#include "eom-image.h"
+#include "eom-util.h"
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+static void
+set_message_area_text_and_icon (GtkInfoBar   *message_area,
+				const gchar  *icon_name,
+				const gchar  *primary_text,
+				const gchar  *secondary_text)
+{
+	GtkWidget *hbox_content;
+	GtkWidget *image;
+	GtkWidget *vbox;
+	gchar *primary_markup;
+	gchar *secondary_markup;
+	GtkWidget *primary_label;
+	GtkWidget *secondary_label;
+
+	hbox_content = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
+	gtk_widget_show (hbox_content);
+
+	image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_DIALOG);
+	gtk_widget_show (image);
+	gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0);
+	gtk_widget_set_valign (image, GTK_ALIGN_START);
+
+	vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+	gtk_widget_show (vbox);
+	gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0);
+
+	primary_markup = g_markup_printf_escaped ("<b>%s</b>", primary_text);
+	primary_label = gtk_label_new (primary_markup);
+	g_free (primary_markup);
+
+	gtk_widget_show (primary_label);
+
+	gtk_box_pack_start (GTK_BOX (vbox), primary_label, TRUE, TRUE, 0);
+	gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE);
+	gtk_label_set_line_wrap (GTK_LABEL (primary_label), FALSE);
+	gtk_label_set_xalign (GTK_LABEL (primary_label), 0.0);
+
+	gtk_widget_set_can_focus (primary_label, TRUE);
+
+	gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE);
+
+	if (secondary_text != NULL) {
+		secondary_markup = g_markup_printf_escaped ("<small>%s</small>",
+		                                            secondary_text);
+		secondary_label = gtk_label_new (secondary_markup);
+		g_free (secondary_markup);
+
+		gtk_widget_show (secondary_label);
+
+		gtk_box_pack_start (GTK_BOX (vbox), secondary_label, TRUE, TRUE, 0);
+
+		gtk_widget_set_can_focus (secondary_label, TRUE);
+
+		gtk_label_set_use_markup (GTK_LABEL (secondary_label), TRUE);
+		gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE);
+		gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE);
+		gtk_label_set_xalign (GTK_LABEL (secondary_label), 0.0);
+	}
+
+	gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (message_area))), hbox_content, TRUE, TRUE, 0);
+}
+
+static GtkWidget *
+create_error_message_area (const gchar *primary_text,
+			   const gchar *secondary_text,
+			   gboolean     recoverable)
+{
+	GtkWidget *message_area;
+
+	if (recoverable)
+		message_area = gtk_info_bar_new_with_buttons (_("_Retry"),
+							      GTK_RESPONSE_OK,
+							      NULL);
+	else
+		message_area = gtk_info_bar_new ();
+
+	gtk_info_bar_set_message_type (GTK_INFO_BAR (message_area),
+				       GTK_MESSAGE_ERROR);
+
+	set_message_area_text_and_icon (GTK_INFO_BAR (message_area),
+					"dialog-error",
+					primary_text,
+					secondary_text);
+
+	return message_area;
+}
+
+/**
+ * eom_image_load_error_message_area_new:
+ * @caption:
+ * @error:
+ *
+ *
+ *
+ * Returns: (transfer full): a new #GtkInfoArea
+ **/
+GtkWidget *
+eom_image_load_error_message_area_new (const gchar  *caption,
+				       const GError *error)
+{
+	GtkWidget *message_area;
+	gchar *error_message = NULL;
+	gchar *message_details = NULL;
+	gchar *pango_escaped_caption = NULL;
+
+	g_return_val_if_fail (caption != NULL, NULL);
+	g_return_val_if_fail (error != NULL, NULL);
+
+	/* Escape the caption string with respect to pango markup.
+	   This is necessary because otherwise characters like "&" will
+	   be interpreted as the beginning of a pango entity inside
+	   the message area GtkLabel. */
+	pango_escaped_caption = g_markup_escape_text (caption, -1);
+	error_message = g_strdup_printf (_("Could not load image '%s'."),
+					 pango_escaped_caption);
+
+	message_details = eom_util_make_valid_utf8 (error->message);
+
+	message_area = create_error_message_area (error_message,
+						  message_details,
+						  TRUE);
+
+	g_free (pango_escaped_caption);
+	g_free (error_message);
+	g_free (message_details);
+
+	return message_area;
+}
+
+/**
+ * eom_no_images_error_message_area_new:
+ * @file:
+ *
+ *
+ *
+ * Returns: (transfer full): a new #GtkInfoBar
+ **/
+GtkWidget *
+eom_no_images_error_message_area_new (GFile *file)
+{
+	GtkWidget *message_area;
+	gchar *error_message = NULL;
+
+	if (file != NULL) {
+		gchar *uri_str, *unescaped_str, *pango_escaped_str;
+
+		uri_str = g_file_get_uri (file);
+		/* Unescape URI with respect to rules defined in RFC 3986. */
+		unescaped_str = g_uri_unescape_string (uri_str, NULL);
+
+		/* Escape the URI string with respect to pango markup.
+		   This is necessary because the URI string can contain
+		   for example "&" which will otherwise be interpreted
+		   as a pango markup entity when inserted into a GtkLabel. */
+		pango_escaped_str = g_markup_escape_text (unescaped_str, -1);
+		error_message = g_strdup_printf (_("No images found in '%s'."),
+						 pango_escaped_str);
+
+		g_free (pango_escaped_str);
+		g_free (uri_str);
+		g_free (unescaped_str);
+	} else {
+		error_message = g_strdup (_("The given locations contain no images."));
+	}
+
+	message_area = create_error_message_area (error_message,
+						  NULL,
+						  FALSE);
+
+	g_free (error_message);
+
+	return message_area;
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/46.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/46.html new file mode 100644 index 0000000..352ed58 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/46.html @@ -0,0 +1,949 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye Of Mate - EXIF Utilities
+ *
+ * Copyright (C) 2006-2007 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ * Author: Claudio Saavedra <csaavedra@alumnos.utalca.cl>
+ * Author: Felix Riemann <felix@hsgheli.de>
+ *
+ * Based on code by:
+ *	- Jens Finke <jens@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"<--- Include file: "config.h" not found.
+#endif
+
+#ifdef HAVE_STRPTIME
+#define _XOPEN_SOURCE
+#define _XOPEN_SOURCE_EXTENDED 1
+#endif
+#include <time.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "eom-exif-util.h"
+#include "eom-util.h"
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define DATE_BUF_SIZE 200
+
+/* gboolean <-> gpointer conversion macros taken from gedit */
+#ifndef GBOOLEAN_TO_POINTER
+#define GBOOLEAN_TO_POINTER(i) (GINT_TO_POINTER ((i) ? 2 : 1))
+#endif
+#ifndef GPOINTER_TO_BOOLEAN
+#define GPOINTER_TO_BOOLEAN(i) ((gboolean) ((GPOINTER_TO_INT (i) == 2) ? TRUE : FALSE))
+#endif
+
+typedef ExifData EomExifData;
+
+/* Define EomExifData type */
+G_DEFINE_BOXED_TYPE(EomExifData, eom_exif_data, eom_exif_data_copy, eom_exif_data_free)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_BOXED_TYPE is a macro then please configure it.
+
+#ifdef HAVE_STRPTIME
+static gpointer
+_check_strptime_updates_wday (gpointer data)
+{
+	struct tm tm;
+
+	memset (&tm, '\0', sizeof (tm));
+	strptime ("2008:12:24 20:30:45", "%Y:%m:%d %T", &tm);
+	/* Check if tm.tm_wday is set to Wednesday (3) now */
+	return GBOOLEAN_TO_POINTER (tm.tm_wday == 3);
+}
+#endif
+
+/**
+ * _calculate_wday_yday:
+ * @tm: A struct tm that should be updated.
+ *
+ * Ensure tm_wday and tm_yday are set correctly in a struct tm.
+ * The other date (dmy) values must have been set already.
+ **/
+static void
+_calculate_wday_yday (struct tm *tm)
+{
+	GDate *exif_date;
+	struct tm tmp_tm;
+
+	exif_date = g_date_new_dmy (tm->tm_mday,
+				    tm->tm_mon+1,
+				    tm->tm_year+1900);
+
+	g_return_if_fail (exif_date != NULL && g_date_valid (exif_date));
+
+	// Use this to get GLib <-> libc corrected values
+	g_date_to_struct_tm (exif_date, &tmp_tm);
+	g_date_free (exif_date);
+
+	tm->tm_wday = tmp_tm.tm_wday;
+	tm->tm_yday = tmp_tm.tm_yday;
+}
+
+/* Older GCCs don't support pragma diagnostic inside functions.
+ * Put these here to avoid problems with the strftime format strings
+ * without breaking the build for these older GCCs */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+
+#ifdef HAVE_STRPTIME
+static gchar *
+eom_exif_util_format_date_with_strptime (const gchar *date, const gchar* format)
+{
+	static GOnce strptime_updates_wday = G_ONCE_INIT;
+	gchar *new_date = NULL;
+	gchar tmp_date[DATE_BUF_SIZE];
+	gchar *p;
+	gsize dlen;
+	struct tm tm;
+
+	memset (&tm, '\0', sizeof (tm));
+	p = strptime (date, "%Y:%m:%d %T", &tm);
+
+	if (p == date + strlen (date)) {
+		g_once (&strptime_updates_wday,
+			_check_strptime_updates_wday,
+			NULL);
+
+		// Ensure tm.tm_wday and tm.tm_yday are set
+		if (!GPOINTER_TO_BOOLEAN (strptime_updates_wday.retval))
+			_calculate_wday_yday (&tm);
+
+		/* A strftime-formatted string, to display the date the image was taken.  */
+		dlen = strftime (tmp_date, DATE_BUF_SIZE * sizeof(gchar), format, &tm);
+		new_date = g_strndup (tmp_date, dlen);
+	}
+
+	return new_date;
+}
+#else
+static gchar *
+eom_exif_util_format_date_by_hand (const gchar *date, const gchar* format)
+{
+	int year, month, day, hour, minutes, seconds;
+	int result;
+	gchar *new_date = NULL;
+
+	result = sscanf (date, "%d:%d:%d %d:%d:%d",
+			 &year, &month, &day, &hour, &minutes, &seconds);
+
+	if (result < 3 || !g_date_valid_dmy (day, month, year)) {
+		return NULL;
+	} else {
+		gchar tmp_date[DATE_BUF_SIZE];
+		gsize dlen;
+		struct tm tm;
+
+		memset (&tm, '\0', sizeof (tm));
+		tm.tm_mday = day;
+		tm.tm_mon = month-1;
+		tm.tm_year = year-1900;
+		// Calculate tm.tm_wday
+		_calculate_wday_yday (&tm);
+
+		tm.tm_sec = result < 6 ? 0 : seconds;
+		tm.tm_min = result < 5 ? 0 : minutes;
+		tm.tm_hour = result < 4 ? 0 : hour;
+		dlen = strftime (tmp_date, DATE_BUF_SIZE * sizeof(gchar), format, &tm);
+
+		if (dlen == 0)
+			return NULL;
+		else
+			new_date = g_strndup (tmp_date, dlen);
+	}
+	return new_date;
+}
+#endif /* HAVE_STRPTIME */
+
+#pragma GCC diagnostic pop
+
+/**
+ * eom_exif_util_format_date:
+ * @date: a date string following Exif specifications
+ *
+ * Takes a date string formatted after Exif specifications and generates a
+ * more readable, possibly localized, string out of it.
+ *
+ * Returns: a newly allocated date string formatted according to the
+ * current locale.
+ */
+gchar *
+eom_exif_util_format_date (const gchar *date)
+{
+	gchar *new_date;
+#ifdef HAVE_STRPTIME
+	/* A strftime-formatted string, to display the date the image was taken.  */
+	new_date = eom_exif_util_format_date_with_strptime (date, _("%a, %d %B %Y  %X"));
+#else
+	new_date = eom_exif_util_format_date_by_hand (date, _("%a, %d %B %Y  %X"));
+#endif /* HAVE_STRPTIME */
+	return new_date;
+}
+
+void
+eom_exif_util_set_label_text (GtkLabel *label,
+			      EomExifData *exif_data,
+			      gint tag_id)
+{
+	gchar exif_buffer[512];
+	const gchar *buf_ptr;
+	gchar *label_text = NULL;
+
+	g_return_if_fail (GTK_IS_LABEL (label));
+
+	if (exif_data) {
+		buf_ptr = eom_exif_data_get_value (exif_data, tag_id,
+						   exif_buffer, 512);
+
+		if (tag_id == EXIF_TAG_DATE_TIME_ORIGINAL && buf_ptr)
+			label_text = eom_exif_util_format_date (buf_ptr);
+		else
+			label_text = eom_util_make_valid_utf8 (buf_ptr);
+	}
+
+	gtk_label_set_text (label, label_text);
+	g_free (label_text);
+}
+
+void
+eom_exif_util_format_datetime_label (GtkLabel *label, EomExifData *exif_data,
+                                     gint tag_id, const gchar *format)
+{
+	gchar exif_buffer[512];
+	const gchar *buf_ptr;
+	gchar *label_text = NULL;
+
+	g_return_if_fail (GTK_IS_LABEL (label));
+	g_warn_if_fail (tag_id == EXIF_TAG_DATE_TIME_ORIGINAL);
+
+	if (exif_data) {
+	    buf_ptr = eom_exif_data_get_value (exif_data, tag_id,
+	                                       exif_buffer, 512);
+
+	    if (tag_id == EXIF_TAG_DATE_TIME_ORIGINAL && buf_ptr)
+#ifdef HAVE_STRPTIME
+	        label_text = eom_exif_util_format_date_with_strptime (buf_ptr, format);
+#else
+	        label_text = eom_exif_util_format_date_by_hand (buf_ptr, format);
+#endif /* HAVE_STRPTIME */
+	}
+
+	gtk_label_set_text (label, label_text);
+	g_free (label_text);
+}
+
+void
+eom_exif_util_set_focal_length_label_text (GtkLabel *label,
+					   EomExifData *exif_data)
+{
+	ExifEntry *entry = NULL, *entry35mm = NULL;
+	ExifByteOrder byte_order;
+	gfloat f_val = 0.0;
+	gchar *fl_text = NULL,*fl35_text = NULL;
+
+	/* If no ExifData is supplied the label will be
+	 * cleared later as fl35_text is NULL. */
+	if (exif_data != NULL) {
+		entry = exif_data_get_entry (exif_data, EXIF_TAG_FOCAL_LENGTH);
+		entry35mm = exif_data_get_entry (exif_data,
+					    EXIF_TAG_FOCAL_LENGTH_IN_35MM_FILM);
+		byte_order = exif_data_get_byte_order (exif_data);
+	}
+
+	if (entry && G_LIKELY (entry->format == EXIF_FORMAT_RATIONAL)) {
+		ExifRational value;
+
+		/* Decode value by hand as libexif is not necessarily returning
+		 * it in the format we want it to be.
+		 */
+		value = exif_get_rational (entry->data, byte_order);
+		/* Guard against div by zero */
+		if (G_LIKELY(value.denominator != 0))
+			f_val = (gfloat)value.numerator/
+				(gfloat)value.denominator;
+
+		/* TRANSLATORS: This is the actual focal length used when
+		   the image was taken.*/
+		fl_text = g_strdup_printf (_("%.1f (lens)"), f_val);
+
+	}
+	if (entry35mm && G_LIKELY (entry35mm->format == EXIF_FORMAT_SHORT)) {
+		ExifShort s_val;
+
+		s_val = exif_get_short (entry35mm->data, byte_order);
+
+		/* Print as float to get a similar look as above. */
+		/* TRANSLATORS: This is the equivalent focal length assuming
+		   a 35mm film camera. */
+		fl35_text = g_strdup_printf(_("%.1f (35mm film)"),(float)s_val);
+	}
+
+	if (fl_text) {
+		if (fl35_text) {
+			gchar *merged_txt;
+
+			merged_txt = g_strconcat (fl35_text,", ", fl_text, NULL);
+			gtk_label_set_text (label, merged_txt);
+			g_free (merged_txt);
+		} else {
+			gtk_label_set_text (label, fl_text);
+		}
+	} else {
+		/* This will also clear the label if no ExifData was supplied */
+		gtk_label_set_text (label, fl35_text);
+	}
+
+	g_free (fl35_text);
+	g_free (fl_text);
+}
+
+/**
+ * eom_exif_data_get_value:
+ * @exif_data: pointer to an <structname>ExifData</structname> struct
+ * @tag_id: the requested tag's id. See <filename>exif-tag.h</filename>
+ * from the libexif package for possible values (e.g. %EXIF_TAG_EXPOSURE_MODE).
+ * @buffer: a pre-allocated output buffer
+ * @buf_size: size of @buffer
+ *
+ * Convenience function to extract a string representation of an Exif tag
+ * directly from an <structname>ExifData</structname> struct. The string is
+ * written into @buffer as far as @buf_size permits.
+ *
+ * Returns: a pointer to @buffer.
+ */
+const gchar *
+eom_exif_data_get_value (EomExifData *exif_data, gint tag_id, gchar *buffer, guint buf_size)
+{
+	ExifEntry *exif_entry;
+	const gchar *exif_value;
+
+        exif_entry = exif_data_get_entry (exif_data, tag_id);
+
+	buffer[0] = 0;
+
+	exif_value = exif_entry_get_value (exif_entry, buffer, buf_size);
+
+	return exif_value;
+}
+
+EomExifData *
+eom_exif_data_copy (EomExifData *data)
+{
+	exif_data_ref (data);
+
+	return data;
+}
+
+void
+eom_exif_data_free (EomExifData *data)
+{
+	exif_data_unref (data);
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/47.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/47.html new file mode 100644 index 0000000..b085666 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/47.html @@ -0,0 +1,353 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _EOM_FILE_CHOOSER_H_
+#define _EOM_FILE_CHOOSER_H_
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gdk-pixbuf/gdk-pixbuf.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+#define EOM_TYPE_FILE_CHOOSER          (eom_file_chooser_get_type ())
+#define EOM_FILE_CHOOSER(o)            (G_TYPE_CHECK_INSTANCE_CAST ((o), EOM_TYPE_FILE_CHOOSER, EomFileChooser))
+#define EOM_FILE_CHOOSER_CLASS(k)      (G_TYPE_CHECK_CLASS_CAST((k), EOM_TYPE_FILE_CHOOSER, EomFileChooserClass))
+
+#define EOM_IS_FILE_CHOOSER(o)         (G_TYPE_CHECK_INSTANCE_TYPE ((o), EOM_TYPE_FILE_CHOOSER))
+#define EOM_IS_FILE_CHOOSER_CLASS(k)   (G_TYPE_CHECK_CLASS_TYPE ((k), EOM_TYPE_FILE_CHOOSER))
+#define EOM_FILE_CHOOSER_GET_CLASS(o)  (G_TYPE_INSTANCE_GET_CLASS ((o), EOM_TYPE_FILE_CHOOSER, EomFileChooserClass))
+
+typedef struct _EomFileChooser         EomFileChooser;
+typedef struct _EomFileChooserClass    EomFileChooserClass;
+typedef struct _EomFileChooserPrivate  EomFileChooserPrivate;
+
+struct _EomFileChooser
+{
+	GtkFileChooserDialog  parent;
+
+	EomFileChooserPrivate *priv;
+};
+
+struct _EomFileChooserClass
+{
+	GtkFileChooserDialogClass  parent_class;
+};
+
+GType		 eom_file_chooser_get_type	(void) G_GNUC_CONST;
+
+GtkWidget	*eom_file_chooser_new		(GtkFileChooserAction action);
+
+GdkPixbufFormat	*eom_file_chooser_get_format	(EomFileChooser *chooser);
+
+G_END_DECLS
+
+#endif /* _EOM_FILE_CHOOSER_H_ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/48.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/48.html new file mode 100644 index 0000000..285070d --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/48.html @@ -0,0 +1,277 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
#ifndef _EOM_PIXBUF_UTIL_H_
+#define _EOM_PIXBUF_UTIL_H_
+
+#include <gdk-pixbuf/gdk-pixbuf.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_GNUC_INTERNAL
+GSList*          eom_pixbuf_get_savable_formats (void);
+
+G_GNUC_INTERNAL
+GdkPixbufFormat* eom_pixbuf_get_format_by_suffix (const char *suffix);
+
+G_GNUC_INTERNAL
+GdkPixbufFormat* eom_pixbuf_get_format (GFile *file);
+
+G_GNUC_INTERNAL
+char*            eom_pixbuf_get_common_suffix (GdkPixbufFormat *format);
+
+#endif /* _EOM_PIXBUF_UTIL_H_ */
+
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/49.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/49.html new file mode 100644 index 0000000..a45bd2f --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/49.html @@ -0,0 +1,1253 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"<--- Include file: "config.h" not found.
+#endif
+
+#include "eom-file-chooser.h"
+#include "eom-config-keys.h"
+#include "eom-pixbuf-util.h"
+
+#include <stdlib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+/* We must define MATE_DESKTOP_USE_UNSTABLE_API to be able
+   to use MateDesktopThumbnail */
+#ifndef MATE_DESKTOP_USE_UNSTABLE_API
+#define MATE_DESKTOP_USE_UNSTABLE_API
+#endif
+#include <libmate-desktop/mate-desktop-thumbnail.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+static char *last_dir[] = { NULL, NULL, NULL, NULL };
+
+#define FILE_FORMAT_KEY "file-format"
+
+struct _EomFileChooserPrivate
+{
+	MateDesktopThumbnailFactory *thumb_factory;
+
+	GtkWidget *image;
+	GtkWidget *size_label;
+	GtkWidget *dim_label;
+	GtkWidget *creator_label;
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (EomFileChooser, eom_file_chooser, GTK_TYPE_FILE_CHOOSER_DIALOG)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
+
+static void
+eom_file_chooser_finalize (GObject *object)
+{
+	EomFileChooserPrivate *priv;
+
+	priv = EOM_FILE_CHOOSER (object)->priv;
+
+	if (priv->thumb_factory != NULL)
+		g_object_unref (priv->thumb_factory);
+
+	(* G_OBJECT_CLASS (eom_file_chooser_parent_class)->finalize) (object);
+}
+
+static void
+eom_file_chooser_class_init (EomFileChooserClass *klass)
+{
+	GObjectClass *object_class = (GObjectClass *) klass;
+
+	object_class->finalize = eom_file_chooser_finalize;
+}
+
+static void
+eom_file_chooser_init (EomFileChooser *chooser)
+{
+	chooser->priv = eom_file_chooser_get_instance_private (chooser);
+}
+
+static void
+response_cb (GtkDialog *dlg, gint id, gpointer data)
+{
+	char *dir;
+	GtkFileChooserAction action;
+
+	if (id == GTK_RESPONSE_OK) {
+		dir = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (dlg));
+		action = gtk_file_chooser_get_action (GTK_FILE_CHOOSER (dlg));
+
+		if (last_dir [action] != NULL)
+			g_free (last_dir [action]);
+
+		last_dir [action] = dir;
+	}
+}
+
+static void
+save_response_cb (GtkDialog *dlg, gint id, gpointer data)
+{
+	GFile *file;
+	GdkPixbufFormat *format;
+
+	if (id != GTK_RESPONSE_OK)
+		return;
+
+	file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (dlg));
+	format = eom_pixbuf_get_format (file);
+	g_object_unref (file);
+
+	if (!format || !gdk_pixbuf_format_is_writable (format)) {
+		GtkWidget *msg_dialog;
+
+		msg_dialog = gtk_message_dialog_new (
+						     GTK_WINDOW (dlg),
+						     GTK_DIALOG_MODAL,
+						     GTK_MESSAGE_ERROR,
+						     GTK_BUTTONS_OK,
+						     _("File format is unknown or unsupported"));
+
+		gtk_message_dialog_format_secondary_text (
+						GTK_MESSAGE_DIALOG (msg_dialog),
+						"%s\n%s",
+		 				_("Eye of MATE could not determine a supported writable file format based on the filename."),
+		  				_("Please try a different file extension like .png or .jpg."));
+
+		gtk_dialog_run (GTK_DIALOG (msg_dialog));
+		gtk_widget_destroy (msg_dialog);
+
+		g_signal_stop_emission_by_name (dlg, "response");
+	} else {
+		response_cb (dlg, id, data);
+	}
+}
+
+static void
+eom_file_chooser_add_filter (EomFileChooser *chooser)
+{
+	GSList *it;
+	GSList *formats;
+ 	GtkFileFilter *all_file_filter;
+	GtkFileFilter *all_img_filter;
+	GtkFileFilter *filter;
+	GSList *filters = NULL;
+	gchar **mime_types, **pattern, *tmp;
+	int i;
+	GtkFileChooserAction action;
+
+	action = gtk_file_chooser_get_action (GTK_FILE_CHOOSER (chooser));
+
+	if (action != GTK_FILE_CHOOSER_ACTION_SAVE && action != GTK_FILE_CHOOSER_ACTION_OPEN) {
+		return;
+	}
+
+	/* All Files Filter */
+	all_file_filter = gtk_file_filter_new ();
+	gtk_file_filter_set_name (all_file_filter, _("All Files"));
+	gtk_file_filter_add_pattern (all_file_filter, "*");
+
+	/* All Image Filter */
+	all_img_filter = gtk_file_filter_new ();
+	gtk_file_filter_set_name (all_img_filter, _("All Images"));
+
+	if (action == GTK_FILE_CHOOSER_ACTION_SAVE) {
+		formats = eom_pixbuf_get_savable_formats ();
+	}
+	else {
+		formats = gdk_pixbuf_get_formats ();
+	}
+
+	/* Image filters */
+	for (it = formats; it != NULL; it = it->next) {
+		char *filter_name;
+		char *description, *extension;
+		GdkPixbufFormat *format;
+		filter = gtk_file_filter_new ();
+
+		format = (GdkPixbufFormat*) it->data;
+		description = gdk_pixbuf_format_get_description (format);
+		extension = gdk_pixbuf_format_get_name (format);
+
+		/* Filter name: First description then file extension, eg. "The PNG-Format (*.png)".*/
+		filter_name = g_strdup_printf (_("%s (*.%s)"), description, extension);
+		g_free (description);
+		g_free (extension);
+
+		gtk_file_filter_set_name (filter, filter_name);
+		g_free (filter_name);
+
+		mime_types = gdk_pixbuf_format_get_mime_types ((GdkPixbufFormat *) it->data);
+		for (i = 0; mime_types[i] != NULL; i++) {
+			gtk_file_filter_add_mime_type (filter, mime_types[i]);
+			gtk_file_filter_add_mime_type (all_img_filter, mime_types[i]);
+		}
+		g_strfreev (mime_types);
+
+		pattern = gdk_pixbuf_format_get_extensions ((GdkPixbufFormat *) it->data);
+		for (i = 0; pattern[i] != NULL; i++) {
+			tmp = g_strconcat ("*.", pattern[i], NULL);
+			gtk_file_filter_add_pattern (filter, tmp);
+			gtk_file_filter_add_pattern (all_img_filter, tmp);
+			g_free (tmp);
+		}
+		g_strfreev (pattern);
+
+		/* attach GdkPixbufFormat to filter, see also
+		 * eom_file_chooser_get_format. */
+		g_object_set_data (G_OBJECT (filter),
+				   FILE_FORMAT_KEY,
+				   format);
+
+		filters = g_slist_prepend (filters, filter);
+	}
+	g_slist_free (formats);
+
+	/* Add filter to filechooser */
+	gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), all_file_filter);
+	gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), all_img_filter);
+	gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (chooser), all_img_filter);
+
+	for (it = filters; it != NULL; it = it->next) {
+		gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), GTK_FILE_FILTER (it->data));
+	}
+	g_slist_free (filters);
+}
+
+static void
+set_preview_label (GtkWidget *label, const char *str)
+{
+	if (str == NULL) {
+		gtk_widget_hide (GTK_WIDGET (label));
+	}
+	else {
+		gtk_label_set_text (GTK_LABEL (label), str);
+		gtk_widget_show (GTK_WIDGET (label));
+	}
+}
+
+/* Sets the pixbuf as preview thumbnail and tries to read and display
+ * further information according to the thumbnail spec.
+ */
+static void
+set_preview_pixbuf (EomFileChooser *chooser, GdkPixbuf *pixbuf, goffset size)
+{
+	EomFileChooserPrivate *priv;
+	int bytes;
+	int pixels;
+	const char *bytes_str;
+	const char *width;
+	const char *height;
+	const char *creator = NULL;
+	char *size_str    = NULL;
+	char *dim_str     = NULL;
+
+	g_return_if_fail (EOM_IS_FILE_CHOOSER (chooser));
+
+	priv = chooser->priv;
+
+	gtk_image_set_from_pixbuf (GTK_IMAGE (priv->image), pixbuf);
+
+	if (pixbuf != NULL) {
+		/* try to read file size */
+		bytes_str = gdk_pixbuf_get_option (pixbuf, "tEXt::Thumb::Size");
+		if (bytes_str != NULL) {
+			bytes = atoi (bytes_str);
+			size_str = g_format_size (bytes);
+		}
+		else {
+			size_str = g_format_size (size);
+		}
+
+		/* try to read image dimensions */
+		width  = gdk_pixbuf_get_option (pixbuf, "tEXt::Thumb::Image::Width");
+		height = gdk_pixbuf_get_option (pixbuf, "tEXt::Thumb::Image::Height");
+
+		if ((width != NULL) && (height != NULL)) {
+			pixels = atoi (height);
+			/* Pixel size of image: width x height in pixel */
+			dim_str = g_strdup_printf ("%s x %s %s", width, height, ngettext ("pixel", "pixels", pixels));
+		}
+
+#if 0
+		/* Not sure, if this is really useful, therefore its commented out for now. */
+
+		/* try to read creator of the thumbnail */
+		creator = gdk_pixbuf_get_option (pixbuf, "tEXt::Software");
+
+		/* stupid workaround to display nicer string if the
+		 * thumbnail is created through the mate libraries.
+		 */
+		if (g_ascii_strcasecmp (creator, "Mate::ThumbnailFactory") == 0) {
+			creator = "MATE Libs";
+		}
+#endif
+	}
+
+	set_preview_label (priv->size_label, size_str);
+	set_preview_label (priv->dim_label, dim_str);
+	set_preview_label (priv->creator_label, creator);
+
+	if (size_str != NULL) {
+		g_free (size_str);
+	}
+
+	if (dim_str != NULL) {
+		g_free (dim_str);
+	}
+}
+
+static void
+update_preview_cb (GtkFileChooser *file_chooser, gpointer data)
+{
+	EomFileChooserPrivate *priv;
+	char *uri;
+	char *thumb_path = NULL;
+	GFile *file;
+	GFileInfo *file_info;
+	GdkPixbuf *pixbuf = NULL;
+	gboolean have_preview = FALSE;
+
+	priv = EOM_FILE_CHOOSER (file_chooser)->priv;
+
+	uri = gtk_file_chooser_get_preview_uri (file_chooser);
+	if (uri == NULL) {
+		gtk_file_chooser_set_preview_widget_active (file_chooser, FALSE);
+		return;
+	}
+
+	file = g_file_new_for_uri (uri);
+	file_info = g_file_query_info (file,
+				       G_FILE_ATTRIBUTE_TIME_MODIFIED ","
+				       G_FILE_ATTRIBUTE_STANDARD_TYPE ","
+				       G_FILE_ATTRIBUTE_STANDARD_SIZE ","
+				       G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+				       0, NULL, NULL);
+	g_object_unref (file);
+
+	if ((file_info != NULL) && (priv->thumb_factory != NULL)
+	    && g_file_info_get_file_type (file_info) != G_FILE_TYPE_SPECIAL) {
+		guint64 mtime;
+
+		mtime = g_file_info_get_attribute_uint64 (file_info,
+							  G_FILE_ATTRIBUTE_TIME_MODIFIED);
+		thumb_path = mate_desktop_thumbnail_factory_lookup (priv->thumb_factory, uri, mtime);
+
+		if (thumb_path != NULL && g_file_test (thumb_path, G_FILE_TEST_EXISTS)) {
+			/* try to load and display preview thumbnail */
+			pixbuf = gdk_pixbuf_new_from_file (thumb_path, NULL);
+		} else if (g_file_info_get_size (file_info) <= 100000) {
+			/* read files smaller than 100kb directly */
+
+			gchar *mime_type = g_content_type_get_mime_type (
+						g_file_info_get_content_type (file_info));
+
+			if (G_LIKELY (mime_type)) {
+				gboolean can_thumbnail, has_failed;
+
+				can_thumbnail = mate_desktop_thumbnail_factory_can_thumbnail (
+							priv->thumb_factory,
+							uri, mime_type, mtime);
+				has_failed = mate_desktop_thumbnail_factory_has_valid_failed_thumbnail (
+							priv->thumb_factory,
+							uri, mtime);
+
+				if (G_LIKELY (can_thumbnail && !has_failed))
+					pixbuf = mate_desktop_thumbnail_factory_generate_thumbnail (
+							priv->thumb_factory, uri, mime_type);
+
+				g_free (mime_type);
+			}
+		}
+
+		if (pixbuf != NULL) {
+			have_preview = TRUE;
+
+			set_preview_pixbuf (EOM_FILE_CHOOSER (file_chooser), pixbuf,
+					    g_file_info_get_size (file_info));
+
+			g_object_unref (pixbuf);
+		}
+	}
+
+	if (thumb_path != NULL) {
+		g_free (thumb_path);
+	}
+
+	g_free (uri);
+	g_object_unref (file_info);
+
+	gtk_file_chooser_set_preview_widget_active (file_chooser, have_preview);
+}
+
+static void
+eom_file_chooser_add_preview (GtkWidget *widget)
+{
+	EomFileChooserPrivate *priv;
+	GtkWidget *vbox;
+
+	priv = EOM_FILE_CHOOSER (widget)->priv;
+
+	vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+	gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
+
+	priv->image      = gtk_image_new ();
+	/* 128x128 is maximum size of thumbnails */
+	gtk_widget_set_size_request (priv->image, 128,128);
+
+	priv->dim_label  = gtk_label_new (NULL);
+	priv->size_label = gtk_label_new (NULL);
+	priv->creator_label = gtk_label_new (NULL);
+
+	gtk_box_pack_start (GTK_BOX (vbox), priv->image, FALSE, TRUE, 0);
+	gtk_box_pack_start (GTK_BOX (vbox), priv->dim_label, FALSE, TRUE, 0);
+	gtk_box_pack_start (GTK_BOX (vbox), priv->size_label, FALSE, TRUE, 0);
+	gtk_box_pack_start (GTK_BOX (vbox), priv->creator_label, FALSE, TRUE, 0);
+
+	gtk_widget_show_all (vbox);
+
+	gtk_file_chooser_set_preview_widget (GTK_FILE_CHOOSER (widget), vbox);
+	gtk_file_chooser_set_preview_widget_active (GTK_FILE_CHOOSER (widget), FALSE);
+
+	priv->thumb_factory = mate_desktop_thumbnail_factory_new (MATE_DESKTOP_THUMBNAIL_SIZE_NORMAL);
+
+	g_signal_connect (widget, "update-preview",
+			  G_CALLBACK (update_preview_cb), NULL);
+}
+
+GtkWidget *
+eom_file_chooser_new (GtkFileChooserAction action)
+{
+	GtkWidget *chooser;
+	gchar *title = NULL;
+
+	chooser = g_object_new (EOM_TYPE_FILE_CHOOSER,
+				"action", action,
+				"select-multiple", (action == GTK_FILE_CHOOSER_ACTION_OPEN),
+				"local-only", FALSE,
+				NULL);
+
+	switch (action) {
+	case GTK_FILE_CHOOSER_ACTION_OPEN:
+		gtk_dialog_add_buttons (GTK_DIALOG (chooser),
+					"gtk-cancel", GTK_RESPONSE_CANCEL,
+					"gtk-open", GTK_RESPONSE_OK,
+					NULL);
+		title = _("Open Image");
+		break;
+
+	case GTK_FILE_CHOOSER_ACTION_SAVE:
+		gtk_dialog_add_buttons (GTK_DIALOG (chooser),
+					"gtk-cancel", GTK_RESPONSE_CANCEL,
+					"gtk-save", GTK_RESPONSE_OK,
+					NULL);
+		title = _("Save Image");
+		break;
+
+	case GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER:
+		gtk_dialog_add_buttons (GTK_DIALOG (chooser),
+					"gtk-cancel", GTK_RESPONSE_CANCEL,
+					"gtk-open", GTK_RESPONSE_OK,
+					NULL);
+		title = _("Open Folder");
+		break;
+
+	default:
+		g_assert_not_reached ();
+	}
+
+	if (action != GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER) {
+		eom_file_chooser_add_filter (EOM_FILE_CHOOSER (chooser));
+		eom_file_chooser_add_preview (chooser);
+	}
+
+	if (last_dir[action] != NULL) {
+		gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (chooser), last_dir [action]);
+	}
+
+	g_signal_connect (chooser, "response",
+			  G_CALLBACK ((action == GTK_FILE_CHOOSER_ACTION_SAVE) ?
+				      save_response_cb : response_cb),
+			  NULL);
+
+ 	gtk_window_set_title (GTK_WINDOW (chooser), title);
+	gtk_dialog_set_default_response (GTK_DIALOG (chooser), GTK_RESPONSE_OK);
+
+	gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (chooser), TRUE);
+
+	return chooser;
+}
+
+GdkPixbufFormat *
+eom_file_chooser_get_format (EomFileChooser *chooser)
+{
+	GtkFileFilter *filter;
+	GdkPixbufFormat* format;
+
+	g_return_val_if_fail (EOM_IS_FILE_CHOOSER (chooser), NULL);
+
+	filter = gtk_file_chooser_get_filter (GTK_FILE_CHOOSER (chooser));
+	if (filter == NULL)
+		return NULL;
+
+	format = g_object_get_data (G_OBJECT (filter), FILE_FORMAT_KEY);
+
+	return format;
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/5.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/5.html new file mode 100644 index 0000000..e11bf7a --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/5.html @@ -0,0 +1,2195 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/*
+ *  Copyright (C) 2002-2004 Marco Pesenti Gritti
+ *  Copyright (C) 2004 Christian Persch
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This program 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 General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  $Id: egg-toolbars-model.c 929 2009-02-19 14:49:56Z friemann $
+ */
+
+#include "config.h"<--- Include file: "config.h" not found.
+
+#include "egg-toolbars-model.h"
+#include "eggtypebuiltins.h"
+#include "eggmarshalers.h"
+
+#include <unistd.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libxml/globals.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libxml/parser.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libxml/tree.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gdk/gdk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+static void egg_toolbars_model_finalize   (GObject               *object);
+
+enum
+{
+  ITEM_ADDED,
+  ITEM_REMOVED,
+  TOOLBAR_ADDED,
+  TOOLBAR_CHANGED,
+  TOOLBAR_REMOVED,
+  LAST_SIGNAL
+};
+
+typedef struct
+{
+  char *name;
+  EggTbModelFlags flags;
+} EggToolbarsToolbar;
+
+typedef struct
+{
+  char *name;
+} EggToolbarsItem;
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
+struct EggToolbarsModelPrivate
+{
+  GNode *toolbars;
+  GList *types;
+  GHashTable *flags;
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (EggToolbarsModel, egg_toolbars_model, G_TYPE_OBJECT)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
+
+static xmlDocPtr
+egg_toolbars_model_to_xml (EggToolbarsModel *model)
+{
+  GNode *l1, *l2, *tl;
+  GList *l3;
+  xmlDocPtr doc;
+
+  g_return_val_if_fail (EGG_IS_TOOLBARS_MODEL (model), NULL);
+
+  tl = model->priv->toolbars;
+
+  xmlIndentTreeOutput = TRUE;
+  doc = xmlNewDoc ((const xmlChar*) "1.0");
+  doc->children = xmlNewDocNode (doc, NULL, (const xmlChar*) "toolbars", NULL);
+
+  for (l1 = tl->children; l1 != NULL; l1 = l1->next)
+    {
+      xmlNodePtr tnode;
+      EggToolbarsToolbar *toolbar = l1->data;
+
+      tnode = xmlNewChild (doc->children, NULL, (const xmlChar*) "toolbar", NULL);
+      xmlSetProp (tnode, (const xmlChar*) "name", (const xmlChar*) toolbar->name);
+      xmlSetProp (tnode, (const xmlChar*) "hidden",
+		  (toolbar->flags&EGG_TB_MODEL_HIDDEN) ? (const xmlChar*) "true" : (const xmlChar*) "false");
+      xmlSetProp (tnode, (const xmlChar*) "editable",
+		  (toolbar->flags&EGG_TB_MODEL_NOT_EDITABLE) ? (const xmlChar*) "false" : (const xmlChar*) "true");
+
+      for (l2 = l1->children; l2 != NULL; l2 = l2->next)
+	{
+	  xmlNodePtr node;
+	  EggToolbarsItem *item = l2->data;
+
+          if (strcmp (item->name, "_separator") == 0)
+            {
+              node = xmlNewChild (tnode, NULL, (const xmlChar*) "separator", NULL);
+              continue;
+            }
+
+          node = xmlNewChild (tnode, NULL, (const xmlChar*) "toolitem", NULL);
+          xmlSetProp (node, (const xmlChar*) "name", (const xmlChar*) item->name);
+
+          /* Add 'data' nodes for each data type which can be written out for this
+           * item. Only write types which can be used to restore the data. */
+          for (l3 = model->priv->types; l3 != NULL; l3 = l3->next)
+            {
+              EggToolbarsItemType *type = l3->data;
+              if (type->get_name != NULL && type->get_data != NULL)
+                {
+                  xmlNodePtr dnode;
+                  char *tmp;
+
+                  tmp = type->get_data (type, item->name);
+                  if (tmp != NULL)
+                    {
+                      dnode = xmlNewTextChild (node, NULL, (const xmlChar*) "data", (const xmlChar*) tmp);
+                      g_free (tmp);
+
+                      tmp = gdk_atom_name (type->type);
+                      xmlSetProp (dnode, (const xmlChar*) "type", (const xmlChar*) tmp);
+                      g_free (tmp);
+                    }
+                }
+	    }
+	}
+    }
+
+  return doc;
+}
+
+static gboolean
+safe_save_xml (const char *xml_file, xmlDocPtr doc)
+{
+	char *tmp_file;
+	char *old_file;
+	gboolean old_exist;
+	gboolean retval = TRUE;
+
+	tmp_file = g_strconcat (xml_file, ".tmp", NULL);
+	old_file = g_strconcat (xml_file, ".old", NULL);
+
+	if (xmlSaveFormatFile (tmp_file, doc, 1) <= 0)
+	{
+		g_warning ("Failed to write XML data to %s", tmp_file);
+		goto failed;
+	}
+
+	old_exist = g_file_test (xml_file, G_FILE_TEST_EXISTS);
+
+	if (old_exist)
+	{
+		if (rename (xml_file, old_file) < 0)
+		{
+			g_warning ("Failed to rename %s to %s", xml_file, old_file);
+			retval = FALSE;
+			goto failed;
+		}
+	}
+
+	if (rename (tmp_file, xml_file) < 0)
+	{
+		g_warning ("Failed to rename %s to %s", tmp_file, xml_file);
+
+		if (rename (old_file, xml_file) < 0)
+		{
+			g_warning ("Failed to restore %s from %s", xml_file, tmp_file);
+		}
+		retval = FALSE;
+		goto failed;
+	}
+
+	if (old_exist)
+	{
+		if (unlink (old_file) < 0)
+		{
+			g_warning ("Failed to delete old file %s", old_file);
+		}
+	}
+
+	failed:
+	g_free (old_file);
+	g_free (tmp_file);
+
+	return retval;
+}
+
+void
+egg_toolbars_model_save_toolbars (EggToolbarsModel *model,
+				  const char *xml_file,
+				  const char *version)
+{
+  xmlDocPtr doc;
+  xmlNodePtr root;
+
+  g_return_if_fail (EGG_IS_TOOLBARS_MODEL (model));
+
+  doc = egg_toolbars_model_to_xml (model);
+  root = xmlDocGetRootElement (doc);
+  xmlSetProp (root, (const xmlChar*) "version", (const xmlChar*) version);
+  safe_save_xml (xml_file, doc);
+  xmlFreeDoc (doc);
+}
+
+static gboolean
+is_unique (EggToolbarsModel *model,
+	   EggToolbarsItem *idata)
+{
+  EggToolbarsItem *idata2;
+  GNode *toolbar, *item;
+
+  for(toolbar = g_node_first_child (model->priv->toolbars);
+      toolbar != NULL; toolbar = g_node_next_sibling (toolbar))
+    {
+      for(item = g_node_first_child (toolbar);
+	  item != NULL; item = g_node_next_sibling (item))
+        {
+	  idata2 = item->data;
+
+	  if (idata != idata2 && strcmp (idata->name, idata2->name) == 0)
+	    {
+	      return FALSE;
+	    }
+	}
+    }
+
+  return TRUE;
+}
+
+static GNode *
+toolbar_node_new (const char *name)
+{
+  EggToolbarsToolbar *toolbar;
+
+  toolbar = g_new (EggToolbarsToolbar, 1);
+  toolbar->name = g_strdup (name);
+  toolbar->flags = 0;
+
+  return g_node_new (toolbar);
+}
+
+static GNode *
+item_node_new (const char *name, EggToolbarsModel *model)
+{
+  EggToolbarsItem *item;
+  int flags;
+
+  g_return_val_if_fail (name != NULL, NULL);
+
+  item = g_new (EggToolbarsItem, 1);
+  item->name = g_strdup (name);
+
+  flags = GPOINTER_TO_INT (g_hash_table_lookup (model->priv->flags, item->name));
+  if ((flags & EGG_TB_MODEL_NAME_INFINITE) == 0)
+    g_hash_table_insert (model->priv->flags,
+			 g_strdup (item->name),
+			 GINT_TO_POINTER (flags | EGG_TB_MODEL_NAME_USED));
+
+  return g_node_new (item);
+}
+
+static void
+item_node_free (GNode *item_node, EggToolbarsModel *model)
+{
+  EggToolbarsItem *item = item_node->data;
+  int flags;
+
+  flags = GPOINTER_TO_INT (g_hash_table_lookup (model->priv->flags, item->name));
+  if ((flags & EGG_TB_MODEL_NAME_INFINITE) == 0 && is_unique (model, item))
+    g_hash_table_insert (model->priv->flags,
+			 g_strdup (item->name),
+			 GINT_TO_POINTER (flags & ~EGG_TB_MODEL_NAME_USED));
+
+  g_free (item->name);
+  g_free (item);
+
+  g_node_destroy (item_node);
+}
+
+static void
+toolbar_node_free (GNode *toolbar_node, EggToolbarsModel *model)
+{
+  EggToolbarsToolbar *toolbar = toolbar_node->data;
+
+  g_node_children_foreach (toolbar_node, G_TRAVERSE_ALL,
+    			   (GNodeForeachFunc) item_node_free, model);
+
+  g_free (toolbar->name);
+  g_free (toolbar);
+
+  g_node_destroy (toolbar_node);
+}
+
+EggTbModelFlags
+egg_toolbars_model_get_flags (EggToolbarsModel *model,
+			      int               toolbar_position)
+{
+  GNode *toolbar_node;
+  EggToolbarsToolbar *toolbar;
+
+  toolbar_node = g_node_nth_child (model->priv->toolbars, toolbar_position);
+  g_return_val_if_fail (toolbar_node != NULL, 0);
+
+  toolbar = toolbar_node->data;
+
+  return toolbar->flags;
+}
+
+void
+egg_toolbars_model_set_flags (EggToolbarsModel *model,
+			      int               toolbar_position,
+			      EggTbModelFlags   flags)
+{
+  GNode *toolbar_node;
+  EggToolbarsToolbar *toolbar;
+
+  toolbar_node = g_node_nth_child (model->priv->toolbars, toolbar_position);
+  g_return_if_fail (toolbar_node != NULL);
+
+  toolbar = toolbar_node->data;
+
+  toolbar->flags = flags;
+
+  g_signal_emit (G_OBJECT (model), signals[TOOLBAR_CHANGED],
+		 0, toolbar_position);
+}
+
+char *
+egg_toolbars_model_get_data (EggToolbarsModel *model,
+                             GdkAtom           type,
+                             const char       *name)
+{
+  EggToolbarsItemType *t;
+  char *data = NULL;
+  GList *l;
+
+  if (type == GDK_NONE || type == gdk_atom_intern (EGG_TOOLBAR_ITEM_TYPE, FALSE))
+    {
+      g_return_val_if_fail (name != NULL, NULL);
+      g_return_val_if_fail (*name != 0,   NULL);
+      return strdup (name);
+    }
+
+  for (l = model->priv->types; l != NULL; l = l->next)
+    {
+      t = l->data;
+      if (t->type == type && t->get_data != NULL)
+        {
+          data = t->get_data (t, name);
+	  if (data != NULL) break;
+        }
+    }
+
+  return data;
+}
+
+char *
+egg_toolbars_model_get_name (EggToolbarsModel *model,
+                             GdkAtom           type,
+                             const char       *data,
+                             gboolean          create)
+{
+  EggToolbarsItemType *t;
+  char *name = NULL;
+  GList *l;
+
+  if (type == GDK_NONE || type == gdk_atom_intern (EGG_TOOLBAR_ITEM_TYPE, FALSE))
+    {
+      g_return_val_if_fail (data, NULL);
+      g_return_val_if_fail (*data, NULL);
+      return strdup (data);
+    }
+
+  if (create)
+    {
+      for (l = model->priv->types; name == NULL && l != NULL; l = l->next)
+        {
+          t = l->data;
+          if (t->type == type && t->new_name != NULL)
+            name = t->new_name (t, data);
+        }
+
+      return name;
+    }
+  else
+    {
+      for (l = model->priv->types; name == NULL && l != NULL; l = l->next)
+        {
+          t = l->data;
+          if (t->type == type && t->get_name != NULL)
+            name = t->get_name (t, data);
+        }
+
+      return name;
+    }
+}
+
+static gboolean
+impl_add_item (EggToolbarsModel    *model,
+	       int		    toolbar_position,
+	       int		    position,
+	       const char          *name)
+{
+  GNode *parent_node;
+  GNode *child_node;
+  int real_position;
+
+  g_return_val_if_fail (EGG_IS_TOOLBARS_MODEL (model), FALSE);
+  g_return_val_if_fail (name != NULL, FALSE);
+
+  parent_node = g_node_nth_child (model->priv->toolbars, toolbar_position);
+  child_node = item_node_new (name, model);
+  g_node_insert (parent_node, position, child_node);
+
+  real_position = g_node_child_position (parent_node, child_node);
+
+  g_signal_emit (G_OBJECT (model), signals[ITEM_ADDED], 0,
+		 toolbar_position, real_position);
+
+  return TRUE;
+}
+
+gboolean
+egg_toolbars_model_add_item (EggToolbarsModel *model,
+			     int	       toolbar_position,
+			     int               position,
+			     const char       *name)
+{
+  EggToolbarsModelClass *klass = EGG_TOOLBARS_MODEL_GET_CLASS (model);
+  return klass->add_item (model, toolbar_position, position, name);
+}
+
+int
+egg_toolbars_model_add_toolbar (EggToolbarsModel *model,
+				int               position,
+				const char       *name)
+{
+  GNode *node;
+  int real_position;
+
+  g_return_val_if_fail (EGG_IS_TOOLBARS_MODEL (model), -1);
+
+  node = toolbar_node_new (name);
+  g_node_insert (model->priv->toolbars, position, node);
+
+  real_position = g_node_child_position (model->priv->toolbars, node);
+
+  g_signal_emit (G_OBJECT (model), signals[TOOLBAR_ADDED],
+		 0, real_position);
+
+  return g_node_child_position (model->priv->toolbars, node);
+}
+
+static char *
+parse_data_list (EggToolbarsModel *model,
+		 xmlNodePtr        child,
+                 gboolean          create)
+{
+  char *name = NULL;
+  while (child && name == NULL)
+    {
+      if (xmlStrEqual (child->name, (const xmlChar*) "data"))
+        {
+          xmlChar *type = xmlGetProp (child, (const xmlChar*) "type");
+          xmlChar *data = xmlNodeGetContent (child);
+
+          if (type != NULL)
+            {
+              GdkAtom atom = gdk_atom_intern ((const char*) type, TRUE);
+              name = egg_toolbars_model_get_name (model, atom, (const char*) data, create);
+            }
+
+          xmlFree (type);
+          xmlFree (data);
+        }
+
+      child = child->next;
+    }
+
+  return name;
+}
+
+static void
+parse_item_list (EggToolbarsModel *model,
+		 xmlNodePtr        child,
+		 int               position)
+{
+  while (child)
+    {
+      if (xmlStrEqual (child->name, (const xmlChar*) "toolitem"))
+	{
+          char *name;
+
+          /* Try to get the name using the data elements first,
+             as they are more 'portable' or 'persistent'. */
+          name = parse_data_list (model, child->children, FALSE);
+          if (name == NULL)
+            {
+              name = parse_data_list (model, child->children, TRUE);
+            }
+
+          /* If that fails, try to use the name. */
+          if (name == NULL)
+            {
+              xmlChar *type = xmlGetProp (child, (const xmlChar*) "type");
+              xmlChar *data = xmlGetProp (child, (const xmlChar*) "name");
+              GdkAtom  atom = type ? gdk_atom_intern ((const char*) type, TRUE) : GDK_NONE;
+
+              /* If an old format, try to use it. */
+              name = egg_toolbars_model_get_name (model, atom, (const char*) data, FALSE);
+              if (name == NULL)
+                {
+                  name = egg_toolbars_model_get_name (model, atom, (const char*) data, TRUE);
+                }
+
+              xmlFree (type);
+              xmlFree (data);
+            }
+
+          if (name != NULL)
+            {
+              egg_toolbars_model_add_item (model, position, -1, name);
+              g_free (name);
+            }
+	}
+      else if (xmlStrEqual (child->name, (const xmlChar*) "separator"))
+	{
+          egg_toolbars_model_add_item (model, position, -1, "_separator");
+	}
+
+      child = child->next;
+    }
+}
+
+static void
+parse_toolbars (EggToolbarsModel *model,
+		xmlNodePtr        child)
+{
+  while (child)
+    {
+      if (xmlStrEqual (child->name, (const xmlChar*) "toolbar"))
+	{
+	  xmlChar *string;
+	  int position;
+          EggTbModelFlags flags;
+
+	  string = xmlGetProp (child, (const xmlChar*) "name");
+	  position = egg_toolbars_model_add_toolbar (model, -1, (const char*) string);
+          flags = egg_toolbars_model_get_flags (model, position);
+	  xmlFree (string);
+
+	  string = xmlGetProp (child, (const xmlChar*) "editable");
+          if (string && xmlStrEqual (string, (const xmlChar*) "false"))
+            flags |= EGG_TB_MODEL_NOT_EDITABLE;
+	  xmlFree (string);
+
+	  string = xmlGetProp (child, (const xmlChar*) "hidden");
+          if (string && xmlStrEqual (string, (const xmlChar*) "true"))
+            flags |= EGG_TB_MODEL_HIDDEN;
+	  xmlFree (string);
+
+	  string = xmlGetProp (child, (const xmlChar*) "style");
+	  if (string && xmlStrEqual (string, (const xmlChar*) "icons-only"))
+            flags |= EGG_TB_MODEL_ICONS;
+	  xmlFree (string);
+
+          egg_toolbars_model_set_flags (model, position, flags);
+
+	  parse_item_list (model, child->children, position);
+	}
+
+      child = child->next;
+    }
+}
+
+gboolean
+egg_toolbars_model_load_toolbars (EggToolbarsModel *model,
+				  const char *xml_file)
+{
+  xmlDocPtr doc;
+  xmlNodePtr root;
+
+  g_return_val_if_fail (EGG_IS_TOOLBARS_MODEL (model), FALSE);
+
+  if (!xml_file || !g_file_test (xml_file, G_FILE_TEST_EXISTS)) return FALSE;
+
+  doc = xmlParseFile (xml_file);
+  if (doc == NULL)
+  {
+    g_warning ("Failed to load XML data from %s", xml_file);
+    return FALSE;
+  }
+  root = xmlDocGetRootElement (doc);
+
+  parse_toolbars (model, root->children);
+
+  xmlFreeDoc (doc);
+
+  return TRUE;
+}
+
+static void
+parse_available_list (EggToolbarsModel *model,
+		      xmlNodePtr        child)
+{
+  gint flags;
+
+  while (child)
+    {
+      if (xmlStrEqual (child->name, (const xmlChar*) "toolitem"))
+	{
+	  xmlChar *name;
+
+	  name = xmlGetProp (child, (const xmlChar*) "name");
+	  flags = egg_toolbars_model_get_name_flags
+	    (model, (const char*)name);
+	  egg_toolbars_model_set_name_flags
+	    (model, (const char*)name, flags | EGG_TB_MODEL_NAME_KNOWN);
+	  xmlFree (name);
+	}
+      child = child->next;
+    }
+}
+
+static void
+parse_names (EggToolbarsModel *model,
+	     xmlNodePtr        child)
+{
+  while (child)
+    {
+      if (xmlStrEqual (child->name, (const xmlChar*) "available"))
+	{
+	  parse_available_list (model, child->children);
+	}
+
+      child = child->next;
+    }
+}
+
+gboolean
+egg_toolbars_model_load_names (EggToolbarsModel *model,
+			       const char *xml_file)
+{
+  xmlDocPtr doc;
+  xmlNodePtr root;
+
+  g_return_val_if_fail (EGG_IS_TOOLBARS_MODEL (model), FALSE);
+
+  if (!xml_file || !g_file_test (xml_file, G_FILE_TEST_EXISTS)) return FALSE;
+
+  doc = xmlParseFile (xml_file);
+  if (doc == NULL)
+  {
+    g_warning ("Failed to load XML data from %s", xml_file);
+    return FALSE;
+  }
+  root = xmlDocGetRootElement (doc);
+
+  parse_names (model, root->children);
+
+  xmlFreeDoc (doc);
+
+  return TRUE;
+}
+
+static void
+egg_toolbars_model_class_init (EggToolbarsModelClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+  object_class->finalize = egg_toolbars_model_finalize;
+
+  klass->add_item = impl_add_item;
+
+  signals[ITEM_ADDED] =
+    g_signal_new ("item_added",
+		  G_OBJECT_CLASS_TYPE (object_class),
+		  G_SIGNAL_RUN_LAST,
+		  G_STRUCT_OFFSET (EggToolbarsModelClass, item_added),
+		  NULL, NULL, _egg_marshal_VOID__INT_INT,
+		  G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
+  signals[TOOLBAR_ADDED] =
+    g_signal_new ("toolbar_added",
+		  G_OBJECT_CLASS_TYPE (object_class),
+		  G_SIGNAL_RUN_LAST,
+		  G_STRUCT_OFFSET (EggToolbarsModelClass, toolbar_added),
+		  NULL, NULL, g_cclosure_marshal_VOID__INT,
+		  G_TYPE_NONE, 1, G_TYPE_INT);
+  signals[ITEM_REMOVED] =
+    g_signal_new ("item_removed",
+		  G_OBJECT_CLASS_TYPE (object_class),
+		  G_SIGNAL_RUN_LAST,
+		  G_STRUCT_OFFSET (EggToolbarsModelClass, item_removed),
+		  NULL, NULL, _egg_marshal_VOID__INT_INT,
+		  G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
+  signals[TOOLBAR_REMOVED] =
+    g_signal_new ("toolbar_removed",
+		  G_OBJECT_CLASS_TYPE (object_class),
+		  G_SIGNAL_RUN_LAST,
+		  G_STRUCT_OFFSET (EggToolbarsModelClass, toolbar_removed),
+		  NULL, NULL, g_cclosure_marshal_VOID__INT,
+		  G_TYPE_NONE, 1, G_TYPE_INT);
+  signals[TOOLBAR_CHANGED] =
+    g_signal_new ("toolbar_changed",
+		  G_OBJECT_CLASS_TYPE (object_class),
+		  G_SIGNAL_RUN_LAST,
+		  G_STRUCT_OFFSET (EggToolbarsModelClass, toolbar_changed),
+		  NULL, NULL, g_cclosure_marshal_VOID__INT,
+		  G_TYPE_NONE, 1, G_TYPE_INT);
+}
+
+static void
+egg_toolbars_model_init (EggToolbarsModel *model)
+{
+  model->priv = egg_toolbars_model_get_instance_private (model);
+
+  model->priv->toolbars = g_node_new (NULL);
+  model->priv->flags = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+  egg_toolbars_model_set_name_flags (model, "_separator",
+				     EGG_TB_MODEL_NAME_KNOWN |
+				     EGG_TB_MODEL_NAME_INFINITE);
+}
+
+static void
+egg_toolbars_model_finalize (GObject *object)
+{
+  EggToolbarsModel *model = EGG_TOOLBARS_MODEL (object);
+
+  g_node_children_foreach (model->priv->toolbars, G_TRAVERSE_ALL,
+    			   (GNodeForeachFunc) toolbar_node_free, model);
+  g_node_destroy (model->priv->toolbars);
+  g_hash_table_destroy (model->priv->flags);
+
+  G_OBJECT_CLASS (egg_toolbars_model_parent_class)->finalize (object);
+}
+
+EggToolbarsModel *
+egg_toolbars_model_new (void)
+{
+  return EGG_TOOLBARS_MODEL (g_object_new (EGG_TYPE_TOOLBARS_MODEL, NULL));
+}
+
+void
+egg_toolbars_model_remove_toolbar (EggToolbarsModel   *model,
+				   int                 position)
+{
+  GNode *node;
+  EggTbModelFlags flags;
+
+  g_return_if_fail (EGG_IS_TOOLBARS_MODEL (model));
+
+  flags = egg_toolbars_model_get_flags (model, position);
+
+  if (!(flags & EGG_TB_MODEL_NOT_REMOVABLE))
+    {
+      node = g_node_nth_child (model->priv->toolbars, position);
+      g_return_if_fail (node != NULL);
+
+      toolbar_node_free (node, model);
+
+      g_signal_emit (G_OBJECT (model), signals[TOOLBAR_REMOVED],
+		     0, position);
+    }
+}
+
+void
+egg_toolbars_model_remove_item (EggToolbarsModel *model,
+				int               toolbar_position,
+				int               position)
+{
+  GNode *node, *toolbar;
+
+  g_return_if_fail (EGG_IS_TOOLBARS_MODEL (model));
+
+  toolbar = g_node_nth_child (model->priv->toolbars, toolbar_position);
+  g_return_if_fail (toolbar != NULL);
+
+  node = g_node_nth_child (toolbar, position);
+  g_return_if_fail (node != NULL);
+
+  item_node_free (node, model);
+
+  g_signal_emit (G_OBJECT (model), signals[ITEM_REMOVED], 0,
+		 toolbar_position, position);
+}
+
+void
+egg_toolbars_model_move_item (EggToolbarsModel *model,
+			      int               toolbar_position,
+			      int               position,
+			      int		new_toolbar_position,
+			      int		new_position)
+{
+  GNode *node, *toolbar, *new_toolbar;
+
+  g_return_if_fail (EGG_IS_TOOLBARS_MODEL (model));
+
+  toolbar = g_node_nth_child (model->priv->toolbars, toolbar_position);
+  g_return_if_fail (toolbar != NULL);
+
+  new_toolbar = g_node_nth_child (model->priv->toolbars, new_toolbar_position);
+  g_return_if_fail (new_toolbar != NULL);
+
+  node = g_node_nth_child (toolbar, position);
+  g_return_if_fail (node != NULL);
+
+  g_node_unlink (node);
+
+  g_signal_emit (G_OBJECT (model), signals[ITEM_REMOVED], 0,
+		 toolbar_position, position);
+
+  g_node_insert (new_toolbar, new_position, node);
+
+  g_signal_emit (G_OBJECT (model), signals[ITEM_ADDED], 0,
+		 new_toolbar_position, new_position);
+}
+
+void
+egg_toolbars_model_delete_item (EggToolbarsModel *model,
+				const char       *name)
+{
+  EggToolbarsItem *idata;
+  EggToolbarsToolbar *tdata;
+  GNode *toolbar, *item, *next;
+  int tpos, ipos;
+
+  g_return_if_fail (EGG_IS_TOOLBARS_MODEL (model));
+
+  toolbar = g_node_first_child (model->priv->toolbars);
+  tpos = 0;
+
+  while (toolbar != NULL)
+    {
+      item = g_node_first_child (toolbar);
+      ipos = 0;
+
+      /* Don't delete toolbars that were already empty */
+      if (item == NULL)
+        {
+	  toolbar = g_node_next_sibling (toolbar);
+	  continue;
+        }
+
+      while (item != NULL)
+        {
+	  next = g_node_next_sibling (item);
+	  idata = item->data;
+	  if (strcmp (idata->name, name) == 0)
+	    {
+	      item_node_free (item, model);
+	      g_signal_emit (G_OBJECT (model),
+			     signals[ITEM_REMOVED],
+			     0, tpos, ipos);
+	    }
+	  else
+	    {
+	      ipos++;
+	    }
+
+	  item = next;
+        }
+
+      next = g_node_next_sibling (toolbar);
+      tdata = toolbar->data;
+      if (!(tdata->flags & EGG_TB_MODEL_NOT_REMOVABLE) &&
+	  g_node_first_child (toolbar) == NULL)
+        {
+	  toolbar_node_free (toolbar, model);
+
+	  g_signal_emit (G_OBJECT (model),
+			 signals[TOOLBAR_REMOVED],
+			 0, tpos);
+        }
+      else
+        {
+	  tpos++;
+        }
+
+      toolbar = next;
+    }
+}
+
+int
+egg_toolbars_model_n_items (EggToolbarsModel *model,
+			    int               toolbar_position)
+{
+  GNode *toolbar;
+
+  toolbar = g_node_nth_child (model->priv->toolbars, toolbar_position);
+  g_return_val_if_fail (toolbar != NULL, -1);
+
+  return g_node_n_children (toolbar);
+}
+
+const char *
+egg_toolbars_model_item_nth (EggToolbarsModel *model,
+			     int	       toolbar_position,
+			     int               position)
+{
+  GNode *toolbar;
+  GNode *item;
+  EggToolbarsItem *idata;
+
+  toolbar = g_node_nth_child (model->priv->toolbars, toolbar_position);
+  g_return_val_if_fail (toolbar != NULL, NULL);
+
+  item = g_node_nth_child (toolbar, position);
+  g_return_val_if_fail (item != NULL, NULL);
+
+  idata = item->data;
+  return idata->name;
+}
+
+int
+egg_toolbars_model_n_toolbars (EggToolbarsModel *model)
+{
+  return g_node_n_children (model->priv->toolbars);
+}
+
+const char *
+egg_toolbars_model_toolbar_nth (EggToolbarsModel *model,
+				int               position)
+{
+  GNode *toolbar;
+  EggToolbarsToolbar *tdata;
+
+  toolbar = g_node_nth_child (model->priv->toolbars, position);
+  g_return_val_if_fail (toolbar != NULL, NULL);
+
+  tdata = toolbar->data;
+
+  return tdata->name;
+}
+
+GList *
+egg_toolbars_model_get_types (EggToolbarsModel *model)
+{
+  return model->priv->types;
+}
+
+void
+egg_toolbars_model_set_types (EggToolbarsModel *model, GList *types)
+{
+  model->priv->types = types;
+}
+
+static void
+fill_avail_array (gpointer key, gpointer value, GPtrArray *array)
+{
+  int flags = GPOINTER_TO_INT (value);
+  if ((flags & EGG_TB_MODEL_NAME_KNOWN) && !(flags & EGG_TB_MODEL_NAME_USED))
+      g_ptr_array_add (array, key);
+}
+
+GPtrArray *
+egg_toolbars_model_get_name_avail (EggToolbarsModel *model)
+{
+  GPtrArray *array = g_ptr_array_new ();
+  g_hash_table_foreach (model->priv->flags, (GHFunc) fill_avail_array, array);
+  return array;
+}
+
+gint
+egg_toolbars_model_get_name_flags (EggToolbarsModel *model, const char *name)
+{
+  return GPOINTER_TO_INT (g_hash_table_lookup (model->priv->flags, name));
+}
+
+void
+egg_toolbars_model_set_name_flags (EggToolbarsModel *model, const char *name, gint flags)
+{
+  g_hash_table_insert (model->priv->flags, g_strdup (name), GINT_TO_POINTER (flags));
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/50.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/50.html new file mode 100644 index 0000000..e593e73 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/50.html @@ -0,0 +1,281 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
#ifndef _EOM_IMAGE_JPEG_H_
+#define _EOM_IMAGE_JPEG_H_
+
+#if HAVE_JPEG
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "eom-image.h"
+#include "eom-image-save-info.h"
+
+/* Saves a source jpeg file in an arbitrary format (as specified by
+ * target). The target pointer may be NULL, in which case the output
+ * file is saved as jpeg too.  This method tries to be as smart as
+ * possible. It will save the image as lossless as possible (if the
+ * target is a jpeg image too).
+ */
+G_GNUC_INTERNAL
+gboolean eom_image_jpeg_save_file (EomImage *image, const char *file,
+				   EomImageSaveInfo *source, EomImageSaveInfo *target,
+				   GError **error);
+#endif
+
+#endif /* _EOM_IMAGE_JPEG_H_ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/51.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/51.html new file mode 100644 index 0000000..3ef5142 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/51.html @@ -0,0 +1,1293 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* This code is based on the jpeg saving code from gdk-pixbuf. Full copyright
+ * notice is given in the following:
+ */
+/* GdkPixbuf library - JPEG image loader
+ *
+ * Copyright (C) 1999 Michael Zucchi
+ * Copyright (C) 1999 The Free Software Foundation
+ *
+ * Progressive loading code Copyright (C) 1999 Red Hat, Inc.
+ *
+ * Authors: Michael Zucchi <zucchi@zedzone.mmc.com.au>
+ *          Federico Mena-Quintero <federico@gimp.org>
+ *          Michael Fulbright <drmike@redhat.com>
+ *
+ * This library 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.
+ *
+ * This library 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 library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include "eom-image-jpeg.h"
+#include "eom-image-private.h"
+
+#if HAVE_JPEG
+
+#include <sys/types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <unistd.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <stdio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <stdlib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <setjmp.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <jpeglib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <jerror.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "transupp.h"<--- Include file: "transupp.h" not found.
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gdk-pixbuf/gdk-pixbuf.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#if HAVE_EXIF
+#include <libexif/exif-data.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#ifdef G_OS_WIN32
+#define sigjmp_buf jmp_buf
+#define sigsetjmp(env, savesigs) setjmp (env)
+#define siglongjmp longjmp
+#endif
+
+typedef enum {
+	EOM_SAVE_NONE,
+	EOM_SAVE_JPEG_AS_JPEG,
+	EOM_SAVE_ANY_AS_JPEG
+} EomJpegSaveMethod;
+
+/* error handler data */
+struct error_handler_data {
+	struct jpeg_error_mgr pub;
+	sigjmp_buf setjmp_buffer;
+        GError **error;
+	char *filename;
+};
+
+static void
+fatal_error_handler (j_common_ptr cinfo)
+{
+	struct error_handler_data *errmgr;
+        char buffer[JMSG_LENGTH_MAX];
+
+	errmgr = (struct error_handler_data *) cinfo->err;
+
+        /* Create the message */
+        (* cinfo->err->format_message) (cinfo, buffer);
+
+        /* broken check for *error == NULL for robustness against
+         * crappy JPEG library
+         */
+        if (errmgr->error && *errmgr->error == NULL) {
+                gchar *str = g_path_get_basename (errmgr->filename);
+                g_set_error (errmgr->error,
+			     0,
+			     0,
+			     "Error interpreting JPEG image file: %s\n\n%s",
+			     str, buffer);
+                g_free (str);
+        }
+
+	siglongjmp (errmgr->setjmp_buffer, 1);
+
+        g_assert_not_reached ();
+}
+
+static void
+output_message_handler (j_common_ptr cinfo)
+{
+	/* This method keeps libjpeg from dumping crap to stderr */
+	/* do nothing */
+}
+
+static void
+init_transform_info (EomImage *image, jpeg_transform_info *info)
+{
+	EomImagePrivate *priv;
+	EomTransform *composition = NULL;
+	EomTransformType transformation;
+	JXFORM_CODE trans_code = JXFORM_NONE;
+
+	g_return_if_fail (EOM_IS_IMAGE (image));
+
+	memset (info, 0x0, sizeof (jpeg_transform_info));
+
+	priv = image->priv;
+
+	if (priv->trans != NULL && priv->trans_autorotate != NULL) {
+		composition = eom_transform_compose (priv->trans,
+						     priv->trans_autorotate);
+	} else if (priv->trans != NULL) {
+		composition = g_object_ref (priv->trans);
+	} else if (priv->trans_autorotate != NULL) {
+		composition = g_object_ref (priv->trans_autorotate);
+	}
+
+	if (composition != NULL) {
+		transformation = eom_transform_get_transform_type (composition);
+
+		switch (transformation) {
+		case EOM_TRANSFORM_ROT_90:
+			trans_code = JXFORM_ROT_90;
+			break;
+		case EOM_TRANSFORM_ROT_270:
+			trans_code = JXFORM_ROT_270;
+			break;
+		case EOM_TRANSFORM_ROT_180:
+			trans_code = JXFORM_ROT_180;
+			break;
+		case EOM_TRANSFORM_FLIP_HORIZONTAL:
+			trans_code = JXFORM_FLIP_H;
+			break;
+		case EOM_TRANSFORM_FLIP_VERTICAL:
+			trans_code = JXFORM_FLIP_V;
+			break;
+		case EOM_TRANSFORM_TRANSPOSE:
+			trans_code = JXFORM_TRANSPOSE;
+			break;
+		case EOM_TRANSFORM_TRANSVERSE:
+			trans_code = JXFORM_TRANSVERSE;
+			break;
+		default:
+			g_warning("EomTransformType not supported!");
+			/* Fallthrough intended here. */
+		case EOM_TRANSFORM_NONE:
+			trans_code = JXFORM_NONE;
+			break;
+		}
+	}
+
+	info->transform = trans_code;
+	info->trim      = FALSE;
+#if JPEG_LIB_VERSION >= 80
+	info->crop = FALSE;
+#endif
+	info->force_grayscale = FALSE;
+
+	g_object_unref (composition);
+}
+
+static gboolean
+_save_jpeg_as_jpeg (EomImage *image, const char *file, EomImageSaveInfo *source,
+		    EomImageSaveInfo *target, GError **error)
+{
+	struct jpeg_decompress_struct  srcinfo;
+	struct jpeg_compress_struct    dstinfo;
+	struct error_handler_data      jsrcerr, jdsterr;
+	jpeg_transform_info            transformoption;
+	jvirt_barray_ptr              *src_coef_arrays;
+	jvirt_barray_ptr              *dst_coef_arrays;
+	FILE                          *output_file;
+	FILE                          *input_file;
+	EomImagePrivate               *priv;
+	gchar                          *infile_uri;
+
+	g_return_val_if_fail (EOM_IS_IMAGE (image), FALSE);
+	g_return_val_if_fail (EOM_IMAGE (image)->priv->file != NULL, FALSE);
+
+	priv = image->priv;
+
+	init_transform_info (image, &transformoption);
+
+	/* Initialize the JPEG decompression object with default error
+	 * handling. */
+	jsrcerr.filename = g_file_get_path (priv->file);
+	srcinfo.err = jpeg_std_error (&(jsrcerr.pub));
+	jsrcerr.pub.error_exit = fatal_error_handler;
+	jsrcerr.pub.output_message = output_message_handler;
+	jsrcerr.error = error;<--- Variable 'jsrcerr.error' is assigned a value that is never used.
+
+	jpeg_create_decompress (&srcinfo);
+
+	/* Initialize the JPEG compression object with default error
+	 * handling. */
+	jdsterr.filename = (char *) file;<--- Variable 'jdsterr.filename' is assigned a value that is never used.
+	dstinfo.err = jpeg_std_error (&(jdsterr.pub));
+	jdsterr.pub.error_exit = fatal_error_handler;
+	jdsterr.pub.output_message = output_message_handler;
+	jdsterr.error = error;<--- Variable 'jdsterr.error' is assigned a value that is never used.
+
+	jpeg_create_compress (&dstinfo);
+
+	dstinfo.err->trace_level = 0;
+	dstinfo.arith_code = FALSE;
+	dstinfo.optimize_coding = FALSE;
+
+	jsrcerr.pub.trace_level = jdsterr.pub.trace_level;
+	srcinfo.mem->max_memory_to_use = dstinfo.mem->max_memory_to_use;
+
+	/* Open the output file. */
+	/* FIXME: Make this a GIO aware input manager */
+	infile_uri = g_file_get_path (priv->file);
+	input_file = fopen (infile_uri, "rb");
+	if (input_file == NULL) {
+		g_warning ("Input file not openable: %s\n", infile_uri);
+		g_free (jsrcerr.filename);
+		g_free (infile_uri);
+		return FALSE;
+	}
+	g_free (infile_uri);
+
+	output_file = fopen (file, "wb");
+	if (output_file == NULL) {
+		g_warning ("Output file not openable: %s\n", file);
+		fclose (input_file);
+		g_free (jsrcerr.filename);
+		return FALSE;
+	}
+
+	if (sigsetjmp (jsrcerr.setjmp_buffer, 1)) {
+		fclose (output_file);
+		fclose (input_file);
+		jpeg_destroy_compress (&dstinfo);
+		jpeg_destroy_decompress (&srcinfo);
+		g_free (jsrcerr.filename);
+		return FALSE;
+	}
+
+	if (sigsetjmp (jdsterr.setjmp_buffer, 1)) {
+		fclose (output_file);
+		fclose (input_file);
+		jpeg_destroy_compress (&dstinfo);
+		jpeg_destroy_decompress (&srcinfo);
+		g_free (jsrcerr.filename);
+		return FALSE;
+	}
+
+	/* Specify data source for decompression */
+	jpeg_stdio_src (&srcinfo, input_file);
+
+	/* Enable saving of extra markers that we want to copy */
+	jcopy_markers_setup (&srcinfo, JCOPYOPT_DEFAULT);
+
+	/* Read file header */
+	(void) jpeg_read_header (&srcinfo, TRUE);
+
+	/* Any space needed by a transform option must be requested before
+	 * jpeg_read_coefficients so that memory allocation will be done right.
+	 */
+	jtransform_request_workspace (&srcinfo, &transformoption);
+
+	/* Read source file as DCT coefficients */
+	src_coef_arrays = jpeg_read_coefficients (&srcinfo);
+
+	/* Initialize destination compression parameters from source values */
+	jpeg_copy_critical_parameters (&srcinfo, &dstinfo);
+
+	/* Adjust destination parameters if required by transform options;
+	 * also find out which set of coefficient arrays will hold the output.
+	 */
+	dst_coef_arrays = jtransform_adjust_parameters (&srcinfo,
+							&dstinfo,
+							src_coef_arrays,
+							&transformoption);
+
+	/* Specify data destination for compression */
+	jpeg_stdio_dest (&dstinfo, output_file);
+
+	/* Start compressor (note no image data is actually written here) */
+	jpeg_write_coefficients (&dstinfo, dst_coef_arrays);
+
+	/* handle EXIF/IPTC data explicitly */
+#if HAVE_EXIF
+	/* exif_chunk and exif are mutally exclusvie, this is what we assure here */
+	g_assert (priv->exif_chunk == NULL);
+	if (priv->exif != NULL)
+	{
+		unsigned char *exif_buf;
+		unsigned int   exif_buf_len;
+
+		exif_data_save_data (priv->exif, &exif_buf, &exif_buf_len);
+		jpeg_write_marker (&dstinfo, JPEG_APP0+1, exif_buf, exif_buf_len);
+		g_free (exif_buf);
+	}
+#else
+	if (priv->exif_chunk != NULL) {
+		jpeg_write_marker (&dstinfo, JPEG_APP0+1, priv->exif_chunk, priv->exif_chunk_len);
+	}
+#endif
+	/* FIXME: Consider IPTC data too */
+
+	/* Copy to the output file any extra markers that we want to
+	 * preserve */
+	jcopy_markers_execute (&srcinfo, &dstinfo, JCOPYOPT_DEFAULT);
+
+	/* Execute image transformation, if any */
+	jtransform_execute_transformation (&srcinfo,
+					   &dstinfo,
+					   src_coef_arrays,
+					   &transformoption);
+
+	/* Finish compression and release memory */
+	jpeg_finish_compress (&dstinfo);
+	jpeg_destroy_compress (&dstinfo);
+	(void) jpeg_finish_decompress (&srcinfo);
+	jpeg_destroy_decompress (&srcinfo);
+	g_free (jsrcerr.filename);
+
+	/* Close files */
+	fclose (input_file);
+	fclose (output_file);
+
+	return TRUE;
+}
+
+static gboolean
+_save_any_as_jpeg (EomImage *image, const char *file, EomImageSaveInfo *source,
+		   EomImageSaveInfo *target, GError **error)
+{
+	EomImagePrivate *priv;
+	GdkPixbuf *pixbuf;
+	struct jpeg_compress_struct cinfo;
+	guchar *buf = NULL;
+	guchar *ptr;<--- Variable 'ptr' can be declared as pointer to const
+	guchar *pixels = NULL;
+	JSAMPROW *jbuf;
+	int y = 0;
+	volatile int quality = 75; /* default; must be between 0 and 100 */
+	int i, j;
+	int w, h = 0;
+	int rowstride = 0;
+	FILE *outfile;
+	struct error_handler_data jerr;
+
+	g_return_val_if_fail (EOM_IS_IMAGE (image), FALSE);
+	g_return_val_if_fail (EOM_IMAGE (image)->priv->image != NULL, FALSE);
+
+	priv = image->priv;
+	pixbuf = priv->image;
+
+	rowstride = gdk_pixbuf_get_rowstride (pixbuf);
+	w = gdk_pixbuf_get_width (pixbuf);
+	h = gdk_pixbuf_get_height (pixbuf);
+
+	/* no image data? abort */
+	pixels = gdk_pixbuf_get_pixels (pixbuf);
+	g_return_val_if_fail (pixels != NULL, FALSE);
+
+	outfile = fopen (file, "wb");
+	if (outfile == NULL) {
+		g_set_error (error,             /* FIXME: Better error message */
+			     GDK_PIXBUF_ERROR,
+			     GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
+			     _("Couldn't create temporary file for saving: %s"),
+			     file);
+		return FALSE;
+	}
+
+	/* allocate a small buffer to convert image data */
+	buf = g_try_malloc (w * 3 * sizeof (guchar));
+	if (!buf) {
+		g_set_error (error,
+			     GDK_PIXBUF_ERROR,
+			     GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
+			     _("Couldn't allocate memory for loading JPEG file"));
+		fclose (outfile);
+		return FALSE;
+	}
+
+	/* set up error handling */
+	jerr.filename = (char *) file;<--- Variable 'jerr.filename' is assigned a value that is never used.
+	cinfo.err = jpeg_std_error (&(jerr.pub));
+	jerr.pub.error_exit = fatal_error_handler;
+	jerr.pub.output_message = output_message_handler;
+	jerr.error = error;<--- Variable 'jerr.error' is assigned a value that is never used.
+
+	/* setup compress params */
+	jpeg_create_compress (&cinfo);
+	jpeg_stdio_dest (&cinfo, outfile);
+	cinfo.image_width      = w;
+	cinfo.image_height     = h;
+	cinfo.input_components = 3;
+	cinfo.in_color_space   = JCS_RGB;
+
+	/* error exit routine */
+	if (sigsetjmp (jerr.setjmp_buffer, 1)) {
+		g_free (buf);
+		fclose (outfile);
+		jpeg_destroy_compress (&cinfo);
+		return FALSE;
+	}
+
+	/* set desired jpeg quality if available */
+	if (target != NULL && target->jpeg_quality >= 0.0) {
+		quality = (int) MIN (target->jpeg_quality, 1.0) * 100;
+	}
+
+	/* set up jepg compression parameters */
+	jpeg_set_defaults (&cinfo);
+	jpeg_set_quality (&cinfo, quality, TRUE);
+	jpeg_start_compress (&cinfo, TRUE);
+
+	/* write EXIF/IPTC data explicitly */
+#if HAVE_EXIF
+	/* exif_chunk and exif are mutally exclusvie, this is what we assure here */
+	g_assert (priv->exif_chunk == NULL);
+	if (priv->exif != NULL)
+	{
+		unsigned char *exif_buf;
+		unsigned int   exif_buf_len;
+
+		exif_data_save_data (priv->exif, &exif_buf, &exif_buf_len);
+		jpeg_write_marker (&cinfo, 0xe1, exif_buf, exif_buf_len);
+		g_free (exif_buf);
+	}
+#else
+	if (priv->exif_chunk != NULL) {
+		jpeg_write_marker (&cinfo, JPEG_APP0+1, priv->exif_chunk, priv->exif_chunk_len);
+	}
+#endif
+	/* FIXME: Consider IPTC data too */
+
+	/* get the start pointer */
+	ptr = pixels;
+	/* go one scanline at a time... and save */
+	i = 0;
+	while (cinfo.next_scanline < cinfo.image_height) {
+		/* convert scanline from ARGB to RGB packed */
+		for (j = 0; j < w; j++)
+			memcpy (&(buf[j*3]), &(ptr[i*rowstride + j*(rowstride/w)]), 3);
+
+		/* write scanline */
+		jbuf = (JSAMPROW *)(&buf);
+		jpeg_write_scanlines (&cinfo, jbuf, 1);
+		i++;
+		y++;
+
+	}
+
+	/* finish off */
+	jpeg_finish_compress (&cinfo);
+	jpeg_destroy_compress(&cinfo);
+	g_free (buf);
+
+	fclose (outfile);
+
+	return TRUE;
+}
+
+gboolean
+eom_image_jpeg_save_file (EomImage *image, const char *file,
+			  EomImageSaveInfo *source, EomImageSaveInfo *target,
+			  GError **error)
+{
+	EomJpegSaveMethod method = EOM_SAVE_NONE;
+	gboolean source_is_jpeg = FALSE;
+	gboolean target_is_jpeg = FALSE;
+        gboolean result;
+
+	g_return_val_if_fail (source != NULL, FALSE);
+
+	source_is_jpeg = !g_ascii_strcasecmp (source->format, EOM_FILE_FORMAT_JPEG);
+
+	/* determine which method should be used for saving */
+	if (target == NULL) {
+		if (source_is_jpeg) {
+			method = EOM_SAVE_JPEG_AS_JPEG;
+		}
+	}
+	else {
+		target_is_jpeg = !g_ascii_strcasecmp (target->format, EOM_FILE_FORMAT_JPEG);
+
+		if (source_is_jpeg && target_is_jpeg) {
+			if (target->jpeg_quality < 0.0) {
+				method = EOM_SAVE_JPEG_AS_JPEG;
+			}
+			else {
+				/* reencoding is required, cause quality is set */
+				method = EOM_SAVE_ANY_AS_JPEG;
+			}
+		}
+		else if (!source_is_jpeg && target_is_jpeg) {
+			method = EOM_SAVE_ANY_AS_JPEG;
+		}
+	}
+
+	switch (method) {
+	case EOM_SAVE_JPEG_AS_JPEG:
+		result = _save_jpeg_as_jpeg (image, file, source, target, error);
+		break;
+	case EOM_SAVE_ANY_AS_JPEG:
+		result = _save_any_as_jpeg (image, file, source, target, error);
+		break;
+	default:
+		result = FALSE;
+	}
+
+	return result;
+}
+#endif
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/52.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/52.html new file mode 100644 index 0000000..0877029 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/52.html @@ -0,0 +1,431 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/* Eye Of Mate - Image Private Data
+ *
+ * Copyright (C) 2007 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __EOM_IMAGE_PRIVATE_H__
+#define __EOM_IMAGE_PRIVATE_H__
+
+#include "eom-image.h"
+#ifdef HAVE_RSVG
+#include <librsvg/rsvg.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+G_BEGIN_DECLS
+
+struct _EomImagePrivate {
+	GFile            *file;
+
+	EomImageStatus    status;
+	EomImageStatus    prev_status;
+	EomImageMetadataStatus metadata_status;
+
+	gboolean          is_playing;
+	GdkPixbufAnimation     *anim;
+	GdkPixbufAnimationIter *anim_iter;
+	GdkPixbuf        *image;
+	GdkPixbuf        *thumbnail;
+#ifdef HAVE_RSVG
+	RsvgHandle       *svg;
+#endif
+
+	gint              width;
+	gint              height;
+
+	goffset           bytes;
+	gchar            *file_type;
+
+	/* Holds EXIF raw data */
+	guint             exif_chunk_len;
+	guchar           *exif_chunk;
+
+#if 0
+	/* Holds IPTC raw data */
+	guchar           *iptc_chunk;
+	guint             iptc_chunk_len;
+#endif
+
+	gboolean          modified;
+	gboolean          file_is_changed;
+
+	gboolean          autorotate;
+	gint              orientation;
+#ifdef HAVE_EXIF
+	ExifData         *exif;
+#endif
+#ifdef HAVE_EXEMPI
+ 	XmpPtr   xmp;
+#endif
+
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
+	cmsHPROFILE       profile;
+#endif
+
+	gchar            *caption;
+
+	gchar            *collate_key;
+
+	GMutex           status_mutex;
+
+	gboolean          cancel_loading;
+	guint             data_ref_count;
+
+	GSList           *undo_stack;
+
+	EomTransform     *trans;
+	EomTransform     *trans_autorotate;
+};
+
+G_END_DECLS
+
+#endif /* __EOM_IMAGE_PRIVATE_H__ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/53.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/53.html new file mode 100644 index 0000000..77f584d --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/53.html @@ -0,0 +1,531 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "eom-image-save-info.h"
+#include "eom-image-private.h"
+#include "eom-pixbuf-util.h"
+#include "eom-image.h"
+
+G_DEFINE_TYPE (EomImageSaveInfo, eom_image_save_info, G_TYPE_OBJECT)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE is a macro then please configure it.
+
+static void
+eom_image_save_info_dispose (GObject *object)
+{
+	EomImageSaveInfo *info = EOM_IMAGE_SAVE_INFO (object);
+
+	if (info->file != NULL) {
+		g_object_unref (info->file);
+		info->file = NULL;
+	}
+
+	if (info->format != NULL) {
+		g_free (info->format);
+		info->format = NULL;
+	}
+
+	G_OBJECT_CLASS (eom_image_save_info_parent_class)->dispose (object);
+}
+
+static void
+eom_image_save_info_init (EomImageSaveInfo *obj)
+{
+
+}
+
+static void
+eom_image_save_info_class_init (EomImageSaveInfoClass *klass)
+{
+	GObjectClass *object_class = (GObjectClass*) klass;
+
+	object_class->dispose = eom_image_save_info_dispose;
+}
+
+/* is_local_uri:
+ *
+ * Checks if the URI points to a local file system. This tests simply
+ * if the URI scheme is 'file'. This function is used to ensure that
+ * we can write to the path-part of the URI with non-VFS aware
+ * filesystem calls.
+ */
+static gboolean
+is_local_file (GFile *file)
+{
+	char *scheme;
+	gboolean ret;
+
+	g_return_val_if_fail (file != NULL, FALSE);
+
+	scheme = g_file_get_uri_scheme (file);
+
+	ret = (g_ascii_strcasecmp (scheme, "file") == 0);
+	g_free (scheme);
+	return ret;
+}
+
+static char*
+get_save_file_type_by_file (GFile *file)
+{
+	GdkPixbufFormat *format;
+	char *type = NULL;
+
+	format = eom_pixbuf_get_format (file);
+	if (format != NULL) {
+		type = gdk_pixbuf_format_get_name (format);
+	}
+
+	return type;
+}
+
+EomImageSaveInfo*
+eom_image_save_info_new_from_image (EomImage *image)
+{
+	EomImageSaveInfo *info = NULL;
+
+	g_return_val_if_fail (EOM_IS_IMAGE (image), NULL);
+
+	info = g_object_new (EOM_TYPE_IMAGE_SAVE_INFO, NULL);
+
+	info->file         = eom_image_get_file (image);
+	info->format       = g_strdup (image->priv->file_type);
+	info->exists       = g_file_query_exists (info->file, NULL);
+	info->local        = is_local_file (info->file);
+        info->has_metadata = eom_image_has_data (image, EOM_IMAGE_DATA_EXIF);
+	info->modified     = eom_image_is_modified (image);
+	info->overwrite    = FALSE;
+
+	info->jpeg_quality = -1.0;
+
+	return info;
+}
+
+EomImageSaveInfo*
+eom_image_save_info_new_from_uri (const char *txt_uri, GdkPixbufFormat *format)
+{
+	GFile *file;
+	EomImageSaveInfo *info;
+
+	g_return_val_if_fail (txt_uri != NULL, NULL);
+
+	file = g_file_new_for_uri (txt_uri);
+
+	info = eom_image_save_info_new_from_file (file, format);
+
+	g_object_unref (file);
+
+	return info;
+}
+
+EomImageSaveInfo*
+eom_image_save_info_new_from_file (GFile *file, GdkPixbufFormat *format)
+{
+	EomImageSaveInfo *info;
+
+	g_return_val_if_fail (file != NULL, NULL);
+
+	info = g_object_new (EOM_TYPE_IMAGE_SAVE_INFO, NULL);
+
+	info->file = g_object_ref (file);
+	if (format == NULL) {
+		info->format = get_save_file_type_by_file (info->file);
+	}
+	else {
+		info->format = gdk_pixbuf_format_get_name (format);
+	}
+	info->exists       = g_file_query_exists (file, NULL);
+	info->local        = is_local_file (file);
+        info->has_metadata = FALSE;
+	info->modified     = FALSE;
+	info->overwrite    = FALSE;
+
+	info->jpeg_quality = -1.0;
+
+	g_assert (info->format != NULL);
+
+	return info;
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/54.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/54.html new file mode 100644 index 0000000..a123478 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/54.html @@ -0,0 +1,5169 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
   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
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+1682
+1683
+1684
+1685
+1686
+1687
+1688
+1689
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699
+1700
+1701
+1702
+1703
+1704
+1705
+1706
+1707
+1708
+1709
+1710
+1711
+1712
+1713
+1714
+1715
+1716
+1717
+1718
+1719
+1720
+1721
+1722
+1723
+1724
+1725
+1726
+1727
+1728
+1729
+1730
+1731
+1732
+1733
+1734
+1735
+1736
+1737
+1738
+1739
+1740
+1741
+1742
+1743
+1744
+1745
+1746
+1747
+1748
+1749
+1750
+1751
+1752
+1753
+1754
+1755
+1756
+1757
+1758
+1759
+1760
+1761
+1762
+1763
+1764
+1765
+1766
+1767
+1768
+1769
+1770
+1771
+1772
+1773
+1774
+1775
+1776
+1777
+1778
+1779
+1780
+1781
+1782
+1783
+1784
+1785
+1786
+1787
+1788
+1789
+1790
+1791
+1792
+1793
+1794
+1795
+1796
+1797
+1798
+1799
+1800
+1801
+1802
+1803
+1804
+1805
+1806
+1807
+1808
+1809
+1810
+1811
+1812
+1813
+1814
+1815
+1816
+1817
+1818
+1819
+1820
+1821
+1822
+1823
+1824
+1825
+1826
+1827
+1828
+1829
+1830
+1831
+1832
+1833
+1834
+1835
+1836
+1837
+1838
+1839
+1840
+1841
+1842
+1843
+1844
+1845
+1846
+1847
+1848
+1849
+1850
+1851
+1852
+1853
+1854
+1855
+1856
+1857
+1858
+1859
+1860
+1861
+1862
+1863
+1864
+1865
+1866
+1867
+1868
+1869
+1870
+1871
+1872
+1873
+1874
+1875
+1876
+1877
+1878
+1879
+1880
+1881
+1882
+1883
+1884
+1885
+1886
+1887
+1888
+1889
+1890
+1891
+1892
+1893
+1894
+1895
+1896
+1897
+1898
+1899
+1900
+1901
+1902
+1903
+1904
+1905
+1906
+1907
+1908
+1909
+1910
+1911
+1912
+1913
+1914
+1915
+1916
+1917
+1918
+1919
+1920
+1921
+1922
+1923
+1924
+1925
+1926
+1927
+1928
+1929
+1930
+1931
+1932
+1933
+1934
+1935
+1936
+1937
+1938
+1939
+1940
+1941
+1942
+1943
+1944
+1945
+1946
+1947
+1948
+1949
+1950
+1951
+1952
+1953
+1954
+1955
+1956
+1957
+1958
+1959
+1960
+1961
+1962
+1963
+1964
+1965
+1966
+1967
+1968
+1969
+1970
+1971
+1972
+1973
+1974
+1975
+1976
+1977
+1978
+1979
+1980
+1981
+1982
+1983
+1984
+1985
+1986
+1987
+1988
+1989
+1990
+1991
+1992
+1993
+1994
+1995
+1996
+1997
+1998
+1999
+2000
+2001
+2002
+2003
+2004
+2005
+2006
+2007
+2008
+2009
+2010
+2011
+2012
+2013
+2014
+2015
+2016
+2017
+2018
+2019
+2020
+2021
+2022
+2023
+2024
+2025
+2026
+2027
+2028
+2029
+2030
+2031
+2032
+2033
+2034
+2035
+2036
+2037
+2038
+2039
+2040
+2041
+2042
+2043
+2044
+2045
+2046
+2047
+2048
+2049
+2050
+2051
+2052
+2053
+2054
+2055
+2056
+2057
+2058
+2059
+2060
+2061
+2062
+2063
+2064
+2065
+2066
+2067
+2068
+2069
+2070
+2071
+2072
+2073
+2074
+2075
+2076
+2077
+2078
+2079
+2080
+2081
+2082
+2083
+2084
+2085
+2086
+2087
+2088
+2089
+2090
+2091
+2092
+2093
+2094
+2095
+2096
+2097
+2098
+2099
+2100
+2101
+2102
+2103
+2104
+2105
+2106
+2107
+2108
+2109
+2110
+2111
+2112
+2113
+2114
+2115
+2116
+2117
+2118
+2119
+2120
+2121
+2122
+2123
+2124
+2125
+2126
+2127
+2128
+2129
+2130
+2131
+2132
+2133
+2134
+2135
+2136
+2137
+2138
+2139
+2140
+2141
+2142
+2143
+2144
+2145
+2146
+2147
+2148
+2149
+2150
+2151
+2152
+2153
+2154
+2155
+2156
+2157
+2158
+2159
+2160
+2161
+2162
+2163
+2164
+2165
+2166
+2167
+2168
+2169
+2170
+2171
+2172
+2173
+2174
+2175
+2176
+2177
+2178
+2179
+2180
+2181
+2182
+2183
+2184
+2185
+2186
+2187
+2188
+2189
+2190
+2191
+2192
+2193
+2194
+2195
+2196
+2197
+2198
+2199
+2200
+2201
+2202
+2203
+2204
+2205
+2206
+2207
+2208
+2209
+2210
+2211
+2212
+2213
+2214
+2215
+2216
+2217
+2218
+2219
+2220
+2221
+2222
+2223
+2224
+2225
+2226
+2227
+2228
+2229
+2230
+2231
+2232
+2233
+2234
+2235
+2236
+2237
+2238
+2239
+2240
+2241
+2242
+2243
+2244
+2245
+2246
+2247
+2248
+2249
+2250
+2251
+2252
+2253
+2254
+2255
+2256
+2257
+2258
+2259
+2260
+2261
+2262
+2263
+2264
+2265
+2266
+2267
+2268
+2269
+2270
+2271
+2272
+2273
+2274
+2275
+2276
+2277
+2278
+2279
+2280
+2281
+2282
+2283
+2284
+2285
+2286
+2287
+2288
+2289
+2290
+2291
+2292
+2293
+2294
+2295
+2296
+2297
+2298
+2299
+2300
+2301
+2302
+2303
+2304
+2305
+2306
+2307
+2308
+2309
+2310
+2311
+2312
+2313
+2314
+2315
+2316
+2317
+2318
+2319
+2320
+2321
+2322
+2323
+2324
+2325
+2326
+2327
+2328
+2329
+2330
+2331
+2332
+2333
+2334
+2335
+2336
+2337
+2338
+2339
+2340
+2341
+2342
+2343
+2344
+2345
+2346
+2347
+2348
+2349
+2350
+2351
+2352
+2353
+2354
+2355
+2356
+2357
+2358
+2359
+2360
+2361
+2362
+2363
+2364
+2365
+2366
+2367
+2368
+2369
+2370
+2371
+2372
+2373
+2374
+2375
+2376
+2377
+2378
+2379
+2380
+2381
+2382
+2383
+2384
+2385
+2386
+2387
+2388
+2389
+2390
+2391
+2392
+2393
+2394
+2395
+2396
+2397
+2398
+2399
+2400
+2401
+2402
+2403
+2404
+2405
+2406
+2407
+2408
+2409
+2410
+2411
+2412
+2413
+2414
+2415
+2416
+2417
+2418
+2419
+2420
+2421
+2422
+2423
+2424
+2425
+2426
+2427
+2428
+2429
+2430
+2431
+2432
+2433
+2434
+2435
+2436
/* Eye Of Mate - Image
+ *
+ * Copyright (C) 2006 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"<--- Include file: "config.h" not found.
+#endif
+
+#define GDK_PIXBUF_ENABLE_BACKEND
+#include <gdk/gdkx.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "eom-image.h"
+#include "eom-image-private.h"
+#include "eom-debug.h"
+
+#ifdef HAVE_JPEG
+#include "eom-image-jpeg.h"
+#endif
+
+#include "eom-marshal.h"
+#include "eom-pixbuf-util.h"
+#include "eom-metadata-reader.h"
+#include "eom-image-save-info.h"
+#include "eom-transform.h"
+#include "eom-util.h"
+#include "eom-jobs.h"
+#include "eom-thumbnail.h"
+
+#include <unistd.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gdk-pixbuf/gdk-pixbuf.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#ifdef HAVE_EXIF
+#include "eom-exif-util.h"
+#include <libexif/exif-data.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libexif/exif-utils.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libexif/exif-loader.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
+#include <lcms2.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#ifdef HAVE_RSVG
+#include <librsvg/rsvg.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+G_DEFINE_TYPE_WITH_PRIVATE (EomImage, eom_image, G_TYPE_OBJECT)
+
+enum {
+	SIGNAL_CHANGED,
+	SIGNAL_SIZE_PREPARED,
+	SIGNAL_THUMBNAIL_CHANGED,
+	SIGNAL_SAVE_PROGRESS,
+	SIGNAL_NEXT_FRAME,
+	SIGNAL_FILE_CHANGED,
+	SIGNAL_LAST
+};
+
+static guint signals[SIGNAL_LAST] = { 0 };
+
+#define EOM_IMAGE_READ_BUFFER_SIZE 65535
+
+static void
+eom_image_free_mem_private (EomImage *image)
+{
+	EomImagePrivate *priv;
+
+	priv = image->priv;
+
+	if (priv->status == EOM_IMAGE_STATUS_LOADING) {
+		eom_image_cancel_load (image);
+	} else {
+		if (priv->anim_iter != NULL) {
+			g_object_unref (priv->anim_iter);
+			priv->anim_iter = NULL;
+		}
+
+		if (priv->anim != NULL) {
+			g_object_unref (priv->anim);
+			priv->anim = NULL;
+		}
+
+		priv->is_playing = FALSE;
+
+		if (priv->image != NULL) {
+			g_object_unref (priv->image);
+			priv->image = NULL;
+		}
+
+#ifdef HAVE_RSVG
+		if (priv->svg != NULL) {
+			g_object_unref (priv->svg);
+			priv->svg = NULL;
+		}
+#endif
+
+#ifdef HAVE_EXIF
+		if (priv->exif != NULL) {
+			exif_data_unref (priv->exif);
+			priv->exif = NULL;
+		}
+#endif
+
+		if (priv->exif_chunk != NULL) {
+			g_free (priv->exif_chunk);
+			priv->exif_chunk = NULL;
+		}
+
+		priv->exif_chunk_len = 0;
+
+#ifdef HAVE_EXEMPI
+		if (priv->xmp != NULL) {
+			xmp_free (priv->xmp);
+			priv->xmp = NULL;
+		}
+#endif
+
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
+		if (priv->profile != NULL) {
+			if (GDK_IS_X11_DISPLAY (gdk_display_get_default ())) {
+				cmsCloseProfile (priv->profile);
+			}
+			priv->profile = NULL;
+		}
+#endif
+
+		priv->status = EOM_IMAGE_STATUS_UNKNOWN;
+		priv->metadata_status = EOM_IMAGE_METADATA_NOT_READ;
+	}
+}
+
+static void
+eom_image_dispose (GObject *object)
+{
+	EomImagePrivate *priv;
+
+	priv = EOM_IMAGE (object)->priv;
+
+	eom_image_free_mem_private (EOM_IMAGE (object));
+
+	if (priv->file) {
+		g_object_unref (priv->file);
+		priv->file = NULL;
+	}
+
+	if (priv->caption) {
+		g_free (priv->caption);
+		priv->caption = NULL;
+	}
+
+	if (priv->collate_key) {
+		g_free (priv->collate_key);
+		priv->collate_key = NULL;
+	}
+
+	if (priv->file_type) {
+		g_free (priv->file_type);
+		priv->file_type = NULL;
+	}
+
+	g_mutex_clear (&priv->status_mutex);
+
+	if (priv->trans) {
+		g_object_unref (priv->trans);
+		priv->trans = NULL;
+	}
+
+	if (priv->trans_autorotate) {
+		g_object_unref (priv->trans_autorotate);
+		priv->trans_autorotate = NULL;
+	}
+
+	if (priv->undo_stack) {
+		g_slist_free_full (priv->undo_stack, g_object_unref);
+		priv->undo_stack = NULL;
+	}
+
+	G_OBJECT_CLASS (eom_image_parent_class)->dispose (object);
+}
+
+static void
+eom_image_class_init (EomImageClass *klass)
+{
+	GObjectClass *object_class = (GObjectClass*) klass;
+
+	object_class->dispose = eom_image_dispose;
+
+	signals[SIGNAL_SIZE_PREPARED] =
+		g_signal_new ("size-prepared",
+			      EOM_TYPE_IMAGE,
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (EomImageClass, size_prepared),
+			      NULL, NULL,
+			      eom_marshal_VOID__INT_INT,
+			      G_TYPE_NONE, 2,
+			      G_TYPE_INT,
+			      G_TYPE_INT);
+
+	signals[SIGNAL_CHANGED] =
+		g_signal_new ("changed",
+			      EOM_TYPE_IMAGE,
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (EomImageClass, changed),
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE, 0);
+
+	signals[SIGNAL_THUMBNAIL_CHANGED] =
+		g_signal_new ("thumbnail-changed",
+			      EOM_TYPE_IMAGE,
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (EomImageClass, thumbnail_changed),
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE, 0);
+
+	signals[SIGNAL_SAVE_PROGRESS] =
+		g_signal_new ("save-progress",
+			      EOM_TYPE_IMAGE,
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (EomImageClass, save_progress),
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__FLOAT,
+			      G_TYPE_NONE, 1,
+			      G_TYPE_FLOAT);
+ 	/**
+ 	 * EomImage::next-frame:
+  	 * @img: the object which received the signal.
+	 * @delay: number of milliseconds the current frame will be displayed.
+	 *
+	 * The ::next-frame signal will be emitted each time an animated image
+	 * advances to the next frame.
+	 */
+	signals[SIGNAL_NEXT_FRAME] =
+		g_signal_new ("next-frame",
+			      EOM_TYPE_IMAGE,
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (EomImageClass, next_frame),
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__INT,
+			      G_TYPE_NONE, 1,
+			      G_TYPE_INT);
+
+	signals[SIGNAL_FILE_CHANGED] = g_signal_new ("file-changed",
+						     EOM_TYPE_IMAGE,
+						     G_SIGNAL_RUN_LAST,
+						     G_STRUCT_OFFSET (EomImageClass, file_changed),
+						     NULL, NULL,
+						     g_cclosure_marshal_VOID__VOID,
+						     G_TYPE_NONE, 0);
+}
+
+static void
+eom_image_init (EomImage *img)
+{
+	img->priv = eom_image_get_instance_private (img);
+
+	img->priv->file = NULL;
+	img->priv->image = NULL;
+	img->priv->anim = NULL;
+	img->priv->anim_iter = NULL;
+	img->priv->is_playing = FALSE;
+	img->priv->thumbnail = NULL;
+	img->priv->width = -1;
+	img->priv->height = -1;
+	img->priv->modified = FALSE;
+	img->priv->file_is_changed = FALSE;
+	g_mutex_init (&img->priv->status_mutex);
+	img->priv->status = EOM_IMAGE_STATUS_UNKNOWN;
+	img->priv->metadata_status = EOM_IMAGE_METADATA_NOT_READ;
+	img->priv->undo_stack = NULL;
+	img->priv->trans = NULL;
+	img->priv->trans_autorotate = NULL;
+	img->priv->data_ref_count = 0;
+#ifdef HAVE_EXIF
+	img->priv->orientation = 0;
+	img->priv->autorotate = FALSE;
+	img->priv->exif = NULL;
+#endif
+#ifdef HAVE_EXEMPI
+	img->priv->xmp = NULL;
+#endif
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
+	img->priv->profile = NULL;
+#endif
+#ifdef HAVE_RSVG
+	img->priv->svg = NULL;
+#endif
+}
+
+EomImage *
+eom_image_new_file (GFile *file, const gchar *caption)
+{
+	EomImage *img;
+
+	img = EOM_IMAGE (g_object_new (EOM_TYPE_IMAGE, NULL));
+
+	img->priv->file = g_object_ref (file);
+	img->priv->caption = g_strdup (caption);
+
+	return img;
+}
+
+GQuark
+eom_image_error_quark (void)
+{
+	static GQuark q = 0;
+
+	if (q == 0) {
+		q = g_quark_from_static_string ("eom-image-error-quark");
+	}
+
+	return q;
+}
+
+static void
+eom_image_update_exif_data (EomImage *image)
+{
+#ifdef HAVE_EXIF
+	EomImagePrivate *priv;
+	ExifEntry *entry;
+	ExifByteOrder bo;
+
+	eom_debug (DEBUG_IMAGE_DATA);
+
+	g_return_if_fail (EOM_IS_IMAGE (image));
+
+	priv = image->priv;
+
+	if (priv->exif == NULL) return;
+
+	bo = exif_data_get_byte_order (priv->exif);
+
+	/* Update image width */
+	entry = exif_data_get_entry (priv->exif, EXIF_TAG_PIXEL_X_DIMENSION);
+	if (entry != NULL && (priv->width >= 0)) {
+		if (entry->format == EXIF_FORMAT_LONG)
+			exif_set_long (entry->data, bo, priv->width);
+		else if (entry->format == EXIF_FORMAT_SHORT)
+			exif_set_short (entry->data, bo, priv->width);
+		else
+			g_warning ("Exif entry has unsupported size");
+	}
+
+	/* Update image height */
+	entry = exif_data_get_entry (priv->exif, EXIF_TAG_PIXEL_Y_DIMENSION);
+	if (entry != NULL && (priv->height >= 0)) {
+		if (entry->format == EXIF_FORMAT_LONG)
+			exif_set_long (entry->data, bo, priv->height);
+		else if (entry->format == EXIF_FORMAT_SHORT)
+			exif_set_short (entry->data, bo, priv->height);
+		else
+			g_warning ("Exif entry has unsupported size");
+	}
+
+	/* Update image orientation */
+	entry = exif_data_get_entry (priv->exif, EXIF_TAG_ORIENTATION);
+	if (entry != NULL) {
+		if (entry->format == EXIF_FORMAT_LONG)
+			exif_set_long (entry->data, bo, 1);
+		else if (entry->format == EXIF_FORMAT_SHORT)
+			exif_set_short (entry->data, bo, 1);
+		else
+			g_warning ("Exif entry has unsupported size");
+
+		priv->orientation = 1;
+	}
+#endif
+}
+
+static void
+eom_image_real_transform (EomImage     *img,
+			  EomTransform *trans,
+			  gboolean      is_undo,
+			  EomJob       *job)
+{
+	EomImagePrivate *priv;
+	GdkPixbuf *transformed;
+	gboolean modified = FALSE;
+
+	g_return_if_fail (EOM_IS_IMAGE (img));
+	g_return_if_fail (EOM_IS_TRANSFORM (trans));
+
+	priv = img->priv;
+
+	if (priv->image != NULL) {
+		transformed = eom_transform_apply (trans, priv->image, job);
+
+		g_object_unref (priv->image);
+		priv->image = transformed;
+
+		priv->width = gdk_pixbuf_get_width (transformed);
+		priv->height = gdk_pixbuf_get_height (transformed);
+
+		modified = TRUE;
+	}
+
+	if (priv->thumbnail != NULL) {
+		transformed = eom_transform_apply (trans, priv->thumbnail, NULL);
+
+		g_object_unref (priv->thumbnail);
+		priv->thumbnail = transformed;
+
+		modified = TRUE;
+	}
+
+	if (modified) {
+		priv->modified = TRUE;
+		eom_image_update_exif_data (img);
+	}
+
+	if (priv->trans == NULL) {
+		g_object_ref (trans);
+		priv->trans = trans;
+	} else {
+		EomTransform *composition;
+
+		composition = eom_transform_compose (priv->trans, trans);
+
+		g_object_unref (priv->trans);
+
+		priv->trans = composition;
+	}
+
+	if (!is_undo) {
+		g_object_ref (trans);
+		priv->undo_stack = g_slist_prepend (priv->undo_stack, trans);
+	}
+}
+
+static gboolean
+do_emit_size_prepared_signal (EomImage *img)
+{
+	g_signal_emit (img, signals[SIGNAL_SIZE_PREPARED], 0,
+		       img->priv->width, img->priv->height);
+	return FALSE;
+}
+
+static void
+eom_image_emit_size_prepared (EomImage *img)
+{
+	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
+	                (GSourceFunc) do_emit_size_prepared_signal,
+	                 g_object_ref (img), g_object_unref);
+}
+
+static void
+eom_image_size_prepared (GdkPixbufLoader *loader,
+			 gint             width,
+			 gint             height,
+			 gpointer         data)
+{
+	EomImage *img;
+
+	eom_debug (DEBUG_IMAGE_LOAD);
+
+	g_return_if_fail (EOM_IS_IMAGE (data));
+
+	img = EOM_IMAGE (data);
+
+	g_mutex_lock (&img->priv->status_mutex);
+
+	img->priv->width = width;
+	img->priv->height = height;
+
+	g_mutex_unlock (&img->priv->status_mutex);
+
+#ifdef HAVE_EXIF
+	if (!img->priv->autorotate || img->priv->exif)
+#endif
+		eom_image_emit_size_prepared (img);
+}
+
+static EomMetadataReader*
+check_for_metadata_img_format (EomImage *img, guchar *buffer, guint bytes_read)
+{
+	EomMetadataReader *md_reader = NULL;
+
+	eom_debug_message (DEBUG_IMAGE_DATA, "Check image format for jpeg: %x%x - length: %i",
+			   buffer[0], buffer[1], bytes_read);
+
+	if (bytes_read >= 2) {
+		/* SOI (start of image) marker for JPEGs is 0xFFD8 */
+		if ((buffer[0] == 0xFF) && (buffer[1] == 0xD8)) {
+			md_reader = eom_metadata_reader_new (EOM_METADATA_JPEG);
+		}
+		if (bytes_read >= 8 &&
+		    memcmp (buffer, "\x89PNG\x0D\x0A\x1a\x0A", 8) == 0) {
+			md_reader = eom_metadata_reader_new (EOM_METADATA_PNG);
+		}
+	}
+
+	return md_reader;
+}
+
+static gboolean
+eom_image_needs_transformation (EomImage *img)
+{
+	g_return_val_if_fail (EOM_IS_IMAGE (img), FALSE);
+
+	return (img->priv->trans != NULL || img->priv->trans_autorotate != NULL);
+}
+
+static gboolean
+eom_image_apply_transformations (EomImage *img, GError **error)
+{
+	GdkPixbuf *transformed = NULL;
+	EomTransform *composition = NULL;
+	EomImagePrivate *priv;
+
+	g_return_val_if_fail (EOM_IS_IMAGE (img), FALSE);
+
+	priv = img->priv;
+
+	if (priv->trans == NULL && priv->trans_autorotate == NULL) {
+		return TRUE;
+	}
+
+	if (priv->image == NULL) {
+		g_set_error (error,
+			     EOM_IMAGE_ERROR,
+			     EOM_IMAGE_ERROR_NOT_LOADED,
+			     _("Transformation on unloaded image."));
+
+		return FALSE;
+	}
+
+	if (priv->trans != NULL && priv->trans_autorotate != NULL) {
+		composition = eom_transform_compose (priv->trans,
+						     priv->trans_autorotate);
+	} else if (priv->trans != NULL) {
+		composition = g_object_ref (priv->trans);
+	} else if (priv->trans_autorotate != NULL) {
+		composition = g_object_ref (priv->trans_autorotate);
+	}
+
+	if (composition != NULL) {
+		transformed = eom_transform_apply (composition, priv->image, NULL);
+	}
+
+	g_object_unref (priv->image);
+	priv->image = transformed;
+
+	if (transformed != NULL) {
+		priv->width = gdk_pixbuf_get_width (priv->image);
+		priv->height = gdk_pixbuf_get_height (priv->image);
+	} else {
+		g_set_error (error,
+			     EOM_IMAGE_ERROR,
+			     EOM_IMAGE_ERROR_GENERIC,
+			     _("Transformation failed."));
+ 	}
+
+	g_object_unref (composition);
+
+	return (transformed != NULL);
+}
+
+static void
+eom_image_get_file_info (EomImage *img,
+			 goffset *bytes,
+			 gchar **mime_type,
+			 GError **error)
+{
+	GFileInfo *file_info;
+
+	file_info = g_file_query_info (img->priv->file,
+				       G_FILE_ATTRIBUTE_STANDARD_SIZE ","
+				       G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+				       0, NULL, error);
+
+	if (file_info == NULL) {
+		if (bytes)
+			*bytes = 0;
+
+		if (mime_type)
+			*mime_type = NULL;
+
+		g_set_error (error,
+			     EOM_IMAGE_ERROR,
+			     EOM_IMAGE_ERROR_VFS,
+			     "Error in getting image file info");
+	} else {
+		if (bytes)
+			*bytes = g_file_info_get_size (file_info);
+
+		if (mime_type)
+			*mime_type = g_strdup (g_file_info_get_content_type (file_info));
+		g_object_unref (file_info);
+	}
+}
+
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
+void
+eom_image_apply_display_profile (EomImage *img, cmsHPROFILE screen)
+{
+	EomImagePrivate *priv;
+	cmsHTRANSFORM transform;
+	gint row, width, rows, stride;
+	guchar *p;
+
+	g_return_if_fail (img != NULL);
+
+	priv = img->priv;
+
+	if (screen == NULL) return;
+	if (!GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
+		return;
+	}
+
+	if (priv->profile == NULL) {
+		/* Check whether GdkPixbuf was able to extract a profile */
+		const char* data = gdk_pixbuf_get_option (priv->image,
+		                                          "icc-profile");
+
+		if(data) {
+			gsize   profile_size = 0;
+			guchar *profile_data = g_base64_decode(data,
+			                                       &profile_size);
+
+			if (profile_data && profile_size > 0) {
+				eom_debug_message (DEBUG_LCMS,
+				                   "Using ICC profile "
+				                   "extracted by GdkPixbuf");
+				priv->profile =
+					cmsOpenProfileFromMem(profile_data,
+					                      profile_size);
+				g_free(profile_data);
+			}
+		}
+
+		if(priv->profile == NULL) {
+			/* Assume sRGB color space for images without ICC profile */
+			eom_debug_message (DEBUG_LCMS, "Image has no ICC profile. "
+					   "Assuming sRGB.");
+			priv->profile = cmsCreate_sRGBProfile ();
+		}
+	}
+
+	/* TODO: support other colorspaces than RGB */
+	if (cmsGetColorSpace (priv->profile) != cmsSigRgbData ||
+	    cmsGetColorSpace (screen) != cmsSigRgbData) {
+		eom_debug_message (DEBUG_LCMS, "One or both ICC profiles not in RGB colorspace; not correcting");
+		return;
+	}
+
+	cmsUInt32Number color_type = TYPE_RGB_8;
+
+	if (gdk_pixbuf_get_has_alpha (priv->image))
+		color_type = TYPE_RGBA_8;
+
+	transform = cmsCreateTransform (priv->profile,
+	                                color_type,
+	                                screen,
+	                                color_type,
+	                                INTENT_PERCEPTUAL,
+	                                0);
+
+	if (G_LIKELY (transform != NULL)) {
+		rows = gdk_pixbuf_get_height (priv->image);
+		width = gdk_pixbuf_get_width (priv->image);
+		stride = gdk_pixbuf_get_rowstride (priv->image);
+		p = gdk_pixbuf_get_pixels (priv->image);
+
+		for (row = 0; row < rows; ++row) {
+			cmsDoTransform (transform, p, p, width);
+			p += stride;
+		}
+		cmsDeleteTransform (transform);
+	}
+}
+
+static void
+eom_image_set_icc_data (EomImage *img, EomMetadataReader *md_reader)
+{
+	EomImagePrivate *priv = img->priv;
+
+	priv->profile = eom_metadata_reader_get_icc_profile (md_reader);
+
+}
+#endif
+
+static void
+eom_image_set_orientation (EomImage *img)
+{
+	EomImagePrivate *priv;
+#ifdef HAVE_EXIF
+	ExifData* exif;
+#endif
+
+	g_return_if_fail (EOM_IS_IMAGE (img));
+
+	priv = img->priv;
+
+#ifdef HAVE_EXIF
+	exif = (ExifData*) eom_image_get_exif_info (img);
+
+	if (exif != NULL) {
+		ExifByteOrder o = exif_data_get_byte_order (exif);
+
+		ExifEntry *entry = exif_data_get_entry (exif,
+							EXIF_TAG_ORIENTATION);
+
+		if (entry && entry->data != NULL) {
+			priv->orientation = exif_get_short (entry->data, o);
+		}
+		exif_data_unref (exif);
+	} else
+#endif
+	{
+		GdkPixbuf *pbuf;
+
+		pbuf = eom_image_get_pixbuf (img);
+
+		if (pbuf) {
+			const gchar *o_str;
+
+			o_str = gdk_pixbuf_get_option (pbuf, "orientation");
+			if (o_str) {
+				short t = (short) g_ascii_strtoll (o_str,
+								   NULL, 10);
+				if (t >= 0 && t < 9)
+					priv->orientation = t;
+			}
+			g_object_unref (pbuf);
+		}
+	}
+
+	if (priv->orientation > 4 &&
+	    priv->orientation < 9) {
+		gint tmp;
+
+		tmp = priv->width;
+		priv->width = priv->height;
+		priv->height = tmp;
+	}
+}
+
+static void
+eom_image_real_autorotate (EomImage *img)
+{
+	static const EomTransformType lookup[8] = {EOM_TRANSFORM_NONE,
+					     EOM_TRANSFORM_FLIP_HORIZONTAL,
+					     EOM_TRANSFORM_ROT_180,
+					     EOM_TRANSFORM_FLIP_VERTICAL,
+					     EOM_TRANSFORM_TRANSPOSE,
+					     EOM_TRANSFORM_ROT_90,
+					     EOM_TRANSFORM_TRANSVERSE,
+					     EOM_TRANSFORM_ROT_270};
+	EomImagePrivate *priv;
+	EomTransformType type;
+
+	g_return_if_fail (EOM_IS_IMAGE (img));
+
+	priv = img->priv;
+
+	type = (priv->orientation >= 1 && priv->orientation <= 8 ?
+		lookup[priv->orientation - 1] : EOM_TRANSFORM_NONE);
+
+	if (type != EOM_TRANSFORM_NONE) {
+		img->priv->trans_autorotate = eom_transform_new (type);
+	}
+
+	/* Disable auto orientation for next loads */
+	priv->autorotate = FALSE;
+}
+
+void
+eom_image_autorotate (EomImage *img)
+{
+	g_return_if_fail (EOM_IS_IMAGE (img));
+
+	/* Schedule auto orientation */
+	img->priv->autorotate = TRUE;
+}
+
+#ifdef HAVE_EXEMPI
+static void
+eom_image_set_xmp_data (EomImage *img, EomMetadataReader *md_reader)
+{
+	EomImagePrivate *priv;
+
+	g_return_if_fail (EOM_IS_IMAGE (img));
+
+	priv = img->priv;
+
+	if (priv->xmp) {
+		xmp_free (priv->xmp);
+	}
+	priv->xmp = eom_metadata_reader_get_xmp_data (md_reader);
+}
+#endif
+
+static void
+eom_image_set_exif_data (EomImage *img, EomMetadataReader *md_reader)
+{
+	EomImagePrivate *priv;
+
+	g_return_if_fail (EOM_IS_IMAGE (img));
+
+	priv = img->priv;
+
+#ifdef HAVE_EXIF
+	g_mutex_lock (&priv->status_mutex);
+	if (priv->exif) {
+		exif_data_unref (priv->exif);
+	}
+	priv->exif = eom_metadata_reader_get_exif_data (md_reader);
+	g_mutex_unlock (&priv->status_mutex);
+
+	priv->exif_chunk = NULL;
+	priv->exif_chunk_len = 0;
+
+	/* EXIF data is already available, set the image orientation */
+	if (priv->autorotate) {
+		eom_image_set_orientation (img);
+
+		/* Emit size prepared signal if we have the size */
+		if (priv->width > 0 &&
+		    priv->height > 0) {
+			eom_image_emit_size_prepared (img);
+		}
+	}
+#else
+	if (priv->exif_chunk) {
+		g_free (priv->exif_chunk);
+	}
+	eom_metadata_reader_get_exif_chunk (md_reader,
+					    &priv->exif_chunk,
+					    &priv->exif_chunk_len);
+#endif
+}
+
+/*
+ * Attempts to get the image dimensions from the thumbnail.
+ * Returns FALSE if this information is not found.
+ **/
+static gboolean
+eom_image_get_dimension_from_thumbnail (EomImage *image,
+			                gint     *width,
+			                gint     *height)
+{
+	if (image->priv->thumbnail == NULL)
+		return FALSE;
+
+	*width = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (image->priv->thumbnail),
+						     EOM_THUMBNAIL_ORIGINAL_WIDTH));
+	*height = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (image->priv->thumbnail),
+						      EOM_THUMBNAIL_ORIGINAL_HEIGHT));
+
+	return (*width || *height);
+}
+
+static gboolean
+eom_image_real_load (EomImage *img,
+		     guint     data2read,
+		     EomJob   *job,
+		     GError  **error)
+{
+	EomImagePrivate *priv;
+	GFileInputStream *input_stream;
+	EomMetadataReader *md_reader = NULL;
+	GdkPixbufFormat *format;
+	gchar *mime_type;
+	GdkPixbufLoader *loader = NULL;
+	guchar *buffer;
+	goffset bytes_read, bytes_read_total = 0;
+	gboolean failed = FALSE;
+	gboolean first_run = TRUE;
+	gboolean set_metadata = TRUE;
+        gboolean use_rsvg = FALSE;
+	gboolean read_image_data = (data2read & EOM_IMAGE_DATA_IMAGE);
+	gboolean read_only_dimension = (data2read & EOM_IMAGE_DATA_DIMENSION) &&
+				  ((data2read ^ EOM_IMAGE_DATA_DIMENSION) == 0);
+
+	priv = img->priv;
+
+ 	g_assert (!read_image_data || priv->image == NULL);
+
+	if (read_image_data && priv->file_type != NULL) {
+		g_free (priv->file_type);
+		priv->file_type = NULL;
+	}
+
+	eom_image_get_file_info (img, &priv->bytes, &mime_type, error);
+
+	if (error && *error) {
+		g_free (mime_type);
+		return FALSE;
+	}
+
+	if (read_only_dimension) {
+		gint width, height;
+		gboolean done;
+
+		done = eom_image_get_dimension_from_thumbnail (img,
+							       &width,
+							       &height);
+
+		if (done) {
+			priv->width = width;
+			priv->height = height;
+
+			g_free (mime_type);
+			return TRUE;
+		}
+	}
+
+	input_stream = g_file_read (priv->file, NULL, error);
+
+	if (input_stream == NULL) {
+		g_free (mime_type);
+
+		if (error != NULL) {
+			g_clear_error (error);
+			g_set_error (error,
+				     EOM_IMAGE_ERROR,
+				     EOM_IMAGE_ERROR_VFS,
+				     "Failed to open input stream for file");
+		}
+		return FALSE;
+	}
+
+	buffer = g_new0 (guchar, EOM_IMAGE_READ_BUFFER_SIZE);
+
+	if (read_image_data || read_only_dimension) {
+#ifdef HAVE_RSVG
+		if (priv->svg != NULL) {
+			g_object_unref (priv->svg);
+			priv->svg = NULL;
+		}
+
+		if (!strcmp (mime_type, "image/svg+xml")
+#if defined (LIBRSVG_HAVE_SVGZ) && LIBRSVG_HAVE_SVGZ
+                    || !strcmp (mime_type, "image/svg+xml-compressed")
+#endif
+                ) {
+			gchar *file_path;
+			/* Keep the object for rendering */
+			priv->svg = rsvg_handle_new ();
+                        use_rsvg = (priv->svg != NULL);
+			file_path = g_file_get_path (priv->file);
+			rsvg_handle_set_base_uri (priv->svg, file_path);
+			g_free (file_path);
+		}
+#endif
+
+                if (!use_rsvg) {
+		        loader = gdk_pixbuf_loader_new_with_mime_type (mime_type, error);
+
+		        if (error && *error) {
+			        g_error_free (*error);
+			        *error = NULL;
+
+			        loader = gdk_pixbuf_loader_new ();
+		        }
+
+		        g_signal_connect_object (loader, "size-prepared",
+					         G_CALLBACK (eom_image_size_prepared),
+					         img,
+					         0);
+                 }
+	}
+	g_free (mime_type);
+
+	while (!priv->cancel_loading) {
+		/* FIXME: make this async */
+		bytes_read = g_input_stream_read (G_INPUT_STREAM (input_stream),
+						  buffer,
+						  EOM_IMAGE_READ_BUFFER_SIZE,
+						  NULL, error);
+
+		if (bytes_read == 0) {
+			/* End of the file */
+			break;
+		} else if (bytes_read == -1) {
+			failed = TRUE;
+
+			g_set_error (error,
+				     EOM_IMAGE_ERROR,
+				     EOM_IMAGE_ERROR_VFS,
+				     "Failed to read from input stream");
+
+			break;
+		}
+
+		if ((read_image_data || read_only_dimension)) {
+#ifdef HAVE_RSVG
+			if (use_rsvg) {
+                            gboolean res;
+
+			    res = rsvg_handle_write (priv->svg, buffer,
+                                                     bytes_read, error);
+
+                            if (G_UNLIKELY (!res)) {
+				failed = TRUE;
+				break;
+                            }
+			} else
+#endif
+			if (!gdk_pixbuf_loader_write (loader, buffer, bytes_read, error)) {
+				failed = TRUE;
+				break;
+			}
+		}
+
+		bytes_read_total += bytes_read;
+
+		if (job != NULL) {
+			float progress = (float) bytes_read_total / (float) priv->bytes;
+			eom_job_set_progress (job, progress);
+		}
+
+		if (first_run) {
+			md_reader = check_for_metadata_img_format (img, buffer, bytes_read);
+
+			if (md_reader == NULL) {
+				if (data2read == EOM_IMAGE_DATA_EXIF) {
+					g_set_error (error,
+						     EOM_IMAGE_ERROR,
+						     EOM_IMAGE_ERROR_GENERIC,
+						     _("EXIF not supported for this file format."));
+					break;
+				}
+
+				priv->metadata_status = EOM_IMAGE_METADATA_NOT_AVAILABLE;
+			}
+
+			first_run = FALSE;
+		}
+
+		if (md_reader != NULL) {
+			eom_metadata_reader_consume (md_reader, buffer, bytes_read);
+
+			if (eom_metadata_reader_finished (md_reader)) {
+				if (set_metadata) {
+					eom_image_set_exif_data (img, md_reader);
+
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
+					eom_image_set_icc_data (img, md_reader);
+#endif
+
+#ifdef HAVE_EXEMPI
+					eom_image_set_xmp_data (img, md_reader);
+#endif
+					set_metadata = FALSE;
+					priv->metadata_status = EOM_IMAGE_METADATA_READY;
+				}
+
+				if (data2read == EOM_IMAGE_DATA_EXIF)
+					break;
+			}
+		}
+
+		if (read_only_dimension &&
+		    eom_image_has_data (img, EOM_IMAGE_DATA_DIMENSION)) {
+			break;
+		}
+	}
+
+	if (read_image_data || read_only_dimension) {
+#ifdef HAVE_RSVG
+		if (use_rsvg) {
+			/* Ignore the error if loading failed earlier
+			 * as the error will already be set in that case */
+			rsvg_handle_close (priv->svg,
+			                   (failed ? NULL : error));
+                } else
+#endif
+		if (failed) {
+			gdk_pixbuf_loader_close (loader, NULL);
+		} else if (!gdk_pixbuf_loader_close (loader, error)) {
+			if (gdk_pixbuf_loader_get_pixbuf (loader) != NULL) {
+				/* Clear error in order to support partial
+				 * images as well. */
+				g_clear_error (error);
+			}
+		}
+	}
+
+	g_free (buffer);
+
+	g_object_unref (G_OBJECT (input_stream));
+
+	failed = (failed ||
+		  priv->cancel_loading ||
+		  bytes_read_total == 0 ||
+		  (error && *error != NULL));
+
+	if (failed) {
+		if (priv->cancel_loading) {
+			priv->cancel_loading = FALSE;
+			priv->status = EOM_IMAGE_STATUS_UNKNOWN;
+		} else {
+			priv->status = EOM_IMAGE_STATUS_FAILED;
+		}
+	} else if (read_image_data) {
+		if (priv->image != NULL) {
+			g_object_unref (priv->image);
+		}
+
+#ifdef HAVE_RSVG
+                if (use_rsvg) {
+                    priv->image = rsvg_handle_get_pixbuf (priv->svg);
+                } else
+#endif
+
+                {
+
+		priv->anim = gdk_pixbuf_loader_get_animation (loader);
+
+		if (gdk_pixbuf_animation_is_static_image (priv->anim)) {
+			priv->image = gdk_pixbuf_animation_get_static_image (priv->anim);
+			priv->anim = NULL;
+		} else {
+			priv->anim_iter = gdk_pixbuf_animation_get_iter (priv->anim,NULL);
+			priv->image = gdk_pixbuf_animation_iter_get_pixbuf (priv->anim_iter);
+		}
+
+                }
+
+		if (G_LIKELY (priv->image != NULL)) {
+                        if (!use_rsvg)
+			        g_object_ref (priv->image);
+
+			priv->width = gdk_pixbuf_get_width (priv->image);
+			priv->height = gdk_pixbuf_get_height (priv->image);
+
+                        if (use_rsvg) {
+                                format = NULL;
+                                priv->file_type = g_strdup ("svg");
+                        } else {
+			        format = gdk_pixbuf_loader_get_format (loader);
+                        }
+
+			if (format != NULL) {
+				priv->file_type = gdk_pixbuf_format_get_name (format);
+			}
+
+			priv->file_is_changed = FALSE;
+
+			/* Set orientation again for safety, eg. if we don't
+			 * have Exif data or HAVE_EXIF is undefined. */
+			if (priv->autorotate) {
+				eom_image_set_orientation (img);
+				eom_image_emit_size_prepared (img);
+			}
+
+		} else {
+			/* Some loaders don't report errors correctly.
+			 * Error will be set below. */
+			failed = TRUE;
+			priv->status = EOM_IMAGE_STATUS_FAILED;
+		}
+	}
+
+	if (loader != NULL) {
+		g_object_unref (loader);
+	}
+
+	if (md_reader != NULL) {
+		g_object_unref (md_reader);
+		md_reader = NULL;
+	}
+
+	/* Catch-all in case of poor-error reporting */
+	if (failed && error && *error == NULL) {
+		g_set_error (error,
+			     EOM_IMAGE_ERROR,
+			     EOM_IMAGE_ERROR_GENERIC,
+			     _("Image loading failed."));
+	}
+
+	return !failed;
+}
+
+gboolean
+eom_image_has_data (EomImage *img, EomImageData req_data)
+{
+	EomImagePrivate *priv;<--- Variable 'priv' can be declared as pointer to const
+	gboolean has_data = TRUE;
+
+	g_return_val_if_fail (EOM_IS_IMAGE (img), FALSE);
+
+	priv = img->priv;
+
+	if ((req_data & EOM_IMAGE_DATA_IMAGE) > 0) {
+		req_data = (req_data & ~EOM_IMAGE_DATA_IMAGE);
+		has_data = has_data && (priv->image != NULL);
+	}
+
+	if ((req_data & EOM_IMAGE_DATA_DIMENSION) > 0 ) {
+		req_data = (req_data & ~EOM_IMAGE_DATA_DIMENSION);
+		has_data = has_data && (priv->width >= 0) && (priv->height >= 0);
+	}
+
+	if ((req_data & EOM_IMAGE_DATA_EXIF) > 0) {
+		req_data = (req_data & ~EOM_IMAGE_DATA_EXIF);
+#ifdef HAVE_EXIF
+		has_data = has_data && (priv->exif != NULL);
+#else
+		has_data = has_data && (priv->exif_chunk != NULL);
+#endif
+	}
+
+	if ((req_data & EOM_IMAGE_DATA_XMP) > 0) {
+		req_data = (req_data & ~EOM_IMAGE_DATA_XMP);
+#ifdef HAVE_EXEMPI
+		has_data = has_data && (priv->xmp != NULL);
+#endif
+	}
+
+	if (req_data != 0) {
+		g_warning ("Asking for unknown data, remaining: %i\n", req_data);
+		has_data = FALSE;
+	}
+
+	return has_data;
+}
+
+gboolean
+eom_image_load (EomImage *img, EomImageData data2read, EomJob *job, GError **error)
+{
+	EomImagePrivate *priv;
+	gboolean success = FALSE;
+
+	eom_debug (DEBUG_IMAGE_LOAD);
+
+	g_return_val_if_fail (EOM_IS_IMAGE (img), FALSE);
+
+	priv = EOM_IMAGE (img)->priv;
+
+	if (data2read == 0) {
+		return TRUE;
+	}
+
+	if (eom_image_has_data (img, data2read)) {
+		return TRUE;
+	}
+
+	priv->status = EOM_IMAGE_STATUS_LOADING;
+
+	success = eom_image_real_load (img, data2read, job, error);
+
+	/* Check that the metadata was loaded at least once before
+	 * trying to autorotate. Also only an imatge load job should try to
+	 * autorotate and image */
+	if (priv->autorotate &&
+#ifdef HAVE_EXIF
+	    priv->metadata_status != EOM_IMAGE_METADATA_NOT_READ &&
+#endif
+	    data2read & EOM_IMAGE_DATA_IMAGE) {
+	                          eom_image_real_autorotate (img);
+	}
+
+	if (success && eom_image_needs_transformation (img)) {
+		success = eom_image_apply_transformations (img, error);
+	}
+
+	if (success) {
+		priv->status = EOM_IMAGE_STATUS_LOADED;
+	} else {
+		priv->status = EOM_IMAGE_STATUS_FAILED;
+	}
+
+	return success;
+}
+
+void
+eom_image_set_thumbnail (EomImage *img, GdkPixbuf *thumbnail)
+{
+	EomImagePrivate *priv;
+
+	g_return_if_fail (EOM_IS_IMAGE (img));
+	g_return_if_fail (GDK_IS_PIXBUF (thumbnail) || thumbnail == NULL);
+
+	priv = img->priv;
+
+	if (priv->thumbnail != NULL) {
+		g_object_unref (priv->thumbnail);
+		priv->thumbnail = NULL;
+	}
+
+	if (thumbnail != NULL && priv->trans != NULL) {
+		priv->thumbnail = eom_transform_apply (priv->trans, thumbnail, NULL);
+	} else {
+		priv->thumbnail = thumbnail;
+
+		if (thumbnail != NULL) {
+			g_object_ref (priv->thumbnail);
+		}
+	}
+
+	if (priv->thumbnail != NULL) {
+		g_signal_emit (img, signals[SIGNAL_THUMBNAIL_CHANGED], 0);
+	}
+}
+
+/**
+ * eom_image_get_pixbuf:
+ * @img: a #EomImage
+ *
+ * Gets the #GdkPixbuf of the image
+ *
+ * Returns: (transfer full): a #GdkPixbuf
+ **/
+GdkPixbuf *
+eom_image_get_pixbuf (EomImage *img)
+{
+	GdkPixbuf *image = NULL;
+
+	g_return_val_if_fail (EOM_IS_IMAGE (img), NULL);
+
+	g_mutex_lock (&img->priv->status_mutex);
+	image = img->priv->image;
+	g_mutex_unlock (&img->priv->status_mutex);
+
+	if (image != NULL) {
+		g_object_ref (image);
+	}
+
+	return image;
+}
+
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
+cmsHPROFILE
+eom_image_get_profile (EomImage *img)
+{
+	g_return_val_if_fail (EOM_IS_IMAGE (img), NULL);
+
+	return img->priv->profile;
+}
+#endif
+
+/**
+ * eom_image_get_thumbnail:
+ * @img: a #EomImage
+ *
+ * Gets the thumbnail pixbuf for @img
+ *
+ * Returns: (transfer full): a #GdkPixbuf with a thumbnail
+ **/
+GdkPixbuf *
+eom_image_get_thumbnail (EomImage *img)
+{
+	g_return_val_if_fail (EOM_IS_IMAGE (img), NULL);
+
+	if (img->priv->thumbnail != NULL) {
+		return g_object_ref (img->priv->thumbnail);
+	}
+
+	return NULL;
+}
+
+void
+eom_image_get_size (EomImage *img, int *width, int *height)
+{
+	EomImagePrivate *priv;<--- Variable 'priv' can be declared as pointer to const
+
+	g_return_if_fail (EOM_IS_IMAGE (img));
+
+	priv = img->priv;
+
+	*width = priv->width;
+	*height = priv->height;
+}
+
+void
+eom_image_transform (EomImage *img, EomTransform *trans, EomJob *job)
+{
+	eom_image_real_transform (img, trans, FALSE, job);
+}
+
+void
+eom_image_undo (EomImage *img)
+{
+	EomImagePrivate *priv;
+	EomTransform *trans;
+	EomTransform *inverse;
+
+	g_return_if_fail (EOM_IS_IMAGE (img));
+
+	priv = img->priv;
+
+	if (priv->undo_stack != NULL) {
+		trans = EOM_TRANSFORM (priv->undo_stack->data);
+
+		inverse = eom_transform_reverse (trans);
+
+		eom_image_real_transform (img, inverse, TRUE, NULL);
+
+		priv->undo_stack = g_slist_delete_link (priv->undo_stack, priv->undo_stack);
+
+		g_object_unref (trans);
+		g_object_unref (inverse);
+
+		if (eom_transform_is_identity (priv->trans)) {
+			g_object_unref (priv->trans);
+			priv->trans = NULL;
+		}
+	}
+
+	priv->modified = (priv->undo_stack != NULL);
+}
+
+static GFile *
+tmp_file_get (void)
+{
+	GFile *tmp_file;
+	char *tmp_file_path;
+	gint fd;
+
+	tmp_file_path = g_build_filename (g_get_tmp_dir (), "eom-save-XXXXXX", NULL);
+	fd = g_mkstemp (tmp_file_path);
+	if (fd == -1) {
+		g_free (tmp_file_path);
+		return NULL;
+	}
+	else {
+		tmp_file = g_file_new_for_path (tmp_file_path);
+		g_free (tmp_file_path);
+		return tmp_file;
+	}
+}
+
+static void
+transfer_progress_cb (goffset cur_bytes,
+		      goffset total_bytes,
+		      gpointer user_data)
+{
+	EomImage *image = EOM_IMAGE (user_data);
+
+	if (cur_bytes > 0) {
+		g_signal_emit (image, signals[SIGNAL_SAVE_PROGRESS],
+			       0,
+			       (gfloat) cur_bytes / (gfloat) total_bytes);
+	}
+}
+
+static void
+tmp_file_restore_unix_attributes (GFile *temp_file,
+				  GFile *target_file)
+{
+	GFileInfo *file_info;
+	guint      uid;
+	guint      gid;
+	guint      mode;
+	guint      mode_mask = 00600;
+
+	GError    *error = NULL;
+
+	g_return_if_fail (G_IS_FILE (temp_file));
+	g_return_if_fail (G_IS_FILE (target_file));
+
+	/* check if file exists */
+	if (!g_file_query_exists (target_file, NULL)) {
+		eom_debug_message (DEBUG_IMAGE_SAVE,
+				   "Target file doesn't exist. Setting default attributes.");
+		return;
+	}
+
+	/* retrieve UID, GID, and MODE of the original file info */
+	file_info = g_file_query_info (target_file,
+				       "unix::uid,unix::gid,unix::mode",
+				       G_FILE_QUERY_INFO_NONE,
+				       NULL,
+				       &error);
+
+	/* check that there aren't any error */
+	if (error != NULL) {
+		eom_debug_message (DEBUG_IMAGE_SAVE,
+				   "File information not available. Setting default attributes.");
+
+		/* free objects */
+		g_object_unref (file_info);
+		g_clear_error (&error);
+
+		return;
+	}
+
+	/* save UID, GID and MODE values */
+	uid = g_file_info_get_attribute_uint32 (file_info,
+						G_FILE_ATTRIBUTE_UNIX_UID);
+
+	gid = g_file_info_get_attribute_uint32 (file_info,
+						G_FILE_ATTRIBUTE_UNIX_GID);
+
+	mode = g_file_info_get_attribute_uint32 (file_info,
+						 G_FILE_ATTRIBUTE_UNIX_MODE);
+
+	/* apply default mode mask to file mode */
+	mode |= mode_mask;
+
+	/* restore original UID, GID, and MODE into the temporal file */
+	g_file_set_attribute_uint32 (temp_file,
+				     G_FILE_ATTRIBUTE_UNIX_UID,
+				     uid,
+				     G_FILE_QUERY_INFO_NONE,
+				     NULL,
+				     &error);
+
+	/* check that there aren't any error */
+	if (error != NULL) {
+		eom_debug_message (DEBUG_IMAGE_SAVE,
+				   "You do not have the permissions necessary to change the file UID.");
+
+		g_clear_error (&error);
+	}
+
+	g_file_set_attribute_uint32 (temp_file,
+				     G_FILE_ATTRIBUTE_UNIX_GID,
+				     gid,
+				     G_FILE_QUERY_INFO_NONE,
+				     NULL,
+				     &error);
+
+	/* check that there aren't any error */
+	if (error != NULL) {
+		eom_debug_message (DEBUG_IMAGE_SAVE,
+				   "You do not have the permissions necessary to change the file GID. Setting user default GID.");
+
+		g_clear_error (&error);
+	}
+
+	g_file_set_attribute_uint32 (temp_file,
+				     G_FILE_ATTRIBUTE_UNIX_MODE,
+				     mode,
+				     G_FILE_QUERY_INFO_NONE,
+				     NULL,
+				     &error);
+
+	/* check that there aren't any error */
+	if (error != NULL) {
+		eom_debug_message (DEBUG_IMAGE_SAVE,
+				   "You do not have the permissions necessary to change the file MODE.");
+
+		g_clear_error (&error);
+	}
+
+	/* free objects */
+	g_object_unref (file_info);
+}
+
+static gboolean
+tmp_file_move_to_uri (EomImage *image,
+		      GFile *tmpfile,
+		      GFile *file,
+		      gboolean overwrite,
+		      GError **error)
+{
+	gboolean result;
+	GError *ioerror = NULL;
+
+	/* try to restore target file unix attributes */
+	tmp_file_restore_unix_attributes (tmpfile, file);
+
+	/* replace target file with temporal file */
+	result = g_file_move (tmpfile,
+			      file,
+			      (overwrite ? G_FILE_COPY_OVERWRITE : 0) |
+			      G_FILE_COPY_ALL_METADATA,
+			      NULL,
+			      (GFileProgressCallback) transfer_progress_cb,
+			      image,
+			      &ioerror);
+
+	if (result == FALSE) {
+		if (g_error_matches (ioerror, G_IO_ERROR,
+				     G_IO_ERROR_EXISTS)) {
+			g_set_error (error, EOM_IMAGE_ERROR,
+				     EOM_IMAGE_ERROR_FILE_EXISTS,
+				     "File exists");
+		} else {
+			g_set_error (error, EOM_IMAGE_ERROR,
+				     EOM_IMAGE_ERROR_VFS,
+				     "VFS error moving the temp file");
+		}
+		g_clear_error (&ioerror);
+	}
+
+	return result;
+}
+
+static gboolean
+tmp_file_delete (GFile *tmpfile)
+{
+	gboolean result;
+	GError *err = NULL;
+
+	if (tmpfile == NULL) return FALSE;
+
+	result = g_file_delete (tmpfile, NULL, &err);
+	if (result == FALSE) {
+		char *tmpfile_path;
+		if (err != NULL) {
+			if (err->code == G_IO_ERROR_NOT_FOUND) {
+				g_error_free (err);
+				return TRUE;
+			}
+			g_error_free (err);
+		}
+		tmpfile_path = g_file_get_path (tmpfile);
+		g_warning ("Couldn't delete temporary file: %s", tmpfile_path);
+		g_free (tmpfile_path);
+	}
+
+	return result;
+}
+
+static void
+eom_image_reset_modifications (EomImage *image)
+{
+	EomImagePrivate *priv;
+
+	g_return_if_fail (EOM_IS_IMAGE (image));
+
+	priv = image->priv;
+
+	g_slist_free_full (priv->undo_stack, g_object_unref);
+	priv->undo_stack = NULL;
+
+	if (priv->trans != NULL) {
+		g_object_unref (priv->trans);
+		priv->trans = NULL;
+	}
+
+	if (priv->trans_autorotate != NULL) {
+		g_object_unref (priv->trans_autorotate);
+		priv->trans_autorotate = NULL;
+	}
+
+	priv->modified = FALSE;
+}
+
+static void
+eom_image_link_with_target (EomImage *image, EomImageSaveInfo *target)
+{
+	EomImagePrivate *priv;
+
+	g_return_if_fail (EOM_IS_IMAGE (image));
+	g_return_if_fail (EOM_IS_IMAGE_SAVE_INFO (target));
+
+	priv = image->priv;
+
+	/* update file location */
+	if (priv->file != NULL) {
+		g_object_unref (priv->file);
+	}
+	priv->file = g_object_ref (target->file);
+
+	/* Clear caption and caption key, these will be
+	 * updated on next eom_image_get_caption call.
+	 */
+	if (priv->caption != NULL) {
+		g_free (priv->caption);
+		priv->caption = NULL;
+	}
+	if (priv->collate_key != NULL) {
+		g_free (priv->collate_key);
+		priv->collate_key = NULL;
+	}
+
+	/* update file format */
+	if (priv->file_type != NULL) {
+		g_free (priv->file_type);
+	}
+	priv->file_type = g_strdup (target->format);
+}
+
+gboolean
+eom_image_save_by_info (EomImage *img, EomImageSaveInfo *source, GError **error)
+{
+	EomImagePrivate *priv;
+	EomImageStatus prev_status;
+	gboolean success = FALSE;
+	GFile *tmp_file;
+	char *tmp_file_path;
+
+	g_return_val_if_fail (EOM_IS_IMAGE (img), FALSE);
+	g_return_val_if_fail (EOM_IS_IMAGE_SAVE_INFO (source), FALSE);
+
+	priv = img->priv;
+
+	prev_status = priv->status;
+
+	/* Image is now being saved */
+	priv->status = EOM_IMAGE_STATUS_SAVING;
+
+	/* see if we need any saving at all */
+	if (source->exists && !source->modified) {
+		return TRUE;
+	}
+
+	/* fail if there is no image to save */
+	if (priv->image == NULL) {
+		g_set_error (error, EOM_IMAGE_ERROR,
+			     EOM_IMAGE_ERROR_NOT_LOADED,
+			     _("No image loaded."));
+		return FALSE;
+	}
+
+	/* generate temporary file */
+	tmp_file = tmp_file_get ();
+
+	if (tmp_file == NULL) {
+		g_set_error (error, EOM_IMAGE_ERROR,
+			     EOM_IMAGE_ERROR_TMP_FILE_FAILED,
+			     _("Temporary file creation failed."));
+		return FALSE;
+	}
+
+	tmp_file_path = g_file_get_path (tmp_file);
+
+#ifdef HAVE_JPEG
+	/* determine kind of saving */
+	if ((g_ascii_strcasecmp (source->format, EOM_FILE_FORMAT_JPEG) == 0) &&
+	    source->exists && source->modified)
+	{
+		success = eom_image_jpeg_save_file (img, tmp_file_path, source, NULL, error);
+	}
+#endif
+
+	if (!success && (*error == NULL)) {
+		success = gdk_pixbuf_save (priv->image, tmp_file_path, source->format, error, NULL);
+	}
+
+	if (success) {
+		/* try to move result file to target uri */
+		success = tmp_file_move_to_uri (img, tmp_file, priv->file, TRUE /*overwrite*/, error);
+	}
+
+	if (success) {
+		eom_image_reset_modifications (img);
+	}
+
+	tmp_file_delete (tmp_file);
+
+	g_free (tmp_file_path);
+	g_object_unref (tmp_file);
+
+	priv->status = prev_status;
+
+	return success;
+}
+
+static gboolean
+eom_image_copy_file (EomImage *image, EomImageSaveInfo *source, EomImageSaveInfo *target, GError **error)
+{
+	gboolean result;
+	GError *ioerror = NULL;
+
+	g_return_val_if_fail (EOM_IS_IMAGE_SAVE_INFO (source), FALSE);
+	g_return_val_if_fail (EOM_IS_IMAGE_SAVE_INFO (target), FALSE);
+
+	result = g_file_copy (source->file,
+			      target->file,
+			      (target->overwrite ? G_FILE_COPY_OVERWRITE : 0) |
+			      G_FILE_COPY_ALL_METADATA,
+			      NULL,
+			      EOM_IS_IMAGE (image) ? transfer_progress_cb :NULL,
+			      image,
+			      &ioerror);
+
+	if (result == FALSE) {
+		if (ioerror->code == G_IO_ERROR_EXISTS) {
+			g_set_error (error, EOM_IMAGE_ERROR,
+				     EOM_IMAGE_ERROR_FILE_EXISTS,
+				     "%s", ioerror->message);
+		} else {
+		g_set_error (error, EOM_IMAGE_ERROR,
+			     EOM_IMAGE_ERROR_VFS,
+			     "%s", ioerror->message);
+		}
+		g_error_free (ioerror);
+	}
+
+	return result;
+}
+
+gboolean
+eom_image_save_as_by_info (EomImage *img, EomImageSaveInfo *source, EomImageSaveInfo *target, GError **error)
+{
+	EomImagePrivate *priv;
+	gboolean success = FALSE;
+	char *tmp_file_path;
+	GFile *tmp_file;
+	gboolean direct_copy = FALSE;
+
+	g_return_val_if_fail (EOM_IS_IMAGE (img), FALSE);
+	g_return_val_if_fail (EOM_IS_IMAGE_SAVE_INFO (source), FALSE);
+	g_return_val_if_fail (EOM_IS_IMAGE_SAVE_INFO (target), FALSE);
+
+	priv = img->priv;
+
+	/* fail if there is no image to save */
+	if (priv->image == NULL) {
+		g_set_error (error,
+			     EOM_IMAGE_ERROR,
+			     EOM_IMAGE_ERROR_NOT_LOADED,
+			     _("No image loaded."));
+
+		return FALSE;
+	}
+
+	/* generate temporary file name */
+	tmp_file = tmp_file_get ();
+
+	if (tmp_file == NULL) {
+		g_set_error (error,
+			     EOM_IMAGE_ERROR,
+			     EOM_IMAGE_ERROR_TMP_FILE_FAILED,
+			     _("Temporary file creation failed."));
+
+		return FALSE;
+	}
+	tmp_file_path = g_file_get_path (tmp_file);
+
+	/* determine kind of saving */
+	if (g_ascii_strcasecmp (source->format, target->format) == 0 && !source->modified) {
+		success = eom_image_copy_file (img, source, target, error);
+		direct_copy = success;
+	}
+
+#ifdef HAVE_JPEG
+	else if ((g_ascii_strcasecmp (source->format, EOM_FILE_FORMAT_JPEG) == 0 && source->exists) ||
+		 (g_ascii_strcasecmp (target->format, EOM_FILE_FORMAT_JPEG) == 0))
+	{
+		success = eom_image_jpeg_save_file (img, tmp_file_path, source, target, error);
+	}
+#endif
+
+	if (!success && (*error == NULL)) {
+		success = gdk_pixbuf_save (priv->image, tmp_file_path, target->format, error, NULL);
+	}
+
+	if (success && !direct_copy) { /* not required if we alredy copied the file directly */
+		/* try to move result file to target uri */
+		success = tmp_file_move_to_uri (img, tmp_file, target->file, target->overwrite, error);
+	}
+
+	if (success) {
+		/* update image information to new uri */
+		eom_image_reset_modifications (img);
+		eom_image_link_with_target (img, target);
+	}
+
+	tmp_file_delete (tmp_file);
+	g_object_unref (tmp_file);
+	g_free (tmp_file_path);
+
+	priv->status = EOM_IMAGE_STATUS_UNKNOWN;
+
+	return success;
+}
+
+/*
+ * This function is extracted from
+ * File: caja/libcaja-private/caja-file.c
+ * Revision: 1.309
+ * Author: Darin Adler <darin@bentspoon.com>
+ */
+static gboolean
+have_broken_filenames (void)
+{
+	static gboolean initialized = FALSE;
+	static gboolean broken;
+
+	if (initialized) {
+		return broken;
+	}
+
+	broken = g_getenv ("G_BROKEN_FILENAMES") != NULL;
+
+	initialized = TRUE;
+
+	return broken;
+}
+
+/*
+ * This function is inspired by
+ * caja/libcaja-private/caja-file.c:caja_file_get_display_name_nocopy
+ * Revision: 1.309
+ * Author: Darin Adler <darin@bentspoon.com>
+ */
+const gchar*
+eom_image_get_caption (EomImage *img)
+{
+	EomImagePrivate *priv;
+	char *name;
+	char *utf8_name;
+	char *scheme;
+	gboolean validated = FALSE;
+	gboolean broken_filenames;
+
+	g_return_val_if_fail (EOM_IS_IMAGE (img), NULL);
+
+	priv = img->priv;
+
+	if (priv->file == NULL) return NULL;
+
+	if (priv->caption != NULL)
+		/* Use cached caption string */
+		return priv->caption;
+
+	name = g_file_get_basename (priv->file);
+	scheme = g_file_get_uri_scheme (priv->file);
+
+	if (name != NULL && g_ascii_strcasecmp (scheme, "file") == 0) {
+		/* Support the G_BROKEN_FILENAMES feature of
+		 * glib by using g_filename_to_utf8 to convert
+		 * local filenames to UTF-8. Also do the same
+		 * thing with any local filename that does not
+		 * validate as good UTF-8.
+		 */
+		broken_filenames = have_broken_filenames ();
+
+		if (broken_filenames || !g_utf8_validate (name, -1, NULL)) {
+			utf8_name = g_locale_to_utf8 (name, -1, NULL, NULL, NULL);
+			if (utf8_name != NULL) {
+				g_free (name);
+				name = utf8_name;
+				/* Guaranteed to be correct utf8 here */
+				validated = TRUE;
+			}
+		} else {
+			/* name was valid, no need to re-validate */
+			validated = TRUE;
+		}
+	}
+
+	if (!validated && !g_utf8_validate (name, -1, NULL)) {
+		if (name == NULL) {
+			name = g_strdup ("[Invalid Unicode]");
+		} else {
+			utf8_name = eom_util_make_valid_utf8 (name);
+			g_free (name);
+			name = utf8_name;
+		}
+	}
+
+	priv->caption = name;
+
+	if (priv->caption == NULL) {
+		char *short_str;
+
+		short_str = g_file_get_basename (priv->file);
+		if (g_utf8_validate (short_str, -1, NULL)) {
+			priv->caption = g_strdup (short_str);
+		} else {
+			priv->caption = g_filename_to_utf8 (short_str, -1, NULL, NULL, NULL);
+		}
+		g_free (short_str);
+	}
+	g_free (scheme);
+
+	return priv->caption;
+}
+
+const gchar*
+eom_image_get_collate_key (EomImage *img)
+{
+	EomImagePrivate *priv;
+
+	g_return_val_if_fail (EOM_IS_IMAGE (img), NULL);
+
+	priv = img->priv;
+
+	if (priv->collate_key == NULL) {
+		const char *caption;
+
+		caption = eom_image_get_caption (img);
+
+		priv->collate_key = g_utf8_collate_key_for_filename (caption, -1);
+	}
+
+	return priv->collate_key;
+}
+
+void
+eom_image_cancel_load (EomImage *img)
+{
+	EomImagePrivate *priv;
+
+	g_return_if_fail (EOM_IS_IMAGE (img));
+
+	priv = img->priv;
+
+	g_mutex_lock (&priv->status_mutex);
+
+	if (priv->status == EOM_IMAGE_STATUS_LOADING) {
+		priv->cancel_loading = TRUE;
+	}
+
+	g_mutex_unlock (&priv->status_mutex);
+}
+
+#ifdef HAVE_EXIF
+ExifData *
+eom_image_get_exif_info (EomImage *img)
+{
+	EomImagePrivate *priv;
+	ExifData *data = NULL;
+
+	g_return_val_if_fail (EOM_IS_IMAGE (img), NULL);
+
+	priv = img->priv;
+
+	g_mutex_lock (&priv->status_mutex);
+
+	exif_data_ref (priv->exif);
+	data = priv->exif;
+
+	g_mutex_unlock (&priv->status_mutex);
+
+	return data;
+}
+#endif
+
+/**
+ * eom_image_get_xmp_info:
+ * @img: a #EomImage
+ *
+ * Gets the XMP info for @img or NULL if compiled without
+ * libexempi support.
+ *
+ * Returns: (transfer full): the xmp data
+ **/
+gpointer
+eom_image_get_xmp_info (EomImage *img)
+{
+ 	gpointer data = NULL;
+
+ 	g_return_val_if_fail (EOM_IS_IMAGE (img), NULL);
+
+#ifdef HAVE_EXEMPI
+	EomImagePrivate *priv;
+ 	priv = img->priv;
+
+	g_mutex_lock (&priv->status_mutex);
+ 	data = (gpointer) xmp_copy (priv->xmp);
+	g_mutex_unlock (&priv->status_mutex);
+#endif
+
+ 	return data;
+}
+
+/**
+ * eom_image_get_file:
+ * @img: a #EomImage
+ *
+ * Gets the #GFile associated with @img
+ *
+ * Returns: (transfer full): a #GFile
+ **/
+GFile *
+eom_image_get_file (EomImage *img)
+{
+	g_return_val_if_fail (EOM_IS_IMAGE (img), NULL);
+
+	return g_object_ref (img->priv->file);
+}
+
+gboolean
+eom_image_is_modified (EomImage *img)
+{
+	g_return_val_if_fail (EOM_IS_IMAGE (img), FALSE);
+
+	return img->priv->modified;
+}
+
+goffset
+eom_image_get_bytes (EomImage *img)
+{
+	g_return_val_if_fail (EOM_IS_IMAGE (img), 0);
+
+	return img->priv->bytes;
+}
+
+void
+eom_image_modified (EomImage *img)
+{
+	g_return_if_fail (EOM_IS_IMAGE (img));
+
+	g_signal_emit (img, signals[SIGNAL_CHANGED], 0);
+}
+
+gchar*
+eom_image_get_uri_for_display (EomImage *img)
+{
+	EomImagePrivate *priv;
+	gchar *uri_str = NULL;
+	gchar *str = NULL;
+
+	g_return_val_if_fail (EOM_IS_IMAGE (img), NULL);
+
+	priv = img->priv;
+
+	if (priv->file != NULL) {
+		uri_str = g_file_get_uri (priv->file);
+
+		if (uri_str != NULL) {
+			str = g_uri_unescape_string (uri_str, NULL);
+			g_free (uri_str);
+		}
+	}
+
+	return str;
+}
+
+EomImageStatus
+eom_image_get_status (EomImage *img)
+{
+	g_return_val_if_fail (EOM_IS_IMAGE (img), EOM_IMAGE_STATUS_UNKNOWN);
+
+	return img->priv->status;
+}
+
+/**
+ * eom_image_get_metadata_status:
+ * @img: a #EomImage
+ *
+ * Returns the current status of the image metadata, that is,
+ * whether the metadata has not been read yet, is ready, or not available at all.
+ *
+ * Returns: one of #EomImageMetadataStatus
+ **/
+EomImageMetadataStatus
+eom_image_get_metadata_status (EomImage *img)
+{
+	g_return_val_if_fail (EOM_IS_IMAGE (img), EOM_IMAGE_METADATA_NOT_AVAILABLE);
+
+	return img->priv->metadata_status;
+}
+
+void
+eom_image_data_ref (EomImage *img)
+{
+	g_return_if_fail (EOM_IS_IMAGE (img));
+
+	g_object_ref (G_OBJECT (img));
+	img->priv->data_ref_count++;
+
+	g_assert (img->priv->data_ref_count <= G_OBJECT (img)->ref_count);
+}
+
+void
+eom_image_data_unref (EomImage *img)
+{
+	g_return_if_fail (EOM_IS_IMAGE (img));
+
+	if (img->priv->data_ref_count > 0) {
+		img->priv->data_ref_count--;
+	} else {
+		g_warning ("More image data unrefs than refs.");
+	}
+
+	if (img->priv->data_ref_count == 0) {
+		eom_image_free_mem_private (img);
+	}
+
+	g_object_unref (G_OBJECT (img));
+
+	g_assert (img->priv->data_ref_count <= G_OBJECT (img)->ref_count);
+}
+
+static gint
+compare_quarks (gconstpointer a, gconstpointer b)
+{
+	GQuark quark;
+
+	quark = g_quark_from_string ((const gchar *) a);
+
+	return quark - GPOINTER_TO_INT (b);
+}
+
+/**
+ * eom_image_get_supported_mime_types:
+ *
+ * Gets the list of supported mimetypes
+ *
+ * Returns: (transfer none)(element-type utf8): a #GList of supported mimetypes
+ **/
+GList *
+eom_image_get_supported_mime_types (void)
+{
+	static GList *supported_mime_types = NULL;
+	GSList *format_list, *it;
+	gchar **mime_types;
+	int i;
+
+	if (supported_mime_types == NULL) {
+		format_list = gdk_pixbuf_get_formats ();
+
+		for (it = format_list; it != NULL; it = it->next) {
+			mime_types =
+				gdk_pixbuf_format_get_mime_types ((GdkPixbufFormat *) it->data);
+
+			for (i = 0; mime_types[i] != NULL; i++) {
+				supported_mime_types =
+					g_list_prepend (supported_mime_types,
+							g_strdup (mime_types[i]));
+			}
+
+			g_strfreev (mime_types);
+		}
+
+		supported_mime_types = g_list_sort (supported_mime_types,
+						    (GCompareFunc) compare_quarks);
+
+		g_slist_free (format_list);
+	}
+
+	return supported_mime_types;
+}
+
+gboolean
+eom_image_is_supported_mime_type (const char *mime_type)
+{
+	GList *result;<--- Variable 'result' can be declared as pointer to const
+	GQuark quark;
+
+	if (mime_type == NULL) {
+		return FALSE;
+	}
+
+	quark = g_quark_from_string (mime_type);
+
+	result = g_list_find_custom (eom_image_get_supported_mime_types (),
+				     GINT_TO_POINTER (quark),
+				     (GCompareFunc) compare_quarks);
+
+	return (result != NULL);
+}
+
+static gboolean
+eom_image_iter_advance (EomImage *img)
+{
+	EomImagePrivate *priv;
+ 	gboolean new_frame;
+
+	g_return_val_if_fail (EOM_IS_IMAGE (img), FALSE);
+	g_return_val_if_fail (GDK_IS_PIXBUF_ANIMATION_ITER (img->priv->anim_iter), FALSE);
+
+	priv = img->priv;
+
+	if ((new_frame = gdk_pixbuf_animation_iter_advance (img->priv->anim_iter, NULL)) == TRUE) {
+		g_mutex_lock (&priv->status_mutex);
+		g_object_unref (priv->image);
+		priv->image = gdk_pixbuf_animation_iter_get_pixbuf (priv->anim_iter);
+	 	g_object_ref (priv->image);
+		/* keep the transformation over time */
+		if (EOM_IS_TRANSFORM (priv->trans)) {
+			GdkPixbuf* transformed = eom_transform_apply (priv->trans, priv->image, NULL);
+			g_object_unref (priv->image);
+			priv->image = transformed;
+			priv->width = gdk_pixbuf_get_width (transformed);
+			priv->height = gdk_pixbuf_get_height (transformed);
+		}
+		g_mutex_unlock (&priv->status_mutex);
+		/* Emit next frame signal so we can update the display */
+		g_signal_emit (img, signals[SIGNAL_NEXT_FRAME], 0,
+			       gdk_pixbuf_animation_iter_get_delay_time (priv->anim_iter));
+	}
+
+	return new_frame;
+}
+
+/**
+ * eom_image_is_animation:
+ * @img: a #EomImage
+ *
+ * Checks whether a given image is animated.
+ *
+ * Returns: #TRUE if it is an animated image, #FALSE otherwise.
+ *
+ **/
+gboolean
+eom_image_is_animation (EomImage *img)
+{
+	g_return_val_if_fail (EOM_IS_IMAGE (img), FALSE);
+	return img->priv->anim != NULL;
+}
+
+static gboolean
+private_timeout (gpointer data)
+{
+	EomImage *img = EOM_IMAGE (data);
+	EomImagePrivate *priv = img->priv;
+
+	if (eom_image_is_animation (img) &&
+	    !g_source_is_destroyed (g_main_current_source ()) &&
+	    priv->is_playing) {
+		while (eom_image_iter_advance (img) != TRUE) {}; /* cpu-sucking ? */
+			g_timeout_add (gdk_pixbuf_animation_iter_get_delay_time (priv->anim_iter), private_timeout, img);
+	 		return FALSE;
+ 	}
+	priv->is_playing = FALSE;
+	return FALSE; /* stop playing */
+}
+
+/**
+ * eom_image_start_animation:
+ * @img: a #EomImage
+ *
+ * Starts playing an animated image.
+ *
+ * Returns: %TRUE on success, %FALSE if @img is already playing or isn't an animated image.
+ **/
+gboolean
+eom_image_start_animation (EomImage *img)
+{
+	EomImagePrivate *priv;
+
+	g_return_val_if_fail (EOM_IS_IMAGE (img), FALSE);
+	priv = img->priv;
+
+	if (!eom_image_is_animation (img) || priv->is_playing)
+		return FALSE;
+
+	g_mutex_lock (&priv->status_mutex);
+	g_object_ref (priv->anim_iter);
+	priv->is_playing = TRUE;
+	g_mutex_unlock (&priv->status_mutex);
+
+ 	g_timeout_add (gdk_pixbuf_animation_iter_get_delay_time (priv->anim_iter), private_timeout, img);
+
+	return TRUE;
+}
+
+#ifdef HAVE_RSVG
+gboolean
+eom_image_is_svg (EomImage *img)
+{
+	g_return_val_if_fail (EOM_IS_IMAGE (img), FALSE);
+
+	return (img->priv->svg != NULL);
+}
+
+RsvgHandle *
+eom_image_get_svg (EomImage *img)
+{
+	g_return_val_if_fail (EOM_IS_IMAGE (img), NULL);
+
+	return img->priv->svg;
+}
+
+#endif
+
+/**
+ * eom_image_get_transform:
+ * @img: a #EomImage
+ *
+ * Get @img transform.
+ *
+ * Returns: (transfer none): A #EomTransform.
+ */
+
+EomTransform *
+eom_image_get_transform (EomImage *img)
+{
+	g_return_val_if_fail (EOM_IS_IMAGE (img), NULL);
+
+	return img->priv->trans;
+}
+
+/**
+ * eom_image_get_autorotate_transform:
+ * @img: a #EomImage
+ *
+ * Get @img autorotate transform.
+ *
+ * Returns: (transfer none): A #EomTransform.
+ */
+
+EomTransform*
+eom_image_get_autorotate_transform (EomImage *img)
+{
+	g_return_val_if_fail (EOM_IS_IMAGE (img), NULL);
+
+	return img->priv->trans_autorotate;
+}
+
+/**
+ * eom_image_file_changed:
+ * @img: a #EomImage
+ *
+ * Marks the image files contents as changed. Also, emits
+ * EomImage::file-changed signal
+ **/
+void
+eom_image_file_changed (EomImage *img)
+{
+	g_return_if_fail (EOM_IS_IMAGE (img));
+
+	img->priv->file_is_changed = TRUE;
+	g_signal_emit (img, signals[SIGNAL_FILE_CHANGED], 0);
+}
+
+gboolean
+eom_image_is_file_changed (EomImage *img)
+{
+	g_return_val_if_fail (EOM_IS_IMAGE (img), TRUE);
+
+	return img->priv->file_is_changed;
+}
+
+gboolean
+eom_image_is_jpeg (EomImage *img)
+{
+	g_return_val_if_fail (EOM_IS_IMAGE (img), FALSE);
+
+	return ((img->priv->file_type != NULL) && (g_ascii_strcasecmp (img->priv->file_type, EOM_FILE_FORMAT_JPEG) == 0));
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/55.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/55.html new file mode 100644 index 0000000..fa73253 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/55.html @@ -0,0 +1,285 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
/* This file is generated by glib-genmarshal, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */
+#ifndef __EOM_MARSHAL_MARSHAL_H__
+#define __EOM_MARSHAL_MARSHAL_H__
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+/* VOID:INT,INT (eom-marshal.list:1) */
+G_GNUC_INTERNAL
+void eom_marshal_VOID__INT_INT (GClosure     *closure,
+                                GValue       *return_value,
+                                guint         n_param_values,
+                                const GValue *param_values,
+                                gpointer      invocation_hint,
+                                gpointer      marshal_data);
+
+/* VOID:DOUBLE (eom-marshal.list:2) */
+#define eom_marshal_VOID__DOUBLE	g_cclosure_marshal_VOID__DOUBLE
+
+
+G_END_DECLS
+
+#endif /* __EOM_MARSHAL_MARSHAL_H__ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/56.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/56.html new file mode 100644 index 0000000..eae09a5 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/56.html @@ -0,0 +1,461 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye Of MATE -- Metadata Reader Interface
+ *
+ * Copyright (C) 2008 The Free Software Foundation
+ *
+ * Author: Felix Riemann <friemann@svn.gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _EOM_METADATA_READER_H_
+#define _EOM_METADATA_READER_H_
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#if HAVE_EXIF
+#include "eom-exif-util.h"
+#endif
+#if HAVE_EXEMPI
+#include <exempi/xmp.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+#if HAVE_LCMS
+#include <lcms2.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+G_BEGIN_DECLS
+
+#define EOM_TYPE_METADATA_READER	      (eom_metadata_reader_get_type ())
+#define EOM_METADATA_READER(o)		      (G_TYPE_CHECK_INSTANCE_CAST ((o), EOM_TYPE_METADATA_READER, EomMetadataReader))
+#define EOM_IS_METADATA_READER(o)	      (G_TYPE_CHECK_INSTANCE_TYPE ((o), EOM_TYPE_METADATA_READER))
+#define EOM_METADATA_READER_GET_INTERFACE(o)  (G_TYPE_INSTANCE_GET_INTERFACE ((o), EOM_TYPE_METADATA_READER, EomMetadataReaderInterface))
+
+typedef struct _EomMetadataReader EomMetadataReader;
+typedef struct _EomMetadataReaderInterface EomMetadataReaderInterface;
+
+struct _EomMetadataReaderInterface {
+	GTypeInterface parent;
+
+	void		(*consume)		(EomMetadataReader *self,
+						 const guchar *buf,
+						 guint len);
+
+	gboolean	(*finished)		(EomMetadataReader *self);
+
+	void		(*get_raw_exif)		(EomMetadataReader *self,
+						 guchar **data,
+						 guint *len);
+
+	gpointer	(*get_exif_data)	(EomMetadataReader *self);
+
+	gpointer	(*get_icc_profile)	(EomMetadataReader *self);
+
+	gpointer	(*get_xmp_ptr)		(EomMetadataReader *self);
+};
+
+typedef enum {
+	EOM_METADATA_JPEG,
+	EOM_METADATA_PNG
+} EomMetadataFileType;
+
+G_GNUC_INTERNAL
+GType                eom_metadata_reader_get_type	(void) G_GNUC_CONST;
+
+G_GNUC_INTERNAL
+EomMetadataReader*   eom_metadata_reader_new 		(EomMetadataFileType type);
+
+G_GNUC_INTERNAL
+void                 eom_metadata_reader_consume	(EomMetadataReader *emr,
+							 const guchar *buf,
+							 guint len);
+
+G_GNUC_INTERNAL
+gboolean             eom_metadata_reader_finished	(EomMetadataReader *emr);
+
+G_GNUC_INTERNAL
+void                 eom_metadata_reader_get_exif_chunk (EomMetadataReader *emr,
+							 guchar **data,
+							 guint *len);
+
+#ifdef HAVE_EXIF
+G_GNUC_INTERNAL
+ExifData*            eom_metadata_reader_get_exif_data	(EomMetadataReader *emr);
+#endif
+
+#ifdef HAVE_EXEMPI
+G_GNUC_INTERNAL
+XmpPtr	     	     eom_metadata_reader_get_xmp_data	(EomMetadataReader *emr);
+#endif
+
+#if 0
+gpointer             eom_metadata_reader_get_iptc_chunk	(EomMetadataReader *emr);
+IptcData*            eom_metadata_reader_get_iptc_data	(EomMetadataReader *emr);
+#endif
+
+#ifdef HAVE_LCMS
+G_GNUC_INTERNAL
+cmsHPROFILE          eom_metadata_reader_get_icc_profile (EomMetadataReader *emr);
+#endif
+
+G_END_DECLS
+
+#endif /* _EOM_METADATA_READER_H_ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/57.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/57.html new file mode 100644 index 0000000..efe39a9 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/57.html @@ -0,0 +1,333 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/* Eye Of Mate - Thumbnailing functions
+ *
+ * Copyright (C) 2000-2007 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on caja code (libcaja-private/caja-thumbnail.c) by:
+ * 	- Andy Hertzfeld <andy@eazel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _EOM_THUMBNAIL_H_
+#define _EOM_THUMBNAIL_H_
+
+#include <gdk-pixbuf/gdk-pixbuf.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "eom-image.h"
+
+G_BEGIN_DECLS
+
+void          eom_thumbnail_init        (void);
+
+GdkPixbuf*    eom_thumbnail_fit_to_size (GdkPixbuf *thumbnail,
+					 gint        dimension);
+
+GdkPixbuf*    eom_thumbnail_add_frame   (GdkPixbuf *thumbnail);
+
+GdkPixbuf*    eom_thumbnail_load        (EomImage *image,
+					 GError **error);
+
+#define EOM_THUMBNAIL_ORIGINAL_WIDTH  "eom-thumbnail-orig-width"
+#define EOM_THUMBNAIL_ORIGINAL_HEIGHT "eom-thumbnail-orig-height"
+
+G_END_DECLS
+
+#endif /* _EOM_THUMBNAIL_H_ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/58.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/58.html new file mode 100644 index 0000000..52929df --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/58.html @@ -0,0 +1,321 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/* Eye Of Mate - Jobs Queue
+ *
+ * Copyright (C) 2006 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on evince code (shell/ev-job-queue.h) by:
+ * 	- Martin Kretzschmar <martink@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __EOM_JOB_QUEUE_H__
+#define __EOM_JOB_QUEUE_H__
+
+#include "eom-jobs.h"
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+void     eom_job_queue_init       (void);
+
+void     eom_job_queue_add_job    (EomJob    *job);
+
+gboolean eom_job_queue_remove_job (EomJob    *job);
+
+G_END_DECLS
+
+#endif /* __EOM_JOB_QUEUE_H__ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/59.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/59.html new file mode 100644 index 0000000..07db979 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/59.html @@ -0,0 +1,449 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
#ifndef _EOM_URI_CONVERTER_H_
+#define _EOM_URI_CONVERTER_H_
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "eom-image.h"
+
+G_BEGIN_DECLS
+
+#define EOM_TYPE_URI_CONVERTER          (eom_uri_converter_get_type ())
+#define EOM_URI_CONVERTER(o)            (G_TYPE_CHECK_INSTANCE_CAST ((o), EOM_TYPE_URI_CONVERTER, EomURIConverter))
+#define EOM_URI_CONVERTER_CLASS(k)      (G_TYPE_CHECK_CLASS_CAST((k), EOM_TYPE_URI_CONVERTER, EomURIConverterClass))
+#define EOM_IS_URI_CONVERTER(o)         (G_TYPE_CHECK_INSTANCE_TYPE ((o), EOM_TYPE_URI_CONVERTER))
+#define EOM_IS_URI_CONVERTER_CLASS(k)   (G_TYPE_CHECK_CLASS_TYPE ((k), EOM_TYPE_URI_CONVERTER))
+#define EOM_URI_CONVERTER_GET_CLASS(o)  (G_TYPE_INSTANCE_GET_CLASS ((o), EOM_TYPE_URI_CONVERTER, EomURIConverterClass))
+
+#ifndef __EOM_URI_CONVERTER_DECLR__
+#define __EOM_URI_CONVERTER_DECLR__
+typedef struct _EomURIConverter EomURIConverter;
+#endif
+typedef struct _EomURIConverterClass EomURIConverterClass;
+typedef struct _EomURIConverterPrivate EomURIConverterPrivate;
+
+typedef enum {
+	EOM_UC_STRING,
+	EOM_UC_FILENAME,
+	EOM_UC_COUNTER,
+	EOM_UC_COMMENT,
+	EOM_UC_DATE,
+	EOM_UC_TIME,
+	EOM_UC_DAY,
+	EOM_UC_MONTH,
+	EOM_UC_YEAR,
+	EOM_UC_HOUR,
+	EOM_UC_MINUTE,
+	EOM_UC_SECOND,
+	EOM_UC_END
+} EomUCType;
+
+typedef struct {
+	char     *description;
+	char     *rep;
+	gboolean req_exif;
+} EomUCInfo;
+
+typedef enum {
+	EOM_UC_ERROR_INVALID_UNICODE,
+	EOM_UC_ERROR_INVALID_CHARACTER,
+	EOM_UC_ERROR_EQUAL_FILENAMES,
+	EOM_UC_ERROR_UNKNOWN
+} EomUCError;
+
+#define EOM_UC_ERROR eom_uc_error_quark ()
+
+struct _EomURIConverter {
+	GObject parent;
+
+	EomURIConverterPrivate *priv;
+};
+
+struct _EomURIConverterClass {
+	GObjectClass parent_klass;
+};
+
+G_GNUC_INTERNAL
+GType              eom_uri_converter_get_type      (void) G_GNUC_CONST;
+
+G_GNUC_INTERNAL
+GQuark             eom_uc_error_quark              (void);
+
+G_GNUC_INTERNAL
+EomURIConverter*   eom_uri_converter_new           (GFile *base_file,
+                                                    GdkPixbufFormat *img_format,
+						    const char *format_string);
+
+G_GNUC_INTERNAL
+gboolean           eom_uri_converter_check         (EomURIConverter *converter,
+                                                    GList *img_list,
+                                                    GError **error);
+
+G_GNUC_INTERNAL
+gboolean           eom_uri_converter_requires_exif (EomURIConverter *converter);
+
+G_GNUC_INTERNAL
+gboolean           eom_uri_converter_do            (EomURIConverter *converter,
+                                                    EomImage *image,
+                                                    GFile **file,
+                                                    GdkPixbufFormat **format,
+                                                    GError **error);
+
+G_GNUC_INTERNAL
+char*              eom_uri_converter_preview       (const char *format_str,
+                                                    EomImage *img,
+                                                    GdkPixbufFormat *format,
+						    gulong counter,
+						    guint n_images,
+						    gboolean convert_spaces,
+						    gunichar space_char);
+
+/* for debugging purpose only */
+G_GNUC_INTERNAL
+void                eom_uri_converter_print_list (EomURIConverter *conv);
+
+G_END_DECLS
+
+#endif /* _EOM_URI_CONVERTER_H_ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/6.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/6.html new file mode 100644 index 0000000..660daa6 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/6.html @@ -0,0 +1,279 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21

+/* This file is generated by glib-mkenums, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */
+
+#ifndef __EGGTYPEBUILTINS_H__
+#define __EGGTYPEBUILTINS_H__ 1
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+/* --- egg-toolbars-model.h --- */
+#define EGG_TYPE_TB_MODEL_FLAGS egg_tb_model_flags_get_type()
+G_GNUC_INTERNAL GType egg_tb_model_flags_get_type (void);
+#define EGG_TYPE_TB_MODEL_NAME_FLAGS egg_tb_model_name_flags_get_type()
+G_GNUC_INTERNAL GType egg_tb_model_name_flags_get_type (void);
+G_END_DECLS
+
+#endif /* __EGGTYPEBUILTINS_H__ */
+
+/* Generated data ends here */
+
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/60.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/60.html new file mode 100644 index 0000000..6cbc45e --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/60.html @@ -0,0 +1,2153 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye Of Mate - Jobs
+ *
+ * Copyright (C) 2006 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on evince code (shell/ev-jobs.c) by:
+ * 	- Martin Kretzschmar <martink@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "eom-uri-converter.h"
+#include "eom-jobs.h"
+#include "eom-job-queue.h"
+#include "eom-image.h"
+#include "eom-transform.h"
+#include "eom-list-store.h"
+#include "eom-thumbnail.h"
+#include "eom-pixbuf-util.h"
+
+#include <gdk-pixbuf/gdk-pixbuf.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_DEFINE_TYPE (EomJob, eom_job, G_TYPE_OBJECT);
+G_DEFINE_TYPE (EomJobThumbnail, eom_job_thumbnail, EOM_TYPE_JOB);
+G_DEFINE_TYPE (EomJobLoad, eom_job_load, EOM_TYPE_JOB);
+G_DEFINE_TYPE (EomJobModel, eom_job_model, EOM_TYPE_JOB);
+G_DEFINE_TYPE (EomJobTransform, eom_job_transform, EOM_TYPE_JOB);
+G_DEFINE_TYPE (EomJobSave, eom_job_save, EOM_TYPE_JOB);
+G_DEFINE_TYPE (EomJobSaveAs, eom_job_save_as, EOM_TYPE_JOB_SAVE);
+G_DEFINE_TYPE (EomJobCopy, eom_job_copy, EOM_TYPE_JOB);
+
+enum
+{
+	SIGNAL_FINISHED,
+	SIGNAL_PROGRESS,
+	SIGNAL_LAST_SIGNAL
+};
+
+static guint job_signals[SIGNAL_LAST_SIGNAL] = { 0 };
+
+static void eom_job_copy_run      (EomJob *ejob);
+static void eom_job_load_run 	  (EomJob *ejob);
+static void eom_job_model_run     (EomJob *ejob);
+static void eom_job_save_run      (EomJob *job);
+static void eom_job_save_as_run   (EomJob *job);
+static void eom_job_thumbnail_run (EomJob *ejob);
+static void eom_job_transform_run (EomJob *ejob);
+
+static void eom_job_init (EomJob *job)
+{
+	/* NOTE: We need to allocate the mutex here so the ABI stays the same when it used to use g_mutex_new */
+	job->mutex = g_malloc (sizeof (GMutex));
+	g_mutex_init (job->mutex);
+	job->progress = 0.0;
+}
+
+static void
+eom_job_dispose (GObject *object)
+{
+	EomJob *job;
+
+	job = EOM_JOB (object);
+
+	if (job->error) {
+		g_error_free (job->error);
+		job->error = NULL;
+	}
+
+	if (job->mutex) {
+		g_mutex_clear (job->mutex);
+		g_free (job->mutex);
+	}
+
+	(* G_OBJECT_CLASS (eom_job_parent_class)->dispose) (object);
+}
+
+static void
+eom_job_run_default (EomJob *job)
+{
+	g_critical ("Class \"%s\" does not implement the required run action",
+		    G_OBJECT_CLASS_NAME (G_OBJECT_GET_CLASS (job)));
+}
+
+static void
+eom_job_class_init (EomJobClass *class)
+{
+	GObjectClass *oclass;
+
+	oclass = G_OBJECT_CLASS (class);
+
+	oclass->dispose = eom_job_dispose;
+
+	class->run = eom_job_run_default;
+
+	job_signals [SIGNAL_FINISHED] =
+		g_signal_new ("finished",
+			      EOM_TYPE_JOB,
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (EomJobClass, finished),
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE, 0);
+
+	job_signals [SIGNAL_PROGRESS] =
+		g_signal_new ("progress",
+			      EOM_TYPE_JOB,
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (EomJobClass, progress),
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__FLOAT,
+			      G_TYPE_NONE, 1,
+			      G_TYPE_FLOAT);
+}
+
+void
+eom_job_finished (EomJob *job)
+{
+	g_return_if_fail (EOM_IS_JOB (job));
+
+	g_signal_emit (job, job_signals[SIGNAL_FINISHED], 0);
+}
+
+/**
+ * eom_job_run:
+ * @job: the job to execute.
+ *
+ * Executes the job passed as @job. Usually there is no need to call this
+ * on your own. Jobs should be executed by using the EomJobQueue.
+ **/
+void
+eom_job_run (EomJob *job)
+{
+	EomJobClass *class;
+
+	g_return_if_fail (EOM_IS_JOB (job));
+
+	class = EOM_JOB_GET_CLASS (job);
+	if (class->run)
+		class->run (job);
+	else
+		eom_job_run_default (job);
+}
+static gboolean
+notify_progress (gpointer data)
+{
+	EomJob *job = EOM_JOB (data);
+
+	g_signal_emit (job, job_signals[SIGNAL_PROGRESS], 0, job->progress);
+
+	return FALSE;
+}
+
+void
+eom_job_set_progress (EomJob *job, float progress)
+{
+	g_return_if_fail (EOM_IS_JOB (job));
+	g_return_if_fail (progress >= 0.0 && progress <= 1.0);
+
+	g_mutex_lock (job->mutex);
+	job->progress = progress;
+	g_mutex_unlock (job->mutex);
+
+	g_idle_add (notify_progress, job);
+}
+
+static void eom_job_thumbnail_init (EomJobThumbnail *job) { /* Do Nothing */ }
+
+static void
+eom_job_thumbnail_dispose (GObject *object)
+{
+	EomJobThumbnail *job;
+
+	job = EOM_JOB_THUMBNAIL (object);
+
+	if (job->image) {
+		g_object_unref (job->image);
+		job->image = NULL;
+	}
+
+	if (job->thumbnail) {
+		g_object_unref (job->thumbnail);
+		job->thumbnail = NULL;
+	}
+
+	(* G_OBJECT_CLASS (eom_job_thumbnail_parent_class)->dispose) (object);
+}
+
+static void
+eom_job_thumbnail_class_init (EomJobThumbnailClass *class)
+{
+	GObjectClass *oclass;
+
+	oclass = G_OBJECT_CLASS (class);
+
+	oclass->dispose = eom_job_thumbnail_dispose;
+
+	EOM_JOB_CLASS (class)->run = eom_job_thumbnail_run;
+}
+
+EomJob *
+eom_job_thumbnail_new (EomImage *image)
+{
+	EomJobThumbnail *job;
+
+	job = g_object_new (EOM_TYPE_JOB_THUMBNAIL, NULL);
+
+	if (image) {
+		job->image = g_object_ref (image);
+	}
+
+	return EOM_JOB (job);
+}
+
+static void
+eom_job_thumbnail_run (EomJob *ejob)
+{
+	gchar *orig_width, *orig_height;
+	gint width, height;
+	GdkPixbuf *pixbuf;
+	EomJobThumbnail *job;
+
+	g_return_if_fail (EOM_IS_JOB_THUMBNAIL (ejob));
+
+	job = EOM_JOB_THUMBNAIL (ejob);
+
+	if (ejob->error) {
+	        g_error_free (ejob->error);
+		ejob->error = NULL;
+	}
+
+	job->thumbnail = eom_thumbnail_load (job->image,
+					     &ejob->error);
+
+	if (!job->thumbnail) {
+		ejob->finished = TRUE;
+		return;
+	}
+
+	orig_width = g_strdup (gdk_pixbuf_get_option (job->thumbnail, "tEXt::Thumb::Image::Width"));
+	orig_height = g_strdup (gdk_pixbuf_get_option (job->thumbnail, "tEXt::Thumb::Image::Height"));
+
+	pixbuf = eom_thumbnail_fit_to_size (job->thumbnail, EOM_LIST_STORE_THUMB_SIZE);
+	g_object_unref (job->thumbnail);
+	job->thumbnail = eom_thumbnail_add_frame (pixbuf);
+	g_object_unref (pixbuf);
+
+	if (orig_width) {
+		sscanf (orig_width, "%i", &width);
+		g_object_set_data (G_OBJECT (job->thumbnail),
+				   EOM_THUMBNAIL_ORIGINAL_WIDTH,
+				   GINT_TO_POINTER (width));
+		g_free (orig_width);
+	}
+	if (orig_height) {
+		sscanf (orig_height, "%i", &height);
+		g_object_set_data (G_OBJECT (job->thumbnail),
+				   EOM_THUMBNAIL_ORIGINAL_HEIGHT,
+				   GINT_TO_POINTER (height));
+		g_free (orig_height);
+	}
+
+	if (ejob->error) {
+		g_warning ("%s", ejob->error->message);
+	}
+
+	ejob->finished = TRUE;
+}
+
+static void eom_job_load_init (EomJobLoad *job) { /* Do Nothing */ }
+
+static void
+eom_job_load_dispose (GObject *object)
+{
+	EomJobLoad *job;
+
+	job = EOM_JOB_LOAD (object);
+
+	if (job->image) {
+		g_object_unref (job->image);
+		job->image = NULL;
+	}
+
+	(* G_OBJECT_CLASS (eom_job_load_parent_class)->dispose) (object);
+}
+
+static void
+eom_job_load_class_init (EomJobLoadClass *class)
+{
+	GObjectClass *oclass;
+
+	oclass = G_OBJECT_CLASS (class);
+
+	oclass->dispose = eom_job_load_dispose;
+	EOM_JOB_CLASS (class)->run = eom_job_load_run;
+}
+
+EomJob *
+eom_job_load_new (EomImage *image, EomImageData data)
+{
+	EomJobLoad *job;
+
+	job = g_object_new (EOM_TYPE_JOB_LOAD, NULL);
+
+	if (image) {
+		job->image = g_object_ref (image);
+	}
+	job->data = data;
+
+	return EOM_JOB (job);
+}
+
+static void
+eom_job_load_run (EomJob *job)
+{
+	g_return_if_fail (EOM_IS_JOB_LOAD (job));
+
+	if (job->error) {
+	        g_error_free (job->error);
+		job->error = NULL;
+	}
+
+	eom_image_load (EOM_IMAGE (EOM_JOB_LOAD (job)->image),
+			EOM_JOB_LOAD (job)->data,
+			job,
+			&job->error);
+
+	job->finished = TRUE;
+}
+
+static void eom_job_model_init (EomJobModel *job) { /* Do Nothing */ }
+
+static void
+eom_job_model_class_init (EomJobModelClass *class)
+{
+	EOM_JOB_CLASS (class)->run = eom_job_model_run;
+}
+
+/**
+ * eom_job_model_new:
+ * @file_list: (element-type GFile): a #GFile list
+ *
+ * Creates a new #EomJob model.
+ *
+ * Returns: A #EomJob.
+ */
+
+EomJob *
+eom_job_model_new (GSList *file_list)
+{
+	EomJobModel *job;
+
+	job = g_object_new (EOM_TYPE_JOB_MODEL, NULL);
+
+	job->file_list = file_list;
+
+	return EOM_JOB (job);
+}
+
+static void
+filter_files (GSList *files, GList **file_list, GList **error_list)
+{
+	GSList *it;
+	GFileInfo *file_info;
+
+	for (it = files; it != NULL; it = it->next) {
+		GFile *file;
+		GFileType type = G_FILE_TYPE_UNKNOWN;
+
+		file = (GFile *) it->data;
+
+		if (file != NULL) {
+			file_info = g_file_query_info (file,
+						       G_FILE_ATTRIBUTE_STANDARD_TYPE","G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+						       0, NULL, NULL);
+			if (file_info == NULL) {
+				type = G_FILE_TYPE_UNKNOWN;
+			} else {
+				type = g_file_info_get_file_type (file_info);
+
+				/* Workaround for gvfs backends that
+				   don't set the GFileType. */
+				if (G_UNLIKELY (type == G_FILE_TYPE_UNKNOWN)) {
+					const gchar *ctype;
+
+					ctype = g_file_info_get_content_type (file_info);
+
+					/* If the content type is supported
+					   adjust the file_type */
+					if (eom_image_is_supported_mime_type (ctype))
+						type = G_FILE_TYPE_REGULAR;
+				}
+
+				g_object_unref (file_info);
+			}
+		}
+
+		switch (type) {
+		case G_FILE_TYPE_REGULAR:
+		case G_FILE_TYPE_DIRECTORY:
+			*file_list = g_list_prepend (*file_list, g_object_ref (file));
+			break;
+		default:
+			*error_list = g_list_prepend (*error_list,
+						      g_file_get_uri (file));
+			break;
+		}
+	}
+
+	*file_list  = g_list_reverse (*file_list);
+	*error_list = g_list_reverse (*error_list);
+}
+
+static void
+eom_job_model_run (EomJob *ejob)
+{
+	GList *filtered_list = NULL;
+	GList *error_list = NULL;
+	EomJobModel *job;
+
+	g_return_if_fail (EOM_IS_JOB_MODEL (ejob));
+
+	job = EOM_JOB_MODEL (ejob);
+
+	filter_files (job->file_list, &filtered_list, &error_list);
+
+	job->store = EOM_LIST_STORE (eom_list_store_new ());
+
+	eom_list_store_add_files (job->store, filtered_list);
+
+	g_list_free_full (filtered_list, g_object_unref);
+	g_list_free_full (error_list, g_free);
+
+	ejob->finished = TRUE;
+}
+
+static void eom_job_transform_init (EomJobTransform *job) { /* Do Nothing */ }
+
+static void
+eom_job_transform_dispose (GObject *object)
+{
+	EomJobTransform *job;
+
+	job = EOM_JOB_TRANSFORM (object);
+
+	if (job->trans) {
+		g_object_unref (job->trans);
+		job->trans = NULL;
+	}
+
+	g_list_free_full (job->images, g_object_unref);
+
+	(* G_OBJECT_CLASS (eom_job_transform_parent_class)->dispose) (object);
+}
+
+static void
+eom_job_transform_class_init (EomJobTransformClass *class)
+{
+	GObjectClass *oclass;
+
+	oclass = G_OBJECT_CLASS (class);
+
+	oclass->dispose = eom_job_transform_dispose;
+
+	EOM_JOB_CLASS (class)->run = eom_job_transform_run;
+}
+
+/**
+ * eom_job_transform_new:
+ * @images: (element-type EomImage) (transfer full): a #EomImage list
+ * @trans: a #EomTransform
+ *
+ * Create a new #EomJob for image transformation.
+ *
+ * Returns: A #EomJob.
+ */
+
+EomJob *
+eom_job_transform_new (GList *images, EomTransform *trans)
+{
+	EomJobTransform *job;
+
+	job = g_object_new (EOM_TYPE_JOB_TRANSFORM, NULL);
+
+	if (trans) {
+		job->trans = g_object_ref (trans);
+	} else {
+		job->trans = NULL;
+	}
+
+	job->images = images;
+
+	return EOM_JOB (job);
+}
+
+static gboolean
+eom_job_transform_image_modified (gpointer data)
+{
+	g_return_val_if_fail (EOM_IS_IMAGE (data), FALSE);
+
+	eom_image_modified (EOM_IMAGE (data));
+	g_object_unref (G_OBJECT (data));
+
+	return FALSE;
+}
+
+void
+eom_job_transform_run (EomJob *ejob)
+{
+	EomJobTransform *job;
+	GList *it;
+
+	g_return_if_fail (EOM_IS_JOB_TRANSFORM (ejob));
+
+	job = EOM_JOB_TRANSFORM (ejob);
+
+	if (ejob->error) {
+	        g_error_free (ejob->error);
+		ejob->error = NULL;
+	}
+
+	for (it = job->images; it != NULL; it = it->next) {
+		EomImage *image = EOM_IMAGE (it->data);
+
+		if (job->trans == NULL) {
+			eom_image_undo (image);
+		} else {
+			eom_image_transform (image, job->trans, ejob);
+		}
+
+		if (eom_image_is_modified (image) || job->trans == NULL) {
+			g_object_ref (image);
+			g_idle_add (eom_job_transform_image_modified, image);
+		}
+	}
+
+	ejob->finished = TRUE;
+}
+
+static void eom_job_save_init (EomJobSave *job) { /* do nothing */ }
+
+static void
+eom_job_save_dispose (GObject *object)
+{
+	EomJobSave *job;
+
+	job = EOM_JOB_SAVE (object);
+
+	if (job->images) {
+		g_list_free_full (job->images, g_object_unref);
+		job->images = NULL;
+	}
+
+	(* G_OBJECT_CLASS (eom_job_save_parent_class)->dispose) (object);
+}
+
+static void
+eom_job_save_class_init (EomJobSaveClass *class)
+{
+	G_OBJECT_CLASS (class)->dispose = eom_job_save_dispose;
+	EOM_JOB_CLASS (class)->run = eom_job_save_run;
+}
+
+/**
+ * eom_job_save_new:
+ * @images: (element-type EomImage) (transfer full): a #EomImage list
+ *
+ * Creates a new #EomJob for image saving.
+ *
+ * Returns: A #EomJob.
+ */
+
+EomJob *
+eom_job_save_new (GList *images)
+{
+	EomJobSave *job;
+
+	job = g_object_new (EOM_TYPE_JOB_SAVE, NULL);
+
+	job->images = images;
+	job->current_image = NULL;
+
+	return EOM_JOB (job);
+}
+
+static void
+save_progress_handler (EomImage *image, gfloat progress, gpointer data)
+{
+	EomJobSave *job = EOM_JOB_SAVE (data);
+	guint n_images = g_list_length (job->images);
+	gfloat job_progress;
+
+	job_progress = (job->current_pos / (gfloat) n_images) + (progress / n_images);
+
+	eom_job_set_progress (EOM_JOB (job), job_progress);
+}
+
+static void
+eom_job_save_run (EomJob *ejob)
+{
+	EomJobSave *job;
+	GList *it;
+
+	g_return_if_fail (EOM_IS_JOB_SAVE (ejob));
+
+	job = EOM_JOB_SAVE (ejob);
+
+	job->current_pos = 0;
+
+	for (it = job->images; it != NULL; it = it->next, job->current_pos++) {
+		EomImage *image = EOM_IMAGE (it->data);
+		EomImageSaveInfo *save_info = NULL;
+		gulong handler_id = 0;
+		gboolean success = FALSE;
+
+		job->current_image = image;
+
+		/* Make sure the image doesn't go away while saving */
+		eom_image_data_ref (image);
+
+		if (!eom_image_has_data (image, EOM_IMAGE_DATA_ALL)) {
+			EomImageMetadataStatus m_status;
+			gint data2load = 0;
+
+			m_status = eom_image_get_metadata_status (image);
+			if (!eom_image_has_data (image, EOM_IMAGE_DATA_IMAGE)) {
+				// Queue full read in this case
+				data2load = EOM_IMAGE_DATA_ALL;
+			} else if (m_status == EOM_IMAGE_METADATA_NOT_READ) {
+				// Load only if we haven't read it yet
+				data2load = EOM_IMAGE_DATA_EXIF | EOM_IMAGE_DATA_XMP;
+			}
+
+			if (data2load != 0) {
+				eom_image_load (image,
+						data2load,
+						NULL,
+						&ejob->error);
+			}
+		}
+
+		handler_id = g_signal_connect (image, "save-progress",
+				               G_CALLBACK (save_progress_handler),
+					       job);
+
+		save_info = eom_image_save_info_new_from_image (image);
+
+		success = eom_image_save_by_info (image,
+						  save_info,
+						  &ejob->error);
+
+		if (save_info)
+			g_object_unref (save_info);
+
+		if (handler_id != 0)
+			g_signal_handler_disconnect (image, handler_id);
+
+		eom_image_data_unref (image);
+
+		if (!success) break;
+	}
+
+	ejob->finished = TRUE;
+}
+
+static void eom_job_save_as_init (EomJobSaveAs *job) { /* do nothing */ }
+
+static void eom_job_save_as_dispose (GObject *object)
+{
+	EomJobSaveAs *job = EOM_JOB_SAVE_AS (object);
+
+	if (job->converter != NULL) {
+		g_object_unref (job->converter);
+		job->converter = NULL;
+	}
+
+	if (job->file != NULL) {
+		g_object_unref (job->file);
+		job->file = NULL;
+	}
+
+	(* G_OBJECT_CLASS (eom_job_save_as_parent_class)->dispose) (object);
+}
+
+static void
+eom_job_save_as_class_init (EomJobSaveAsClass *class)
+{
+	G_OBJECT_CLASS (class)->dispose = eom_job_save_as_dispose;
+	EOM_JOB_CLASS (class)->run = eom_job_save_as_run;
+}
+
+/**
+ * eom_job_save_as_new:
+ * @images: (element-type EomImage) (transfer full): a #EomImage list
+ * @converter: a URI converter
+ * file: a #GFile
+ *
+ * Creates a new #EomJob for save as.
+ *
+ * Returns: A #EomJob.
+ */
+
+EomJob *
+eom_job_save_as_new (GList *images, EomURIConverter *converter, GFile *file)
+{
+	EomJobSaveAs *job;
+
+	g_assert (converter != NULL || g_list_length (images) == 1);
+
+	job = g_object_new (EOM_TYPE_JOB_SAVE_AS, NULL);
+
+	EOM_JOB_SAVE(job)->images = images;
+
+	job->converter = converter ? g_object_ref (converter) : NULL;
+	job->file = file ? g_object_ref (file) : NULL;
+
+	return EOM_JOB (job);
+}
+
+static void
+eom_job_save_as_run (EomJob *ejob)
+{
+	EomJobSave *job;
+	EomJobSaveAs *saveas_job;
+	GList *it;
+	guint n_images;
+
+	g_return_if_fail (EOM_IS_JOB_SAVE_AS (ejob));
+
+	job = EOM_JOB_SAVE (ejob);
+
+	n_images = g_list_length (job->images);
+
+	saveas_job = EOM_JOB_SAVE_AS (job);
+
+	job->current_pos = 0;
+
+	for (it = job->images; it != NULL; it = it->next, job->current_pos++) {
+		GdkPixbufFormat *format;
+		EomImageSaveInfo *src_info, *dest_info;
+		EomImage *image = EOM_IMAGE (it->data);
+		gboolean success = FALSE;
+		gulong handler_id = 0;
+
+		job->current_image = image;
+
+		eom_image_data_ref (image);
+
+		if (!eom_image_has_data (image, EOM_IMAGE_DATA_ALL)) {
+			EomImageMetadataStatus m_status;
+			gint data2load = 0;
+
+			m_status = eom_image_get_metadata_status (image);
+			if (!eom_image_has_data (image, EOM_IMAGE_DATA_IMAGE)) {
+				// Queue full read in this case
+				data2load = EOM_IMAGE_DATA_ALL;
+			} else if (m_status == EOM_IMAGE_METADATA_NOT_READ) {
+				// Load only if we haven't read it yet
+				data2load = EOM_IMAGE_DATA_EXIF | EOM_IMAGE_DATA_XMP;
+			}
+
+			if (data2load != 0) {
+				eom_image_load (image,
+						data2load,
+						NULL,
+						&ejob->error);
+			}
+		}
+
+		g_assert (ejob->error == NULL);
+
+		handler_id = g_signal_connect (image, "save-progress",
+				               G_CALLBACK (save_progress_handler),
+					       job);
+
+		src_info = eom_image_save_info_new_from_image (image);
+
+		if (n_images == 1) {
+			g_assert (saveas_job->file != NULL);
+
+			format = eom_pixbuf_get_format (saveas_job->file);
+
+			dest_info = eom_image_save_info_new_from_file (saveas_job->file,
+								   format);
+
+		/* SaveAsDialog has already secured permission to overwrite */
+			if (dest_info->exists) {
+				dest_info->overwrite = TRUE;
+			}
+		} else {
+			GFile *dest_file;
+			gboolean result;
+
+			result = eom_uri_converter_do (saveas_job->converter,
+						       image,
+						       &dest_file,
+						       &format,
+						       NULL);
+
+			g_assert (result);
+
+			dest_info = eom_image_save_info_new_from_file (dest_file,
+								   format);
+		}
+
+		success = eom_image_save_as_by_info (image,
+						     src_info,
+						     dest_info,
+						     &ejob->error);
+
+		if (src_info)
+			g_object_unref (src_info);
+
+		if (dest_info)
+			g_object_unref (dest_info);
+
+		if (handler_id != 0)
+			g_signal_handler_disconnect (image, handler_id);
+
+		eom_image_data_unref (image);
+
+		if (!success)
+			break;
+	}
+
+	ejob->finished = TRUE;
+}
+
+static void eom_job_copy_init (EomJobCopy *job) { /* do nothing */};
+
+static void
+eom_job_copy_dispose (GObject *object)
+{
+	EomJobCopy *job = EOM_JOB_COPY (object);
+
+	if (job->dest) {
+		g_free (job->dest);
+		job->dest = NULL;
+	}
+
+	(* G_OBJECT_CLASS (eom_job_copy_parent_class)->dispose) (object);
+}
+
+static void
+eom_job_copy_class_init (EomJobCopyClass *class)
+{
+	G_OBJECT_CLASS (class)->dispose = eom_job_copy_dispose;
+	EOM_JOB_CLASS (class)->run = eom_job_copy_run;
+}
+
+/**
+ * eom_job_copy_new:
+ * @images: (element-type EomImage) (transfer full): a #EomImage list
+ * @dest: destination path for the copy
+ *
+ * Creates a new #EomJob.
+ *
+ * Returns: A #EomJob.
+ */
+
+EomJob *
+eom_job_copy_new (GList *images, const gchar *dest)
+{
+	EomJobCopy *job;
+
+	g_assert (images != NULL && dest != NULL);
+
+	job = g_object_new (EOM_TYPE_JOB_COPY, NULL);
+
+	job->images = images;
+	job->dest = g_strdup (dest);
+
+	return EOM_JOB (job);
+}
+
+static void
+eom_job_copy_progress_callback (goffset current_num_bytes,
+				goffset total_num_bytes,
+				gpointer user_data)
+{
+	gfloat job_progress;
+	guint n_images;
+	EomJobCopy *job;
+
+	job = EOM_JOB_COPY (user_data);
+	n_images = g_list_length (job->images);
+
+	job_progress =  ((current_num_bytes / (gfloat) total_num_bytes) + job->current_pos)/n_images;
+
+	eom_job_set_progress (EOM_JOB (job), job_progress);
+}
+
+void
+eom_job_copy_run (EomJob *ejob)
+{
+	EomJobCopy *job;
+	GList *it;
+	GFile *src, *dest;
+	gchar *filename, *dest_filename;
+
+	g_return_if_fail (EOM_IS_JOB_COPY (ejob));
+
+	job = EOM_JOB_COPY (ejob);
+
+	job->current_pos = 0;
+
+	for (it = job->images; it != NULL; it = g_list_next (it), job->current_pos++) {
+		src = (GFile *) it->data;
+		filename = g_file_get_basename (src);
+		dest_filename = g_build_filename (job->dest, filename, NULL);
+		dest = g_file_new_for_path (dest_filename);
+
+		g_file_copy (src, dest,
+			     G_FILE_COPY_OVERWRITE, NULL,
+			     eom_job_copy_progress_callback, job,
+			     &ejob->error);
+		g_free (filename);
+		g_free (dest_filename);
+	}
+
+	ejob->finished = TRUE;
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/61.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/61.html new file mode 100644 index 0000000..7c829a1 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/61.html @@ -0,0 +1,2091 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye Of Mate - Image Store
+ *
+ * Copyright (C) 2006-2008 The Free Software Foundation
+ *
+ * Author: Claudio Saavedra <csaavedra@gnome.org>
+ *
+ * Based on code by: Jens Finke <jens@triq.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "eom-list-store.h"
+#include "eom-thumbnail.h"
+#include "eom-image.h"
+#include "eom-job-queue.h"
+#include "eom-jobs.h"
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+struct _EomListStorePrivate {
+	GList *monitors;          /* Monitors for the directories */
+	gint initial_image;       /* The image that should be selected firstly by the view. */
+	GdkPixbuf *busy_image;    /* Loading image icon */
+	GdkPixbuf *missing_image; /* Missing image icon */
+	GMutex mutex;            /* Mutex for saving the jobs in the model */
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (EomListStore, eom_list_store, GTK_TYPE_LIST_STORE);
+
+static void
+foreach_monitors_free (gpointer data, gpointer user_data)
+{
+	g_file_monitor_cancel (G_FILE_MONITOR (data));
+}
+
+static void
+eom_list_store_dispose (GObject *object)
+{
+	EomListStore *store = EOM_LIST_STORE (object);
+
+	g_list_foreach (store->priv->monitors,
+			foreach_monitors_free, NULL);
+
+	g_list_free (store->priv->monitors);
+
+	store->priv->monitors = NULL;
+
+	if(store->priv->busy_image != NULL) {
+		g_object_unref (store->priv->busy_image);
+		store->priv->busy_image = NULL;
+	}
+
+	if(store->priv->missing_image != NULL) {
+		g_object_unref (store->priv->missing_image);
+		store->priv->missing_image = NULL;
+	}
+
+	g_mutex_clear (&store->priv->mutex);
+
+	G_OBJECT_CLASS (eom_list_store_parent_class)->dispose (object);
+}
+
+static void
+eom_list_store_class_init (EomListStoreClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	object_class->dispose = eom_list_store_dispose;
+}
+
+/*
+   Sorting functions
+*/
+
+static gint
+eom_list_store_compare_func (GtkTreeModel *model,
+			     GtkTreeIter *a,
+			     GtkTreeIter *b,
+			     gpointer user_data)
+{
+	gint r_value;
+
+	EomImage *image_a, *image_b;
+
+	gtk_tree_model_get (model, a,
+			    EOM_LIST_STORE_EOM_IMAGE, &image_a,
+			    -1);
+
+	gtk_tree_model_get (model, b,
+			    EOM_LIST_STORE_EOM_IMAGE, &image_b,
+			    -1);
+
+	r_value = strcmp (eom_image_get_collate_key (image_a),
+			  eom_image_get_collate_key (image_b));
+
+	g_object_unref (G_OBJECT (image_a));
+	g_object_unref (G_OBJECT (image_b));
+
+	return r_value;
+}
+
+static GdkPixbuf *
+eom_list_store_get_icon (const gchar *icon_name)
+{
+	GError *error = NULL;
+	GtkIconTheme *icon_theme;
+	GdkPixbuf *pixbuf;
+
+	icon_theme = gtk_icon_theme_get_default ();
+
+	pixbuf = gtk_icon_theme_load_icon (icon_theme,
+					   icon_name,
+					   EOM_LIST_STORE_THUMB_SIZE,
+					   0,
+					   &error);
+
+	if (!pixbuf) {
+		g_warning ("Couldn't load icon: %s", error->message);
+		g_error_free (error);
+	}
+
+	return pixbuf;
+}
+
+static void
+eom_list_store_init (EomListStore *self)
+{
+	GType types[EOM_LIST_STORE_NUM_COLUMNS];
+
+	types[EOM_LIST_STORE_THUMBNAIL] = GDK_TYPE_PIXBUF;
+	types[EOM_LIST_STORE_EOM_IMAGE] = G_TYPE_OBJECT;
+	types[EOM_LIST_STORE_THUMB_SET] = G_TYPE_BOOLEAN;
+	types[EOM_LIST_STORE_EOM_JOB]   = G_TYPE_POINTER;
+
+	gtk_list_store_set_column_types (GTK_LIST_STORE (self),
+					 EOM_LIST_STORE_NUM_COLUMNS, types);
+
+	self->priv = eom_list_store_get_instance_private (self);
+
+	self->priv->monitors = NULL;
+	self->priv->initial_image = -1;
+
+	self->priv->busy_image = eom_list_store_get_icon ("image-loading");
+	self->priv->missing_image = eom_list_store_get_icon ("image-missing");
+
+	g_mutex_init (&self->priv->mutex);
+
+	gtk_tree_sortable_set_default_sort_func (GTK_TREE_SORTABLE (self),
+						 eom_list_store_compare_func,
+						 NULL, NULL);
+
+	gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (self),
+					      GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID,
+					      GTK_SORT_ASCENDING);
+}
+
+/**
+ * eom_list_store_new:
+ *
+ * Creates a new and empty #EomListStore.
+ *
+ * Returns: a newly created #EomListStore.
+ **/
+GtkListStore*
+eom_list_store_new (void)
+{
+        return g_object_new (EOM_TYPE_LIST_STORE, NULL);
+}
+
+/*
+   Searchs for a file in the store. If found and @iter_found is not NULL,
+   then sets @iter_found to a #GtkTreeIter pointing to the file.
+ */
+static gboolean
+is_file_in_list_store (EomListStore *store,
+		       const gchar *info_uri,
+		       GtkTreeIter *iter_found)
+{
+	gboolean found = FALSE;
+	EomImage *image;
+	GFile *file;
+	gchar *str;
+	GtkTreeIter iter;
+
+	if (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter)) {
+		return FALSE;
+	}
+
+	do {
+		gtk_tree_model_get (GTK_TREE_MODEL (store), &iter,
+				    EOM_LIST_STORE_EOM_IMAGE, &image,
+				    -1);
+		if (!image)
+			continue;
+
+		file = eom_image_get_file (image);
+		str = g_file_get_uri (file);
+
+		found = (strcmp (str, info_uri) == 0)? TRUE : FALSE;
+
+		g_object_unref (file);
+		g_free (str);
+		g_object_unref (G_OBJECT (image));
+
+	} while (!found &&
+		 gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter));
+
+	if (found && iter_found != NULL) {
+		*iter_found = iter;
+	}
+
+	return found;
+}
+
+static gboolean
+is_file_in_list_store_file (EomListStore *store,
+			   GFile *file,
+			   GtkTreeIter *iter_found)
+{
+	gchar *uri_str;
+	gboolean result;
+
+	uri_str = g_file_get_uri (file);
+
+	result = is_file_in_list_store (store, uri_str, iter_found);
+
+	g_free (uri_str);
+
+	return result;
+}
+
+static void
+eom_job_thumbnail_cb (EomJobThumbnail *job, gpointer data)
+{
+	EomListStore *store;
+	GtkTreeIter iter;
+	EomImage *image;
+	GdkPixbuf *thumbnail;
+	GFile *file;
+
+	g_return_if_fail (EOM_IS_LIST_STORE (data));
+
+	store = EOM_LIST_STORE (data);
+
+	file = eom_image_get_file (job->image);
+
+	if (is_file_in_list_store_file (store, file, &iter)) {
+		gtk_tree_model_get (GTK_TREE_MODEL (store), &iter,
+				    EOM_LIST_STORE_EOM_IMAGE, &image,
+				    -1);
+
+		if (job->thumbnail) {
+			eom_image_set_thumbnail (image, job->thumbnail);
+
+			/* Getting the thumbnail, in case it needed
+ 			 * transformations */
+			thumbnail = eom_image_get_thumbnail (image);
+		} else {
+			thumbnail = g_object_ref (store->priv->missing_image);
+		}
+
+		gtk_list_store_set (GTK_LIST_STORE (store), &iter,
+				    EOM_LIST_STORE_THUMBNAIL, thumbnail,
+				    EOM_LIST_STORE_THUMB_SET, TRUE,
+				    EOM_LIST_STORE_EOM_JOB, NULL,
+				    -1);
+		g_object_unref (image);
+		g_object_unref (thumbnail);
+	}
+
+	g_object_unref (file);
+}
+
+static void
+on_image_changed (EomImage *image, EomListStore *store)
+{
+	GtkTreePath *path;
+	GtkTreeIter iter;
+	gint pos;
+
+	pos = eom_list_store_get_pos_by_image (store, image);
+	path = gtk_tree_path_new_from_indices (pos, -1);
+
+	gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, path);
+	eom_list_store_thumbnail_refresh (store, &iter);
+	gtk_tree_path_free (path);
+}
+
+/**
+ * eom_list_store_remove:
+ * @store: An #EomListStore.
+ * @iter: A #GtkTreeIter.
+ *
+ * Removes the image pointed by @iter from @store.
+ **/
+static void
+eom_list_store_remove (EomListStore *store, GtkTreeIter *iter)
+{
+	EomImage *image;
+
+	gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
+			    EOM_LIST_STORE_EOM_IMAGE, &image,
+			    -1);
+
+	g_signal_handlers_disconnect_by_func (image, on_image_changed, store);
+	g_object_unref (image);
+
+	gtk_list_store_remove (GTK_LIST_STORE (store), iter);
+}
+
+/**
+ * eom_list_store_append_image:
+ * @store: An #EomListStore.
+ * @image: An #EomImage.
+ *
+ * Adds an #EomImage to @store. The thumbnail of the image is not
+ * loaded and will only be loaded if the thumbnail is made visible
+ * or eom_list_store_set_thumbnail() is called.
+ *
+ **/
+void
+eom_list_store_append_image (EomListStore *store, EomImage *image)
+{
+	GtkTreeIter iter;
+
+	g_signal_connect (image, "changed",
+ 			  G_CALLBACK (on_image_changed),
+ 			  store);
+
+	gtk_list_store_append (GTK_LIST_STORE (store), &iter);
+	gtk_list_store_set (GTK_LIST_STORE (store), &iter,
+			    EOM_LIST_STORE_EOM_IMAGE, image,
+			    EOM_LIST_STORE_THUMBNAIL, store->priv->busy_image,
+			    EOM_LIST_STORE_THUMB_SET, FALSE,
+			    -1);
+}
+
+static void
+eom_list_store_append_image_from_file (EomListStore *store,
+				       GFile *file,
+				       const gchar *caption)
+{
+	EomImage *image;
+
+	g_return_if_fail (EOM_IS_LIST_STORE (store));
+
+	image = eom_image_new_file (file, caption);
+
+	eom_list_store_append_image (store, image);
+}
+
+static void
+file_monitor_changed_cb (GFileMonitor *monitor,
+			 GFile *file,
+			 GFile *other_file,
+			 GFileMonitorEvent event,
+			 EomListStore *store)
+{
+	const char *mimetype;
+	GFileInfo *file_info;
+	GtkTreeIter iter;
+	EomImage *image;
+
+	switch (event) {
+	case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
+		file_info = g_file_query_info (file,
+					       G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE ","
+					       G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME,
+					       0, NULL, NULL);
+		if (file_info == NULL) {
+			break;
+		}
+		mimetype = g_file_info_get_content_type (file_info);
+
+		if (is_file_in_list_store_file (store, file, &iter)) {
+			if (eom_image_is_supported_mime_type (mimetype)) {
+				gtk_tree_model_get (GTK_TREE_MODEL (store), &iter,
+						    EOM_LIST_STORE_EOM_IMAGE, &image,
+						    -1);
+				eom_image_file_changed (image);
+				g_object_unref (image);
+				eom_list_store_thumbnail_refresh (store, &iter);
+			} else {
+				eom_list_store_remove (store, &iter);
+			}
+		} else {
+			if (eom_image_is_supported_mime_type (mimetype)) {
+				const gchar *caption;
+
+				caption = g_file_info_get_display_name (file_info);
+				eom_list_store_append_image_from_file (store, file, caption);
+			}
+		}
+		g_object_unref (file_info);
+		break;
+	case G_FILE_MONITOR_EVENT_DELETED:
+		if (is_file_in_list_store_file (store, file, &iter)) {
+			gtk_tree_model_get (GTK_TREE_MODEL (store), &iter,
+					    EOM_LIST_STORE_EOM_IMAGE, &image,
+					    -1);
+
+			eom_list_store_remove (store, &iter);
+		}
+		break;
+	case G_FILE_MONITOR_EVENT_CREATED:
+		if (!is_file_in_list_store_file (store, file, NULL)) {
+			file_info = g_file_query_info (file,
+						       G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE ","
+						       G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME,
+						       0, NULL, NULL);
+			if (file_info == NULL) {
+				break;
+			}
+			mimetype = g_file_info_get_content_type (file_info);
+
+			if (eom_image_is_supported_mime_type (mimetype)) {
+				const gchar *caption;
+
+				caption = g_file_info_get_display_name (file_info);
+				eom_list_store_append_image_from_file (store, file, caption);
+			}
+			g_object_unref (file_info);
+		}
+		break;
+	case G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED:
+		file_info = g_file_query_info (file,
+					       G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+					       0, NULL, NULL);
+		if (file_info == NULL) {
+			break;
+		}
+		mimetype = g_file_info_get_content_type (file_info);
+		if (is_file_in_list_store_file (store, file, &iter) &&
+		    eom_image_is_supported_mime_type (mimetype)) {
+			eom_list_store_thumbnail_refresh (store, &iter);
+		}
+		g_object_unref (file_info);
+		break;
+	default:
+		break;
+	}
+}
+
+/*
+ * Called for each file in a directory. Checks if the file is some
+ * sort of image. If so, it creates an image object and adds it to the
+ * list.
+ */
+static void
+directory_visit (GFile *directory,
+		 GFileInfo *children_info,
+		 EomListStore *store)
+{
+	GFile *child;
+	gboolean load_uri = FALSE;
+	const char *mime_type, *name;
+
+	mime_type = g_file_info_get_content_type (children_info);
+	name = g_file_info_get_name (children_info);
+
+	if (!g_str_has_prefix (name, ".")) {
+		/* We support opening any image type, so let eom to add any images in the current directory to the store */
+		if (g_content_type_is_mime_type (mime_type, "image/*") || eom_image_is_supported_mime_type (mime_type)) {
+			load_uri = TRUE;
+		}
+	}
+
+	if (load_uri) {
+		const gchar *caption;
+
+		child = g_file_get_child (directory, name);
+		caption = g_file_info_get_display_name (children_info);
+		eom_list_store_append_image_from_file (store, child, caption);
+	}
+}
+
+static void
+eom_list_store_append_directory (EomListStore *store,
+				 GFile *file,
+				 GFileType file_type)
+{
+	GFileMonitor *file_monitor;
+	GFileEnumerator *file_enumerator;
+	GFileInfo *file_info;
+
+	g_return_if_fail (file_type == G_FILE_TYPE_DIRECTORY);
+
+	file_monitor = g_file_monitor_directory (file,
+						 0, NULL, NULL);
+
+	if (file_monitor != NULL) {
+		g_signal_connect (file_monitor, "changed",
+				  G_CALLBACK (file_monitor_changed_cb), store);
+
+		/* prepend seems more efficient to me, we don't need this list
+		   to be sorted */
+		store->priv->monitors = g_list_prepend (store->priv->monitors, file_monitor);
+	}
+
+	file_enumerator = g_file_enumerate_children (file,
+						     G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE ","
+						     G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME ","<--- There is an unknown macro here somewhere. Configuration is required. If G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME is a macro then please configure it.
+						     G_FILE_ATTRIBUTE_STANDARD_NAME,
+						     0, NULL, NULL);
+	file_info = g_file_enumerator_next_file (file_enumerator, NULL, NULL);
+
+	while (file_info != NULL)
+	{
+		directory_visit (file, file_info, store);
+		g_object_unref (file_info);
+		file_info = g_file_enumerator_next_file (file_enumerator, NULL, NULL);
+	}
+	g_object_unref (file_enumerator);
+}
+
+/**
+ * eom_list_store_add_files:
+ * @store: An #EomListStore.
+ * @file_list: (element-type GFile): A %NULL-terminated list of #GFile's.
+ *
+ * Adds a list of #GFile's to @store. The given list
+ * must be %NULL-terminated.
+ *
+ * If any of the #GFile's in @file_list is a directory, all the images
+ * in that directory will be added to @store. If the list of files contains
+ * only one file and this is a regular file, then all the images in the same
+ * directory will be added as well to @store.
+ *
+ **/
+void
+eom_list_store_add_files (EomListStore *store, GList *file_list)
+{
+	GList *it;
+	GFileInfo *file_info;
+	GFileType file_type;
+	GFile *initial_file = NULL;
+	GtkTreeIter iter;
+
+	if (file_list == NULL) {
+		return;
+	}
+
+	gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store),
+					      GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID,
+					      GTK_SORT_ASCENDING);
+
+	for (it = file_list; it != NULL; it = it->next) {
+		GFile *file = (GFile *) it->data;
+		gchar *caption = NULL;
+
+		file_info = g_file_query_info (file,
+					       G_FILE_ATTRIBUTE_STANDARD_TYPE","
+					       G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE","
+					       G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME,
+					       0, NULL, NULL);
+		if (file_info == NULL) {
+			continue;
+		}
+
+		caption = g_strdup (g_file_info_get_display_name (file_info));
+		file_type = g_file_info_get_file_type (file_info);
+
+		/* Workaround for gvfs backends that don't set the GFileType. */
+		if (G_UNLIKELY (file_type == G_FILE_TYPE_UNKNOWN)) {
+			const gchar *ctype;
+
+			ctype = g_file_info_get_content_type (file_info);
+
+			/* If the content type is supported adjust file_type */
+			if (eom_image_is_supported_mime_type (ctype))
+				file_type = G_FILE_TYPE_REGULAR;
+		}
+
+		g_object_unref (file_info);
+
+		if (file_type == G_FILE_TYPE_DIRECTORY) {
+			eom_list_store_append_directory (store, file, file_type);
+		} else if (file_type == G_FILE_TYPE_REGULAR &&
+			   g_list_length (file_list) == 1) {
+
+			initial_file = g_file_dup (file);
+
+			file = g_file_get_parent (file);
+			file_info = g_file_query_info (file,
+						       G_FILE_ATTRIBUTE_STANDARD_TYPE,
+						       0, NULL, NULL);
+
+			/* If we can't get a file_info,
+			   file_type will stay as G_FILE_TYPE_REGULAR */
+			if (file_info != NULL) {
+				file_type = g_file_info_get_file_type (file_info);
+				g_object_unref (file_info);
+			}
+
+			if (file_type == G_FILE_TYPE_DIRECTORY) {
+				eom_list_store_append_directory (store, file, file_type);
+
+				if (!is_file_in_list_store_file (store,
+								 initial_file,
+								 &iter)) {
+					eom_list_store_append_image_from_file (store, initial_file, caption);
+				}
+			} else {
+				eom_list_store_append_image_from_file (store, initial_file, caption);
+			}
+			g_object_unref (file);
+		} else if (file_type == G_FILE_TYPE_REGULAR &&
+			   g_list_length (file_list) > 1) {
+			eom_list_store_append_image_from_file (store, file, caption);
+		}
+
+		g_free (caption);
+	}
+
+	gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store),
+					      GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID,
+					      GTK_SORT_ASCENDING);
+
+	if (initial_file &&
+	    is_file_in_list_store_file (store, initial_file, &iter)) {
+		store->priv->initial_image = eom_list_store_get_pos_by_iter (store, &iter);
+		g_object_unref (initial_file);
+	} else {
+		store->priv->initial_image = 0;
+	}
+}
+
+/**
+ * eom_list_store_remove_image:
+ * @store: An #EomListStore.
+ * @image: An #EomImage.
+ *
+ * Removes @image from @store.
+ **/
+void
+eom_list_store_remove_image (EomListStore *store, EomImage *image)
+{
+	GtkTreeIter iter;
+	GFile *file;
+
+	g_return_if_fail (EOM_IS_LIST_STORE (store));
+	g_return_if_fail (EOM_IS_IMAGE (image));
+
+	file = eom_image_get_file (image);
+
+	if (is_file_in_list_store_file (store, file, &iter)) {
+		eom_list_store_remove (store, &iter);
+	}
+	g_object_unref (file);
+}
+
+/**
+ * eom_list_store_new_from_glist:
+ * @list: (element-type EomImage): a %NULL-terminated list of #EomImage's.
+ *
+ * Creates a new #EomListStore from a list of #EomImage's.
+ * The given list must be %NULL-terminated.
+ *
+ * Returns: a new #EomListStore.
+ **/
+GtkListStore *
+eom_list_store_new_from_glist (GList *list)
+{
+	GList *it;
+
+	GtkListStore *store = eom_list_store_new ();
+
+	for (it = list; it != NULL; it = it->next) {
+		eom_list_store_append_image (EOM_LIST_STORE (store),
+					     EOM_IMAGE (it->data));
+	}
+
+	return store;
+}
+
+/**
+ * eom_list_store_get_pos_by_image:
+ * @store: An #EomListStore.
+ * @image: An #EomImage.
+ *
+ * Gets the position where @image is stored in @store. If @image
+ * is not stored in @store, -1 is returned.
+ *
+ * Returns: the position of @image in @store or -1 if not found.
+ **/
+gint
+eom_list_store_get_pos_by_image (EomListStore *store, EomImage *image)
+{
+	GtkTreeIter iter;
+	gint pos = -1;
+	GFile *file;
+
+	g_return_val_if_fail (EOM_IS_LIST_STORE (store), -1);
+	g_return_val_if_fail (EOM_IS_IMAGE (image), -1);
+
+	file = eom_image_get_file (image);
+
+	if (is_file_in_list_store_file (store, file, &iter)) {
+		pos = eom_list_store_get_pos_by_iter (store, &iter);
+	}
+
+	g_object_unref (file);
+	return pos;
+}
+
+/**
+ * eom_list_store_get_image_by_pos:
+ * @store: An #EomListStore.
+ * @pos: the position of the required #EomImage.
+ *
+ * Gets the #EomImage in the position @pos of @store. If there is
+ * no image at position @pos, %NULL is returned.
+ *
+ * Returns: (transfer full): the #EomImage in position @pos or %NULL.
+ *
+ **/
+EomImage *
+eom_list_store_get_image_by_pos (EomListStore *store, gint pos)
+{
+	EomImage *image = NULL;
+	GtkTreeIter iter;
+
+	g_return_val_if_fail (EOM_IS_LIST_STORE (store), NULL);
+
+	if (gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (store), &iter, NULL, pos)) {
+		gtk_tree_model_get (GTK_TREE_MODEL (store), &iter,
+				    EOM_LIST_STORE_EOM_IMAGE, &image,
+				    -1);
+	}
+
+	return image;
+}
+
+/**
+ * eom_list_store_get_pos_by_iter:
+ * @store: An #EomListStore.
+ * @iter: A #GtkTreeIter pointing to an image in @store.
+ *
+ * Gets the position of the image pointed by @iter.
+ *
+ * Returns: The position of the image pointed by @iter.
+ **/
+gint
+eom_list_store_get_pos_by_iter (EomListStore *store,
+				GtkTreeIter *iter)
+{
+	gint *indices;
+	GtkTreePath *path;
+	gint pos;
+
+	path = gtk_tree_model_get_path (GTK_TREE_MODEL (store), iter);
+	indices = gtk_tree_path_get_indices (path);
+	pos = indices [0];
+	gtk_tree_path_free (path);
+
+	return pos;
+}
+
+/**
+ * eom_list_store_length:
+ * @store: An #EomListStore.
+ *
+ * Returns the number of images in the store.
+ *
+ * Returns: The number of images in @store.
+ **/
+gint
+eom_list_store_length (EomListStore *store)
+{
+	g_return_val_if_fail (EOM_IS_LIST_STORE (store), -1);
+
+	return gtk_tree_model_iter_n_children (GTK_TREE_MODEL (store), NULL);
+}
+
+/**
+ * eom_list_store_get_initial_pos:
+ * @store: An #EomListStore.
+ *
+ * Gets the position of the #EomImage that should be loaded first.
+ * If not set, it returns -1.
+ *
+ * Returns: the position of the image to be loaded first or -1.
+ *
+ **/
+gint
+eom_list_store_get_initial_pos (EomListStore *store)
+{
+	g_return_val_if_fail (EOM_IS_LIST_STORE (store), -1);
+
+	return store->priv->initial_image;
+}
+
+static void
+eom_list_store_remove_thumbnail_job (EomListStore *store,
+				     GtkTreeIter *iter)
+{
+	EomJob *job;
+
+	gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
+			    EOM_LIST_STORE_EOM_JOB, &job,
+			    -1);
+
+	if (job != NULL) {
+		g_mutex_lock (&store->priv->mutex);
+		eom_job_queue_remove_job (job);
+		gtk_list_store_set (GTK_LIST_STORE (store), iter,
+				    EOM_LIST_STORE_EOM_JOB, NULL,
+				    -1);
+		g_mutex_unlock (&store->priv->mutex);
+	}
+
+}
+
+static void
+eom_list_store_add_thumbnail_job (EomListStore *store, GtkTreeIter *iter)
+{
+	EomImage *image;
+	EomJob *job;
+
+	gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
+			    EOM_LIST_STORE_EOM_IMAGE, &image,
+			    EOM_LIST_STORE_EOM_JOB, &job,
+			    -1);
+
+	if (job != NULL) {
+		g_object_unref (image);
+		return;
+	}
+
+	job = eom_job_thumbnail_new (image);
+
+	g_signal_connect (job,
+			  "finished",
+			  G_CALLBACK (eom_job_thumbnail_cb),
+			  store);
+
+	g_mutex_lock (&store->priv->mutex);
+	gtk_list_store_set (GTK_LIST_STORE (store), iter,
+			    EOM_LIST_STORE_EOM_JOB, job,
+			    -1);
+	eom_job_queue_add_job (job);
+	g_mutex_unlock (&store->priv->mutex);
+	g_object_unref (job);
+	g_object_unref (image);
+}
+
+/**
+ * eom_list_store_thumbnail_set:
+ * @store: An #EomListStore.
+ * @iter: A #GtkTreeIter pointing to an image in @store.
+ *
+ * Sets the thumbnail for the image pointed by @iter.
+ *
+ **/
+void
+eom_list_store_thumbnail_set (EomListStore *store,
+			      GtkTreeIter *iter)
+{
+	gboolean thumb_set = FALSE;
+
+	gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
+			    EOM_LIST_STORE_THUMB_SET, &thumb_set,
+			    -1);
+
+	if (thumb_set) {
+		return;
+	}
+
+	eom_list_store_add_thumbnail_job (store, iter);
+}
+
+/**
+ * eom_list_store_thumbnail_unset:
+ * @store: An #EomListStore.
+ * @iter: A #GtkTreeIter pointing to an image in @store.
+ *
+ * Unsets the thumbnail for the image pointed by @iter, changing
+ * it to a "busy" icon.
+ *
+ **/
+void
+eom_list_store_thumbnail_unset (EomListStore *store,
+				GtkTreeIter *iter)
+{
+	EomImage *image;
+
+	eom_list_store_remove_thumbnail_job (store, iter);
+
+	gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
+			    EOM_LIST_STORE_EOM_IMAGE, &image,
+			    -1);
+	eom_image_set_thumbnail (image, NULL);
+	g_object_unref (image);
+
+	gtk_list_store_set (GTK_LIST_STORE (store), iter,
+			    EOM_LIST_STORE_THUMBNAIL, store->priv->busy_image,
+			    EOM_LIST_STORE_THUMB_SET, FALSE,
+			    -1);
+}
+
+/**
+ * eom_list_store_thumbnail_refresh:
+ * @store: An #EomListStore.
+ * @iter: A #GtkTreeIter pointing to an image in @store.
+ *
+ * Refreshes the thumbnail for the image pointed by @iter.
+ *
+ **/
+void
+eom_list_store_thumbnail_refresh (EomListStore *store,
+				  GtkTreeIter *iter)
+{
+	eom_list_store_remove_thumbnail_job (store, iter);
+	eom_list_store_add_thumbnail_job (store, iter);
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/62.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/62.html new file mode 100644 index 0000000..3dcd5f0 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/62.html @@ -0,0 +1,435 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/* This file is generated by glib-genmarshal, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#ifdef G_ENABLE_DEBUG
+#define g_marshal_value_peek_boolean(v)  g_value_get_boolean (v)
+#define g_marshal_value_peek_char(v)     g_value_get_schar (v)
+#define g_marshal_value_peek_uchar(v)    g_value_get_uchar (v)
+#define g_marshal_value_peek_int(v)      g_value_get_int (v)
+#define g_marshal_value_peek_uint(v)     g_value_get_uint (v)
+#define g_marshal_value_peek_long(v)     g_value_get_long (v)
+#define g_marshal_value_peek_ulong(v)    g_value_get_ulong (v)
+#define g_marshal_value_peek_int64(v)    g_value_get_int64 (v)
+#define g_marshal_value_peek_uint64(v)   g_value_get_uint64 (v)
+#define g_marshal_value_peek_enum(v)     g_value_get_enum (v)
+#define g_marshal_value_peek_flags(v)    g_value_get_flags (v)
+#define g_marshal_value_peek_float(v)    g_value_get_float (v)
+#define g_marshal_value_peek_double(v)   g_value_get_double (v)
+#define g_marshal_value_peek_string(v)   (char*) g_value_get_string (v)
+#define g_marshal_value_peek_param(v)    g_value_get_param (v)
+#define g_marshal_value_peek_boxed(v)    g_value_get_boxed (v)
+#define g_marshal_value_peek_pointer(v)  g_value_get_pointer (v)
+#define g_marshal_value_peek_object(v)   g_value_get_object (v)
+#define g_marshal_value_peek_variant(v)  g_value_get_variant (v)
+#else /* !G_ENABLE_DEBUG */
+/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
+ *          Do not access GValues directly in your code. Instead, use the
+ *          g_value_get_*() functions
+ */
+#define g_marshal_value_peek_boolean(v)  (v)->data[0].v_int
+#define g_marshal_value_peek_char(v)     (v)->data[0].v_int
+#define g_marshal_value_peek_uchar(v)    (v)->data[0].v_uint
+#define g_marshal_value_peek_int(v)      (v)->data[0].v_int
+#define g_marshal_value_peek_uint(v)     (v)->data[0].v_uint
+#define g_marshal_value_peek_long(v)     (v)->data[0].v_long
+#define g_marshal_value_peek_ulong(v)    (v)->data[0].v_ulong
+#define g_marshal_value_peek_int64(v)    (v)->data[0].v_int64
+#define g_marshal_value_peek_uint64(v)   (v)->data[0].v_uint64
+#define g_marshal_value_peek_enum(v)     (v)->data[0].v_long
+#define g_marshal_value_peek_flags(v)    (v)->data[0].v_ulong
+#define g_marshal_value_peek_float(v)    (v)->data[0].v_float
+#define g_marshal_value_peek_double(v)   (v)->data[0].v_double
+#define g_marshal_value_peek_string(v)   (v)->data[0].v_pointer
+#define g_marshal_value_peek_param(v)    (v)->data[0].v_pointer
+#define g_marshal_value_peek_boxed(v)    (v)->data[0].v_pointer
+#define g_marshal_value_peek_pointer(v)  (v)->data[0].v_pointer
+#define g_marshal_value_peek_object(v)   (v)->data[0].v_pointer
+#define g_marshal_value_peek_variant(v)  (v)->data[0].v_pointer
+#endif /* !G_ENABLE_DEBUG */
+
+/* VOID:INT,INT (eom-marshal.list:1) */
+/* Prototype for -Wmissing-prototypes */
+G_BEGIN_DECLS
+extern
+void eom_marshal_VOID__INT_INT (GClosure     *closure,
+                                GValue       *return_value,
+                                guint         n_param_values,
+                                const GValue *param_values,
+                                gpointer      invocation_hint,
+                                gpointer      marshal_data);
+G_END_DECLS
+void
+eom_marshal_VOID__INT_INT (GClosure     *closure,
+                           GValue       *return_value G_GNUC_UNUSED,
+                           guint         n_param_values,
+                           const GValue *param_values,
+                           gpointer      invocation_hint G_GNUC_UNUSED,
+                           gpointer      marshal_data)
+{
+  typedef void (*GMarshalFunc_VOID__INT_INT) (gpointer data1,
+                                              gint arg1,
+                                              gint arg2,
+                                              gpointer data2);
+  GCClosure *cc = (GCClosure *) closure;
+  gpointer data1, data2;
+  GMarshalFunc_VOID__INT_INT callback;
+
+  g_return_if_fail (n_param_values == 3);
+
+  if (G_CCLOSURE_SWAP_DATA (closure))
+    {
+      data1 = closure->data;
+      data2 = g_value_peek_pointer (param_values + 0);
+    }
+  else
+    {
+      data1 = g_value_peek_pointer (param_values + 0);
+      data2 = closure->data;
+    }
+  callback = (GMarshalFunc_VOID__INT_INT) (marshal_data ? marshal_data : cc->callback);
+
+  callback (data1,
+            g_marshal_value_peek_int (param_values + 1),
+            g_marshal_value_peek_int (param_values + 2),
+            data2);
+}
+
+/* VOID:DOUBLE (eom-marshal.list:2) */
+#define eom_marshal_VOID__DOUBLE	g_cclosure_marshal_VOID__DOUBLE
+
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/63.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/63.html new file mode 100644 index 0000000..50dac62 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/63.html @@ -0,0 +1,389 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/* Eye Of Mate - EOM Image Exif Details
+ *
+ * Copyright (C) 2006 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __EOM_METADATA_DETAILS__
+#define __EOM_METADATA_DETAILS__
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#if HAVE_EXIF
+#include <libexif/exif-data.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+#if HAVE_EXEMPI
+#include <exempi/xmp.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+G_BEGIN_DECLS
+
+typedef struct _EomMetadataDetails EomMetadataDetails;
+typedef struct _EomMetadataDetailsClass EomMetadataDetailsClass;
+typedef struct _EomMetadataDetailsPrivate EomMetadataDetailsPrivate;
+
+#define EOM_TYPE_METADATA_DETAILS            (eom_metadata_details_get_type ())
+#define EOM_METADATA_DETAILS(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), EOM_TYPE_METADATA_DETAILS, EomMetadataDetails))
+#define EOM_METADATA_DETAILS_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), EOM_TYPE_METADATA_DETAILS, EomMetadataDetailsClass))
+#define EOM_IS_METADATA_DETAILS(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EOM_TYPE_METADATA_DETAILS))
+#define EOM_IS_METADATA_DETAILS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EOM_TYPE_METADATA_DETAILS))
+#define EOM_METADATA_DETAILS_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), EOM_TYPE_METADATA_DETAILS, EomMetadataDetailsClass))
+
+struct _EomMetadataDetails {
+        GtkTreeView parent;
+
+	EomMetadataDetailsPrivate *priv;
+};
+
+struct _EomMetadataDetailsClass {
+	GtkTreeViewClass parent_class;
+};
+
+G_GNUC_INTERNAL
+GType               eom_metadata_details_get_type    (void) G_GNUC_CONST;
+
+G_GNUC_INTERNAL
+GtkWidget          *eom_metadata_details_new         (void);
+
+#if HAVE_EXIF
+G_GNUC_INTERNAL
+void                eom_metadata_details_update      (EomMetadataDetails *details,
+                                                      ExifData       *data);
+#endif
+#if HAVE_EXEMPI
+G_GNUC_INTERNAL
+void                eom_metadata_details_xmp_update  (EomMetadataDetails *details,
+                                                      XmpPtr          xmp_data);
+#endif
+
+G_END_DECLS
+
+#endif /* __EOM_METADATA_DETAILS__ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/64.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/64.html new file mode 100644 index 0000000..6201d41 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/64.html @@ -0,0 +1,1603 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye Of Mate - EOM Metadata Details
+ *
+ * Copyright (C) 2006 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include "eom-metadata-details.h"
+#include "eom-util.h"
+
+#if HAVE_EXIF
+#include <libexif/exif-entry.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libexif/exif-utils.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+#if HAVE_EXEMPI
+#include <exempi/xmp.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <exempi/xmpconsts.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <math.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+typedef enum {
+    EXIF_CATEGORY_CAMERA,
+    EXIF_CATEGORY_IMAGE_DATA,
+    EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS,
+    EXIF_CATEGORY_GPS_DATA,
+    EXIF_CATEGORY_MAKER_NOTE,
+    EXIF_CATEGORY_OTHER,
+#ifdef HAVE_EXEMPI
+    XMP_CATEGORY_EXIF,
+    XMP_CATEGORY_IPTC,
+    XMP_CATEGORY_RIGHTS,
+    XMP_CATEGORY_OTHER
+#endif
+} MetadataCategory;
+
+typedef struct {
+    char *label;
+    char *path;
+} ExifCategoryInfo;
+
+static ExifCategoryInfo exif_categories[] = {
+    { N_("Camera"),                  "0" },
+    { N_("Image Data"),              "1" },
+    { N_("Image Taking Conditions"), "2" },
+    { N_("GPS Data"),                "3" },
+    { N_("Maker Note"),              "4" },
+    { N_("Other"),                   "5" },
+#ifdef HAVE_EXEMPI
+    { N_("XMP Exif"),                "6" },
+    { N_("XMP IPTC"),                "7" },
+    { N_("XMP Rights Management"),   "8" },
+    { N_("XMP Other"),               "9" },
+#endif
+    { NULL, NULL }
+};
+
+typedef struct {
+    int id;
+    MetadataCategory category;
+} ExifTagCategory;
+
+#ifdef HAVE_EXIF
+static ExifTagCategory exif_tag_category_map[] = {
+    { EXIF_TAG_INTEROPERABILITY_INDEX,       EXIF_CATEGORY_CAMERA},
+    { EXIF_TAG_INTEROPERABILITY_VERSION,     EXIF_CATEGORY_CAMERA},
+    { EXIF_TAG_IMAGE_WIDTH,                  EXIF_CATEGORY_IMAGE_DATA},
+    { EXIF_TAG_IMAGE_LENGTH,                 EXIF_CATEGORY_IMAGE_DATA},
+    { EXIF_TAG_BITS_PER_SAMPLE,              EXIF_CATEGORY_CAMERA },
+    { EXIF_TAG_COMPRESSION,                  EXIF_CATEGORY_IMAGE_DATA},
+    { EXIF_TAG_PHOTOMETRIC_INTERPRETATION,   EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_FILL_ORDER,                   EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_DOCUMENT_NAME,                EXIF_CATEGORY_IMAGE_DATA},
+    { EXIF_TAG_IMAGE_DESCRIPTION,            EXIF_CATEGORY_IMAGE_DATA},
+    { EXIF_TAG_MAKE,                         EXIF_CATEGORY_CAMERA},
+    { EXIF_TAG_MODEL,                        EXIF_CATEGORY_CAMERA},
+    { EXIF_TAG_STRIP_OFFSETS,                EXIF_CATEGORY_IMAGE_DATA},
+    { EXIF_TAG_ORIENTATION,                  EXIF_CATEGORY_IMAGE_DATA},
+    { EXIF_TAG_SAMPLES_PER_PIXEL,            EXIF_CATEGORY_CAMERA},
+    { EXIF_TAG_ROWS_PER_STRIP,               EXIF_CATEGORY_CAMERA},
+    { EXIF_TAG_STRIP_BYTE_COUNTS,            EXIF_CATEGORY_CAMERA},
+    { EXIF_TAG_X_RESOLUTION,                 EXIF_CATEGORY_CAMERA},
+    { EXIF_TAG_Y_RESOLUTION,                 EXIF_CATEGORY_CAMERA},
+    { EXIF_TAG_PLANAR_CONFIGURATION,         EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_RESOLUTION_UNIT,              EXIF_CATEGORY_CAMERA},
+    { EXIF_TAG_TRANSFER_FUNCTION,            EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_SOFTWARE,                     EXIF_CATEGORY_CAMERA},
+    { EXIF_TAG_DATE_TIME,                    EXIF_CATEGORY_IMAGE_DATA},
+    { EXIF_TAG_ARTIST,                       EXIF_CATEGORY_IMAGE_DATA},
+    { EXIF_TAG_WHITE_POINT,                  EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_PRIMARY_CHROMATICITIES,       EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_TRANSFER_RANGE,               EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_JPEG_PROC,                    EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_JPEG_INTERCHANGE_FORMAT,      EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH, },
+    { EXIF_TAG_YCBCR_COEFFICIENTS,           EXIF_CATEGORY_IMAGE_DATA},
+    { EXIF_TAG_YCBCR_SUB_SAMPLING,           EXIF_CATEGORY_IMAGE_DATA},
+    { EXIF_TAG_YCBCR_POSITIONING,            EXIF_CATEGORY_IMAGE_DATA},
+    { EXIF_TAG_REFERENCE_BLACK_WHITE,        EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_RELATED_IMAGE_FILE_FORMAT,    EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_RELATED_IMAGE_WIDTH,          EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_RELATED_IMAGE_LENGTH,         EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_CFA_REPEAT_PATTERN_DIM,       EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_CFA_PATTERN,                  EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_BATTERY_LEVEL,                EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_COPYRIGHT,                    EXIF_CATEGORY_IMAGE_DATA},
+    { EXIF_TAG_EXPOSURE_TIME,                EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_FNUMBER,                      EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_IPTC_NAA,                     EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_EXIF_IFD_POINTER,             EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_INTER_COLOR_PROFILE,          EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_EXPOSURE_PROGRAM,             EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_SPECTRAL_SENSITIVITY,         EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_GPS_INFO_IFD_POINTER,         EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_ISO_SPEED_RATINGS,            EXIF_CATEGORY_IMAGE_DATA},
+    { EXIF_TAG_OECF,                         EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_EXIF_VERSION,                 EXIF_CATEGORY_CAMERA},
+    { EXIF_TAG_DATE_TIME_ORIGINAL,           EXIF_CATEGORY_IMAGE_DATA},
+    { EXIF_TAG_DATE_TIME_DIGITIZED,          EXIF_CATEGORY_IMAGE_DATA},
+    { EXIF_TAG_COMPONENTS_CONFIGURATION,     EXIF_CATEGORY_CAMERA},
+    { EXIF_TAG_COMPRESSED_BITS_PER_PIXEL,    EXIF_CATEGORY_CAMERA},
+    { EXIF_TAG_SHUTTER_SPEED_VALUE,          EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_APERTURE_VALUE,               EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_BRIGHTNESS_VALUE,             EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_EXPOSURE_BIAS_VALUE,          EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_MAX_APERTURE_VALUE,           EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_SUBJECT_DISTANCE,             EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_METERING_MODE,                EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_LIGHT_SOURCE,                 EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_FLASH,                        EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_FOCAL_LENGTH,                 EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_SUBJECT_AREA,                 EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_MAKER_NOTE,                   EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_USER_COMMENT,                 EXIF_CATEGORY_IMAGE_DATA},
+    { EXIF_TAG_SUBSEC_TIME,                  EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_SUB_SEC_TIME_ORIGINAL,        EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_SUB_SEC_TIME_DIGITIZED,       EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_FLASH_PIX_VERSION,            EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_COLOR_SPACE,                  EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_PIXEL_X_DIMENSION,            EXIF_CATEGORY_IMAGE_DATA},
+    { EXIF_TAG_PIXEL_Y_DIMENSION,            EXIF_CATEGORY_IMAGE_DATA},
+    { EXIF_TAG_RELATED_SOUND_FILE,           EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_INTEROPERABILITY_IFD_POINTER, EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_FLASH_ENERGY,                 EXIF_CATEGORY_OTHER },
+    { EXIF_TAG_SPATIAL_FREQUENCY_RESPONSE,   EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_FOCAL_PLANE_X_RESOLUTION,     EXIF_CATEGORY_CAMERA},
+    { EXIF_TAG_FOCAL_PLANE_Y_RESOLUTION,     EXIF_CATEGORY_CAMERA},
+    { EXIF_TAG_FOCAL_PLANE_RESOLUTION_UNIT,  EXIF_CATEGORY_CAMERA},
+    { EXIF_TAG_SUBJECT_LOCATION,             EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_EXPOSURE_INDEX,               EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_SENSING_METHOD,               EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_FILE_SOURCE,                  EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_SCENE_TYPE,                   EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_NEW_CFA_PATTERN,              EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_CUSTOM_RENDERED,              EXIF_CATEGORY_OTHER},
+    { EXIF_TAG_EXPOSURE_MODE,                EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_WHITE_BALANCE,                EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_DIGITAL_ZOOM_RATIO,           EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_FOCAL_LENGTH_IN_35MM_FILM,    EXIF_CATEGORY_CAMERA},
+    { EXIF_TAG_SCENE_CAPTURE_TYPE,           EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_GAIN_CONTROL,                 EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_CONTRAST,                     EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_SATURATION,                   EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_SHARPNESS,                    EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_DEVICE_SETTING_DESCRIPTION,   EXIF_CATEGORY_CAMERA},
+    { EXIF_TAG_SUBJECT_DISTANCE_RANGE,       EXIF_CATEGORY_IMAGE_TAKING_CONDITIONS},
+    { EXIF_TAG_IMAGE_UNIQUE_ID,              EXIF_CATEGORY_IMAGE_DATA},
+    { -1, -1 }
+};
+#endif
+
+#define MODEL_COLUMN_ATTRIBUTE 0
+#define MODEL_COLUMN_VALUE     1
+
+struct _EomMetadataDetailsPrivate {
+    GtkTreeModel *model;
+
+    GHashTable   *id_path_hash;
+    GHashTable   *id_path_hash_mnote;
+};
+
+static char*  set_row_data (GtkTreeStore *store, char *path, char *parent, const char *attribute, const char *value);
+
+static void eom_metadata_details_reset (EomMetadataDetails *exif_details);
+
+G_DEFINE_TYPE_WITH_PRIVATE (EomMetadataDetails, eom_metadata_details, GTK_TYPE_TREE_VIEW)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
+
+static void
+eom_metadata_details_dispose (GObject *object)
+{
+    EomMetadataDetailsPrivate *priv;
+
+    priv = EOM_METADATA_DETAILS (object)->priv;
+
+    if (priv->model) {
+        g_object_unref (priv->model);
+        priv->model = NULL;
+    }
+
+    if (priv->id_path_hash) {
+        g_hash_table_destroy (priv->id_path_hash);
+        priv->id_path_hash = NULL;
+    }
+
+    if (priv->id_path_hash_mnote) {
+        g_hash_table_destroy (priv->id_path_hash_mnote);
+        priv->id_path_hash_mnote = NULL;
+    }
+    G_OBJECT_CLASS (eom_metadata_details_parent_class)->dispose (object);
+}
+
+static void
+eom_metadata_details_init (EomMetadataDetails *details)
+{
+    EomMetadataDetailsPrivate *priv;
+    GtkTreeViewColumn *column;
+    GtkCellRenderer *cell;
+
+    details->priv = eom_metadata_details_get_instance_private (details);
+
+    priv = details->priv;
+
+    priv->model = GTK_TREE_MODEL (gtk_tree_store_new (2, G_TYPE_STRING, G_TYPE_STRING));
+    priv->id_path_hash = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free);
+    priv->id_path_hash_mnote = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free);
+
+    /* Tag name column */
+    cell = gtk_cell_renderer_text_new ();
+    column = gtk_tree_view_column_new_with_attributes (_("Tag"), cell,
+                                                       "text", MODEL_COLUMN_ATTRIBUTE,
+                                                       NULL);
+    gtk_tree_view_append_column (GTK_TREE_VIEW (details), column);
+
+    /* Value column */
+    cell = gtk_cell_renderer_text_new ();
+    g_object_set (cell,
+                  "editable", TRUE,
+                  NULL);
+    column = gtk_tree_view_column_new_with_attributes (_("Value"), cell,
+                                                       "text", MODEL_COLUMN_VALUE,
+                                                       NULL);
+    gtk_tree_view_append_column (GTK_TREE_VIEW (details), column);
+
+    eom_metadata_details_reset (details);
+
+    gtk_tree_view_set_model (GTK_TREE_VIEW (details),
+                             GTK_TREE_MODEL (priv->model));
+}
+
+static void
+eom_metadata_details_class_init (EomMetadataDetailsClass *klass)
+{
+    GObjectClass *object_class = (GObjectClass*) klass;
+
+    object_class->dispose = eom_metadata_details_dispose;
+}
+
+#ifdef HAVE_EXIF
+static MetadataCategory
+get_exif_category (ExifEntry *entry)
+{
+    MetadataCategory cat = EXIF_CATEGORY_OTHER;
+    int i;
+
+    /* Some GPS tag IDs overlap with other ones, so check the IFD */
+    if (exif_entry_get_ifd (entry) == EXIF_IFD_GPS) {
+        return EXIF_CATEGORY_GPS_DATA;
+    }
+
+    for (i = 0; exif_tag_category_map [i].id != -1; i++) {
+        if (exif_tag_category_map[i].id == (int) entry->tag) {
+            cat = exif_tag_category_map[i].category;
+            break;
+        }
+    }
+
+    return cat;
+}
+#endif
+
+static char*
+set_row_data (GtkTreeStore *store, char *path, char *parent, const char *attribute, const char *value)
+{
+    GtkTreeIter iter;
+    gchar *utf_attribute = NULL;
+    gchar *utf_value = NULL;
+    gboolean iter_valid = FALSE;
+
+    if (!attribute) return NULL;
+
+    if (path != NULL) {
+        iter_valid = gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (store), &iter, path);
+    }
+
+    if (!iter_valid) {
+        GtkTreePath *tree_path;
+        GtkTreeIter parent_iter;
+        gboolean parent_valid = FALSE;
+
+        if (parent != NULL) {
+            parent_valid = gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (store),
+                                                                &parent_iter,
+                                                                parent);
+        }
+
+        gtk_tree_store_append (store, &iter, parent_valid ? &parent_iter : NULL);
+
+        if (path == NULL) {
+            tree_path = gtk_tree_model_get_path (GTK_TREE_MODEL (store), &iter);
+
+            if (tree_path != NULL) {
+                path = gtk_tree_path_to_string (tree_path);
+                gtk_tree_path_free (tree_path);
+            }
+        }
+    }
+
+    utf_attribute = eom_util_make_valid_utf8 (attribute);
+
+    gtk_tree_store_set (store, &iter, MODEL_COLUMN_ATTRIBUTE, utf_attribute, -1);
+    g_free (utf_attribute);
+
+    if (value != NULL) {
+        utf_value = eom_util_make_valid_utf8 (value);
+        gtk_tree_store_set (store, &iter, MODEL_COLUMN_VALUE, utf_value, -1);
+        g_free (utf_value);
+    }
+
+    return path;
+}
+
+#ifdef HAVE_EXIF
+
+static const char *
+eom_exif_entry_get_value (ExifEntry    *e,
+                          char         *buf,
+                          guint         n_buf)
+{
+    ExifByteOrder bo;
+
+    /* For now we only want to reformat some GPS values */
+    if (G_LIKELY (exif_entry_get_ifd (e) != EXIF_IFD_GPS))
+        return exif_entry_get_value (e, buf, n_buf);
+
+    bo = exif_data_get_byte_order (e->parent->parent);
+
+    /* Cast to number to avoid warnings about values not in enumeration */
+    switch ((guint16) e->tag) {
+        case EXIF_TAG_GPS_LATITUDE:
+        case EXIF_TAG_GPS_LONGITUDE:
+        {
+            gsize rational_size;
+            ExifRational r;
+            gfloat h = 0., m = 0., s = 0.;
+
+            rational_size = exif_format_get_size (EXIF_FORMAT_RATIONAL);
+            if (G_UNLIKELY (e->components != 3 ||
+                e->format != EXIF_FORMAT_RATIONAL))
+                return exif_entry_get_value (e, buf, n_buf);
+
+            r = exif_get_rational (e->data, bo);
+            if (r.denominator != 0)
+                h = (gfloat)r.numerator / r.denominator;
+
+            r = exif_get_rational (e->data + rational_size, bo);
+			if (r.denominator != 0) {
+				if (r.numerator != 0) {
+					m = (gfloat)r.numerator /
+					    (gfloat)r.denominator;
+				} else {
+					double integ;
+
+					m = (gfloat)(modf (h, &integ) * 60.0);
+					h = (gfloat) integ;
+				}
+			}
+
+            r = exif_get_rational (e->data + (2 * rational_size),
+                           bo);
+			if (r.denominator != 0) {
+				if (r.numerator != 0) {
+					s = (gfloat)r.numerator /
+					    (gfloat)r.denominator;
+				} else {
+					double integ;
+
+					s = (gfloat)(modf (m, &integ) * 60.0);
+					m = (gfloat) integ;
+				}
+			}
+
+			if (s != 0.0) {
+                g_snprintf (buf, n_buf,
+                        "%.0f° %.0f' %.2f\"",
+                        h, m, s);
+            } else {
+                g_snprintf (buf, n_buf,
+                        "%.0f° %.2f'",
+                        h, m);
+            }
+
+            break;
+        }
+        case EXIF_TAG_GPS_LATITUDE_REF:
+        case EXIF_TAG_GPS_LONGITUDE_REF:
+        {
+            if (G_UNLIKELY (e->components != 2 ||
+                e->format != EXIF_FORMAT_ASCII))
+                return exif_entry_get_value (e, buf, n_buf);
+
+            switch (e->data[0]) {
+            case 'N':
+                g_snprintf (buf, n_buf, "%s", _("North"));
+                break;
+            case 'E':
+                g_snprintf (buf, n_buf, "%s", _("East"));
+                break;
+            case 'W':
+                g_snprintf (buf, n_buf, "%s", _("West"));
+                break;
+            case 'S':
+                g_snprintf (buf, n_buf, "%s", _("South"));
+                break;
+            default:
+                return exif_entry_get_value (e, buf, n_buf);
+                break;
+            }
+            break;
+        }
+        default:
+            return exif_entry_get_value (e, buf, n_buf);
+            break;
+    }
+
+    return buf;
+}
+
+static void
+exif_entry_cb (ExifEntry *entry, gpointer data)
+{
+    GtkTreeStore *store;
+    EomMetadataDetails *view;
+    EomMetadataDetailsPrivate *priv;
+    MetadataCategory cat;
+    ExifIfd ifd = exif_entry_get_ifd (entry);
+    char *path;
+    char b[1024];
+    const gint key = ifd << 16 | entry->tag;
+
+    /* This should optimize away if comparision is correct */
+    g_warn_if_fail (EXIF_IFD_COUNT <= G_MAXUINT16);
+
+    view = EOM_METADATA_DETAILS (data);
+    priv = view->priv;
+
+    store = GTK_TREE_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (view)));
+
+    /* Take the tag's IFD into account when caching their GtkTreePaths.
+     * That should fix key collisions for tags that have the same number
+     * but are stored in different IFDs. Exif tag numbers are 16-bit
+     * values so we should be able to set the high word to the IFD number.
+     */
+    path = g_hash_table_lookup (priv->id_path_hash, GINT_TO_POINTER (key));
+
+    if (path != NULL) {
+        set_row_data (store,
+                      path,
+                      NULL,
+                      exif_tag_get_name_in_ifd (entry->tag, ifd),
+                      eom_exif_entry_get_value (entry, b, sizeof(b)));
+    } else {
+
+        ExifMnoteData *mnote = (entry->tag == EXIF_TAG_MAKER_NOTE ?
+                                exif_data_get_mnote_data (entry->parent->parent) : NULL);
+
+        if (mnote) {
+            // Supported MakerNote Found
+            unsigned int i, c = exif_mnote_data_count (mnote);
+
+            for (i = 0; i < c; i++) {
+                path = g_hash_table_lookup (priv->id_path_hash_mnote, GINT_TO_POINTER (i));
+                if (path != NULL) {
+                    set_row_data (store, path, NULL,
+                                  exif_mnote_data_get_title (mnote, i),
+                                  exif_mnote_data_get_value (mnote, i, b, sizeof(b)));
+                } else {
+                    path = set_row_data (store,
+                                         NULL,
+                                         exif_categories[EXIF_CATEGORY_MAKER_NOTE].path,
+                                         exif_mnote_data_get_title (mnote, i),
+                                         exif_mnote_data_get_value (mnote, i, b, sizeof(b)));
+                    g_hash_table_insert (priv->id_path_hash_mnote, GINT_TO_POINTER (i), path);
+                }
+            }
+        } else {
+            cat = get_exif_category (entry);
+
+            path = set_row_data (store,
+                                 NULL,
+                                 exif_categories[cat].path,
+                                 exif_tag_get_name_in_ifd (entry->tag, ifd),
+                                 eom_exif_entry_get_value (entry, b,
+                                 sizeof(b)));
+
+            g_hash_table_insert (priv->id_path_hash,
+                                 GINT_TO_POINTER (key),
+                                 path);
+        }
+    }
+}
+#endif
+
+#ifdef HAVE_EXIF
+static void
+exif_content_cb (ExifContent *content, gpointer data)
+{
+    exif_content_foreach_entry (content, exif_entry_cb, data);
+}
+#endif
+
+GtkWidget *
+eom_metadata_details_new (void)
+{
+    GObject *object;
+
+    object = g_object_new (EOM_TYPE_METADATA_DETAILS, NULL);
+
+    return GTK_WIDGET (object);
+}
+
+static void
+eom_metadata_details_reset (EomMetadataDetails *details)
+{
+    EomMetadataDetailsPrivate *priv = details->priv;
+    int i;
+
+    gtk_tree_store_clear (GTK_TREE_STORE (priv->model));
+
+    g_hash_table_remove_all (priv->id_path_hash);
+    g_hash_table_remove_all (priv->id_path_hash_mnote);
+
+    for (i = 0; exif_categories [i].label != NULL; i++) {
+        char *translated_string;
+
+        translated_string = gettext (exif_categories[i].label);
+
+        set_row_data (GTK_TREE_STORE (priv->model),
+                      exif_categories[i].path,
+                      NULL,
+                      translated_string,
+                      NULL);
+    }
+}
+
+#ifdef HAVE_EXIF
+void
+eom_metadata_details_update (EomMetadataDetails *details, ExifData *data)
+{
+    g_return_if_fail (EOM_IS_METADATA_DETAILS (details));
+
+    eom_metadata_details_reset (details);
+    if (data) {
+        exif_data_foreach_content (data, exif_content_cb, details);
+    }
+}
+#endif /* HAVE_EXIF */
+
+#ifdef HAVE_EXEMPI
+typedef struct {
+    const char *id;
+    MetadataCategory category;
+} XmpNsCategory;
+
+static XmpNsCategory xmp_ns_category_map[] = {
+    { NS_EXIF,                  XMP_CATEGORY_EXIF},
+    { NS_TIFF,                  XMP_CATEGORY_EXIF},
+    { NS_XAP,                   XMP_CATEGORY_EXIF},
+    { NS_XAP_RIGHTS,            XMP_CATEGORY_RIGHTS},
+    { NS_EXIF_AUX,              XMP_CATEGORY_EXIF},
+    { NS_DC,                    XMP_CATEGORY_IPTC},
+    { NS_IPTC4XMP,              XMP_CATEGORY_IPTC},
+    { NS_CC,                    XMP_CATEGORY_RIGHTS},
+    { NULL, -1}
+};
+
+static MetadataCategory
+get_xmp_category (XmpStringPtr schema)
+{
+    MetadataCategory cat = XMP_CATEGORY_OTHER;
+    const char *s = xmp_string_cstr(schema);
+    int i;
+
+    for (i = 0; xmp_ns_category_map[i].id != NULL; i++) {
+        if (strcmp (xmp_ns_category_map[i].id, s) == 0) {
+            cat = xmp_ns_category_map[i].category;
+            break;
+        }
+    }
+
+    return cat;
+}
+
+static void
+xmp_entry_insert (EomMetadataDetails *view, XmpStringPtr xmp_schema,
+                  XmpStringPtr xmp_path, XmpStringPtr xmp_prop)
+{
+    GtkTreeStore *store;
+    EomMetadataDetailsPrivate *priv;
+    MetadataCategory cat;
+    char *path;
+    gchar *key;
+
+    priv = view->priv;
+
+    key = g_strconcat (xmp_string_cstr (xmp_schema), ":",
+                       xmp_string_cstr (xmp_path), NULL);
+
+    store = GTK_TREE_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (view)));
+
+    path = g_hash_table_lookup (priv->id_path_hash, key);
+
+    if (path != NULL) {
+        set_row_data (store, path, NULL,
+                      xmp_string_cstr (xmp_path),
+                      xmp_string_cstr (xmp_prop));
+
+        g_free(key);
+    }
+    else {
+        cat = get_xmp_category (xmp_schema);
+
+        path = set_row_data (store, NULL, exif_categories[cat].path,
+                             xmp_string_cstr(xmp_path),
+                             xmp_string_cstr(xmp_prop));
+
+        g_hash_table_insert (priv->id_path_hash, key, path);
+    }
+}
+
+void
+eom_metadata_details_xmp_update (EomMetadataDetails *view, XmpPtr data)
+{
+    g_return_if_fail (EOM_IS_METADATA_DETAILS (view));
+
+    if (data) {
+        XmpIteratorPtr iter = xmp_iterator_new(data, NULL, NULL, XMP_ITER_JUSTLEAFNODES);
+        XmpStringPtr the_schema = xmp_string_new ();
+        XmpStringPtr the_path = xmp_string_new ();
+        XmpStringPtr the_prop = xmp_string_new ();
+
+        while (xmp_iterator_next (iter, the_schema, the_path, the_prop, NULL)) {
+            xmp_entry_insert (view, the_schema, the_path, the_prop);
+        }
+
+        xmp_string_free (the_prop);
+        xmp_string_free (the_path);
+        xmp_string_free (the_schema);
+        xmp_iterator_free (iter);
+    }
+}
+#endif
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/65.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/65.html new file mode 100644 index 0000000..8f8ffaf --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/65.html @@ -0,0 +1,1565 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye Of MATE -- JPEG Metadata Reader
+ *
+ * Copyright (C) 2008 The Free Software Foundation
+ *
+ * Author: Felix Riemann <friemann@svn.gnome.org>
+ *
+ * Based on the original EomMetadataReader code.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gdk/gdkx.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "eom-metadata-reader.h"
+#include "eom-metadata-reader-jpg.h"
+#include "eom-debug.h"
+
+typedef enum {
+	EMR_READ = 0,
+	EMR_READ_SIZE_HIGH_BYTE,
+	EMR_READ_SIZE_LOW_BYTE,
+	EMR_READ_MARKER,
+	EMR_SKIP_BYTES,
+	EMR_READ_APP1,
+	EMR_READ_EXIF,
+	EMR_READ_XMP,
+	EMR_READ_ICC,
+	EMR_READ_IPTC,
+	EMR_FINISHED
+} EomMetadataReaderState;
+
+typedef enum {
+	EJA_EXIF = 0,
+	EJA_XMP,
+	EJA_OTHER
+} EomJpegApp1Type;
+
+#define EOM_JPEG_MARKER_START   0xFF
+#define EOM_JPEG_MARKER_APP1	0xE1
+#define EOM_JPEG_MARKER_APP2	0xE2
+#define EOM_JPEG_MARKER_APP14	0xED
+
+#define IS_FINISHED(priv) (priv->state == EMR_READ  && \
+                           priv->exif_chunk != NULL && \
+                           priv->icc_chunk  != NULL && \
+                           priv->iptc_chunk != NULL && \
+                           priv->xmp_chunk  != NULL)
+
+struct _EomMetadataReaderJpgPrivate {
+	EomMetadataReaderState  state;
+
+	/* data fields */
+	guint    exif_len;
+	gpointer exif_chunk;
+
+	gpointer iptc_chunk;
+	guint	 iptc_len;
+
+	guint icc_len;
+	gpointer icc_chunk;
+
+	gpointer xmp_chunk;
+	guint xmp_len;
+
+	/* management fields */
+	int      size;
+	int      last_marker;
+	int      bytes_read;
+};
+
+static void
+eom_metadata_reader_jpg_init_emr_iface (gpointer g_iface, gpointer iface_data);
+
+G_DEFINE_TYPE_WITH_CODE (EomMetadataReaderJpg, eom_metadata_reader_jpg,<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_CODE is a macro then please configure it.
+			 G_TYPE_OBJECT,
+			 G_IMPLEMENT_INTERFACE (EOM_TYPE_METADATA_READER,
+			                        eom_metadata_reader_jpg_init_emr_iface) \
+			                        G_ADD_PRIVATE (EomMetadataReaderJpg))
+
+static void
+eom_metadata_reader_jpg_dispose (GObject *object)
+{
+	EomMetadataReaderJpg *emr = EOM_METADATA_READER_JPG (object);
+
+	if (emr->priv->exif_chunk != NULL) {
+		g_free (emr->priv->exif_chunk);
+		emr->priv->exif_chunk = NULL;
+	}
+
+	if (emr->priv->iptc_chunk != NULL) {
+		g_free (emr->priv->iptc_chunk);
+		emr->priv->iptc_chunk = NULL;
+	}
+
+	if (emr->priv->xmp_chunk != NULL) {
+		g_free (emr->priv->xmp_chunk);
+		emr->priv->xmp_chunk = NULL;
+	}
+
+	if (emr->priv->icc_chunk != NULL) {
+		g_free (emr->priv->icc_chunk);
+		emr->priv->icc_chunk = NULL;
+	}
+
+	G_OBJECT_CLASS (eom_metadata_reader_jpg_parent_class)->dispose (object);
+}
+
+static void
+eom_metadata_reader_jpg_init (EomMetadataReaderJpg *emr)
+{
+	EomMetadataReaderJpgPrivate *priv;
+
+	priv = emr->priv =  eom_metadata_reader_jpg_get_instance_private (emr);
+	priv->exif_chunk = NULL;
+	priv->exif_len = 0;
+	priv->iptc_chunk = NULL;
+	priv->iptc_len = 0;
+	priv->icc_chunk = NULL;
+	priv->icc_len = 0;
+}
+
+static void
+eom_metadata_reader_jpg_class_init (EomMetadataReaderJpgClass *klass)
+{
+	GObjectClass *object_class = (GObjectClass*) klass;
+
+	object_class->dispose = eom_metadata_reader_jpg_dispose;
+}
+
+static gboolean
+eom_metadata_reader_jpg_finished (EomMetadataReaderJpg *emr)
+{
+	g_return_val_if_fail (EOM_IS_METADATA_READER_JPG (emr), TRUE);
+
+	return (emr->priv->state == EMR_FINISHED);
+}
+
+static EomJpegApp1Type
+eom_metadata_identify_app1 (gchar *buf, guint len)
+{
+ 	if (len < 5) {
+ 		return EJA_OTHER;
+ 	}
+
+ 	if (len < 29) {
+ 		return (strncmp ("Exif", buf, 5) == 0 ? EJA_EXIF : EJA_OTHER);
+ 	}
+
+ 	if (strncmp ("Exif", buf, 5) == 0) {
+ 		return EJA_EXIF;
+ 	} else if (strncmp ("http://ns.adobe.com/xap/1.0/", buf, 29) == 0) {
+ 		return EJA_XMP;
+ 	}
+
+ 	return EJA_OTHER;
+}
+
+static void
+eom_metadata_reader_get_next_block (EomMetadataReaderJpgPrivate* priv,
+				    guchar *chunk,
+				    int* i,
+				    const guchar *buf,
+				    int len,
+				    EomMetadataReaderState state)
+{
+	if (*i + priv->size < len) {
+		/* read data in one block */
+		memcpy ((guchar*) (chunk) + priv->bytes_read, &buf[*i], priv->size);
+		priv->state = EMR_READ;
+		*i = *i + priv->size - 1; /* the for-loop consumes the other byte */
+	} else {
+		int chunk_len = len - *i;
+		memcpy ((guchar*) (chunk) + priv->bytes_read, &buf[*i], chunk_len);
+		priv->bytes_read += chunk_len; /* bytes already read */
+		priv->size = (*i + priv->size) - len; /* remaining data to read */
+		*i = len - 1;
+		priv->state = state;
+	}
+}
+
+static void
+eom_metadata_reader_jpg_consume (EomMetadataReaderJpg *emr, const guchar *buf, guint len)
+{
+	EomMetadataReaderJpgPrivate *priv;
+ 	EomJpegApp1Type app1_type;
+	int i;
+	EomMetadataReaderState next_state = EMR_READ;
+	guchar *chunk = NULL;
+
+	g_return_if_fail (EOM_IS_METADATA_READER_JPG (emr));
+
+	priv = emr->priv;
+
+	if (priv->state == EMR_FINISHED) return;
+
+	for (i = 0; (i < len) && (priv->state != EMR_FINISHED); i++) {
+
+		switch (priv->state) {
+		case EMR_READ:
+			if (buf[i] == EOM_JPEG_MARKER_START) {
+				priv->state = EMR_READ_MARKER;
+			}
+			else {
+				priv->state = EMR_FINISHED;
+			}
+			break;
+
+		case EMR_READ_MARKER:
+			if ((buf [i] & 0xF0) == 0xE0 || buf[i] == 0xFE) {
+			/* we are reading some sort of APPxx or COM marker */
+				/* these are always followed by 2 bytes of size information */
+				priv->last_marker = buf [i];
+				priv->size = 0;
+				priv->state = EMR_READ_SIZE_HIGH_BYTE;
+
+				eom_debug_message (DEBUG_IMAGE_DATA, "APPx or COM Marker Found: %x", priv->last_marker);
+			}
+			else {
+				/* otherwise simply consume the byte */
+				priv->state = EMR_READ;
+			}
+			break;
+
+		case EMR_READ_SIZE_HIGH_BYTE:
+			priv->size = (buf [i] & 0xff) << 8;
+			priv->state = EMR_READ_SIZE_LOW_BYTE;
+			break;
+
+		case EMR_READ_SIZE_LOW_BYTE:
+			priv->size |= (buf [i] & 0xff);
+
+			if (priv->size > 2)  /* ignore the two size-bytes */
+				priv->size -= 2;
+
+			if (priv->size == 0) {
+				priv->state = EMR_READ;
+			} else if (priv->last_marker == EOM_JPEG_MARKER_APP1 &&
+				   ((priv->exif_chunk == NULL) || (priv->xmp_chunk == NULL)))
+			{
+				priv->state = EMR_READ_APP1;
+			} else if (priv->last_marker == EOM_JPEG_MARKER_APP2 &&
+				   priv->icc_chunk == NULL && priv->size > 14)
+			{
+	 			/* Chunk has 14 bytes identification data */
+				priv->state = EMR_READ_ICC;
+			} else if (priv->last_marker == EOM_JPEG_MARKER_APP14 &&
+				priv->iptc_chunk == NULL)
+			{
+				priv->state = EMR_READ_IPTC;
+			} else {
+				priv->state = EMR_SKIP_BYTES;
+			}
+
+			priv->last_marker = 0;
+			break;
+
+		case EMR_SKIP_BYTES:
+			eom_debug_message (DEBUG_IMAGE_DATA, "Skip bytes: %i", priv->size);
+
+			if (i + priv->size < len) {
+				i = i + priv->size - 1; /* the for-loop consumes the other byte */
+				priv->size = 0;
+			}
+			else {
+				priv->size = (i + priv->size) - len;
+				i = len - 1;
+			}
+			if (priv->size == 0) { /* don't need to skip any more bytes */
+				priv->state = EMR_READ;
+			}
+			break;
+
+		case EMR_READ_APP1:
+			eom_debug_message (DEBUG_IMAGE_DATA, "Read APP1 data, Length: %i", priv->size);
+
+			app1_type = eom_metadata_identify_app1 ((gchar*) &buf[i], priv->size);
+
+			switch (app1_type) {
+			case EJA_EXIF:
+				if (priv->exif_chunk == NULL) {
+					priv->exif_chunk = g_new0 (guchar, priv->size);
+					priv->exif_len = priv->size;
+					priv->bytes_read = 0;
+					chunk = priv->exif_chunk;
+					next_state = EMR_READ_EXIF;
+				} else {
+					chunk = NULL;
+					priv->state = EMR_SKIP_BYTES;
+				}
+				break;
+			case EJA_XMP:
+				if (priv->xmp_chunk == NULL) {
+					priv->xmp_chunk = g_new0 (guchar, priv->size);
+					priv->xmp_len = priv->size;
+					priv->bytes_read = 0;
+					chunk = priv->xmp_chunk;
+					next_state = EMR_READ_XMP;
+				} else {
+					chunk = NULL;
+					priv->state = EMR_SKIP_BYTES;
+				}
+				break;
+			case EJA_OTHER:
+			default:
+				/* skip unknown data */
+				chunk = NULL;
+				priv->state = EMR_SKIP_BYTES;
+				break;
+			}
+
+			if (chunk) {
+				eom_metadata_reader_get_next_block (priv, chunk,
+								    &i, buf,
+								    len,
+								    next_state);
+			}
+
+			if (IS_FINISHED(priv))
+				priv->state = EMR_FINISHED;
+			break;
+
+		case EMR_READ_EXIF:
+			eom_debug_message (DEBUG_IMAGE_DATA, "Read continuation of EXIF data, length: %i", priv->size);
+			{
+ 				eom_metadata_reader_get_next_block (priv, priv->exif_chunk,
+ 								    &i, buf, len, EMR_READ_EXIF);
+			}
+			if (IS_FINISHED(priv))
+				priv->state = EMR_FINISHED;
+			break;
+
+		case EMR_READ_XMP:
+			eom_debug_message (DEBUG_IMAGE_DATA, "Read continuation of XMP data, length: %i", priv->size);
+			{
+				eom_metadata_reader_get_next_block (priv, priv->xmp_chunk,
+ 								    &i, buf, len, EMR_READ_XMP);
+			}
+			if (IS_FINISHED (priv))
+				priv->state = EMR_FINISHED;
+			break;
+
+		case EMR_READ_ICC:
+			eom_debug_message (DEBUG_IMAGE_DATA,
+					   "Read continuation of ICC data, "
+					   "length: %i", priv->size);
+
+			if (priv->icc_chunk == NULL) {
+				priv->icc_chunk = g_new0 (guchar, priv->size);
+				priv->icc_len = priv->size;
+				priv->bytes_read = 0;
+			}
+
+			eom_metadata_reader_get_next_block (priv,
+							    priv->icc_chunk,
+							    &i, buf, len,
+							    EMR_READ_ICC);
+
+			/* Test that the chunk actually contains ICC data. */
+			if (priv->state == EMR_READ && priv->icc_chunk) {
+			    	const char* icc_chunk = priv->icc_chunk;
+				gboolean valid = TRUE;
+
+				/* Chunk should begin with the
+				 * ICC_PROFILE\0 identifier */
+				valid &= strncmp (icc_chunk,
+						  "ICC_PROFILE\0",12) == 0;
+				/* Make sure this is the first and only
+				 * ICC chunk in the file as we don't
+				 * support merging chunks yet. */
+				valid &=  *(guint16*)(icc_chunk+12) == 0x101;
+
+				if (!valid) {
+					/* This no ICC data. Throw it away. */
+					eom_debug_message (DEBUG_IMAGE_DATA,
+					"Supposed ICC chunk didn't validate. "
+					"Ignoring.");
+					g_free (priv->icc_chunk);
+					priv->icc_chunk = NULL;
+					priv->icc_len = 0;
+				}
+			}
+
+			if (IS_FINISHED(priv))
+				priv->state = EMR_FINISHED;
+			break;
+
+		case EMR_READ_IPTC:
+			eom_debug_message (DEBUG_IMAGE_DATA,
+					   "Read continuation of IPTC data, "
+					   "length: %i", priv->size);
+
+			if (priv->iptc_chunk == NULL) {
+				priv->iptc_chunk = g_new0 (guchar, priv->size);
+				priv->iptc_len = priv->size;
+				priv->bytes_read = 0;
+			}
+
+			eom_metadata_reader_get_next_block (priv,
+							    priv->iptc_chunk,
+							    &i, buf, len,
+							    EMR_READ_IPTC);
+
+			if (IS_FINISHED(priv))
+				priv->state = EMR_FINISHED;
+			break;
+
+		default:
+			g_assert_not_reached ();
+		}
+	}
+}
+
+/* Returns the raw exif data. NOTE: The caller of this function becomes
+ * the new owner of this piece of memory and is responsible for freeing it!
+ */
+static void
+eom_metadata_reader_jpg_get_exif_chunk (EomMetadataReaderJpg *emr, guchar **data, guint *len)
+{
+	EomMetadataReaderJpgPrivate *priv;
+
+	g_return_if_fail (EOM_IS_METADATA_READER (emr));
+	priv = emr->priv;
+
+	*data = (guchar*) priv->exif_chunk;
+	*len = priv->exif_len;
+
+	priv->exif_chunk = NULL;
+	priv->exif_len = 0;
+}
+
+#ifdef HAVE_EXIF
+static gpointer
+eom_metadata_reader_jpg_get_exif_data (EomMetadataReaderJpg *emr)
+{
+	EomMetadataReaderJpgPrivate *priv;
+	ExifData *data = NULL;
+
+	g_return_val_if_fail (EOM_IS_METADATA_READER (emr), NULL);
+	priv = emr->priv;
+
+	if (priv->exif_chunk != NULL) {
+		data = exif_data_new_from_data (priv->exif_chunk, priv->exif_len);
+	}
+
+	return data;
+}
+#endif
+
+#ifdef HAVE_EXEMPI
+
+/* skip the signature */
+#define EOM_XMP_OFFSET (29)
+
+static gpointer
+eom_metadata_reader_jpg_get_xmp_data (EomMetadataReaderJpg *emr )
+{
+	EomMetadataReaderJpgPrivate *priv;
+	XmpPtr xmp = NULL;
+
+	g_return_val_if_fail (EOM_IS_METADATA_READER (emr), NULL);
+
+	priv = emr->priv;
+
+	if (priv->xmp_chunk != NULL) {
+		xmp = xmp_new (priv->xmp_chunk+EOM_XMP_OFFSET,
+			       priv->xmp_len-EOM_XMP_OFFSET);
+	}
+
+	return (gpointer)xmp;
+}
+#endif
+
+/*
+ * FIXME: very broken, assumes the profile fits in a single chunk.  Change to
+ * parse the sections and construct a single memory chunk, or maybe even parse
+ * the profile.
+ */
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
+static gpointer
+eom_metadata_reader_jpg_get_icc_profile (EomMetadataReaderJpg *emr)
+{
+	EomMetadataReaderJpgPrivate *priv;
+	cmsHPROFILE profile = NULL;
+
+	g_return_val_if_fail (EOM_IS_METADATA_READER (emr), NULL);
+
+	priv = emr->priv;
+
+	if (priv->icc_chunk) {
+		if (GDK_IS_X11_DISPLAY (gdk_display_get_default ())) {
+			profile = cmsOpenProfileFromMem(priv->icc_chunk + 14, priv->icc_len - 14);
+		}
+
+		if (profile) {
+			eom_debug_message (DEBUG_LCMS, "JPEG has ICC profile");
+		} else {
+			eom_debug_message (DEBUG_LCMS, "JPEG has invalid ICC profile");
+		}
+	}
+
+#ifdef HAVE_EXIF
+	if (!profile && priv->exif_chunk != NULL) {
+		ExifEntry *entry;
+		ExifByteOrder o;
+		gint color_space;
+		ExifData *exif = eom_metadata_reader_jpg_get_exif_data (emr);
+
+		if (!exif) return NULL;
+
+		o = exif_data_get_byte_order (exif);
+
+		entry = exif_data_get_entry (exif, EXIF_TAG_COLOR_SPACE);
+
+		if (entry == NULL) {
+			exif_data_unref (exif);
+			return NULL;
+		}
+
+		color_space = exif_get_short (entry->data, o);
+
+		switch (color_space) {
+		case 1:
+			eom_debug_message (DEBUG_LCMS, "JPEG is sRGB");
+
+			profile = cmsCreate_sRGBProfile ();
+
+			break;
+		case 2:
+			eom_debug_message (DEBUG_LCMS, "JPEG is Adobe RGB (Disabled)");
+
+			/* TODO: create Adobe RGB profile */
+			//profile = cmsCreate_Adobe1998Profile ();
+
+			break;
+		case 0xFFFF:
+		  	{
+			cmsCIExyY whitepoint;
+			cmsCIExyYTRIPLE primaries;
+			cmsToneCurve *gamma[3];
+			double gammaValue;
+			ExifRational r;
+
+			const int offset = exif_format_get_size (EXIF_FORMAT_RATIONAL);
+
+			entry = exif_data_get_entry (exif, EXIF_TAG_WHITE_POINT);
+
+			if (entry && entry->components == 2) {
+				r = exif_get_rational (entry->data, o);
+				whitepoint.x = (double) r.numerator / r.denominator;
+
+				r = exif_get_rational (entry->data + offset, o);
+				whitepoint.y = (double) r.numerator / r.denominator;
+				whitepoint.Y = 1.0;
+			} else {
+				eom_debug_message (DEBUG_LCMS, "No whitepoint found");
+				break;
+			}
+
+			entry = exif_data_get_entry (exif, EXIF_TAG_PRIMARY_CHROMATICITIES);
+
+			if (entry && entry->components == 6) {
+				r = exif_get_rational (entry->data + 0 * offset, o);
+				primaries.Red.x = (double) r.numerator / r.denominator;
+
+				r = exif_get_rational (entry->data + 1 * offset, o);
+				primaries.Red.y = (double) r.numerator / r.denominator;
+
+				r = exif_get_rational (entry->data + 2 * offset, o);
+				primaries.Green.x = (double) r.numerator / r.denominator;
+
+				r = exif_get_rational (entry->data + 3 * offset, o);
+				primaries.Green.y = (double) r.numerator / r.denominator;
+
+				r = exif_get_rational (entry->data + 4 * offset, o);
+				primaries.Blue.x = (double) r.numerator / r.denominator;
+
+				r = exif_get_rational (entry->data + 5 * offset, o);
+				primaries.Blue.y = (double) r.numerator / r.denominator;
+
+				primaries.Red.Y = primaries.Green.Y = primaries.Blue.Y = 1.0;
+			} else {
+				eom_debug_message (DEBUG_LCMS, "No primary chromaticities found");
+				break;
+			}
+
+			entry = exif_data_get_entry (exif, EXIF_TAG_GAMMA);
+
+			if (entry) {
+				r = exif_get_rational (entry->data, o);
+				gammaValue = (double) r.numerator / r.denominator;
+			} else {
+				eom_debug_message (DEBUG_LCMS, "No gamma found");
+				gammaValue = 2.2;
+			}
+
+			gamma[0] = gamma[1] = gamma[2] = cmsBuildGamma (NULL, gammaValue);
+
+			profile = cmsCreateRGBProfile (&whitepoint, &primaries, gamma);
+
+			cmsFreeToneCurve(gamma[0]);
+
+			eom_debug_message (DEBUG_LCMS, "JPEG is calibrated");
+
+			break;
+			}
+		}
+
+		exif_data_unref (exif);
+	}
+#endif
+	return profile;
+}
+#endif
+
+static void
+eom_metadata_reader_jpg_init_emr_iface (gpointer g_iface, gpointer iface_data)
+{
+	EomMetadataReaderInterface *iface;
+
+	iface = (EomMetadataReaderInterface*)g_iface;
+
+	iface->consume =
+		(void (*) (EomMetadataReader *self, const guchar *buf, guint len))
+			eom_metadata_reader_jpg_consume;
+	iface->finished =
+		(gboolean (*) (EomMetadataReader *self))
+			eom_metadata_reader_jpg_finished;
+	iface->get_raw_exif =
+		(void (*) (EomMetadataReader *self, guchar **data, guint *len))
+			eom_metadata_reader_jpg_get_exif_chunk;
+#ifdef HAVE_EXIF
+	iface->get_exif_data =
+		(gpointer (*) (EomMetadataReader *self))
+			eom_metadata_reader_jpg_get_exif_data;
+#endif
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
+	iface->get_icc_profile =
+		(gpointer (*) (EomMetadataReader *self))
+			eom_metadata_reader_jpg_get_icc_profile;
+#endif
+#ifdef HAVE_EXEMPI
+	iface->get_xmp_ptr =
+		(gpointer (*) (EomMetadataReader *self))
+			eom_metadata_reader_jpg_get_xmp_data;
+#endif
+}
+
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/66.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/66.html new file mode 100644 index 0000000..2e05df7 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/66.html @@ -0,0 +1,1597 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye Of MATE -- PNG Metadata Reader
+ *
+ * Copyright (C) 2008 The Free Software Foundation
+ *
+ * Author: Felix Riemann <friemann@svn.gnome.org>
+ *
+ * Based on the old EomMetadataReader code.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <math.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <zlib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gdk/gdkx.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "eom-metadata-reader.h"
+#include "eom-metadata-reader-png.h"
+#include "eom-debug.h"
+
+typedef enum {
+	EMR_READ_MAGIC,
+	EMR_READ_SIZE_HIGH_HIGH_BYTE,
+	EMR_READ_SIZE_HIGH_LOW_BYTE,
+	EMR_READ_SIZE_LOW_HIGH_BYTE,
+	EMR_READ_SIZE_LOW_LOW_BYTE,
+	EMR_READ_CHUNK_NAME,
+	EMR_SKIP_BYTES,
+	EMR_CHECK_CRC,
+	EMR_SKIP_CRC,
+	EMR_READ_XMP_ITXT,
+	EMR_READ_ICCP,
+	EMR_READ_SRGB,
+	EMR_READ_CHRM,
+	EMR_READ_GAMA,
+	EMR_FINISHED
+} EomMetadataReaderPngState;
+
+#if 0
+#define IS_FINISHED(priv) (priv->icc_chunk  != NULL && \
+                           priv->xmp_chunk  != NULL)
+#endif
+
+struct _EomMetadataReaderPngPrivate {
+	EomMetadataReaderPngState  state;
+
+	/* data fields */
+	guint32  icc_len;
+	gpointer icc_chunk;
+
+	gpointer xmp_chunk;
+	guint32  xmp_len;
+
+	guint32	 sRGB_len;
+	gpointer sRGB_chunk;
+
+	gpointer cHRM_chunk;
+	guint32	 cHRM_len;
+
+	guint32	 gAMA_len;
+	gpointer gAMA_chunk;
+
+	/* management fields */
+	gsize      size;
+	gsize      bytes_read;
+	guint	   sub_step;
+	guchar	   chunk_name[4];
+	gpointer   *crc_chunk;
+	guint32	   *crc_len;
+	guint32    target_crc;
+	gboolean   hasIHDR;
+};
+
+static void
+eom_metadata_reader_png_init_emr_iface (gpointer g_iface, gpointer iface_data);
+
+G_DEFINE_TYPE_WITH_CODE (EomMetadataReaderPng, eom_metadata_reader_png,<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_CODE is a macro then please configure it.
+			 G_TYPE_OBJECT,
+			 G_IMPLEMENT_INTERFACE (EOM_TYPE_METADATA_READER,
+			                        eom_metadata_reader_png_init_emr_iface) \
+			                        G_ADD_PRIVATE(EomMetadataReaderPng))
+
+static void
+eom_metadata_reader_png_dispose (GObject *object)
+{
+	EomMetadataReaderPng *emr = EOM_METADATA_READER_PNG (object);
+	EomMetadataReaderPngPrivate *priv = emr->priv;
+
+	g_free (priv->xmp_chunk);
+	priv->xmp_chunk = NULL;
+
+	g_free (priv->icc_chunk);
+	priv->icc_chunk = NULL;
+
+	g_free (priv->sRGB_chunk);
+	priv->sRGB_chunk = NULL;
+
+	g_free (priv->cHRM_chunk);
+	priv->cHRM_chunk = NULL;
+
+	g_free (priv->gAMA_chunk);
+	priv->gAMA_chunk = NULL;
+
+	G_OBJECT_CLASS (eom_metadata_reader_png_parent_class)->dispose (object);
+}
+
+static void
+eom_metadata_reader_png_init (EomMetadataReaderPng *emr)
+{
+	EomMetadataReaderPngPrivate *priv;
+
+	priv = emr->priv =  eom_metadata_reader_png_get_instance_private (emr);
+	priv->icc_chunk = NULL;
+	priv->icc_len = 0;
+	priv->xmp_chunk = NULL;
+	priv->xmp_len = 0;
+	priv->sRGB_chunk = NULL;
+	priv->sRGB_len = 0;
+	priv->cHRM_chunk = NULL;
+	priv->cHRM_len = 0;
+	priv->gAMA_chunk = NULL;
+	priv->gAMA_len = 0;
+
+	priv->sub_step = 0;
+	priv->state = EMR_READ_MAGIC;
+	priv->hasIHDR = FALSE;
+}
+
+static void
+eom_metadata_reader_png_class_init (EomMetadataReaderPngClass *klass)
+{
+	GObjectClass *object_class = (GObjectClass*) klass;
+
+	object_class->dispose = eom_metadata_reader_png_dispose;
+}
+
+static gboolean
+eom_metadata_reader_png_finished (EomMetadataReaderPng *emr)
+{
+	g_return_val_if_fail (EOM_IS_METADATA_READER_PNG (emr), TRUE);
+
+	return (emr->priv->state == EMR_FINISHED);
+}
+
+static void
+eom_metadata_reader_png_get_next_block (EomMetadataReaderPngPrivate* priv,
+				    	guchar *chunk,
+					int* i,
+					const guchar *buf,
+					int len,
+					EomMetadataReaderPngState state)
+{
+	if (*i + priv->size < len) {
+		/* read data in one block */
+		memcpy ((guchar*) (chunk) + priv->bytes_read, &buf[*i], priv->size);
+		priv->state = EMR_CHECK_CRC;
+		*i = *i + priv->size - 1; /* the for-loop consumes the other byte */
+		priv->size = 0;
+	} else {
+		int chunk_len = len - *i;
+		memcpy ((guchar*) (chunk) + priv->bytes_read, &buf[*i], chunk_len);
+		priv->bytes_read += chunk_len; /* bytes already read */
+		priv->size = (*i + priv->size) - len; /* remaining data to read */
+		*i = len - 1;
+		priv->state = state;
+	}
+}
+
+static void
+eom_metadata_reader_png_consume (EomMetadataReaderPng *emr, const guchar *buf, guint len)
+{
+	EomMetadataReaderPngPrivate *priv;
+ 	int i;
+	guint32 chunk_crc;
+	static const gchar PNGMAGIC[8] = "\x89PNG\x0D\x0A\x1a\x0A";
+
+	g_return_if_fail (EOM_IS_METADATA_READER_PNG (emr));
+
+	priv = emr->priv;
+
+	if (priv->state == EMR_FINISHED) return;
+
+	for (i = 0; (i < len) && (priv->state != EMR_FINISHED); i++) {
+
+		switch (priv->state) {
+		case EMR_READ_MAGIC:
+			/* Check PNG magic string */
+			if (priv->sub_step < 8 &&
+			    (gchar)buf[i] == PNGMAGIC[priv->sub_step]) {
+			    	if (priv->sub_step == 7)
+					priv->state = EMR_READ_SIZE_HIGH_HIGH_BYTE;
+				priv->sub_step++;
+			} else {
+				priv->state = EMR_FINISHED;
+			}
+			break;
+		case EMR_READ_SIZE_HIGH_HIGH_BYTE:
+			/* Read the high byte of the size's high word */
+			priv->size |= (buf[i] & 0xFF) << 24;
+			priv->state = EMR_READ_SIZE_HIGH_LOW_BYTE;
+			break;
+		case EMR_READ_SIZE_HIGH_LOW_BYTE:
+			/* Read the low byte of the size's high word */
+			priv->size |= (buf[i] & 0xFF) << 16;
+			priv->state = EMR_READ_SIZE_LOW_HIGH_BYTE;
+			break;
+		case EMR_READ_SIZE_LOW_HIGH_BYTE:
+			/* Read the high byte of the size's low word */
+			priv->size |= (buf [i] & 0xff) << 8;
+			priv->state = EMR_READ_SIZE_LOW_LOW_BYTE;
+			break;
+		case EMR_READ_SIZE_LOW_LOW_BYTE:
+			/* Read the high byte of the size's low word */
+			priv->size |= (buf [i] & 0xff);
+			/* The maximum chunk length is 2^31-1 */
+			if (G_LIKELY (priv->size <= (guint32) 0x7fffffff)) {
+				priv->state = EMR_READ_CHUNK_NAME;
+				/* Make sure sub_step is 0 before next step */
+				priv->sub_step = 0;
+			} else {
+				priv->state = EMR_FINISHED;
+				eom_debug_message (DEBUG_IMAGE_DATA,
+						   "chunk size larger than "
+						   "2^31-1; stopping parser");
+			}
+
+			break;
+		case EMR_READ_CHUNK_NAME:
+			/* Read the 4-byte chunk name */
+			if (priv->sub_step > 3)
+				g_assert_not_reached ();
+
+			priv->chunk_name[priv->sub_step] = buf[i];
+
+			if (priv->sub_step++ != 3)
+				break;
+
+			if (G_UNLIKELY (!priv->hasIHDR)) {
+				/* IHDR should be the first chunk in a PNG */
+				if (priv->size == 13
+				    && memcmp (priv->chunk_name, "IHDR", 4) == 0){
+					priv->hasIHDR = TRUE;
+				} else {
+					/* Stop parsing if it is not */
+					priv->state = EMR_FINISHED;
+				}
+			}
+
+			/* Try to identify the chunk by its name.
+			 * Already do some sanity checks where possible */
+			if (memcmp (priv->chunk_name, "iTXt", 4) == 0 &&
+			    priv->size > (22 + 54) && priv->xmp_chunk == NULL) {
+				priv->state = EMR_READ_XMP_ITXT;
+			} else if (memcmp (priv->chunk_name, "iCCP", 4) == 0 &&
+				   priv->icc_chunk == NULL) {
+				priv->state = EMR_READ_ICCP;
+			} else if (memcmp (priv->chunk_name, "sRGB", 4) == 0 &&
+				   priv->sRGB_chunk == NULL && priv->size == 1) {
+				priv->state = EMR_READ_SRGB;
+			} else if (memcmp (priv->chunk_name, "cHRM", 4) == 0 &&
+				   priv->cHRM_chunk == NULL && priv->size == 32) {
+				priv->state = EMR_READ_CHRM;
+			} else if (memcmp (priv->chunk_name, "gAMA", 4) == 0 &&
+				   priv->gAMA_chunk == NULL && priv->size == 4) {
+				priv->state = EMR_READ_GAMA;
+			} else if (memcmp (priv->chunk_name, "IEND", 4) == 0) {
+				priv->state = EMR_FINISHED;
+			} else {
+				/* Skip chunk + 4-byte CRC32 value */
+				priv->size += 4;
+				priv->state = EMR_SKIP_BYTES;
+			}
+			priv->sub_step = 0;
+			break;
+		case EMR_SKIP_CRC:
+			/* Skip the 4-byte CRC32 value following every chunk */
+			priv->size = 4;
+		case EMR_SKIP_BYTES:
+		/* Skip chunk and start reading the size of the next one */
+			eom_debug_message (DEBUG_IMAGE_DATA,
+					   "Skip bytes: %" G_GSIZE_FORMAT,
+					   priv->size);
+
+			if (i + priv->size < len) {
+				i = i + priv->size - 1; /* the for-loop consumes the other byte */
+				priv->size = 0;
+				priv->state = EMR_READ_SIZE_HIGH_HIGH_BYTE;
+			}
+			else {
+				priv->size = (i + priv->size) - len;
+				i = len - 1;
+			}
+			break;
+		case EMR_CHECK_CRC:
+			/* Read the chunks CRC32 value from the file,... */
+			if (priv->sub_step == 0)
+				priv->target_crc = 0;
+
+			priv->target_crc |= buf[i] << ((3 - priv->sub_step) * 8);
+
+			if (priv->sub_step++ != 3)
+				break;
+
+			/* ...generate the chunks CRC32,... */
+			chunk_crc = crc32 (crc32 (0L, Z_NULL, 0), priv->chunk_name, 4);
+			chunk_crc = crc32 (chunk_crc, *priv->crc_chunk, *priv->crc_len);
+
+			eom_debug_message (DEBUG_IMAGE_DATA, "Checking CRC: Chunk: 0x%X - Target: 0x%X", chunk_crc, priv->target_crc);
+
+			/* ...and check if they match. If they don't throw
+			 * the chunk away and stop parsing. */
+			if (priv->target_crc == chunk_crc) {
+				priv->state = EMR_READ_SIZE_HIGH_HIGH_BYTE;
+			} else {
+				g_free (*priv->crc_chunk);
+				*priv->crc_chunk = NULL;
+				*priv->crc_len = 0;
+				/* Stop parsing for security reasons */
+				priv->state = EMR_FINISHED;
+			}
+			priv->sub_step = 0;
+			break;
+		case EMR_READ_XMP_ITXT:
+			/* Extract an iTXt chunk possibly containing
+			 * an XMP packet */
+			eom_debug_message (DEBUG_IMAGE_DATA,
+					   "Read XMP Chunk - size: %"
+					   G_GSIZE_FORMAT, priv->size);
+
+			if (priv->xmp_chunk == NULL) {
+				priv->xmp_chunk = g_new0 (guchar, priv->size);
+				priv->xmp_len = priv->size;
+				priv->crc_len = &priv->xmp_len;
+				priv->bytes_read = 0;
+				priv->crc_chunk = &priv->xmp_chunk;
+			}
+			eom_metadata_reader_png_get_next_block (priv,
+							    priv->xmp_chunk,
+							    &i, buf, len,
+							    EMR_READ_XMP_ITXT);
+
+			if (priv->state == EMR_CHECK_CRC) {
+				/* Check if it is actually an XMP chunk.
+				 * Throw it away if not.
+				 * The check has 4 extra \0's to check
+				 * if the chunk is configured correctly. */
+				if (memcmp (priv->xmp_chunk, "XML:com.adobe.xmp\0\0\0\0\0", 22) != 0) {
+					priv->state = EMR_SKIP_CRC;
+					g_free (priv->xmp_chunk);
+					priv->xmp_chunk = NULL;
+					priv->xmp_len = 0;
+				}
+			}
+			break;
+		case EMR_READ_ICCP:
+			/* Extract an iCCP chunk containing a
+			 * deflated ICC profile. */
+			eom_debug_message (DEBUG_IMAGE_DATA,
+					   "Read ICC Chunk - size: %"
+					   G_GSIZE_FORMAT, priv->size);
+
+			if (priv->icc_chunk == NULL) {
+				priv->icc_chunk = g_new0 (guchar, priv->size);
+				priv->icc_len = priv->size;
+				priv->crc_len = &priv->icc_len;
+				priv->bytes_read = 0;
+				priv->crc_chunk = &priv->icc_chunk;
+			}
+
+			eom_metadata_reader_png_get_next_block (priv,
+							    priv->icc_chunk,
+							    &i, buf, len,
+							    EMR_READ_ICCP);
+			break;
+		case EMR_READ_SRGB:
+			/* Extract the sRGB chunk. Marks the image data as
+			 * being in sRGB colorspace. */
+			eom_debug_message (DEBUG_IMAGE_DATA,
+					   "Read sRGB Chunk - value: %u", *(buf+i));
+
+			if (priv->sRGB_chunk == NULL) {
+				priv->sRGB_chunk = g_new0 (guchar, priv->size);
+				priv->sRGB_len = priv->size;
+				priv->crc_len = &priv->sRGB_len;
+				priv->bytes_read = 0;
+				priv->crc_chunk = &priv->sRGB_chunk;
+			}
+
+			eom_metadata_reader_png_get_next_block (priv,
+							    priv->sRGB_chunk,
+							    &i, buf, len,
+							    EMR_READ_SRGB);
+			break;
+		case EMR_READ_CHRM:
+			/* Extract the cHRM chunk. Contains the coordinates of
+			 * the image's whitepoint and primary chromacities. */
+			eom_debug_message (DEBUG_IMAGE_DATA,
+					   "Read cHRM Chunk - size: %"
+					   G_GSIZE_FORMAT, priv->size);
+
+			if (priv->cHRM_chunk == NULL) {
+				priv->cHRM_chunk = g_new0 (guchar, priv->size);
+				priv->cHRM_len = priv->size;
+				priv->crc_len = &priv->cHRM_len;
+				priv->bytes_read = 0;
+				priv->crc_chunk = &priv->cHRM_chunk;
+			}
+
+			eom_metadata_reader_png_get_next_block (priv,
+							    priv->cHRM_chunk,
+							    &i, buf, len,
+							    EMR_READ_ICCP);
+			break;
+		case EMR_READ_GAMA:
+			/* Extract the gAMA chunk containing the
+			 * image's gamma value */
+			eom_debug_message (DEBUG_IMAGE_DATA,
+					   "Read gAMA-Chunk - size: %"
+					   G_GSIZE_FORMAT, priv->size);
+
+			if (priv->gAMA_chunk == NULL) {
+				priv->gAMA_chunk = g_new0 (guchar, priv->size);
+				priv->gAMA_len = priv->size;
+				priv->crc_len = &priv->gAMA_len;
+				priv->bytes_read = 0;
+				priv->crc_chunk = &priv->gAMA_chunk;
+			}
+
+			eom_metadata_reader_png_get_next_block (priv,
+							    priv->gAMA_chunk,
+							    &i, buf, len,
+							    EMR_READ_ICCP);
+			break;
+		default:
+			g_assert_not_reached ();
+		}
+	}
+}
+
+#ifdef HAVE_EXEMPI
+
+/* skip the chunk ID */
+#define EOM_XMP_OFFSET (22)
+
+static gpointer
+eom_metadata_reader_png_get_xmp_data (EomMetadataReaderPng *emr )
+{
+	EomMetadataReaderPngPrivate *priv;
+	XmpPtr xmp = NULL;
+
+	g_return_val_if_fail (EOM_IS_METADATA_READER_PNG (emr), NULL);
+
+	priv = emr->priv;
+
+	if (priv->xmp_chunk != NULL) {
+		xmp = xmp_new (priv->xmp_chunk+EOM_XMP_OFFSET,
+			       priv->xmp_len-EOM_XMP_OFFSET);
+	}
+
+	return (gpointer) xmp;
+}
+#endif
+
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
+
+#define EXTRACT_DOUBLE_UINT_BLOCK_OFFSET(chunk,offset,divider) \
+		(double)(GUINT32_FROM_BE(*((guint32*)((chunk)+((offset)*4))))/(double)(divider))
+
+/* This is the amount of memory the inflate output buffer gets increased by
+ * while decompressing the ICC profile */
+#define EOM_ICC_INFLATE_BUFFER_STEP 1024
+
+/* I haven't seen ICC profiles larger than 1MB yet.
+ * A maximum output buffer of 5MB should be enough. */
+#define EOM_ICC_INFLATE_BUFFER_LIMIT (1024*1024*5)
+
+/* Apparently an sRGB profile saved in cHRM and gAMA chunks does not compute
+ * a profile that exactly matches the built-in sRGB profile and thus could
+ * cause a slight color deviation. Try catching this case to allow fallback
+ * to the built-in profile instead.
+ */
+static gboolean
+_chrm_matches_srgb(const cmsCIExyY       *whitepoint,
+		   const cmsCIExyYTRIPLE *primaries,
+		         gdouble          gammaValue)
+{
+	/* PNGs gAMA value for 2.2 is only accurate to the 4th decimal point */
+#define DOUBLE_EQUAL_MAX_DIFF 1e-4
+#define DOUBLE_EQUAL(a,b) (fabs (a - b) < DOUBLE_EQUAL_MAX_DIFF)
+
+	return (DOUBLE_EQUAL(gammaValue, 2.2)
+		&& DOUBLE_EQUAL(whitepoint->x, 0.3127)
+		&& DOUBLE_EQUAL(whitepoint->y, 0.329)
+		&& DOUBLE_EQUAL(primaries->Red.x, 0.64)
+		&& DOUBLE_EQUAL(primaries->Red.y, 0.33)
+		&& DOUBLE_EQUAL(primaries->Green.x, 0.3)
+		&& DOUBLE_EQUAL(primaries->Green.y, 0.6)
+		&& DOUBLE_EQUAL(primaries->Blue.x, 0.15)
+		&& DOUBLE_EQUAL(primaries->Blue.y, 0.06));
+}
+
+static gpointer
+eom_metadata_reader_png_get_icc_profile (EomMetadataReaderPng *emr)
+{
+	EomMetadataReaderPngPrivate *priv;
+	cmsHPROFILE profile = NULL;
+
+	g_return_val_if_fail (EOM_IS_METADATA_READER_PNG (emr), NULL);
+
+	priv = emr->priv;
+
+	if (priv->icc_chunk) {
+		gpointer outbuf;
+		gsize offset = 0;
+		z_stream zstr;
+		int z_ret;
+
+		/* Use default allocation functions */
+		zstr.zalloc = Z_NULL;
+		zstr.zfree = Z_NULL;
+		zstr.opaque = Z_NULL;
+
+		/* Skip the name of the ICC profile */
+		while (*((guchar*)priv->icc_chunk+offset) != '\0')
+			offset++;
+		/* Ensure the compression method (deflate) */
+		if (*((guchar*)priv->icc_chunk+(++offset)) != '\0')
+			return NULL;
+		++offset; //offset now points to the start of the deflated data
+
+		/* Prepare the zlib data structure for decompression */
+		zstr.next_in = priv->icc_chunk + offset;
+		zstr.avail_in = priv->icc_len - offset;
+		if (inflateInit (&zstr) != Z_OK) {
+			return NULL;
+		}
+
+		/* Prepare output buffer and make zlib aware of it */
+		outbuf = g_malloc (EOM_ICC_INFLATE_BUFFER_STEP);
+		zstr.next_out = outbuf;
+		zstr.avail_out = EOM_ICC_INFLATE_BUFFER_STEP;
+
+		do {
+			if (zstr.avail_out == 0) {
+				/* The output buffer was not large enough to
+				 * hold all the decompressed data. Increase its
+				 * size and continue decompression. */
+				gsize new_size = zstr.total_out + EOM_ICC_INFLATE_BUFFER_STEP;
+
+				if (G_UNLIKELY (new_size > EOM_ICC_INFLATE_BUFFER_LIMIT)) {
+					/* Enforce a memory limit for the output
+					 * buffer to avoid possible OOM cases */
+					inflateEnd (&zstr);
+					g_free (outbuf);
+					eom_debug_message (DEBUG_IMAGE_DATA, "ICC profile is too large. Ignoring.");
+					return NULL;
+				}
+				outbuf = g_realloc(outbuf, new_size);
+				zstr.avail_out = EOM_ICC_INFLATE_BUFFER_STEP;
+				zstr.next_out = outbuf + zstr.total_out;
+			}
+			z_ret = inflate (&zstr, Z_SYNC_FLUSH);
+		} while (z_ret == Z_OK);
+
+		if (G_UNLIKELY (z_ret != Z_STREAM_END)) {
+			eom_debug_message (DEBUG_IMAGE_DATA, "Error while inflating ICC profile: %s (%d)", zstr.msg, z_ret);
+			inflateEnd (&zstr);
+			g_free (outbuf);
+			return NULL;
+		}
+
+		if (GDK_IS_X11_DISPLAY (gdk_display_get_default ())) {
+			profile = cmsOpenProfileFromMem(outbuf, zstr.total_out);
+		}
+		inflateEnd (&zstr);
+		g_free (outbuf);
+
+		eom_debug_message (DEBUG_LCMS, "PNG has %s ICC profile", profile ? "valid" : "invalid");
+	}
+
+	if (!profile && priv->sRGB_chunk) {
+		eom_debug_message (DEBUG_LCMS, "PNG is sRGB");
+		/* If the file has an sRGB chunk the image data is in the sRGB
+		 * colorspace. lcms has a built-in sRGB profile. */
+
+		if (GDK_IS_X11_DISPLAY (gdk_display_get_default ())) {
+			profile = cmsCreate_sRGBProfile ();
+		}
+	}
+
+	if (!profile && priv->cHRM_chunk && priv->gAMA_chunk) {
+		cmsCIExyY whitepoint;
+		cmsCIExyYTRIPLE primaries;
+		cmsToneCurve *gamma[3];
+		double gammaValue;
+
+		/* This uglyness extracts the chromacity and whitepoint values
+		 * from a PNG's cHRM chunk. These can be accurate up to the
+		 * 5th decimal point.
+		 * They are saved as integer values multiplied by 100000. */
+
+		eom_debug_message (DEBUG_LCMS, "Trying to calculate color profile");
+
+		whitepoint.x = EXTRACT_DOUBLE_UINT_BLOCK_OFFSET (priv->cHRM_chunk, 0, 100000);
+		whitepoint.y = EXTRACT_DOUBLE_UINT_BLOCK_OFFSET (priv->cHRM_chunk, 1, 100000);
+
+		primaries.Red.x = EXTRACT_DOUBLE_UINT_BLOCK_OFFSET (priv->cHRM_chunk, 2, 100000);
+		primaries.Red.y = EXTRACT_DOUBLE_UINT_BLOCK_OFFSET (priv->cHRM_chunk, 3, 100000);
+		primaries.Green.x = EXTRACT_DOUBLE_UINT_BLOCK_OFFSET (priv->cHRM_chunk, 4, 100000);
+		primaries.Green.y = EXTRACT_DOUBLE_UINT_BLOCK_OFFSET (priv->cHRM_chunk, 5, 100000);
+		primaries.Blue.x = EXTRACT_DOUBLE_UINT_BLOCK_OFFSET (priv->cHRM_chunk, 6, 100000);
+		primaries.Blue.y = EXTRACT_DOUBLE_UINT_BLOCK_OFFSET (priv->cHRM_chunk, 7, 100000);
+
+		whitepoint.Y = primaries.Red.Y = primaries.Green.Y = primaries.Blue.Y = 1.0;
+
+		gammaValue = (double) 1.0/EXTRACT_DOUBLE_UINT_BLOCK_OFFSET (priv->gAMA_chunk, 0, 100000);
+		eom_debug_message (DEBUG_LCMS, "Gamma %.5lf", gammaValue);
+
+		/* Catch SRGB in cHRM/gAMA chunks and use accurate built-in
+		 * profile instead of computing one that "gets close". */
+		if(_chrm_matches_srgb (&whitepoint, &primaries, gammaValue)) {
+			eom_debug_message (DEBUG_LCMS, "gAMA and cHRM match sRGB");
+			if (GDK_IS_X11_DISPLAY (gdk_display_get_default ())) {
+				profile = cmsCreate_sRGBProfile ();
+			}
+		} else {
+			gamma[0] = gamma[1] = gamma[2] =
+				cmsBuildGamma (NULL, gammaValue);
+			if (GDK_IS_X11_DISPLAY (gdk_display_get_default ())) {
+				profile = cmsCreateRGBProfile (&whitepoint, &primaries,
+						gamma);
+				cmsFreeToneCurve(gamma[0]);
+			}
+		}
+	}
+
+	return profile;
+}
+#endif
+
+static void
+eom_metadata_reader_png_init_emr_iface (gpointer g_iface, gpointer iface_data)
+{
+	EomMetadataReaderInterface *iface;
+
+	iface = (EomMetadataReaderInterface*) g_iface;
+
+	iface->consume =
+		(void (*) (EomMetadataReader *self, const guchar *buf, guint len))
+			eom_metadata_reader_png_consume;
+	iface->finished =
+		(gboolean (*) (EomMetadataReader *self))
+			eom_metadata_reader_png_finished;
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
+	iface->get_icc_profile =
+		(cmsHPROFILE (*) (EomMetadataReader *self))
+			eom_metadata_reader_png_get_icc_profile;
+#endif
+#ifdef HAVE_EXEMPI
+	iface->get_xmp_ptr =
+		(gpointer (*) (EomMetadataReader *self))
+			eom_metadata_reader_png_get_xmp_data;
+#endif
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/67.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/67.html new file mode 100644 index 0000000..0e505ef --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/67.html @@ -0,0 +1,499 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye Of MATE -- Metadata Reader Interface
+ *
+ * Copyright (C) 2008 The Free Software Foundation
+ *
+ * Author: Felix Riemann <friemann@svn.gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <gdk/gdk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "eom-metadata-reader.h"
+#include "eom-metadata-reader-jpg.h"
+#include "eom-metadata-reader-png.h"
+#include "eom-debug.h"
+
+G_DEFINE_INTERFACE (EomMetadataReader, eom_metadata_reader, G_TYPE_INVALID)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_INTERFACE is a macro then please configure it.
+
+EomMetadataReader*
+eom_metadata_reader_new (EomMetadataFileType type)
+{
+	EomMetadataReader *emr;
+
+	switch (type) {
+	case EOM_METADATA_JPEG:
+		emr = EOM_METADATA_READER (g_object_new (EOM_TYPE_METADATA_READER_JPG, NULL));
+		break;
+	case EOM_METADATA_PNG:
+		emr = EOM_METADATA_READER (g_object_new (EOM_TYPE_METADATA_READER_PNG, NULL));
+		break;
+	default:
+		emr = NULL;
+		break;
+	}
+
+	return emr;
+}
+
+gboolean
+eom_metadata_reader_finished (EomMetadataReader *emr)
+{
+	g_return_val_if_fail (EOM_IS_METADATA_READER (emr), TRUE);
+
+	return EOM_METADATA_READER_GET_INTERFACE (emr)->finished (emr);
+}
+
+void
+eom_metadata_reader_consume (EomMetadataReader *emr, const guchar *buf, guint len)
+{
+	EOM_METADATA_READER_GET_INTERFACE (emr)->consume (emr, buf, len);
+}
+
+/* Returns the raw exif data. NOTE: The caller of this function becomes
+ * the new owner of this piece of memory and is responsible for freeing it!
+ */
+void
+eom_metadata_reader_get_exif_chunk (EomMetadataReader *emr, guchar **data, guint *len)
+{
+	g_return_if_fail (data != NULL && len != NULL);
+
+	EOM_METADATA_READER_GET_INTERFACE (emr)->get_raw_exif (emr, data, len);
+}
+
+#ifdef HAVE_EXIF
+ExifData*
+eom_metadata_reader_get_exif_data (EomMetadataReader *emr)
+{
+	return EOM_METADATA_READER_GET_INTERFACE (emr)->get_exif_data (emr);
+}
+#endif
+
+#ifdef HAVE_EXEMPI
+XmpPtr
+eom_metadata_reader_get_xmp_data (EomMetadataReader *emr)
+{
+	return EOM_METADATA_READER_GET_INTERFACE (emr)->get_xmp_ptr (emr);
+}
+#endif
+
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
+cmsHPROFILE
+eom_metadata_reader_get_icc_profile (EomMetadataReader *emr)
+{
+	return EOM_METADATA_READER_GET_INTERFACE (emr)->get_icc_profile (emr);
+}
+#endif
+
+/* Default vfunc that simply clears the output if not overriden by the
+   implementing class. This mimics the old behavour of get_exif_chunk(). */
+static void
+_eom_metadata_reader_default_get_raw_exif (EomMetadataReader *emr,
+					   guchar **data, guint *length)
+{
+	g_return_if_fail (data != NULL && length != NULL);
+	*data = NULL;
+	*length = 0;
+}
+
+/* Default vfunc that simply returns NULL if not overriden by the implementing
+   class. Mimics the old fallback behaviour of the getter functions. */
+static gpointer
+_eom_metadata_reader_default_get_null (EomMetadataReader *emr)
+{
+	return NULL;
+}
+static void
+eom_metadata_reader_default_init (EomMetadataReaderInterface *iface)
+{
+	/* consume and finished are required to be implemented */
+	/* Not-implemented funcs return NULL by default */
+	iface->get_raw_exif = _eom_metadata_reader_default_get_raw_exif;
+	iface->get_exif_data = _eom_metadata_reader_default_get_null;
+	iface->get_icc_profile = _eom_metadata_reader_default_get_null;
+	iface->get_xmp_ptr = _eom_metadata_reader_default_get_null;
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/68.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/68.html new file mode 100644 index 0000000..d61cbb5 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/68.html @@ -0,0 +1,1321 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/*
+ * eom-metadata-sidebar.c
+ * This file is part of eom
+ *
+ * Author: Felix Riemann <friemann@gnome.org>
+ *
+ * Portions based on code by: Lucas Rocha <lucasr@gnome.org>
+ *                            Hubert Figuiere <hub@figuiere.net> (XMP support)
+ *
+ * Copyright (C) 2011 GNOME Foundation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "eom-image.h"
+#include "eom-metadata-sidebar.h"
+#include "eom-properties-dialog.h"
+#include "eom-scroll-view.h"
+#include "eom-util.h"
+#include "eom-window.h"
+
+#ifdef HAVE_EXIF
+#include <libexif/exif-data.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libexif/exif-tag.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "eom-exif-util.h"
+#endif
+
+#if HAVE_EXEMPI
+#include <exempi/xmp.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <exempi/xmpconsts.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+/* There's no exempi support in the sidebar yet */
+#if HAVE_EXIF  /*|| HAVE_EXEMPI */
+#define HAVE_METADATA 1
+#endif
+
+enum {
+	PROP_0,
+	PROP_IMAGE,
+	PROP_PARENT_WINDOW
+};
+
+struct _EomMetadataSidebarPrivate {
+	EomWindow *parent_window;
+	EomImage *image;
+
+	gulong image_changed_id;
+	gulong thumb_changed_id;
+
+	GtkWidget *size_label;
+	GtkWidget *type_label;
+	GtkWidget *filesize_label;
+	GtkWidget *folder_label;
+
+#if HAVE_EXIF
+	GtkWidget *aperture_label;
+	GtkWidget *exposure_label;
+	GtkWidget *focallen_label;
+	GtkWidget *iso_label;
+	GtkWidget *metering_label;
+	GtkWidget *model_label;
+	GtkWidget *date_label;
+	GtkWidget *time_label;
+#else
+	GtkWidget *metadata_grid;
+#endif
+
+#if HAVE_METADATA
+	GtkWidget *details_button;
+#endif
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE(EomMetadataSidebar, eom_metadata_sidebar, GTK_TYPE_SCROLLED_WINDOW)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
+
+static void
+parent_file_display_name_query_info_cb (GObject *source_object,
+                                        GAsyncResult *res,
+                                        gpointer user_data)
+{
+	EomMetadataSidebar *sidebar = EOM_METADATA_SIDEBAR (user_data);
+	GFile *parent_file = G_FILE (source_object);
+	GFileInfo *file_info;
+	gchar *baseuri;
+	gchar *display_name;
+	gchar *str;
+
+	file_info = g_file_query_info_finish (parent_file, res, NULL);
+	if (file_info == NULL) {
+		display_name = g_file_get_basename (parent_file);
+	} else {
+		display_name = g_strdup (
+			g_file_info_get_display_name (file_info));
+		g_object_unref (file_info);
+	}
+	baseuri = g_file_get_uri (parent_file);
+	str = g_markup_printf_escaped ("<a href=\"%s\">%s</a>",
+				       baseuri,
+				       display_name);
+	gtk_label_set_markup (GTK_LABEL (sidebar->priv->folder_label), str);
+
+	g_free (str);
+	g_free (baseuri);
+	g_free (display_name);
+
+	str = g_file_get_path (parent_file);
+	gtk_widget_set_tooltip_text (GTK_WIDGET (sidebar->priv->folder_label), str);
+	g_free (str);
+
+	g_object_unref (sidebar);
+}
+
+static void
+eom_metadata_sidebar_update_general_section (EomMetadataSidebar *sidebar)
+{
+	EomMetadataSidebarPrivate *priv = sidebar->priv;
+	EomImage *img = priv->image;
+	GFile *file, *parent_file;
+	GFileInfo *file_info;
+	gchar *str;
+	goffset bytes;
+	gint width, height;
+
+	if (G_UNLIKELY (img == NULL)) {
+		gtk_label_set_text (GTK_LABEL (priv->size_label), NULL);
+		gtk_label_set_text (GTK_LABEL (priv->type_label), NULL);
+		gtk_label_set_text (GTK_LABEL (priv->filesize_label), NULL);
+		gtk_label_set_text (GTK_LABEL (priv->folder_label), NULL);
+		return;
+	}
+
+	eom_image_get_size (img, &width, &height);
+	str = g_strdup_printf (ngettext("%i × %i pixel",
+					"%i × %i pixels", height),
+			       width, height);
+	gtk_label_set_text (GTK_LABEL (priv->size_label), str);
+	g_free (str);
+
+	file = eom_image_get_file (img);
+	file_info = g_file_query_info (file,
+				       G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+				       0, NULL, NULL);
+	if (file_info == NULL) {
+		str = g_strdup (_("Unknown"));
+	} else {
+		const gchar *mime_str;
+
+		mime_str = g_file_info_get_content_type (file_info);
+		str = g_content_type_get_description (mime_str);
+		g_object_unref (file_info);
+	}
+	gtk_label_set_text (GTK_LABEL (priv->type_label), str);
+	g_free (str);
+
+	bytes = eom_image_get_bytes (img);
+	str = g_format_size (bytes);
+	gtk_label_set_text (GTK_LABEL (priv->filesize_label), str);
+	g_free (str);
+
+	parent_file = g_file_get_parent (file);
+	if (parent_file == NULL) {
+		/* file is root directory itself */
+		parent_file = g_object_ref (file);
+	}
+	gtk_label_set_markup (GTK_LABEL (sidebar->priv->folder_label), NULL);
+	g_file_query_info_async (parent_file,
+				 G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME,
+				 G_FILE_QUERY_INFO_NONE,
+				 G_PRIORITY_DEFAULT,
+				 NULL,
+				 parent_file_display_name_query_info_cb,
+				 g_object_ref (sidebar));
+
+	g_object_unref (parent_file);
+}
+
+#if HAVE_METADATA
+static void
+eom_metadata_sidebar_update_metadata_section (EomMetadataSidebar *sidebar)
+{
+	EomMetadataSidebarPrivate *priv = sidebar->priv;
+#if HAVE_EXIF
+	EomImage *img = priv->image;
+	ExifData *exif_data = NULL;
+
+	if (img) {
+		exif_data = eom_image_get_exif_info (img);
+	}
+
+	eom_exif_util_set_label_text (GTK_LABEL (priv->aperture_label),
+				      exif_data, EXIF_TAG_FNUMBER);
+	eom_exif_util_set_label_text (GTK_LABEL (priv->exposure_label),
+				      exif_data,
+				      EXIF_TAG_EXPOSURE_TIME);
+	eom_exif_util_set_focal_length_label_text (
+				       GTK_LABEL (priv->focallen_label),
+				       exif_data);
+	eom_exif_util_set_label_text (GTK_LABEL (priv->iso_label),
+				      exif_data,
+				      EXIF_TAG_ISO_SPEED_RATINGS);
+	eom_exif_util_set_label_text (GTK_LABEL (priv->metering_label),
+				      exif_data,
+				      EXIF_TAG_METERING_MODE);
+	eom_exif_util_set_label_text (GTK_LABEL (priv->model_label),
+				      exif_data, EXIF_TAG_MODEL);
+	eom_exif_util_format_datetime_label (GTK_LABEL (priv->date_label),
+				      exif_data,
+				      EXIF_TAG_DATE_TIME_ORIGINAL,
+				      _("%a, %d %B %Y"));
+	eom_exif_util_format_datetime_label (GTK_LABEL (priv->time_label),
+				      exif_data,
+				      EXIF_TAG_DATE_TIME_ORIGINAL,
+				      _("%X"));
+
+	/* exif_data_unref can handle NULL-values */
+	exif_data_unref(exif_data);
+#endif /* HAVE_EXIF */
+}
+#endif /* HAVE_METADATA */
+
+static void
+eom_metadata_sidebar_update (EomMetadataSidebar *sidebar)
+{
+	g_return_if_fail (EOM_IS_METADATA_SIDEBAR (sidebar));
+
+	eom_metadata_sidebar_update_general_section (sidebar);
+#if HAVE_METADATA
+	eom_metadata_sidebar_update_metadata_section (sidebar);
+#endif
+}
+
+static void
+_thumbnail_changed_cb (EomImage *image, gpointer user_data)
+{
+	eom_metadata_sidebar_update (EOM_METADATA_SIDEBAR (user_data));
+}
+
+static void
+eom_metadata_sidebar_set_image (EomMetadataSidebar *sidebar, EomImage *image)
+{
+	EomMetadataSidebarPrivate *priv = sidebar->priv;
+
+	if (image == priv->image)
+		return;
+
+#if GLIB_CHECK_VERSION(2,62,0)
+	g_clear_signal_handler (&priv->thumb_changed_id,
+	                        priv->image);
+#else
+	if (priv->thumb_changed_id != 0) {
+		g_signal_handler_disconnect (priv->image,
+					     priv->thumb_changed_id);
+		priv->thumb_changed_id = 0;
+	}
+#endif
+
+	if (priv->image)
+		g_object_unref (priv->image);
+
+	priv->image = image;
+
+	if (priv->image) {
+		g_object_ref (priv->image);
+		priv->thumb_changed_id =
+			g_signal_connect (priv->image, "thumbnail-changed",
+					  G_CALLBACK (_thumbnail_changed_cb),
+					  sidebar);
+		eom_metadata_sidebar_update (sidebar);
+	}
+
+	g_object_notify (G_OBJECT (sidebar), "image");
+}
+
+static void
+_notify_image_cb (GObject *gobject, GParamSpec *pspec, gpointer user_data)
+{
+	EomImage *image;
+
+	g_return_if_fail (EOM_IS_METADATA_SIDEBAR (user_data));
+	g_return_if_fail (EOM_IS_SCROLL_VIEW (gobject));
+
+	image = eom_scroll_view_get_image (EOM_SCROLL_VIEW (gobject));
+
+	eom_metadata_sidebar_set_image (EOM_METADATA_SIDEBAR (user_data),
+					image);
+
+	if (image)
+		g_object_unref (image);
+}
+
+static void
+_folder_label_clicked_cb (GtkLabel *label, const gchar *uri, gpointer user_data)
+{
+	EomMetadataSidebarPrivate *priv = EOM_METADATA_SIDEBAR(user_data)->priv;
+	EomImage *img;
+	GtkWidget *toplevel;
+	GtkWindow *window;
+	GFile *file;
+
+	g_return_if_fail (priv->parent_window != NULL);
+
+	img = eom_window_get_image (priv->parent_window);
+	file = eom_image_get_file (img);
+
+	toplevel = gtk_widget_get_toplevel (GTK_WIDGET (label));
+	if (GTK_IS_WINDOW (toplevel))
+		window = GTK_WINDOW (toplevel);
+	else
+		window = NULL;
+
+	eom_util_show_file_in_filemanager (file, window);
+
+	g_object_unref (file);
+}
+
+#ifdef HAVE_METADATA
+static void
+_details_button_clicked_cb (GtkButton *button, gpointer user_data)
+{
+	EomMetadataSidebarPrivate *priv = EOM_METADATA_SIDEBAR(user_data)->priv;
+	GtkWidget *dlg;
+
+	g_return_if_fail (priv->parent_window != NULL);
+
+	dlg = eom_window_get_properties_dialog (
+					EOM_WINDOW (priv->parent_window));
+	g_return_if_fail (dlg != NULL);
+	eom_properties_dialog_set_page (EOM_PROPERTIES_DIALOG (dlg),
+					EOM_PROPERTIES_DIALOG_PAGE_DETAILS);
+	gtk_widget_show (dlg);
+}
+#endif /* HAVE_METADATA */
+
+static void
+eom_metadata_sidebar_set_parent_window (EomMetadataSidebar *sidebar,
+					EomWindow *window)
+{
+	EomMetadataSidebarPrivate *priv;
+	GtkWidget *view;
+
+	g_return_if_fail (EOM_IS_METADATA_SIDEBAR (sidebar));
+	priv = sidebar->priv;
+	g_return_if_fail (priv->parent_window == NULL);
+
+	priv->parent_window = g_object_ref (window);
+	eom_metadata_sidebar_update (sidebar);
+	view = eom_window_get_view (window);
+	priv->image_changed_id = g_signal_connect (view, "notify::image",
+						  G_CALLBACK (_notify_image_cb),
+						  sidebar);
+
+	g_object_notify (G_OBJECT (sidebar), "parent-window");
+
+}
+
+static void
+eom_metadata_sidebar_init (EomMetadataSidebar *sidebar)
+{
+	EomMetadataSidebarPrivate *priv;
+
+	priv = sidebar->priv = eom_metadata_sidebar_get_instance_private (sidebar);
+
+	gtk_widget_init_template (GTK_WIDGET (sidebar));
+
+	g_signal_connect (priv->folder_label, "activate-link",
+	                  G_CALLBACK (_folder_label_clicked_cb), sidebar);
+
+#if HAVE_METADATA
+	g_signal_connect (priv->details_button, "clicked",
+			  G_CALLBACK (_details_button_clicked_cb), sidebar);
+#endif /* HAVE_METADATA */
+
+#ifndef HAVE_EXIF
+	{
+		/* Remove the lower 8 lines as they are empty without libexif*/
+		guint i;
+
+		for (i = 11; i > 3; i--)
+		{
+			gtk_grid_remove_row (GTK_GRID (priv->metadata_grid), i);
+		}
+	}
+#endif /* !HAVE_EXIF */
+}
+
+static void
+eom_metadata_sidebar_get_property (GObject *object, guint property_id,
+				   GValue *value, GParamSpec *pspec)
+{
+	EomMetadataSidebar *sidebar;
+
+	g_return_if_fail (EOM_IS_METADATA_SIDEBAR (object));
+
+	sidebar = EOM_METADATA_SIDEBAR (object);
+
+	switch (property_id) {
+	case PROP_IMAGE:
+	{
+		g_value_set_object (value, sidebar->priv->image);
+		break;
+	}
+	case PROP_PARENT_WINDOW:
+		g_value_set_object (value, sidebar->priv->parent_window);
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+	}
+}
+
+static void
+eom_metadata_sidebar_set_property (GObject *object, guint property_id,
+				   const GValue *value, GParamSpec *pspec)
+{
+	EomMetadataSidebar *sidebar;
+
+	g_return_if_fail (EOM_IS_METADATA_SIDEBAR (object));
+
+	sidebar = EOM_METADATA_SIDEBAR (object);
+
+	switch (property_id) {
+	case PROP_IMAGE:
+	{
+		break;
+	}
+	case PROP_PARENT_WINDOW:
+	{
+		EomWindow *window;
+
+		window = g_value_get_object (value);
+		eom_metadata_sidebar_set_parent_window (sidebar, window);
+		break;
+	}
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+	}
+
+}
+static void
+eom_metadata_sidebar_class_init (EomMetadataSidebarClass *klass)
+{
+	GObjectClass *g_obj_class = G_OBJECT_CLASS (klass);
+	GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+	g_obj_class->get_property = eom_metadata_sidebar_get_property;
+	g_obj_class->set_property = eom_metadata_sidebar_set_property;
+/*	g_obj_class->dispose = eom_metadata_sidebar_dispose;*/
+
+	g_object_class_install_property (
+		g_obj_class, PROP_PARENT_WINDOW,
+		g_param_spec_object ("parent-window", NULL, NULL,
+				     EOM_TYPE_WINDOW, G_PARAM_READWRITE
+				     | G_PARAM_CONSTRUCT_ONLY
+				     | G_PARAM_STATIC_STRINGS));
+	g_object_class_install_property (
+		g_obj_class, PROP_IMAGE,
+		g_param_spec_object ("image", NULL, NULL, EOM_TYPE_IMAGE,
+				     G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
+				    );
+
+	gtk_widget_class_set_template_from_resource (widget_class,
+						     "/org/mate/eom/ui/metadata-sidebar.ui");
+
+	gtk_widget_class_bind_template_child_private (widget_class,
+						      EomMetadataSidebar,
+						      size_label);
+	gtk_widget_class_bind_template_child_private (widget_class,
+						      EomMetadataSidebar,
+						      type_label);
+	gtk_widget_class_bind_template_child_private (widget_class,
+						      EomMetadataSidebar,
+						      filesize_label);
+	gtk_widget_class_bind_template_child_private (widget_class,
+						      EomMetadataSidebar,
+						      folder_label);
+#if HAVE_EXIF
+	gtk_widget_class_bind_template_child_private (widget_class,
+						      EomMetadataSidebar,
+						      aperture_label);
+	gtk_widget_class_bind_template_child_private (widget_class,
+						      EomMetadataSidebar,
+						      exposure_label);
+	gtk_widget_class_bind_template_child_private (widget_class,
+						      EomMetadataSidebar,
+						      focallen_label);
+	gtk_widget_class_bind_template_child_private (widget_class,
+						      EomMetadataSidebar,
+						      iso_label);
+	gtk_widget_class_bind_template_child_private (widget_class,
+						      EomMetadataSidebar,
+						      metering_label);
+	gtk_widget_class_bind_template_child_private (widget_class,
+						      EomMetadataSidebar,
+						      model_label);
+	gtk_widget_class_bind_template_child_private (widget_class,
+						      EomMetadataSidebar,
+						      date_label);
+	gtk_widget_class_bind_template_child_private (widget_class,
+						      EomMetadataSidebar,
+						      time_label);
+#else
+	gtk_widget_class_bind_template_child_private (widget_class,
+						      EomMetadataSidebar,
+						      metadata_grid);
+#endif /* HAVE_EXIF */
+#if HAVE_METADATA
+	gtk_widget_class_bind_template_child_private (widget_class,
+						      EomMetadataSidebar,
+						      details_button);
+#endif /* HAVE_METADATA */
+}
+
+GtkWidget*
+eom_metadata_sidebar_new (EomWindow *window)
+{
+	return gtk_widget_new (EOM_TYPE_METADATA_SIDEBAR,
+			       "hadjustment", NULL,
+			       "vadjustment", NULL,
+			       "hscrollbar-policy", GTK_POLICY_NEVER,
+			       "vscrollbar-policy", GTK_POLICY_AUTOMATIC,
+			       "parent-window", window,
+			       NULL);
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/69.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/69.html new file mode 100644 index 0000000..990dedf --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/69.html @@ -0,0 +1,359 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/*
+ * eom-metadata-sidebar.h
+ * This file is part of eom
+ *
+ * Author: Felix Riemann <friemann@gnome.org>
+ *
+ * Copyright (C) 2011 GNOME Foundation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+#ifndef EOM_METADATA_SIDEBAR_H
+#define EOM_METADATA_SIDEBAR_H
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "eom-window.h"
+
+G_BEGIN_DECLS
+
+#define EOM_TYPE_METADATA_SIDEBAR          (eom_metadata_sidebar_get_type ())
+#define EOM_METADATA_SIDEBAR(o)            (G_TYPE_CHECK_INSTANCE_CAST ((o), EOM_TYPE_METADATA_SIDEBAR, EomMetadataSidebar))
+#define EOM_METADATA_SIDEBAR_CLASS(k)      (G_TYPE_CHECK_CLASS_CAST((k), EOM_TYPE_METADATA_SIDEBAR, EomMetadataSidebarClass))
+#define EOM_IS_METADATA_SIDEBAR(o)         (G_TYPE_CHECK_INSTANCE_TYPE ((o), EOM_TYPE_METADATA_SIDEBAR))
+#define EOM_IS_METADATA_SIDEBAR_CLASS(k)   (G_TYPE_CHECK_CLASS_TYPE ((k), EOM_TYPE_METADATA_SIDEBAR))
+#define EOM_METADATA_SIDEBAR_GET_CLASS(o)  (G_TYPE_INSTANCE_GET_CLASS ((o), EOM_TYPE_METADATA_SIDEBAR, EomMetadataSidebarClass))
+
+typedef struct _EomMetadataSidebar EomMetadataSidebar;
+typedef struct _EomMetadataSidebarClass EomMetadataSidebarClass;
+typedef struct _EomMetadataSidebarPrivate EomMetadataSidebarPrivate;
+
+struct _EomMetadataSidebar {
+	GtkScrolledWindow parent;
+
+	EomMetadataSidebarPrivate *priv;
+};
+
+struct _EomMetadataSidebarClass {
+	GtkScrolledWindowClass parent_klass;
+};
+
+GType eom_metadata_sidebar_get_type (void) G_GNUC_CONST;
+
+GtkWidget* eom_metadata_sidebar_new (EomWindow *window);
+
+G_END_DECLS
+
+#endif /* EOM_METADATA_SIDEBAR_H */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/7.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/7.html new file mode 100644 index 0000000..0440391 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/7.html @@ -0,0 +1,279 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
/* This file is generated by glib-genmarshal, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */
+#ifndef ___EGG_MARSHAL_MARSHAL_H__
+#define ___EGG_MARSHAL_MARSHAL_H__
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+/* VOID:INT,INT (./eggmarshalers.list:1) */
+G_GNUC_INTERNAL
+void _egg_marshal_VOID__INT_INT (GClosure     *closure,
+                                 GValue       *return_value,
+                                 guint         n_param_values,
+                                 const GValue *param_values,
+                                 gpointer      invocation_hint,
+                                 gpointer      marshal_data);
+
+
+G_END_DECLS
+
+#endif /* ___EGG_MARSHAL_MARSHAL_H__ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/70.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/70.html new file mode 100644 index 0000000..2bc0463 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/70.html @@ -0,0 +1,509 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "eom-pixbuf-util.h"
+
+GSList*
+eom_pixbuf_get_savable_formats (void)
+{
+	GSList *list;
+	GSList *write_list = NULL;
+	GSList *it;
+
+	list = gdk_pixbuf_get_formats ();
+
+	for (it = list; it != NULL; it = it->next) {
+		GdkPixbufFormat *format;
+
+		format = (GdkPixbufFormat*) it->data;
+		if (gdk_pixbuf_format_is_writable (format)) {
+			write_list = g_slist_prepend (write_list, format);
+		}
+	}
+
+	g_slist_free (list);
+	write_list = g_slist_reverse (write_list);
+
+	return write_list;
+}
+
+GdkPixbufFormat*
+eom_pixbuf_get_format_by_suffix (const char *suffix)
+{
+	GSList *list;
+	GSList *it;
+	GdkPixbufFormat *result = NULL;
+
+	g_return_val_if_fail (suffix != NULL, NULL);
+
+	list = gdk_pixbuf_get_formats ();
+
+	for (it = list; (it != NULL) && (result == NULL); it = it->next) {
+		GdkPixbufFormat *format;
+		gchar **extensions;
+		int i;
+
+		format = (GdkPixbufFormat*) it->data;
+
+		extensions = gdk_pixbuf_format_get_extensions (format);
+		for (i = 0; extensions[i] != NULL; i++) {
+			/* g_print ("check extension: %s against %s\n", extensions[i], suffix); */
+			if (g_ascii_strcasecmp (suffix, extensions[i]) == 0) {
+				result = format;
+				break;
+			}
+		}
+
+		g_strfreev (extensions);
+	}
+
+	g_slist_free (list);
+
+	return result;
+}
+
+char*
+eom_pixbuf_get_common_suffix (GdkPixbufFormat *format)
+{
+	char **extensions;
+	int i;
+	char *result = NULL;
+
+	if (format == NULL) return NULL;
+
+	extensions = gdk_pixbuf_format_get_extensions (format);
+	if (extensions[0] == NULL) return NULL;
+
+	/* try to find 3-char suffix first, use the last occurence */
+	for (i = 0; extensions [i] != NULL; i++) {
+		if (strlen (extensions[i]) <= 3) {
+			g_free (result);
+			result = g_ascii_strdown (extensions[i], -1);
+		}
+	}
+
+	/* otherwise take the first one */
+	if (result == NULL) {
+		result = g_ascii_strdown (extensions[0], -1);
+	}
+
+	g_strfreev (extensions);
+
+	return result;
+}
+
+static char*
+get_suffix_from_basename (const char *basename)
+{
+	char *suffix;
+	char *suffix_start;
+	guint len;
+
+	/* FIXME: does this work for all locales? */
+	suffix_start = g_utf8_strrchr (basename, -1, '.');
+
+	if (suffix_start == NULL)
+		return NULL;
+
+	len = strlen (suffix_start) - 1;
+	suffix = g_strndup (suffix_start+1, len);
+
+	return suffix;
+
+}
+
+GdkPixbufFormat *
+eom_pixbuf_get_format (GFile *file)
+{
+	GdkPixbufFormat *format;
+	char *path, *basename, *suffix;
+	g_return_val_if_fail (file != NULL, NULL);
+
+	path = g_file_get_path (file);
+	basename = g_path_get_basename (path);
+	suffix = get_suffix_from_basename (basename);
+
+	format = eom_pixbuf_get_format_by_suffix (suffix);
+
+	g_free (path);
+	g_free (basename);
+	g_free (suffix);
+
+	return format;
+}
+
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/71.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/71.html new file mode 100644 index 0000000..5c0bdb8 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/71.html @@ -0,0 +1,515 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye Of Mate - EOM Plugin Manager
+ *
+ * Copyright (C) 2007 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on gedit code (gedit/gedit-module.c) by:
+ * 	- Paolo Maggi <paolo@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include "eom-plugin-engine.h"
+#include "eom-debug.h"
+#include "eom-config-keys.h"
+#include "eom-util.h"
+
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <girepository.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define USER_EOM_PLUGINS_LOCATION "plugins/"
+
+struct _EomPluginEnginePrivate {
+	GSettings *plugins_settings;
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (EomPluginEngine, eom_plugin_engine, PEAS_TYPE_ENGINE)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
+
+static void
+eom_plugin_engine_dispose (GObject *object)
+{
+	EomPluginEngine *engine = EOM_PLUGIN_ENGINE (object);
+
+	if (engine->priv->plugins_settings != NULL)
+	{
+		g_object_unref (engine->priv->plugins_settings);
+		engine->priv->plugins_settings = NULL;
+	}
+
+	G_OBJECT_CLASS (eom_plugin_engine_parent_class)->dispose (object);
+}
+
+static void
+eom_plugin_engine_class_init (EomPluginEngineClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	object_class->dispose = eom_plugin_engine_dispose;
+}
+
+static void
+eom_plugin_engine_init (EomPluginEngine *engine)
+{
+	eom_debug (DEBUG_PLUGINS);
+
+	engine->priv = eom_plugin_engine_get_instance_private (engine);
+
+	engine->priv->plugins_settings = g_settings_new (EOM_CONF_PLUGINS);
+}
+
+EomPluginEngine *
+eom_plugin_engine_new (void)
+{
+	EomPluginEngine *engine;
+	gchar *user_plugin_path;
+	gchar *private_path;
+	GError *error = NULL;
+
+	private_path = g_build_filename (LIBDIR, "girepository-1.0", NULL);
+
+	/* This should be moved to libpeas */
+	if (g_irepository_require (g_irepository_get_default (),
+	                           "Peas", "1.0", 0, &error) == NULL)
+	{
+		g_warning ("Error loading Peas typelib: %s\n",
+		           error->message);
+		g_clear_error (&error);
+	}
+
+	if (g_irepository_require (g_irepository_get_default (),
+	                           "PeasGtk", "1.0", 0, &error) == NULL)
+	{
+		g_warning ("Error loading PeasGtk typelib: %s\n",
+		           error->message);
+		g_clear_error (&error);
+	}
+
+	if (g_irepository_require_private (g_irepository_get_default (),
+	                                   private_path, "Eom", "1.0", 0,
+	                                   &error) == NULL)
+	{
+		g_warning ("Error loading Eom typelib: %s\n",
+		           error->message);
+		g_clear_error (&error);
+	}
+
+	g_free (private_path);
+
+	engine = EOM_PLUGIN_ENGINE (g_object_new (EOM_TYPE_PLUGIN_ENGINE, NULL));
+
+	peas_engine_enable_loader (PEAS_ENGINE (engine), "python3");
+
+	user_plugin_path = g_build_filename (eom_util_dot_dir (),
+	                                     USER_EOM_PLUGINS_LOCATION, NULL);
+
+	peas_engine_add_search_path (PEAS_ENGINE (engine),
+	                             user_plugin_path, user_plugin_path);
+
+	peas_engine_add_search_path (PEAS_ENGINE (engine),
+	                             EOM_PLUGIN_DIR, EOM_PLUGIN_DIR);
+
+	g_settings_bind (engine->priv->plugins_settings,
+	                 EOM_CONF_PLUGINS_ACTIVE_PLUGINS,
+	                 engine,
+	                 "loaded-plugins",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	g_free (user_plugin_path);
+
+	return engine;
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/72.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/72.html new file mode 100644 index 0000000..29fcf74 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/72.html @@ -0,0 +1,365 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/* Eye Of Mate - EOM Preferences Dialog
+ *
+ * Copyright (C) 2006 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __EOM_PREFERENCES_DIALOG_H__
+#define __EOM_PREFERENCES_DIALOG_H__
+
+#include "eom-image.h"
+#include "eom-thumb-view.h"
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+typedef struct _EomPreferencesDialog EomPreferencesDialog;
+typedef struct _EomPreferencesDialogClass EomPreferencesDialogClass;
+typedef struct _EomPreferencesDialogPrivate EomPreferencesDialogPrivate;
+
+#define EOM_TYPE_PREFERENCES_DIALOG            (eom_preferences_dialog_get_type ())
+#define EOM_PREFERENCES_DIALOG(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), EOM_TYPE_PREFERENCES_DIALOG, EomPreferencesDialog))
+#define EOM_PREFERENCES_DIALOG_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  EOM_TYPE_PREFERENCES_DIALOG, EomPreferencesDialogClass))
+#define EOM_IS_PREFERENCES_DIALOG(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), EOM_TYPE_PREFERENCES_DIALOG))
+#define EOM_IS_PREFERENCES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  EOM_TYPE_PREFERENCES_DIALOG))
+#define EOM_PREFERENCES_DIALOG_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  EOM_TYPE_PREFERENCES_DIALOG, EomPreferencesDialogClass))
+
+struct _EomPreferencesDialog {
+	GtkDialog dialog;
+
+	EomPreferencesDialogPrivate *priv;
+};
+
+struct _EomPreferencesDialogClass {
+	GtkDialogClass parent_class;
+};
+
+G_GNUC_INTERNAL
+GType	    eom_preferences_dialog_get_type	  (void) G_GNUC_CONST;
+
+G_GNUC_INTERNAL
+GtkWidget    *eom_preferences_dialog_get_instance	  (GtkWindow   *parent);
+
+G_END_DECLS
+
+#endif /* __EOM_PREFERENCES_DIALOG_H__ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/73.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/73.html new file mode 100644 index 0000000..8ff8ec0 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/73.html @@ -0,0 +1,913 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye Of Mate - EOM Preferences Dialog
+ *
+ * Copyright (C) 2006 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on code by:
+ *	- Jens Finke <jens@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"<--- Include file: "config.h" not found.
+#endif
+
+#include "eom-preferences-dialog.h"
+#include "eom-scroll-view.h"
+#include "eom-util.h"
+#include "eom-config-keys.h"
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libpeas-gtk/peas-gtk-plugin-manager.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define GSETTINGS_OBJECT_VALUE		"GSETTINGS_VALUE"
+
+struct _EomPreferencesDialogPrivate {
+	GSettings    *view_settings;
+	GSettings    *ui_settings;<--- struct member '_EomPreferencesDialogPrivate::ui_settings' is never used.
+	GSettings    *fullscreen_settings;
+
+	GtkWidget     *notebook;
+	GtkWidget     *interpolate_check;
+	GtkWidget     *extrapolate_check;
+	GtkWidget     *autorotate_check;
+	GtkWidget     *bg_color_check;
+	GtkWidget     *bg_color_button;
+	GtkWidget     *color_radio;
+	GtkWidget     *checkpattern_radio;
+	GtkWidget     *background_radio;
+	GtkWidget     *transp_color_button;
+
+	GtkWidget     *upscale_check;
+	GtkWidget     *random_check;
+	GtkWidget     *loop_check;
+	GtkWidget     *seconds_spin;
+
+	GtkWidget     *plugin_manager;
+};
+
+static GObject *instance = NULL;
+
+G_DEFINE_TYPE_WITH_PRIVATE (EomPreferencesDialog, eom_preferences_dialog, GTK_TYPE_DIALOG);
+
+static gboolean
+pd_string_to_rgba_mapping (GValue   *value,
+			    GVariant *variant,
+			    gpointer user_data)
+{
+	GdkRGBA color;
+
+	g_return_val_if_fail (g_variant_is_of_type (variant, G_VARIANT_TYPE_STRING), FALSE);
+
+	if (gdk_rgba_parse (&color, g_variant_get_string (variant, NULL))) {
+		g_value_set_boxed (value, &color);
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+static GVariant*
+pd_rgba_to_string_mapping (const GValue       *value,
+			    const GVariantType *expected_type,
+			    gpointer            user_data)
+{
+
+	GVariant *variant = NULL;
+	GdkRGBA *color;
+	gchar *hex_val;
+
+	g_return_val_if_fail (G_VALUE_TYPE (value) == GDK_TYPE_RGBA, NULL);
+	g_return_val_if_fail (g_variant_type_equal (expected_type, G_VARIANT_TYPE_STRING), NULL);
+
+	color = g_value_get_boxed (value);
+	hex_val = gdk_rgba_to_string(color);
+
+	variant = g_variant_new_string (hex_val);
+	g_free (hex_val);
+
+	return variant;
+}
+
+static void
+pd_transp_radio_toggle_cb (GtkWidget *widget, gpointer data)
+{
+	gpointer value = NULL;
+
+	if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
+	    return;
+
+	value = g_object_get_data (G_OBJECT (widget), GSETTINGS_OBJECT_VALUE);
+
+	g_settings_set_enum (G_SETTINGS (data), EOM_CONF_VIEW_TRANSPARENCY,
+			     GPOINTER_TO_INT (value));
+}
+
+static void
+random_change_cb (GSettings *settings, gchar *key, GtkWidget *widget)
+{
+	gtk_widget_set_sensitive (widget, !g_settings_get_boolean (settings, key));
+}
+
+static void
+eom_preferences_response_cb (GtkDialog *dlg, gint res_id, gpointer data)
+{
+	switch (res_id) {
+		case GTK_RESPONSE_HELP:
+			eom_util_show_help ("eom-prefs", NULL);
+			break;
+		default:
+			gtk_widget_destroy (GTK_WIDGET (dlg));
+			instance = NULL;
+	}
+}
+
+static void
+eom_preferences_dialog_class_init (EomPreferencesDialogClass *klass)
+{
+	GtkWidgetClass *widget_class = (GtkWidgetClass*) klass;
+
+	/* This should make sure the libpeas-gtk dependency isn't
+	 * dropped by aggressive linkers (#739618) */
+	g_type_ensure (PEAS_GTK_TYPE_PLUGIN_MANAGER);
+
+	gtk_widget_class_set_template_from_resource (widget_class,
+	                                             "/org/mate/eom/ui/eom-preferences-dialog.ui");
+	gtk_widget_class_bind_template_child_private (widget_class,
+	                                              EomPreferencesDialog,
+	                                              notebook);
+	gtk_widget_class_bind_template_child_private (widget_class,
+	                                              EomPreferencesDialog,
+	                                              interpolate_check);
+	gtk_widget_class_bind_template_child_private (widget_class,
+	                                              EomPreferencesDialog,
+	                                              extrapolate_check);
+	gtk_widget_class_bind_template_child_private (widget_class,
+	                                              EomPreferencesDialog,
+	                                              autorotate_check);
+	gtk_widget_class_bind_template_child_private (widget_class,
+	                                              EomPreferencesDialog,
+	                                              bg_color_check);
+	gtk_widget_class_bind_template_child_private (widget_class,
+	                                              EomPreferencesDialog,
+	                                              bg_color_button);
+	gtk_widget_class_bind_template_child_private (widget_class,
+	                                              EomPreferencesDialog,
+	                                              color_radio);
+	gtk_widget_class_bind_template_child_private (widget_class,
+	                                              EomPreferencesDialog,
+	                                              checkpattern_radio);
+	gtk_widget_class_bind_template_child_private (widget_class,
+	                                              EomPreferencesDialog,
+	                                              background_radio);
+	gtk_widget_class_bind_template_child_private (widget_class,
+	                                              EomPreferencesDialog,
+	                                              transp_color_button);
+
+	gtk_widget_class_bind_template_child_private (widget_class,
+	                                              EomPreferencesDialog,
+	                                              upscale_check);
+	gtk_widget_class_bind_template_child_private (widget_class,
+	                                              EomPreferencesDialog,
+	                                              random_check);
+	gtk_widget_class_bind_template_child_private (widget_class,
+	                                              EomPreferencesDialog,
+	                                              loop_check);
+	gtk_widget_class_bind_template_child_private (widget_class,
+	                                              EomPreferencesDialog,
+	                                              seconds_spin);
+
+	gtk_widget_class_bind_template_child_private (widget_class,
+	                                              EomPreferencesDialog,
+	                                              plugin_manager);
+}
+
+static void
+eom_preferences_dialog_init (EomPreferencesDialog *pref_dlg)
+{
+	EomPreferencesDialogPrivate *priv;
+
+	pref_dlg->priv = eom_preferences_dialog_get_instance_private (pref_dlg);
+	priv = pref_dlg->priv;
+
+	gtk_widget_init_template (GTK_WIDGET (pref_dlg));
+
+	priv->view_settings = g_settings_new (EOM_CONF_VIEW);
+	priv->fullscreen_settings = g_settings_new (EOM_CONF_FULLSCREEN);
+
+	g_signal_connect (pref_dlg, "response",
+	                  G_CALLBACK (eom_preferences_response_cb),
+	                  pref_dlg);
+
+	g_settings_bind (priv->view_settings,
+	                 EOM_CONF_VIEW_INTERPOLATE,
+	                 priv->interpolate_check, "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+	g_settings_bind (priv->view_settings,
+	                 EOM_CONF_VIEW_EXTRAPOLATE,
+	                 priv->extrapolate_check, "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+	g_settings_bind (priv->view_settings,
+	                 EOM_CONF_VIEW_AUTOROTATE,
+	                 priv->autorotate_check, "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+	g_settings_bind (priv->view_settings,
+	                 EOM_CONF_VIEW_USE_BG_COLOR,
+	                 priv->bg_color_check, "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	g_settings_bind_with_mapping (priv->view_settings,
+	                              EOM_CONF_VIEW_BACKGROUND_COLOR,
+	                              priv->bg_color_button, "rgba",
+	                              G_SETTINGS_BIND_DEFAULT,
+	                              pd_string_to_rgba_mapping,
+	                              pd_rgba_to_string_mapping,
+	                              NULL, NULL);
+	g_object_set_data (G_OBJECT (priv->color_radio),
+	                   GSETTINGS_OBJECT_VALUE,
+	                   GINT_TO_POINTER (EOM_TRANSP_COLOR));
+
+	g_signal_connect (priv->color_radio, "toggled",
+	                  G_CALLBACK (pd_transp_radio_toggle_cb),
+	                  priv->view_settings);
+
+	g_object_set_data (G_OBJECT (priv->checkpattern_radio),
+	                   GSETTINGS_OBJECT_VALUE,
+	                   GINT_TO_POINTER (EOM_TRANSP_CHECKED));
+
+	g_signal_connect (priv->checkpattern_radio, "toggled",
+	                  G_CALLBACK (pd_transp_radio_toggle_cb),
+	                  priv->view_settings);
+
+	g_object_set_data (G_OBJECT (priv->background_radio),
+	                   GSETTINGS_OBJECT_VALUE,
+	                   GINT_TO_POINTER (EOM_TRANSP_BACKGROUND));
+
+	g_signal_connect (priv->background_radio, "toggled",
+	                  G_CALLBACK (pd_transp_radio_toggle_cb),
+	                  priv->view_settings);
+
+	switch (g_settings_get_enum (priv->view_settings,
+				    EOM_CONF_VIEW_TRANSPARENCY))
+	{
+	case EOM_TRANSP_COLOR:
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->color_radio), TRUE);
+		break;
+	case EOM_TRANSP_CHECKED:
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->checkpattern_radio), TRUE);
+		break;
+	default:
+		// Log a warning and use EOM_TRANSP_BACKGROUND as fallback
+		g_warn_if_reached ();
+	case EOM_TRANSP_BACKGROUND:
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->background_radio), TRUE);
+		break;
+	}
+
+	g_settings_bind_with_mapping (priv->view_settings,
+	                              EOM_CONF_VIEW_TRANS_COLOR,
+	                              priv->transp_color_button, "rgba",
+	                              G_SETTINGS_BIND_DEFAULT,
+	                              pd_string_to_rgba_mapping,
+	                              pd_rgba_to_string_mapping,
+	                              NULL, NULL);
+
+	g_settings_bind (priv->fullscreen_settings, EOM_CONF_FULLSCREEN_UPSCALE,
+	                 priv->upscale_check, "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	g_settings_bind (priv->fullscreen_settings,
+	                 EOM_CONF_FULLSCREEN_LOOP,
+	                 priv->loop_check, "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	g_settings_bind (priv->fullscreen_settings,
+	                 EOM_CONF_FULLSCREEN_RANDOM,
+	                 priv->random_check, "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+	g_signal_connect (priv->fullscreen_settings, "changed::" EOM_CONF_FULLSCREEN_RANDOM,
+	                  G_CALLBACK (random_change_cb),
+	                  priv->loop_check);
+	random_change_cb (priv->fullscreen_settings,
+	                  EOM_CONF_FULLSCREEN_RANDOM,
+	                  priv->loop_check);
+
+	g_settings_bind (priv->fullscreen_settings,
+	                 EOM_CONF_FULLSCREEN_SECONDS,
+	                 priv->seconds_spin, "value",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	gtk_widget_show_all (priv->plugin_manager);
+
+    /* Add tab scrolling support for GTK3 */
+    gtk_widget_add_events (priv->notebook, GDK_SCROLL_MASK);
+    g_signal_connect (priv->notebook, "scroll-event",
+                      G_CALLBACK (eom_notebook_scroll_event_cb),
+                      NULL);
+}
+
+GtkWidget *eom_preferences_dialog_get_instance (GtkWindow *parent)
+{
+	if (instance == NULL) {
+		instance = g_object_new (EOM_TYPE_PREFERENCES_DIALOG,
+				 	 NULL);
+	}
+
+	if (parent)
+		gtk_window_set_transient_for (GTK_WINDOW (instance), parent);
+
+	return GTK_WIDGET(instance);
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/74.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/74.html new file mode 100644 index 0000000..896dfdf --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/74.html @@ -0,0 +1,2391 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
   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
/* Eye Of MATE -- Print Dialog Custom Widget
+ *
+ * Copyright (C) 2006-2007 The Free Software Foundation
+ *
+ * Author: Claudio Saavedra <csaavedra@alumnos.utalca.cl>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"<--- Include file: "config.h" not found.
+#endif
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtkunixprint.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gprintf.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#ifdef HAVE__NL_MEASUREMENT_MEASUREMENT
+#include <langinfo.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include "eom-print-image-setup.h"
+#include "eom-print-preview.h"
+
+/**
+ * SECTION:
+ * @Title: Printing Custom Widget
+ * @Short_Description: a custom widget to setup image prints.
+ * @Stability_Level: Internal
+ * @See_Also: #EomPrintPreview
+ *
+ * This widget is to be used as the custom widget in a #GtkPrintUnixDialog in
+ * EOM. Through it, you can set the position and scaling of a image
+ * interactively.
+ */
+
+struct _EomPrintImageSetupPrivate {
+	GtkWidget *left;
+	GtkWidget *right;
+	GtkWidget *top;
+	GtkWidget *bottom;
+
+	GtkWidget *center;
+
+	GtkWidget *width;
+	GtkWidget *height;
+
+	GtkWidget *scaling;
+	GtkWidget *unit;
+
+	GtkUnit current_unit;
+
+	EomImage *image;
+	GtkPageSetup *page_setup;
+
+	GtkWidget *preview;
+};
+
+enum {
+	PROP_0,
+	PROP_IMAGE,
+	PROP_PAGE_SETUP
+};
+
+enum {
+	CENTER_NONE,
+	CENTER_HORIZONTAL,
+	CENTER_VERTICAL,
+	CENTER_BOTH
+};
+
+enum {
+	CHANGE_HORIZ,
+	CHANGE_VERT
+};
+
+enum {
+	UNIT_INCH,
+	UNIT_MM
+};
+
+#define FACTOR_INCH_TO_MM 25.4
+#define FACTOR_INCH_TO_PIXEL 72.
+#define FACTOR_MM_TO_INCH 0.03937007874015748
+#define FACTOR_MM_TO_PIXEL 2.834645669
+
+static void eom_print_image_setup_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
+static void eom_print_image_setup_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
+
+static void on_left_value_changed   (GtkSpinButton *spinbutton, gpointer user_data);
+static void on_right_value_changed  (GtkSpinButton *spinbutton, gpointer user_data);
+static void on_top_value_changed    (GtkSpinButton *spinbutton, gpointer user_data);
+static void on_bottom_value_changed (GtkSpinButton *spinbutton, gpointer user_data);
+
+static void on_width_value_changed  (GtkSpinButton *spinbutton, gpointer user_data);
+static void on_height_value_changed (GtkSpinButton *spinbutton, gpointer user_data);
+
+G_DEFINE_TYPE_WITH_PRIVATE (EomPrintImageSetup, eom_print_image_setup, GTK_TYPE_GRID);
+
+static void
+block_handlers (EomPrintImageSetup *setup)
+{
+	EomPrintImageSetupPrivate *priv = setup->priv;
+
+	g_signal_handlers_block_by_func (priv->left, on_left_value_changed, setup);
+	g_signal_handlers_block_by_func (priv->right, on_right_value_changed, setup);
+	g_signal_handlers_block_by_func (priv->width, on_width_value_changed, setup);
+	g_signal_handlers_block_by_func (priv->top, on_top_value_changed, setup);
+	g_signal_handlers_block_by_func (priv->bottom, on_bottom_value_changed, setup);
+	g_signal_handlers_block_by_func (priv->height, on_height_value_changed, setup);
+}
+
+static void
+unblock_handlers (EomPrintImageSetup *setup)
+{
+	EomPrintImageSetupPrivate *priv = setup->priv;
+
+	g_signal_handlers_unblock_by_func (priv->left, on_left_value_changed, setup);
+	g_signal_handlers_unblock_by_func (priv->right, on_right_value_changed, setup);
+	g_signal_handlers_unblock_by_func (priv->width, on_width_value_changed, setup);
+	g_signal_handlers_unblock_by_func (priv->top, on_top_value_changed, setup);
+	g_signal_handlers_unblock_by_func (priv->bottom, on_bottom_value_changed, setup);
+	g_signal_handlers_unblock_by_func (priv->height, on_height_value_changed, setup);
+}
+
+static gdouble
+get_scale_to_px_factor (EomPrintImageSetup *setup)<--- Parameter 'setup' can be declared as pointer to const
+{
+	gdouble factor = 0.;
+
+	switch (setup->priv->current_unit) {
+	case GTK_UNIT_MM:
+		factor = FACTOR_MM_TO_PIXEL;
+		break;
+	case GTK_UNIT_INCH:
+		factor = FACTOR_INCH_TO_PIXEL;
+		break;
+	default:
+		g_assert_not_reached ();
+	}
+
+	return factor;
+}
+
+static gdouble
+get_max_percentage (EomPrintImageSetup *setup)
+{
+	EomPrintImageSetupPrivate *priv = setup->priv;
+	gdouble p_width, p_height;
+	gdouble width, height;
+	gint pix_width, pix_height;
+	gdouble perc;
+
+	p_width = gtk_page_setup_get_page_width (priv->page_setup, GTK_UNIT_INCH);
+	p_height = gtk_page_setup_get_page_height (priv->page_setup, GTK_UNIT_INCH);
+
+	eom_image_get_size (priv->image, &pix_width, &pix_height);
+
+	width  = (gdouble)pix_width/FACTOR_INCH_TO_PIXEL;
+	height = (gdouble)pix_height/FACTOR_INCH_TO_PIXEL;
+
+	if (p_width > width && p_height > height) {
+		perc = 1.;
+	} else {
+		perc = MIN (p_width/width, p_height/height);
+	}
+
+	return perc;
+}
+
+static void
+center (gdouble page_width,
+	gdouble width,
+	GtkSpinButton *s_left,
+	GtkSpinButton *s_right)
+{
+	gdouble left, right;
+
+	left = (page_width - width)/2;
+	right = page_width - left - width;
+	gtk_spin_button_set_value (s_left, left);
+	gtk_spin_button_set_value (s_right, right);
+}
+
+static void
+on_center_changed (GtkComboBox *combobox,
+		   gpointer user_data)
+{
+	EomPrintImageSetup *setup;
+	EomPrintImageSetupPrivate *priv;
+	gint active;
+
+	setup = EOM_PRINT_IMAGE_SETUP (user_data);
+	priv = setup->priv;
+
+	active = gtk_combo_box_get_active (combobox);
+
+	switch (active) {
+	case CENTER_HORIZONTAL:
+		center (gtk_page_setup_get_page_width (priv->page_setup,
+						       priv->current_unit),
+			gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->width)),
+			GTK_SPIN_BUTTON (priv->left),
+			GTK_SPIN_BUTTON (priv->right));
+		break;
+	case CENTER_VERTICAL:
+		center (gtk_page_setup_get_page_height (priv->page_setup,
+							priv->current_unit),
+			gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->height)),
+			GTK_SPIN_BUTTON (priv->top),
+			GTK_SPIN_BUTTON (priv->bottom));
+		break;
+	case CENTER_BOTH:
+		center (gtk_page_setup_get_page_width (priv->page_setup,
+						       priv->current_unit),
+			gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->width)),
+			GTK_SPIN_BUTTON (priv->left),
+			GTK_SPIN_BUTTON (priv->right));
+		center (gtk_page_setup_get_page_height (priv->page_setup,
+							priv->current_unit),
+			gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->height)),
+			GTK_SPIN_BUTTON (priv->top),
+			GTK_SPIN_BUTTON (priv->bottom));
+		break;
+	case CENTER_NONE:
+	default:
+		break;
+	}
+
+	gtk_combo_box_set_active (combobox, active);
+}
+
+static void
+update_image_pos_ranges (EomPrintImageSetup *setup,
+			 gdouble page_width,
+			 gdouble page_height,
+			 gdouble width,
+			 gdouble height)
+{
+	EomPrintImageSetupPrivate *priv;
+
+	priv = setup->priv;
+
+	gtk_spin_button_set_range (GTK_SPIN_BUTTON (priv->left),
+				   0, page_width - width);
+	gtk_spin_button_set_range (GTK_SPIN_BUTTON (priv->right),
+				   0, page_width - width);
+	gtk_spin_button_set_range (GTK_SPIN_BUTTON (priv->top),
+				   0, page_height - height);
+	gtk_spin_button_set_range (GTK_SPIN_BUTTON (priv->bottom),
+				   0, page_height - height);
+}
+
+static gboolean
+on_scale_changed (GtkRange     *range,
+		  gpointer      user_data)
+{
+	gdouble scale;
+	gdouble width, height;
+	gint pix_width, pix_height;
+	gdouble left, right, top, bottom;
+	gdouble page_width, page_height;
+	EomPrintImageSetupPrivate *priv;
+	EomPrintImageSetup *setup;
+	gdouble factor;
+	EomImage *image;
+
+	setup = EOM_PRINT_IMAGE_SETUP (user_data);
+	priv = setup->priv;
+
+	gtk_combo_box_set_active (GTK_COMBO_BOX (priv->center), CENTER_NONE);
+
+	image = priv->image;
+	eom_image_get_size (image, &pix_width, &pix_height);
+
+	factor = get_scale_to_px_factor (setup);
+
+	width = (gdouble)pix_width/factor;
+	height = (gdouble)pix_height/factor;
+
+	left = gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->left));
+	top = gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->top));
+
+	scale = CLAMP (0.01*gtk_range_get_value (range), 0, get_max_percentage (setup));
+
+ 	eom_print_preview_set_scale (EOM_PRINT_PREVIEW (priv->preview), scale);
+
+	width  *= scale;
+	height *= scale;
+
+	page_width = gtk_page_setup_get_page_width (priv->page_setup, priv->current_unit);
+	page_height = gtk_page_setup_get_page_height (priv->page_setup, priv->current_unit);
+
+	update_image_pos_ranges (setup, page_width, page_height, width, height);
+
+	right = page_width - left - width;
+	bottom = page_height - top - height;
+
+	gtk_spin_button_set_value (GTK_SPIN_BUTTON (priv->width), width);
+	gtk_spin_button_set_value (GTK_SPIN_BUTTON (priv->height), height);
+	gtk_spin_button_set_value (GTK_SPIN_BUTTON (priv->right), right);
+	gtk_spin_button_set_value (GTK_SPIN_BUTTON (priv->bottom), bottom);
+
+	return FALSE;
+}
+
+static gchar *
+on_scale_format_value (GtkScale *scale,
+		       gdouble value)
+{
+	return g_strdup_printf ("%i%%", (gint)value);
+}
+
+static void
+position_values_changed (EomPrintImageSetup *setup,
+			 GtkWidget *w_changed,
+			 GtkWidget *w_to_update,
+			 GtkWidget *w_size,
+			 gdouble total_size,
+			 gint change)
+{
+	EomPrintImageSetupPrivate *priv;
+	gdouble changed, to_update, size;
+	gdouble pos;
+
+	priv = setup->priv;
+	size = gtk_spin_button_get_value (GTK_SPIN_BUTTON (w_size));
+	changed = gtk_spin_button_get_value (GTK_SPIN_BUTTON (w_changed));
+
+	to_update = total_size - changed - size;
+	gtk_spin_button_set_value (GTK_SPIN_BUTTON (w_to_update), to_update);
+	gtk_combo_box_set_active (GTK_COMBO_BOX (priv->center), CENTER_NONE);
+
+	switch (change) {
+	case CHANGE_HORIZ:
+		pos = gtk_spin_button_get_value (GTK_SPIN_BUTTON (setup->priv->left));
+		if (setup->priv->current_unit == GTK_UNIT_MM) {
+			pos *= FACTOR_MM_TO_INCH;
+		}
+ 		eom_print_preview_set_image_position (EOM_PRINT_PREVIEW (priv->preview), pos, -1);
+		break;
+	case CHANGE_VERT:
+		pos = gtk_spin_button_get_value (GTK_SPIN_BUTTON (setup->priv->top));
+		if (setup->priv->current_unit == GTK_UNIT_MM) {
+			pos *= FACTOR_MM_TO_INCH;
+		}
+		eom_print_preview_set_image_position (EOM_PRINT_PREVIEW (priv->preview), -1, pos);
+		break;
+	}
+}
+
+static void
+on_left_value_changed (GtkSpinButton *spinbutton,
+		       gpointer       user_data)
+{
+	EomPrintImageSetup *setup;
+	EomPrintImageSetupPrivate *priv;
+
+	setup = EOM_PRINT_IMAGE_SETUP (user_data);
+	priv = setup->priv;
+
+	position_values_changed (setup,
+				 priv->left, priv->right, priv->width,
+				 gtk_page_setup_get_page_width (priv->page_setup,
+								priv->current_unit),
+				 CHANGE_HORIZ);
+}
+
+static void
+on_right_value_changed (GtkSpinButton *spinbutton,
+			gpointer       user_data)
+{
+	EomPrintImageSetupPrivate *priv;
+
+	priv = EOM_PRINT_IMAGE_SETUP (user_data)->priv;
+
+	position_values_changed (EOM_PRINT_IMAGE_SETUP (user_data),
+				 priv->right, priv->left, priv->width,
+				 gtk_page_setup_get_page_width (priv->page_setup,
+								priv->current_unit),
+				 CHANGE_HORIZ);
+}
+
+static void
+on_top_value_changed (GtkSpinButton *spinbutton,
+		      gpointer       user_data)
+{
+	EomPrintImageSetupPrivate *priv;
+
+	priv = EOM_PRINT_IMAGE_SETUP (user_data)->priv;
+
+	position_values_changed (EOM_PRINT_IMAGE_SETUP (user_data),
+				 priv->top, priv->bottom, priv->height,
+				 gtk_page_setup_get_page_height (priv->page_setup,
+								 priv->current_unit),
+				 CHANGE_VERT);
+}
+
+static void
+on_bottom_value_changed (GtkSpinButton *spinbutton,
+			 gpointer       user_data)
+{
+	EomPrintImageSetupPrivate *priv;
+
+	priv = EOM_PRINT_IMAGE_SETUP (user_data)->priv;
+
+	position_values_changed (EOM_PRINT_IMAGE_SETUP (user_data),
+				 priv->bottom, priv->top, priv->height,
+				 gtk_page_setup_get_page_height (priv->page_setup,
+								 priv->current_unit),
+				 CHANGE_VERT);
+}
+
+static void
+size_changed (EomPrintImageSetup *setup,
+	      GtkWidget *w_size_x,
+	      GtkWidget *w_size_y,
+	      GtkWidget *w_margin_x_1,
+	      GtkWidget *w_margin_x_2,
+	      GtkWidget *w_margin_y_1,
+	      GtkWidget *w_margin_y_2,
+	      gdouble page_size_x,
+	      gdouble page_size_y,
+	      gint change)
+{
+	EomPrintImageSetupPrivate *priv;
+	gdouble margin_x_1, margin_x_2;
+	gdouble margin_y_1, margin_y_2;
+	gdouble orig_size_x = -1, orig_size_y = -1, scale;
+	gdouble size_x, size_y;
+	gint pix_width, pix_height;
+	gdouble factor;
+
+	priv = setup->priv;
+
+	size_x = gtk_spin_button_get_value (GTK_SPIN_BUTTON (w_size_x));
+	margin_x_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON (w_margin_x_1));
+	margin_y_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON (w_margin_y_1));
+
+	eom_image_get_size (priv->image, &pix_width, &pix_height);
+
+	factor = get_scale_to_px_factor (setup);
+
+	switch (change) {
+	case CHANGE_HORIZ:
+		orig_size_x = (gdouble) pix_width / factor;
+		orig_size_y = (gdouble) pix_height / factor;
+		break;
+	case CHANGE_VERT:
+		orig_size_y = (gdouble) pix_width / factor;
+		orig_size_x = (gdouble) pix_height / factor;
+		break;
+	}
+
+	scale = CLAMP (size_x / orig_size_x, 0, 1);
+
+	size_y = scale * orig_size_y;
+
+	margin_x_2 = page_size_x - margin_x_1 - size_x;
+	margin_y_2 = page_size_y - margin_y_1 - size_y;
+
+ 	eom_print_preview_set_scale (EOM_PRINT_PREVIEW (priv->preview), scale);
+
+	switch (change) {
+	case CHANGE_HORIZ:
+		update_image_pos_ranges (setup, page_size_x, page_size_y, size_x, size_y);
+		break;
+	case CHANGE_VERT:
+		update_image_pos_ranges (setup, page_size_y, page_size_x, size_y, size_x);
+		break;
+	}
+
+	gtk_range_set_value (GTK_RANGE (priv->scaling), 100*scale);
+
+	gtk_spin_button_set_value (GTK_SPIN_BUTTON (w_margin_x_2), margin_x_2);
+	gtk_spin_button_set_value (GTK_SPIN_BUTTON (w_size_y), size_y);
+	gtk_spin_button_set_value (GTK_SPIN_BUTTON (w_margin_y_2), margin_y_2);
+
+	gtk_combo_box_set_active (GTK_COMBO_BOX (priv->center), CENTER_NONE);
+}
+
+static void
+on_width_value_changed (GtkSpinButton *spinbutton,
+			gpointer       user_data)
+{
+	EomPrintImageSetupPrivate *priv = EOM_PRINT_IMAGE_SETUP (user_data)->priv;
+
+	size_changed (EOM_PRINT_IMAGE_SETUP (user_data),
+		      priv->width, priv->height,
+		      priv->left, priv->right,
+		      priv->top, priv->bottom,
+		      gtk_page_setup_get_page_width (priv->page_setup,
+						     priv->current_unit),
+		      gtk_page_setup_get_page_height (priv->page_setup,
+						      priv->current_unit),
+		      CHANGE_HORIZ);
+}
+
+static void
+on_height_value_changed (GtkSpinButton *spinbutton,
+			 gpointer       user_data)
+{
+	EomPrintImageSetupPrivate *priv = EOM_PRINT_IMAGE_SETUP (user_data)->priv;
+
+	size_changed (EOM_PRINT_IMAGE_SETUP (user_data),
+		      priv->height, priv->width,
+		      priv->top, priv->bottom,
+		      priv->left, priv->right,
+		      gtk_page_setup_get_page_height (priv->page_setup,
+						     priv->current_unit),
+		      gtk_page_setup_get_page_width (priv->page_setup,
+						     priv->current_unit),
+		      CHANGE_VERT);
+}
+
+static void
+change_unit (GtkSpinButton *spinbutton,
+	     gdouble factor,
+	     gint digits,
+	     gdouble step,
+	     gdouble page)
+{
+	gdouble value;
+	gdouble range;
+
+	gtk_spin_button_get_range (spinbutton, NULL, &range);
+	range *= factor;
+
+	value = gtk_spin_button_get_value (spinbutton);
+	value *= factor;
+
+	gtk_spin_button_set_range (spinbutton, 0, range);
+	gtk_spin_button_set_value (spinbutton, value);
+	gtk_spin_button_set_digits (spinbutton, digits);
+	gtk_spin_button_set_increments  (spinbutton, step, page);
+}
+
+static void
+set_scale_unit (EomPrintImageSetup *setup,
+		GtkUnit unit)
+{
+	EomPrintImageSetupPrivate *priv = setup->priv;
+	gdouble factor;
+	gdouble step, page;
+	gint digits;
+
+	if (G_UNLIKELY (priv->current_unit == unit))
+		return;
+
+	switch (unit) {
+	case GTK_UNIT_MM:
+		factor = FACTOR_INCH_TO_MM;
+		digits = 0;
+		step = 1;
+		page = 10;
+		break;
+	case GTK_UNIT_INCH:
+		factor = FACTOR_MM_TO_INCH;
+		digits = 2;
+		step = 0.01;
+		page = 0.1;
+		break;
+	default:
+		g_assert_not_reached ();
+	}
+
+ 	block_handlers (setup);
+
+	change_unit (GTK_SPIN_BUTTON (priv->width), factor, digits, step, page);
+	change_unit (GTK_SPIN_BUTTON (priv->height), factor, digits, step, page);
+	change_unit (GTK_SPIN_BUTTON (priv->left), factor, digits, step, page);
+	change_unit (GTK_SPIN_BUTTON (priv->right), factor, digits, step, page);
+	change_unit (GTK_SPIN_BUTTON (priv->top), factor, digits, step, page);
+	change_unit (GTK_SPIN_BUTTON (priv->bottom), factor, digits, step, page);
+
+ 	unblock_handlers (setup);
+
+	priv->current_unit = unit;
+}
+
+static void
+on_unit_changed (GtkComboBox *combobox,
+		 gpointer user_data)
+{
+	GtkUnit unit = GTK_UNIT_INCH;
+
+	switch (gtk_combo_box_get_active (combobox)) {
+	case UNIT_INCH:
+		unit = GTK_UNIT_INCH;
+		break;
+	case UNIT_MM:
+		unit = GTK_UNIT_MM;
+		break;
+	default:
+		g_assert_not_reached ();
+	}
+
+	set_scale_unit (EOM_PRINT_IMAGE_SETUP (user_data), unit);
+}
+
+static void
+on_preview_image_moved (EomPrintPreview *preview,
+			gpointer user_data)
+{
+	EomPrintImageSetupPrivate *priv = EOM_PRINT_IMAGE_SETUP (user_data)->priv;
+	gdouble x, y;
+
+	eom_print_preview_get_image_position (preview, &x, &y);
+
+	if (priv->current_unit == GTK_UNIT_MM) {
+		x *= FACTOR_INCH_TO_MM;
+		y *= FACTOR_INCH_TO_MM;
+	}
+
+	gtk_spin_button_set_value (GTK_SPIN_BUTTON (priv->left), x);
+	gtk_spin_button_set_value (GTK_SPIN_BUTTON (priv->top), y);
+}
+
+/* Function taken from gtkprintunixdialog.c */
+static GtkWidget *
+wrap_in_frame (const gchar *label,
+               GtkWidget   *child)
+{
+	GtkWidget *frame, *label_widget;
+	gchar *bold_text;
+
+	label_widget = gtk_label_new ("");
+	gtk_widget_set_halign (label_widget, GTK_ALIGN_START);
+	gtk_widget_show (label_widget);
+
+	bold_text = g_markup_printf_escaped ("<b>%s</b>", label);
+	gtk_label_set_markup (GTK_LABEL (label_widget), bold_text);
+	g_free (bold_text);
+
+	frame = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+	gtk_box_pack_start (GTK_BOX (frame), label_widget, FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX (frame), child, FALSE, FALSE, 0);
+
+	gtk_widget_set_margin_start (child, 12);
+
+	gtk_widget_show (frame);
+
+	return frame;
+}
+
+static GtkWidget *
+grid_attach_spin_button_with_label (GtkWidget *grid,
+				     const gchar* text_label,
+				     gint left, gint top)
+{
+	GtkWidget *label, *spin_button;
+
+	label = gtk_label_new_with_mnemonic (text_label);
+	gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+	spin_button = gtk_spin_button_new_with_range (0, 100, 0.01);
+	gtk_spin_button_set_digits (GTK_SPIN_BUTTON (spin_button), 2);
+	gtk_entry_set_width_chars (GTK_ENTRY (spin_button), 6);
+	gtk_grid_attach (GTK_GRID (grid), label, left, top, 1, 1);
+	gtk_grid_attach_next_to (GTK_GRID (grid), spin_button, label,
+							 GTK_POS_RIGHT, 1, 1);
+	gtk_label_set_mnemonic_widget (GTK_LABEL (label), spin_button);
+
+	return spin_button;
+}
+
+static void
+eom_print_image_setup_set_property (GObject      *object,
+				    guint         prop_id,
+				    const GValue *value,
+				    GParamSpec   *pspec)
+{
+	EomPrintImageSetup *setup = EOM_PRINT_IMAGE_SETUP (object);
+	EomPrintImageSetupPrivate *priv = setup->priv;
+	GdkPixbuf *pixbuf;
+
+	switch (prop_id) {
+	case PROP_IMAGE:
+		if (priv->image) {
+			g_object_unref (priv->image);
+		}
+		priv->image = EOM_IMAGE (g_value_dup_object (value));
+		if (EOM_IS_IMAGE (priv->image)) {
+			pixbuf = eom_image_get_pixbuf (priv->image);
+			g_object_set (priv->preview, "image",
+				      pixbuf, NULL);
+			g_object_unref (pixbuf);
+		}
+		break;
+	case PROP_PAGE_SETUP:
+		priv->page_setup = g_value_get_object (value);
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+	}
+}
+
+static void
+eom_print_image_setup_get_property (GObject    *object,
+				    guint       prop_id,
+				    GValue     *value,
+				    GParamSpec *pspec)
+{
+	EomPrintImageSetup *setup = EOM_PRINT_IMAGE_SETUP (object);
+	EomPrintImageSetupPrivate *priv = setup->priv;
+
+	switch (prop_id) {
+	case PROP_IMAGE:
+		g_value_set_object (value, priv->image);
+		break;
+	case PROP_PAGE_SETUP:
+		g_value_set_object (value, priv->page_setup);
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+	}
+}
+
+static void
+set_initial_values (EomPrintImageSetup *setup)
+{
+	EomPrintImageSetupPrivate *priv;
+	GtkPageSetup *page_setup;
+	EomImage *image;
+	gdouble page_width, page_height;
+	gint pix_width, pix_height;
+	gdouble factor;
+	gdouble width, height;
+	gdouble max_perc;
+
+	priv = setup->priv;
+	page_setup = priv->page_setup;
+	image = priv->image;
+
+	factor = get_scale_to_px_factor (setup);
+
+	eom_image_get_size (image, &pix_width, &pix_height);
+	width = (gdouble)pix_width/factor;
+	height = (gdouble)pix_height/factor;
+
+	max_perc = get_max_percentage (setup);
+
+	width *= max_perc;
+	height *= max_perc;
+
+	gtk_range_set_range (GTK_RANGE (priv->scaling), 1, 100*max_perc);
+	gtk_range_set_increments (GTK_RANGE (priv->scaling), max_perc, 10*max_perc);
+	gtk_range_set_value (GTK_RANGE (priv->scaling), 100*max_perc);
+
+	eom_print_preview_set_scale (EOM_PRINT_PREVIEW (priv->preview), max_perc);
+	gtk_spin_button_set_range (GTK_SPIN_BUTTON (priv->width), 0, width);
+	gtk_spin_button_set_range (GTK_SPIN_BUTTON (priv->height), 0, height);
+	gtk_spin_button_set_value (GTK_SPIN_BUTTON (priv->width), width);
+	gtk_spin_button_set_value (GTK_SPIN_BUTTON (priv->height), height);
+
+	gtk_combo_box_set_active (GTK_COMBO_BOX (priv->center),
+				  CENTER_BOTH);
+
+	center (gtk_page_setup_get_page_width (priv->page_setup, priv->current_unit),
+		gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->width)),
+		GTK_SPIN_BUTTON (priv->left), GTK_SPIN_BUTTON (priv->right));
+	center (gtk_page_setup_get_page_height (priv->page_setup, priv->current_unit),
+		gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->height)),
+		GTK_SPIN_BUTTON (priv->top), GTK_SPIN_BUTTON (priv->bottom));
+
+	page_width = gtk_page_setup_get_page_width (page_setup, priv->current_unit);
+	page_height = gtk_page_setup_get_page_height (page_setup, priv->current_unit);
+
+	update_image_pos_ranges (setup, page_width, page_height, width, height);
+
+}
+
+static void
+connect_signals (EomPrintImageSetup *setup)
+{
+	EomPrintImageSetupPrivate *priv;
+
+	priv = setup->priv;
+
+	g_signal_connect (priv->left, "value-changed",
+	                  G_CALLBACK (on_left_value_changed),
+	                  setup);
+
+	g_signal_connect (priv->right, "value-changed",
+			  G_CALLBACK (on_right_value_changed),
+	                  setup);
+
+	g_signal_connect (priv->top, "value-changed",
+	                  G_CALLBACK (on_top_value_changed),
+	                  setup);
+
+	g_signal_connect (priv->bottom, "value-changed",
+	                  G_CALLBACK (on_bottom_value_changed),
+	                  setup);
+
+	g_signal_connect (priv->width, "value-changed",
+	                  G_CALLBACK (on_width_value_changed),
+	                  setup);
+
+	g_signal_connect (priv->height, "value-changed",
+	                  G_CALLBACK (on_height_value_changed),
+	                  setup);
+
+	g_signal_connect (priv->scaling, "value-changed",
+	                  G_CALLBACK (on_scale_changed),
+	                  setup);
+
+	g_signal_connect (priv->scaling, "format-value",
+	                  G_CALLBACK (on_scale_format_value),
+	                  NULL);
+
+	g_signal_connect (priv->preview, "image-moved",
+	                  G_CALLBACK (on_preview_image_moved),
+	                  setup);
+}
+
+static void
+eom_print_image_setup_class_init (EomPrintImageSetupClass *class)
+{
+	GObjectClass *object_class = (GObjectClass *)class;
+
+	object_class->set_property = eom_print_image_setup_set_property;
+	object_class->get_property = eom_print_image_setup_get_property;
+
+	g_object_class_install_property (object_class, PROP_IMAGE,
+					 g_param_spec_object ("image",
+							      _("Image"),
+							      _("The image whose printing properties will be set up"),
+							      EOM_TYPE_IMAGE,
+							      G_PARAM_READWRITE));
+
+	g_object_class_install_property (object_class, PROP_PAGE_SETUP,
+					 g_param_spec_object ("page-setup",
+							      _("Page Setup"),
+							      _("The information for the page where the image will be printed"),
+							      GTK_TYPE_PAGE_SETUP,
+							      G_PARAM_READWRITE));
+}
+
+static void
+eom_print_image_setup_init (EomPrintImageSetup *setup)
+{
+	GtkWidget *frame;
+	GtkWidget *grid;
+	GtkWidget *label;
+	GtkWidget *hscale;
+	GtkWidget *combobox;
+	EomPrintImageSetupPrivate *priv;
+
+#ifdef HAVE__NL_MEASUREMENT_MEASUREMENT
+	gchar *locale_scale = NULL;<--- Variable 'locale_scale' can be declared as pointer to const
+#endif
+
+	priv = setup->priv = eom_print_image_setup_get_instance_private (setup);
+
+	priv->image = NULL;
+
+	grid = gtk_grid_new ();
+	gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
+	gtk_grid_set_column_spacing (GTK_GRID (grid), 12);
+	frame = wrap_in_frame (_("Position"), grid);
+	gtk_grid_attach (GTK_GRID (setup), frame, 0, 0, 1, 1);
+
+	priv->left = grid_attach_spin_button_with_label (grid,
+													 _("_Left:"), 0, 0);
+	priv->right = grid_attach_spin_button_with_label (grid,
+													  _("_Right:"), 0, 1);
+	priv->top = grid_attach_spin_button_with_label (grid, _("_Top:"), 2, 0);
+	priv->bottom = grid_attach_spin_button_with_label (grid, _("_Bottom:"),
+													   2, 1);
+
+	label = gtk_label_new_with_mnemonic (_("C_enter:"));
+	gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+
+	combobox = gtk_combo_box_text_new ();
+	gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT (combobox),
+				   CENTER_NONE, _("None"));
+	gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT (combobox),
+				   CENTER_HORIZONTAL, _("Horizontal"));
+	gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT (combobox),
+				   CENTER_VERTICAL, _("Vertical"));
+	gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT (combobox),
+				   CENTER_BOTH, _("Both"));
+	gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), CENTER_NONE);
+	/* Attach combobox below right margin spinbutton and span until end */
+	gtk_grid_attach_next_to (GTK_GRID (grid), combobox, priv->right,
+							 GTK_POS_BOTTOM, 3, 1);
+	/* Attach the label to the left of the combobox */
+	gtk_grid_attach_next_to (GTK_GRID (grid), label, combobox, GTK_POS_LEFT,
+							 1, 1);
+	gtk_label_set_mnemonic_widget (GTK_LABEL (label), combobox);
+	priv->center = combobox;
+	g_signal_connect (combobox, "changed",
+	                  G_CALLBACK (on_center_changed),
+	                  setup);
+
+	grid = gtk_grid_new ();
+	gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
+	gtk_grid_set_column_spacing (GTK_GRID (grid), 12);
+	frame = wrap_in_frame (_("Size"), grid);
+	gtk_grid_attach (GTK_GRID (setup), frame, 0, 1, 1, 1);
+
+	priv->width = grid_attach_spin_button_with_label (grid, _("_Width:"),
+							   0, 0);
+	priv->height = grid_attach_spin_button_with_label (grid, _("_Height:"),
+							    2, 0);
+
+	label = gtk_label_new_with_mnemonic (_("_Scaling:"));
+	hscale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 1, 100, 1);
+	gtk_scale_set_value_pos (GTK_SCALE (hscale), GTK_POS_RIGHT);
+	gtk_range_set_value (GTK_RANGE (hscale), 100);
+	gtk_grid_attach_next_to (GTK_GRID (grid), hscale, priv->width,
+							 GTK_POS_BOTTOM, 3, 1);
+	gtk_grid_attach_next_to (GTK_GRID (grid), label, hscale, GTK_POS_LEFT,
+							 1, 1);
+	gtk_label_set_mnemonic_widget (GTK_LABEL (label), hscale);
+	priv->scaling = hscale;
+
+	label = gtk_label_new_with_mnemonic (_("_Unit:"));
+	gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+
+	combobox = gtk_combo_box_text_new ();
+	gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT (combobox), UNIT_MM,
+				   _("Millimeters"));
+	gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT (combobox), UNIT_INCH,
+				   _("Inches"));
+
+#ifdef HAVE__NL_MEASUREMENT_MEASUREMENT
+	locale_scale = nl_langinfo (_NL_MEASUREMENT_MEASUREMENT);
+	if (locale_scale && locale_scale[0] == 2) {
+		gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), UNIT_INCH);
+		set_scale_unit (setup, GTK_UNIT_INCH);
+	} else
+#endif
+	{
+		gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), UNIT_MM);
+		set_scale_unit (setup, GTK_UNIT_MM);
+	}
+
+	gtk_grid_attach_next_to (GTK_GRID (grid), combobox, hscale,
+							 GTK_POS_BOTTOM, 3, 1);
+	gtk_grid_attach_next_to (GTK_GRID (grid), label, combobox, GTK_POS_LEFT,
+							 1, 1);
+	gtk_label_set_mnemonic_widget (GTK_LABEL (label), combobox);
+	priv->unit = combobox;
+	g_signal_connect (combobox, "changed",
+	                  G_CALLBACK (on_unit_changed),
+	                  setup);
+
+	priv->preview = eom_print_preview_new ();
+
+	/* FIXME: This shouldn't be set by hand */
+	gtk_widget_set_size_request (priv->preview, 250, 250);
+
+	frame = wrap_in_frame (_("Preview"), priv->preview);
+	/* The preview widget needs to span the whole grid height */
+	gtk_grid_attach (GTK_GRID (setup), frame, 1, 0, 1, 2);
+
+	gtk_widget_show_all (GTK_WIDGET (setup));
+}
+
+/**
+ * eom_print_image_setup_new:
+ * @image: the #EomImage to print
+ * @page_setup: a #GtkPageSetup specifying the page where
+ * the image will be print
+ *
+ * Creates a new #EomPrintImageSetup widget, to be used as a custom
+ * widget in a #GtkPrintUnixDialog. This widgets allows to set
+ * the image position and scale in a page.
+ *
+ * Returns: a new #EomPrintImageSetup
+ **/
+GtkWidget *
+eom_print_image_setup_new (EomImage *image, GtkPageSetup *page_setup)
+{
+	GtkWidget *setup;
+	GtkWidget *preview;
+
+	setup = g_object_new (EOM_TYPE_PRINT_IMAGE_SETUP,
+			     "orientation", GTK_ORIENTATION_VERTICAL,
+			     "row-spacing", 18,
+			     "column-spacing", 18,
+			     "border-width", 12,
+			     "image", image,
+			     "page-setup", page_setup,
+			     NULL);
+
+	set_initial_values (EOM_PRINT_IMAGE_SETUP (setup));
+
+	preview = EOM_PRINT_IMAGE_SETUP (setup)->priv->preview;
+	eom_print_preview_set_from_page_setup (EOM_PRINT_PREVIEW (preview),
+					       page_setup);
+
+	connect_signals (EOM_PRINT_IMAGE_SETUP (setup));
+
+	return setup;
+}
+
+/**
+ * eom_print_image_setup_get_options:
+ * @setup: a #EomPrintImageSetup
+ * @left: a pointer where to store the image's left position
+ * @top: a pointer where to store the image's top position
+ * @scale: a pointer where to store the image's scale
+ * @unit: a pointer where to store the #GtkUnit used by the @left and @top values.
+ *
+ * Gets the options set by the #EomPrintImageSetup.
+ **/
+void
+eom_print_image_setup_get_options (EomPrintImageSetup *setup,
+				   gdouble *left,
+				   gdouble *top,
+				   gdouble *scale,
+				   GtkUnit *unit)
+{
+	EomPrintImageSetupPrivate *priv;
+
+	g_return_if_fail (EOM_IS_PRINT_IMAGE_SETUP (setup));
+
+	priv = setup->priv;
+
+	*left = gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->left));
+	*top = gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->top));
+	*scale = gtk_range_get_value (GTK_RANGE (priv->scaling));
+	*unit = priv->current_unit;
+}
+
+void
+eom_print_image_setup_update (GtkPrintOperation *operation,
+			      GtkWidget         *custom_widget,
+			      GtkPageSetup      *page_setup,
+			      GtkPrintSettings  *print_settings,
+			      gpointer           user_data)
+{
+	GtkWidget *preview;
+	gdouble    pos_x;
+	gdouble    pos_y;
+	EomPrintImageSetup *setup;
+
+	setup = EOM_PRINT_IMAGE_SETUP (custom_widget);
+
+	setup->priv->page_setup = gtk_page_setup_copy (page_setup);
+
+	set_initial_values (EOM_PRINT_IMAGE_SETUP (setup));
+
+	preview = EOM_PRINT_IMAGE_SETUP (setup)->priv->preview;
+	eom_print_preview_set_from_page_setup (EOM_PRINT_PREVIEW (preview),
+					       setup->priv->page_setup);
+
+	pos_x = gtk_spin_button_get_value (GTK_SPIN_BUTTON (setup->priv->left));
+	pos_y = gtk_spin_button_get_value (GTK_SPIN_BUTTON (setup->priv->top));
+	if (setup->priv->current_unit == GTK_UNIT_MM) {
+		pos_x *= FACTOR_MM_TO_INCH;
+		pos_y *= FACTOR_MM_TO_INCH;
+	}
+	eom_print_preview_set_image_position (EOM_PRINT_PREVIEW (setup->priv->preview), pos_x, pos_y);
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/75.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/75.html new file mode 100644 index 0000000..c984c9e --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/75.html @@ -0,0 +1,2485 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
   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
/* Eye Of MATE -- Print Preview Widget
+ *
+ * Copyright (C) 2006-2008 The Free Software Foundation
+ *
+ * Author: Claudio Saavedra <csaavedra@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <cairo.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gdk/gdkkeysyms.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "eom-image.h"
+#include "eom-print-preview.h"
+
+struct _EomPrintPreviewPrivate {
+	GtkWidget *area;
+	GdkPixbuf *image;
+	GdkPixbuf *image_scaled;
+
+	/* The surface to set to the cairo context, created from the image */
+	cairo_surface_t *surface;
+
+        /* Flag whether we have to create surface */
+	gboolean flag_create_surface;
+
+	/* the alignment of the image in the page */
+	gfloat image_x_align, image_y_align;
+
+	/* real paper size, in inches */
+	gfloat p_width, p_height;
+
+	/* page margins, in inches */
+	gfloat l_margin, r_margin, t_margin, b_margin;
+
+	/* page margins, relatives to the widget size */
+	gint l_rmargin, r_rmargin, t_rmargin, b_rmargin;
+
+	/* image width, relative to the widget size */
+	gint r_width, r_height;
+
+	/* scale of the image, as defined by the user */
+	gfloat i_scale;
+
+	/* scale of the page, relative to the widget size */
+	gfloat p_scale;
+
+	/* whether we are currently grabbing the image */
+	gboolean grabbed;
+
+	/* the last cursor position */
+	gdouble cursorx, cursory;
+
+	/* if we reject to move the image,
+	   store the delta here */
+	gdouble r_dx, r_dy;
+};
+
+/* Signal IDs */
+enum {
+	SIGNAL_IMAGE_MOVED,
+	SIGNAL_LAST
+};
+
+static guint preview_signals [SIGNAL_LAST] = { 0 };
+
+enum {
+	PROP_0,
+	PROP_IMAGE,
+	PROP_IMAGE_X_ALIGN,
+	PROP_IMAGE_Y_ALIGN,
+	PROP_IMAGE_SCALE,
+	PROP_PAPER_WIDTH,
+	PROP_PAPER_HEIGHT,
+	PROP_PAGE_LEFT_MARGIN,
+	PROP_PAGE_RIGHT_MARGIN,
+	PROP_PAGE_TOP_MARGIN,
+	PROP_PAGE_BOTTOM_MARGIN
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (EomPrintPreview, eom_print_preview, GTK_TYPE_ASPECT_FRAME)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
+
+static void eom_print_preview_draw (EomPrintPreview *preview, cairo_t *cr);
+static void eom_print_preview_finalize (GObject *object);
+static void update_relative_sizes (EomPrintPreview *preview);
+static void create_surface (EomPrintPreview *preview);
+static void create_image_scaled (EomPrintPreview *preview);
+static gboolean create_surface_when_idle (EomPrintPreview *preview);
+
+static void
+eom_print_preview_get_property (GObject    *object,
+				guint       prop_id,
+				GValue     *value,
+				GParamSpec *pspec)
+{
+	EomPrintPreviewPrivate *priv = EOM_PRINT_PREVIEW (object)->priv;
+
+	switch (prop_id) {
+	case PROP_IMAGE:
+		g_value_set_object (value, priv->image);
+		break;
+	case PROP_IMAGE_X_ALIGN:
+		g_value_set_float (value, priv->image_x_align);
+		break;
+	case PROP_IMAGE_Y_ALIGN:
+		g_value_set_float (value, priv->image_y_align);
+		break;
+	case PROP_IMAGE_SCALE:
+		g_value_set_float (value, priv->i_scale);
+		break;
+	case PROP_PAPER_WIDTH:
+		g_value_set_float (value, priv->p_width);
+		break;
+	case PROP_PAPER_HEIGHT:
+		g_value_set_float (value, priv->p_height);
+		break;
+	case PROP_PAGE_LEFT_MARGIN:
+		g_value_set_float (value, priv->l_margin);
+		break;
+	case PROP_PAGE_RIGHT_MARGIN:
+		g_value_set_float (value, priv->r_margin);
+		break;
+	case PROP_PAGE_TOP_MARGIN:
+		g_value_set_float (value, priv->t_margin);
+		break;
+	case PROP_PAGE_BOTTOM_MARGIN:
+		g_value_set_float (value, priv->b_margin);
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+	}
+}
+
+static void
+eom_print_preview_set_property (GObject      *object,
+				guint         prop_id,
+				const GValue *value,
+				GParamSpec   *pspec)
+{
+	EomPrintPreviewPrivate *priv = EOM_PRINT_PREVIEW (object)->priv;
+	gboolean paper_size_changed = FALSE;
+
+	switch (prop_id) {
+	case PROP_IMAGE:
+		if (priv->image) {
+			g_object_unref (priv->image);
+		}
+		priv->image = GDK_PIXBUF (g_value_dup_object (value));
+
+		if (priv->image_scaled) {
+			g_object_unref (priv->image_scaled);
+			priv->image_scaled = NULL;
+		}
+
+		priv->flag_create_surface = TRUE;
+		break;
+	case PROP_IMAGE_X_ALIGN:
+		priv->image_x_align = g_value_get_float (value);
+		break;
+	case PROP_IMAGE_Y_ALIGN:
+		priv->image_y_align = g_value_get_float (value);
+		break;
+	case PROP_IMAGE_SCALE:
+		priv->i_scale = g_value_get_float (value);
+		priv->flag_create_surface = TRUE;
+		break;
+	case PROP_PAPER_WIDTH:
+		priv->p_width = g_value_get_float (value);
+		paper_size_changed = TRUE;
+		break;
+	case PROP_PAPER_HEIGHT:
+		priv->p_height = g_value_get_float (value);
+		paper_size_changed = TRUE;
+		break;
+	case PROP_PAGE_LEFT_MARGIN:
+		priv->l_margin = g_value_get_float (value);
+		break;
+	case PROP_PAGE_RIGHT_MARGIN:
+		priv->r_margin = g_value_get_float (value);
+		break;
+	case PROP_PAGE_TOP_MARGIN:
+		priv->t_margin = g_value_get_float (value);
+		break;
+	case PROP_PAGE_BOTTOM_MARGIN:
+		priv->b_margin = g_value_get_float (value);
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+	}
+
+	if (paper_size_changed) {
+		g_object_set (object,
+			      "ratio", priv->p_width/priv->p_height,
+			      NULL);
+	}
+
+	update_relative_sizes (EOM_PRINT_PREVIEW (object));
+	gtk_widget_queue_draw (priv->area);
+}
+
+static void
+eom_print_preview_class_init (EomPrintPreviewClass *klass)
+{
+	GObjectClass *gobject_class;
+
+	gobject_class = (GObjectClass*) klass;
+
+	gobject_class->get_property = eom_print_preview_get_property;
+	gobject_class->set_property = eom_print_preview_set_property;
+	gobject_class->finalize     = eom_print_preview_finalize;
+
+/**
+ * EomPrintPreview:image:
+ *
+ * The "image" property defines the image that is previewed
+ * in the widget.
+ */
+	g_object_class_install_property (gobject_class,
+					 PROP_IMAGE,
+					 g_param_spec_object ("image",
+							      "Image to show in the preview",
+							      "",
+							      G_TYPE_OBJECT,
+							      G_PARAM_READWRITE));
+
+/**
+ * EomPrintPreview:image-x-align:
+ *
+ * The "image-x-align" property defines the horizontal alignment
+ * of the image in the widget.
+ */
+	g_object_class_install_property (gobject_class,
+					 PROP_IMAGE_X_ALIGN,
+					 g_param_spec_float ("image-x-align",
+							      "Horizontal alignment for the image",
+							      "",
+							      0,
+							      1,
+							      0.5,
+							      G_PARAM_READWRITE));
+
+/**
+ * EomPrintPreview:image-y-align:
+ *
+ * The "image-y-align" property defines the horizontal alignment
+ * of the image in the widget.
+ */
+	g_object_class_install_property (gobject_class,
+					 PROP_IMAGE_Y_ALIGN,
+					 g_param_spec_float ("image-y-align",
+							      "Vertical alignment for the image",
+							      "",
+							      0,
+							      1,
+							      0.5,
+							      G_PARAM_READWRITE));
+
+/**
+ * EomPrintPreview:image-scale:
+ *
+ * The "image-scale" property defines the scaling of the image
+ * that the user wants for the printing.
+ */
+	g_object_class_install_property (gobject_class,
+					 PROP_IMAGE_SCALE,
+					 g_param_spec_float ("image-scale",
+							     "The scale for the image",
+							      "",
+							      0,
+							      1,
+							      1,
+							      G_PARAM_READWRITE));
+
+/**
+ * EomPrintPreview:paper-width:
+ *
+ * The width of the previewed paper, in inches.
+ */
+	g_object_class_install_property (gobject_class,
+					 PROP_PAPER_WIDTH,
+					 g_param_spec_float ("paper-width",
+							     "Real paper width in inches",
+							     "",
+							     0,
+							     100,
+							     8.5,
+							     G_PARAM_READWRITE));
+
+/**
+ * EomPrintPreview:paper-height:
+ *
+ * The height of the previewed paper, in inches.
+ */
+	g_object_class_install_property (gobject_class,
+					 PROP_PAPER_HEIGHT,
+					 g_param_spec_float ("paper-height",
+							     "Real paper height in inches",
+							      "",
+							      0,
+							      200,
+							      11,
+							      G_PARAM_READWRITE));
+
+/**
+ * EomPrintPreview:page-left-margin:
+ *
+ * The size of the page's left margin, in inches.
+ */
+	g_object_class_install_property (gobject_class,
+					 PROP_PAGE_LEFT_MARGIN,
+					 g_param_spec_float ("page-left-margin",
+							     "Left margin of the page in inches",
+							     "",
+							     0,
+							     100,
+							     0.25,
+							     G_PARAM_READWRITE));
+
+/**
+ * EomPrintPreview:page-right-margin:
+ *
+ * The size of the page's right margin, in inches.
+ */
+	g_object_class_install_property (gobject_class,
+					 PROP_PAGE_RIGHT_MARGIN,
+					 g_param_spec_float ("page-right-margin",
+							     "Right margin of the page in inches",
+							      "",
+							      0,
+							      200,
+							      0.25,
+							      G_PARAM_READWRITE));
+/**
+ * EomPrintPreview:page-top-margin:
+ *
+ * The size of the page's top margin, in inches.
+ */
+	g_object_class_install_property (gobject_class,
+					 PROP_PAGE_TOP_MARGIN,
+					 g_param_spec_float ("page-top-margin",
+							     "Top margin of the page in inches",
+							     "",
+							      0,
+							      100,
+							      0.25,
+							      G_PARAM_READWRITE));
+
+/**
+ * EomPrintPreview:page-bottom-margin:
+ *
+ * The size of the page's bottom margin, in inches.
+ */
+	g_object_class_install_property (gobject_class,
+					 PROP_PAGE_BOTTOM_MARGIN,
+					 g_param_spec_float ("page-bottom-margin",
+							     "Bottom margin of the page in inches",
+							      "",
+							      0,
+							      200,
+							      0.56,
+							      G_PARAM_READWRITE));
+
+/**
+ * EomPrintPreview::image-moved:
+ * @preview: the object which received the signal
+ *
+ * The #EomPrintPreview::image-moved signal is emitted when the position
+ * of the image is changed.
+ */
+	preview_signals [SIGNAL_IMAGE_MOVED] =
+		g_signal_new ("image_moved",
+			      G_TYPE_FROM_CLASS (gobject_class),
+			      G_SIGNAL_RUN_FIRST, 0, NULL, NULL,
+			      g_cclosure_marshal_VOID__VOID, G_TYPE_NONE,
+			      0, NULL);
+}
+
+static void
+eom_print_preview_finalize (GObject *object)
+{
+	EomPrintPreviewPrivate *priv;
+
+	priv = EOM_PRINT_PREVIEW (object)->priv;
+
+	if (priv->image) {
+		g_object_unref (priv->image);
+		priv->image = NULL;
+	}
+
+	if (priv->image_scaled) {
+		g_object_unref (priv->image_scaled);
+		priv->image_scaled = NULL;
+	}
+
+	if (priv->surface) {
+		cairo_surface_destroy (priv->surface);
+		priv->surface = NULL;
+	}
+
+	G_OBJECT_CLASS (eom_print_preview_parent_class)->finalize (object);
+}
+
+static void
+eom_print_preview_init (EomPrintPreview *preview)
+{
+	EomPrintPreviewPrivate *priv;
+	gfloat ratio;
+
+	priv = preview->priv = eom_print_preview_get_instance_private (preview);
+
+	priv->area = GTK_WIDGET (gtk_drawing_area_new ());
+
+	gtk_container_add (GTK_CONTAINER (preview), priv->area);
+
+	priv->p_width  =  8.5;
+	priv->p_height = 11.0;
+
+	ratio = priv->p_width/priv->p_height;
+
+	gtk_aspect_frame_set (GTK_ASPECT_FRAME (preview),
+			      0.5, 0.5, ratio, FALSE);
+
+	priv->image = NULL;
+	priv->image_scaled = NULL;
+	priv->image_x_align = 0.5;
+	priv->image_y_align = 0.5;
+	priv->i_scale = 1;
+
+	priv->surface = NULL;
+	priv->flag_create_surface = TRUE;
+
+	priv->p_scale = 0;
+
+	priv->l_margin = 0.25;
+	priv->r_margin = 0.25;
+	priv->t_margin = 0.25;
+	priv->b_margin = 0.56;
+
+	priv->grabbed = FALSE;
+	priv->cursorx = 0;
+	priv->cursory = 0;
+	priv->r_dx    = 0;
+	priv->r_dy    = 0;
+}
+
+static gboolean button_press_event_cb   (GtkWidget *widget, GdkEventButton *bev, gpointer user_data);
+static gboolean button_release_event_cb (GtkWidget *widget, GdkEventButton *bev, gpointer user_data);
+static gboolean motion_notify_event_cb  (GtkWidget *widget, GdkEventMotion *mev, gpointer user_data);
+static gboolean key_press_event_cb      (GtkWidget *widget, GdkEventKey *event, gpointer user_data);
+
+static gboolean draw_cb (GtkDrawingArea *drawing_area, cairo_t *cr, gpointer user_data);
+static void size_allocate_cb (GtkWidget *widget, GtkAllocation *allocation, gpointer user_data);
+
+/**
+ * eom_print_preview_new_with_pixbuf:
+ * @pixbuf: a #GdkPixbuf
+ *
+ * Creates a new #EomPrintPreview widget, and sets the #GdkPixbuf to preview
+ * on it.
+ *
+ * Returns: A new #EomPrintPreview widget.
+ **/
+GtkWidget *
+eom_print_preview_new_with_pixbuf (GdkPixbuf *pixbuf)
+{
+	EomPrintPreview *preview;
+
+	g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
+
+	preview = EOM_PRINT_PREVIEW (eom_print_preview_new ());
+
+	preview->priv->image = g_object_ref (pixbuf);
+
+	update_relative_sizes (preview);
+
+	return GTK_WIDGET (preview);
+}
+
+/**
+ * eom_print_preview_new:
+ *
+ * Creates a new #EomPrintPreview widget, setting it to the default values,
+ * and leaving the page empty. You still need to set the #EomPrintPreview:image
+ * property to make it useful.
+ *
+ * Returns: A new and empty #EomPrintPreview widget.
+ **/
+GtkWidget *
+eom_print_preview_new (void)
+{
+	EomPrintPreview *preview;
+	GtkWidget *area;
+
+	preview = g_object_new (EOM_TYPE_PRINT_PREVIEW, NULL);
+
+	area = preview->priv->area;
+
+	gtk_widget_set_events (area,
+			       GDK_EXPOSURE_MASK            |
+			       GDK_POINTER_MOTION_MASK      |
+			       GDK_BUTTON_PRESS_MASK        |
+			       GDK_BUTTON_RELEASE_MASK      |
+			       GDK_KEY_PRESS_MASK);
+
+	g_object_set (G_OBJECT (area),
+		      "can-focus", TRUE,
+		      NULL);
+
+/* 	update_relative_sizes (preview); */
+
+	g_signal_connect (area, "draw",
+	                  G_CALLBACK (draw_cb),
+	                  preview);
+
+	g_signal_connect (area, "motion-notify-event",
+			  G_CALLBACK (motion_notify_event_cb),
+	                  preview);
+
+ 	g_signal_connect (area, "button-press-event",
+	                  G_CALLBACK (button_press_event_cb),
+	                  preview);
+
+	g_signal_connect (area, "button-release-event",
+	                  G_CALLBACK (button_release_event_cb),
+	                  preview);
+
+	g_signal_connect (area, "key-press-event",
+	                  G_CALLBACK (key_press_event_cb),
+	                  preview);
+
+	g_signal_connect (area, "size-allocate",
+	                  G_CALLBACK (size_allocate_cb),
+	                  preview);
+
+	return GTK_WIDGET (preview);
+}
+
+static gboolean
+draw_cb (GtkDrawingArea *drawing_area,
+		 cairo_t *cr,
+		 gpointer  user_data)
+{
+	update_relative_sizes (EOM_PRINT_PREVIEW (user_data));
+
+	eom_print_preview_draw (EOM_PRINT_PREVIEW (user_data), cr);
+
+	if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) {
+		fprintf (stderr, "Cairo is unhappy: %s\n",
+		    cairo_status_to_string (cairo_status (cr)));
+	}
+
+	return TRUE;
+}
+
+/**
+ * get_current_image_coordinates:
+ * @preview: an #EomPrintPreview
+ * @x0: A pointer where to store the x coordinate.
+ * @y0: A pointer where to store the y coordinate.
+ *
+ * This function returns the current image coordinates, according
+ * with the properties of the given @preview widget.
+ **/
+static void
+get_current_image_coordinates (EomPrintPreview *preview,
+			       gint *x0, gint *y0)
+{
+	EomPrintPreviewPrivate *priv;
+	GtkAllocation allocation;
+
+	priv = preview->priv;
+	gtk_widget_get_allocation (GTK_WIDGET (priv->area), &allocation);
+
+	*x0 = (gint)((1 - priv->image_x_align)*priv->l_rmargin +  priv->image_x_align*(allocation.width - priv->r_rmargin - priv->r_width));
+	*y0 = (gint)((1 - priv->image_y_align)*priv->t_rmargin +  priv->image_y_align*(allocation.height - priv->b_rmargin - priv->r_height));
+}
+
+/**
+ * press_inside_image_area:
+ * @preview: an #EomPrintPreview
+ * @x: the points x coordinate
+ * @y: the points y coordinate
+ *
+ * Returns whether the given point is inside the image area.
+ *
+ * Returns: %TRUE if the given point is inside of the image area,
+ * %FALSE otherwise.
+ **/
+static gboolean
+press_inside_image_area (EomPrintPreview *preview,
+			 guint x,
+			 guint y)
+{
+	EomPrintPreviewPrivate *priv;
+	gint x0, y0;
+
+	priv = preview->priv;
+	get_current_image_coordinates (preview, &x0, &y0);
+
+	if (x >= x0 &&  y >= y0 &&
+	    x <= x0 + priv->r_width && y <= y0 + priv->r_height)
+		return TRUE;
+
+	return FALSE;
+}
+
+static void
+create_image_scaled (EomPrintPreview *preview)
+{
+	EomPrintPreviewPrivate *priv = preview->priv;
+
+	if (!priv->image_scaled) {
+		gint i_width, i_height;
+		GtkAllocation allocation;
+
+		gtk_widget_get_allocation (priv->area, &allocation);
+		i_width = gdk_pixbuf_get_width (priv->image);
+		i_height = gdk_pixbuf_get_height (priv->image);
+
+                if ((i_width > allocation.width) ||
+		    (i_height > allocation.height)) {
+			gdouble scale;
+			scale = MIN ((gdouble) allocation.width/i_width,
+				     (gdouble) allocation.height/i_height);
+			scale *= gtk_widget_get_scale_factor (GTK_WIDGET (priv->area));
+			priv->image_scaled = gdk_pixbuf_scale_simple (priv->image,
+								      i_width*scale,
+								      i_height*scale,
+								      GDK_INTERP_TILES);
+		} else {
+			priv->image_scaled = priv->image;
+			g_object_ref (priv->image_scaled);
+		}
+	}
+}
+
+static GdkPixbuf *
+create_preview_buffer (EomPrintPreview *preview)
+{
+	GdkPixbuf *pixbuf;
+	gint width, height, widget_scale;
+	GdkInterpType type = GDK_INTERP_TILES;
+
+	if (preview->priv->image == NULL) {
+		return NULL;
+	}
+
+	create_image_scaled (preview);
+
+	width  = gdk_pixbuf_get_width (preview->priv->image);
+	height = gdk_pixbuf_get_height (preview->priv->image);
+	widget_scale = gtk_widget_get_scale_factor (GTK_WIDGET (preview->priv->area));
+
+	width   *= preview->priv->i_scale * preview->priv->p_scale
+			* widget_scale;
+	height  *= preview->priv->i_scale * preview->priv->p_scale
+			* widget_scale;
+
+	if (width < 1 || height < 1)
+		return NULL;
+
+	/* to use GDK_INTERP_TILES for small pixbufs is expensive and unnecessary */
+	if (width < 25 || height < 25)
+		type = GDK_INTERP_NEAREST;
+
+	if (preview->priv->image_scaled) {
+		pixbuf = gdk_pixbuf_scale_simple (preview->priv->image_scaled,
+						  width, height, type);
+	} else {
+		pixbuf = gdk_pixbuf_scale_simple (preview->priv->image,
+						  width, height, type);
+	}
+
+	return pixbuf;
+}
+
+static void
+create_surface (EomPrintPreview *preview)
+{
+	EomPrintPreviewPrivate *priv = preview->priv;
+	GdkPixbuf *pixbuf;
+
+	if (priv->surface) {
+		cairo_surface_destroy (priv->surface);
+		priv->surface = NULL;
+	}
+
+	pixbuf = create_preview_buffer (preview);
+	if (pixbuf) {
+		priv->surface =
+			gdk_cairo_surface_create_from_pixbuf (pixbuf, 0,
+			                                      gtk_widget_get_window (GTK_WIDGET (preview)));
+		g_object_unref (pixbuf);
+	}
+	priv->flag_create_surface = FALSE;
+}
+
+static gboolean
+create_surface_when_idle (EomPrintPreview *preview)
+{
+	create_surface (preview);
+
+	return FALSE;
+}
+
+static gboolean
+button_press_event_cb (GtkWidget *widget,
+		       GdkEventButton *event,
+		       gpointer user_data)
+{
+	EomPrintPreview *preview = EOM_PRINT_PREVIEW (user_data);
+
+	preview->priv->cursorx = event->x;
+	preview->priv->cursory = event->y;
+
+	switch (event->button) {
+	case 1:
+		preview->priv->grabbed = press_inside_image_area (preview, event->x, event->y);
+		break;
+	}
+
+	if (preview->priv->grabbed) {
+		gtk_widget_queue_draw (GTK_WIDGET (preview));
+	}
+
+	gtk_widget_grab_focus (preview->priv->area);
+
+	return FALSE;
+}
+
+static gboolean
+button_release_event_cb (GtkWidget *widget,
+			 GdkEventButton *event,
+			 gpointer user_data)
+{
+	EomPrintPreview *preview = EOM_PRINT_PREVIEW (user_data);
+
+	switch (event->button) {
+	case 1:
+		preview->priv->grabbed = FALSE;
+		preview->priv->r_dx = 0;
+		preview->priv->r_dy = 0;
+		gtk_widget_queue_draw (GTK_WIDGET (preview));
+
+	}
+	return FALSE;
+}
+
+static gboolean
+key_press_event_cb (GtkWidget   *widget,
+		    GdkEventKey *event,
+		    gpointer     user_data)
+{
+	gfloat delta, align;
+	gboolean stop_emission = FALSE;
+	const gchar *property;
+
+	delta = 0;
+
+	switch (event->keyval) {
+	case GDK_KEY_Left:
+		property = "image-x-align";
+		delta = -0.01;
+		break;
+	case GDK_KEY_Right:
+		property = "image-x-align";
+		delta = 0.01;
+		break;
+	case GDK_KEY_Up:
+		property = "image-y-align";
+		delta = -0.01;
+		break;
+	case GDK_KEY_Down:
+		property = "image-y-align";
+		delta = 0.01;
+		break;
+	}
+
+	if (delta != 0) {
+		g_object_get (G_OBJECT (user_data),
+			      property, &align,
+			      NULL);
+
+		align += delta;
+		align = CLAMP (align, 0, 1);
+		g_object_set (G_OBJECT (user_data),
+			      property, align,
+			      NULL);
+
+		stop_emission = TRUE;
+		g_signal_emit (user_data, preview_signals[SIGNAL_IMAGE_MOVED], 0);
+	}
+
+	return stop_emission;
+}
+
+static gboolean
+motion_notify_event_cb (GtkWidget      *widget,
+			GdkEventMotion *event,
+			gpointer        user_data)
+{
+	EomPrintPreviewPrivate *priv = EOM_PRINT_PREVIEW (user_data)->priv;
+	gdouble dx, dy;
+	GtkAllocation allocation;
+
+	if (priv->grabbed) {
+		dx = event->x - priv->cursorx;
+		dy = event->y - priv->cursory;
+
+		gtk_widget_get_allocation (widget, &allocation);
+
+		/* Make sure the image stays inside the margins */
+
+		priv->image_x_align += (dx + priv->r_dx)/(allocation.width  - priv->r_width - priv->l_rmargin - priv->r_rmargin);
+		if (priv->image_x_align < 0. || priv->image_x_align > 1.) {
+			priv->image_x_align = CLAMP (priv->image_x_align, 0., 1.);
+			priv->r_dx += dx;
+		}
+		else
+			priv->r_dx = 0;
+
+		priv->image_y_align += (dy + priv->r_dy)/(allocation.height - priv->r_height - priv->t_rmargin - priv->b_rmargin);
+		if (priv->image_y_align < 0. || priv->image_y_align > 1.) {
+			priv->image_y_align = CLAMP (priv->image_y_align, 0., 1.);
+			priv->r_dy += dy;
+		} else
+			priv->r_dy = 0;
+
+		/* we do this to correctly change the property values */
+		g_object_set (EOM_PRINT_PREVIEW (user_data),
+			      "image-x-align", priv->image_x_align,
+			      "image-y-align", priv->image_y_align,
+			      NULL);
+
+		priv->cursorx = event->x;
+		priv->cursory = event->y;
+
+		g_signal_emit (user_data, preview_signals[SIGNAL_IMAGE_MOVED], 0);
+	} else {
+		if (press_inside_image_area (EOM_PRINT_PREVIEW (user_data), event->x, event->y)) {
+		  	GdkCursor *cursor;
+			cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget),
+							     GDK_FLEUR);
+			gdk_window_set_cursor (gtk_widget_get_window (widget),
+					       cursor);
+			g_object_unref (cursor);
+		} else {
+			gdk_window_set_cursor (gtk_widget_get_window (widget),
+					       NULL);
+		}
+	}
+	return FALSE;
+}
+
+static void
+size_allocate_cb (GtkWidget *widget,
+		  GtkAllocation *allocation,
+		  gpointer user_data)
+{
+	EomPrintPreview *preview;
+
+	preview = EOM_PRINT_PREVIEW (user_data);
+	update_relative_sizes (preview);
+
+	preview->priv->flag_create_surface = TRUE;
+
+	if (preview->priv->image_scaled) {
+		g_object_unref (preview->priv->image_scaled);
+		preview->priv->image_scaled = NULL;
+	}
+
+	g_idle_add ((GSourceFunc) create_surface_when_idle, preview);
+}
+
+static void
+eom_print_preview_draw (EomPrintPreview *preview, cairo_t *cr)
+{
+	EomPrintPreviewPrivate *priv;
+	GtkWidget *area;
+	GtkAllocation allocation;
+	gint x0, y0;
+	gboolean has_focus;
+
+	priv = preview->priv;
+	area = priv->area;
+
+	has_focus = gtk_widget_has_focus (area);
+
+	gtk_widget_get_allocation (area, &allocation);
+
+	/* draw the page */
+	cairo_set_source_rgb (cr, 1., 1., 1.);
+ 	cairo_rectangle (cr, 0, 0, allocation.width, allocation.height);
+ 	cairo_fill (cr);
+
+	/* draw the page margins */
+	cairo_set_source_rgb (cr, 0., 0., 0.);
+	cairo_set_line_width (cr, 0.1);
+	cairo_rectangle (cr,
+			 priv->l_rmargin, priv->t_rmargin,
+			 allocation.width - priv->l_rmargin - priv->r_rmargin,
+			 allocation.height - priv->t_rmargin - priv->b_rmargin);
+	cairo_stroke (cr);
+
+	get_current_image_coordinates (preview, &x0, &y0);
+
+	if (priv->flag_create_surface) {
+		create_surface (preview);
+	}
+
+	if (priv->surface) {
+		cairo_set_source_surface (cr, priv->surface, x0, y0);
+		cairo_paint (cr);
+	} else if (priv->image_scaled) {
+		/* just in the remote case we don't have the surface */
+
+		/* adjust (x0, y0) to the new scale */
+		gdouble scale = priv->i_scale * priv->p_scale *
+			gdk_pixbuf_get_width (priv->image) / gdk_pixbuf_get_width (priv->image_scaled);
+		x0 /= scale;
+		y0 /= scale;
+
+		cairo_scale (cr, scale, scale);
+		gdk_cairo_set_source_pixbuf (cr, priv->image_scaled, x0, y0);
+		cairo_paint (cr);
+	} else if (priv->image) {
+		/* just in the remote case we don't have the surface */
+
+		/* adjust (x0, y0) to the new scale */
+		x0 /=  priv->i_scale * priv->p_scale;
+		y0 /=  priv->i_scale * priv->p_scale;
+
+		cairo_scale (cr, priv->i_scale*priv->p_scale, priv->i_scale*priv->p_scale);
+		gdk_cairo_set_source_pixbuf (cr, priv->image, x0, y0);
+		cairo_paint (cr);
+	}
+
+	if (has_focus) {
+		GtkStyleContext *ctx;
+
+		ctx = gtk_widget_get_style_context (area);
+		gtk_render_focus (ctx, cr, 0, 0,
+				  allocation.width, allocation.height);
+	}
+}
+
+static void
+update_relative_sizes (EomPrintPreview *preview)
+{
+	EomPrintPreviewPrivate *priv;
+	GtkAllocation allocation;
+	gint i_width, i_height;
+
+	priv = preview->priv;
+
+	if (priv->image != NULL) {
+		i_width = gdk_pixbuf_get_width (priv->image);
+		i_height = gdk_pixbuf_get_height (priv->image);
+	} else {
+		i_width = i_height = 0;
+	}
+
+	gtk_widget_get_allocation (priv->area, &allocation);
+
+	priv->p_scale = (gfloat) allocation.width / (priv->p_width * 72.0);
+
+	priv->r_width  = (gint) i_width  * priv->i_scale * priv->p_scale;
+	priv->r_height = (gint) i_height * priv->i_scale * priv->p_scale;
+
+	priv->l_rmargin = (gint) (72. * priv->l_margin * priv->p_scale);
+	priv->r_rmargin = (gint) (72. * priv->r_margin * priv->p_scale);
+	priv->t_rmargin = (gint) (72. * priv->t_margin * priv->p_scale);
+	priv->b_rmargin = (gint) (72. * priv->b_margin * priv->p_scale);
+}
+
+/**
+ * eom_print_preview_set_page_margins:
+ * @preview: a #EomPrintPreview
+ * @l_margin: Left margin.
+ * @r_margin: Right margin.
+ * @t_margin: Top margin.
+ * @b_margin: Bottom margin.
+ *
+ * Manually set the margins, in inches.
+ **/
+void
+eom_print_preview_set_page_margins (EomPrintPreview *preview,
+				    gfloat l_margin,
+				    gfloat r_margin,
+				    gfloat t_margin,
+				    gfloat b_margin)
+{
+	g_return_if_fail (EOM_IS_PRINT_PREVIEW (preview));
+
+	g_object_set (G_OBJECT(preview),
+		      "page-left-margin",   l_margin,
+		      "page-right-margin",  r_margin,
+		      "page-top-margin",    t_margin,
+		      "page-bottom-margin", r_margin,
+		      NULL);
+}
+
+/**
+ * eom_print_preview_set_from_page_setup:
+ * @preview: a #EomPrintPreview
+ * @setup: a #GtkPageSetup to set the properties from
+ *
+ * Sets up the page properties from a #GtkPageSetup. Useful when using the
+ * widget with the GtkPrint API.
+ **/
+void
+eom_print_preview_set_from_page_setup (EomPrintPreview *preview,
+				       GtkPageSetup *setup)
+{
+	g_return_if_fail (EOM_IS_PRINT_PREVIEW (preview));
+	g_return_if_fail (GTK_IS_PAGE_SETUP (setup));
+
+	g_object_set (G_OBJECT (preview),
+		      "page-left-margin", gtk_page_setup_get_left_margin (setup, GTK_UNIT_INCH),
+		      "page-right-margin", gtk_page_setup_get_right_margin (setup, GTK_UNIT_INCH),
+		      "page-top-margin", gtk_page_setup_get_top_margin (setup, GTK_UNIT_INCH),
+		      "page-bottom-margin", gtk_page_setup_get_bottom_margin (setup, GTK_UNIT_INCH),
+		      "paper-width", gtk_page_setup_get_paper_width (setup, GTK_UNIT_INCH),
+		      "paper-height", gtk_page_setup_get_paper_height (setup, GTK_UNIT_INCH),
+		      NULL);
+
+}
+
+/**
+ * eom_print_preview_get_image_position:
+ * @preview: a #EomPrintPreview
+ * @x: a pointer to a #gdouble, or %NULL to ignore it
+ * @y: a pointer to a #gdouble, or %NULL to ignore it
+ *
+ * Gets current image position in inches, relative to the margins. A
+ * (0, 0) position is the intersection between the left and top margins.
+ **/
+void
+eom_print_preview_get_image_position (EomPrintPreview *preview,
+				      gdouble *x,
+				      gdouble *y)
+{
+	EomPrintPreviewPrivate *priv;
+	gdouble width, height;
+
+	g_return_if_fail (EOM_IS_PRINT_PREVIEW (preview));
+
+	priv = preview->priv;
+
+	if (x != NULL) {
+		width  = gdk_pixbuf_get_width (priv->image)  * priv->i_scale / 72.;
+		*x = priv->image_x_align * (priv->p_width  - priv->l_margin - priv->r_margin - width);
+	}
+	if (y != NULL) {
+		height = gdk_pixbuf_get_height (priv->image) * priv->i_scale / 72.;
+		*y = priv->image_y_align * (priv->p_height - priv->t_margin - priv->b_margin - height);
+	}
+}
+
+/**
+ * eom_print_preview_set_image_position:
+ * @preview: a #EomPrintPreview
+ * @x: The X coordinate, in inches, or -1 to ignore it.
+ * @y: The Y coordinate, in inches, or -1 to ignore it.
+ *
+ * Sets the image position. You can pass -1 to one of the coordinates if you
+ * only want to set the other.
+ **/
+void
+eom_print_preview_set_image_position (EomPrintPreview *preview,
+				      gdouble x,
+				      gdouble y)
+{
+	EomPrintPreviewPrivate *priv;
+	gfloat x_align, y_align;
+	gdouble width, height;
+
+	g_return_if_fail (EOM_IS_PRINT_PREVIEW (preview));
+
+	priv = preview->priv;
+
+	if (x != -1) {
+		width  = gdk_pixbuf_get_width (priv->image) * priv->i_scale / 72.;
+		x_align = CLAMP (x/(priv->p_width - priv->l_margin - priv->r_margin - width), 0, 1);
+		g_object_set (preview, "image-x-align", x_align, NULL);
+	}
+
+	if (y != -1) {
+		height  = gdk_pixbuf_get_height (priv->image) * priv->i_scale / 72.;
+		y_align = CLAMP (y/(priv->p_height - priv->t_margin - priv->b_margin - height), 0, 1);
+		g_object_set (preview, "image-y-align", y_align, NULL);
+	}
+}
+
+/**
+ * eom_print_preview_set_scale:
+ * @preview: a #EomPrintPreview
+ * @scale: a scale value, between 0 and 1.
+ *
+ * Sets the scale for the image.
+ **/
+void
+eom_print_preview_set_scale (EomPrintPreview *preview,
+			     gfloat           scale)
+{
+	g_return_if_fail (EOM_IS_PRINT_PREVIEW (preview));
+
+	g_object_set (preview,
+		      "image-scale", scale,
+		      NULL);
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/76.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/76.html new file mode 100644 index 0000000..aece96d --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/76.html @@ -0,0 +1,1279 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye of Mate - Print Operations
+ *
+ * Copyright (C) 2005-2008 The Free Software Foundation
+ *
+ * Author: Claudio Saavedra <csaavedra@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"<--- Include file: "config.h" not found.
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "eom-image.h"
+#include "eom-print.h"
+#include "eom-print-image-setup.h"
+#include "eom-util.h"
+#include "eom-debug.h"
+
+#ifdef HAVE_RSVG
+#include <librsvg/rsvg.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#define EOM_PRINT_SETTINGS_FILE "eom-print-settings.ini"
+#define EOM_PAGE_SETUP_GROUP "Page Setup"
+#define EOM_PRINT_SETTINGS_GROUP "Print Settings"
+
+typedef struct {
+	EomImage *image;
+	gdouble left_margin;
+	gdouble top_margin;
+	gdouble scale_factor;
+	GtkUnit unit;
+} EomPrintData;
+
+/* art_affine_flip modified to work with cairo_matrix_t */
+static void
+_eom_cairo_matrix_flip (cairo_matrix_t *dst, const cairo_matrix_t *src, gboolean horiz, gboolean vert)
+{
+	dst->xx = horiz ? -src->xx : src->xx;
+	dst->yx = horiz ? -src->yx : src->yx;
+	dst->xy = vert ? -src->xy : src->xy;
+	dst->yy = vert ? -src->yy : src->yy;
+	dst->x0 = horiz ? -src->x0 : src->x0;
+	dst->y0 = vert ? -src->y0 : src->y0;
+}
+
+static gboolean
+_cairo_ctx_supports_jpg_metadata (cairo_t *cr)
+{
+	cairo_surface_t *surface = cairo_get_target (cr);
+	cairo_surface_type_t type = cairo_surface_get_type (surface);
+
+	/* Based on cairo-1.10 */
+	return (type == CAIRO_SURFACE_TYPE_PDF || type == CAIRO_SURFACE_TYPE_PS ||
+		type == CAIRO_SURFACE_TYPE_SVG || type == CAIRO_SURFACE_TYPE_WIN32_PRINTING);
+}
+
+static void
+eom_print_draw_page (GtkPrintOperation *operation,
+		     GtkPrintContext   *context,
+		     gint               page_nr,
+		     gpointer           user_data)
+{
+	cairo_t *cr;
+	gdouble dpi_x, dpi_y;
+	gdouble x0, y0;
+	gdouble scale_factor;
+	gdouble p_width, p_height;
+	gint width, height;
+	EomPrintData *data;
+	GtkPageSetup *page_setup;
+
+	eom_debug (DEBUG_PRINTING);
+
+	data = (EomPrintData *) user_data;
+
+	scale_factor = data->scale_factor/100;
+
+	dpi_x = gtk_print_context_get_dpi_x (context);
+	dpi_y = gtk_print_context_get_dpi_y (context);
+
+	switch (data->unit) {
+	case GTK_UNIT_INCH:
+		x0 = data->left_margin * dpi_x;
+		y0 = data->top_margin  * dpi_y;
+		break;
+	case GTK_UNIT_MM:
+		x0 = data->left_margin * dpi_x/25.4;
+		y0 = data->top_margin  * dpi_y/25.4;
+		break;
+	default:
+		g_assert_not_reached ();
+	}
+
+	cr = gtk_print_context_get_cairo_context (context);
+
+	cairo_translate (cr, x0, y0);
+
+	page_setup = gtk_print_context_get_page_setup (context);
+	p_width =  gtk_page_setup_get_page_width (page_setup, GTK_UNIT_POINTS);
+	p_height = gtk_page_setup_get_page_height (page_setup, GTK_UNIT_POINTS);
+
+	eom_image_get_size (data->image, &width, &height);
+
+	/* this is both a workaround for a bug in cairo's PDF backend, and
+	   a way to ensure we are not printing outside the page margins */
+	cairo_rectangle (cr, 0, 0, MIN (width*scale_factor, p_width), MIN (height*scale_factor, p_height));
+	cairo_clip (cr);
+
+	cairo_scale (cr, scale_factor, scale_factor);
+
+#ifdef HAVE_RSVG
+	if (eom_image_is_svg (data->image))
+	{
+		RsvgHandle *svg = eom_image_get_svg (data->image);
+
+		rsvg_handle_render_cairo (svg, cr);
+		return;
+	} else
+#endif
+	/* JPEGs can be attached to the cairo surface which simply embeds the JPEG file into the
+	 * destination PDF skipping (PNG-)recompression. This should reduce PDF sizes enormously. */
+	if (eom_image_is_jpeg (data->image) && _cairo_ctx_supports_jpg_metadata (cr))
+	{
+		GFile *file;
+		char *img_data;
+		gsize data_len;
+		cairo_surface_t *surface = NULL;
+
+		eom_debug_message (DEBUG_PRINTING, "Attaching image to cairo surface");
+
+		file = eom_image_get_file (data->image);
+		if (g_file_load_contents (file, NULL, &img_data, &data_len, NULL, NULL))
+		{
+			EomTransform *tf = eom_image_get_transform (data->image);
+			EomTransform *auto_tf = eom_image_get_autorotate_transform (data->image);
+			cairo_matrix_t mx, mx2;
+
+			if (!tf && auto_tf) {
+				/* If only autorotation data present,
+				 * make it the normal rotation. */
+				tf = auto_tf;
+				auto_tf = NULL;
+			}
+
+			/* Care must be taken with height and width values. They are not the original
+			 * values but were affected by the transformation. As the surface needs to be
+			 * generated using the original dimensions they might need to be flipped. */
+			if (tf) {
+				if (auto_tf) {
+					/* If we have an autorotation apply
+					 * it before the others */
+					tf = eom_transform_compose (auto_tf, tf);
+				}
+
+				switch (eom_transform_get_transform_type (tf)) {
+					case EOM_TRANSFORM_ROT_90:
+						surface = cairo_image_surface_create (
+								CAIRO_FORMAT_RGB24, height, width);
+						cairo_rotate (cr, 90.0 * (G_PI/180.0));
+						cairo_translate (cr, 0.0, -width);
+						break;
+					case EOM_TRANSFORM_ROT_180:
+						surface = cairo_image_surface_create (
+								CAIRO_FORMAT_RGB24, width, height);
+						cairo_rotate (cr, 180.0 * (G_PI/180.0));
+						cairo_translate (cr, -width, -height);
+						break;
+					case EOM_TRANSFORM_ROT_270:
+						surface = cairo_image_surface_create (
+								CAIRO_FORMAT_RGB24, height, width);
+						cairo_rotate (cr, 270.0 * (G_PI/180.0));
+						cairo_translate (cr, -height, 0.0);
+						break;
+					case EOM_TRANSFORM_FLIP_HORIZONTAL:
+						surface = cairo_image_surface_create (
+								CAIRO_FORMAT_RGB24, width, height);
+						cairo_matrix_init_identity (&mx);
+						_eom_cairo_matrix_flip (&mx2, &mx, TRUE, FALSE);
+						cairo_transform (cr, &mx2);
+						cairo_translate (cr, -width, 0.0);
+						break;
+					case EOM_TRANSFORM_FLIP_VERTICAL:
+						surface = cairo_image_surface_create (
+								CAIRO_FORMAT_RGB24, width, height);
+						cairo_matrix_init_identity (&mx);
+						_eom_cairo_matrix_flip (&mx2, &mx, FALSE, TRUE);
+						cairo_transform (cr, &mx2);
+						cairo_translate (cr, 0.0, -height);
+						break;
+					case EOM_TRANSFORM_TRANSPOSE:
+						surface = cairo_image_surface_create (
+								CAIRO_FORMAT_RGB24, height, width);
+						cairo_matrix_init_rotate (&mx, 90.0 * (G_PI/180.0));
+						cairo_matrix_init_identity (&mx2);
+						_eom_cairo_matrix_flip (&mx2, &mx2, TRUE, FALSE);
+						cairo_matrix_multiply (&mx2, &mx, &mx2);
+						cairo_transform (cr, &mx2);
+						break;
+					case EOM_TRANSFORM_TRANSVERSE:
+						surface = cairo_image_surface_create (
+								CAIRO_FORMAT_RGB24, height, width);
+						cairo_matrix_init_rotate (&mx, 90.0 * (G_PI/180.0));
+						cairo_matrix_init_identity (&mx2);
+						_eom_cairo_matrix_flip (&mx2, &mx2, FALSE, TRUE);
+						cairo_matrix_multiply (&mx2, &mx, &mx2);
+						cairo_transform (cr, &mx2);
+						cairo_translate (cr, -height , -width);
+						break;
+					case EOM_TRANSFORM_NONE:
+					default:
+						surface = cairo_image_surface_create (
+								CAIRO_FORMAT_RGB24, width, height);
+						break;
+				}
+			}
+
+			if (!surface)
+				surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24,
+								      width, height);
+			cairo_surface_set_mime_data (surface,
+			                             CAIRO_MIME_TYPE_JPEG,
+			                             (unsigned char*)img_data, data_len,
+						     g_free, img_data);
+			cairo_set_source_surface (cr, surface, 0, 0);
+			cairo_paint (cr);
+			cairo_surface_destroy (surface);
+			g_object_unref (file);
+			return;
+		}
+		g_object_unref (file);
+
+	}
+
+	{
+		GdkPixbuf *pixbuf;
+
+		pixbuf = eom_image_get_pixbuf (data->image);
+		gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0);
+ 		cairo_paint (cr);
+		g_object_unref (pixbuf);
+	}
+}
+
+static GObject *
+eom_print_create_custom_widget (GtkPrintOperation *operation,
+				       gpointer user_data)
+{
+	GtkPageSetup *page_setup;
+	EomPrintData *data;
+
+	eom_debug (DEBUG_PRINTING);
+
+	data = (EomPrintData *)user_data;
+
+	page_setup = gtk_print_operation_get_default_page_setup (operation);
+
+	if (page_setup == NULL)
+		page_setup = gtk_page_setup_new ();
+
+	return G_OBJECT (eom_print_image_setup_new (data->image, page_setup));
+}
+
+static void
+eom_print_custom_widget_apply (GtkPrintOperation *operation,
+			       GtkWidget         *widget,
+			       gpointer           user_data)
+{
+	EomPrintData *data;
+	gdouble left_margin, top_margin, scale_factor;
+	GtkUnit unit;
+
+	eom_debug (DEBUG_PRINTING);
+
+	data = (EomPrintData *)user_data;
+
+	eom_print_image_setup_get_options (EOM_PRINT_IMAGE_SETUP (widget),
+					   &left_margin, &top_margin,
+					   &scale_factor, &unit);
+
+	data->left_margin = left_margin;
+	data->top_margin = top_margin;
+	data->scale_factor = scale_factor;
+	data->unit = unit;
+}
+
+static void
+eom_print_end_print (GtkPrintOperation *operation,
+		     GtkPrintContext   *context,
+		     gpointer           user_data)
+{
+	EomPrintData *data = (EomPrintData*) user_data;
+
+	eom_debug (DEBUG_PRINTING);
+
+	g_object_unref (data->image);
+	g_slice_free (EomPrintData, data);
+}
+
+GtkPrintOperation *
+eom_print_operation_new (EomImage *image,
+			 GtkPrintSettings *print_settings,
+			 GtkPageSetup *page_setup)
+{
+	GtkPrintOperation *print;
+	EomPrintData *data;
+	gint width, height;
+
+	eom_debug (DEBUG_PRINTING);
+
+	print = gtk_print_operation_new ();
+
+	data = g_slice_new0 (EomPrintData);
+
+	data->left_margin = 0;
+	data->top_margin = 0;
+	data->scale_factor = 100;
+	data->image = g_object_ref (image);
+	data->unit = GTK_UNIT_INCH;
+
+	eom_image_get_size (image, &width, &height);
+
+	if (page_setup == NULL)
+		page_setup = gtk_page_setup_new ();
+
+	if (height >= width) {
+		gtk_page_setup_set_orientation (page_setup,
+						GTK_PAGE_ORIENTATION_PORTRAIT);
+	} else {
+		gtk_page_setup_set_orientation (page_setup,
+						GTK_PAGE_ORIENTATION_LANDSCAPE);
+	}
+
+	gtk_print_operation_set_print_settings (print, print_settings);
+	gtk_print_operation_set_default_page_setup (print,
+						    page_setup);
+	gtk_print_operation_set_n_pages (print, 1);
+	gtk_print_operation_set_job_name (print,
+					  eom_image_get_caption (image));
+	gtk_print_operation_set_embed_page_setup (print, TRUE);
+
+	g_signal_connect (print, "draw_page",
+			  G_CALLBACK (eom_print_draw_page),
+			  data);
+	g_signal_connect (print, "create-custom-widget",
+			  G_CALLBACK (eom_print_create_custom_widget),
+			  data);
+	g_signal_connect (print, "custom-widget-apply",
+			  G_CALLBACK (eom_print_custom_widget_apply),
+			  data);
+	g_signal_connect (print, "end-print",
+			  G_CALLBACK (eom_print_end_print),
+			  data);
+	g_signal_connect (print, "update-custom-widget",
+			  G_CALLBACK (eom_print_image_setup_update),
+			  data);
+
+	gtk_print_operation_set_custom_tab_label (print, _("Image Settings"));
+
+	return print;
+}
+
+static GKeyFile *
+eom_print_get_key_file (void)
+{
+	GKeyFile *key_file;
+	GError *error = NULL;
+	gchar *filename;
+	GFile *file;
+	const gchar *dot_dir = eom_util_dot_dir ();
+
+	filename = g_build_filename (dot_dir, EOM_PRINT_SETTINGS_FILE, NULL);
+
+	file = g_file_new_for_path (filename);
+	key_file = g_key_file_new ();
+
+	if (g_file_query_exists (file, NULL)) {
+		g_key_file_load_from_file (key_file, filename,
+					   G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS,
+					   &error);
+		if (error) {
+			g_warning ("Error loading print settings file: %s", error->message);
+			g_error_free (error);
+			g_object_unref (file);
+			g_free (filename);
+			g_key_file_free (key_file);
+			return NULL;
+		}
+	}
+
+	g_object_unref (file);
+	g_free (filename);
+
+	return key_file;
+}
+
+GtkPageSetup *
+eom_print_get_page_setup (void)
+{
+	GtkPageSetup *page_setup;
+	GKeyFile *key_file;
+	GError *error = NULL;
+
+	key_file = eom_print_get_key_file ();
+
+	if (key_file && g_key_file_has_group (key_file, EOM_PAGE_SETUP_GROUP)) {
+		page_setup = gtk_page_setup_new_from_key_file (key_file, EOM_PAGE_SETUP_GROUP, &error);
+	} else {
+		page_setup = gtk_page_setup_new ();
+	}
+
+	if (error) {
+		page_setup = gtk_page_setup_new ();
+
+		g_warning ("Error loading print settings file: %s", error->message);
+		g_error_free (error);
+	}
+
+	if (key_file)
+		g_key_file_free (key_file);
+
+	return page_setup;
+}
+
+static void
+eom_print_save_key_file (GKeyFile *key_file)
+{
+	gchar *filename;
+	gchar *data;
+	GError *error = NULL;
+	const gchar *dot_dir = eom_util_dot_dir ();
+
+	filename = g_build_filename (dot_dir, EOM_PRINT_SETTINGS_FILE, NULL);
+
+	data = g_key_file_to_data (key_file, NULL, NULL);
+
+	g_file_set_contents (filename, data, -1, &error);
+
+	if (error) {
+		g_warning ("Error saving print settings file: %s", error->message);
+		g_error_free (error);
+	}
+
+	g_free (filename);
+	g_free (data);
+}
+
+void
+eom_print_set_page_setup (GtkPageSetup *page_setup)
+{
+	GKeyFile *key_file;
+
+	key_file = eom_print_get_key_file ();
+
+	if (key_file == NULL) {
+		key_file = g_key_file_new ();
+	}
+
+	gtk_page_setup_to_key_file (page_setup, key_file, EOM_PAGE_SETUP_GROUP);
+	eom_print_save_key_file (key_file);
+
+	g_key_file_free (key_file);
+}
+
+GtkPrintSettings *
+eom_print_get_print_settings (void)
+{
+	GtkPrintSettings *print_settings;
+	GError *error = NULL;
+	GKeyFile *key_file;
+
+	key_file = eom_print_get_key_file ();
+
+	if (key_file && g_key_file_has_group (key_file, EOM_PRINT_SETTINGS_GROUP)) {
+		print_settings = gtk_print_settings_new_from_key_file (key_file, EOM_PRINT_SETTINGS_GROUP, &error);
+	} else {
+		print_settings = gtk_print_settings_new ();
+	}
+
+	if (error) {
+		print_settings = gtk_print_settings_new ();
+
+		g_warning ("Error loading print settings file: %s", error->message);
+		g_error_free (error);
+	}
+
+	if (key_file)
+		g_key_file_free (key_file);
+
+	return print_settings;
+}
+
+void
+eom_print_set_print_settings (GtkPrintSettings *print_settings)
+{
+	GKeyFile *key_file;
+
+	key_file = eom_print_get_key_file ();
+
+	if (key_file == NULL) {
+		key_file = g_key_file_new ();
+	}
+
+	gtk_print_settings_to_key_file (print_settings, key_file, EOM_PRINT_SETTINGS_GROUP);
+	eom_print_save_key_file (key_file);
+
+	g_key_file_free (key_file);
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/77.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/77.html new file mode 100644 index 0000000..0b981df --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/77.html @@ -0,0 +1,335 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/* Eye of Mate - Print Operations
+ *
+ * Copyright (C) 2005-2008 The Free Software Foundation
+ *
+ * Author: Claudio Saavedra <csaavedra@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __EOM_PRINT_H__
+#define __EOM_PRINT_H__
+
+#include "eom-image.h"
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+G_GNUC_INTERNAL
+GtkPrintOperation*    eom_print_operation_new (EomImage *image,
+					       GtkPrintSettings *print_settings,
+					       GtkPageSetup *page_setup);
+
+G_GNUC_INTERNAL
+GtkPageSetup*         eom_print_get_page_setup (void);
+
+G_GNUC_INTERNAL
+void                  eom_print_set_page_setup (GtkPageSetup *page_setup);
+
+G_GNUC_INTERNAL
+GtkPrintSettings *    eom_print_get_print_settings (void);
+
+G_GNUC_INTERNAL
+void                  eom_print_set_print_settings (GtkPrintSettings *print_settings);
+
+G_END_DECLS
+
+#endif /* __EOM_PRINT_H__ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/78.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/78.html new file mode 100644 index 0000000..1848f29 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/78.html @@ -0,0 +1,1989 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye Of Mate - Image Properties Dialog
+ *
+ * Copyright (C) 2006 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *         Hubert Figuiere <hub@figuiere.net> (XMP support)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"<--- Include file: "config.h" not found.
+#endif
+
+#include "eom-properties-dialog.h"
+#include "eom-image.h"
+#include "eom-util.h"
+#include "eom-thumb-view.h"
+
+#if HAVE_EXIF
+#include "eom-exif-util.h"
+#endif
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#if HAVE_EXEMPI
+#include <exempi/xmp.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <exempi/xmpconsts.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+#if HAVE_EXIF || HAVE_EXEMPI
+#define HAVE_METADATA 1
+#endif
+
+#if HAVE_METADATA
+#include "eom-metadata-details.h"
+#endif
+
+enum {
+        PROP_0,
+        PROP_THUMBVIEW,
+        PROP_NETBOOK_MODE
+};
+
+struct _EomPropertiesDialogPrivate {
+	EomThumbView   *thumbview;
+
+	gboolean        update_page;
+	EomPropertiesDialogPage current_page;
+
+	GtkWidget      *notebook;
+	GtkWidget      *close_button;
+	GtkWidget      *next_button;
+	GtkWidget      *previous_button;
+
+	GtkWidget      *general_box;<--- struct member '_EomPropertiesDialogPrivate::general_box' is never used.
+	GtkWidget      *thumbnail_image;
+	GtkWidget      *name_label;
+	GtkWidget      *width_label;
+	GtkWidget      *height_label;
+	GtkWidget      *type_label;
+	GtkWidget      *bytes_label;
+	GtkWidget      *folder_button;
+	gchar          *folder_button_uri;
+#ifdef HAVE_EXIF
+	GtkWidget      *exif_aperture_label;
+	GtkWidget      *exif_exposure_label;
+	GtkWidget      *exif_focal_label;
+	GtkWidget      *exif_flash_label;
+	GtkWidget      *exif_iso_label;
+	GtkWidget      *exif_metering_label;
+	GtkWidget      *exif_model_label;
+	GtkWidget      *exif_date_label;
+#endif
+#ifdef HAVE_EXEMPI
+	GtkWidget      *xmp_location_label;
+	GtkWidget      *xmp_description_label;
+	GtkWidget      *xmp_keywords_label;
+	GtkWidget      *xmp_creator_label;
+	GtkWidget      *xmp_rights_label;
+#else
+	GtkWidget      *xmp_box;<--- struct member '_EomPropertiesDialogPrivate::xmp_box' is never used.
+	GtkWidget      *xmp_box_label;<--- struct member '_EomPropertiesDialogPrivate::xmp_box_label' is never used.
+#endif
+#if HAVE_METADATA
+	GtkWidget      *metadata_box;
+	GtkWidget      *metadata_details_expander;
+	GtkWidget      *metadata_details;
+	GtkWidget      *metadata_details_box;
+	GtkWidget      *metadata_details_sw;
+#endif
+
+	gboolean        netbook_mode;
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (EomPropertiesDialog, eom_properties_dialog, GTK_TYPE_DIALOG);
+
+static void
+parent_file_display_name_query_info_cb (GObject *source_object,
+					GAsyncResult *res,
+					gpointer user_data)
+{
+	EomPropertiesDialog *prop_dlg = EOM_PROPERTIES_DIALOG (user_data);
+	GFile *parent_file = G_FILE (source_object);
+	GFileInfo *file_info;
+	gchar *display_name;
+
+	file_info = g_file_query_info_finish (parent_file, res, NULL);
+	if (file_info == NULL) {
+		display_name = g_file_get_basename (parent_file);
+	} else {
+		display_name = g_strdup (
+			g_file_info_get_display_name (file_info));
+		g_object_unref (file_info);
+	}
+	gtk_button_set_label (GTK_BUTTON (prop_dlg->priv->folder_button),
+			      display_name);
+	gtk_widget_set_sensitive (prop_dlg->priv->folder_button, TRUE);
+
+	g_free (display_name);
+	g_object_unref (prop_dlg);
+}
+
+static void
+pd_update_general_tab (EomPropertiesDialog *prop_dlg,
+		       EomImage            *image)
+{
+	gchar *bytes_str, *dir_str_long;
+	gchar *width_str, *height_str;
+	GFile *file, *parent_file;
+	GFileInfo *file_info;
+	const char *mime_str;
+	char *type_str;
+	gint width, height;
+	goffset bytes;
+
+	g_object_set (G_OBJECT (prop_dlg->priv->thumbnail_image),
+		      "pixbuf", eom_image_get_thumbnail (image),
+		      NULL);
+
+	gtk_label_set_text (GTK_LABEL (prop_dlg->priv->name_label),
+			    eom_image_get_caption (image));
+
+	eom_image_get_size (image, &width, &height);
+
+	width_str = g_strdup_printf ("%d %s", width,
+				     ngettext ("pixel", "pixels", width));
+	height_str = g_strdup_printf ("%d %s", height,
+				      ngettext ("pixel", "pixels", height));
+
+	gtk_label_set_text (GTK_LABEL (prop_dlg->priv->width_label), width_str);
+
+	gtk_label_set_text (GTK_LABEL (prop_dlg->priv->height_label),
+			    height_str);
+
+	g_free (height_str);
+	g_free (width_str);
+
+	file = eom_image_get_file (image);
+	file_info = g_file_query_info (file,
+				       G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+				       0, NULL, NULL);
+	if (file_info == NULL) {
+		type_str = g_strdup (_("Unknown"));
+	} else {
+		mime_str = g_file_info_get_content_type (file_info);
+		type_str = g_content_type_get_description (mime_str);
+		g_object_unref (file_info);
+	}
+
+	gtk_label_set_text (GTK_LABEL (prop_dlg->priv->type_label), type_str);
+
+	bytes = eom_image_get_bytes (image);
+	bytes_str = g_format_size (bytes);
+
+	gtk_label_set_text (GTK_LABEL (prop_dlg->priv->bytes_label), bytes_str);
+
+	parent_file = g_file_get_parent (file);
+	if (parent_file == NULL) {
+		/* file is root directory itself */
+		parent_file = g_object_ref (file);
+	}
+
+	gtk_widget_set_sensitive (prop_dlg->priv->folder_button, FALSE);
+	gtk_button_set_label (GTK_BUTTON (prop_dlg->priv->folder_button), NULL);
+
+	dir_str_long = g_file_get_path (parent_file);
+	gtk_widget_set_tooltip_text (GTK_WIDGET (prop_dlg->priv->folder_button),
+	                             dir_str_long);
+
+	g_free (prop_dlg->priv->folder_button_uri);
+	prop_dlg->priv->folder_button_uri = g_file_get_uri (parent_file);
+
+	g_file_query_info_async (parent_file,
+				 G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME,
+				 G_FILE_QUERY_INFO_NONE,
+				 G_PRIORITY_DEFAULT,
+				 NULL,
+				 parent_file_display_name_query_info_cb,
+				 g_object_ref (prop_dlg));
+
+	g_object_unref (parent_file);
+
+	g_free (type_str);
+	g_free (bytes_str);
+	g_free (dir_str_long);
+}
+
+#if HAVE_EXEMPI
+static void
+eom_xmp_set_label (XmpPtr xmp,
+		   const char *ns,
+		   const char *propname,
+		   GtkWidget *w)
+{
+	uint32_t options;
+
+	XmpStringPtr value = xmp_string_new ();
+
+	if (xmp_get_property (xmp, ns, propname, value, &options)) {
+		if (XMP_IS_PROP_SIMPLE (options)) {
+			gtk_label_set_text (GTK_LABEL (w), xmp_string_cstr (value));
+		} else if (XMP_IS_PROP_ARRAY (options)) {
+			XmpIteratorPtr iter = xmp_iterator_new (xmp,
+							        ns,
+								propname,
+								XMP_ITER_JUSTLEAFNODES);
+
+			GString *string = g_string_new ("");
+
+			if (iter) {
+				gboolean first = TRUE;
+
+				while (xmp_iterator_next (iter, NULL, NULL, value, &options)
+				       && !XMP_IS_PROP_QUALIFIER (options)) {
+
+					if (!first) {
+						g_string_append_printf(string, ", ");
+					} else {
+						first = FALSE;
+					}
+
+					g_string_append_printf (string,
+								"%s",
+								xmp_string_cstr (value));
+				}
+
+				xmp_iterator_free (iter);
+			}
+
+			gtk_label_set_text (GTK_LABEL (w), string->str);
+			g_string_free (string, TRUE);
+		}
+	} else {
+		/* Property was not found */
+		/* Clear label so it won't show bogus data */
+		gtk_label_set_text (GTK_LABEL (w), NULL);
+	}
+
+	xmp_string_free (value);
+}
+#endif
+
+#if HAVE_METADATA
+static void
+pd_update_metadata_tab (EomPropertiesDialog *prop_dlg,
+			EomImage            *image)
+{
+	EomPropertiesDialogPrivate *priv;
+	GtkNotebook *notebook;
+#if HAVE_EXIF
+	ExifData    *exif_data;
+#endif
+#if HAVE_EXEMPI
+	XmpPtr      xmp_data;
+#endif
+
+	g_return_if_fail (EOM_IS_PROPERTIES_DIALOG (prop_dlg));
+
+	priv = prop_dlg->priv;
+
+	notebook = GTK_NOTEBOOK (priv->notebook);
+
+	if (TRUE
+#if HAVE_EXIF
+	    && !eom_image_has_data (image, EOM_IMAGE_DATA_EXIF)
+#endif
+#if HAVE_EXEMPI
+	    && !eom_image_has_data (image, EOM_IMAGE_DATA_XMP)
+#endif
+	    ) {
+		if (gtk_notebook_get_current_page (notebook) ==	EOM_PROPERTIES_DIALOG_PAGE_EXIF) {
+			gtk_notebook_prev_page (notebook);
+		} else if (gtk_notebook_get_current_page (notebook) == EOM_PROPERTIES_DIALOG_PAGE_DETAILS) {
+			gtk_notebook_set_current_page (notebook, EOM_PROPERTIES_DIALOG_PAGE_GENERAL);
+		}
+
+		if (gtk_widget_get_visible (priv->metadata_box)) {
+			gtk_widget_hide (priv->metadata_box);
+		}
+		if (gtk_widget_get_visible (priv->metadata_details_box)) {
+			gtk_widget_hide (priv->metadata_details_box);
+		}
+
+		return;
+	} else {
+		if (!gtk_widget_get_visible (priv->metadata_box))
+			gtk_widget_show_all (priv->metadata_box);
+		if (priv->netbook_mode &&
+		    !gtk_widget_get_visible (priv->metadata_details_box)) {
+			gtk_widget_show_all (priv->metadata_details_box);
+			gtk_widget_hide (priv->metadata_details_expander);
+		}
+	}
+
+#if HAVE_EXIF
+	exif_data = (ExifData *) eom_image_get_exif_info (image);
+
+	eom_exif_util_set_label_text (GTK_LABEL (priv->exif_aperture_label),
+				      exif_data, EXIF_TAG_FNUMBER);
+
+	eom_exif_util_set_label_text (GTK_LABEL (priv->exif_exposure_label),
+				      exif_data, EXIF_TAG_EXPOSURE_TIME);
+
+	eom_exif_util_set_focal_length_label_text (GTK_LABEL (priv->exif_focal_label), exif_data);
+
+	eom_exif_util_set_label_text (GTK_LABEL (priv->exif_flash_label),
+				      exif_data, EXIF_TAG_FLASH);
+
+	eom_exif_util_set_label_text (GTK_LABEL (priv->exif_iso_label),
+				      exif_data, EXIF_TAG_ISO_SPEED_RATINGS);
+
+	eom_exif_util_set_label_text (GTK_LABEL (priv->exif_metering_label),
+				      exif_data, EXIF_TAG_METERING_MODE);
+
+	eom_exif_util_set_label_text (GTK_LABEL (priv->exif_model_label),
+				      exif_data, EXIF_TAG_MODEL);
+
+	eom_exif_util_set_label_text (GTK_LABEL (priv->exif_date_label),
+				      exif_data, EXIF_TAG_DATE_TIME_ORIGINAL);
+
+	eom_metadata_details_update (EOM_METADATA_DETAILS (priv->metadata_details),
+				 exif_data);
+
+	/* exif_data_unref can handle NULL-values */
+	exif_data_unref(exif_data);
+#endif
+
+#if HAVE_EXEMPI
+	xmp_data = (XmpPtr) eom_image_get_xmp_info (image);
+
+ 	if (xmp_data != NULL) {
+		eom_xmp_set_label (xmp_data,
+				   NS_IPTC4XMP,
+				   "Location",
+				   priv->xmp_location_label);
+
+		eom_xmp_set_label (xmp_data,
+				   NS_DC,
+				   "description",
+				   priv->xmp_description_label);
+
+		eom_xmp_set_label (xmp_data,
+				   NS_DC,
+				   "subject",
+				   priv->xmp_keywords_label);
+
+		eom_xmp_set_label (xmp_data,
+				   NS_DC,
+        	                   "creator",
+				   priv->xmp_creator_label);
+
+		eom_xmp_set_label (xmp_data,
+				   NS_DC,
+				   "rights",
+				   priv->xmp_rights_label);
+
+		eom_metadata_details_xmp_update (EOM_METADATA_DETAILS (priv->metadata_details), xmp_data);
+
+		xmp_free (xmp_data);
+	} else {
+		/* Image has no XMP data */
+
+		/* Clear the labels so they won't display foreign data.*/
+
+		gtk_label_set_text (GTK_LABEL (priv->xmp_location_label), NULL);
+		gtk_label_set_text (GTK_LABEL (priv->xmp_description_label),
+				    NULL);
+		gtk_label_set_text (GTK_LABEL (priv->xmp_keywords_label), NULL);
+		gtk_label_set_text (GTK_LABEL (priv->xmp_creator_label), NULL);
+		gtk_label_set_text (GTK_LABEL (priv->xmp_rights_label), NULL);
+	}
+#endif
+}
+
+static gboolean
+pd_resize_dialog (gpointer user_data)
+{
+	gint width, height;
+
+	gtk_window_get_size (GTK_WINDOW (user_data),
+			     &width,
+			     &height);
+
+	gtk_window_resize (GTK_WINDOW (user_data), width, 1);
+
+	return FALSE;
+}
+
+static void
+pd_exif_details_activated_cb (GtkExpander *expander,
+			      GParamSpec *param_spec,
+			      GtkWidget *dialog)
+{
+	gboolean expanded;
+
+	expanded = gtk_expander_get_expanded (expander);
+
+	/*FIXME: this is depending on the expander animation
+         * duration. Need to find a safer way for doing that. */
+	if (!expanded)
+		g_timeout_add (150, pd_resize_dialog, dialog);
+}
+#endif
+
+static void
+pd_folder_button_clicked_cb (GtkButton *button, gpointer data)
+{
+	EomPropertiesDialogPrivate *priv = EOM_PROPERTIES_DIALOG (data)->priv;
+	GtkWindow *window;
+	guint32 timestamp;
+
+	if (!priv->folder_button_uri)
+		return;
+
+	timestamp = gtk_get_current_event_time ();
+
+	window = GTK_WINDOW (data);
+	gtk_show_uri_on_window (window, priv->folder_button_uri, timestamp, NULL);
+}
+
+static gboolean
+eom_properties_dialog_page_switch (GtkNotebook     *notebook,
+				   gpointer         page,
+				   guint            page_index,
+				   EomPropertiesDialog *prop_dlg)
+{
+	if (prop_dlg->priv->update_page)
+		prop_dlg->priv->current_page = page_index;
+
+	return TRUE;
+}
+
+void
+eom_properties_dialog_set_netbook_mode (EomPropertiesDialog *dlg,
+					gboolean enable)
+{
+	EomPropertiesDialogPrivate *priv;
+
+	g_return_if_fail (EOM_IS_PROPERTIES_DIALOG (dlg));
+
+	priv = dlg->priv;
+
+	if (priv->netbook_mode == enable)
+		return;
+
+	priv->netbook_mode = enable;
+
+#ifdef HAVE_METADATA
+	if (enable) {
+		g_object_ref (priv->metadata_details_sw);
+		gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (priv->metadata_details_sw)),
+				      priv->metadata_details_sw);
+		gtk_container_add (GTK_CONTAINER (priv->metadata_details_box), priv->metadata_details_sw);
+		g_object_unref (priv->metadata_details_sw);
+		// Only show details box if metadata is being displayed
+		if (gtk_widget_get_visible (priv->metadata_box))
+			gtk_widget_show_all (priv->metadata_details_box);
+
+		gtk_widget_hide (priv->metadata_details_expander);
+	} else {
+		g_object_ref (priv->metadata_details_sw);
+		gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (priv->metadata_details_sw)),
+				      priv->metadata_details_sw);
+		gtk_container_add (GTK_CONTAINER (priv->metadata_details_expander), priv->metadata_details_sw);
+		g_object_unref (priv->metadata_details_sw);
+		gtk_widget_show_all (priv->metadata_details_expander);
+
+		if (gtk_notebook_get_current_page (GTK_NOTEBOOK (priv->notebook)) == EOM_PROPERTIES_DIALOG_PAGE_DETAILS)
+			gtk_notebook_prev_page (GTK_NOTEBOOK (priv->notebook));
+		gtk_widget_hide (priv->metadata_details_box);
+	}
+#endif
+}
+
+static void
+eom_properties_dialog_set_property (GObject      *object,
+				    guint         prop_id,
+				    const GValue *value,
+				    GParamSpec   *pspec)
+{
+	EomPropertiesDialog *prop_dlg = EOM_PROPERTIES_DIALOG (object);
+
+	switch (prop_id) {
+		case PROP_THUMBVIEW:
+			prop_dlg->priv->thumbview = g_value_get_object (value);
+			break;
+		case PROP_NETBOOK_MODE:
+			eom_properties_dialog_set_netbook_mode (prop_dlg,
+						   g_value_get_boolean (value));
+			break;
+		default:
+			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id,
+							   pspec);
+			break;
+	}
+}
+
+static void
+eom_properties_dialog_get_property (GObject    *object,
+				    guint       prop_id,
+				    GValue     *value,
+				    GParamSpec *pspec)
+{
+	EomPropertiesDialog *prop_dlg = EOM_PROPERTIES_DIALOG (object);
+
+	switch (prop_id) {
+		case PROP_THUMBVIEW:
+			g_value_set_object (value, prop_dlg->priv->thumbview);
+			break;
+		case PROP_NETBOOK_MODE:
+			g_value_set_boolean (value,
+					     prop_dlg->priv->netbook_mode);
+			break;
+		default:
+			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id,
+							   pspec);
+			break;
+	}
+}
+
+static void
+eom_properties_dialog_dispose (GObject *object)
+{
+	EomPropertiesDialog *prop_dlg;
+	EomPropertiesDialogPrivate *priv;
+
+	g_return_if_fail (object != NULL);
+	g_return_if_fail (EOM_IS_PROPERTIES_DIALOG (object));
+
+	prop_dlg = EOM_PROPERTIES_DIALOG (object);
+	priv = prop_dlg->priv;
+
+	if (priv->thumbview) {
+		g_object_unref (priv->thumbview);
+		priv->thumbview = NULL;
+	}
+
+	g_free (priv->folder_button_uri);
+	priv->folder_button_uri = NULL;
+
+	G_OBJECT_CLASS (eom_properties_dialog_parent_class)->dispose (object);
+}
+
+static void
+eom_properties_dialog_class_init (EomPropertiesDialogClass *klass)
+{
+	GObjectClass *g_object_class = (GObjectClass *) klass;
+
+	g_object_class->dispose = eom_properties_dialog_dispose;
+	g_object_class->set_property = eom_properties_dialog_set_property;
+	g_object_class->get_property = eom_properties_dialog_get_property;
+
+	g_object_class_install_property (g_object_class,
+					 PROP_THUMBVIEW,
+					 g_param_spec_object ("thumbview",
+							      "Thumbview",
+							      "Thumbview",
+							      EOM_TYPE_THUMB_VIEW,
+							      G_PARAM_READWRITE |
+							      G_PARAM_CONSTRUCT_ONLY |
+							      G_PARAM_STATIC_NAME |
+							      G_PARAM_STATIC_NICK |
+							      G_PARAM_STATIC_BLURB));
+	g_object_class_install_property (g_object_class, PROP_NETBOOK_MODE,
+					 g_param_spec_boolean ("netbook-mode",
+					 		      "Netbook Mode",
+							      "Netbook Mode",
+							      FALSE,
+							      G_PARAM_READWRITE |
+							      G_PARAM_STATIC_STRINGS));
+
+	GtkWidgetClass *wklass = (GtkWidgetClass*) klass;
+
+	gtk_widget_class_set_template_from_resource (wklass,
+	                                             "/org/mate/eom/ui/eom-image-properties-dialog.ui");
+
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     notebook);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     previous_button);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     next_button);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     close_button);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     thumbnail_image);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     general_box);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     name_label);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     width_label);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     height_label);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     type_label);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     bytes_label);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     folder_button);
+
+#if HAVE_EXIF
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     exif_aperture_label);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     exif_exposure_label);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     exif_focal_label);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     exif_flash_label);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     exif_iso_label);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     exif_metering_label);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     exif_model_label);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     exif_date_label);
+#endif
+#if HAVE_EXEMPI
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     xmp_location_label);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     xmp_description_label);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     xmp_keywords_label);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     xmp_creator_label);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     xmp_rights_label);
+#else
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     xmp_box);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     xmp_box_label);
+#endif
+#ifdef HAVE_METADATA
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     metadata_box);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     metadata_details_expander);
+	gtk_widget_class_bind_template_child_private(wklass,
+						     EomPropertiesDialog,
+						     metadata_details_box);
+
+	gtk_widget_class_bind_template_callback(wklass,
+						pd_exif_details_activated_cb);
+#endif
+	gtk_widget_class_bind_template_callback(wklass,
+						eom_properties_dialog_page_switch);
+	gtk_widget_class_bind_template_callback(wklass,
+						pd_folder_button_clicked_cb);
+}
+
+static void
+eom_properties_dialog_init (EomPropertiesDialog *prop_dlg)
+{
+	EomPropertiesDialogPrivate *priv;
+#if HAVE_METADATA
+	GtkWidget *sw;
+#endif
+
+	prop_dlg->priv = eom_properties_dialog_get_instance_private (prop_dlg);
+
+	priv = prop_dlg->priv;
+
+	priv->update_page = FALSE;
+
+	gtk_widget_init_template (GTK_WIDGET (prop_dlg));
+
+	g_signal_connect (prop_dlg,
+	                  "delete-event",
+	                 G_CALLBACK (gtk_widget_hide_on_delete),
+	                 prop_dlg);
+
+	g_signal_connect_swapped (priv->close_button,
+	                          "clicked",
+	                          G_CALLBACK (gtk_widget_hide_on_delete),
+	                          prop_dlg);
+
+	gtk_widget_set_size_request (priv->thumbnail_image, 100, 100);
+
+#ifdef HAVE_METADATA
+ 	sw = gtk_scrolled_window_new (NULL, NULL);
+
+	gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
+					     GTK_SHADOW_IN);
+
+	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
+					GTK_POLICY_AUTOMATIC,
+					GTK_POLICY_AUTOMATIC);
+
+	priv->metadata_details = eom_metadata_details_new ();
+	gtk_widget_set_size_request (priv->metadata_details, -1, 170);
+	gtk_container_set_border_width (GTK_CONTAINER (sw), 6);
+	gtk_widget_set_vexpand (priv->metadata_details, TRUE);
+
+	gtk_container_add (GTK_CONTAINER (sw), priv->metadata_details);
+	gtk_widget_show_all (sw);
+
+	priv->metadata_details_sw = sw;
+
+	if (priv->netbook_mode) {
+		gtk_widget_hide (priv->metadata_details_expander);
+		gtk_box_pack_start (GTK_BOX (priv->metadata_details_box),
+				    sw, TRUE, TRUE, 6);
+	} else {
+		gtk_container_add (GTK_CONTAINER (priv->metadata_details_expander),
+				   sw);
+	}
+
+#ifndef HAVE_EXEMPI
+	gtk_widget_hide (priv->xmp_box);
+	gtk_widget_hide (priv->xmp_box_label);
+#endif
+
+#else
+	/* Remove pages from back to front. Otherwise the page index
+	 * needs to be adjusted when deleting the next page. */
+	gtk_notebook_remove_page (GTK_NOTEBOOK (priv->notebook),
+				  EOM_PROPERTIES_DIALOG_PAGE_DETAILS);
+	gtk_notebook_remove_page (GTK_NOTEBOOK (priv->notebook),
+				  EOM_PROPERTIES_DIALOG_PAGE_EXIF);
+#endif
+
+    /* Add tab scrolling support for GTK3 */
+    gtk_widget_add_events (priv->notebook, GDK_SCROLL_MASK);
+    g_signal_connect (priv->notebook,
+                      "scroll-event",
+                      G_CALLBACK (eom_notebook_scroll_event_cb),
+                      NULL);
+}
+
+/**
+ * eom_properties_dialog_new:
+ * @parent: the dialog's parent window
+ * @thumbview:
+ * @next_image_action:
+ * @previous_image_action:
+ *
+ *
+ *
+ * Returns: (transfer full) (type EomPropertiesDialog): a new #EomPropertiesDialog
+ **/
+
+GtkWidget *
+eom_properties_dialog_new (GtkWindow    *parent,
+			   EomThumbView *thumbview,
+			   GtkAction    *next_image_action,
+			   GtkAction    *previous_image_action)
+{
+	GObject *prop_dlg;
+
+	g_return_val_if_fail (GTK_IS_WINDOW (parent), NULL);
+	g_return_val_if_fail (EOM_IS_THUMB_VIEW (thumbview), NULL);
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	g_return_val_if_fail (GTK_IS_ACTION (next_image_action), NULL);
+	g_return_val_if_fail (GTK_IS_ACTION (previous_image_action), NULL);
+
+	prop_dlg = g_object_new (EOM_TYPE_PROPERTIES_DIALOG,
+	                         "thumbview", thumbview,
+	                         NULL);
+
+	if (parent) {
+		gtk_window_set_transient_for (GTK_WINDOW (prop_dlg), parent);
+	}
+
+	gtk_activatable_set_related_action (GTK_ACTIVATABLE (EOM_PROPERTIES_DIALOG (prop_dlg)->priv->next_button), next_image_action);
+
+	gtk_activatable_set_related_action (GTK_ACTIVATABLE (EOM_PROPERTIES_DIALOG (prop_dlg)->priv->previous_button), previous_image_action);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+
+	return GTK_WIDGET (prop_dlg);
+}
+
+void
+eom_properties_dialog_update (EomPropertiesDialog *prop_dlg,
+			      EomImage            *image)
+{
+	g_return_if_fail (EOM_IS_PROPERTIES_DIALOG (prop_dlg));
+
+	prop_dlg->priv->update_page = FALSE;
+
+	pd_update_general_tab (prop_dlg, image);
+
+#ifdef HAVE_METADATA
+	pd_update_metadata_tab (prop_dlg, image);
+#endif
+	gtk_notebook_set_current_page (GTK_NOTEBOOK (prop_dlg->priv->notebook),
+				       prop_dlg->priv->current_page);
+
+	prop_dlg->priv->update_page = TRUE;
+}
+
+void
+eom_properties_dialog_set_page (EomPropertiesDialog *prop_dlg,
+			        EomPropertiesDialogPage page)
+{
+	g_return_if_fail (EOM_IS_PROPERTIES_DIALOG (prop_dlg));
+
+	prop_dlg->priv->current_page = page;
+
+	gtk_notebook_set_current_page (GTK_NOTEBOOK (prop_dlg->priv->notebook),
+				       page);
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/79.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/79.html new file mode 100644 index 0000000..5b768d1 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/79.html @@ -0,0 +1,1833 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#if defined (__ELF__) && ( __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6))
+# define SECTION __attribute__ ((section (".gresource.eom"), aligned (8)))
+#else
+# define SECTION
+#endif
+
+static const SECTION union { const guint8 data[9456]; const double alignment; void * const ptr;}  _eom_resource_data = { {<--- union member 'Anonymous0::alignment' is never used.<--- union member 'Anonymous0::ptr' is never used.
+  0107, 0126, 0141, 0162, 0151, 0141, 0156, 0164, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 
+  0030, 0000, 0000, 0000, 0250, 0001, 0000, 0000, 0000, 0000, 0000, 0050, 0016, 0000, 0000, 0000, 
+  0000, 0000, 0000, 0000, 0001, 0000, 0000, 0000, 0002, 0000, 0000, 0000, 0005, 0000, 0000, 0000, 
+  0005, 0000, 0000, 0000, 0006, 0000, 0000, 0000, 0006, 0000, 0000, 0000, 0007, 0000, 0000, 0000, 
+  0011, 0000, 0000, 0000, 0012, 0000, 0000, 0000, 0013, 0000, 0000, 0000, 0013, 0000, 0000, 0000, 
+  0015, 0000, 0000, 0000, 0016, 0000, 0000, 0000, 0136, 0073, 0312, 0116, 0011, 0000, 0000, 0000, 
+  0250, 0001, 0000, 0000, 0036, 0000, 0166, 0000, 0310, 0001, 0000, 0000, 0363, 0007, 0000, 0000, 
+  0113, 0120, 0220, 0013, 0003, 0000, 0000, 0000, 0363, 0007, 0000, 0000, 0004, 0000, 0114, 0000, 
+  0370, 0007, 0000, 0000, 0374, 0007, 0000, 0000, 0376, 0257, 0370, 0026, 0010, 0000, 0000, 0000, 
+  0374, 0007, 0000, 0000, 0023, 0000, 0166, 0000, 0020, 0010, 0000, 0000, 0372, 0011, 0000, 0000, 
+  0324, 0265, 0002, 0000, 0377, 0377, 0377, 0377, 0372, 0011, 0000, 0000, 0001, 0000, 0114, 0000, 
+  0374, 0011, 0000, 0000, 0000, 0012, 0000, 0000, 0022, 0363, 0015, 0161, 0011, 0000, 0000, 0000, 
+  0000, 0012, 0000, 0000, 0036, 0000, 0166, 0000, 0040, 0012, 0000, 0000, 0145, 0021, 0000, 0000, 
+  0010, 0052, 0352, 0022, 0011, 0000, 0000, 0000, 0145, 0021, 0000, 0000, 0011, 0000, 0166, 0000, 
+  0160, 0021, 0000, 0000, 0364, 0025, 0000, 0000, 0166, 0171, 0123, 0260, 0011, 0000, 0000, 0000, 
+  0364, 0025, 0000, 0000, 0007, 0000, 0166, 0000, 0000, 0026, 0000, 0000, 0270, 0026, 0000, 0000, 
+  0261, 0362, 0170, 0170, 0013, 0000, 0000, 0000, 0270, 0026, 0000, 0000, 0004, 0000, 0114, 0000, 
+  0274, 0026, 0000, 0000, 0300, 0026, 0000, 0000, 0257, 0002, 0325, 0061, 0011, 0000, 0000, 0000, 
+  0300, 0026, 0000, 0000, 0010, 0000, 0114, 0000, 0310, 0026, 0000, 0000, 0314, 0026, 0000, 0000, 
+  0176, 0300, 0216, 0312, 0007, 0000, 0000, 0000, 0314, 0026, 0000, 0000, 0003, 0000, 0114, 0000, 
+  0320, 0026, 0000, 0000, 0360, 0026, 0000, 0000, 0007, 0064, 0342, 0034, 0011, 0000, 0000, 0000, 
+  0360, 0026, 0000, 0000, 0031, 0000, 0166, 0000, 0020, 0027, 0000, 0000, 0377, 0035, 0000, 0000, 
+  0201, 0321, 0040, 0031, 0001, 0000, 0000, 0000, 0377, 0035, 0000, 0000, 0005, 0000, 0114, 0000, 
+  0004, 0036, 0000, 0000, 0010, 0036, 0000, 0000, 0011, 0156, 0067, 0122, 0011, 0000, 0000, 0000, 
+  0010, 0036, 0000, 0000, 0012, 0000, 0166, 0000, 0030, 0036, 0000, 0000, 0025, 0041, 0000, 0000, 
+  0122, 0161, 0064, 0344, 0011, 0000, 0000, 0000, 0025, 0041, 0000, 0000, 0023, 0000, 0166, 0000, 
+  0050, 0041, 0000, 0000, 0357, 0044, 0000, 0000, 0145, 0157, 0155, 0055, 0155, 0165, 0154, 0164, 
+  0151, 0160, 0154, 0145, 0055, 0163, 0141, 0166, 0145, 0055, 0141, 0163, 0055, 0144, 0151, 0141, 
+  0154, 0157, 0147, 0056, 0165, 0151, 0000, 0000, 0075, 0065, 0000, 0000, 0001, 0000, 0000, 0000, 
+  0170, 0332, 0355, 0133, 0133, 0123, 0333, 0070, 0024, 0176, 0337, 0137, 0241, 0365, 0114, 0373, 
+  0320, 0035, 0021, 0342, 0100, 0267, 0323, 0222, 0164, 0150, 0013, 0154, 0247, 0027, 0030, 0102, 
+  0237, 0075, 0212, 0175, 0022, 0253, 0310, 0222, 0127, 0222, 0011, 0314, 0354, 0217, 0337, 0043, 
+  0233, 0100, 0056, 0216, 0343, 0160, 0011, 0011, 0155, 0136, 0260, 0345, 0043, 0353, 0334, 0364, 
+  0235, 0213, 0314, 0336, 0373, 0313, 0104, 0220, 0013, 0320, 0206, 0053, 0331, 0366, 0232, 0133, 
+  0333, 0036, 0001, 0031, 0252, 0210, 0313, 0101, 0333, 0373, 0161, 0166, 0110, 0337, 0170, 0357, 
+  0073, 0177, 0354, 0375, 0111, 0051, 0071, 0002, 0011, 0232, 0131, 0210, 0310, 0220, 0333, 0230, 
+  0014, 0004, 0213, 0200, 0264, 0266, 0132, 0157, 0266, 0174, 0102, 0151, 0101, 0364, 0212, 0222, 
+  0104, 0105, 0360, 0226, 0270, 0327, 0342, 0235, 0033, 0346, 0322, 0202, 0356, 0263, 0020, 0072, 
+  0173, 0032, 0376, 0315, 0270, 0006, 0103, 0004, 0357, 0265, 0275, 0201, 0075, 0377, 0313, 0273, 
+  0135, 0274, 0265, 0345, 0373, 0136, 0243, 0263, 0247, 0172, 0077, 0041, 0264, 0044, 0024, 0314, 
+  0230, 0266, 0167, 0144, 0317, 0367, 0243, 0237, 0231, 0261, 0011, 0110, 0353, 0021, 0036, 0265, 
+  0075, 0166, 0163, 0337, 0364, 0072, 0173, 0251, 0126, 0051, 0150, 0173, 0105, 0044, 0113, 0240, 
+  0355, 0145, 0051, 0336, 0171, 0235, 0346, 0166, 0361, 0333, 0153, 0214, 0236, 0317, 0120, 0136, 
+  0060, 0221, 0001, 0122, 0126, 0220, 0030, 0013, 0051, 0345, 0062, 0324, 0220, 0257, 0136, 0111, 
+  0233, 0262, 0001, 0114, 0320, 0116, 0254, 0335, 0050, 0244, 0052, 0221, 0356, 0163, 0202, 0023, 
+  0013, 0301, 0270, 0273, 0054, 0221, 0351, 0202, 0033, 0336, 0023, 0310, 0353, 0231, 0316, 0240, 
+  0202, 0205, 0220, 0111, 0332, 0127, 0141, 0146, 0274, 0316, 0041, 0023, 0246, 0212, 0224, 0207, 
+  0112, 0122, 0167, 0351, 0165, 0042, 0234, 0341, 0130, 0246, 0206, 0135, 0000, 0145, 0346, 0156, 
+  0154, 0373, 0253, 0146, 0033, 0237, 0204, 0140, 0014, 0065, 0126, 0245, 0365, 0130, 0376, 0304, 
+  0231, 0120, 0203, 0202, 0147, 0120, 0111, 0220, 0144, 0302, 0362, 0124, 0100, 0340, 0004, 0017, 
+  0230, 0011, 0242, 0202, 0340, 0076, 0014, 0302, 0005, 0152, 0022, 0351, 0216, 0076, 0175, 0011, 
+  0116, 0216, 0077, 0177, 0077, 0073, 0070, 0015, 0276, 0035, 0237, 0175, 0076, 0376, 0036, 0174, 
+  0333, 0357, 0176, 0041, 0377, 0221, 0222, 0047, 0377, 0340, 0335, 0370, 0343, 0017, 0077, 0316, 
+  0316, 0160, 0370, 0344, 0364, 0240, 0333, 0055, 0031, 0077, 0075, 0370, 0172, 0260, 0337, 0075, 
+  0310, 0237, 0124, 0260, 0322, 0123, 0072, 0002, 0115, 0207, 0074, 0262, 0261, 0327, 0331, 0255, 
+  0240, 0264, 0334, 0242, 0231, 0210, 0325, 0114, 0032, 0301, 0054, 0103, 0243, 0265, 0275, 0053, 
+  0100, 0061, 0272, 0250, 0031, 0262, 0157, 0052, 0346, 0016, 0271, 0214, 0324, 0220, 0246, 0312, 
+  0160, 0213, 0333, 0330, 0353, 0204, 0340, 0366, 0073, 0105, 0073, 0245, 0114, 0343, 0165, 0325, 
+  0272, 0127, 0051, 0320, 0230, 0273, 0335, 0122, 0250, 0176, 0234, 0066, 0214, 0271, 0210, 0110, 
+  0016, 0036, 0222, 0011, 0232, 0337, 0242, 0117, 0365, 0324, 0245, 0127, 0142, 0333, 0017, 0070, 
+  0234, 0033, 0266, 0170, 0021, 0165, 0164, 0073, 0053, 0161, 0111, 0245, 0071, 0112, 0311, 0012, 
+  0341, 0021, 0314, 0054, 0017, 0231, 0250, 0302, 0224, 0224, 0205, 0210, 0256, 0136, 0307, 0137, 
+  0054, 0055, 0013, 0335, 0153, 0003, 0324, 0043, 0053, 0025, 0072, 0263, 0126, 0311, 0151, 0321, 
+  0307, 0046, 0255, 0106, 0003, 0202, 0135, 0251, 0014, 0341, 0303, 0136, 0271, 0367, 0202, 0214, 
+  0146, 0004, 0233, 0313, 0173, 0301, 0070, 0256, 0025, 0202, 0010, 0172, 0305, 0120, 0311, 0373, 
+  0173, 0040, 0112, 0335, 0063, 0370, 0230, 0317, 0254, 0002, 0371, 0345, 0305, 0135, 0100, 0251, 
+  0041, 0004, 0176, 0001, 0206, 0106, 0320, 0147, 0210, 0040, 0065, 0100, 0053, 0207, 0312, 0116, 
+  0001, 0223, 0025, 0164, 0231, 0001, 0232, 0111, 0334, 0263, 0202, 0313, 0022, 0216, 0157, 0200, 
+  0015, 0035, 0350, 0034, 0075, 0150, 0026, 0173, 0056, 0123, 0046, 0243, 0205, 0002, 0364, 0271, 
+  0020, 0013, 0211, 0156, 0367, 0363, 0144, 0030, 0273, 0131, 0273, 0161, 0155, 0330, 0072, 0366, 
+  0035, 0341, 0353, 0362, 0006, 0316, 0361, 0047, 0250, 0004, 0240, 0165, 0263, 0160, 0163, 0343, 
+  0054, 0334, 0254, 0266, 0160, 0155, 0256, 0026, 0151, 0251, 0036, 0133, 0270, 0010, 0165, 0201, 
+  0141, 0006, 0111, 0036, 0334, 0103, 0107, 0270, 0351, 0142, 0105, 0163, 0275, 0143, 0305, 0353, 
+  0072, 0220, 0172, 0250, 0135, 0142, 0224, 0213, 0324, 0167, 0227, 0376, 0212, 0320, 0037, 0067, 
+  0057, 0275, 0144, 0202, 0017, 0246, 0155, 0061, 0055, 0115, 0314, 0134, 0252, 0120, 0030, 0127, 
+  0052, 0011, 0165, 0204, 0332, 0167, 0357, 0035, 0313, 0375, 0107, 0267, 0255, 0225, 0010, 0207, 
+  0271, 0045, 0246, 0061, 0121, 0064, 0153, 0204, 0231, 0144, 0013, 0241, 0055, 0251, 0107, 0053, 
+  0240, 0157, 0157, 0051, 0233, 0176, 0211, 0032, 0134, 0275, 0045, 0151, 0250, 0104, 0226, 0110, 
+  0323, 0156, 0341, 0265, 0126, 0103, 0167, 0201, 0025, 0325, 0254, 0216, 0216, 0064, 0217, 0012, 
+  0365, 0344, 0330, 0271, 0032, 0325, 0040, 0103, 0264, 0334, 0077, 0247, 0337, 0231, 0113, 0101, 
+  0227, 0363, 0345, 0211, 0315, 0351, 0257, 0307, 0346, 0234, 0307, 0353, 0327, 0042, 0174, 0071, 
+  0156, 0363, 0315, 0320, 0134, 0015, 0277, 0361, 0365, 0226, 0063, 0226, 0151, 0273, 0150, 0203, 
+  0226, 0106, 0327, 0227, 0302, 0276, 0353, 0275, 0034, 0330, 0167, 0057, 0372, 0157, 0335, 0165, 
+  0043, 0277, 0041, 0250, 0210, 0001, 0307, 0054, 0224, 0040, 0140, 0203, 0173, 0307, 0202, 0210, 
+  0226, 0060, 0175, 0236, 0245, 0263, 0242, 0061, 0153, 0065, 0307, 0230, 0017, 0146, 0354, 0372, 
+  0246, 0262, 0166, 0311, 0042, 0311, 0153, 0160, 0214, 0237, 0026, 0145, 0011, 0135, 0361, 0077, 
+  0103, 0207, 0066, 0270, 0245, 0333, 0336, 0172, 0263, 0075, 0371, 0333, 0161, 0223, 0032, 0343, 
+  0053, 0155, 0126, 0232, 0064, 0343, 0073, 0177, 0157, 0234, 0357, 0310, 0161, 0337, 0011, 0125, 
+  0346, 0152, 0230, 0337, 0036, 0363, 0370, 0151, 0127, 0036, 0106, 0120, 0016, 0026, 0306, 0325, 
+  0235, 0051, 0027, 0304, 0106, 0164, 0176, 0145, 0051, 0237, 0167, 0012, 0374, 0273, 0171, 0362, 
+  0107, 0225, 0364, 0324, 0015, 0154, 0367, 0225, 0116, 0230, 0015, 0102, 0067, 0130, 0224, 0354, 
+  0217, 0340, 0324, 0313, 0251, 0310, 0257, 0251, 0242, 0346, 0335, 0344, 0077, 0220, 0126, 0137, 
+  0135, 0107, 0141, 0165, 0016, 0062, 0200, 0174, 0140, 0005, 0365, 0312, 0032, 0365, 0234, 0342, 
+  0232, 0133, 0205, 0313, 0153, 0065, 0320, 0060, 0146, 0332, 0353, 0274, 0252, 0262, 0015, 0134, 
+  0142, 0011, 0366, 0242, 0177, 0167, 0313, 0067, 0037, 0327, 0362, 0207, 0030, 0046, 0077, 0306, 
+  0112, 0031, 0320, 0343, 0125, 0157, 0304, 0165, 0020, 0026, 0303, 0053, 0301, 0364, 0242, 0357, 
+  0203, 0230, 0016, 0002, 0371, 0303, 0131, 0042, 0252, 0004, 0142, 0241, 0020, 0051, 0251, 0222, 
+  0342, 0252, 0106, 0036, 0074, 0267, 0103, 0130, 0010, 0116, 0030, 0231, 0135, 0357, 0161, 0214, 
+  0264, 0375, 0150, 0010, 0066, 0023, 0213, 0267, 0067, 0044, 0026, 0177, 0002, 0143, 0061, 0141, 
+  0163, 0346, 0277, 0066, 0303, 0333, 0273, 0333, 0141, 0373, 0056, 0166, 0270, 0207, 0222, 0233, 
+  0033, 0242, 0344, 0303, 0353, 0144, 0230, 0024, 0241, 0155, 0005, 0032, 0256, 0007, 0107, 0251, 
+  0140, 0041, 0304, 0271, 0325, 0033, 0045, 0331, 0303, 0334, 0201, 0242, 0343, 0354, 0212, 0361, 
+  0221, 0324, 0165, 0254, 0265, 0272, 0226, 0302, 0134, 0043, 0220, 0023, 0146, 0143, 0322, 0115, 
+  0041, 0344, 0175, 0054, 0321, 0234, 0327, 0233, 0272, 0111, 0344, 0020, 0370, 0040, 0266, 0067, 
+  0331, 0141, 0017, 0325, 0066, 0077, 0035, 0134, 0272, 0001, 0266, 0026, 0025, 0305, 0164, 0027, 
+  0250, 0365, 0234, 0273, 0100, 0073, 0317, 0272, 0013, 0124, 0335, 0025, 0151, 0265, 0066, 0355, 
+  0174, 0253, 0112, 0242, 0330, 0365, 0171, 0126, 0043, 0321, 0162, 0235, 0250, 0151, 0010, 0364, 
+  0133, 0117, 0214, 0201, 0135, 0027, 0302, 0106, 0205, 0066, 0131, 0066, 0022, 0055, 0327, 0254, 
+  0137, 0104, 0165, 0157, 0264, 0352, 0246, 0134, 0116, 0034, 0005, 0026, 0142, 0005, 0006, 0307, 
+  0177, 0261, 0332, 0351, 0366, 0263, 0026, 0257, 0063, 0366, 0211, 0113, 0225, 0230, 0202, 0047, 
+  0075, 0352, 0276, 0311, 0251, 0116, 0237, 0145, 0226, 0200, 0346, 0341, 0075, 0016, 0234, 0036, 
+  0332, 0133, 0126, 0173, 0344, 0364, 0350, 0136, 0374, 0061, 0206, 0160, 0342, 0304, 0123, 0103, 
+  0236, 0226, 0005, 0016, 0152, 0300, 0140, 0031, 0210, 0317, 0227, 0071, 0367, 0074, 0055, 0346, 
+  0223, 0142, 0176, 0361, 0301, 0125, 0176, 0160, 0150, 0102, 0245, 0141, 0335, 0217, 0103, 0027, 
+  0034, 0163, 0116, 0121, 0107, 0232, 0015, 0051, 0227, 0221, 0313, 0345, 0224, 0176, 0172, 0047, 
+  0035, 0205, 0144, 0377, 0101, 0075, 0371, 0141, 0363, 0160, 0377, 0211, 0143, 0320, 0161, 0372, 
+  0154, 0323, 0356, 0346, 0303, 0244, 0335, 0073, 0317, 0071, 0355, 0336, 0375, 0175, 0370, 0072, 
+  0357, 0360, 0165, 0167, 0203, 0016, 0137, 0313, 0151, 0143, 0225, 0250, 0001, 0110, 0120, 0145, 
+  0261, 0241, 0106, 0226, 0234, 0152, 0270, 0340, 0060, 0014, 0106, 0140, 0266, 0156, 0315, 0235, 
+  0116, 0376, 0147, 0155, 0273, 0311, 0363, 0064, 0031, 0364, 0265, 0112, 0176, 0141, 0165, 0076, 
+  0130, 0277, 0361, 0365, 0206, 0064, 0034, 0117, 0257, 0333, 0215, 0150, 0366, 0115, 0152, 0347, 
+  0356, 0156, 0210, 0172, 0317, 0324, 0232, 0267, 0160, 0237, 0342, 0341, 0043, 0245, 0253, 0255, 
+  0165, 0150, 0033, 0177, 0167, 0273, 0351, 0244, 0200, 0324, 0347, 0230, 0270, 0372, 0017, 0124, 
+  0123, 0077, 0315, 0127, 0016, 0243, 0201, 0342, 0024, 0323, 0375, 0327, 0302, 0000, 0254, 0231, 
+  0272, 0047, 0130, 0373, 0246, 0130, 0167, 0340, 0012, 0024, 0141, 0174, 0342, 0273, 0161, 0064, 
+  0312, 0070, 0151, 0305, 0114, 0104, 0250, 0311, 0057, 0222, 0147, 0246, 0066, 0246, 0271, 0270, 
+  0145, 0363, 0366, 0277, 0231, 0376, 0370, 0037, 0043, 0216, 0102, 0240, 0000, 0050, 0165, 0165, 
+  0141, 0171, 0051, 0157, 0162, 0147, 0057, 0000, 0013, 0000, 0000, 0000, 0164, 0150, 0165, 0155, 
+  0142, 0156, 0141, 0151, 0154, 0055, 0146, 0162, 0141, 0155, 0145, 0056, 0160, 0156, 0147, 0000, 
+  0332, 0001, 0000, 0000, 0000, 0000, 0000, 0000, 0211, 0120, 0116, 0107, 0015, 0012, 0032, 0012, 
+  0000, 0000, 0000, 0015, 0111, 0110, 0104, 0122, 0000, 0000, 0000, 0100, 0000, 0000, 0000, 0100, 
+  0010, 0004, 0000, 0000, 0000, 0000, 0140, 0271, 0125, 0000, 0000, 0000, 0004, 0147, 0101, 0115, 
+  0101, 0000, 0000, 0330, 0353, 0365, 0034, 0024, 0252, 0000, 0000, 0000, 0040, 0143, 0110, 0122, 
+  0115, 0000, 0000, 0172, 0045, 0000, 0000, 0200, 0203, 0000, 0000, 0364, 0045, 0000, 0000, 0204, 
+  0317, 0000, 0000, 0155, 0137, 0000, 0000, 0350, 0154, 0000, 0000, 0074, 0213, 0000, 0000, 0033, 
+  0130, 0325, 0222, 0146, 0223, 0000, 0000, 0001, 0145, 0111, 0104, 0101, 0124, 0170, 0001, 0355, 
+  0231, 0131, 0152, 0303, 0100, 0014, 0206, 0277, 0231, 0354, 0173, 0356, 0060, 0357, 0335, 0017, 
+  0222, 0213, 0064, 0217, 0211, 0175, 0266, 0036, 0116, 0065, 0002, 0201, 0140, 0336, 0255, 0202, 
+  0312, 0217, 0166, 0143, 0176, 0344, 0131, 0061, 0124, 0026, 0154, 0071, 0162, 0122, 0034, 0061, 
+  0175, 0124, 0075, 0211, 0125, 0024, 0336, 0063, 0153, 0332, 0236, 0166, 0031, 0023, 0127, 0263, 
+  0334, 0226, 0005, 0105, 0200, 0045, 0022, 0202, 0306, 0205, 0245, 0000, 0133, 0344, 0147, 0166, 
+  0040, 0334, 0150, 0154, 0005, 0070, 0062, 0045, 0204, 0071, 0241, 0004, 0356, 0274, 0161, 0244, 
+  0306, 0021, 0030, 0370, 0104, 0011, 0234, 0302, 0010, 0174, 0105, 0166, 0300, 0010, 0224, 0304, 
+  0035, 0030, 0255, 0003, 0341, 0203, 0060, 0162, 0014, 0234, 0042, 0147, 0301, 0250, 0004, 0112, 
+  0044, 0201, 0117, 0045, 0020, 0074, 0010, 0153, 0362, 0101, 0030, 0117, 0200, 0362, 0337, 0201, 
+  0344, 0013, 0321, 0061, 0176, 0045, 0014, 0337, 0013, 0112, 0336, 0275, 0300, 0072, 0220, 0372, 
+  0120, 0372, 0031, 0073, 0010, 0307, 0370, 0117, 0360, 0025, 0337, 0201, 0340, 0061, 0140, 0004, 
+  0222, 0137, 0114, 0242, 0017, 0245, 0231, 0067, 0243, 0361, 0317, 0254, 0204, 0071, 0057, 0046, 
+  0326, 0201, 0370, 0355, 0270, 0246, 0046, 0140, 0143, 0040, 0363, 0365, 0374, 0030, 0277, 0020, 
+  0145, 0076, 0226, 0373, 0355, 0070, 0361, 0335, 0060, 0172, 0026, 0304, 0137, 0317, 0323, 0137, 
+  0114, 0162, 0037, 0112, 0375, 0047, 0310, 0173, 0061, 0211, 0337, 0214, 0154, 0020, 0316, 0016, 
+  0204, 0247, 0133, 0210, 0102, 0360, 0155, 0377, 0015, 0167, 0064, 0156, 0334, 0171, 0062, 0062, 
+  0250, 0050, 0314, 0353, 0342, 0336, 0357, 0063, 0243, 0323, 0335, 0033, 0325, 0336, 0271, 0321, 
+  0330, 0121, 0140, 0311, 0225, 0306, 0033, 0237, 0174, 0251, 0114, 0332, 0371, 0146, 0055, 0257, 
+  0265, 0256, 0142, 0125, 0127, 0351, 0252, 0246, 0125, 0170, 0245, 0161, 0145, 0051, 0100, 0141, 
+  0311, 0226, 0243, 0242, 0373, 0373, 0255, 0272, 0363, 0234, 0365, 0117, 0373, 0232, 0345, 0373, 
+  0167, 0130, 0145, 0313, 0222, 0052, 0040, 0120, 0004, 0052, 0105, 0105, 0065, 0125, 0121, 0234, 
+  0070, 0370, 0272, 0152, 0213, 0373, 0234, 0305, 0375, 0033, 0024, 0202, 0360, 0013, 0333, 0245, 
+  0223, 0145, 0342, 0165, 0274, 0152, 0000, 0000, 0000, 0000, 0111, 0105, 0116, 0104, 0256, 0102, 
+  0140, 0202, 0000, 0000, 0050, 0165, 0165, 0141, 0171, 0051, 0057, 0000, 0001, 0000, 0000, 0000, 
+  0145, 0157, 0155, 0055, 0151, 0155, 0141, 0147, 0145, 0055, 0160, 0162, 0157, 0160, 0145, 0162, 
+  0164, 0151, 0145, 0163, 0055, 0144, 0151, 0141, 0154, 0157, 0147, 0056, 0165, 0151, 0000, 0000, 
+  0254, 0160, 0000, 0000, 0001, 0000, 0000, 0000, 0170, 0332, 0355, 0135, 0133, 0167, 0342, 0066, 
+  0020, 0176, 0337, 0137, 0341, 0352, 0265, 0307, 0001, 0103, 0262, 0271, 0234, 0304, 0173, 0366, 
+  0336, 0075, 0315, 0156, 0367, 0164, 0323, 0366, 0321, 0107, 0330, 0003, 0150, 0221, 0055, 0127, 
+  0222, 0111, 0350, 0257, 0257, 0144, 0233, 0140, 0356, 0220, 0030, 0142, 0201, 0337, 0014, 0214, 
+  0320, 0110, 0337, 0247, 0321, 0214, 0106, 0262, 0256, 0337, 0074, 0204, 0324, 0032, 0002, 0027, 
+  0204, 0105, 0067, 0310, 0071, 0151, 0042, 0013, 0042, 0237, 0005, 0044, 0352, 0335, 0240, 0277, 
+  0356, 0076, 0331, 0027, 0350, 0215, 0373, 0352, 0372, 0027, 0333, 0266, 0076, 0103, 0004, 0034, 
+  0113, 0010, 0254, 0173, 0042, 0373, 0126, 0217, 0342, 0000, 0254, 0366, 0111, 0373, 0342, 0244, 
+  0145, 0331, 0266, 0022, 0042, 0221, 0004, 0336, 0305, 0076, 0270, 0327, 0034, 0376, 0115, 0010, 
+  0007, 0141, 0121, 0322, 0271, 0101, 0075, 0071, 0370, 0025, 0115, 0152, 0151, 0237, 0264, 0132, 
+  0250, 0341, 0136, 0263, 0316, 0117, 0360, 0245, 0345, 0123, 0054, 0304, 0015, 0372, 0054, 0007, 
+  0137, 0102, 0334, 0003, 0144, 0221, 0340, 0006, 0021, 0375, 0350, 0040, 0367, 0072, 0346, 0054, 
+  0006, 0056, 0107, 0126, 0204, 0103, 0270, 0101, 0103, 0042, 0110, 0207, 0002, 0162, 0357, 0170, 
+  0002, 0327, 0215, 0361, 0257, 0163, 0162, 0076, 0216, 0354, 0056, 0363, 0023, 0201, 0334, 0117, 
+  0230, 0212, 0125, 0242, 0304, 0147, 0221, 0255, 0037, 0221, 0333, 0143, 0166, 0004, 0017, 0262, 
+  0050, 0334, 0310, 0264, 0334, 0100, 0333, 0326, 0013, 0150, 0033, 0163, 0030, 0022, 0226, 0210, 
+  0247, 0151, 0334, 0336, 0267, 0306, 0367, 0044, 0012, 0330, 0275, 0355, 0123, 0066, 0135, 0342, 
+  0121, 0145, 0011, 0141, 0114, 0025, 0307, 0306, 0112, 0177, 0144, 0341, 0367, 0114, 0212, 0200, 
+  0370, 0100, 0060, 0145, 0075, 0144, 0305, 0230, 0103, 0044, 0323, 0026, 0345, 0137, 0075, 0107, 
+  0275, 0016, 0343, 0001, 0160, 0373, 0236, 0004, 0262, 0217, 0334, 0263, 0025, 0222, 0222, 0110, 
+  0325, 0063, 0226, 0344, 0070, 0022, 0112, 0111, 0254, 0372, 0351, 0006, 0215, 0100, 0325, 0221, 
+  0166, 0254, 0065, 0321, 0164, 0103, 0374, 0344, 0300, 0216, 0067, 0051, 0043, 0107, 0061, 0330, 
+  0175, 0065, 0274, 0220, 0033, 0244, 0015, 0056, 0312, 0372, 0175, 0102, 0003, 0053, 0035, 0173, 
+  0021, 0246, 0166, 0372, 0121, 0341, 0330, 0141, 0017, 0150, 0001, 0005, 0336, 0251, 0257, 0047, 
+  0004, 0050, 0124, 0157, 0147, 0377, 0154, 0347, 0005, 0167, 0117, 0013, 0306, 0211, 0102, 0021, 
+  0113, 0145, 0022, 0220, 0073, 0324, 0112, 0370, 0230, 0256, 0220, 0027, 0061, 0366, 0225, 0125, 
+  0102, 0156, 0153, 0175, 0353, 0261, 0257, 0377, 0326, 0123, 0074, 0301, 0013, 0073, 0041, 0221, 
+  0222, 0105, 0217, 0135, 0221, 0267, 0274, 0120, 0150, 0077, 0206, 0207, 0342, 0021, 0113, 0244, 
+  0055, 0344, 0110, 0377, 0057, 0104, 0301, 0134, 0303, 0226, 0352, 0236, 0051, 0076, 0036, 0375, 
+  0136, 0047, 0373, 0162, 0101, 0015, 0035, 0240, 0013, 0031, 0353, 0175, 0137, 0140, 0071, 0236, 
+  0337, 0344, 0065, 0222, 0034, 0174, 0040, 0103, 0115, 0066, 0350, 0342, 0204, 0312, 0265, 0005, 
+  0122, 0226, 0042, 0067, 0263, 0257, 0053, 0344, 0022, 0001, 0166, 0022, 0251, 0161, 0114, 0111, 
+  0264, 0100, 0341, 0107, 0373, 0242, 0070, 0064, 0120, 0044, 0232, 0053, 0017, 0017, 0061, 0216, 
+  0202, 0265, 0352, 0164, 0011, 0245, 0153, 0205, 0142, 0046, 0110, 0306, 0352, 0346, 0224, 0016, 
+  0217, 0165, 0067, 0162, 0154, 0067, 0201, 0130, 0117, 0107, 0117, 0201, 0367, 0333, 0314, 0064, 
+  0126, 0155, 0150, 0035, 0343, 0240, 0165, 0236, 0017, 0155, 0072, 0013, 0076, 0005, 0333, 0367, 
+  0263, 0323, 0347, 0316, 0301, 0325, 0222, 0233, 0342, 0072, 0117, 0204, 0265, 0016, 0102, 0201, 
+  0011, 0355, 0075, 0060, 0141, 0235, 0076, 0031, 0025, 0326, 0111, 0115, 0270, 0320, 0132, 0315, 
+  0205, 0175, 0353, 0245, 0152, 0261, 0265, 0307, 0060, 0067, 0245, 0224, 0155, 0247, 0276, 0061, 
+  0011, 0035, 0306, 0006, 0271, 0245, 0032, 0177, 0332, 0003, 0037, 0127, 0370, 0154, 0202, 0364, 
+  0224, 0043, 0060, 0366, 0031, 0124, 0244, 0342, 0367, 0355, 0070, 0165, 0173, 0373, 0252, 0223, 
+  0051, 0160, 0325, 0337, 0054, 0364, 0046, 0216, 0217, 0227, 0115, 0377, 0236, 0026, 0362, 0262, 
+  0002, 0310, 0312, 0332, 0272, 0304, 0377, 0024, 0367, 0070, 0216, 0041, 0155, 0262, 0016, 0143, 
+  0226, 0216, 0365, 0261, 0177, 0321, 0113, 0003, 0047, 0352, 0355, 0314, 0263, 0132, 0253, 0201, 
+  0166, 0352, 0132, 0347, 0173, 0161, 0152, 0246, 0241, 0161, 0232, 0317, 0361, 0000, 0227, 0265, 
+  0253, 0020, 0307, 0310, 0176, 0022, 0166, 0042, 0114, 0250, 0227, 0133, 0221, 0331, 0112, 0122, 
+  0105, 0154, 0035, 0217, 0202, 0220, 0132, 0241, 0125, 0032, 0365, 0201, 0364, 0372, 0162, 0123, 
+  0351, 0335, 0306, 0112, 0231, 0203, 0036, 0022, 0041, 0324, 0140, 0254, 0204, 0235, 0153, 0356, 
+  0325, 0316, 0355, 0334, 0313, 0032, 0017, 0216, 0276, 0032, 0034, 0316, 0145, 0325, 0006, 0307, 
+  0143, 0270, 0163, 0276, 0375, 0110, 0277, 0254, 0166, 0000, 0167, 0266, 0111, 0213, 0156, 0063, 
+  0377, 0107, 0267, 0051, 0165, 0205, 0332, 0257, 0367, 0322, 0250, 0076, 0246, 0152, 0002, 0101, 
+  0256, 0220, 0230, 0257, 0162, 0240, 0103, 0314, 0173, 0044, 0262, 0045, 0213, 0221, 0173, 0261, 
+  0136, 0256, 0303, 0224, 0227, 0027, 0256, 0026, 0135, 0356, 0361, 0175, 0123, 0277, 0137, 0255, 
+  0252, 0044, 0202, 0220, 0105, 0304, 0327, 0304, 0352, 0201, 0262, 0133, 0372, 0153, 0057, 0375, 
+  0277, 0025, 0245, 0176, 0046, 0102, 0222, 0356, 0010, 0271, 0134, 0033, 0275, 0242, 0040, 0226, 
+  0222, 0023, 0345, 0230, 0202, 0050, 0074, 0217, 0355, 0151, 0152, 0042, 0221, 0065, 0304, 0064, 
+  0111, 0031, 0115, 0003, 0075, 0011, 0066, 0212, 0145, 0252, 0152, 0241, 0066, 0346, 0332, 0371, 
+  0361, 0162, 0355, 0037, 0155, 0233, 0266, 0042, 0133, 0152, 0315, 0346, 0331, 0146, 0054, 0211, 
+  0234, 0222, 0110, 0164, 0161, 0274, 0044, 0372, 0055, 0305, 0167, 0053, 0026, 0145, 0256, 0327, 
+  0001, 0321, 0250, 0125, 0022, 0215, 0056, 0217, 0227, 0106, 0167, 0052, 0212, 0335, 0212, 0104, 
+  0072, 0354, 0075, 0040, 0012, 0265, 0313, 0241, 0320, 0151, 0363, 0170, 0051, 0364, 0156, 0244, 
+  0040, 0334, 0212, 0103, 0035, 0135, 0342, 0200, 0110, 0164, 0132, 0016, 0211, 0316, 0333, 0307, 
+  0113, 0242, 0133, 0346, 0247, 0141, 0316, 0126, 0074, 0352, 0052, 0026, 0000, 0317, 0327, 0167, 
+  0017, 0202, 0111, 0147, 0325, 0132, 0347, 0054, 0155, 0001, 0100, 0307, 0314, 0355, 0346, 0141, 
+  0305, 0314, 0223, 0010, 0260, 0262, 0303, 0366, 0162, 0363, 0141, 0173, 0276, 0252, 0213, 0200, 
+  0252, 0136, 0300, 0013, 0033, 0144, 0160, 0040, 0132, 0210, 0252, 0152, 0004, 0215, 0214, 0002, 
+  0213, 0021, 0115, 0015, 0241, 0221, 0021, 0330, 0044, 0236, 0250, 0001, 0064, 0062, 0376, 0051, 
+  0070, 0363, 0065, 0202, 0346, 0004, 0037, 0305, 0155, 0022, 0123, 0176, 0364, 0262, 0175, 0022, 
+  0356, 0274, 0233, 0135, 0201, 0035, 0057, 0123, 0271, 0150, 0237, 0022, 0177, 0000, 0101, 0041, 
+  0017, 0035, 0007, 0336, 0124, 0343, 0274, 0134, 0304, 0363, 0073, 0333, 0145, 0240, 0217, 0044, 
+  0042, 0050, 0153, 0163, 0116, 0325, 0325, 0232, 0032, 0035, 0226, 0236, 0203, 0324, 0114, 0204, 
+  0073, 0150, 0223, 0245, 0236, 0075, 0155, 0134, 0134, 0026, 0051, 0147, 0173, 0304, 0351, 0126, 
+  0266, 0107, 0225, 0267, 0227, 0020, 0357, 0011, 0301, 0134, 0010, 0022, 0007, 0112, 0047, 0257, 
+  0062, 0373, 0130, 0067, 0112, 0100, 0267, 0132, 0007, 0224, 0200, 0336, 0123, 0352, 0343, 0371, 
+  0075, 0237, 0052, 0353, 0034, 0140, 0266, 0374, 0242, 0132, 0311, 0247, 0345, 0006, 0343, 0255, 
+  0026, 0113, 0070, 0130, 0177, 0353, 0025, 0257, 0253, 0072, 0013, 0135, 0300, 0260, 0155, 0010, 
+  0206, 0037, 0037, 0124, 0333, 0065, 0206, 0167, 0044, 0074, 0020, 0010, 0113, 0312, 0001, 0137, 
+  0276, 0066, 0004, 0302, 0117, 0114, 0131, 0043, 0353, 0026, 0242, 0336, 0114, 0362, 0377, 0330, 
+  0323, 0257, 0227, 0147, 0246, 0040, 0250, 0232, 0160, 0040, 0320, 0225, 0224, 0366, 0274, 0074, 
+  0065, 0004, 0272, 0057, 0077, 0376, 0260, 0176, 0304, 0000, 0201, 0365, 0247, 0362, 0017, 0242, 
+  0336, 0125, 0235, 0167, 0054, 0240, 0150, 0312, 0054, 0370, 0025, 0044, 0160, 0325, 0104, 0353, 
+  0053, 0013, 0016, 0144, 0026, 0074, 0053, 0011, 0302, 0226, 0041, 0020, 0276, 0127, 0277, 0163, 
+  0234, 0002, 0110, 0257, 0216, 0153, 0347, 0344, 0353, 0222, 0240, 0166, 0014, 0201, 0372, 0003, 
+  0226, 0320, 0070, 0034, 0177, 0365, 0274, 0122, 0053, 0136, 0070, 0010, 0346, 0103, 0327, 0235, 
+  0245, 0357, 0037, 0302, 0330, 0253, 0374, 0241, 0345, 0047, 0105, 0361, 0216, 0143, 0314, 0160, 
+  0002, 0341, 0163, 0022, 0317, 0155, 0222, 0071, 0366, 0030, 0336, 0161, 0232, 0206, 0040, 0270, 
+  0160, 0217, 0323, 0261, 0307, 0357, 0216, 0143, 0212, 0353, 0362, 0073, 0214, 0356, 0031, 0017, 
+  0104, 0035, 0274, 0117, 0301, 0147, 0112, 0360, 0360, 0066, 0221, 0175, 0306, 0353, 0360, 0175, 
+  0012, 0074, 0123, 0342, 0367, 0367, 0054, 0036, 0361, 0271, 0003, 0017, 0207, 0032, 0270, 0327, 
+  0111, 0335, 0322, 0067, 0237, 0236, 0066, 0115, 0312, 0227, 0265, 0016, 0313, 0323, 0206, 0007, 
+  0322, 0365, 0160, 0236, 0206, 0252, 0340, 0126, 0041, 0375, 0326, 0213, 0020, 0363, 0101, 0022, 
+  0257, 0255, 0175, 0371, 0272, 0304, 0026, 0173, 0205, 0146, 0207, 0015, 0245, 0044, 0026, 0344, 
+  0277, 0371, 0327, 0111, 0030, 0354, 0233, 0247, 0230, 0103, 0236, 0266, 0062, 0033, 0163, 0263, 
+  0241, 0164, 0312, 0201, 0262, 0253, 0323, 0127, 0065, 0216, 0046, 0073, 0354, 0031, 0216, 0072, 
+  0211, 0125, 0343, 0150, 0262, 0357, 0236, 0342, 0110, 0004, 0253, 0121, 0064, 0071, 0365, 0226, 
+  0242, 0030, 0346, 0031, 0255, 0032, 0112, 0223, 0123, 0160, 0031, 0224, 0072, 0245, 0125, 0343, 
+  0150, 0162, 0176, 0055, 0305, 0061, 0300, 0262, 0366, 0127, 0353, 0074, 0333, 0113, 0346, 0331, 
+  0366, 0110, 0277, 0275, 0255, 0001, 0350, 0246, 0005, 0223, 0024, 0126, 0275, 0012, 0160, 0024, 
+  0253, 0000, 0032, 0165, 0232, 0247, 0275, 0152, 0243, 0152, 0362, 0042, 0200, 0106, 0162, 0220, 
+  0147, 0300, 0152, 0044, 0115, 0136, 0006, 0320, 0110, 0372, 0034, 0260, 0144, 0274, 0006, 0322, 
+  0344, 0165, 0000, 0015, 0144, 0072, 0001, 0325, 0003, 0262, 0316, 0345, 0035, 0330, 0001, 0115, 
+  0063, 0122, 0214, 0037, 0123, 0155, 0200, 0317, 0234, 0213, 0014, 0324, 0003, 0241, 0302, 0203, 
+  0361, 0317, 0273, 0070, 0052, 0235, 0353, 0024, 0123, 0354, 0103, 0077, 0075, 0343, 0334, 0130, 
+  0174, 0256, 0165, 0154, 0033, 0126, 0231, 0222, 0235, 0150, 0374, 0364, 0063, 0256, 0037, 0062, 
+  0165, 0312, 0314, 0365, 0117, 0035, 0024, 0217, 0230, 0166, 0337, 0257, 0256, 0362, 0346, 0316, 
+  0234, 0030, 0317, 0226, 0001, 0362, 0036, 0321, 0127, 0226, 0014, 0365, 0225, 0114, 0353, 0217, 
+  0214, 0343, 0256, 0324, 0377, 0240, 0133, 0260, 0364, 0370, 0370, 0013, 0207, 0261, 0355, 0162, 
+  0337, 0152, 0377, 0334, 0321, 0274, 0235, 0203, 0272, 0345, 0071, 0355, 0227, 0076, 0250, 0375, 
+  0065, 0067, 0007, 0133, 0315, 0122, 0113, 0172, 0144, 0077, 0347, 0271, 0307, 0234, 0257, 0332, 
+  0271, 0356, 0305, 0066, 0156, 0213, 0276, 0154, 0225, 0311, 0256, 0060, 0170, 0354, 0250, 0375, 
+  0271, 0135, 0133, 0331, 0312, 0247, 0366, 0314, 0163, 0130, 0146, 0312, 0033, 0037, 0262, 0053, 
+  0250, 0362, 0127, 0010, 0212, 0231, 0317, 0026, 0007, 0021, 0263, 0110, 0250, 0032, 0232, 0310, 
+  0235, 0271, 0373, 0111, 0315, 0047, 0105, 0331, 0225, 0105, 0013, 0167, 0012, 0155, 0134, 0314, 
+  0076, 0107, 0156, 0361, 0302, 0232, 0271, 0202, 0215, 0131, 0335, 0323, 0153, 0255, 0024, 0175, 
+  0065, 0113, 0307, 0275, 0314, 0102, 0173, 0311, 0275, 0143, 0351, 0074, 0224, 0027, 0151, 0214, 
+  0157, 0201, 0123, 0217, 0223, 0073, 0005, 0137, 0375, 0017, 0240, 0021, 0113, 0106, 0000, 0050, 
+  0165, 0165, 0141, 0171, 0051, 0145, 0157, 0155, 0056, 0141, 0142, 0157, 0165, 0164, 0000, 0000, 
+  0145, 0010, 0000, 0000, 0001, 0000, 0000, 0000, 0170, 0332, 0225, 0125, 0113, 0222, 0334, 0066, 
+  0014, 0335, 0373, 0024, 0334, 0160, 0225, 0152, 0371, 0273, 0210, 0063, 0262, 0253, 0172, 0074, 
+  0143, 0273, 0342, 0231, 0111, 0147, 0172, 0342, 0311, 0247, 0262, 0200, 0044, 0110, 0342, 0210, 
+  0044, 0024, 0176, 0372, 0267, 0317, 0101, 0122, 0225, 0063, 0344, 0002, 0316, 0301, 0002, 0112, 
+  0152, 0133, 0135, 0345, 0115, 0026, 0335, 0004, 0330, 0257, 0111, 0000, 0017, 0170, 0374, 0155, 
+  0131, 0120, 0014, 0277, 0077, 0132, 0306, 0320, 0222, 0363, 0257, 0226, 0025, 0030, 0161, 0351, 
+  0052, 0003, 0126, 0344, 0055, 0166, 0250, 0045, 0270, 0262, 0325, 0312, 0306, 0135, 0246, 0154, 
+  0115, 0257, 0317, 0226, 0235, 0157, 0141, 0057, 0336, 0305, 0076, 0200, 0310, 0073, 0025, 0100, 
+  0153, 0345, 0145, 0143, 0100, 0351, 0254, 0044, 0303, 0010, 0215, 0073, 0260, 0025, 0072, 0261, 
+  0332, 0267, 0240, 0151, 0043, 0162, 0350, 0107, 0353, 0053, 0060, 0207, 0342, 0226, 0174, 0240, 
+  0115, 0360, 0310, 0310, 0200, 0301, 0221, 0121, 0226, 0144, 0203, 0066, 0020, 0145, 0344, 0232, 
+  0021, 0213, 0112, 0254, 0311, 0121, 0247, 0070, 0064, 0117, 0056, 0203, 0141, 0117, 0032, 0244, 
+  0255, 0313, 0134, 0234, 0100, 0173, 0161, 0013, 0125, 0067, 0334, 0071, 0270, 0231, 0033, 0334, 
+  0223, 0213, 0235, 0352, 0304, 0005, 0156, 0320, 0172, 0106, 0261, 0043, 0033, 0113, 0006, 0307, 
+  0233, 0316, 0301, 0007, 0205, 0126, 0334, 0120, 0211, 0216, 0023, 0154, 0241, 0102, 0357, 0345, 
+  0270, 0144, 0026, 0003, 0103, 0036, 0076, 0375, 0343, 0254, 0270, 0307, 0202, 0123, 0314, 0213, 
+  0007, 0102, 0147, 0263, 0155, 0362, 0136, 0276, 0220, 0141, 0101, 0226, 0313, 0205, 0131, 0205, 
+  0214, 0044, 0247, 0274, 0270, 0154, 0070, 0154, 0016, 0010, 0207, 0125, 0216, 0305, 0034, 0042, 
+  0171, 0243, 0041, 0126, 0212, 0304, 0032, 0140, 0203, 0125, 0272, 0256, 0364, 0223, 0051, 0125, 
+  0003, 0132, 0301, 0210, 0273, 0300, 0002, 0234, 0157, 0025, 0347, 0266, 0027, 0171, 0065, 0171, 
+  0156, 0036, 0367, 0045, 0203, 0275, 0130, 0142, 0241, 0104, 0036, 0075, 0272, 0247, 0057, 0236, 
+  0311, 0226, 0302, 0227, 0254, 0057, 0015, 0223, 0032, 0121, 0213, 0025, 0224, 0174, 0053, 0207, 
+  0063, 0155, 0314, 0117, 0171, 0213, 0114, 0233, 0052, 0111, 0134, 0243, 0205, 0305, 0217, 0121, 
+  0331, 0200, 0216, 0104, 0136, 0117, 0373, 0214, 0215, 0107, 0244, 0126, 0073, 0161, 0253, 0220, 
+  0017, 0141, 0102, 0152, 0067, 0132, 0363, 0303, 0336, 0101, 0301, 0273, 0132, 0274, 0041, 0147, 
+  0024, 0272, 0305, 0262, 0256, 0065, 0226, 0035, 0227, 0114, 0077, 0051, 0073, 0254, 0122, 0230, 
+  0236, 0352, 0060, 0347, 0346, 0173, 0330, 0060, 0124, 0254, 0077, 0375, 0145, 0313, 0026, 0017, 
+  0042, 0177, 0360, 0060, 0130, 0222, 0353, 0337, 0025, 0072, 0342, 0204, 0113, 0344, 0275, 0125, 
+  0266, 0103, 0206, 0260, 0055, 0203, 0123, 0177, 0214, 0364, 0134, 0201, 0077, 0150, 0022, 0134, 
+  0173, 0142, 0176, 0025, 0030, 0317, 0231, 0306, 0371, 0045, 0127, 0020, 0035, 0067, 0227, 0270, 
+  0201, 0076, 0025, 0055, 0017, 0140, 0172, 0015, 0126, 0326, 0016, 0061, 0253, 0035, 0003, 0120, 
+  0065, 0255, 0130, 0227, 0024, 0202, 0310, 0165, 0162, 0236, 0076, 0173, 0076, 0360, 0046, 0033, 
+  0242, 0106, 0343, 0354, 0254, 0130, 0362, 0021, 0267, 0124, 0266, 0314, 0236, 0116, 0316, 0011, 
+  0055, 0127, 0061, 0034, 0304, 0365, 0256, 0174, 0276, 0053, 0112, 0255, 0123, 0277, 0104, 0127, 
+  0176, 0053, 0335, 0041, 0213, 0126, 0055, 0072, 0160, 0332, 0273, 0330, 0216, 0335, 0162, 0315, 
+  0243, 0306, 0345, 0272, 0120, 0017, 0235, 0017, 0251, 0031, 0314, 0260, 0221, 0125, 0373, 0301, 
+  0237, 0147, 0300, 0320, 0300, 0163, 0160, 0016, 0121, 0253, 0146, 0000, 0262, 0313, 0174, 0033, 
+  0134, 0120, 0275, 0030, 0073, 0154, 0270, 0177, 0002, 0336, 0053, 0323, 0073, 0156, 0340, 0317, 
+  0120, 0003, 0001, 0027, 0251, 0244, 0201, 0372, 0011, 0251, 0070, 0005, 0276, 0376, 0032, 0261, 
+  0113, 0070, 0223, 0326, 0057, 0174, 0137, 0053, 0056, 0365, 0221, 0321, 0334, 0260, 0227, 0065, 
+  0243, 0047, 0053, 0360, 0013, 0256, 0374, 0141, 0213, 0256, 0013, 0010, 0146, 0110, 0146, 0005, 
+  0105, 0042, 0201, 0063, 0140, 0010, 0347, 0342, 0113, 0332, 0112, 0236, 0006, 0214, 0375, 0110, 
+  0323, 0012, 0150, 0144, 0011, 0131, 0077, 0104, 0336, 0027, 0243, 0045, 0073, 0140, 0072, 0076, 
+  0047, 0272, 0102, 0307, 0163, 0225, 0210, 0354, 0047, 0153, 0136, 0206, 0125, 0253, 0264, 0352, 
+  0305, 0107, 0126, 0253, 0367, 0104, 0065, 0203, 0066, 0140, 0133, 0266, 0346, 0024, 0254, 0024, 
+  0005, 0047, 0056, 0334, 0277, 0177, 0162, 0245, 0372, 0344, 0360, 0170, 0065, 0363, 0143, 0156, 
+  0211, 0117, 0016, 0342, 0074, 0076, 0210, 0334, 0015, 0166, 0126, 0304, 0207, 0023, 0104, 0364, 
+  0236, 0243, 0023, 0357, 0131, 0124, 0170, 0002, 0367, 0321, 0364, 0321, 0203, 0041, 0333, 0304, 
+  0223, 0200, 0326, 0120, 0327, 0052, 0264, 0242, 0015, 0241, 0367, 0337, 0075, 0176, 0334, 0260, 
+  0023, 0213, 0364, 0333, 0343, 0351, 0047, 0206, 0014, 0322, 0270, 0336, 0042, 0167, 0077, 0367, 
+  0247, 0255, 0225, 0123, 0047, 0063, 0060, 0366, 0335, 0071, 0150, 0213, 0254, 0005, 0214, 0361, 
+  0305, 0150, 0177, 0205, 0265, 0243, 0042, 0116, 0002, 0371, 0165, 0141, 0134, 0007, 0144, 0151, 
+  0375, 0240, 0225, 0341, 0321, 0300, 0255, 0357, 0022, 0060, 0355, 0235, 0150, 0054, 0243, 0152, 
+  0260, 0044, 0076, 0200, 0203, 0036, 0203, 0117, 0223, 0341, 0307, 0075, 0046, 0345, 0270, 0067, 
+  0205, 0030, 0130, 0076, 0305, 0257, 0350, 0313, 0166, 0000, 0155, 0360, 0220, 0354, 0147, 0363, 
+  0064, 0356, 0224, 0021, 0357, 0320, 0045, 0362, 0203, 0062, 0337, 0244, 0330, 0213, 0330, 0160, 
+  0271, 0322, 0336, 0330, 0003, 0014, 0061, 0342, 0374, 0323, 0337, 0251, 0040, 0171, 0372, 0247, 
+  0054, 0040, 0051, 0115, 0030, 0043, 0272, 0163, 0312, 0266, 0142, 0311, 0237, 0233, 0206, 0112, 
+  0326, 0352, 0260, 0175, 0372, 0362, 0345, 0223, 0371, 0045, 0037, 0125, 0031, 0310, 0245, 0230, 
+  0221, 0043, 0331, 0164, 0151, 0225, 0016, 0253, 0026, 0302, 0004, 0320, 0120, 0211, 0037, 0334, 
+  0360, 0012, 0061, 0137, 0076, 0260, 0262, 0332, 0202, 0166, 0103, 0141, 0356, 0111, 0327, 0015, 
+  0330, 0106, 0374, 0244, 0271, 0225, 0123, 0056, 0051, 0112, 0351, 0270, 0354, 0052, 0014, 0155, 
+  0174, 0037, 0305, 0317, 0012, 0050, 0250, 0364, 0040, 0356, 0061, 0050, 0177, 0102, 0325, 0057, 
+  0000, 0351, 0255, 0131, 0243, 0356, 0150, 0253, 0170, 0324, 0363, 0275, 0077, 0332, 0162, 0320, 
+  0267, 0314, 0023, 0117, 0074, 0326, 0234, 0020, 0216, 0111, 0353, 0330, 0141, 0315, 0157, 0134, 
+  0125, 0046, 0301, 0070, 0332, 0262, 0215, 0276, 0375, 0162, 0260, 0303, 0203, 0147, 0335, 0035, 
+  0026, 0071, 0174, 0217, 0177, 0366, 0320, 0251, 0042, 0205, 0131, 0304, 0301, 0234, 0007, 0343, 
+  0043, 0163, 0222, 0157, 0260, 0221, 0176, 0323, 0200, 0101, 0237, 0365, 0372, 0365, 0331, 0243, 
+  0013, 0052, 0243, 0301, 0044, 0344, 0376, 0025, 0277, 0022, 0024, 0304, 0125, 0172, 0166, 0243, 
+  0341, 0047, 0040, 0271, 0122, 0217, 0156, 0126, 0356, 0376, 0317, 0003, 0260, 0216, 0126, 0260, 
+  0146, 0360, 0104, 0356, 0271, 0001, 0214, 0077, 0273, 0136, 0336, 0135, 0212, 0343, 0145, 0020, 
+  0024, 0131, 0161, 0307, 0152, 0160, 0366, 0350, 0077, 0366, 0141, 0020, 0236, 0000, 0050, 0165, 
+  0165, 0141, 0171, 0051, 0145, 0157, 0155, 0056, 0143, 0163, 0163, 0000, 0000, 0000, 0000, 0000, 
+  0250, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0056, 0145, 0157, 0155, 0055, 0167, 0151, 0156, 
+  0144, 0157, 0167, 0040, 0163, 0164, 0141, 0164, 0165, 0163, 0142, 0141, 0162, 0040, 0160, 0162, 
+  0157, 0147, 0162, 0145, 0163, 0163, 0142, 0141, 0162, 0056, 0150, 0157, 0162, 0151, 0172, 0157, 
+  0156, 0164, 0141, 0154, 0054, 0012, 0056, 0145, 0157, 0155, 0055, 0167, 0151, 0156, 0144, 0157, 
+  0167, 0040, 0163, 0164, 0141, 0164, 0165, 0163, 0142, 0141, 0162, 0040, 0160, 0162, 0157, 0147, 
+  0162, 0145, 0163, 0163, 0142, 0141, 0162, 0056, 0150, 0157, 0162, 0151, 0172, 0157, 0156, 0164, 
+  0141, 0154, 0040, 0164, 0162, 0157, 0165, 0147, 0150, 0040, 0173, 0012, 0040, 0040, 0040, 0040, 
+  0155, 0151, 0156, 0055, 0150, 0145, 0151, 0147, 0150, 0164, 0072, 0040, 0061, 0064, 0160, 0170, 
+  0073, 0012, 0175, 0012, 0012, 0043, 0145, 0157, 0155, 0055, 0163, 0151, 0144, 0145, 0142, 0141, 
+  0162, 0055, 0164, 0151, 0164, 0154, 0145, 0040, 0173, 0012, 0011, 0146, 0157, 0156, 0164, 0055, 
+  0167, 0145, 0151, 0147, 0150, 0164, 0072, 0040, 0142, 0157, 0154, 0144, 0073, 0012, 0175, 0012, 
+  0000, 0000, 0050, 0165, 0165, 0141, 0171, 0051, 0145, 0157, 0155, 0057, 0011, 0000, 0000, 0000, 
+  0160, 0151, 0170, 0155, 0141, 0160, 0163, 0057, 0002, 0000, 0000, 0000, 0165, 0151, 0057, 0000, 
+  0004, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0012, 0000, 0000, 0000, 0014, 0000, 0000, 0000, 
+  0005, 0000, 0000, 0000, 0006, 0000, 0000, 0000, 0015, 0000, 0000, 0000, 0010, 0000, 0000, 0000, 
+  0145, 0157, 0155, 0055, 0160, 0162, 0145, 0146, 0145, 0162, 0145, 0156, 0143, 0145, 0163, 0055, 
+  0144, 0151, 0141, 0154, 0157, 0147, 0056, 0165, 0151, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 
+  0166, 0132, 0000, 0000, 0001, 0000, 0000, 0000, 0170, 0332, 0355, 0134, 0131, 0163, 0333, 0066, 
+  0020, 0176, 0317, 0257, 0100, 0371, 0324, 0116, 0113, 0313, 0222, 0217, 0050, 0031, 0133, 0031, 
+  0047, 0165, 0222, 0316, 0044, 0255, 0047, 0166, 0373, 0320, 0027, 0016, 0110, 0256, 0104, 0304, 
+  0044, 0300, 0000, 0240, 0145, 0367, 0327, 0167, 0111, 0352, 0242, 0016, 0212, 0324, 0175, 0320, 
+  0036, 0173, 0104, 0152, 0001, 0356, 0002, 0213, 0017, 0337, 0142, 0101, 0134, 0275, 0173, 0016, 
+  0174, 0362, 0004, 0122, 0061, 0301, 0257, 0215, 0372, 0311, 0251, 0101, 0200, 0073, 0302, 0145, 
+  0274, 0163, 0155, 0374, 0375, 0360, 0321, 0154, 0032, 0357, 0132, 0257, 0256, 0176, 0062, 0115, 
+  0362, 0011, 0070, 0110, 0252, 0301, 0045, 0135, 0246, 0075, 0322, 0361, 0251, 0013, 0344, 0354, 
+  0344, 0254, 0171, 0322, 0040, 0246, 0211, 0102, 0214, 0153, 0220, 0155, 0352, 0100, 0353, 0112, 
+  0302, 0217, 0210, 0111, 0120, 0304, 0147, 0366, 0265, 0321, 0321, 0217, 0277, 0032, 0303, 0247, 
+  0234, 0235, 0064, 0032, 0106, 0155, 0134, 0010, 0377, 0205, 0100, 0225, 0211, 0302, 0106, 0126, 
+  0043, 0024, 0025, 0366, 0167, 0160, 0064, 0161, 0174, 0252, 0324, 0265, 0361, 0111, 0077, 0336, 
+  0270, 0337, 0043, 0245, 0003, 0340, 0332, 0040, 0314, 0275, 0066, 0350, 0340, 0272, 0156, 0264, 
+  0256, 0102, 0051, 0102, 0220, 0372, 0205, 0160, 0032, 0000, 0126, 0055, 0272, 0040, 0215, 0126, 
+  0375, 0252, 0326, 0377, 0142, 0102, 0044, 0012, 0303, 0104, 0344, 0364, 0064, 0107, 0350, 0211, 
+  0372, 0021, 0030, 0255, 0213, 0034, 0021, 0245, 0041, 0064, 0031, 0167, 0044, 0044, 0272, 0345, 
+  0076, 0063, 0244, 0035, 0310, 0310, 0146, 0236, 0135, 0113, 0155, 0236, 0142, 0373, 0037, 0001, 
+  0026, 0114, 0315, 0146, 0361, 0307, 0051, 0026, 0077, 0061, 0305, 0154, 0037, 0165, 0175, 0220, 
+  0021, 0344, 0250, 0340, 0120, 0156, 0266, 0205, 0023, 0051, 0243, 0365, 0221, 0372, 0052, 0117, 
+  0224, 0071, 0202, 0233, 0361, 0107, 0243, 0325, 0145, 0334, 0025, 0135, 0323, 0361, 0105, 0266, 
+  0104, 0161, 0225, 0033, 0233, 0126, 0331, 0003, 0077, 0064, 0155, 0051, 0272, 0012, 0344, 0124, 
+  0225, 0065, 0004, 0241, 0217, 0336, 0335, 0127, 0372, 0126, 0004, 0167, 0022, 0332, 0040, 0161, 
+  0070, 0200, 0372, 0235, 0121, 0137, 0164, 0014, 0022, 0122, 0274, 0326, 0211, 0111, 0275, 0133, 
+  0313, 0350, 0147, 0013, 0351, 0202, 0064, 0273, 0314, 0325, 0136, 0276, 0133, 0151, 0246, 0261, 
+  0151, 0210, 0226, 0224, 0053, 0324, 0222, 0142, 0103, 0135, 0033, 0057, 0200, 0317, 0270, 0175, 
+  0001, 0042, 0332, 0344, 0353, 0315, 0303, 0055, 0031, 0121, 0070, 0257, 0256, 0227, 0020, 0114, 
+  0217, 0305, 0036, 0347, 0046, 0066, 0214, 0312, 0072, 0036, 0363, 0135, 0222, 0214, 0144, 0116, 
+  0175, 0063, 0271, 0304, 0276, 0261, 0305, 0263, 0061, 0245, 0133, 0337, 0343, 0355, 0244, 0123, 
+  0323, 0212, 0314, 0130, 0256, 0276, 0124, 0223, 0010, 0311, 0260, 0201, 0251, 0306, 0301, 0157, 
+  0264, 0020, 0005, 0064, 0163, 0250, 0237, 0067, 0336, 0102, 0352, 0040, 0126, 0031, 0255, 0306, 
+  0174, 0053, 0250, 0023, 0127, 0153, 0141, 0027, 0322, 0251, 0306, 0104, 0132, 0013, 0076, 0156, 
+  0322, 0110, 0241, 0345, 0054, 0363, 0351, 0213, 0210, 0264, 0251, 0364, 0113, 0354, 0344, 0300, 
+  0335, 0011, 0205, 0147, 0352, 0224, 0052, 0024, 0273, 0260, 0145, 0247, 0067, 0246, 0324, 0156, 
+  0203, 0077, 0325, 0101, 0254, 0317, 0130, 0056, 0017, 0324, 0312, 0217, 0273, 0002, 0222, 0056, 
+  0264, 0151, 0344, 0353, 0271, 0262, 0022, 0034, 0140, 0117, 0240, 0206, 0005, 0346, 0016, 0352, 
+  0004, 0112, 0132, 0051, 0214, 0344, 0041, 0272, 0002, 0063, 0342, 0070, 0276, 0174, 0306, 0247, 
+  0130, 0067, 0030, 0370, 0350, 0100, 0217, 0350, 0101, 0023, 0345, 0341, 0071, 0244, 0334, 0235, 
+  0257, 0117, 0233, 0371, 0376, 0174, 0251, 0120, 0050, 0226, 0072, 0165, 0026, 0344, 0007, 0117, 
+  0257, 0365, 0134, 0240, 0210, 0047, 0044, 0300, 0273, 0210, 0053, 0174, 0030, 0107, 0354, 0003, 
+  0362, 0205, 0372, 0036, 0372, 0102, 0075, 0337, 0027, 0066, 0255, 0027, 0076, 0305, 0214, 0147, 
+  0207, 0011, 0170, 0132, 0265, 0063, 0377, 0051, 0064, 0330, 0102, 0074, 0246, 0356, 0314, 0373, 
+  0127, 0033, 0360, 0307, 0234, 0051, 0167, 0346, 0310, 0353, 0317, 0010, 0361, 0354, 0166, 0261, 
+  0021, 0342, 0222, 0325, 0262, 0336, 0130, 0307, 0204, 0131, 0157, 0226, 0066, 0376, 0162, 0043, 
+  0306, 0057, 0154, 0321, 0145, 0021, 0203, 0276, 0244, 0350, 0030, 0233, 0224, 0000, 0345, 0146, 
+  0154, 0362, 0250, 0317, 0072, 0150, 0216, 0322, 0124, 0352, 0134, 0222, 0060, 0013, 0273, 0023, 
+  0006, 0115, 0156, 0271, 0107, 0221, 0336, 0305, 0361, 0102, 0206, 0342, 0121, 0255, 0045, 0303, 
+  0011, 0001, 0324, 0310, 0347, 0136, 0235, 0135, 0140, 0035, 0017, 0303, 0244, 0044, 0172, 0211, 
+  0175, 0313, 0167, 0343, 0220, 0252, 0066, 0132, 0146, 0357, 0146, 0303, 0276, 0133, 0172, 0350, 
+  0226, 0126, 0102, 0364, 0102, 0021, 0323, 0367, 0365, 0364, 0146, 0121, 0147, 0132, 0277, 0046, 
+  0123, 0375, 0245, 0105, 0360, 0147, 0237, 0311, 0315, 0007, 0017, 0234, 0014, 0303, 0031, 0151, 
+  0107, 0313, 0211, 0277, 0054, 0103, 0163, 0356, 0003, 0041, 0264, 0107, 0022, 0126, 0240, 0110, 
+  0327, 0003, 0116, 0376, 0023, 0042, 0000, 0327, 0264, 0220, 0201, 0157, 0224, 0376, 0224, 0247, 
+  0064, 0163, 0250, 0312, 0230, 0264, 0053, 0151, 0327, 0304, 0150, 0034, 0041, 0122, 0013, 0171, 
+  0264, 0314, 0146, 0116, 0053, 0025, 0126, 0253, 0030, 0334, 0300, 0063, 0072, 0335, 0116, 0300, 
+  0315, 0332, 0065, 0071, 0022, 0270, 0031, 0151, 0307, 0225, 0302, 0015, 0343, 0025, 0332, 0034, 
+  0061, 0332, 0064, 0126, 0200, 0066, 0064, 0302, 0246, 0026, 0172, 0353, 0130, 0023, 0353, 0021, 
+  0122, 0267, 0202, 0231, 0045, 0140, 0146, 0330, 0227, 0345, 0121, 0306, 0272, 0301, 0302, 0001, 
+  0106, 0105, 0016, 0031, 0011, 0220, 0052, 0170, 0071, 0302, 0145, 0232, 0201, 0136, 0147, 0073, 
+  0252, 0327, 0262, 0101, 0335, 0214, 0064, 0302, 0336, 0257, 0065, 0324, 0367, 0144, 0255, 0341, 
+  0075, 0366, 0130, 0107, 0212, 0050, 0273, 0010, 0170, 0324, 0153, 0014, 0233, 0351, 0272, 0200, 
+  0312, 0016, 0343, 0146, 0322, 0163, 0010, 0073, 0227, 0205, 0326, 0361, 0032, 0105, 0134, 0161, 
+  0142, 0056, 0262, 0073, 0226, 0043, 0174, 0041, 0313, 0317, 0104, 0067, 0212, 0240, 0061, 0070, 
+  0031, 0221, 0244, 0202, 0267, 0073, 0076, 0007, 0355, 0354, 0254, 0262, 0050, 0253, 0210, 0033, 
+  0175, 0152, 0117, 0316, 0112, 0010, 0155, 0242, 0027, 0346, 0024, 0230, 0235, 0277, 0036, 0142, 
+  0015, 0111, 0054, 0053, 0222, 0306, 0165, 0100, 0365, 0054, 0032, 0153, 0236, 0033, 0375, 0370, 
+  0127, 0162, 0143, 0254, 0145, 0062, 0105, 0306, 0124, 0033, 0224, 0171, 0373, 0166, 0050, 0226, 
+  0356, 0032, 0050, 0253, 0357, 0300, 0225, 0166, 0174, 0231, 0343, 0070, 0324, 0132, 0031, 0277, 
+  0053, 0304, 0127, 0136, 0037, 0040, 0137, 0151, 0356, 0011, 0137, 0171, 0210, 0157, 0245, 0133, 
+  0163, 0310, 0035, 0126, 0122, 0245, 0106, 0372, 0264, 0345, 0174, 0273, 0213, 0006, 0157, 0252, 
+  0345, 0202, 0005, 0341, 0244, 0171, 0000, 0160, 0362, 0215, 0272, 0114, 0144, 0366, 0255, 0304, 
+  0124, 0063, 0304, 0301, 0205, 0363, 0271, 0045, 0343, 0157, 0313, 0362, 0316, 0270, 0002, 0142, 
+  0365, 0252, 0330, 0161, 0342, 0131, 0024, 0327, 0016, 0144, 0221, 0144, 0025, 0160, 0265, 0231, 
+  0335, 0025, 0313, 0172, 0161, 0102, 0051, 0027, 0162, 0337, 0136, 0330, 0144, 0355, 0103, 0334, 
+  0264, 0132, 0267, 0034, 0023, 0217, 0031, 0164, 0150, 0264, 0046, 0001, 0341, 0240, 0042, 0263, 
+  0304, 0013, 0302, 0035, 0210, 0316, 0312, 0255, 0073, 0134, 0316, 0361, 0012, 0352, 0207, 0036, 
+  0135, 0042, 0344, 0113, 0332, 0211, 0264, 0361, 0157, 0224, 0270, 0335, 0110, 0240, 0171, 0333, 
+  0226, 0145, 0307, 0306, 0207, 0342, 0377, 0237, 0117, 0177, 0303, 0337, 0137, 0126, 0031, 0050, 
+  0146, 0072, 0152, 0205, 0301, 0142, 0101, 0113, 0217, 0064, 0156, 0134, 0173, 0200, 0066, 0001, 
+  0335, 0366, 0040, 0170, 0137, 0010, 0277, 0055, 0173, 0352, 0302, 0150, 0305, 0075, 0366, 0021, 
+  0344, 0033, 0325, 0032, 0311, 0001, 0040, 0103, 0321, 0136, 0314, 0100, 0005, 0211, 0067, 0071, 
+  0043, 0352, 0123, 0333, 0050, 0020, 0304, 0236, 0157, 0060, 0210, 0235, 0275, 0363, 0363, 0037, 
+  0006, 0335, 0122, 0343, 0006, 0253, 0060, 0147, 0264, 0346, 0242, 0051, 0271, 0372, 0061, 0157, 
+  0176, 0256, 0067, 0016, 0061, 0043, 0171, 0266, 0127, 0333, 0237, 0377, 0025, 0042, 0250, 0326, 
+  0366, 0172, 0301, 0362, 0353, 0355, 0256, 0355, 0325, 0317, 0253, 0305, 0275, 0105, 0201, 0364, 
+  0354, 0000, 0240, 0144, 0042, 0243, 0034, 0205, 0012, 0353, 0137, 0140, 0153, 0323, 0255, 0225, 
+  0364, 0125, 0177, 0007, 0245, 0026, 0244, 0315, 0064, 0121, 0216, 0004, 0250, 0066, 0070, 0355, 
+  0202, 0123, 0127, 0134, 0170, 0057, 0270, 0360, 0112, 0240, 0351, 0374, 0020, 0131, 0316, 0305, 
+  0236, 0260, 0234, 0173, 0370, 0021, 0305, 0257, 0357, 0127, 0034, 0247, 0307, 0161, 0232, 0133, 
+  0346, 0070, 0227, 0025, 0307, 0131, 0024, 0110, 0056, 0016, 0000, 0110, 0006, 0026, 0051, 0160, 
+  0004, 0167, 0225, 0345, 0245, 0007, 0141, 0354, 0132, 0216, 0152, 0334, 0157, 0317, 0056, 0267, 
+  0274, 0146, 0141, 0335, 0167, 0231, 0166, 0172, 0057, 0305, 0020, 0332, 0326, 0220, 0233, 0357, 
+  0052, 0107, 0243, 0002, 0016, 0201, 0340, 0314, 0211, 0227, 0010, 0072, 0200, 0054, 0255, 0337, 
+  0073, 0052, 0314, 0276, 0160, 0263, 0157, 0003, 0350, 0036, 0365, 0037, 0145, 0324, 0243, 0166, 
+  0155, 0042, 0161, 0064, 0074, 0104, 0311, 0150, 0215, 0034, 0250, 0224, 0127, 0267, 0317, 0002, 
+  0333, 0224, 0311, 0333, 0051, 0171, 0162, 0074, 0012, 0100, 0062, 0147, 0122, 0203, 0045, 0062, 
+  0067, 0313, 0046, 0147, 0172, 0255, 0273, 0311, 0104, 0314, 0332, 0063, 0036, 0023, 0023, 0130, 
+  0163, 0313, 0100, 0220, 0327, 0310, 0207, 0275, 0342, 0277, 0371, 0327, 0213, 0260, 0365, 0135, 
+  0021, 0054, 0360, 0152, 0321, 0267, 0244, 0040, 0121, 0123, 0330, 0147, 0225, 0333, 0332, 0361, 
+  0227, 0217, 0012, 0173, 0207, 0057, 0104, 0270, 0200, 0157, 0174, 0301, 0142, 0225, 0147, 0354, 
+  0244, 0147, 0124, 0031, 0314, 0112, 0255, 0222, 0100, 0121, 0056, 0363, 0171, 0261, 0145, 0362, 
+  0160, 0357, 0063, 0027, 0224, 0047, 0312, 0045, 0076, 0147, 0264, 0310, 0132, 0323, 0243, 0241, 
+  0037, 0165, 0030, 0267, 0002, 0312, 0061, 0336, 0221, 0026, 0162, 0036, 0115, 0021, 0133, 0344, 
+  0336, 0045, 0114, 0247, 0132, 0172, 0007, 0124, 0241, 0265, 0167, 0211, 0221, 0137, 0123, 0033, 
+  0247, 0331, 0275, 0033, 0021, 0177, 0341, 0221, 0074, 0107, 0247, 0222, 0003, 0371, 0164, 0145, 
+  0003, 0271, 0261, 0362, 0201, 0374, 0346, 0365, 0226, 0107, 0162, 0352, 0072, 0152, 0301, 0161, 
+  0334, 0130, 0325, 0070, 0336, 0165, 0220, 0357, 0337, 0110, 0017, 0035, 0355, 0255, 0157, 0250, 
+  0261, 0153, 0042, 0101, 0205, 0202, 0053, 0174, 0202, 0031, 0157, 0311, 0030, 0071, 0027, 0364, 
+  0252, 0226, 0221, 0314, 0051, 0210, 0016, 0061, 0172, 0212, 0344, 0104, 0301, 0332, 0270, 0012, 
+  0311, 0271, 0245, 0350, 0174, 0261, 0217, 0365, 0033, 0113, 0004, 0146, 0070, 0074, 0162, 0326, 
+  0114, 0117, 0114, 0115, 0026, 0240, 0173, 0322, 0265, 0376, 0251, 0272, 0370, 0161, 0170, 0072, 
+  0364, 0253, 0377, 0001, 0016, 0120, 0031, 0340, 0000, 0050, 0165, 0165, 0141, 0171, 0051, 0155, 
+  0141, 0164, 0145, 0057, 0007, 0000, 0000, 0000, 0145, 0157, 0155, 0055, 0165, 0151, 0056, 0170, 
+  0155, 0154, 0000, 0000, 0000, 0000, 0000, 0000, 0254, 0020, 0000, 0000, 0001, 0000, 0000, 0000, 
+  0170, 0332, 0355, 0126, 0121, 0117, 0333, 0060, 0020, 0176, 0347, 0127, 0124, 0371, 0001, 0013, 
+  0260, 0115, 0323, 0244, 0122, 0224, 0001, 0005, 0304, 0012, 0025, 0355, 0100, 0332, 0313, 0344, 
+  0246, 0267, 0326, 0232, 0343, 0363, 0142, 0247, 0300, 0176, 0375, 0354, 0070, 0115, 0223, 0324, 
+  0116, 0332, 0111, 0173, 0141, 0173, 0364, 0175, 0337, 0167, 0147, 0337, 0235, 0317, 0356, 0237, 
+  0076, 0047, 0254, 0267, 0202, 0124, 0122, 0344, 0047, 0301, 0321, 0233, 0303, 0340, 0164, 0160, 
+  0320, 0317, 0350, 0240, 0237, 0000, 0317, 0146, 0044, 0355, 0161, 0222, 0300, 0111, 0060, 0042, 
+  0224, 0217, 0264, 0045, 0260, 0100, 0217, 0304, 0052, 0127, 0134, 0047, 0144, 0001, 0205, 0221, 
+  0052, 0110, 0352, 0300, 0235, 0000, 0036, 0204, 0056, 0211, 0101, 0036, 0251, 0132, 0152, 0251, 
+  0140, 0044, 0206, 0045, 0262, 0071, 0254, 0203, 0105, 0102, 0060, 0032, 0023, 0103, 0227, 0275, 
+  0361, 0006, 0066, 0256, 0102, 0343, 0153, 0320, 0227, 0040, 0110, 0112, 0024, 0246, 0241, 0057, 
+  0366, 0204, 0254, 0040, 0150, 0105, 0043, 0151, 0360, 0156, 0117, 0343, 0224, 0162, 0265, 0033, 
+  0165, 0002, 0052, 0222, 0217, 0204, 0061, 0101, 0204, 0335, 0257, 0077, 0061, 0147, 0310, 0225, 
+  0316, 0052, 0345, 0213, 0141, 0171, 0272, 0135, 0066, 0203, 0332, 0263, 0242, 0260, 0265, 0371, 
+  0355, 0074, 0336, 0103, 0014, 0134, 0235, 0143, 0234, 0151, 0137, 0152, 0307, 0323, 0236, 0061, 
+  0224, 0120, 0311, 0164, 0255, 0166, 0027, 0163, 0252, 0134, 0325, 0066, 0366, 0057, 0174, 0216, 
+  0235, 0041, 0014, 0361, 0014, 0305, 0213, 0355, 0233, 0135, 0330, 0103, 0106, 0305, 0025, 0246, 
+  0364, 0227, 0111, 0027, 0013, 0332, 0150, 0017, 0046, 0061, 0261, 0045, 0165, 0372, 0275, 0107, 
+  0105, 0024, 0174, 0074, 0014, 0332, 0011, 0307, 0037, 0016, 0167, 0162, 0067, 0302, 0025, 0114, 
+  0161, 0232, 0022, 0271, 0334, 0211, 0077, 0105, 0144, 0372, 0172, 0171, 0243, 0217, 0123, 0370, 
+  0016, 0051, 0360, 0330, 0026, 0332, 0125, 0214, 0007, 0012, 0117, 0325, 0142, 0330, 0242, 0027, 
+  0216, 0247, 0270, 0130, 0060, 0010, 0152, 0144, 0127, 0114, 0053, 0232, 0350, 0243, 0146, 0322, 
+  0043, 0053, 0101, 0207, 0320, 0266, 0014, 0062, 0006, 0271, 0300, 0045, 0157, 0120, 0134, 0321, 
+  0351, 0034, 0174, 0261, 0055, 0344, 0115, 0251, 0165, 0060, 0314, 0030, 0223, 0161, 0012, 0172, 
+  0332, 0324, 0324, 0025, 0273, 0043, 0052, 0323, 0276, 0345, 0022, 0237, 0032, 0021, 0113, 0163, 
+  0127, 0031, 0015, 0373, 0053, 0142, 0162, 0315, 0203, 0066, 0370, 0056, 0123, 0255, 0370, 0055, 
+  0246, 0211, 0247, 0261, 0327, 0224, 0041, 0125, 0276, 0046, 0270, 0304, 0355, 0026, 0270, 0104, 
+  0335, 0075, 0053, 0212, 0231, 0014, 0052, 0274, 0322, 0026, 0072, 0004, 0267, 0360, 0254, 0252, 
+  0344, 0174, 0335, 0236, 0364, 0113, 0034, 0322, 0124, 0326, 0124, 0326, 0340, 0242, 0176, 0046, 
+  0165, 0146, 0276, 0356, 0362, 0177, 0117, 0364, 0110, 0111, 0252, 0262, 0302, 0322, 0310, 0305, 
+  0246, 0361, 0145, 0376, 0106, 0225, 0202, 0334, 0344, 0174, 0142, 0162, 0344, 0116, 0310, 0157, 
+  0107, 0335, 0143, 0264, 0344, 0036, 0357, 0301, 0175, 0273, 0007, 0367, 0335, 0036, 0334, 0367, 
+  0276, 0106, 0270, 0002, 0046, 0134, 0243, 0331, 0330, 0107, 0204, 0147, 0236, 0026, 0063, 0160, 
+  0064, 0303, 0254, 0332, 0140, 0141, 0361, 0366, 0017, 0372, 0312, 0116, 0214, 0372, 0150, 0011, 
+  0254, 0275, 0346, 0246, 0336, 0136, 0016, 0330, 0325, 0120, 0133, 0264, 0372, 0215, 0362, 0302, 
+  0305, 0215, 0362, 0342, 0233, 0033, 0345, 0245, 0024, 0067, 0252, 0165, 0067, 0133, 0217, 0100, 
+  0013, 0303, 0276, 0043, 0141, 0221, 0257, 0146, 0342, 0066, 0163, 0250, 0065, 0205, 0345, 0365, 
+  0371, 0363, 0364, 0072, 0040, 0327, 0125, 0173, 0165, 0231, 0357, 0074, 0234, 0343, 0025, 0152, 
+  0325, 0214, 0111, 0046, 0241, 0366, 0026, 0154, 0212, 0053, 0120, 0144, 0142, 0175, 0047, 0226, 
+  0131, 0062, 0343, 0204, 0262, 0261, 0061, 0006, 0377, 0306, 0137, 0167, 0377, 0137, 0334, 0076, 
+  0337, 0043, 0307, 0077, 0367, 0357, 0374, 0266, 0303, 0274, 0220, 0365, 0172, 0232, 0136, 0371, 
+  0137, 0312, 0127, 0121, 0312, 0142, 0326, 0332, 0152, 0326, 0376, 0004, 0153, 0153, 0144, 0147, 
+  0101, 0367, 0027, 0175, 0355, 0236, 0304, 0061, 0060, 0310, 0217, 0133, 0004, 0061, 0233, 0111, 
+  0221, 0135, 0374, 0324, 0017, 0154, 0144, 0320, 0115, 0244, 0052, 0144, 0234, 0170, 0305, 0067, 
+  0343, 0150, 0076, 0167, 0213, 0157, 0204, 0206, 0072, 0304, 0223, 0154, 0346, 0023, 0153, 0310, 
+  0055, 0376, 0104, 0342, 0037, 0023, 0241, 0133, 0264, 0241, 0054, 0355, 0156, 0331, 0271, 0136, 
+  0253, 0246, 0306, 0032, 0335, 0202, 0013, 0336, 0074, 0230, 0266, 0270, 0251, 0127, 0230, 0064, 
+  0075, 0033, 0123, 0236, 0376, 0214, 0016, 0016, 0176, 0003, 0340, 0040, 0374, 0065, 0000, 0050, 
+  0165, 0165, 0141, 0171, 0051, 0155, 0145, 0164, 0141, 0144, 0141, 0164, 0141, 0055, 0163, 0151, 
+  0144, 0145, 0142, 0141, 0162, 0056, 0165, 0151, 0304, 0057, 0000, 0000, 0001, 0000, 0000, 0000, 
+  0170, 0332, 0355, 0232, 0337, 0163, 0332, 0070, 0020, 0307, 0337, 0373, 0127, 0370, 0364, 0172, 
+  0103, 0300, 0244, 0115, 0323, 0031, 0160, 0347, 0176, 0064, 0231, 0233, 0151, 0347, 0036, 0222, 
+  0273, 0076, 0172, 0026, 0151, 0001, 0025, 0131, 0362, 0111, 0353, 0020, 0372, 0327, 0237, 0034, 
+  0073, 0115, 0177, 0305, 0220, 0240, 0032, 0122, 0363, 0004, 0230, 0257, 0245, 0365, 0176, 0264, 
+  0153, 0151, 0245, 0321, 0353, 0353, 0114, 0105, 0127, 0150, 0235, 0064, 0172, 0314, 0342, 0243, 
+  0001, 0213, 0120, 0163, 0043, 0244, 0236, 0215, 0331, 0077, 0227, 0147, 0275, 0123, 0366, 0072, 
+  0171, 0066, 0372, 0245, 0327, 0213, 0316, 0121, 0243, 0005, 0102, 0021, 0055, 0045, 0315, 0243, 
+  0231, 0002, 0201, 0321, 0361, 0321, 0160, 0170, 0024, 0107, 0275, 0236, 0027, 0111, 0115, 0150, 
+  0247, 0300, 0061, 0031, 0131, 0374, 0257, 0220, 0026, 0135, 0244, 0344, 0144, 0314, 0146, 0264, 
+  0370, 0225, 0335, 0365, 0342, 0357, 0031, 0260, 0176, 0062, 0042, 0314, 0162, 0345, 0033, 0214, 
+  0270, 0002, 0347, 0306, 0354, 0215, 0311, 0336, 0041, 0201, 0000, 0202, 0013, 0051, 0160, 0002, 
+  0226, 0105, 0071, 0130, 0324, 0064, 0146, 0347, 0264, 0270, 0340, 0326, 0050, 0205, 0342, 0275, 
+  0324, 0302, 0054, 0131, 0062, 0312, 0255, 0311, 0321, 0322, 0052, 0322, 0220, 0341, 0230, 0135, 
+  0111, 0047, 0047, 0012, 0131, 0162, 0151, 0013, 0034, 0365, 0157, 0377, 0375, 0106, 0307, 0101, 
+  0247, 0123, 0303, 0013, 0267, 0126, 0071, 0167, 0067, 0135, 0172, 0103, 0322, 0334, 0050, 0311, 
+  0127, 0054, 0321, 0350, 0037, 0343, 0363, 0133, 0370, 0134, 0052, 0221, 0214, 0314, 0344, 0003, 
+  0162, 0272, 0175, 0022, 0157, 0355, 0277, 0022, 0227, 0271, 0261, 0304, 0042, 0051, 0112, 0333, 
+  0252, 0137, 0161, 0020, 0263, 0317, 0100, 0271, 0046, 0251, 0233, 0203, 0367, 0120, 0112, 0253, 
+  0334, 0067, 0253, 0215, 0306, 0115, 0014, 0076, 0267, 0122, 0124, 0306, 0146, 0065, 0204, 0164, 
+  0126, 0136, 0152, 0303, 0140, 0143, 0245, 0247, 0014, 0344, 0207, 0007, 0113, 0274, 0203, 0111, 
+  0162, 0120, 0015, 0172, 0353, 0237, 0316, 0345, 0300, 0375, 0050, 0145, 0311, 0161, 0223, 0015, 
+  0106, 0025, 0231, 0276, 0323, 0236, 0064, 0150, 0063, 0260, 0063, 0251, 0173, 0216, 0300, 0123, 
+  0333, 0104, 0211, 0132, 0154, 0244, 0233, 0030, 0042, 0223, 0175, 0045, 0275, 0017, 0303, 0133, 
+  0230, 0240, 0252, 0070, 0250, 0362, 0153, 0073, 0043, 0346, 0012, 0224, 0234, 0171, 0337, 0117, 
+  0300, 0241, 0222, 0272, 0111, 0252, 0052, 0003, 0311, 0202, 0166, 0076, 0172, 0301, 0133, 0062, 
+  0146, 0053, 0364, 0235, 0134, 0310, 0217, 0115, 0067, 0176, 0050, 0034, 0311, 0251, 0217, 0041, 
+  0053, 0147, 0163, 0152, 0020, 0136, 0327, 0306, 0304, 0237, 0153, 0034, 0255, 0224, 0117, 0054, 
+  0067, 0216, 0252, 0165, 0102, 0146, 0275, 0312, 0032, 0237, 0114, 0372, 0265, 0240, 0137, 0171, 
+  0324, 0067, 0012, 0174, 0341, 0231, 0177, 0153, 0077, 0116, 0051, 0005, 0042, 0340, 0163, 0226, 
+  0014, 0032, 0314, 0040, 0223, 0177, 0137, 0327, 0377, 0324, 0164, 0277, 0246, 0270, 0051, 0314, 
+  0341, 0323, 0201, 0171, 0351, 0223, 0307, 0017, 0203, 0371, 0225, 0146, 0125, 0153, 0006, 0373, 
+  0003, 0074, 0016, 0003, 0374, 0270, 0025, 0340, 0367, 0123, 0074, 0223, 0012, 0243, 0037, 0032, 
+  0227, 0373, 0217, 0162, 0030, 0006, 0345, 0363, 0175, 0213, 0335, 0352, 0355, 0222, 0336, 0276, 
+  0135, 0342, 0341, 0343, 0106, 0210, 0121, 0342, 0313, 0031, 0115, 0307, 0206, 0307, 0161, 0230, 
+  0341, 0361, 0142, 0307, 0221, 0376, 0133, 0051, 0053, 0154, 0227, 0003, 0375, 0171, 0030, 0222, 
+  0047, 0073, 0046, 0371, 0346, 0072, 0067, 0256, 0333, 0044, 0137, 0204, 0041, 0371, 0162, 0307, 
+  0044, 0377, 0272, 0370, 0073, 0004, 0304, 0362, 0075, 0340, 0232, 0235, 0367, 0104, 0071, 0277, 
+  0014, 0303, 0371, 0164, 0307, 0234, 0337, 0041, 0241, 0365, 0226, 0167, 0070, 0142, 0117, 0303, 
+  0220, 0174, 0325, 0012, 0311, 0060, 0063, 0247, 0077, 0374, 0377, 0026, 0072, 0314, 0374, 0125, 
+  0030, 0346, 0361, 0340, 0351, 0254, 0212, 0377, 0004, 0352, 0364, 0252, 0070, 0120, 0035, 0044, 
+  0216, 0167, 0234, 0261, 0057, 0145, 0326, 0151, 0216, 0333, 0227, 0067, 0244, 0063, 0151, 0145, 
+  0155, 0173, 0044, 0223, 0233, 0217, 0246, 0302, 0067, 0052, 0157, 0060, 0154, 0322, 0371, 0365, 
+  0367, 0250, 0074, 0314, 0333, 0161, 0153, 0263, 0034, 0047, 0077, 0342, 0301, 0333, 0155, 0225, 
+  0152, 0313, 0175, 0223, 0375, 0363, 0366, 0322, 0102, 0276, 0266, 0333, 0375, 0104, 0262, 0175, 
+  0266, 0231, 0112, 0205, 0373, 0031, 0004, 0117, 0030, 0313, 0366, 0205, 0121, 0250, 0213, 0116, 
+  0007, 0054, 0001, 0261, 0154, 0137, 0306, 0302, 0272, 0202, 0164, 0300, 0022, 0020, 0313, 0366, 
+  0065, 0251, 0254, 0056, 0023, 0034, 0260, 0004, 0304, 0262, 0175, 0341, 0101, 0370, 0065, 0135, 
+  0213, 0110, 0036, 0274, 0016, 0375, 0251, 0147, 0006, 0333, 0317, 0326, 0062, 0043, 0120, 0355, 
+  0047, 0277, 0207, 0327, 0231, 0176, 0146, 0326, 0333, 0227, 0213, 0310, 0257, 0332, 0017, 0311, 
+  0063, 0144, 0370, 0005, 0230, 0231, 0337, 0354, 0037, 0167, 0046, 0376, 0012, 0207, 0251, 0157, 
+  0166, 0121, 0254, 0107, 0276, 0321, 0270, 0050, 0105, 0151, 0231, 0302, 0130, 0262, 0064, 0126, 
+  0364, 0370, 0034, 0232, 0066, 0343, 0311, 0172, 0104, 0151, 0351, 0125, 0102, 0221, 0372, 0307, 
+  0137, 0154, 0340, 0261, 0026, 0007, 0124, 0240, 0315, 0364, 0170, 0270, 0353, 0163, 0063, 0206, 
+  0203, 0212, 0336, 0242, 0236, 0321, 0274, 0303, 0165, 0302, 0223, 0000, 0351, 0301, 0073, 0122, 
+  0241, 0076, 0244, 0355, 0200, 0121, 0366, 0110, 0054, 0277, 0027, 0076, 0017, 0352, 0172, 0322, 
+  0213, 0004, 0122, 0271, 0164, 0122, 0135, 0173, 0310, 0026, 0110, 0165, 0147, 0123, 0206, 0016, 
+  0176, 0020, 0333, 0042, 0107, 0171, 0205, 0056, 0025, 0070, 0205, 0102, 0321, 0372, 0223, 0333, 
+  0065, 0014, 0216, 0345, 0231, 0364, 0307, 0023, 0331, 0270, 0240, 0336, 0364, 0152, 0131, 0112, 
+  0101, 0353, 0313, 0055, 0237, 0014, 0273, 0377, 0302, 0355, 0201, 0171, 0377, 0365, 0356, 0254, 
+  0375, 0263, 0377, 0001, 0256, 0332, 0165, 0132, 0000, 0050, 0165, 0165, 0141, 0171, 0051
+} };
+
+static GStaticResource static_resource = { _eom_resource_data.data, sizeof (_eom_resource_data.data) - 1 /* nul terminator */, NULL, NULL, NULL };
+
+G_MODULE_EXPORT
+GResource *_eom_get_resource (void);
+GResource *_eom_get_resource (void)
+{
+  return g_static_resource_get_resource (&static_resource);
+}
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ *
+ * This library 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.1 of the License, or (at your option) any later version.
+ *
+ * This library 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 library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
+ * file for a list of people on the GLib Team.  See the ChangeLog
+ * files for a list of changes.  These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_CONSTRUCTOR_H__
+#define __G_CONSTRUCTOR_H__
+
+/*
+  If G_HAS_CONSTRUCTORS is true then the compiler support *both* constructors and
+  destructors, in a usable way, including e.g. on library unload. If not you're on
+  your own.
+
+  Some compilers need #pragma to handle this, which does not work with macros,
+  so the way you need to use this is (for constructors):
+
+  #ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
+  #pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(my_constructor)
+  #endif
+  G_DEFINE_CONSTRUCTOR(my_constructor)
+  static void my_constructor(void) {
+   ...
+  }
+
+*/
+
+#ifndef __GTK_DOC_IGNORE__
+
+#if  __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+
+#define G_HAS_CONSTRUCTORS 1
+
+#define G_DEFINE_CONSTRUCTOR(_func) static void __attribute__((constructor)) _func (void);
+#define G_DEFINE_DESTRUCTOR(_func) static void __attribute__((destructor)) _func (void);
+
+#elif defined (_MSC_VER) && (_MSC_VER >= 1500)
+/* Visual studio 2008 and later has _Pragma */
+
+/*
+ * Only try to include gslist.h if not already included via glib.h,
+ * so that items using gconstructor.h outside of GLib (such as
+ * GResources) continue to build properly.
+ */
+#ifndef __G_LIB_H__
+#include "gslist.h"
+#endif
+
+#include <stdlib.h>
+
+#define G_HAS_CONSTRUCTORS 1
+
+/* We do some weird things to avoid the constructors being optimized
+ * away on VS2015 if WholeProgramOptimization is enabled. First we
+ * make a reference to the array from the wrapper to make sure its
+ * references. Then we use a pragma to make sure the wrapper function
+ * symbol is always included at the link stage. Also, the symbols
+ * need to be extern (but not dllexport), even though they are not
+ * really used from another object file.
+ */
+
+/* We need to account for differences between the mangling of symbols
+ * for x86 and x64/ARM/ARM64 programs, as symbols on x86 are prefixed
+ * with an underscore but symbols on x64/ARM/ARM64 are not.
+ */
+#ifdef _M_IX86
+#define G_MSVC_SYMBOL_PREFIX "_"
+#else
+#define G_MSVC_SYMBOL_PREFIX ""
+#endif
+
+#define G_DEFINE_CONSTRUCTOR(_func) G_MSVC_CTOR (_func, G_MSVC_SYMBOL_PREFIX)
+#define G_DEFINE_DESTRUCTOR(_func) G_MSVC_DTOR (_func, G_MSVC_SYMBOL_PREFIX)
+
+#define G_MSVC_CTOR(_func,_sym_prefix) \
+  static void _func(void); \
+  extern int (* _array ## _func)(void);              \
+  int _func ## _wrapper(void);              \
+  int _func ## _wrapper(void) { _func(); g_slist_find (NULL,  _array ## _func); return 0; } \
+  __pragma(comment(linker,"/include:" _sym_prefix # _func "_wrapper")) \
+  __pragma(section(".CRT$XCU",read)) \
+  __declspec(allocate(".CRT$XCU")) int (* _array ## _func)(void) = _func ## _wrapper;
+
+#define G_MSVC_DTOR(_func,_sym_prefix) \
+  static void _func(void); \
+  extern int (* _array ## _func)(void);              \
+  int _func ## _constructor(void);              \
+  int _func ## _constructor(void) { atexit (_func); g_slist_find (NULL,  _array ## _func); return 0; } \
+   __pragma(comment(linker,"/include:" _sym_prefix # _func "_constructor")) \
+  __pragma(section(".CRT$XCU",read)) \
+  __declspec(allocate(".CRT$XCU")) int (* _array ## _func)(void) = _func ## _constructor;
+
+#elif defined (_MSC_VER)
+
+#define G_HAS_CONSTRUCTORS 1
+
+/* Pre Visual studio 2008 must use #pragma section */
+#define G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA 1
+#define G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA 1
+
+#define G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(_func) \
+  section(".CRT$XCU",read)
+#define G_DEFINE_CONSTRUCTOR(_func) \
+  static void _func(void); \
+  static int _func ## _wrapper(void) { _func(); return 0; } \
+  __declspec(allocate(".CRT$XCU")) static int (*p)(void) = _func ## _wrapper;
+
+#define G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(_func) \
+  section(".CRT$XCU",read)
+#define G_DEFINE_DESTRUCTOR(_func) \
+  static void _func(void); \
+  static int _func ## _constructor(void) { atexit (_func); return 0; } \
+  __declspec(allocate(".CRT$XCU")) static int (* _array ## _func)(void) = _func ## _constructor;
+
+#elif defined(__SUNPRO_C)
+
+/* This is not tested, but i believe it should work, based on:
+ * http://opensource.apple.com/source/OpenSSL098/OpenSSL098-35/src/fips/fips_premain.c
+ */
+
+#define G_HAS_CONSTRUCTORS 1
+
+#define G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA 1
+#define G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA 1
+
+#define G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(_func) \
+  init(_func)
+#define G_DEFINE_CONSTRUCTOR(_func) \
+  static void _func(void);
+
+#define G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(_func) \
+  fini(_func)
+#define G_DEFINE_DESTRUCTOR(_func) \
+  static void _func(void);
+
+#else
+
+/* constructors not supported for this compiler */
+
+#endif
+
+#endif /* __GTK_DOC_IGNORE__ */
+#endif /* __G_CONSTRUCTOR_H__ */
+
+#ifdef G_HAS_CONSTRUCTORS
+
+#ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
+#pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(_eomresource_constructor)
+#endif
+G_DEFINE_CONSTRUCTOR(_eomresource_constructor)
+#ifdef G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA
+#pragma G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(_eomresource_destructor)
+#endif
+G_DEFINE_DESTRUCTOR(_eomresource_destructor)
+
+#else
+#warning "Constructor not supported on this compiler, linking in resources will not work"
+#endif
+
+static void _eomresource_constructor (void)
+{
+  g_static_resource_init (&static_resource);
+}
+
+static void _eomresource_destructor (void)
+{
+  g_static_resource_fini (&static_resource);
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/8.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/8.html new file mode 100644 index 0000000..1e9497a --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/8.html @@ -0,0 +1,429 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/* This file is generated by glib-genmarshal, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#ifdef G_ENABLE_DEBUG
+#define g_marshal_value_peek_boolean(v)  g_value_get_boolean (v)
+#define g_marshal_value_peek_char(v)     g_value_get_schar (v)
+#define g_marshal_value_peek_uchar(v)    g_value_get_uchar (v)
+#define g_marshal_value_peek_int(v)      g_value_get_int (v)
+#define g_marshal_value_peek_uint(v)     g_value_get_uint (v)
+#define g_marshal_value_peek_long(v)     g_value_get_long (v)
+#define g_marshal_value_peek_ulong(v)    g_value_get_ulong (v)
+#define g_marshal_value_peek_int64(v)    g_value_get_int64 (v)
+#define g_marshal_value_peek_uint64(v)   g_value_get_uint64 (v)
+#define g_marshal_value_peek_enum(v)     g_value_get_enum (v)
+#define g_marshal_value_peek_flags(v)    g_value_get_flags (v)
+#define g_marshal_value_peek_float(v)    g_value_get_float (v)
+#define g_marshal_value_peek_double(v)   g_value_get_double (v)
+#define g_marshal_value_peek_string(v)   (char*) g_value_get_string (v)
+#define g_marshal_value_peek_param(v)    g_value_get_param (v)
+#define g_marshal_value_peek_boxed(v)    g_value_get_boxed (v)
+#define g_marshal_value_peek_pointer(v)  g_value_get_pointer (v)
+#define g_marshal_value_peek_object(v)   g_value_get_object (v)
+#define g_marshal_value_peek_variant(v)  g_value_get_variant (v)
+#else /* !G_ENABLE_DEBUG */
+/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
+ *          Do not access GValues directly in your code. Instead, use the
+ *          g_value_get_*() functions
+ */
+#define g_marshal_value_peek_boolean(v)  (v)->data[0].v_int
+#define g_marshal_value_peek_char(v)     (v)->data[0].v_int
+#define g_marshal_value_peek_uchar(v)    (v)->data[0].v_uint
+#define g_marshal_value_peek_int(v)      (v)->data[0].v_int
+#define g_marshal_value_peek_uint(v)     (v)->data[0].v_uint
+#define g_marshal_value_peek_long(v)     (v)->data[0].v_long
+#define g_marshal_value_peek_ulong(v)    (v)->data[0].v_ulong
+#define g_marshal_value_peek_int64(v)    (v)->data[0].v_int64
+#define g_marshal_value_peek_uint64(v)   (v)->data[0].v_uint64
+#define g_marshal_value_peek_enum(v)     (v)->data[0].v_long
+#define g_marshal_value_peek_flags(v)    (v)->data[0].v_ulong
+#define g_marshal_value_peek_float(v)    (v)->data[0].v_float
+#define g_marshal_value_peek_double(v)   (v)->data[0].v_double
+#define g_marshal_value_peek_string(v)   (v)->data[0].v_pointer
+#define g_marshal_value_peek_param(v)    (v)->data[0].v_pointer
+#define g_marshal_value_peek_boxed(v)    (v)->data[0].v_pointer
+#define g_marshal_value_peek_pointer(v)  (v)->data[0].v_pointer
+#define g_marshal_value_peek_object(v)   (v)->data[0].v_pointer
+#define g_marshal_value_peek_variant(v)  (v)->data[0].v_pointer
+#endif /* !G_ENABLE_DEBUG */
+
+/* VOID:INT,INT (./eggmarshalers.list:1) */
+/* Prototype for -Wmissing-prototypes */
+G_BEGIN_DECLS
+extern
+void _egg_marshal_VOID__INT_INT (GClosure     *closure,
+                                 GValue       *return_value,
+                                 guint         n_param_values,
+                                 const GValue *param_values,
+                                 gpointer      invocation_hint,
+                                 gpointer      marshal_data);
+G_END_DECLS
+void
+_egg_marshal_VOID__INT_INT (GClosure     *closure,
+                            GValue       *return_value G_GNUC_UNUSED,
+                            guint         n_param_values,
+                            const GValue *param_values,
+                            gpointer      invocation_hint G_GNUC_UNUSED,
+                            gpointer      marshal_data)
+{
+  typedef void (*GMarshalFunc_VOID__INT_INT) (gpointer data1,
+                                              gint arg1,
+                                              gint arg2,
+                                              gpointer data2);
+  GCClosure *cc = (GCClosure *) closure;
+  gpointer data1, data2;
+  GMarshalFunc_VOID__INT_INT callback;
+
+  g_return_if_fail (n_param_values == 3);
+
+  if (G_CCLOSURE_SWAP_DATA (closure))
+    {
+      data1 = closure->data;
+      data2 = g_value_peek_pointer (param_values + 0);
+    }
+  else
+    {
+      data1 = g_value_peek_pointer (param_values + 0);
+      data2 = closure->data;
+    }
+  callback = (GMarshalFunc_VOID__INT_INT) (marshal_data ? marshal_data : cc->callback);
+
+  callback (data1,
+            g_marshal_value_peek_int (param_values + 1),
+            g_marshal_value_peek_int (param_values + 2),
+            data2);
+}
+
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/80.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/80.html new file mode 100644 index 0000000..2ebac07 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/80.html @@ -0,0 +1,855 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <stdlib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "eom-save-as-dialog-helper.h"
+#include "eom-pixbuf-util.h"
+#include "eom-file-chooser.h"
+
+typedef struct {
+	GtkWidget *dir_chooser;
+	GtkWidget *token_entry;
+	GtkWidget *replace_spaces_check;
+	GtkWidget *counter_spin;
+	GtkWidget *preview_label;
+	GtkWidget *format_combobox;
+
+	guint      idle_id;
+	gint       n_images;
+	EomImage  *image;
+	gint       nth_image;
+} SaveAsData;
+
+static GdkPixbufFormat *
+get_selected_format (GtkComboBox *combobox)
+{
+	GdkPixbufFormat *format;
+	GtkTreeModel *store;
+	GtkTreeIter iter;
+
+	gtk_combo_box_get_active_iter (combobox, &iter);
+	store = gtk_combo_box_get_model (combobox);
+	gtk_tree_model_get (store, &iter, 1, &format, -1);
+
+	return format;
+}
+
+static gboolean
+update_preview (gpointer user_data)
+{
+	SaveAsData *data;
+	char *preview_str = NULL;
+	const char *token_str;
+	gboolean convert_spaces;
+	gulong   counter_start;
+	GdkPixbufFormat *format;
+
+	data = g_object_get_data (G_OBJECT (user_data), "data");
+	g_assert (data != NULL);
+
+	if (data->image == NULL) return FALSE;
+
+	/* obtain required dialog data */
+	token_str = gtk_entry_get_text (GTK_ENTRY (data->token_entry));
+	convert_spaces = gtk_toggle_button_get_active
+		(GTK_TOGGLE_BUTTON (data->replace_spaces_check));
+	counter_start = gtk_spin_button_get_value_as_int
+		(GTK_SPIN_BUTTON (data->counter_spin));
+
+	format = get_selected_format (GTK_COMBO_BOX (data->format_combobox));
+
+	if (token_str != NULL) {
+		/* generate preview filename */
+		preview_str = eom_uri_converter_preview (token_str, data->image, format,
+							 (counter_start + data->nth_image),
+							 data->n_images,
+							 convert_spaces, '_' /* FIXME: make this editable */);
+	}
+
+	gtk_label_set_text (GTK_LABEL (data->preview_label), preview_str);
+
+	g_free (preview_str);
+
+	data->idle_id = 0;
+
+	return FALSE;
+}
+
+static void
+request_preview_update (GtkWidget *dlg)
+{
+	SaveAsData *data;
+
+	data = g_object_get_data (G_OBJECT (dlg), "data");
+	g_assert (data != NULL);
+
+	if (data->idle_id != 0)
+		return;
+
+	data->idle_id = g_idle_add (update_preview, dlg);
+}
+
+static void
+on_format_combobox_changed (GtkComboBox *widget, gpointer data)
+{
+	request_preview_update (GTK_WIDGET (data));
+}
+
+static void
+on_token_entry_changed (GtkWidget *widget, gpointer user_data)
+{
+	SaveAsData *data;
+	gboolean enable_save;
+
+	data = g_object_get_data (G_OBJECT (user_data), "data");
+	g_assert (data != NULL);
+
+	request_preview_update (GTK_WIDGET (user_data));
+
+	enable_save = (strlen (gtk_entry_get_text (GTK_ENTRY (data->token_entry))) > 0);
+	gtk_dialog_set_response_sensitive (GTK_DIALOG (user_data), GTK_RESPONSE_OK,
+					   enable_save);
+}
+
+static void
+on_replace_spaces_check_clicked (GtkWidget *widget, gpointer data)
+{
+	request_preview_update (GTK_WIDGET (data));
+}
+
+static void
+on_counter_spin_changed (GtkWidget *widget, gpointer data)
+{
+	request_preview_update (GTK_WIDGET (data));
+}
+
+static void
+prepare_format_combobox (SaveAsData *data)
+{
+	GtkComboBox *combobox;
+	GtkCellRenderer *cell;
+	GSList *formats;
+	GtkListStore *store;
+	GSList *it;
+	GtkTreeIter iter;
+
+	combobox = GTK_COMBO_BOX (data->format_combobox);
+
+	store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER);
+	gtk_combo_box_set_model (combobox, GTK_TREE_MODEL (store));
+
+	cell = gtk_cell_renderer_text_new ();
+	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combobox), cell, TRUE);
+	gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (combobox), cell,
+				 	"text", 0);
+
+	formats = eom_pixbuf_get_savable_formats ();
+	for (it = formats; it != NULL; it = it->next) {
+		GdkPixbufFormat *f;
+
+		f = (GdkPixbufFormat*) it->data;
+
+		gtk_list_store_append (store, &iter);
+		gtk_list_store_set (store, &iter, 0, gdk_pixbuf_format_get_name (f), 1, f, -1);
+	}
+	g_slist_free (formats);
+
+	gtk_list_store_append (store, &iter);
+	gtk_list_store_set (store, &iter, 0, _("as is"), 1, NULL, -1);
+	gtk_combo_box_set_active_iter (combobox, &iter);
+	gtk_widget_show_all (GTK_WIDGET (combobox));
+}
+
+static void
+destroy_data_cb (gpointer data)
+{
+	SaveAsData *sd;
+
+	sd = (SaveAsData*) data;
+
+	if (sd->image != NULL)
+		g_object_unref (sd->image);
+
+	if (sd->idle_id != 0)
+		g_source_remove (sd->idle_id);
+
+	g_slice_free (SaveAsData, sd);
+}
+
+static void
+set_default_values (GtkWidget *dlg, GFile *base_file)
+{
+	SaveAsData *sd;
+
+	sd = (SaveAsData*) g_object_get_data (G_OBJECT (dlg), "data");
+
+	gtk_spin_button_set_value (GTK_SPIN_BUTTON (sd->counter_spin), 0.0);
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sd->replace_spaces_check),
+				      FALSE);
+	if (base_file != NULL) {
+		gtk_file_chooser_set_current_folder_file (GTK_FILE_CHOOSER (sd->dir_chooser), base_file, NULL);
+	}
+
+	/*gtk_dialog_set_response_sensitive (GTK_DIALOG (dlg), GTK_RESPONSE_OK, FALSE);*/
+
+	request_preview_update (dlg);
+}
+
+GtkWidget*
+eom_save_as_dialog_new (GtkWindow *main, GList *images, GFile *base_file)
+{
+	GtkBuilder  *xml;
+	GtkWidget *dlg;
+	SaveAsData *data;
+	GtkWidget *label;
+
+	xml = gtk_builder_new_from_resource ("/org/mate/eom/ui/eom-multiple-save-as-dialog.ui");
+#ifdef ENABLE_NLS
+	gtk_builder_set_translation_domain (xml, GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
+
+	dlg = GTK_WIDGET (g_object_ref (gtk_builder_get_object (xml, "eom_multiple_save_as_dialog")));
+	gtk_window_set_transient_for (GTK_WINDOW (dlg), GTK_WINDOW (main));
+	gtk_window_set_position (GTK_WINDOW (dlg), GTK_WIN_POS_CENTER_ON_PARENT);
+
+	data = g_slice_new0 (SaveAsData);
+	/* init widget references */
+	data->dir_chooser = GTK_WIDGET (gtk_builder_get_object (xml,
+								"dir_chooser"));
+	data->token_entry = GTK_WIDGET (gtk_builder_get_object (xml,
+								"token_entry"));
+	data->replace_spaces_check = GTK_WIDGET (gtk_builder_get_object (xml,
+						       "replace_spaces_check"));
+	data->counter_spin = GTK_WIDGET (gtk_builder_get_object (xml,
+							       "counter_spin"));
+	data->preview_label = GTK_WIDGET (gtk_builder_get_object (xml,
+							      "preview_label"));
+	data->format_combobox = GTK_WIDGET (gtk_builder_get_object (xml,
+							    "format_combobox"));
+
+	/* init preview information */
+	data->idle_id = 0;
+	data->n_images = g_list_length (images);
+	data->nth_image = (int) ((float) data->n_images * rand() / (float) (RAND_MAX+1.0));
+	g_assert (data->nth_image >= 0 && data->nth_image < data->n_images);
+	data->image = g_object_ref (EOM_IMAGE (g_list_nth_data (images, data->nth_image)));
+	g_object_set_data_full (G_OBJECT (dlg), "data", data, destroy_data_cb);
+
+	g_signal_connect (data->format_combobox, "changed",
+	                  G_CALLBACK (on_format_combobox_changed),
+	                  dlg);
+
+	g_signal_connect (data->token_entry, "changed",
+	                  G_CALLBACK (on_token_entry_changed),
+	                  dlg);
+
+	g_signal_connect (data->replace_spaces_check, "toggled",
+	                  G_CALLBACK (on_replace_spaces_check_clicked),
+	                  dlg);
+
+	g_signal_connect (data->counter_spin, "changed",
+	                  G_CALLBACK (on_counter_spin_changed),
+	                  dlg);
+
+	label = GTK_WIDGET (gtk_builder_get_object (xml, "preview_label_from"));
+	gtk_label_set_text (GTK_LABEL (label), eom_image_get_caption (data->image));
+
+	prepare_format_combobox (data);
+
+	set_default_values (dlg, base_file);
+	g_object_unref (xml);
+	return dlg;
+}
+
+EomURIConverter*
+eom_save_as_dialog_get_converter (GtkWidget *dlg)
+{
+	EomURIConverter *conv;
+
+	SaveAsData *data;
+	const char *format_str;
+	gboolean convert_spaces;
+	gulong   counter_start;
+	GdkPixbufFormat *format;
+	GFile *base_file;
+
+	data = g_object_get_data (G_OBJECT (dlg), "data");
+	g_assert (data != NULL);
+
+	/* obtain required dialog data */
+	format_str = gtk_entry_get_text (GTK_ENTRY (data->token_entry));
+
+	convert_spaces = gtk_toggle_button_get_active
+		(GTK_TOGGLE_BUTTON (data->replace_spaces_check));
+
+	counter_start = gtk_spin_button_get_value_as_int
+		(GTK_SPIN_BUTTON (data->counter_spin));
+
+	format = get_selected_format (GTK_COMBO_BOX (data->format_combobox));
+
+	base_file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (data->dir_chooser));
+
+	/* create converter object */
+	conv = eom_uri_converter_new (base_file, format, format_str);
+
+	/* set other properties */
+	g_object_set (G_OBJECT (conv),
+		      "convert-spaces", convert_spaces,
+		      "space-character", '_',
+		      "counter-start", counter_start,
+		      "n-images", data->n_images,
+		      NULL);
+
+	g_object_unref (base_file);
+
+	return conv;
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/81.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/81.html new file mode 100644 index 0000000..75a695e --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/81.html @@ -0,0 +1,273 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
#ifndef _EOM_SAVE_AS_DIALOG_HELPER_H_
+#define _EOM_SAVE_AS_DIALOG_HELPER_H_
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "eom-uri-converter.h"
+
+G_BEGIN_DECLS
+
+G_GNUC_INTERNAL
+GtkWidget*    eom_save_as_dialog_new       (GtkWindow *main, GList *images, GFile *base_file);
+
+G_GNUC_INTERNAL
+EomURIConverter* eom_save_as_dialog_get_converter (GtkWidget *dlg);
+
+G_END_DECLS
+
+#endif /* _EOM_SAVE_DIALOG_HELPER_H_ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/82.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/82.html new file mode 100644 index 0000000..de2bf29 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/82.html @@ -0,0 +1,5015 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
   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
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+1682
+1683
+1684
+1685
+1686
+1687
+1688
+1689
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699
+1700
+1701
+1702
+1703
+1704
+1705
+1706
+1707
+1708
+1709
+1710
+1711
+1712
+1713
+1714
+1715
+1716
+1717
+1718
+1719
+1720
+1721
+1722
+1723
+1724
+1725
+1726
+1727
+1728
+1729
+1730
+1731
+1732
+1733
+1734
+1735
+1736
+1737
+1738
+1739
+1740
+1741
+1742
+1743
+1744
+1745
+1746
+1747
+1748
+1749
+1750
+1751
+1752
+1753
+1754
+1755
+1756
+1757
+1758
+1759
+1760
+1761
+1762
+1763
+1764
+1765
+1766
+1767
+1768
+1769
+1770
+1771
+1772
+1773
+1774
+1775
+1776
+1777
+1778
+1779
+1780
+1781
+1782
+1783
+1784
+1785
+1786
+1787
+1788
+1789
+1790
+1791
+1792
+1793
+1794
+1795
+1796
+1797
+1798
+1799
+1800
+1801
+1802
+1803
+1804
+1805
+1806
+1807
+1808
+1809
+1810
+1811
+1812
+1813
+1814
+1815
+1816
+1817
+1818
+1819
+1820
+1821
+1822
+1823
+1824
+1825
+1826
+1827
+1828
+1829
+1830
+1831
+1832
+1833
+1834
+1835
+1836
+1837
+1838
+1839
+1840
+1841
+1842
+1843
+1844
+1845
+1846
+1847
+1848
+1849
+1850
+1851
+1852
+1853
+1854
+1855
+1856
+1857
+1858
+1859
+1860
+1861
+1862
+1863
+1864
+1865
+1866
+1867
+1868
+1869
+1870
+1871
+1872
+1873
+1874
+1875
+1876
+1877
+1878
+1879
+1880
+1881
+1882
+1883
+1884
+1885
+1886
+1887
+1888
+1889
+1890
+1891
+1892
+1893
+1894
+1895
+1896
+1897
+1898
+1899
+1900
+1901
+1902
+1903
+1904
+1905
+1906
+1907
+1908
+1909
+1910
+1911
+1912
+1913
+1914
+1915
+1916
+1917
+1918
+1919
+1920
+1921
+1922
+1923
+1924
+1925
+1926
+1927
+1928
+1929
+1930
+1931
+1932
+1933
+1934
+1935
+1936
+1937
+1938
+1939
+1940
+1941
+1942
+1943
+1944
+1945
+1946
+1947
+1948
+1949
+1950
+1951
+1952
+1953
+1954
+1955
+1956
+1957
+1958
+1959
+1960
+1961
+1962
+1963
+1964
+1965
+1966
+1967
+1968
+1969
+1970
+1971
+1972
+1973
+1974
+1975
+1976
+1977
+1978
+1979
+1980
+1981
+1982
+1983
+1984
+1985
+1986
+1987
+1988
+1989
+1990
+1991
+1992
+1993
+1994
+1995
+1996
+1997
+1998
+1999
+2000
+2001
+2002
+2003
+2004
+2005
+2006
+2007
+2008
+2009
+2010
+2011
+2012
+2013
+2014
+2015
+2016
+2017
+2018
+2019
+2020
+2021
+2022
+2023
+2024
+2025
+2026
+2027
+2028
+2029
+2030
+2031
+2032
+2033
+2034
+2035
+2036
+2037
+2038
+2039
+2040
+2041
+2042
+2043
+2044
+2045
+2046
+2047
+2048
+2049
+2050
+2051
+2052
+2053
+2054
+2055
+2056
+2057
+2058
+2059
+2060
+2061
+2062
+2063
+2064
+2065
+2066
+2067
+2068
+2069
+2070
+2071
+2072
+2073
+2074
+2075
+2076
+2077
+2078
+2079
+2080
+2081
+2082
+2083
+2084
+2085
+2086
+2087
+2088
+2089
+2090
+2091
+2092
+2093
+2094
+2095
+2096
+2097
+2098
+2099
+2100
+2101
+2102
+2103
+2104
+2105
+2106
+2107
+2108
+2109
+2110
+2111
+2112
+2113
+2114
+2115
+2116
+2117
+2118
+2119
+2120
+2121
+2122
+2123
+2124
+2125
+2126
+2127
+2128
+2129
+2130
+2131
+2132
+2133
+2134
+2135
+2136
+2137
+2138
+2139
+2140
+2141
+2142
+2143
+2144
+2145
+2146
+2147
+2148
+2149
+2150
+2151
+2152
+2153
+2154
+2155
+2156
+2157
+2158
+2159
+2160
+2161
+2162
+2163
+2164
+2165
+2166
+2167
+2168
+2169
+2170
+2171
+2172
+2173
+2174
+2175
+2176
+2177
+2178
+2179
+2180
+2181
+2182
+2183
+2184
+2185
+2186
+2187
+2188
+2189
+2190
+2191
+2192
+2193
+2194
+2195
+2196
+2197
+2198
+2199
+2200
+2201
+2202
+2203
+2204
+2205
+2206
+2207
+2208
+2209
+2210
+2211
+2212
+2213
+2214
+2215
+2216
+2217
+2218
+2219
+2220
+2221
+2222
+2223
+2224
+2225
+2226
+2227
+2228
+2229
+2230
+2231
+2232
+2233
+2234
+2235
+2236
+2237
+2238
+2239
+2240
+2241
+2242
+2243
+2244
+2245
+2246
+2247
+2248
+2249
+2250
+2251
+2252
+2253
+2254
+2255
+2256
+2257
+2258
+2259
+2260
+2261
+2262
+2263
+2264
+2265
+2266
+2267
+2268
+2269
+2270
+2271
+2272
+2273
+2274
+2275
+2276
+2277
+2278
+2279
+2280
+2281
+2282
+2283
+2284
+2285
+2286
+2287
+2288
+2289
+2290
+2291
+2292
+2293
+2294
+2295
+2296
+2297
+2298
+2299
+2300
+2301
+2302
+2303
+2304
+2305
+2306
+2307
+2308
+2309
+2310
+2311
+2312
+2313
+2314
+2315
+2316
+2317
+2318
+2319
+2320
+2321
+2322
+2323
+2324
+2325
+2326
+2327
+2328
+2329
+2330
+2331
+2332
+2333
+2334
+2335
+2336
+2337
+2338
+2339
+2340
+2341
+2342
+2343
+2344
+2345
+2346
+2347
+2348
+2349
+2350
+2351
+2352
+2353
+2354
+2355
+2356
+2357
+2358
+2359
+2360
+2361
+2362
+2363
+2364
+2365
+2366
+2367
+2368
+2369
+2370
+2371
+2372
+2373
+2374
+2375
+2376
+2377
+2378
+2379
+2380
+2381
+2382
+2383
+2384
+2385
+2386
+2387
+2388
+2389
#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <stdlib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <math.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gdk-pixbuf/gdk-pixbuf.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gdk/gdkkeysyms.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#ifdef HAVE_RSVG
+#include <librsvg/rsvg.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include "eom-config-keys.h"
+#include "eom-enum-types.h"
+#include "eom-marshal.h"
+#include "eom-scroll-view.h"
+#include "eom-debug.h"
+#include "zoom.h"
+
+#include <gdk/gdk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+/* Scroll step increment */
+#define SCROLL_STEP_SIZE 32
+
+/* Maximum zoom factor */
+#define MAX_ZOOM_FACTOR 20
+#define MIN_ZOOM_FACTOR 0.02
+
+#define CHECK_MEDIUM 8
+#define CHECK_BLACK "#000000"
+#define CHECK_GRAY "#808080"
+#define CHECK_LIGHT "#cccccc"
+
+/* Default increment for zooming.  The current zoom factor is multiplied or
+ * divided by this amount on every zooming step.  For consistency, you should
+ * use the same value elsewhere in the program.
+ */
+#define IMAGE_VIEW_ZOOM_MULTIPLIER 1.05
+
+/* States for automatically adjusting the zoom factor */
+typedef enum {
+	ZOOM_MODE_FIT,		/* Image is fitted to scroll view even if the latter changes size */
+	ZOOM_MODE_FREE		/* The image remains at its current zoom factor even if the scrollview changes size  */
+} ZoomMode;
+
+/* Signal IDs */
+enum {
+	SIGNAL_ZOOM_CHANGED,
+	SIGNAL_LAST
+};
+
+static guint view_signals [SIGNAL_LAST] = { 0 };
+
+typedef enum {
+	EOM_SCROLL_VIEW_CURSOR_NORMAL,
+	EOM_SCROLL_VIEW_CURSOR_HIDDEN,
+	EOM_SCROLL_VIEW_CURSOR_DRAG
+} EomScrollViewCursor;
+
+/* Drag 'n Drop */
+static GtkTargetEntry target_table[] = {
+	{ "text/uri-list", 0, 0},
+};
+
+enum {
+	PROP_0,
+	PROP_ANTIALIAS_IN,
+	PROP_ANTIALIAS_OUT,
+	PROP_BACKGROUND_COLOR,
+	PROP_IMAGE,
+	PROP_SCROLLWHEEL_ZOOM,
+	PROP_TRANSP_COLOR,
+	PROP_TRANSPARENCY_STYLE,
+	PROP_USE_BG_COLOR,
+	PROP_ZOOM_MULTIPLIER
+};
+
+/* Private part of the EomScrollView structure */
+struct _EomScrollViewPrivate {
+	/* some widgets we rely on */
+	GtkWidget *display;
+	GtkAdjustment *hadj;
+	GtkAdjustment *vadj;
+	GtkWidget *hbar;
+	GtkWidget *vbar;
+	GtkWidget *menu;
+
+	/* actual image */
+	EomImage *image;
+	gulong image_changed_id;
+	gulong frame_changed_id;
+	GdkPixbuf *pixbuf;
+	cairo_surface_t *surface;
+
+	/* scale factor */
+	gint scale;
+
+	/* zoom mode, either ZOOM_MODE_FIT or ZOOM_MODE_FREE */
+	ZoomMode zoom_mode;
+
+	/* whether to allow zoom > 1.0 on zoom fit */
+	gboolean upscale;
+
+	/* the actual zoom factor */
+	double zoom;
+
+	/* the minimum possible (reasonable) zoom factor */
+	double min_zoom;
+
+	/* Current scrolling offsets */
+	int xofs, yofs;
+
+	/* handler ID for paint idle callback */
+	guint idle_id;
+
+	/* Interpolation type when zoomed in*/
+	cairo_filter_t interp_type_in;
+
+	/* Interpolation type when zoomed out*/
+	cairo_filter_t interp_type_out;
+
+	/* Scroll wheel zoom */
+	gboolean scroll_wheel_zoom;
+
+	/* Scroll wheel zoom */
+	gdouble zoom_multiplier;
+
+	/* dragging stuff */
+	int drag_anchor_x, drag_anchor_y;
+	int drag_ofs_x, drag_ofs_y;
+	guint dragging : 1;
+
+	/* how to indicate transparency in images */
+	EomTransparencyStyle transp_style;
+	GdkRGBA transp_color;
+
+	/* the type of the cursor we are currently showing */
+	EomScrollViewCursor cursor;
+
+	gboolean  use_bg_color;
+	GdkRGBA *background_color;
+	GdkRGBA *override_bg_color;
+
+	cairo_surface_t *background_surface;
+
+	/* Two-pass filtering */
+	GSource *hq_redraw_timeout_source;
+	gboolean force_unfiltered;
+};
+
+static void scroll_by (EomScrollView *view, int xofs, int yofs);
+static void set_zoom_fit (EomScrollView *view);
+/* static void request_paint_area (EomScrollView *view, GdkRectangle *area); */
+static void set_minimum_zoom_factor (EomScrollView *view);
+static void view_on_drag_begin_cb (GtkWidget *widget, GdkDragContext *context,
+				   gpointer user_data);
+static void view_on_drag_data_get_cb (GtkWidget *widget,
+				      GdkDragContext*drag_context,
+				      GtkSelectionData *data, guint info,
+				      guint time, gpointer user_data);
+
+static gboolean _eom_gdk_rgba_equal0 (const GdkRGBA *a, const GdkRGBA *b);
+
+G_DEFINE_TYPE_WITH_PRIVATE (EomScrollView, eom_scroll_view, GTK_TYPE_GRID)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
+
+/*===================================
+    widget size changing handler &
+        util functions
+  ---------------------------------*/
+
+static cairo_surface_t *
+create_surface_from_pixbuf (EomScrollView *view, GdkPixbuf *pixbuf)
+{
+	cairo_surface_t *surface;
+
+	surface = gdk_cairo_surface_create_from_pixbuf (pixbuf,
+			                                view->priv->scale,
+			                                gtk_widget_get_window (view->priv->display));
+
+	return surface;
+}
+
+/* Disconnects from the EomImage and removes references to it */
+static void
+free_image_resources (EomScrollView *view)
+{
+	EomScrollViewPrivate *priv;
+
+	priv = view->priv;
+
+#if GLIB_CHECK_VERSION(2,62,0)
+	g_clear_signal_handler (&priv->image_changed_id, priv->image);
+	g_clear_signal_handler (&priv->frame_changed_id, priv->image);
+#else
+	if (priv->image_changed_id != 0) {
+		g_signal_handler_disconnect (priv->image, priv->image_changed_id);
+		priv->image_changed_id = 0;
+	}
+
+	if (priv->frame_changed_id != 0) {
+		g_signal_handler_disconnect (priv->image, priv->frame_changed_id);
+		priv->frame_changed_id = 0;
+	}
+#endif
+
+	if (priv->image != NULL) {
+		eom_image_data_unref (priv->image);
+		priv->image = NULL;
+	}
+
+	if (priv->pixbuf != NULL) {
+		g_object_unref (priv->pixbuf);
+		priv->pixbuf = NULL;
+	}
+
+	if (priv->surface !=NULL) {
+		cairo_surface_destroy (priv->surface);
+		priv->surface = NULL;
+	}
+}
+
+/* Computes the size in pixels of the scaled image */
+static void
+compute_scaled_size (EomScrollView *view, double zoom, int *width, int *height)
+{
+	EomScrollViewPrivate *priv;
+
+	priv = view->priv;
+
+	if (priv->pixbuf) {
+		*width = floor (gdk_pixbuf_get_width (priv->pixbuf) / priv->scale * zoom + 0.5);
+		*height = floor (gdk_pixbuf_get_height (priv->pixbuf) / priv->scale * zoom + 0.5);
+	} else
+		*width = *height = 0;
+}
+
+/* Computes the offsets for the new zoom value so that they keep the image
+ * centered on the view.
+ */
+static void
+compute_center_zoom_offsets (EomScrollView *view,
+			     double old_zoom, double new_zoom,
+			     int width, int height,
+			     double zoom_x_anchor, double zoom_y_anchor,
+			     int *xofs, int *yofs)
+{
+	EomScrollViewPrivate *priv;
+	int old_scaled_width, old_scaled_height;
+	int new_scaled_width, new_scaled_height;
+	double view_cx, view_cy;
+
+	priv = view->priv;
+
+	compute_scaled_size (view, old_zoom,
+			     &old_scaled_width, &old_scaled_height);
+
+	if (old_scaled_width < width)
+		view_cx = (zoom_x_anchor * old_scaled_width) / old_zoom;
+	else
+		view_cx = (priv->xofs + zoom_x_anchor * width) / old_zoom;
+
+	if (old_scaled_height < height)
+		view_cy = (zoom_y_anchor * old_scaled_height) / old_zoom;
+	else
+		view_cy = (priv->yofs + zoom_y_anchor * height) / old_zoom;
+
+	compute_scaled_size (view, new_zoom,
+			     &new_scaled_width, &new_scaled_height);
+
+	if (new_scaled_width < width)
+		*xofs = 0;
+	else {
+		*xofs = floor (view_cx * new_zoom - zoom_x_anchor * width + 0.5);
+		if (*xofs < 0)
+			*xofs = 0;
+	}
+
+	if (new_scaled_height < height)
+		*yofs = 0;
+	else {
+		*yofs = floor (view_cy * new_zoom - zoom_y_anchor * height + 0.5);
+		if (*yofs < 0)
+			*yofs = 0;
+	}
+}
+
+/* Sets the scrollbar values based on the current scrolling offset */
+static void
+update_scrollbar_values (EomScrollView *view)
+{
+	EomScrollViewPrivate *priv;
+	int scaled_width, scaled_height;
+	gdouble page_size,page_increment,step_increment;
+	gdouble lower, upper;
+	GtkAllocation allocation;
+
+	priv = view->priv;
+
+	if (!gtk_widget_get_visible (priv->hbar)
+	    && !gtk_widget_get_visible (priv->vbar))
+		return;
+
+	compute_scaled_size (view, priv->zoom, &scaled_width, &scaled_height);
+	gtk_widget_get_allocation (priv->display, &allocation);
+
+	if (gtk_widget_get_visible (priv->hbar)) {
+		/* Set scroll increments */
+		page_size = MIN (scaled_width, allocation.width);
+
+		page_increment = allocation.width / 2;
+		step_increment = SCROLL_STEP_SIZE;
+
+		/* Set scroll bounds and new offsets */
+		lower = 0;
+		upper = scaled_width;
+		priv->xofs = CLAMP (priv->xofs, 0, upper - page_size);
+
+		g_signal_handlers_block_matched (
+			priv->hadj, G_SIGNAL_MATCH_DATA,
+			0, 0, NULL, NULL, view);
+
+		gtk_adjustment_configure (priv->hadj, priv->xofs, lower,
+					  upper, step_increment,
+					  page_increment, page_size);
+
+		g_signal_handlers_unblock_matched (
+			priv->hadj, G_SIGNAL_MATCH_DATA,
+			0, 0, NULL, NULL, view);
+	}
+
+	if (gtk_widget_get_visible (priv->vbar)) {
+		page_size = MIN (scaled_height, allocation.height);
+		page_increment = allocation.height / 2;
+		step_increment = SCROLL_STEP_SIZE;
+
+		lower = 0;
+		upper = scaled_height;
+		priv->yofs = CLAMP (priv->yofs, 0, upper - page_size);
+
+		g_signal_handlers_block_matched (
+			priv->vadj, G_SIGNAL_MATCH_DATA,
+			0, 0, NULL, NULL, view);
+
+		gtk_adjustment_configure (priv->vadj, priv->yofs, lower,
+					  upper, step_increment,
+					  page_increment, page_size);
+
+		g_signal_handlers_unblock_matched (
+			priv->vadj, G_SIGNAL_MATCH_DATA,
+			0, 0, NULL, NULL, view);
+	}
+}
+
+static void
+eom_scroll_view_set_cursor (EomScrollView *view, EomScrollViewCursor new_cursor)
+{
+	GdkCursor *cursor = NULL;
+	GdkDisplay *display;
+	GtkWidget *widget;
+
+	if (view->priv->cursor == new_cursor) {
+		return;
+	}
+
+	widget = gtk_widget_get_toplevel (GTK_WIDGET (view));
+	display = gtk_widget_get_display (widget);
+	view->priv->cursor = new_cursor;
+
+	switch (new_cursor) {
+		case EOM_SCROLL_VIEW_CURSOR_NORMAL:
+			gdk_window_set_cursor (gtk_widget_get_window (widget), NULL);
+			break;
+                case EOM_SCROLL_VIEW_CURSOR_HIDDEN:
+                        cursor = gdk_cursor_new_for_display (display, GDK_BLANK_CURSOR);
+                        break;
+		case EOM_SCROLL_VIEW_CURSOR_DRAG:
+			cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
+			break;
+	}
+
+	if (cursor) {
+		gdk_window_set_cursor (gtk_widget_get_window (widget), cursor);
+		g_object_unref (cursor);
+		gdk_display_flush (display);
+	}
+}
+
+/* Changes visibility of the scrollbars based on the zoom factor and the
+ * specified allocation, or the current allocation if NULL is specified.
+ */
+static void
+check_scrollbar_visibility (EomScrollView *view, GtkAllocation *alloc)
+{
+	EomScrollViewPrivate *priv;
+	int bar_height;
+	int bar_width;
+	int img_width;
+	int img_height;
+	GtkRequisition req;
+	int width, height;
+	gboolean hbar_visible, vbar_visible;
+
+	priv = view->priv;
+
+	if (alloc) {
+		width = alloc->width;
+		height = alloc->height;
+	} else {
+		GtkAllocation allocation;
+
+		gtk_widget_get_allocation (GTK_WIDGET (view), &allocation);
+		width = allocation.width;
+		height = allocation.height;
+	}
+
+	compute_scaled_size (view, priv->zoom, &img_width, &img_height);
+
+	/* this should work fairly well in this special case for scrollbars */
+	gtk_widget_get_preferred_size (priv->hbar, &req, NULL);
+	bar_height = req.height;
+	gtk_widget_get_preferred_size (priv->vbar, &req, NULL);
+	bar_width = req.width;
+
+	eom_debug_message (DEBUG_WINDOW, "Widget Size allocate: %i, %i   Bar: %i, %i\n",
+			   width, height, bar_width, bar_height);
+
+	hbar_visible = vbar_visible = FALSE;
+	if (priv->zoom_mode == ZOOM_MODE_FIT)
+		hbar_visible = vbar_visible = FALSE;
+	else if (img_width <= width && img_height <= height)
+		hbar_visible = vbar_visible = FALSE;
+	else if (img_width > width && img_height > height)
+		hbar_visible = vbar_visible = TRUE;
+	else if (img_width > width) {
+		hbar_visible = TRUE;
+		if (img_height <= (height - bar_height))
+			vbar_visible = FALSE;
+		else
+			vbar_visible = TRUE;
+	}
+        else if (img_height > height) {
+		vbar_visible = TRUE;
+		if (img_width <= (width - bar_width))
+			hbar_visible = FALSE;
+		else
+			hbar_visible = TRUE;
+	}
+
+	if (hbar_visible != gtk_widget_get_visible (priv->hbar))
+		g_object_set (G_OBJECT (priv->hbar), "visible", hbar_visible, NULL);
+
+	if (vbar_visible != gtk_widget_get_visible (priv->vbar))
+		g_object_set (G_OBJECT (priv->vbar), "visible", vbar_visible, NULL);
+}
+
+#define DOUBLE_EQUAL_MAX_DIFF 1e-6
+#define DOUBLE_EQUAL(a,b) (fabs (a - b) < DOUBLE_EQUAL_MAX_DIFF)
+
+/* Returns whether the image is zoomed in */
+static gboolean
+is_zoomed_in (EomScrollView *view)
+{
+	EomScrollViewPrivate *priv;
+
+	priv = view->priv;
+	return priv->zoom - 1.0 > DOUBLE_EQUAL_MAX_DIFF;
+}
+
+/* Returns whether the image is zoomed out */
+static gboolean
+is_zoomed_out (EomScrollView *view)
+{
+	EomScrollViewPrivate *priv;
+
+	priv = view->priv;
+	return DOUBLE_EQUAL_MAX_DIFF + priv->zoom - 1.0 < 0.0;
+}
+
+/* Returns wether the image is movable, that means if it is larger then
+ * the actual visible area.
+ */
+static gboolean
+is_image_movable (EomScrollView *view)
+{
+	EomScrollViewPrivate *priv;
+
+	priv = view->priv;
+
+	return (gtk_widget_get_visible (priv->hbar) || gtk_widget_get_visible (priv->vbar));
+}
+
+/*===================================
+          drawing core
+  ---------------------------------*/
+
+static void
+get_transparency_params (EomScrollView *view, int *size, GdkRGBA *color1, GdkRGBA *color2)
+{
+	EomScrollViewPrivate *priv;
+
+	priv = view->priv;
+
+	/* Compute transparency parameters */
+	switch (priv->transp_style) {
+	case EOM_TRANSP_BACKGROUND: {
+		/* Simply return fully transparent color */
+		color1->red = color1->green = color1->blue = color1->alpha = 0.0;
+		color2->red = color2->green = color2->blue = color2->alpha = 0.0;
+		break;
+	}
+
+	case EOM_TRANSP_CHECKED:
+		g_warn_if_fail (gdk_rgba_parse (color1, CHECK_GRAY));
+		g_warn_if_fail (gdk_rgba_parse (color2, CHECK_LIGHT));
+		break;
+
+	case EOM_TRANSP_COLOR:
+		*color1 = *color2 = priv->transp_color;
+		break;
+
+	default:
+		g_assert_not_reached ();
+	};
+
+	*size = CHECK_MEDIUM;
+}
+
+static cairo_surface_t *
+create_background_surface (EomScrollView *view)
+{
+	int check_size;
+	GdkRGBA check_1;
+	GdkRGBA check_2;
+	cairo_surface_t *surface;
+
+	get_transparency_params (view, &check_size, &check_1, &check_2);
+	surface = gdk_window_create_similar_surface (gtk_widget_get_window (view->priv->display),
+						     CAIRO_CONTENT_COLOR_ALPHA,
+						     check_size * 2, check_size * 2);
+	cairo_t* cr = cairo_create (surface);
+
+	/* Use source operator to make fully transparent work */
+	cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
+
+	gdk_cairo_set_source_rgba(cr, &check_1);
+	cairo_rectangle (cr, 0, 0, check_size, check_size);
+	cairo_rectangle (cr, check_size, check_size, check_size, check_size);
+	cairo_fill (cr);
+
+	gdk_cairo_set_source_rgba(cr, &check_2);
+	cairo_rectangle (cr, 0, check_size, check_size, check_size);
+	cairo_rectangle (cr, check_size, 0, check_size, check_size);
+	cairo_fill (cr);
+
+	cairo_destroy (cr);
+
+	return surface;
+}
+
+/* =======================================
+
+    scrolling stuff
+
+    --------------------------------------*/
+
+/* Scrolls the view to the specified offsets.  */
+static void
+scroll_to (EomScrollView *view, int x, int y, gboolean change_adjustments)
+{
+	EomScrollViewPrivate *priv;
+	GtkAllocation allocation;
+	int xofs, yofs;
+	GdkWindow *window;
+
+	priv = view->priv;
+
+	/* Check bounds & Compute offsets */
+	if (gtk_widget_get_visible (priv->hbar)) {
+		x = CLAMP (x, 0, gtk_adjustment_get_upper (priv->hadj)
+				 - gtk_adjustment_get_page_size (priv->hadj));
+		xofs = x - priv->xofs;
+	} else
+		xofs = 0;
+
+	if (gtk_widget_get_visible (priv->vbar)) {
+		y = CLAMP (y, 0, gtk_adjustment_get_upper (priv->vadj)
+				 - gtk_adjustment_get_page_size (priv->vadj));
+		yofs = y - priv->yofs;
+	} else
+		yofs = 0;
+
+	if (xofs == 0 && yofs == 0)
+		return;
+
+	priv->xofs = x;
+	priv->yofs = y;
+
+	if (!gtk_widget_is_drawable (priv->display))
+		goto out;
+
+	gtk_widget_get_allocation (priv->display, &allocation);
+
+	if (abs (xofs) >= allocation.width || abs (yofs) >= allocation.height) {
+		gtk_widget_queue_draw (priv->display);
+		goto out;
+	}
+
+	window = gtk_widget_get_window (priv->display);
+
+	gdk_window_scroll (window, -xofs, -yofs);
+
+ out:
+	if (!change_adjustments)
+		return;
+
+	g_signal_handlers_block_matched (
+		priv->hadj, G_SIGNAL_MATCH_DATA,
+		0, 0, NULL, NULL, view);
+	g_signal_handlers_block_matched (
+		priv->vadj, G_SIGNAL_MATCH_DATA,
+		0, 0, NULL, NULL, view);
+
+	gtk_adjustment_set_value (priv->hadj, x);
+	gtk_adjustment_set_value (priv->vadj, y);
+
+	g_signal_handlers_unblock_matched (
+		priv->hadj, G_SIGNAL_MATCH_DATA,
+		0, 0, NULL, NULL, view);
+	g_signal_handlers_unblock_matched (
+		priv->vadj, G_SIGNAL_MATCH_DATA,
+		0, 0, NULL, NULL, view);
+}
+
+/* Scrolls the image view by the specified offsets.  Notifies the adjustments
+ * about their new values.
+ */
+static void
+scroll_by (EomScrollView *view, int xofs, int yofs)
+{
+	EomScrollViewPrivate *priv;
+
+	priv = view->priv;
+
+	scroll_to (view, priv->xofs + xofs, priv->yofs + yofs, TRUE);
+}
+
+/* Callback used when an adjustment is changed */
+static void
+adjustment_changed_cb (GtkAdjustment *adj, gpointer data)
+{
+	EomScrollView *view;
+	EomScrollViewPrivate *priv;
+
+	view = EOM_SCROLL_VIEW (data);
+	priv = view->priv;
+
+	scroll_to (view, gtk_adjustment_get_value (priv->hadj),
+		   gtk_adjustment_get_value (priv->vadj), FALSE);
+
+	gtk_widget_queue_resize (GTK_WIDGET (view));
+}
+
+/* Drags the image to the specified position */
+static void
+drag_to (EomScrollView *view, int x, int y)
+{
+	EomScrollViewPrivate *priv;
+	int dx, dy;
+
+	priv = view->priv;
+
+	dx = priv->drag_anchor_x - x;
+	dy = priv->drag_anchor_y - y;
+
+	x = priv->drag_ofs_x + dx;
+	y = priv->drag_ofs_y + dy;
+
+	scroll_to (view, x, y, TRUE);
+}
+
+static void
+set_minimum_zoom_factor (EomScrollView *view)
+{
+	g_return_if_fail (EOM_IS_SCROLL_VIEW (view));
+
+	view->priv->min_zoom = MAX (1.0 / gdk_pixbuf_get_width (view->priv->pixbuf) / view->priv->scale,
+				    MAX(1.0 / gdk_pixbuf_get_height (view->priv->pixbuf) / view->priv->scale,
+					MIN_ZOOM_FACTOR) );
+	return;
+}
+
+/**
+ * set_zoom:
+ * @view: A scroll view.
+ * @zoom: Zoom factor.
+ * @have_anchor: Whether the anchor point specified by (@anchorx, @anchory)
+ * should be used.
+ * @anchorx: Horizontal anchor point in pixels.
+ * @anchory: Vertical anchor point in pixels.
+ *
+ * Sets the zoom factor for an image view.  The anchor point can be used to
+ * specify the point that stays fixed when the image is zoomed.  If @have_anchor
+ * is %TRUE, then (@anchorx, @anchory) specify the point relative to the image
+ * view widget's allocation that will stay fixed when zooming.  If @have_anchor
+ * is %FALSE, then the center point of the image view will be used.
+ **/
+static void
+set_zoom (EomScrollView *view, double zoom,
+	  gboolean have_anchor, int anchorx, int anchory)
+{
+	EomScrollViewPrivate *priv;
+	GtkAllocation allocation;
+	int xofs, yofs;
+	double x_rel, y_rel;
+
+	priv = view->priv;
+
+	if (priv->pixbuf == NULL)
+		return;
+
+	if (zoom > MAX_ZOOM_FACTOR)
+		zoom = MAX_ZOOM_FACTOR;
+	else if (zoom < MIN_ZOOM_FACTOR)
+		zoom = MIN_ZOOM_FACTOR;
+
+	if (DOUBLE_EQUAL (priv->zoom, zoom))
+		return;
+	if (DOUBLE_EQUAL (priv->zoom, priv->min_zoom) && zoom < priv->zoom)
+		return;
+
+	priv->zoom_mode = ZOOM_MODE_FREE;
+
+	gtk_widget_get_allocation (priv->display, &allocation);
+
+	/* compute new xofs/yofs values */
+	if (have_anchor) {
+		x_rel = (double) anchorx / allocation.width;
+		y_rel = (double) anchory / allocation.height;
+	} else {
+		x_rel = 0.5;
+		y_rel = 0.5;
+	}
+
+	compute_center_zoom_offsets (view, priv->zoom, zoom,
+				     allocation.width, allocation.height,
+				     x_rel, y_rel,
+				     &xofs, &yofs);
+
+	/* set new values */
+	priv->xofs = xofs; /* (img_width * x_rel * zoom) - anchorx; */
+	priv->yofs = yofs; /* (img_height * y_rel * zoom) - anchory; */
+#if 0
+	g_print ("xofs: %i  yofs: %i\n", priv->xofs, priv->yofs);
+#endif
+	if (zoom <= priv->min_zoom)
+		priv->zoom = priv->min_zoom;
+	else
+		priv->zoom = zoom;
+
+	/* we make use of the new values here */
+	check_scrollbar_visibility (view, NULL);
+	update_scrollbar_values (view);
+
+	/* repaint the whole image */
+	gtk_widget_queue_draw (priv->display);
+
+	g_signal_emit (view, view_signals[SIGNAL_ZOOM_CHANGED], 0, priv->zoom);
+}
+
+/* Zooms the image to fit the available allocation */
+static void
+set_zoom_fit (EomScrollView *view)
+{
+	EomScrollViewPrivate *priv;
+	GtkAllocation allocation;
+	double new_zoom;
+
+	priv = view->priv;
+
+	priv->zoom_mode = ZOOM_MODE_FIT;
+
+	if (!gtk_widget_get_mapped (GTK_WIDGET (view)))
+		return;
+
+	if (priv->pixbuf == NULL)
+		return;
+
+	gtk_widget_get_allocation (priv->display, &allocation);
+
+	new_zoom = zoom_fit_scale (allocation.width, allocation.height,
+				   gdk_pixbuf_get_width (priv->pixbuf) / priv->scale,
+				   gdk_pixbuf_get_height (priv->pixbuf) / priv->scale,
+				   priv->upscale);
+
+	if (new_zoom > MAX_ZOOM_FACTOR)
+		new_zoom = MAX_ZOOM_FACTOR;
+	else if (new_zoom < MIN_ZOOM_FACTOR)
+		new_zoom = MIN_ZOOM_FACTOR;
+
+	priv->zoom = new_zoom;
+	priv->xofs = 0;
+	priv->yofs = 0;
+
+	g_signal_emit (view, view_signals[SIGNAL_ZOOM_CHANGED], 0, priv->zoom);
+}
+
+/*===================================
+
+   internal signal callbacks
+
+  ---------------------------------*/
+
+/* Key press event handler for the image view */
+static gboolean
+display_key_press_event (GtkWidget *widget, GdkEventKey *event, gpointer data)
+{
+	EomScrollView *view;
+	EomScrollViewPrivate *priv;
+	GtkAllocation allocation;
+	gboolean do_zoom;
+	double zoom;
+	gboolean do_scroll;
+	int xofs, yofs;
+
+	view = EOM_SCROLL_VIEW (data);
+	priv = view->priv;
+
+	do_zoom = FALSE;
+	do_scroll = FALSE;
+	xofs = yofs = 0;
+	zoom = 1.0;
+
+	gtk_widget_get_allocation (priv->display, &allocation);
+
+	/* EomScrollView doesn't handle/have any Alt+Key combos */
+	if (event->state & GDK_MOD1_MASK) {
+		return FALSE;
+	}
+
+	switch (event->keyval) {
+	case GDK_KEY_Up:
+		do_scroll = TRUE;
+		xofs = 0;
+		yofs = -SCROLL_STEP_SIZE;
+		break;
+
+	case GDK_KEY_Page_Up:
+		do_scroll = TRUE;
+		if (event->state & GDK_CONTROL_MASK) {
+			xofs = -(allocation.width * 3) / 4;
+			yofs = 0;
+		} else {
+			xofs = 0;
+			yofs = -(allocation.height * 3) / 4;
+		}
+		break;
+
+	case GDK_KEY_Down:
+		do_scroll = TRUE;
+		xofs = 0;
+		yofs = SCROLL_STEP_SIZE;
+		break;
+
+	case GDK_KEY_Page_Down:
+		do_scroll = TRUE;
+		if (event->state & GDK_CONTROL_MASK) {
+			xofs = (allocation.width * 3) / 4;
+			yofs = 0;
+		} else {
+			xofs = 0;
+			yofs = (allocation.height * 3) / 4;
+		}
+		break;
+
+	case GDK_KEY_Left:
+		do_scroll = TRUE;
+		xofs = -SCROLL_STEP_SIZE;
+		yofs = 0;
+		break;
+
+	case GDK_KEY_Right:
+		do_scroll = TRUE;
+		xofs = SCROLL_STEP_SIZE;
+		yofs = 0;
+		break;
+
+	case GDK_KEY_plus:
+	case GDK_KEY_equal:
+	case GDK_KEY_KP_Add:
+		do_zoom = TRUE;
+		zoom = priv->zoom * priv->zoom_multiplier;
+		break;
+
+	case GDK_KEY_minus:
+	case GDK_KEY_KP_Subtract:
+		do_zoom = TRUE;
+		zoom = priv->zoom / priv->zoom_multiplier;
+		break;
+
+	case GDK_KEY_1:
+		do_zoom = TRUE;
+		zoom = 1.0;
+		break;
+
+	default:
+		return FALSE;
+	}
+
+	if (do_zoom) {
+		GdkSeat *seat;
+		GdkDevice *device;
+		gint x, y;
+
+		seat = gdk_display_get_default_seat (gtk_widget_get_display (widget));
+		device = gdk_seat_get_pointer (seat);
+
+		gdk_window_get_device_position (gtk_widget_get_window (widget), device,
+		                                &x, &y, NULL);
+		set_zoom (view, zoom, TRUE, x, y);
+	}
+
+	if (do_scroll)
+		scroll_by (view, xofs, yofs);
+
+	return TRUE;
+}
+
+/* Button press event handler for the image view */
+static gboolean
+eom_scroll_view_button_press_event (GtkWidget *widget, GdkEventButton *event, gpointer data)
+{
+	EomScrollView *view;
+	EomScrollViewPrivate *priv;
+
+	view = EOM_SCROLL_VIEW (data);
+	priv = view->priv;
+
+	if (!gtk_widget_has_focus (priv->display))
+		gtk_widget_grab_focus (priv->display);
+
+	if (priv->dragging)
+		return FALSE;
+
+	switch (event->button) {
+		case 1:
+		case 2:
+                        if (event->button == 1 && !priv->scroll_wheel_zoom &&
+			    !(event->state & GDK_CONTROL_MASK))
+				break;
+
+			if (is_image_movable (view)) {
+				eom_scroll_view_set_cursor (view, EOM_SCROLL_VIEW_CURSOR_DRAG);
+
+				priv->dragging = TRUE;
+				priv->drag_anchor_x = event->x;
+				priv->drag_anchor_y = event->y;
+
+				priv->drag_ofs_x = priv->xofs;
+				priv->drag_ofs_y = priv->yofs;
+
+				return TRUE;
+			}
+		default:
+			break;
+	}
+
+	return FALSE;
+}
+
+/* Button release event handler for the image view */
+static gboolean
+eom_scroll_view_button_release_event (GtkWidget *widget, GdkEventButton *event, gpointer data)
+{
+	EomScrollView *view;
+	EomScrollViewPrivate *priv;
+
+	view = EOM_SCROLL_VIEW (data);
+	priv = view->priv;
+
+	if (!priv->dragging)
+		return FALSE;
+
+	switch (event->button) {
+		case 1:
+		case 2:
+			drag_to (view, event->x, event->y);
+			priv->dragging = FALSE;
+
+			eom_scroll_view_set_cursor (view, EOM_SCROLL_VIEW_CURSOR_NORMAL);
+			break;
+
+		default:
+			break;
+	}
+
+	return TRUE;
+}
+
+/* Scroll event handler for the image view.  We zoom with an event without
+ * modifiers rather than scroll; we use the Shift modifier to scroll.
+ * Rationale: images are not primarily vertical, and in EOM you scan scroll by
+ * dragging the image with button 1 anyways.
+ */
+static gboolean
+eom_scroll_view_scroll_event (GtkWidget *widget, GdkEventScroll *event, gpointer data)
+{
+	EomScrollView *view;
+	EomScrollViewPrivate *priv;
+	double zoom_factor;
+	int xofs, yofs;
+
+	view = EOM_SCROLL_VIEW (data);
+	priv = view->priv;
+
+	/* Compute zoom factor and scrolling offsets; we'll only use either of them */
+	/* same as in gtkscrolledwindow.c */
+	xofs = gtk_adjustment_get_page_increment (priv->hadj) / 2;
+	yofs = gtk_adjustment_get_page_increment (priv->vadj) / 2;
+
+	switch (event->direction) {
+	case GDK_SCROLL_UP:
+		zoom_factor = priv->zoom_multiplier;
+		xofs = 0;
+		yofs = -yofs;
+		break;
+
+	case GDK_SCROLL_LEFT:
+		zoom_factor = 1.0 / priv->zoom_multiplier;
+		xofs = -xofs;
+		yofs = 0;
+		break;
+
+	case GDK_SCROLL_DOWN:
+		zoom_factor = 1.0 / priv->zoom_multiplier;
+		xofs = 0;
+		/* yofs = yofs; */
+		break;
+
+	case GDK_SCROLL_RIGHT:
+		zoom_factor = priv->zoom_multiplier;
+		/* xofs = xofs; */
+		yofs = 0;
+		break;
+
+	default:
+		g_assert_not_reached ();
+		return FALSE;
+	}
+
+        if (priv->scroll_wheel_zoom) {
+		if (event->state & GDK_SHIFT_MASK)
+			scroll_by (view, yofs, xofs);
+		else if (event->state & GDK_CONTROL_MASK)
+			scroll_by (view, xofs, yofs);
+		else
+			set_zoom (view, priv->zoom * zoom_factor,
+				  TRUE, event->x, event->y);
+	} else {
+		if (event->state & GDK_SHIFT_MASK)
+			scroll_by (view, yofs, xofs);
+		else if (event->state & GDK_CONTROL_MASK)
+			set_zoom (view, priv->zoom * zoom_factor,
+				  TRUE, event->x, event->y);
+		else
+			scroll_by (view, xofs, yofs);
+        }
+
+	return TRUE;
+}
+
+/* Motion event handler for the image view */
+static gboolean
+eom_scroll_view_motion_event (GtkWidget *widget, GdkEventMotion *event, gpointer data)
+{
+	EomScrollView *view;
+	EomScrollViewPrivate *priv;
+	gint x, y;
+	GdkModifierType mods;
+
+	view = EOM_SCROLL_VIEW (data);
+	priv = view->priv;
+
+	if (!priv->dragging)
+		return FALSE;
+
+	if (event->is_hint)
+		gdk_window_get_device_position (gtk_widget_get_window (priv->display), event->device, &x, &y, &mods);
+	else {
+		x = event->x;
+		y = event->y;
+	}
+
+	drag_to (view, x, y);
+	return TRUE;
+}
+
+static void
+display_map_event (GtkWidget *widget, GdkEvent *event, gpointer data)
+{
+	EomScrollView *view;
+	EomScrollViewPrivate *priv;
+
+	view = EOM_SCROLL_VIEW (data);
+	priv = view->priv;
+
+	eom_debug (DEBUG_WINDOW);
+
+	set_zoom_fit (view);
+	check_scrollbar_visibility (view, NULL);
+	gtk_widget_queue_draw (priv->display);
+}
+
+static void
+eom_scroll_view_size_allocate (GtkWidget *widget, GtkAllocation *alloc)
+{
+	EomScrollView *view;
+
+	view = EOM_SCROLL_VIEW (widget);
+	check_scrollbar_visibility (view, alloc);
+
+	GTK_WIDGET_CLASS (eom_scroll_view_parent_class)->size_allocate (widget
+									,alloc);
+}
+
+static void
+display_size_change (GtkWidget *widget, GdkEventConfigure *event, gpointer data)
+{
+	EomScrollView *view;
+	EomScrollViewPrivate *priv;
+
+	view = EOM_SCROLL_VIEW (data);
+	priv = view->priv;
+
+	if (priv->zoom_mode == ZOOM_MODE_FIT) {
+		GtkAllocation alloc;
+
+		alloc.width = event->width;
+		alloc.height = event->height;
+
+		set_zoom_fit (view);
+		check_scrollbar_visibility (view, &alloc);
+		gtk_widget_queue_draw (priv->display);
+	} else {
+		int scaled_width, scaled_height;
+		int x_offset = 0;
+		int y_offset = 0;
+
+		compute_scaled_size (view, priv->zoom, &scaled_width, &scaled_height);
+
+		if (priv->xofs + event->width > scaled_width)
+			x_offset = scaled_width - event->width - priv->xofs;
+
+		if (priv->yofs + event->height > scaled_height)
+			y_offset = scaled_height - event->height - priv->yofs;
+
+		scroll_by (view, x_offset, y_offset);
+	}
+
+	update_scrollbar_values (view);
+}
+
+static gboolean
+eom_scroll_view_focus_in_event (GtkWidget     *widget,
+                                GdkEventFocus *event,
+                                gpointer       data)
+{
+	g_signal_stop_emission_by_name (widget, "focus_in_event");
+	return FALSE;
+}
+
+static gboolean
+eom_scroll_view_focus_out_event (GtkWidget     *widget,
+                                 GdkEventFocus *event,
+                                 gpointer       data)
+{
+	g_signal_stop_emission_by_name (widget, "focus_out_event");
+	return FALSE;
+}
+
+static gboolean _hq_redraw_cb (gpointer user_data)
+{
+	EomScrollViewPrivate *priv = EOM_SCROLL_VIEW (user_data)->priv;
+
+	priv->force_unfiltered = FALSE;
+	gtk_widget_queue_draw (priv->display);
+
+	priv->hq_redraw_timeout_source = NULL;
+	return G_SOURCE_REMOVE;
+}
+
+static void
+_clear_hq_redraw_timeout (EomScrollView *view)
+{
+	EomScrollViewPrivate *priv = view->priv;
+
+	if (priv->hq_redraw_timeout_source != NULL) {
+		g_source_unref (priv->hq_redraw_timeout_source);
+		g_source_destroy (priv->hq_redraw_timeout_source);
+	}
+
+	priv->hq_redraw_timeout_source = NULL;
+}
+
+static void
+_set_hq_redraw_timeout (EomScrollView *view)
+{
+	GSource *source;
+
+	_clear_hq_redraw_timeout (view);
+
+	source = g_timeout_source_new (200);
+	g_source_set_callback (source, &_hq_redraw_cb, view, NULL);
+
+	g_source_attach (source, NULL);
+
+	view->priv->hq_redraw_timeout_source = source;
+}
+
+static gboolean
+display_draw (GtkWidget *widget, cairo_t *cr, gpointer data)
+{
+	const GdkRGBA *background_color = NULL;
+	EomScrollView *view;
+	EomScrollViewPrivate *priv;
+	GtkAllocation allocation;
+	int scaled_width, scaled_height;
+	int xofs, yofs;
+
+	g_return_val_if_fail (GTK_IS_DRAWING_AREA (widget), FALSE);
+	g_return_val_if_fail (EOM_IS_SCROLL_VIEW (data), FALSE);
+
+	view = EOM_SCROLL_VIEW (data);
+
+	priv = view->priv;
+
+	if (priv->pixbuf == NULL)
+		return TRUE;
+
+	compute_scaled_size (view, priv->zoom, &scaled_width, &scaled_height);
+
+	gtk_widget_get_allocation (priv->display, &allocation);
+
+	/* Compute image offsets with respect to the window */
+
+	if (scaled_width <= allocation.width)
+		xofs = (allocation.width - scaled_width) / 2;
+	else
+		xofs = -priv->xofs;
+
+	if (scaled_height <= allocation.height)
+		yofs = (allocation.height - scaled_height) / 2;
+	else
+		yofs = -priv->yofs;
+
+	eom_debug_message (DEBUG_WINDOW, "zoom %.2f, xofs: %i, yofs: %i scaled w: %i h: %i\n",
+	priv->zoom, xofs, yofs, scaled_width, scaled_height);
+
+	/* Paint the background */
+	cairo_rectangle (cr, 0, 0, allocation.width, allocation.height);
+	if (priv->transp_style != EOM_TRANSP_BACKGROUND)
+		cairo_rectangle (cr, MAX (0, xofs), MAX (0, yofs),
+				 scaled_width, scaled_height);
+	if (priv->override_bg_color != NULL)
+		background_color = priv->override_bg_color;
+	else if (priv->use_bg_color)
+		background_color = priv->background_color;
+	if (background_color != NULL)
+		cairo_set_source_rgba (cr,
+				       background_color->red,
+				       background_color->green,
+				       background_color->blue,
+				       background_color->alpha);
+	else
+		cairo_set_source (cr, gdk_window_get_background_pattern (gtk_widget_get_window (priv->display)));
+	cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
+	cairo_fill (cr);
+
+	if (gdk_pixbuf_get_has_alpha (priv->pixbuf)) {
+		if (priv->background_surface == NULL) {
+			priv->background_surface = create_background_surface (view);
+		}
+		cairo_set_source_surface (cr, priv->background_surface, xofs, yofs);
+		cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_REPEAT);
+		cairo_rectangle (cr, xofs, yofs, scaled_width, scaled_height);
+		cairo_fill (cr);
+	}
+
+	/* Make sure the image is only drawn as large as needed.
+	 * This is especially necessary for SVGs where there might
+	 * be more image data available outside the image boundaries.
+	 */
+	cairo_rectangle (cr, xofs, yofs, scaled_width, scaled_height);
+	cairo_clip (cr);
+
+#ifdef HAVE_RSVG
+	if (eom_image_is_svg (view->priv->image)) {
+		cairo_matrix_t matrix, translate, scale, original;
+		EomTransform *transform = eom_image_get_transform (priv->image);
+		cairo_matrix_init_identity (&matrix);
+		if (transform) {
+			cairo_matrix_t affine;
+			int image_offset_x = 0;
+			int image_offset_y = 0;
+
+			eom_transform_get_affine (transform, &affine);
+			cairo_matrix_multiply (&matrix, &affine, &matrix);
+
+			switch (eom_transform_get_transform_type (transform)) {
+			case EOM_TRANSFORM_ROT_90:
+			case EOM_TRANSFORM_FLIP_HORIZONTAL:
+				image_offset_x = gdk_pixbuf_get_width (priv->pixbuf);
+				break;
+			case EOM_TRANSFORM_ROT_270:
+			case EOM_TRANSFORM_FLIP_VERTICAL:
+				image_offset_y = gdk_pixbuf_get_height (priv->pixbuf);
+				break;
+			case EOM_TRANSFORM_ROT_180:
+			case EOM_TRANSFORM_TRANSPOSE:
+			case EOM_TRANSFORM_TRANSVERSE:
+				image_offset_x = gdk_pixbuf_get_width (priv->pixbuf);
+				image_offset_y = gdk_pixbuf_get_height (priv->pixbuf);
+				break;
+			case EOM_TRANSFORM_NONE:
+				default:
+				break;
+			}
+			cairo_matrix_init_translate (&translate, (double) image_offset_x, (double) image_offset_y);
+			cairo_matrix_multiply (&matrix, &matrix, &translate);
+		}
+		/* Zoom factor for SVGs is already scaled, so scale back to application pixels. */
+		cairo_matrix_init_scale (&scale, priv->zoom / priv->scale, priv->zoom / priv->scale);
+		cairo_matrix_multiply (&matrix, &matrix, &scale);
+		cairo_matrix_init_translate (&translate, xofs, yofs);
+		cairo_matrix_multiply (&matrix, &matrix, &translate);
+
+		cairo_get_matrix (cr, &original);
+		cairo_matrix_multiply (&matrix, &matrix, &original);
+		cairo_set_matrix (cr, &matrix);
+
+		rsvg_handle_render_cairo (eom_image_get_svg (priv->image), cr);
+
+	} else
+#endif /* HAVE_RSVG */
+	{
+		cairo_filter_t interp_type;
+
+		if(!DOUBLE_EQUAL(priv->zoom, 1.0) && priv->force_unfiltered)
+		{
+			interp_type = CAIRO_FILTER_NEAREST;
+			_set_hq_redraw_timeout(view);
+		}
+		else
+		{
+			if (is_zoomed_in (view))
+				interp_type = priv->interp_type_in;
+			else
+				interp_type = priv->interp_type_out;
+
+			_clear_hq_redraw_timeout (view);
+			priv->force_unfiltered = TRUE;
+		}
+		cairo_scale (cr, priv->zoom, priv->zoom);
+		cairo_set_source_surface (cr, priv->surface, xofs/priv->zoom, yofs/priv->zoom);
+		cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_PAD);
+		if (is_zoomed_in (view) || is_zoomed_out (view))
+			cairo_pattern_set_filter (cairo_get_source (cr), interp_type);
+
+		cairo_paint (cr);
+	}
+
+	return TRUE;
+}
+
+/*==================================
+
+   image loading callbacks
+
+   -----------------------------------*/
+
+/* Use when the pixbuf in the view is changed, to keep a
+   reference to it and create its cairo surface. */
+static void
+update_pixbuf (EomScrollView *view, GdkPixbuf *pixbuf)
+{
+	EomScrollViewPrivate *priv;
+
+	priv = view->priv;
+
+	if (priv->pixbuf != NULL) {
+		g_object_unref (priv->pixbuf);
+		priv->pixbuf = NULL;
+	}
+
+	priv->pixbuf = pixbuf;
+
+	if (priv->surface) {
+		cairo_surface_destroy (priv->surface);
+	}
+	priv->surface = create_surface_from_pixbuf (view, priv->pixbuf);
+}
+
+static void
+image_changed_cb (EomImage *img, gpointer data)
+{
+	EomScrollViewPrivate *priv;
+
+	priv = EOM_SCROLL_VIEW (data)->priv;
+
+	update_pixbuf (EOM_SCROLL_VIEW (data), eom_image_get_pixbuf (img));
+
+	set_zoom_fit (EOM_SCROLL_VIEW (data));
+	check_scrollbar_visibility (EOM_SCROLL_VIEW (data), NULL);
+
+	gtk_widget_queue_draw (priv->display);
+}
+
+/*===================================
+         public API
+  ---------------------------------*/
+
+void
+eom_scroll_view_hide_cursor (EomScrollView *view)
+{
+       eom_scroll_view_set_cursor (view, EOM_SCROLL_VIEW_CURSOR_HIDDEN);
+}
+
+void
+eom_scroll_view_show_cursor (EomScrollView *view)
+{
+       eom_scroll_view_set_cursor (view, EOM_SCROLL_VIEW_CURSOR_NORMAL);
+}
+
+/* general properties */
+void
+eom_scroll_view_set_zoom_upscale (EomScrollView *view, gboolean upscale)
+{
+	EomScrollViewPrivate *priv;
+
+	g_return_if_fail (EOM_IS_SCROLL_VIEW (view));
+
+	priv = view->priv;
+
+	if (priv->upscale != upscale) {
+		priv->upscale = upscale;
+
+		if (priv->zoom_mode == ZOOM_MODE_FIT) {
+			set_zoom_fit (view);
+			gtk_widget_queue_draw (priv->display);
+		}
+	}
+}
+
+void
+eom_scroll_view_set_antialiasing_in (EomScrollView *view, gboolean state)
+{
+	EomScrollViewPrivate *priv;
+	cairo_filter_t new_interp_type;
+
+	g_return_if_fail (EOM_IS_SCROLL_VIEW (view));
+
+	priv = view->priv;
+
+	new_interp_type = state ? CAIRO_FILTER_GOOD : CAIRO_FILTER_NEAREST;
+
+	if (priv->interp_type_in != new_interp_type) {
+		priv->interp_type_in = new_interp_type;
+		gtk_widget_queue_draw (priv->display);
+		g_object_notify (G_OBJECT (view), "antialiasing-in");
+	}
+}
+
+void
+eom_scroll_view_set_antialiasing_out (EomScrollView *view, gboolean state)
+{
+	EomScrollViewPrivate *priv;
+	cairo_filter_t new_interp_type;
+
+	g_return_if_fail (EOM_IS_SCROLL_VIEW (view));
+
+	priv = view->priv;
+
+	new_interp_type = state ? CAIRO_FILTER_GOOD : CAIRO_FILTER_NEAREST;
+
+	if (priv->interp_type_out != new_interp_type) {
+		priv->interp_type_out = new_interp_type;
+		gtk_widget_queue_draw (priv->display);
+		g_object_notify (G_OBJECT (view), "antialiasing-out");
+
+	}
+}
+
+static void
+_transp_background_changed (EomScrollView *view)
+{
+	EomScrollViewPrivate *priv = view->priv;
+
+	if (priv->pixbuf != NULL && gdk_pixbuf_get_has_alpha (priv->pixbuf)) {
+		if (priv->background_surface) {
+			cairo_surface_destroy (priv->background_surface);
+			/* Will be recreated if needed during redraw */
+			priv->background_surface = NULL;
+		}
+		gtk_widget_queue_draw (priv->display);
+	}
+
+}
+
+void
+eom_scroll_view_set_transparency_color (EomScrollView *view, GdkRGBA *color)
+{
+	EomScrollViewPrivate *priv;
+
+	g_return_if_fail (EOM_IS_SCROLL_VIEW (view));
+
+	priv = view->priv;
+
+	if (!_eom_gdk_rgba_equal0 (&priv->transp_color, color)) {
+		priv->transp_color = *color;
+		if (priv->transp_style == EOM_TRANSP_COLOR)
+		    _transp_background_changed (view);
+
+		g_object_notify (G_OBJECT (view), "transparency-color");
+	}
+}
+
+void
+eom_scroll_view_set_transparency (EomScrollView        *view,
+				  EomTransparencyStyle  style)
+{
+	EomScrollViewPrivate *priv;
+
+	g_return_if_fail (EOM_IS_SCROLL_VIEW (view));
+
+	priv = view->priv;
+
+	if (priv->transp_style != style) {
+		priv->transp_style = style;
+		_transp_background_changed (view);
+		g_object_notify (G_OBJECT (view), "transparency-style");
+	}
+}
+
+/* zoom api */
+
+static double preferred_zoom_levels[] = {
+	1.0 / 100, 1.0 / 50, 1.0 / 20,
+	1.0 / 10.0, 1.0 / 5.0, 1.0 / 3.0, 1.0 / 2.0, 1.0 / 1.5,
+        1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0,
+        11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0
+};
+static const gint n_zoom_levels = (sizeof (preferred_zoom_levels) / sizeof (double));
+
+void
+eom_scroll_view_zoom_in (EomScrollView *view, gboolean smooth)
+{
+	EomScrollViewPrivate *priv;
+	double zoom;
+
+	g_return_if_fail (EOM_IS_SCROLL_VIEW (view));
+
+	priv = view->priv;
+
+	if (smooth) {
+		zoom = priv->zoom * priv->zoom_multiplier;
+	}
+	else {
+		int i;
+		int index = -1;
+
+		for (i = 0; i < n_zoom_levels; i++) {
+			if (preferred_zoom_levels [i] - priv->zoom
+					> DOUBLE_EQUAL_MAX_DIFF) {
+				index = i;
+				break;
+			}
+		}
+
+		if (index == -1) {
+			zoom = priv->zoom;
+		}
+		else {
+			zoom = preferred_zoom_levels [i];
+		}
+	}
+	set_zoom (view, zoom, FALSE, 0, 0);
+
+}
+
+void
+eom_scroll_view_zoom_out (EomScrollView *view, gboolean smooth)
+{
+	EomScrollViewPrivate *priv;
+	double zoom;
+
+	g_return_if_fail (EOM_IS_SCROLL_VIEW (view));
+
+	priv = view->priv;
+
+	if (smooth) {
+		zoom = priv->zoom / priv->zoom_multiplier;
+	}
+	else {
+		int i;
+		int index = -1;
+
+		for (i = n_zoom_levels - 1; i >= 0; i--) {
+			if (priv->zoom - preferred_zoom_levels [i]
+					> DOUBLE_EQUAL_MAX_DIFF) {
+				index = i;
+				break;
+			}
+		}
+		if (index == -1) {
+			zoom = priv->zoom;
+		}
+		else {
+			zoom = preferred_zoom_levels [i];
+		}
+	}
+	set_zoom (view, zoom, FALSE, 0, 0);
+}
+
+void
+eom_scroll_view_zoom_fit (EomScrollView *view)
+{
+	g_return_if_fail (EOM_IS_SCROLL_VIEW (view));
+
+	set_zoom_fit (view);
+	check_scrollbar_visibility (view, NULL);
+	gtk_widget_queue_draw (view->priv->display);
+}
+
+void
+eom_scroll_view_set_zoom (EomScrollView *view, double zoom)
+{
+	g_return_if_fail (EOM_IS_SCROLL_VIEW (view));
+
+	set_zoom (view, zoom, FALSE, 0, 0);
+}
+
+double
+eom_scroll_view_get_zoom (EomScrollView *view)
+{
+	g_return_val_if_fail (EOM_IS_SCROLL_VIEW (view), 0.0);
+
+	return view->priv->zoom;
+}
+
+gboolean
+eom_scroll_view_get_zoom_is_min (EomScrollView *view)
+{
+	g_return_val_if_fail (EOM_IS_SCROLL_VIEW (view), FALSE);
+
+	set_minimum_zoom_factor (view);
+
+	return DOUBLE_EQUAL (view->priv->zoom, MIN_ZOOM_FACTOR) ||
+	       DOUBLE_EQUAL (view->priv->zoom, view->priv->min_zoom);
+}
+
+gboolean
+eom_scroll_view_get_zoom_is_max (EomScrollView *view)
+{
+	g_return_val_if_fail (EOM_IS_SCROLL_VIEW (view), FALSE);
+
+	return DOUBLE_EQUAL (view->priv->zoom, MAX_ZOOM_FACTOR);
+}
+
+static void
+display_next_frame_cb (EomImage *image, gint delay, gpointer data)
+{
+ 	EomScrollViewPrivate *priv;
+	EomScrollView *view;
+
+	if (!EOM_IS_SCROLL_VIEW (data))
+		return;
+
+	view = EOM_SCROLL_VIEW (data);
+	priv = view->priv;
+
+	update_pixbuf (view, eom_image_get_pixbuf (image));
+	gtk_widget_queue_draw (priv->display);
+}
+
+void
+eom_scroll_view_set_image (EomScrollView *view, EomImage *image)
+{
+	EomScrollViewPrivate *priv;
+
+	g_return_if_fail (EOM_IS_SCROLL_VIEW (view));
+
+	priv = view->priv;
+
+	if (priv->image == image) {
+		return;
+	}
+
+	if (priv->image != NULL) {
+		free_image_resources (view);
+	}
+	g_assert (priv->image == NULL);
+	g_assert (priv->pixbuf == NULL);
+
+	if (image != NULL) {
+		eom_image_data_ref (image);
+
+		if (priv->pixbuf == NULL) {
+			update_pixbuf (view, eom_image_get_pixbuf (image));
+			set_zoom_fit (view);
+			check_scrollbar_visibility (view, NULL);
+			gtk_widget_queue_draw (priv->display);
+
+		}
+
+		priv->image_changed_id = g_signal_connect (image, "changed",
+		                                           G_CALLBACK (image_changed_cb),
+		                                           view);
+		if (eom_image_is_animation (image) == TRUE ) {
+			eom_image_start_animation (image);
+			priv->frame_changed_id = g_signal_connect (image, "next-frame",
+			                                           G_CALLBACK (display_next_frame_cb),
+			                                           view);
+		}
+	}
+
+	priv->image = image;
+
+	g_object_notify (G_OBJECT (view), "image");
+}
+
+/**
+ * eom_scroll_view_get_image:
+ * @view: An #EomScrollView.
+ *
+ * Gets the the currently displayed #EomImage.
+ *
+ * Returns: (transfer full): An #EomImage.
+ **/
+EomImage*
+eom_scroll_view_get_image (EomScrollView *view)
+{
+	EomImage *img;
+
+	g_return_val_if_fail (EOM_IS_SCROLL_VIEW (view), NULL);
+
+	img = view->priv->image;
+
+	if (img != NULL)
+		g_object_ref (img);
+
+	return img;
+}
+
+gboolean
+eom_scroll_view_scrollbars_visible (EomScrollView *view)
+{
+	if (!gtk_widget_get_visible (view->priv->hbar) &&
+	    !gtk_widget_get_visible (view->priv->vbar))
+		return FALSE;
+
+	return TRUE;
+}
+
+/*===================================
+    object creation/freeing
+  ---------------------------------*/
+
+static gboolean
+sv_string_to_rgba_mapping (GValue   *value,
+			    GVariant *variant,
+			    gpointer  user_data)
+{
+	GdkRGBA color;
+
+	g_return_val_if_fail (g_variant_is_of_type (variant, G_VARIANT_TYPE_STRING), FALSE);
+
+	if (gdk_rgba_parse (&color, g_variant_get_string (variant, NULL))) {
+		g_value_set_boxed (value, &color);
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+static GVariant*
+sv_rgba_to_string_mapping (const GValue       *value,
+			    const GVariantType *expected_type,
+			    gpointer            user_data)
+{
+	GVariant *variant = NULL;
+	GdkRGBA *color;
+	gchar *hex_val;
+
+	g_return_val_if_fail (G_VALUE_TYPE (value) == GDK_TYPE_RGBA, NULL);
+	g_return_val_if_fail (g_variant_type_equal (expected_type, G_VARIANT_TYPE_STRING), NULL);
+
+	color = g_value_get_boxed (value);
+	hex_val = gdk_rgba_to_string(color);
+	variant = g_variant_new_string (hex_val);
+	g_free (hex_val);
+
+	return variant;
+}
+
+static void
+eom_scroll_view_init (EomScrollView *view)
+{
+	GSettings *settings;
+	EomScrollViewPrivate *priv;
+
+	priv = view->priv = eom_scroll_view_get_instance_private (view);
+	settings = g_settings_new (EOM_CONF_VIEW);
+
+	priv->zoom = 1.0;
+	priv->min_zoom = MIN_ZOOM_FACTOR;
+	priv->zoom_mode = ZOOM_MODE_FIT;
+	priv->upscale = FALSE;
+	priv->interp_type_in = CAIRO_FILTER_GOOD;
+	priv->interp_type_out = CAIRO_FILTER_GOOD;
+	priv->scroll_wheel_zoom = FALSE;
+	priv->zoom_multiplier = IMAGE_VIEW_ZOOM_MULTIPLIER;
+	priv->image = NULL;
+	priv->pixbuf = NULL;
+	priv->surface = NULL;
+	priv->transp_style = EOM_TRANSP_BACKGROUND;
+	g_warn_if_fail (gdk_rgba_parse(&priv->transp_color, CHECK_BLACK));
+	priv->cursor = EOM_SCROLL_VIEW_CURSOR_NORMAL;
+	priv->menu = NULL;
+	priv->background_color = NULL;
+
+	priv->hadj = GTK_ADJUSTMENT (gtk_adjustment_new (0, 100, 0, 10, 10, 100));
+	g_signal_connect (priv->hadj, "value_changed",
+	                  G_CALLBACK (adjustment_changed_cb),
+	                  view);
+
+	priv->hbar = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, priv->hadj);
+	priv->vadj = GTK_ADJUSTMENT (gtk_adjustment_new (0, 100, 0, 10, 10, 100));
+	g_signal_connect (priv->vadj, "value_changed",
+	                  G_CALLBACK (adjustment_changed_cb),
+	                  view);
+
+	priv->vbar = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, priv->vadj);
+	priv->display = g_object_new (GTK_TYPE_DRAWING_AREA,
+				      "can-focus", TRUE,
+				      NULL);
+	priv->scale = gtk_widget_get_scale_factor (priv->display);
+
+	gtk_widget_add_events (priv->display,
+			       GDK_EXPOSURE_MASK
+			       | GDK_BUTTON_PRESS_MASK
+			       | GDK_BUTTON_RELEASE_MASK
+			       | GDK_POINTER_MOTION_MASK
+			       | GDK_POINTER_MOTION_HINT_MASK
+			       | GDK_SCROLL_MASK
+			       | GDK_KEY_PRESS_MASK);
+
+	g_signal_connect (priv->display, "configure_event",
+	                  G_CALLBACK (display_size_change),
+	                  view);
+
+	g_signal_connect (priv->display, "draw",
+	                  G_CALLBACK (display_draw),
+	                  view);
+
+	g_signal_connect (priv->display, "map_event",
+	                  G_CALLBACK (display_map_event),
+	                  view);
+
+	g_signal_connect (priv->display, "button_press_event",
+	                  G_CALLBACK (eom_scroll_view_button_press_event),
+	                  view);
+
+	g_signal_connect (priv->display, "motion_notify_event",
+	                  G_CALLBACK (eom_scroll_view_motion_event),
+	                  view);
+
+	g_signal_connect (priv->display, "button_release_event",
+	                  G_CALLBACK (eom_scroll_view_button_release_event),
+	                  view);
+
+	g_signal_connect (priv->display, "scroll_event",
+	                  G_CALLBACK (eom_scroll_view_scroll_event),
+	                  view);
+
+	g_signal_connect (priv->display, "focus_in_event",
+	                  G_CALLBACK (eom_scroll_view_focus_in_event),
+	                  NULL);
+
+	g_signal_connect (priv->display, "focus_out_event",
+	                  G_CALLBACK (eom_scroll_view_focus_out_event),
+	                  NULL);
+
+	g_signal_connect (view, "key_press_event",
+	                  G_CALLBACK (display_key_press_event),
+	                  view);
+
+	gtk_drag_source_set (priv->display, GDK_BUTTON1_MASK,
+			     target_table, G_N_ELEMENTS (target_table),
+			     GDK_ACTION_COPY | GDK_ACTION_MOVE |
+			     GDK_ACTION_LINK | GDK_ACTION_ASK);
+
+	g_signal_connect (priv->display, "drag-data-get",
+	                  G_CALLBACK (view_on_drag_data_get_cb),
+	                  view);
+
+	g_signal_connect (priv->display, "drag-begin",
+	                  G_CALLBACK (view_on_drag_begin_cb),
+	                  view);
+
+	gtk_grid_attach (GTK_GRID (view), priv->display,
+					 0, 0, 1, 1);
+	gtk_widget_set_hexpand (priv->display, TRUE);
+	gtk_widget_set_vexpand (priv->display, TRUE);
+	gtk_grid_attach (GTK_GRID (view), priv->hbar,
+					 0, 1, 1, 1);
+	gtk_widget_set_hexpand (priv->hbar, TRUE);
+	gtk_grid_attach (GTK_GRID (view), priv->vbar,
+					 1, 0, 1, 1);
+	gtk_widget_set_vexpand (priv->vbar, TRUE);
+
+	g_settings_bind (settings, EOM_CONF_VIEW_USE_BG_COLOR, view,
+			 "use-background-color", G_SETTINGS_BIND_DEFAULT);
+	g_settings_bind_with_mapping (settings, EOM_CONF_VIEW_BACKGROUND_COLOR,
+				      view, "background-color",
+				      G_SETTINGS_BIND_DEFAULT,
+				      sv_string_to_rgba_mapping,
+				      sv_rgba_to_string_mapping, NULL, NULL);
+	g_settings_bind (settings, EOM_CONF_VIEW_EXTRAPOLATE, view,
+			 "antialiasing-in", G_SETTINGS_BIND_GET);
+	g_settings_bind (settings, EOM_CONF_VIEW_INTERPOLATE, view,
+			 "antialiasing-out", G_SETTINGS_BIND_GET);
+	g_settings_bind_with_mapping (settings, EOM_CONF_VIEW_TRANS_COLOR,
+				      view, "transparency-color",
+				      G_SETTINGS_BIND_GET,
+				      sv_string_to_rgba_mapping,
+				      sv_rgba_to_string_mapping, NULL, NULL);
+	g_settings_bind (settings, EOM_CONF_VIEW_TRANSPARENCY, view,
+			 "transparency-style", G_SETTINGS_BIND_GET);
+
+	g_object_unref (settings);
+
+	priv->override_bg_color = NULL;
+	priv->background_surface = NULL;
+}
+
+static void
+eom_scroll_view_dispose (GObject *object)
+{
+	EomScrollView *view;
+	EomScrollViewPrivate *priv;
+
+	g_return_if_fail (EOM_IS_SCROLL_VIEW (object));
+
+	view = EOM_SCROLL_VIEW (object);
+	priv = view->priv;
+
+	_clear_hq_redraw_timeout (view);
+
+	if (priv->idle_id != 0) {
+		g_source_remove (priv->idle_id);
+		priv->idle_id = 0;
+	}
+
+	if (priv->background_color != NULL) {
+		gdk_rgba_free (priv->background_color);
+		priv->background_color = NULL;
+	}
+
+	if (priv->override_bg_color != NULL) {
+		gdk_rgba_free (priv->override_bg_color);
+		priv->override_bg_color = NULL;
+	}
+
+	if (priv->background_surface != NULL) {
+		cairo_surface_destroy (priv->background_surface);
+		priv->background_surface = NULL;
+	}
+
+	free_image_resources (view);
+
+	G_OBJECT_CLASS (eom_scroll_view_parent_class)->dispose (object);
+}
+
+static void
+eom_scroll_view_get_property (GObject *object, guint property_id,
+			      GValue *value, GParamSpec *pspec)
+{
+	EomScrollView *view;
+	EomScrollViewPrivate *priv;
+
+	g_return_if_fail (EOM_IS_SCROLL_VIEW (object));
+
+	view = EOM_SCROLL_VIEW (object);
+	priv = view->priv;
+
+	switch (property_id) {
+	case PROP_ANTIALIAS_IN:
+	{
+		gboolean filter = (priv->interp_type_in != CAIRO_FILTER_NEAREST);
+		g_value_set_boolean (value, filter);
+		break;
+	}
+	case PROP_ANTIALIAS_OUT:
+	{
+		gboolean filter = (priv->interp_type_out != CAIRO_FILTER_NEAREST);
+		g_value_set_boolean (value, filter);
+		break;
+	}
+	case PROP_USE_BG_COLOR:
+		g_value_set_boolean (value, priv->use_bg_color);
+		break;
+	case PROP_BACKGROUND_COLOR:
+		//FIXME: This doesn't really handle the NULL color.
+		g_value_set_boxed (value, priv->background_color);
+		break;
+	case PROP_SCROLLWHEEL_ZOOM:
+		g_value_set_boolean (value, priv->scroll_wheel_zoom);
+		break;
+	case PROP_TRANSPARENCY_STYLE:
+		g_value_set_enum (value, priv->transp_style);
+		break;
+	case PROP_ZOOM_MULTIPLIER:
+		g_value_set_double (value, priv->zoom_multiplier);
+		break;
+	case PROP_IMAGE:
+		g_value_set_object (value, priv->image);
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+	}
+}
+
+static void
+eom_scroll_view_set_property (GObject *object, guint property_id,
+			      const GValue *value, GParamSpec *pspec)
+{
+	EomScrollView *view;
+
+	g_return_if_fail (EOM_IS_SCROLL_VIEW (object));
+
+	view = EOM_SCROLL_VIEW (object);
+
+	switch (property_id) {
+	case PROP_ANTIALIAS_IN:
+		eom_scroll_view_set_antialiasing_in (view, g_value_get_boolean (value));
+		break;
+	case PROP_ANTIALIAS_OUT:
+		eom_scroll_view_set_antialiasing_out (view, g_value_get_boolean (value));
+		break;
+	case PROP_USE_BG_COLOR:
+		eom_scroll_view_set_use_bg_color (view, g_value_get_boolean (value));
+		break;
+	case PROP_BACKGROUND_COLOR:
+	{
+		const GdkRGBA *color = g_value_get_boxed (value);
+		eom_scroll_view_set_background_color (view, color);
+		break;
+	}
+	case PROP_SCROLLWHEEL_ZOOM:
+		eom_scroll_view_set_scroll_wheel_zoom (view, g_value_get_boolean (value));
+		break;
+	case PROP_TRANSP_COLOR:
+		eom_scroll_view_set_transparency_color (view, g_value_get_boxed (value));
+		break;
+	case PROP_TRANSPARENCY_STYLE:
+		eom_scroll_view_set_transparency (view, g_value_get_enum (value));
+		break;
+	case PROP_ZOOM_MULTIPLIER:
+		eom_scroll_view_set_zoom_multiplier (view, g_value_get_double (value));
+		break;
+	case PROP_IMAGE:
+		eom_scroll_view_set_image (view, g_value_get_object (value));
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+	}
+}
+
+static void
+eom_scroll_view_class_init (EomScrollViewClass *klass)
+{
+	GObjectClass *gobject_class;
+	GtkWidgetClass *widget_class;
+
+	gobject_class = (GObjectClass*) klass;
+	widget_class = (GtkWidgetClass*) klass;
+
+	gobject_class->dispose = eom_scroll_view_dispose;
+        gobject_class->set_property = eom_scroll_view_set_property;
+        gobject_class->get_property = eom_scroll_view_get_property;
+
+	g_object_class_install_property (
+		gobject_class, PROP_ANTIALIAS_IN,
+		g_param_spec_boolean ("antialiasing-in", NULL, NULL, TRUE,
+				      G_PARAM_READWRITE | G_PARAM_STATIC_NAME));
+
+	g_object_class_install_property (
+		gobject_class, PROP_ANTIALIAS_OUT,
+		g_param_spec_boolean ("antialiasing-out", NULL, NULL, TRUE,
+				      G_PARAM_READWRITE | G_PARAM_STATIC_NAME));
+
+	/**
+	 * EomScrollView:background-color:
+	 *
+	 * This is the default background color used for painting the background
+	 * of the image view. If set to %NULL the color is determined by the
+	 * active GTK theme.
+	 */
+	g_object_class_install_property (
+		gobject_class, PROP_BACKGROUND_COLOR,
+		g_param_spec_boxed ("background-color", NULL, NULL,
+				    GDK_TYPE_RGBA,
+				    G_PARAM_READWRITE | G_PARAM_STATIC_NAME));
+
+	g_object_class_install_property (
+		gobject_class, PROP_USE_BG_COLOR,
+		g_param_spec_boolean ("use-background-color", NULL, NULL, FALSE,
+				      G_PARAM_READWRITE | G_PARAM_STATIC_NAME));
+
+	/**
+	 * EomScrollView:zoom-multiplier:
+	 *
+	 * The current zoom factor is multiplied with this value + 1.0 when
+	 * scrolling with the scrollwheel to determine the next zoom factor.
+	 */
+	g_object_class_install_property (
+		gobject_class, PROP_ZOOM_MULTIPLIER,
+		g_param_spec_double ("zoom-multiplier", NULL, NULL,
+				     -G_MAXDOUBLE, G_MAXDOUBLE -1.0, 0.05,
+				     G_PARAM_READWRITE | G_PARAM_STATIC_NAME));
+
+	/**
+	 * EomScrollView:scrollwheel-zoom:
+	 *
+	 * If %TRUE the scrollwheel will zoom the view, otherwise it will be
+	 * used for scrolling a zoomed image.
+	 */
+	g_object_class_install_property (
+		gobject_class, PROP_SCROLLWHEEL_ZOOM,
+		g_param_spec_boolean ("scrollwheel-zoom", NULL, NULL, TRUE,
+		G_PARAM_READWRITE | G_PARAM_STATIC_NAME));
+
+	/**
+	 * EomScrollView:image:
+	 *
+	 * This is the currently display #EomImage.
+	 */
+	g_object_class_install_property (
+		gobject_class, PROP_IMAGE,
+		g_param_spec_object ("image", NULL, NULL, EOM_TYPE_IMAGE,
+				     G_PARAM_READWRITE | G_PARAM_STATIC_NAME));
+
+	/**
+	 * EomScrollView:transparency-color:
+	 *
+	 * This is the color used to fill the transparent parts of an image
+	 * if :transparency-style is set to use a custom color.
+	 */
+	g_object_class_install_property (
+		gobject_class, PROP_TRANSP_COLOR,
+		g_param_spec_boxed ("transparency-color", NULL, NULL,
+				    GDK_TYPE_RGBA,
+				    G_PARAM_WRITABLE | G_PARAM_STATIC_NAME));
+
+	/**
+	 * EomScrollView:transparency-style:
+	 *
+	 * Determines how to fill the shown image's transparent areas.
+	 */
+	g_object_class_install_property (
+		gobject_class, PROP_TRANSPARENCY_STYLE,
+		g_param_spec_enum ("transparency-style", NULL, NULL,
+				   EOM_TYPE_TRANSPARENCY_STYLE,
+				   EOM_TRANSP_CHECKED,
+				   G_PARAM_READWRITE | G_PARAM_STATIC_NAME));
+
+	view_signals [SIGNAL_ZOOM_CHANGED] =
+		g_signal_new ("zoom_changed",
+			      EOM_TYPE_SCROLL_VIEW,
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (EomScrollViewClass, zoom_changed),
+			      NULL, NULL,
+			      eom_marshal_VOID__DOUBLE,
+			      G_TYPE_NONE, 1,
+			      G_TYPE_DOUBLE);
+
+	widget_class->size_allocate = eom_scroll_view_size_allocate;
+}
+
+static void
+view_on_drag_begin_cb (GtkWidget        *widget,
+		       GdkDragContext   *context,
+		       gpointer          user_data)
+{
+	EomScrollView *view;
+	EomImage *image;
+	GdkPixbuf *thumbnail;
+	gint width, height;
+
+	view = EOM_SCROLL_VIEW (user_data);
+	image = view->priv->image;
+
+	thumbnail = eom_image_get_thumbnail (image);
+
+	if  (thumbnail) {
+		width = gdk_pixbuf_get_width (thumbnail) / view->priv->scale;
+		height = gdk_pixbuf_get_height (thumbnail) / view->priv->scale;
+		gtk_drag_set_icon_pixbuf (context, thumbnail, width/2, height/2);
+		g_object_unref (thumbnail);
+	}
+}
+
+static void
+view_on_drag_data_get_cb (GtkWidget        *widget,
+			  GdkDragContext   *drag_context,
+			  GtkSelectionData *data,
+			  guint             info,
+			  guint             time,
+			  gpointer          user_data)
+{
+	EomScrollView *view;
+	EomImage *image;
+	gchar *uris[2];
+	GFile *file;
+
+	view = EOM_SCROLL_VIEW (user_data);
+
+	image = view->priv->image;
+
+	file = eom_image_get_file (image);
+	uris[0] = g_file_get_uri (file);
+	uris[1] = NULL;
+
+	gtk_selection_data_set_uris (data, uris);
+
+	g_free (uris[0]);
+	g_object_unref (file);
+}
+
+GtkWidget*
+eom_scroll_view_new (void)
+{
+	GtkWidget *widget;
+
+	widget = g_object_new (EOM_TYPE_SCROLL_VIEW,
+			       "can-focus", TRUE,
+			       "row-homogeneous", FALSE,
+			       "column-homogeneous", FALSE,
+			       NULL);
+
+	return widget;
+}
+
+static gboolean
+view_on_button_press_event_cb (GtkWidget *widget, GdkEventButton *event,
+			       gpointer user_data)
+{
+    EomScrollView *view = EOM_SCROLL_VIEW (widget);
+
+    /* Ignore double-clicks and triple-clicks */
+    if (event->button == 3 && event->type == GDK_BUTTON_PRESS)
+    {
+	    gtk_menu_popup_at_pointer (GTK_MENU (view->priv->menu),
+	                               (const GdkEvent*) event);
+
+	    return TRUE;
+    }
+
+    return FALSE;
+}
+
+void
+eom_scroll_view_set_popup (EomScrollView *view,
+			   GtkMenu *menu)
+{
+	g_return_if_fail (EOM_IS_SCROLL_VIEW (view));
+	g_return_if_fail (view->priv->menu == NULL);
+
+	view->priv->menu = g_object_ref (GTK_WIDGET (menu));
+
+	gtk_menu_attach_to_widget (GTK_MENU (view->priv->menu),
+				   GTK_WIDGET (view),
+				   NULL);
+
+	g_signal_connect (view, "button_press_event",
+	                  G_CALLBACK (view_on_button_press_event_cb),
+	                  NULL);
+}
+
+static gboolean
+_eom_gdk_rgba_equal0 (const GdkRGBA *a, const GdkRGBA *b)
+{
+	if (a == NULL || b == NULL)
+		return (a == b);
+
+	return gdk_rgba_equal (a, b);
+}
+
+static gboolean
+_eom_replace_gdk_rgba (GdkRGBA **dest, const GdkRGBA *src)
+{
+	GdkRGBA *old = *dest;
+
+	if (_eom_gdk_rgba_equal0 (old, src))
+		return FALSE;
+
+	if (old != NULL)
+		gdk_rgba_free (old);
+
+	*dest = (src) ? gdk_rgba_copy (src) : NULL;
+
+	return TRUE;
+}
+
+static void
+_eom_scroll_view_update_bg_color (EomScrollView *view)
+{
+	EomScrollViewPrivate *priv = view->priv;
+
+	if (priv->transp_style == EOM_TRANSP_BACKGROUND
+	    && priv->background_surface != NULL) {
+		/* Delete the SVG background to have it recreated with
+		 * the correct color during the next SVG redraw */
+		cairo_surface_destroy (priv->background_surface);
+		priv->background_surface = NULL;
+	}
+
+	gtk_widget_queue_draw (priv->display);
+}
+
+void
+eom_scroll_view_set_background_color (EomScrollView *view,
+				      const GdkRGBA *color)
+{
+	g_return_if_fail (EOM_IS_SCROLL_VIEW (view));
+
+	if (_eom_replace_gdk_rgba (&view->priv->background_color, color))
+		_eom_scroll_view_update_bg_color (view);
+}
+
+void
+eom_scroll_view_override_bg_color (EomScrollView *view,
+				   const GdkRGBA *color)
+{
+	g_return_if_fail (EOM_IS_SCROLL_VIEW (view));
+
+	if (_eom_replace_gdk_rgba (&view->priv->override_bg_color, color))
+		_eom_scroll_view_update_bg_color (view);
+}
+
+void
+eom_scroll_view_set_use_bg_color (EomScrollView *view, gboolean use)
+{
+	EomScrollViewPrivate *priv;
+
+	g_return_if_fail (EOM_IS_SCROLL_VIEW (view));
+
+	priv = view->priv;
+
+	if (use != priv->use_bg_color) {
+		priv->use_bg_color = use;
+
+		_eom_scroll_view_update_bg_color (view);
+
+		g_object_notify (G_OBJECT (view), "use-background-color");
+	}
+}
+
+void
+eom_scroll_view_set_scroll_wheel_zoom (EomScrollView *view,
+				       gboolean       scroll_wheel_zoom)
+{
+	g_return_if_fail (EOM_IS_SCROLL_VIEW (view));
+
+	if (view->priv->scroll_wheel_zoom != scroll_wheel_zoom) {
+		view->priv->scroll_wheel_zoom = scroll_wheel_zoom;
+		g_object_notify (G_OBJECT (view), "scrollwheel-zoom");
+	}
+}
+
+void
+eom_scroll_view_set_zoom_multiplier (EomScrollView *view,
+				     gdouble        zoom_multiplier)
+{
+	g_return_if_fail (EOM_IS_SCROLL_VIEW (view));
+
+        view->priv->zoom_multiplier = 1.0 + zoom_multiplier;
+
+	g_object_notify (G_OBJECT (view), "zoom-multiplier");
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/83.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/83.html new file mode 100644 index 0000000..c90587f --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/83.html @@ -0,0 +1,313 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/* Eye of Mate image viewer - utility functions for computing zoom factors
+ *
+ * Copyright (C) 2000 The Free Software Foundation
+ *
+ * Author: Federico Mena-Quintero <federico@gnu.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef ZOOM_H
+#define ZOOM_H
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_GNUC_INTERNAL
+void zoom_fit_size (guint dest_width, guint dest_height,
+		    guint src_width, guint src_height,
+		    gboolean upscale_smaller,
+		    guint *width, guint *height);
+
+G_GNUC_INTERNAL
+double zoom_fit_scale (guint dest_width, guint dest_height,
+		       guint src_width, guint src_height,
+		       gboolean upscale_smaller);
+
+#endif
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/84.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/84.html new file mode 100644 index 0000000..a17e6e9 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/84.html @@ -0,0 +1,341 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/* Eye Of Mate - Session Handler
+ *
+ * Copyright (C) 2006 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on gedit code (gedit/gedit-session.h) by:
+ * 	- Gedit Team
+ * 	- Federico Mena-Quintero <federico@ximian.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include "eom-session.h"
+#include "eom-window.h"
+#include "eom-application.h"
+
+void
+eom_session_init (EomApplication *application)
+{
+	g_return_if_fail (EOM_IS_APPLICATION (application));
+
+	/* FIXME: Session management is currently a no-op in eom. */
+}
+
+gboolean
+eom_session_is_restored	(void)
+{
+	return FALSE;
+}
+
+gboolean
+eom_session_load (void)
+{
+	return TRUE;
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/85.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/85.html new file mode 100644 index 0000000..149795b --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/85.html @@ -0,0 +1,1415 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye of Mate - Side bar
+ *
+ * Copyright (C) 2004 Red Hat, Inc.
+ * Copyright (C) 2007 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on evince code (shell/ev-sidebar.c) by:
+ * 	- Jonathan Blandford <jrb@alum.mit.edu>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"<--- Include file: "config.h" not found.
+#endif
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gdk/gdkkeysyms.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "eom-sidebar.h"
+
+enum {
+	PROP_0,
+	PROP_CURRENT_PAGE
+};
+
+enum {
+	PAGE_COLUMN_TITLE,
+	PAGE_COLUMN_MENU_ITEM,
+	PAGE_COLUMN_MAIN_WIDGET,
+	PAGE_COLUMN_NOTEBOOK_INDEX,
+	PAGE_COLUMN_NUM_COLS
+};
+
+enum {
+	SIGNAL_PAGE_ADDED,
+	SIGNAL_PAGE_REMOVED,
+	SIGNAL_LAST
+};
+
+static guint signals[SIGNAL_LAST] = { 0 };
+
+struct _EomSidebarPrivate {
+	GtkWidget *notebook;
+	GtkWidget *select_button;
+	GtkWidget *menu;
+	GtkWidget *hbox;
+	GtkWidget *label;
+	GtkWidget *arrow;
+
+	GtkTreeModel *page_model;
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (EomSidebar, eom_sidebar, GTK_TYPE_BOX)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
+
+static void
+eom_sidebar_destroy (GtkWidget *object)
+{
+	EomSidebar *eom_sidebar = EOM_SIDEBAR (object);
+
+	if (eom_sidebar->priv->menu) {
+		gtk_menu_detach (GTK_MENU (eom_sidebar->priv->menu));
+		eom_sidebar->priv->menu = NULL;
+	}
+
+	if (eom_sidebar->priv->page_model) {
+		g_object_unref (eom_sidebar->priv->page_model);
+		eom_sidebar->priv->page_model = NULL;
+	}
+
+	(* GTK_WIDGET_CLASS (eom_sidebar_parent_class)->destroy) (object);
+}
+
+static void
+eom_sidebar_select_page (EomSidebar *eom_sidebar, GtkTreeIter *iter)
+{
+	gchar *title;
+	gint index;
+
+	gtk_tree_model_get (eom_sidebar->priv->page_model, iter,
+			    PAGE_COLUMN_TITLE, &title,
+			    PAGE_COLUMN_NOTEBOOK_INDEX, &index,
+			    -1);
+
+	gtk_notebook_set_current_page (GTK_NOTEBOOK (eom_sidebar->priv->notebook), index);
+	gtk_label_set_text (GTK_LABEL (eom_sidebar->priv->label), title);
+
+	g_free (title);
+}
+
+void
+eom_sidebar_set_page (EomSidebar   *eom_sidebar,
+		     GtkWidget   *main_widget)
+{
+	GtkTreeIter iter;
+	gboolean valid;
+
+	valid = gtk_tree_model_get_iter_first (eom_sidebar->priv->page_model, &iter);
+
+	while (valid) {
+		GtkWidget *widget;
+
+		gtk_tree_model_get (eom_sidebar->priv->page_model, &iter,
+				    PAGE_COLUMN_MAIN_WIDGET, &widget,
+				    -1);
+
+		if (widget == main_widget) {
+			eom_sidebar_select_page (eom_sidebar, &iter);
+			valid = FALSE;
+		} else {
+			valid = gtk_tree_model_iter_next (eom_sidebar->priv->page_model, &iter);
+		}
+
+		g_object_unref (widget);
+	}
+
+	g_object_notify (G_OBJECT (eom_sidebar), "current-page");
+}
+
+static GtkWidget *
+eom_sidebar_get_current_page (EomSidebar *sidebar)
+{
+	GtkNotebook *notebook = GTK_NOTEBOOK (sidebar->priv->notebook);
+
+	return gtk_notebook_get_nth_page
+		(notebook, gtk_notebook_get_current_page (notebook));
+}
+
+static void
+eom_sidebar_set_property (GObject     *object,
+		         guint         prop_id,
+		         const GValue *value,
+		         GParamSpec   *pspec)
+{
+	EomSidebar *sidebar = EOM_SIDEBAR (object);
+
+	switch (prop_id) {
+	case PROP_CURRENT_PAGE:
+		eom_sidebar_set_page (sidebar, g_value_get_object (value));
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+	}
+}
+
+static void
+eom_sidebar_get_property (GObject    *object,
+		          guint       prop_id,
+		          GValue     *value,
+		          GParamSpec *pspec)
+{
+	EomSidebar *sidebar = EOM_SIDEBAR (object);
+
+	switch (prop_id) {
+	case PROP_CURRENT_PAGE:
+		g_value_set_object (value, eom_sidebar_get_current_page (sidebar));
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+	}
+}
+
+static void
+eom_sidebar_class_init (EomSidebarClass *eom_sidebar_class)
+{
+	GObjectClass *g_object_class;
+	GtkWidgetClass *widget_class;
+
+	g_object_class = G_OBJECT_CLASS (eom_sidebar_class);
+	widget_class = GTK_WIDGET_CLASS (eom_sidebar_class);
+
+	widget_class->destroy = eom_sidebar_destroy;
+	g_object_class->get_property = eom_sidebar_get_property;
+	g_object_class->set_property = eom_sidebar_set_property;
+
+	g_object_class_install_property (g_object_class,
+					 PROP_CURRENT_PAGE,
+					 g_param_spec_object ("current-page",
+							      "Current page",
+							      "The currently visible page",
+							      GTK_TYPE_WIDGET,
+							      G_PARAM_READWRITE));
+
+	signals[SIGNAL_PAGE_ADDED] =
+		g_signal_new ("page-added",
+			      EOM_TYPE_SIDEBAR,
+			      G_SIGNAL_RUN_FIRST,
+			      G_STRUCT_OFFSET (EomSidebarClass, page_added),
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__OBJECT,
+			      G_TYPE_NONE,
+			      1,
+			      GTK_TYPE_WIDGET);
+
+	signals[SIGNAL_PAGE_REMOVED] =
+		g_signal_new ("page-removed",
+			      EOM_TYPE_SIDEBAR,
+			      G_SIGNAL_RUN_FIRST,
+			      G_STRUCT_OFFSET (EomSidebarClass, page_removed),
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__OBJECT,
+			      G_TYPE_NONE,
+			      1,
+			      GTK_TYPE_WIDGET);
+}
+
+static gboolean
+eom_sidebar_select_button_press_cb (GtkWidget      *widget,
+				    GdkEventButton *event,
+				    gpointer        user_data)
+{
+	EomSidebar *eom_sidebar = EOM_SIDEBAR (user_data);
+
+	if (event->button == 1) {
+		GtkRequisition requisition;
+		GtkAllocation allocation;
+
+		gtk_widget_get_allocation (widget, &allocation);
+
+		gtk_widget_set_size_request (eom_sidebar->priv->menu, -1, -1);
+		gtk_widget_get_preferred_size (eom_sidebar->priv->menu, &requisition, NULL);
+		gtk_widget_set_size_request (eom_sidebar->priv->menu,
+					     MAX (allocation.width,
+						  requisition.width), -1);
+
+		gtk_widget_grab_focus (widget);
+
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
+
+		gtk_menu_popup_at_widget (GTK_MENU (eom_sidebar->priv->menu),
+		                          widget,
+		                          GDK_GRAVITY_SOUTH_WEST,
+		                          GDK_GRAVITY_NORTH_WEST,
+		                          (const GdkEvent*) event);
+
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+static gboolean
+eom_sidebar_select_button_key_press_cb (GtkWidget   *widget,
+				        GdkEventKey *event,
+				        gpointer     user_data)
+{
+	EomSidebar *eom_sidebar = EOM_SIDEBAR (user_data);
+
+	if (event->keyval == GDK_KEY_space ||
+	    event->keyval == GDK_KEY_KP_Space ||
+	    event->keyval == GDK_KEY_Return ||
+	    event->keyval == GDK_KEY_KP_Enter) {
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
+
+		gtk_menu_popup_at_widget (GTK_MENU (eom_sidebar->priv->menu),
+		                          widget,
+		                          GDK_GRAVITY_SOUTH_WEST,
+		                          GDK_GRAVITY_NORTH_WEST,
+		                          (const GdkEvent*) event);
+
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+static void
+eom_sidebar_close_clicked_cb (GtkWidget *widget,
+ 			      gpointer   user_data)
+{
+	EomSidebar *eom_sidebar = EOM_SIDEBAR (user_data);
+
+	gtk_widget_hide (GTK_WIDGET (eom_sidebar));
+}
+
+static void
+eom_sidebar_menu_deactivate_cb (GtkWidget *widget,
+			       gpointer   user_data)
+{
+	GtkWidget *menu_button;
+
+	menu_button = GTK_WIDGET (user_data);
+
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (menu_button), FALSE);
+}
+
+static void
+eom_sidebar_menu_detach_cb (GtkWidget *widget,
+			   GtkMenu   *menu)
+{
+	EomSidebar *eom_sidebar = EOM_SIDEBAR (widget);
+
+	eom_sidebar->priv->menu = NULL;
+}
+
+static void
+eom_sidebar_menu_item_activate_cb (GtkWidget *widget,
+				   gpointer   user_data)
+{
+	EomSidebar *eom_sidebar = EOM_SIDEBAR (user_data);
+	GtkTreeIter iter;
+	GtkWidget *menu_item, *item;
+	gboolean valid;
+
+	menu_item = gtk_menu_get_active (GTK_MENU (eom_sidebar->priv->menu));
+	valid = gtk_tree_model_get_iter_first (eom_sidebar->priv->page_model, &iter);
+
+	while (valid) {
+		gtk_tree_model_get (eom_sidebar->priv->page_model, &iter,
+				    PAGE_COLUMN_MENU_ITEM, &item,
+				    -1);
+
+		if (item == menu_item) {
+			eom_sidebar_select_page (eom_sidebar, &iter);
+			valid = FALSE;
+		} else {
+			valid = gtk_tree_model_iter_next (eom_sidebar->priv->page_model, &iter);
+		}
+
+		g_object_unref (item);
+	}
+
+	g_object_notify (G_OBJECT (eom_sidebar), "current-page");
+}
+
+static void
+eom_sidebar_update_arrow_visibility (EomSidebar *sidebar)
+{
+	EomSidebarPrivate *priv = sidebar->priv;
+	const gint n_pages = eom_sidebar_get_n_pages (sidebar);
+
+	gtk_widget_set_visible (GTK_WIDGET (priv->arrow),
+				n_pages > 1);
+}
+
+static void
+eom_sidebar_init (EomSidebar *eom_sidebar)
+{
+	GtkWidget *hbox;
+	GtkWidget *close_button;
+	GtkWidget *select_hbox;
+	GtkWidget *arrow;
+	GtkWidget *image;
+
+	eom_sidebar->priv = eom_sidebar_get_instance_private (eom_sidebar);
+
+	gtk_style_context_add_class (
+	        gtk_widget_get_style_context (GTK_WIDGET (eom_sidebar)),
+	                                      GTK_STYLE_CLASS_SIDEBAR);
+
+	/* data model */
+	eom_sidebar->priv->page_model = (GtkTreeModel *)
+			gtk_list_store_new (PAGE_COLUMN_NUM_COLS,
+					    G_TYPE_STRING,
+					    GTK_TYPE_WIDGET,
+					    GTK_TYPE_WIDGET,
+					    G_TYPE_INT);
+
+	/* top option menu */
+	hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+	g_object_set (hbox, "border-width", 6, NULL);
+	eom_sidebar->priv->hbox = hbox;
+	gtk_box_pack_start (GTK_BOX (eom_sidebar), hbox, FALSE, FALSE, 0);
+	gtk_widget_show (hbox);
+
+	eom_sidebar->priv->select_button = gtk_toggle_button_new ();
+	gtk_button_set_relief (GTK_BUTTON (eom_sidebar->priv->select_button),
+			       GTK_RELIEF_NONE);
+
+	g_signal_connect (eom_sidebar->priv->select_button, "button_press_event",
+	                  G_CALLBACK (eom_sidebar_select_button_press_cb),
+	                  eom_sidebar);
+
+	g_signal_connect (eom_sidebar->priv->select_button, "key_press_event",
+	                  G_CALLBACK (eom_sidebar_select_button_key_press_cb),
+	                  eom_sidebar);
+
+	select_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+
+	eom_sidebar->priv->label = gtk_label_new ("");
+	gtk_widget_set_name (eom_sidebar->priv->label, "eom-sidebar-title");
+
+	gtk_box_pack_start (GTK_BOX (select_hbox),
+			    eom_sidebar->priv->label,
+			    FALSE, FALSE, 0);
+
+	gtk_widget_show (eom_sidebar->priv->label);
+
+	arrow = gtk_image_new_from_icon_name ("pan-down-symbolic", GTK_ICON_SIZE_BUTTON);
+	gtk_box_pack_end (GTK_BOX (select_hbox), arrow, FALSE, FALSE, 0);
+	eom_sidebar->priv->arrow = arrow;
+	gtk_widget_set_visible (arrow, FALSE);
+
+	gtk_container_add (GTK_CONTAINER (eom_sidebar->priv->select_button), select_hbox);
+	gtk_widget_show (select_hbox);
+
+	gtk_box_set_center_widget (GTK_BOX (hbox), eom_sidebar->priv->select_button);
+	gtk_widget_show (eom_sidebar->priv->select_button);
+
+	close_button = gtk_button_new ();
+
+	gtk_button_set_relief (GTK_BUTTON (close_button), GTK_RELIEF_NONE);
+
+	g_signal_connect (close_button, "clicked",
+	                  G_CALLBACK (eom_sidebar_close_clicked_cb),
+	                  eom_sidebar);
+
+	image = gtk_image_new_from_icon_name ("window-close",
+					  GTK_ICON_SIZE_MENU);
+	gtk_container_add (GTK_CONTAINER (close_button), image);
+	gtk_widget_show (image);
+
+	gtk_box_pack_end (GTK_BOX (hbox), close_button, FALSE, FALSE, 0);
+	gtk_widget_show (close_button);
+
+	eom_sidebar->priv->menu = gtk_menu_new ();
+
+	g_signal_connect (eom_sidebar->priv->menu, "deactivate",
+	                  G_CALLBACK (eom_sidebar_menu_deactivate_cb),
+	                  eom_sidebar->priv->select_button);
+
+	gtk_menu_attach_to_widget (GTK_MENU (eom_sidebar->priv->menu),
+				   GTK_WIDGET (eom_sidebar),
+				   eom_sidebar_menu_detach_cb);
+
+	gtk_widget_show (eom_sidebar->priv->menu);
+
+	eom_sidebar->priv->notebook = gtk_notebook_new ();
+
+	gtk_notebook_set_show_border (GTK_NOTEBOOK (eom_sidebar->priv->notebook), FALSE);
+	gtk_notebook_set_show_tabs (GTK_NOTEBOOK (eom_sidebar->priv->notebook), FALSE);
+
+	gtk_box_pack_start (GTK_BOX (eom_sidebar), eom_sidebar->priv->notebook,
+			    TRUE, TRUE, 0);
+
+	gtk_widget_show (eom_sidebar->priv->notebook);
+}
+
+GtkWidget *
+eom_sidebar_new (void)
+{
+	GtkWidget *eom_sidebar;
+
+	eom_sidebar = g_object_new (EOM_TYPE_SIDEBAR,
+	                            "orientation", GTK_ORIENTATION_VERTICAL,
+	                            NULL);
+
+	return eom_sidebar;
+}
+
+void
+eom_sidebar_add_page (EomSidebar   *eom_sidebar,
+		      const gchar  *title,
+		      GtkWidget    *main_widget)
+{
+	GtkTreeIter iter;
+	GtkWidget *menu_item;
+	gchar *label_title;
+	gint index;
+
+	g_return_if_fail (EOM_IS_SIDEBAR (eom_sidebar));
+	g_return_if_fail (GTK_IS_WIDGET (main_widget));
+
+	index = gtk_notebook_append_page (GTK_NOTEBOOK (eom_sidebar->priv->notebook),
+					  main_widget, NULL);
+
+	menu_item = gtk_menu_item_new_with_label (title);
+
+	g_signal_connect (menu_item, "activate",
+	                  G_CALLBACK (eom_sidebar_menu_item_activate_cb),
+	                  eom_sidebar);
+
+	gtk_widget_show (menu_item);
+
+	gtk_menu_shell_append (GTK_MENU_SHELL (eom_sidebar->priv->menu),
+			       menu_item);
+
+	/* Insert and move to end */
+	gtk_list_store_insert_with_values (GTK_LIST_STORE (eom_sidebar->priv->page_model),
+					   &iter, 0,
+					   PAGE_COLUMN_TITLE, title,
+					   PAGE_COLUMN_MENU_ITEM, menu_item,
+					   PAGE_COLUMN_MAIN_WIDGET, main_widget,
+					   PAGE_COLUMN_NOTEBOOK_INDEX, index,
+					   -1);
+
+	gtk_list_store_move_before (GTK_LIST_STORE(eom_sidebar->priv->page_model),
+				    &iter,
+				    NULL);
+
+	/* Set the first item added as active */
+	gtk_tree_model_get_iter_first (eom_sidebar->priv->page_model, &iter);
+	gtk_tree_model_get (eom_sidebar->priv->page_model,
+			    &iter,
+			    PAGE_COLUMN_TITLE, &label_title,
+			    PAGE_COLUMN_NOTEBOOK_INDEX, &index,
+			    -1);
+
+	gtk_menu_set_active (GTK_MENU (eom_sidebar->priv->menu), index);
+
+	gtk_label_set_text (GTK_LABEL (eom_sidebar->priv->label), label_title);
+
+	gtk_notebook_set_current_page (GTK_NOTEBOOK (eom_sidebar->priv->notebook),
+				       index);
+
+	g_free (label_title);
+
+	eom_sidebar_update_arrow_visibility (eom_sidebar);
+
+	g_signal_emit (eom_sidebar, signals[SIGNAL_PAGE_ADDED], 0, main_widget);
+}
+
+void
+eom_sidebar_remove_page (EomSidebar *eom_sidebar, GtkWidget *main_widget)
+{
+	GtkTreeIter iter;
+	GtkWidget *widget, *menu_item;
+	gboolean valid;
+	gint index;
+
+	g_return_if_fail (EOM_IS_SIDEBAR (eom_sidebar));
+	g_return_if_fail (GTK_IS_WIDGET (main_widget));
+
+	valid = gtk_tree_model_get_iter_first (eom_sidebar->priv->page_model, &iter);
+
+	while (valid) {
+		gtk_tree_model_get (eom_sidebar->priv->page_model, &iter,
+				    PAGE_COLUMN_NOTEBOOK_INDEX, &index,
+				    PAGE_COLUMN_MENU_ITEM, &menu_item,
+				    PAGE_COLUMN_MAIN_WIDGET, &widget,
+				    -1);
+
+		if (widget == main_widget) {
+			break;
+		} else {
+			valid = gtk_tree_model_iter_next (eom_sidebar->priv->page_model,
+							  &iter);
+		}
+
+		g_object_unref (menu_item);
+		g_object_unref (widget);
+	}
+
+	if (valid) {
+		gtk_notebook_remove_page (GTK_NOTEBOOK (eom_sidebar->priv->notebook),
+					  index);
+
+		gtk_container_remove (GTK_CONTAINER (eom_sidebar->priv->menu), menu_item);
+
+		gtk_list_store_remove (GTK_LIST_STORE (eom_sidebar->priv->page_model),
+				       &iter);
+
+		eom_sidebar_update_arrow_visibility (eom_sidebar);
+
+		g_signal_emit (eom_sidebar, signals[SIGNAL_PAGE_REMOVED], 0, main_widget);
+	}
+}
+
+gint
+eom_sidebar_get_n_pages (EomSidebar *eom_sidebar)
+{
+	g_return_val_if_fail (EOM_IS_SIDEBAR (eom_sidebar), TRUE);
+
+	return gtk_tree_model_iter_n_children (
+		GTK_TREE_MODEL (eom_sidebar->priv->page_model), NULL);
+}
+
+gboolean
+eom_sidebar_is_empty (EomSidebar *eom_sidebar)
+{
+	g_return_val_if_fail (EOM_IS_SIDEBAR (eom_sidebar), TRUE);
+
+	return gtk_tree_model_iter_n_children (
+		GTK_TREE_MODEL (eom_sidebar->priv->page_model), NULL) == 0;
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/86.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/86.html new file mode 100644 index 0000000..729f88c --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/86.html @@ -0,0 +1,399 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/* Eye of Mate - Side bar
+ *
+ * Copyright (C) 2004 Red Hat, Inc.
+ * Copyright (C) 2007 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on evince code (shell/ev-sidebar.h) by:
+ * 	- Jonathan Blandford <jrb@alum.mit.edu>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __EOM_SIDEBAR_H__
+#define __EOM_SIDEBAR_H__
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+typedef struct _EomSidebar EomSidebar;
+typedef struct _EomSidebarClass EomSidebarClass;
+typedef struct _EomSidebarPrivate EomSidebarPrivate;
+
+#define EOM_TYPE_SIDEBAR	    (eom_sidebar_get_type())
+#define EOM_SIDEBAR(obj)	    (G_TYPE_CHECK_INSTANCE_CAST((obj), EOM_TYPE_SIDEBAR, EomSidebar))
+#define EOM_SIDEBAR_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  EOM_TYPE_SIDEBAR, EomSidebarClass))
+#define EOM_IS_SIDEBAR(obj)	    (G_TYPE_CHECK_INSTANCE_TYPE((obj), EOM_TYPE_SIDEBAR))
+#define EOM_IS_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  EOM_TYPE_SIDEBAR))
+#define EOM_SIDEBAR_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  EOM_TYPE_SIDEBAR, EomSidebarClass))
+
+struct _EomSidebar {
+	GtkBox base_instance;
+
+	EomSidebarPrivate *priv;
+};
+
+struct _EomSidebarClass {
+	GtkBoxClass base_class;
+
+	void (* page_added)   (EomSidebar *eom_sidebar,
+			       GtkWidget  *main_widget);
+
+	void (* page_removed) (EomSidebar *eom_sidebar,
+			       GtkWidget  *main_widget);
+};
+
+GType      eom_sidebar_get_type     (void);
+
+GtkWidget *eom_sidebar_new          (void);
+
+void       eom_sidebar_add_page     (EomSidebar  *eom_sidebar,
+				     const gchar *title,
+				     GtkWidget   *main_widget);
+
+void       eom_sidebar_remove_page  (EomSidebar  *eom_sidebar,
+				     GtkWidget   *main_widget);
+
+void       eom_sidebar_set_page     (EomSidebar  *eom_sidebar,
+				     GtkWidget   *main_widget);
+
+gint       eom_sidebar_get_n_pages  (EomSidebar  *eom_sidebar);
+
+gboolean   eom_sidebar_is_empty     (EomSidebar  *eom_sidebar);
+
+G_END_DECLS
+
+#endif /* __EOM_SIDEBAR_H__ */
+
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/87.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/87.html new file mode 100644 index 0000000..521e5f8 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/87.html @@ -0,0 +1,373 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/* Eye of Mate - Statusbar
+ *
+ * Copyright (C) 2000-2006 The Free Software Foundation
+ *
+ * Author: Federico Mena-Quintero <federico@gnu.org>
+ *	   Jens Finke <jens@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __EOM_STATUSBAR_H__
+#define __EOM_STATUSBAR_H__
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+typedef struct _EomStatusbar        EomStatusbar;
+typedef struct _EomStatusbarPrivate EomStatusbarPrivate;
+typedef struct _EomStatusbarClass   EomStatusbarClass;
+
+#define EOM_TYPE_STATUSBAR            (eom_statusbar_get_type ())
+#define EOM_STATUSBAR(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), EOM_TYPE_STATUSBAR, EomStatusbar))
+#define EOM_STATUSBAR_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),   EOM_TYPE_STATUSBAR, EomStatusbarClass))
+#define EOM_IS_STATUSBAR(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EOM_TYPE_STATUSBAR))
+#define EOM_IS_STATUSBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  EOM_TYPE_STATUSBAR))
+#define EOM_STATUSBAR_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  EOM_TYPE_STATUSBAR, EomStatusbarClass))
+
+struct _EomStatusbar
+{
+        GtkStatusbar parent;
+
+        EomStatusbarPrivate *priv;
+};
+
+struct _EomStatusbarClass
+{
+        GtkStatusbarClass parent_class;
+};
+
+GType		 eom_statusbar_get_type			(void) G_GNUC_CONST;
+
+GtkWidget	*eom_statusbar_new			(void);
+
+void		 eom_statusbar_set_image_number		(EomStatusbar   *statusbar,
+							 gint           num,
+							 gint           tot);
+
+void		 eom_statusbar_set_progress		(EomStatusbar   *statusbar,
+							 gdouble        progress);
+
+G_END_DECLS
+
+#endif /* __EOM_STATUSBAR_H__ */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/88.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/88.html new file mode 100644 index 0000000..5a7e023 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/88.html @@ -0,0 +1,529 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye of Mate - Statusbar
+ *
+ * Copyright (C) 2000-2006 The Free Software Foundation
+ *
+ * Author: Federico Mena-Quintero <federico@gnu.org>
+ *	   Jens Finke <jens@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"<--- Include file: "config.h" not found.
+#endif
+
+#include "eom-statusbar.h"
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+struct _EomStatusbarPrivate
+{
+	GtkWidget *progressbar;
+	GtkWidget *img_num_label;
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (EomStatusbar, eom_statusbar, GTK_TYPE_STATUSBAR)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
+
+static void
+eom_statusbar_class_init (EomStatusbarClass *klass)
+{
+    /* empty */
+}
+
+static void
+eom_statusbar_init (EomStatusbar *statusbar)
+{
+	EomStatusbarPrivate *priv;
+	GtkWidget *vbox;
+
+	statusbar->priv = eom_statusbar_get_instance_private (statusbar);
+	priv = statusbar->priv;
+
+	gtk_widget_set_margin_top (GTK_WIDGET (statusbar), 0);
+	gtk_widget_set_margin_bottom (GTK_WIDGET (statusbar), 0);
+
+	priv->img_num_label = gtk_label_new (NULL);
+	gtk_widget_set_size_request (priv->img_num_label, 100, 10);
+	gtk_widget_show (priv->img_num_label);
+
+	gtk_box_pack_end (GTK_BOX (statusbar),
+			  priv->img_num_label,
+			  FALSE,
+			  TRUE,
+			  0);
+
+	vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+
+	gtk_box_pack_end (GTK_BOX (statusbar),
+			  vbox,
+			  FALSE,
+			  FALSE,
+			  2);
+
+	statusbar->priv->progressbar = gtk_progress_bar_new ();
+
+	gtk_box_pack_end (GTK_BOX (vbox),
+			  priv->progressbar,
+			  TRUE,
+			  TRUE,
+			  2);
+
+	gtk_widget_set_size_request (priv->progressbar, -1, 10);
+
+	gtk_widget_show (vbox);
+
+	gtk_widget_hide (statusbar->priv->progressbar);
+
+}
+
+GtkWidget *
+eom_statusbar_new (void)
+{
+	return GTK_WIDGET (g_object_new (EOM_TYPE_STATUSBAR, NULL));
+}
+
+void
+eom_statusbar_set_image_number (EomStatusbar *statusbar,
+                                gint          num,
+				gint          tot)
+{
+	gchar *msg;
+
+	g_return_if_fail (EOM_IS_STATUSBAR (statusbar));
+
+	/* Hide number display if values don't make sense */
+	if (G_UNLIKELY (num <= 0 || tot <= 0))
+		return;
+
+	/* Translators: This string is displayed in the statusbar.
+	 * The first token is the image number, the second is total image
+	 * count.
+	 *
+	 * Translate to "%Id" if you want to use localized digits, or
+	 * translate to "%d" otherwise.
+	 *
+	 * Note that translating this doesn't guarantee that you get localized
+	 * digits. That needs support from your system and locale definition
+	 * too.*/
+	msg = g_strdup_printf (_("%d / %d"), num, tot);
+
+	gtk_label_set_text (GTK_LABEL (statusbar->priv->img_num_label), msg);
+
+      	g_free (msg);
+}
+
+void
+eom_statusbar_set_progress (EomStatusbar *statusbar,
+			    gdouble       progress)
+{
+	g_return_if_fail (EOM_IS_STATUSBAR (statusbar));
+
+	gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (statusbar->priv->progressbar),
+				       progress);
+
+	if (progress > 0 && progress < 1) {
+		gtk_widget_show (statusbar->priv->progressbar);
+		gtk_widget_hide (statusbar->priv->img_num_label);
+	} else {
+		gtk_widget_hide (statusbar->priv->progressbar);
+		gtk_widget_show (statusbar->priv->img_num_label);
+	}
+}
+
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/89.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/89.html new file mode 100644 index 0000000..5318417 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/89.html @@ -0,0 +1,1459 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye Of Mate - Thumbnail Navigator
+ *
+ * Copyright (C) 2006 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"<--- Include file: "config.h" not found.
+#endif
+
+#include "eom-thumb-nav.h"
+#include "eom-thumb-view.h"
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <math.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define EOM_THUMB_NAV_SCROLL_INC      20
+#define EOM_THUMB_NAV_SCROLL_TIMEOUT  20
+
+enum
+{
+	PROP_0,
+	PROP_SHOW_BUTTONS,
+	PROP_THUMB_VIEW,
+	PROP_MODE
+};
+
+struct _EomThumbNavPrivate {
+	EomThumbNavMode   mode;
+
+	gboolean          show_buttons;
+	gboolean          scroll_dir;
+	gint              scroll_pos;
+	gint              scroll_id;
+
+	GtkWidget        *button_left;
+	GtkWidget        *button_right;
+	GtkWidget        *sw;
+	GtkWidget        *thumbview;
+	GtkAdjustment    *adj;
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (EomThumbNav, eom_thumb_nav, GTK_TYPE_BOX);
+
+static gboolean
+eom_thumb_nav_scroll_event (GtkWidget *widget, GdkEventScroll *event, gpointer user_data)
+{
+	EomThumbNav *nav = EOM_THUMB_NAV (user_data);
+	gint inc = EOM_THUMB_NAV_SCROLL_INC * 3;
+
+	if (nav->priv->mode != EOM_THUMB_NAV_MODE_ONE_ROW)
+		return FALSE;
+
+	switch (event->direction) {
+	case GDK_SCROLL_UP:
+	case GDK_SCROLL_LEFT:
+		inc *= -1;
+		break;
+
+	case GDK_SCROLL_DOWN:
+	case GDK_SCROLL_RIGHT:
+		break;
+
+	case GDK_SCROLL_SMOOTH:
+	{
+		/* Compatibility code to catch smooth events from mousewheels */
+		gdouble x_delta, y_delta;
+		gboolean set = gdk_event_get_scroll_deltas ((GdkEvent*)event,
+							    &x_delta, &y_delta);
+
+		/* Propagate horizontal smooth scroll events further,
+		   as well as non-mousewheel events. */
+		if (G_UNLIKELY (!set) || x_delta != 0.0 || fabs(y_delta) != 1.0)
+			return FALSE;
+
+		/* The y_delta is either +1.0 or -1.0 here */
+		inc *= (gint) y_delta;
+	}
+	break;
+
+	default:
+		g_assert_not_reached ();
+		return FALSE;
+	}
+
+	if (inc < 0)
+		gtk_adjustment_set_value (nav->priv->adj, MAX (0, gtk_adjustment_get_value (nav->priv->adj) + inc));
+	else
+		gtk_adjustment_set_value (nav->priv->adj, MIN (gtk_adjustment_get_upper (nav->priv->adj) - gtk_adjustment_get_page_size (nav->priv->adj), gtk_adjustment_get_value (nav->priv->adj) + inc));
+
+	return TRUE;
+}
+
+static void
+eom_thumb_nav_adj_changed (GtkAdjustment *adj, gpointer user_data)
+{
+	EomThumbNav *nav;
+	EomThumbNavPrivate *priv;
+	gboolean ltr;
+
+	nav = EOM_THUMB_NAV (user_data);
+	priv = eom_thumb_nav_get_instance_private (nav);
+	ltr = gtk_widget_get_direction (priv->sw) == GTK_TEXT_DIR_LTR;
+
+	gtk_widget_set_sensitive (ltr ? priv->button_right : priv->button_left,
+				  gtk_adjustment_get_value (adj)
+				   < gtk_adjustment_get_upper (adj)
+				    - gtk_adjustment_get_page_size (adj));
+}
+
+static void
+eom_thumb_nav_adj_value_changed (GtkAdjustment *adj, gpointer user_data)
+{
+	EomThumbNav *nav;
+	EomThumbNavPrivate *priv;
+	gboolean ltr;
+
+	nav = EOM_THUMB_NAV (user_data);
+	priv = eom_thumb_nav_get_instance_private (nav);
+	ltr = gtk_widget_get_direction (priv->sw) == GTK_TEXT_DIR_LTR;
+
+	gtk_widget_set_sensitive (ltr ? priv->button_left : priv->button_right,
+				  gtk_adjustment_get_value (adj) > 0);
+
+	gtk_widget_set_sensitive (ltr ? priv->button_right : priv->button_left,
+				  gtk_adjustment_get_value (adj)
+				   < gtk_adjustment_get_upper (adj)
+				    - gtk_adjustment_get_page_size (adj));
+}
+
+static gboolean
+eom_thumb_nav_scroll_step (gpointer user_data)
+{
+	EomThumbNav *nav = EOM_THUMB_NAV (user_data);
+	GtkAdjustment *adj = nav->priv->adj;
+	gint delta;
+
+	if (nav->priv->scroll_pos < 10)
+		delta = EOM_THUMB_NAV_SCROLL_INC;
+	else if (nav->priv->scroll_pos < 20)
+		delta = EOM_THUMB_NAV_SCROLL_INC * 2;
+	else if (nav->priv->scroll_pos < 30)
+		delta = EOM_THUMB_NAV_SCROLL_INC * 2 + 5;
+	else
+		delta = EOM_THUMB_NAV_SCROLL_INC * 2 + 12;
+
+	if (!nav->priv->scroll_dir)
+		delta *= -1;
+
+	if ((gint) (gtk_adjustment_get_value (adj) + (gdouble) delta) >= 0 &&
+	    (gint) (gtk_adjustment_get_value (adj) + (gdouble) delta) <= gtk_adjustment_get_upper (adj) - gtk_adjustment_get_page_size (adj)) {
+		gtk_adjustment_set_value(adj,
+			gtk_adjustment_get_value (adj) + (gdouble) delta);
+		nav->priv->scroll_pos++;
+	} else {
+		if (delta > 0)
+		      gtk_adjustment_set_value (adj,
+		      	gtk_adjustment_get_upper (adj) - gtk_adjustment_get_page_size (adj));
+		else
+		      gtk_adjustment_set_value (adj, 0);
+
+		nav->priv->scroll_pos = 0;
+
+		return FALSE;
+	}
+
+	return TRUE;
+}
+
+static void
+eom_thumb_nav_button_clicked (GtkButton *button, EomThumbNav *nav)
+{
+	nav->priv->scroll_pos = 0;
+
+	nav->priv->scroll_dir = gtk_widget_get_direction (GTK_WIDGET (button)) == GTK_TEXT_DIR_LTR ?
+		GTK_WIDGET (button) == nav->priv->button_right :
+		GTK_WIDGET (button) == nav->priv->button_left;
+
+	eom_thumb_nav_scroll_step (nav);
+}
+
+static void
+eom_thumb_nav_start_scroll (GtkButton *button, EomThumbNav *nav)
+{
+	nav->priv->scroll_dir = gtk_widget_get_direction (GTK_WIDGET (button)) == GTK_TEXT_DIR_LTR ?
+		GTK_WIDGET (button) == nav->priv->button_right :
+		GTK_WIDGET (button) == nav->priv->button_left;
+
+	nav->priv->scroll_id = g_timeout_add (EOM_THUMB_NAV_SCROLL_TIMEOUT,
+					      eom_thumb_nav_scroll_step,
+					      nav);
+}
+
+static void
+eom_thumb_nav_stop_scroll (GtkButton *button, EomThumbNav *nav)
+{
+	if (nav->priv->scroll_id > 0) {
+		g_source_remove (nav->priv->scroll_id);
+		nav->priv->scroll_id = 0;
+		nav->priv->scroll_pos = 0;
+	}
+}
+
+static void
+eom_thumb_nav_get_property (GObject    *object,
+			    guint       property_id,
+			    GValue     *value,
+			    GParamSpec *pspec)
+{
+	EomThumbNav *nav = EOM_THUMB_NAV (object);
+
+	switch (property_id)
+	{
+	case PROP_SHOW_BUTTONS:
+		g_value_set_boolean (value,
+			eom_thumb_nav_get_show_buttons (nav));
+		break;
+
+	case PROP_THUMB_VIEW:
+		g_value_set_object (value, nav->priv->thumbview);
+		break;
+
+	case PROP_MODE:
+		g_value_set_int (value,
+			eom_thumb_nav_get_mode (nav));
+		break;
+	}
+}
+
+static void
+eom_thumb_nav_set_property (GObject      *object,
+			    guint         property_id,
+			    const GValue *value,
+			    GParamSpec   *pspec)
+{
+	EomThumbNav *nav = EOM_THUMB_NAV (object);
+
+	switch (property_id)
+	{
+	case PROP_SHOW_BUTTONS:
+		eom_thumb_nav_set_show_buttons (nav,
+			g_value_get_boolean (value));
+		break;
+
+	case PROP_THUMB_VIEW:
+		nav->priv->thumbview =
+			GTK_WIDGET (g_value_get_object (value));
+		break;
+
+	case PROP_MODE:
+		eom_thumb_nav_set_mode (nav,
+			g_value_get_int (value));
+		break;
+	}
+}
+
+static GObject *
+eom_thumb_nav_constructor (GType type,
+			   guint n_construct_properties,
+			   GObjectConstructParam *construct_params)
+{
+	GObject *object;
+	EomThumbNavPrivate *priv;
+
+	object = G_OBJECT_CLASS (eom_thumb_nav_parent_class)->constructor
+			(type, n_construct_properties, construct_params);
+
+	priv = EOM_THUMB_NAV (object)->priv;
+
+	if (priv->thumbview != NULL) {
+		gtk_container_add (GTK_CONTAINER (priv->sw), priv->thumbview);
+		gtk_widget_show_all (priv->sw);
+	}
+
+	return object;
+}
+
+static void
+eom_thumb_nav_class_init (EomThumbNavClass *class)
+{
+	GObjectClass *g_object_class = (GObjectClass *) class;
+
+	g_object_class->constructor  = eom_thumb_nav_constructor;
+	g_object_class->get_property = eom_thumb_nav_get_property;
+	g_object_class->set_property = eom_thumb_nav_set_property;
+
+	g_object_class_install_property (g_object_class,
+	                                 PROP_SHOW_BUTTONS,
+	                                 g_param_spec_boolean ("show-buttons",
+	                                                       "Show Buttons",
+	                                                       "Whether to show navigation buttons or not",
+	                                                       TRUE,
+	                                                       (G_PARAM_READABLE | G_PARAM_WRITABLE)));
+
+	g_object_class_install_property (g_object_class,
+	                                 PROP_THUMB_VIEW,
+	                                 g_param_spec_object ("thumbview",
+	                                                       "Thumbnail View",
+	                                                       "The internal thumbnail viewer widget",
+	                                                       EOM_TYPE_THUMB_VIEW,
+	                                                       (G_PARAM_CONSTRUCT_ONLY |
+								G_PARAM_READABLE |
+								G_PARAM_WRITABLE)));
+
+	g_object_class_install_property (g_object_class,
+	                                 PROP_MODE,
+	                                 g_param_spec_int ("mode",
+	                                                   "Mode",
+	                                                   "Thumb navigator mode",
+	                                                   EOM_THUMB_NAV_MODE_ONE_ROW,
+							   EOM_THUMB_NAV_MODE_MULTIPLE_ROWS,
+							   EOM_THUMB_NAV_MODE_ONE_ROW,
+	                                                   (G_PARAM_READABLE | G_PARAM_WRITABLE)));
+}
+
+static void
+eom_thumb_nav_init (EomThumbNav *nav)
+{
+	EomThumbNavPrivate *priv;
+	GtkWidget *arrow;
+
+	gtk_orientable_set_orientation (GTK_ORIENTABLE (nav),
+					GTK_ORIENTATION_HORIZONTAL);
+
+	nav->priv = eom_thumb_nav_get_instance_private (nav);
+
+	priv = nav->priv;
+
+	priv->mode = EOM_THUMB_NAV_MODE_ONE_ROW;
+
+	priv->show_buttons = TRUE;
+
+	priv->button_left = gtk_button_new ();
+	gtk_button_set_relief (GTK_BUTTON (priv->button_left), GTK_RELIEF_NONE);
+
+	arrow = gtk_image_new_from_icon_name ("pan-start-symbolic", GTK_ICON_SIZE_BUTTON);
+	gtk_container_add (GTK_CONTAINER (priv->button_left), arrow);
+
+	gtk_widget_set_size_request (GTK_WIDGET (priv->button_left), 25, 0);
+
+	gtk_box_pack_start (GTK_BOX (nav), priv->button_left, FALSE, FALSE, 0);
+
+	g_signal_connect (priv->button_left,
+			  "clicked",
+			  G_CALLBACK (eom_thumb_nav_button_clicked),
+			  nav);
+
+	g_signal_connect (priv->button_left,
+			  "pressed",
+			  G_CALLBACK (eom_thumb_nav_start_scroll),
+			  nav);
+
+	g_signal_connect (priv->button_left,
+			  "released",
+			  G_CALLBACK (eom_thumb_nav_stop_scroll),
+			  nav);
+
+	priv->sw = gtk_scrolled_window_new (NULL, NULL);
+
+	gtk_widget_set_name (gtk_scrolled_window_get_hscrollbar (GTK_SCROLLED_WINDOW (priv->sw)), "eom-image-collection-scrollbar");
+
+	gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (priv->sw),
+					     GTK_SHADOW_IN);
+
+	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->sw),
+					GTK_POLICY_AUTOMATIC,
+					GTK_POLICY_NEVER);
+
+	g_signal_connect (priv->sw,
+			  "scroll-event",
+			  G_CALLBACK (eom_thumb_nav_scroll_event),
+			  nav);
+
+	priv->adj = gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (priv->sw));
+
+	g_signal_connect (priv->adj,
+			  "changed",
+			  G_CALLBACK (eom_thumb_nav_adj_changed),
+			  nav);
+
+	g_signal_connect (priv->adj,
+			  "value-changed",
+			  G_CALLBACK (eom_thumb_nav_adj_value_changed),
+			  nav);
+
+	gtk_box_pack_start (GTK_BOX (nav), priv->sw, TRUE, TRUE, 0);
+
+	priv->button_right = gtk_button_new ();
+	gtk_button_set_relief (GTK_BUTTON (priv->button_right), GTK_RELIEF_NONE);
+
+	arrow = gtk_image_new_from_icon_name ("pan-end-symbolic", GTK_ICON_SIZE_BUTTON);
+	gtk_container_add (GTK_CONTAINER (priv->button_right), arrow);
+
+	gtk_widget_set_size_request (GTK_WIDGET (priv->button_right), 25, 0);
+
+	gtk_box_pack_start (GTK_BOX (nav), priv->button_right, FALSE, FALSE, 0);
+
+	g_signal_connect (priv->button_right,
+			  "clicked",
+			  G_CALLBACK (eom_thumb_nav_button_clicked),
+			  nav);
+
+	g_signal_connect (priv->button_right,
+			  "pressed",
+			  G_CALLBACK (eom_thumb_nav_start_scroll),
+			  nav);
+
+	g_signal_connect (priv->button_right,
+			  "released",
+			  G_CALLBACK (eom_thumb_nav_stop_scroll),
+			  nav);
+
+	/* Update nav button states */
+	eom_thumb_nav_adj_value_changed (priv->adj, nav);
+}
+
+/**
+ * eom_thumb_nav_new:
+ * @thumbview: an #EomThumbView to embed in the navigation widget.
+ * @mode: The navigation mode.
+ * @show_buttons: Whether to show the navigation buttons.
+ *
+ * Creates a new thumbnail navigation widget.
+ *
+ * Returns: a new #EomThumbNav object.
+ **/
+GtkWidget *
+eom_thumb_nav_new (GtkWidget       *thumbview,
+		   EomThumbNavMode  mode,
+		   gboolean         show_buttons)
+{
+	GObject *nav;
+
+	nav = g_object_new (EOM_TYPE_THUMB_NAV,
+		            "show-buttons", show_buttons,
+		            "mode", mode,
+		            "thumbview", thumbview,
+		            "homogeneous", FALSE,
+		            "spacing", 0,
+			    NULL);
+
+	return GTK_WIDGET (nav);
+}
+
+/**
+ * eom_thumb_nav_get_show_buttons:
+ * @nav: an #EomThumbNav.
+ *
+ * Gets whether the navigation buttons are visible.
+ *
+ * Returns: %TRUE if the navigation buttons are visible,
+ * %FALSE otherwise.
+ **/
+gboolean
+eom_thumb_nav_get_show_buttons (EomThumbNav *nav)
+{
+	g_return_val_if_fail (EOM_IS_THUMB_NAV (nav), FALSE);
+
+	return nav->priv->show_buttons;
+}
+
+/**
+ * eom_thumb_nav_set_show_buttons:
+ * @nav: an #EomThumbNav.
+ * @show_buttons: %TRUE to show the buttons, %FALSE to hide them.
+ *
+ * Sets whether the navigation buttons to the left and right of the
+ * widget should be visible.
+ **/
+void
+eom_thumb_nav_set_show_buttons (EomThumbNav *nav, gboolean show_buttons)
+{
+	g_return_if_fail (EOM_IS_THUMB_NAV (nav));
+	g_return_if_fail (nav->priv->button_left  != NULL);
+	g_return_if_fail (nav->priv->button_right != NULL);
+
+	nav->priv->show_buttons = show_buttons;
+
+	if (show_buttons &&
+	    nav->priv->mode == EOM_THUMB_NAV_MODE_ONE_ROW) {
+		gtk_widget_show_all (nav->priv->button_left);
+		gtk_widget_show_all (nav->priv->button_right);
+	} else {
+		gtk_widget_hide (nav->priv->button_left);
+		gtk_widget_hide (nav->priv->button_right);
+	}
+}
+
+/**
+ * eom_thumb_nav_get_mode:
+ * @nav: an #EomThumbNav.
+ *
+ * Gets the navigation mode in @nav.
+ *
+ * Returns: A value in #EomThumbNavMode.
+ **/
+EomThumbNavMode
+eom_thumb_nav_get_mode (EomThumbNav *nav)
+{
+	g_return_val_if_fail (EOM_IS_THUMB_NAV (nav), FALSE);
+
+	return nav->priv->mode;
+}
+
+/**
+ * eom_thumb_nav_set_mode:
+ * @nav: An #EomThumbNav.
+ * @mode: One of #EomThumbNavMode.
+ *
+ * Sets the navigation mode in @nav. See #EomThumbNavMode for details.
+ **/
+void
+eom_thumb_nav_set_mode (EomThumbNav *nav, EomThumbNavMode mode)
+{
+	EomThumbNavPrivate *priv;
+
+	g_return_if_fail (EOM_IS_THUMB_NAV (nav));
+
+	priv = nav->priv;
+
+	priv->mode = mode;
+
+	switch (mode)
+	{
+	case EOM_THUMB_NAV_MODE_ONE_ROW:
+		gtk_orientable_set_orientation (GTK_ORIENTABLE(priv->thumbview),
+		                                GTK_ORIENTATION_HORIZONTAL);
+
+		gtk_widget_set_size_request (priv->thumbview, -1, -1);
+		eom_thumb_view_set_item_height (EOM_THUMB_VIEW (priv->thumbview),
+						115);
+
+		gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->sw),
+						GTK_POLICY_AUTOMATIC,
+						GTK_POLICY_NEVER);
+
+		eom_thumb_nav_set_show_buttons (nav, priv->show_buttons);
+
+		break;
+
+	case EOM_THUMB_NAV_MODE_ONE_COLUMN:
+		gtk_orientable_set_orientation (GTK_ORIENTABLE(priv->thumbview),
+		                                GTK_ORIENTATION_VERTICAL);
+
+		gtk_widget_set_size_request (priv->thumbview, -1, -1);
+		eom_thumb_view_set_item_height (EOM_THUMB_VIEW (priv->thumbview),
+						-1);
+
+		gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->sw),
+						GTK_POLICY_NEVER,
+						GTK_POLICY_AUTOMATIC);
+
+		gtk_widget_hide (priv->button_left);
+		gtk_widget_hide (priv->button_right);
+
+		break;
+
+	case EOM_THUMB_NAV_MODE_MULTIPLE_ROWS:
+		gtk_orientable_set_orientation (GTK_ORIENTABLE(priv->thumbview),
+		                                GTK_ORIENTATION_VERTICAL);
+
+		gtk_widget_set_size_request (priv->thumbview, -1, 220);
+		eom_thumb_view_set_item_height (EOM_THUMB_VIEW (priv->thumbview),
+						-1);
+
+		gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->sw),
+						GTK_POLICY_NEVER,
+						GTK_POLICY_AUTOMATIC);
+
+		gtk_widget_hide (priv->button_left);
+		gtk_widget_hide (priv->button_right);
+
+		break;
+
+	case EOM_THUMB_NAV_MODE_MULTIPLE_COLUMNS:
+		gtk_orientable_set_orientation (GTK_ORIENTABLE(priv->thumbview),
+		                                GTK_ORIENTATION_VERTICAL);
+
+		gtk_widget_set_size_request (priv->thumbview, 230, -1);
+		eom_thumb_view_set_item_height (EOM_THUMB_VIEW (priv->thumbview),
+						-1);
+
+		gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->sw),
+						GTK_POLICY_NEVER,
+						GTK_POLICY_AUTOMATIC);
+
+		gtk_widget_hide (priv->button_left);
+		gtk_widget_hide (priv->button_right);
+
+		break;
+	}
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/9.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/9.html new file mode 100644 index 0000000..4112334 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/9.html @@ -0,0 +1,2295 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  GThumb
+ *
+ *  Copyright (C) 2001, 2002 The Free Software Foundation, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/* based upon file transupp.c from the libjpeg package, original copyright
+ * note follows:
+.*
+ *
+ * transupp.c
+ *
+ * Copyright (C) 1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains image transformation routines and other utility code
+ * used by the jpegtran sample application.  These are NOT part of the core
+ * JPEG library.  But we keep these routines separate from jpegtran.c to
+ * ease the task of maintaining jpegtran-like programs that have other user
+ * interfaces.
+ */
+
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#ifdef HAVE_LIBJPEG
+
+#define SAVE_MARKERS_SUPPORTED 1
+
+#include <stdio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <jpeglib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "transupp-6b.h"		/* My own external interface */
+
+#ifndef MAX
+#define MAX(a, b)  (((a) > (b)) ? (a) : (b))
+#endif
+
+enum {
+  JERR_CONVERSION_NOTIMPL
+};
+
+#define ERREXIT(cinfo,code)  \
+  ((cinfo)->err->msg_code = (code), \
+   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+
+static long
+jround_up (long a, long b)
+/* Compute a rounded up to next multiple of b, ie, ceil(a/b)*b */
+/* Assumes a >= 0, b > 0 */
+{
+  a += b - 1L;
+  return a - (a % b);
+}
+
+static void
+jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row,
+		 JDIMENSION num_blocks)
+/* Copy a row of coefficient blocks from one place to another. */
+{
+  register JCOEFPTR inptr, outptr;
+  register long count;
+
+  inptr = (JCOEFPTR) input_row;
+  outptr = (JCOEFPTR) output_row;
+  for (count = (long) num_blocks * DCTSIZE2; count > 0; count--) {
+    *outptr++ = *inptr++;
+  }
+}
+
+/*
+ * Lossless image transformation routines.  These routines work on DCT
+ * coefficient arrays and thus do not require any lossy decompression
+ * or recompression of the image.
+ * Thanks to Guido Vollbeding for the initial design and code of this feature.
+ *
+ * Horizontal flipping is done in-place, using a single top-to-bottom
+ * pass through the virtual source array.  It will thus be much the
+ * fastest option for images larger than main memory.
+ *
+ * The other routines require a set of destination virtual arrays, so they
+ * need twice as much memory as jpegtran normally does.  The destination
+ * arrays are always written in normal scan order (top to bottom) because
+ * the virtual array manager expects this.  The source arrays will be scanned
+ * in the corresponding order, which means multiple passes through the source
+ * arrays for most of the transforms.  That could result in much thrashing
+ * if the image is larger than main memory.
+ *
+ * Some notes about the operating environment of the individual transform
+ * routines:
+ * 1. Both the source and destination virtual arrays are allocated from the
+ *    source JPEG object, and therefore should be manipulated by calling the
+ *    source's memory manager.
+ * 2. The destination's component count should be used.  It may be smaller
+ *    than the source's when forcing to grayscale.
+ * 3. Likewise the destination's sampling factors should be used.  When
+ *    forcing to grayscale the destination's sampling factors will be all 1,
+ *    and we may as well take that as the effective iMCU size.
+ * 4. When "trim" is in effect, the destination's dimensions will be the
+ *    trimmed values but the source's will be untrimmed.
+ * 5. All the routines assume that the source and destination buffers are
+ *    padded out to a full iMCU boundary.  This is true, although for the
+ *    source buffer it is an undocumented property of jdcoefct.c.
+ * Notes 2,3,4 boil down to this: generally we should use the destination's
+ * dimensions and ignore the source's.
+ */
+
+static void
+do_flip_h (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	   jvirt_barray_ptr *src_coef_arrays)
+/* Horizontal flip; done in-place, so no separate dest array is required */
+{
+  JDIMENSION MCU_cols, comp_width, blk_x, blk_y;
+  int ci, k, offset_y;
+  JBLOCKARRAY buffer;
+  JCOEFPTR ptr1, ptr2;
+  JCOEF temp1, temp2;
+  jpeg_component_info *compptr;
+
+  /* Horizontal mirroring of DCT blocks is accomplished by swapping
+   * pairs of blocks in-place.  Within a DCT block, we perform horizontal
+   * mirroring by changing the signs of odd-numbered columns.
+   * Partial iMCUs at the right edge are left untouched.
+   */
+  MCU_cols = dstinfo->image_width / (dstinfo->max_h_samp_factor * DCTSIZE);
+
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    comp_width = MCU_cols * compptr->h_samp_factor;
+    for (blk_y = 0; blk_y < compptr->height_in_blocks;
+	 blk_y += compptr->v_samp_factor) {
+      buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, src_coef_arrays[ci], blk_y,
+	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+	for (blk_x = 0; blk_x * 2 < comp_width; blk_x++) {
+	  ptr1 = buffer[offset_y][blk_x];
+	  ptr2 = buffer[offset_y][comp_width - blk_x - 1];
+	  /* this unrolled loop doesn't need to know which row it's on... */
+	  for (k = 0; k < DCTSIZE2; k += 2) {
+	    temp1 = *ptr1;	/* swap even column */
+	    temp2 = *ptr2;
+	    *ptr1++ = temp2;
+	    *ptr2++ = temp1;
+	    temp1 = *ptr1;	/* swap odd column with sign change */
+	    temp2 = *ptr2;
+	    *ptr1++ = -temp2;
+	    *ptr2++ = -temp1;
+	  }
+	}
+      }
+    }
+  }
+}
+
+static void
+do_flip_v (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	   jvirt_barray_ptr *src_coef_arrays,
+	   jvirt_barray_ptr *dst_coef_arrays)
+/* Vertical flip */
+{
+  JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;
+  int ci, i, j, offset_y;
+  JBLOCKARRAY src_buffer, dst_buffer;
+  JBLOCKROW src_row_ptr, dst_row_ptr;
+  JCOEFPTR src_ptr, dst_ptr;
+  jpeg_component_info *compptr;
+
+  /* We output into a separate array because we can't touch different
+   * rows of the source virtual array simultaneously.  Otherwise, this
+   * is a pretty straightforward analog of horizontal flip.
+   * Within a DCT block, vertical mirroring is done by changing the signs
+   * of odd-numbered rows.
+   * Partial iMCUs at the bottom edge are copied verbatim.
+   */
+  MCU_rows = dstinfo->image_height / (dstinfo->max_v_samp_factor * DCTSIZE);
+
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    comp_height = MCU_rows * compptr->v_samp_factor;
+    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+	 dst_blk_y += compptr->v_samp_factor) {
+      dst_buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
+	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+      if (dst_blk_y < comp_height) {
+	/* Row is within the mirrorable area. */
+	src_buffer = (*srcinfo->mem->access_virt_barray)
+	  ((j_common_ptr) srcinfo, src_coef_arrays[ci],
+	   comp_height - dst_blk_y - (JDIMENSION) compptr->v_samp_factor,
+	   (JDIMENSION) compptr->v_samp_factor, FALSE);
+      } else {
+	/* Bottom-edge blocks will be copied verbatim. */
+	src_buffer = (*srcinfo->mem->access_virt_barray)
+	  ((j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_y,
+	   (JDIMENSION) compptr->v_samp_factor, FALSE);
+      }
+      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+	if (dst_blk_y < comp_height) {
+	  /* Row is within the mirrorable area. */
+	  dst_row_ptr = dst_buffer[offset_y];
+	  src_row_ptr = src_buffer[compptr->v_samp_factor - offset_y - 1];
+	  for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
+	       dst_blk_x++) {
+	    dst_ptr = dst_row_ptr[dst_blk_x];
+	    src_ptr = src_row_ptr[dst_blk_x];
+	    for (i = 0; i < DCTSIZE; i += 2) {
+	      /* copy even row */
+	      for (j = 0; j < DCTSIZE; j++)
+		*dst_ptr++ = *src_ptr++;
+	      /* copy odd row with sign change */
+	      for (j = 0; j < DCTSIZE; j++)
+		*dst_ptr++ = - *src_ptr++;
+	    }
+	  }
+	} else {
+	  /* Just copy row verbatim. */
+	  jcopy_block_row(src_buffer[offset_y], dst_buffer[offset_y],
+			  compptr->width_in_blocks);
+	}
+      }
+    }
+  }
+}
+
+static void
+do_transpose (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	      jvirt_barray_ptr *src_coef_arrays,
+	      jvirt_barray_ptr *dst_coef_arrays)
+/* Transpose source into destination */
+{
+  JDIMENSION dst_blk_x, dst_blk_y;
+  int ci, i, j, offset_x, offset_y;
+  JBLOCKARRAY src_buffer, dst_buffer;
+  JCOEFPTR src_ptr, dst_ptr;
+  jpeg_component_info *compptr;
+
+  /* Transposing pixels within a block just requires transposing the
+   * DCT coefficients.
+   * Partial iMCUs at the edges require no special treatment; we simply
+   * process all the available DCT blocks for every component.
+   */
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+	 dst_blk_y += compptr->v_samp_factor) {
+      dst_buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
+	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+	for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
+	     dst_blk_x += compptr->h_samp_factor) {
+	  src_buffer = (*srcinfo->mem->access_virt_barray)
+	    ((j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_x,
+	     (JDIMENSION) compptr->h_samp_factor, FALSE);
+	  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {
+	    src_ptr = src_buffer[offset_x][dst_blk_y + offset_y];
+	    dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
+	    for (i = 0; i < DCTSIZE; i++)
+	      for (j = 0; j < DCTSIZE; j++)
+		dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+	  }
+	}
+      }
+    }
+  }
+}
+
+static void
+do_rot_90 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	   jvirt_barray_ptr *src_coef_arrays,
+	   jvirt_barray_ptr *dst_coef_arrays)
+/* 90 degree rotation is equivalent to
+ *   1. Transposing the image;
+ *   2. Horizontal mirroring.
+ * These two steps are merged into a single processing routine.
+ */
+{
+  JDIMENSION MCU_cols, comp_width, dst_blk_x, dst_blk_y;
+  int ci, i, j, offset_x, offset_y;
+  JBLOCKARRAY src_buffer, dst_buffer;
+  JCOEFPTR src_ptr, dst_ptr;
+  jpeg_component_info *compptr;
+
+  /* Because of the horizontal mirror step, we can't process partial iMCUs
+   * at the (output) right edge properly.  They just get transposed and
+   * not mirrored.
+   */
+  MCU_cols = dstinfo->image_width / (dstinfo->max_h_samp_factor * DCTSIZE);
+
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    comp_width = MCU_cols * compptr->h_samp_factor;
+    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+	 dst_blk_y += compptr->v_samp_factor) {
+      dst_buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
+	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+	for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
+	     dst_blk_x += compptr->h_samp_factor) {
+	  src_buffer = (*srcinfo->mem->access_virt_barray)
+	    ((j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_x,
+	     (JDIMENSION) compptr->h_samp_factor, FALSE);
+	  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {
+	    src_ptr = src_buffer[offset_x][dst_blk_y + offset_y];
+	    if (dst_blk_x < comp_width) {
+	      /* Block is within the mirrorable area. */
+	      dst_ptr = dst_buffer[offset_y]
+		[comp_width - dst_blk_x - offset_x - 1];
+	      for (i = 0; i < DCTSIZE; i++) {
+		for (j = 0; j < DCTSIZE; j++)
+		  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+		i++;
+		for (j = 0; j < DCTSIZE; j++)
+		  dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
+	      }
+	    } else {
+	      /* Edge blocks are transposed but not mirrored. */
+	      dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
+	      for (i = 0; i < DCTSIZE; i++)
+		for (j = 0; j < DCTSIZE; j++)
+		  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+	    }
+	  }
+	}
+      }
+    }
+  }
+}
+
+static void
+do_rot_270 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	    jvirt_barray_ptr *src_coef_arrays,
+	    jvirt_barray_ptr *dst_coef_arrays)
+/* 270 degree rotation is equivalent to
+ *   1. Horizontal mirroring;
+ *   2. Transposing the image.
+ * These two steps are merged into a single processing routine.
+ */
+{
+  JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;
+  int ci, i, j, offset_x, offset_y;
+  JBLOCKARRAY src_buffer, dst_buffer;
+  JCOEFPTR src_ptr, dst_ptr;
+  jpeg_component_info *compptr;
+
+  /* Because of the horizontal mirror step, we can't process partial iMCUs
+   * at the (output) bottom edge properly.  They just get transposed and
+   * not mirrored.
+   */
+  MCU_rows = dstinfo->image_height / (dstinfo->max_v_samp_factor * DCTSIZE);
+
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    comp_height = MCU_rows * compptr->v_samp_factor;
+    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+	 dst_blk_y += compptr->v_samp_factor) {
+      dst_buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
+	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+	for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
+	     dst_blk_x += compptr->h_samp_factor) {
+	  src_buffer = (*srcinfo->mem->access_virt_barray)
+	    ((j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_x,
+	     (JDIMENSION) compptr->h_samp_factor, FALSE);
+	  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {
+	    dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
+	    if (dst_blk_y < comp_height) {
+	      /* Block is within the mirrorable area. */
+	      src_ptr = src_buffer[offset_x]
+		[comp_height - dst_blk_y - offset_y - 1];
+	      for (i = 0; i < DCTSIZE; i++) {
+		for (j = 0; j < DCTSIZE; j++) {
+		  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+		  j++;
+		  dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
+		}
+	      }
+	    } else {
+	      /* Edge blocks are transposed but not mirrored. */
+	      src_ptr = src_buffer[offset_x][dst_blk_y + offset_y];
+	      for (i = 0; i < DCTSIZE; i++)
+		for (j = 0; j < DCTSIZE; j++)
+		  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+	    }
+	  }
+	}
+      }
+    }
+  }
+}
+
+static void
+do_rot_180 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	    jvirt_barray_ptr *src_coef_arrays,
+	    jvirt_barray_ptr *dst_coef_arrays)
+/* 180 degree rotation is equivalent to
+ *   1. Vertical mirroring;
+ *   2. Horizontal mirroring.
+ * These two steps are merged into a single processing routine.
+ */
+{
+  JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;
+  int ci, i, j, offset_y;
+  JBLOCKARRAY src_buffer, dst_buffer;
+  JBLOCKROW src_row_ptr, dst_row_ptr;
+  JCOEFPTR src_ptr, dst_ptr;
+  jpeg_component_info *compptr;
+
+  MCU_cols = dstinfo->image_width / (dstinfo->max_h_samp_factor * DCTSIZE);
+  MCU_rows = dstinfo->image_height / (dstinfo->max_v_samp_factor * DCTSIZE);
+
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    comp_width = MCU_cols * compptr->h_samp_factor;
+    comp_height = MCU_rows * compptr->v_samp_factor;
+    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+	 dst_blk_y += compptr->v_samp_factor) {
+      dst_buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
+	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+      if (dst_blk_y < comp_height) {
+	/* Row is within the vertically mirrorable area. */
+	src_buffer = (*srcinfo->mem->access_virt_barray)
+	  ((j_common_ptr) srcinfo, src_coef_arrays[ci],
+	   comp_height - dst_blk_y - (JDIMENSION) compptr->v_samp_factor,
+	   (JDIMENSION) compptr->v_samp_factor, FALSE);
+      } else {
+	/* Bottom-edge rows are only mirrored horizontally. */
+	src_buffer = (*srcinfo->mem->access_virt_barray)
+	  ((j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_y,
+	   (JDIMENSION) compptr->v_samp_factor, FALSE);
+      }
+      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+	if (dst_blk_y < comp_height) {
+	  /* Row is within the mirrorable area. */
+	  dst_row_ptr = dst_buffer[offset_y];
+	  src_row_ptr = src_buffer[compptr->v_samp_factor - offset_y - 1];
+	  /* Process the blocks that can be mirrored both ways. */
+	  for (dst_blk_x = 0; dst_blk_x < comp_width; dst_blk_x++) {
+	    dst_ptr = dst_row_ptr[dst_blk_x];
+	    src_ptr = src_row_ptr[comp_width - dst_blk_x - 1];
+	    for (i = 0; i < DCTSIZE; i += 2) {
+	      /* For even row, negate every odd column. */
+	      for (j = 0; j < DCTSIZE; j += 2) {
+		*dst_ptr++ = *src_ptr++;
+		*dst_ptr++ = - *src_ptr++;
+	      }
+	      /* For odd row, negate every even column. */
+	      for (j = 0; j < DCTSIZE; j += 2) {
+		*dst_ptr++ = - *src_ptr++;
+		*dst_ptr++ = *src_ptr++;
+	      }
+	    }
+	  }
+	  /* Any remaining right-edge blocks are only mirrored vertically. */
+	  for (; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {
+	    dst_ptr = dst_row_ptr[dst_blk_x];
+	    src_ptr = src_row_ptr[dst_blk_x];
+	    for (i = 0; i < DCTSIZE; i += 2) {
+	      for (j = 0; j < DCTSIZE; j++)
+		*dst_ptr++ = *src_ptr++;
+	      for (j = 0; j < DCTSIZE; j++)
+		*dst_ptr++ = - *src_ptr++;
+	    }
+	  }
+	} else {
+	  /* Remaining rows are just mirrored horizontally. */
+	  dst_row_ptr = dst_buffer[offset_y];
+	  src_row_ptr = src_buffer[offset_y];
+	  /* Process the blocks that can be mirrored. */
+	  for (dst_blk_x = 0; dst_blk_x < comp_width; dst_blk_x++) {
+	    dst_ptr = dst_row_ptr[dst_blk_x];
+	    src_ptr = src_row_ptr[comp_width - dst_blk_x - 1];
+	    for (i = 0; i < DCTSIZE2; i += 2) {
+	      *dst_ptr++ = *src_ptr++;
+	      *dst_ptr++ = - *src_ptr++;
+	    }
+	  }
+	  /* Any remaining right-edge blocks are only copied. */
+	  for (; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {
+	    dst_ptr = dst_row_ptr[dst_blk_x];
+	    src_ptr = src_row_ptr[dst_blk_x];
+	    for (i = 0; i < DCTSIZE2; i++)
+	      *dst_ptr++ = *src_ptr++;
+	  }
+	}
+      }
+    }
+  }
+}
+
+static void
+do_transverse (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+	       jvirt_barray_ptr *src_coef_arrays,
+	       jvirt_barray_ptr *dst_coef_arrays)
+/* Transverse transpose is equivalent to
+ *   1. 180 degree rotation;
+ *   2. Transposition;
+ * or
+ *   1. Horizontal mirroring;
+ *   2. Transposition;
+ *   3. Horizontal mirroring.
+ * These steps are merged into a single processing routine.
+ */
+{
+  JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;
+  int ci, i, j, offset_x, offset_y;
+  JBLOCKARRAY src_buffer, dst_buffer;
+  JCOEFPTR src_ptr, dst_ptr;
+  jpeg_component_info *compptr;
+
+  MCU_cols = dstinfo->image_width / (dstinfo->max_h_samp_factor * DCTSIZE);
+  MCU_rows = dstinfo->image_height / (dstinfo->max_v_samp_factor * DCTSIZE);
+
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    comp_width = MCU_cols * compptr->h_samp_factor;
+    comp_height = MCU_rows * compptr->v_samp_factor;
+    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+	 dst_blk_y += compptr->v_samp_factor) {
+      dst_buffer = (*srcinfo->mem->access_virt_barray)
+	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
+	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+	for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
+	     dst_blk_x += compptr->h_samp_factor) {
+	  src_buffer = (*srcinfo->mem->access_virt_barray)
+	    ((j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_x,
+	     (JDIMENSION) compptr->h_samp_factor, FALSE);
+	  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {
+	    if (dst_blk_y < comp_height) {
+	      src_ptr = src_buffer[offset_x]
+		[comp_height - dst_blk_y - offset_y - 1];
+	      if (dst_blk_x < comp_width) {
+		/* Block is within the mirrorable area. */
+		dst_ptr = dst_buffer[offset_y]
+		  [comp_width - dst_blk_x - offset_x - 1];
+		for (i = 0; i < DCTSIZE; i++) {
+		  for (j = 0; j < DCTSIZE; j++) {
+		    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+		    j++;
+		    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
+		  }
+		  i++;
+		  for (j = 0; j < DCTSIZE; j++) {
+		    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
+		    j++;
+		    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+		  }
+		}
+	      } else {
+		/* Right-edge blocks are mirrored in y only */
+		dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
+		for (i = 0; i < DCTSIZE; i++) {
+		  for (j = 0; j < DCTSIZE; j++) {
+		    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+		    j++;
+		    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
+		  }
+		}
+	      }
+	    } else {
+	      src_ptr = src_buffer[offset_x][dst_blk_y + offset_y];
+	      if (dst_blk_x < comp_width) {
+		/* Bottom-edge blocks are mirrored in x only */
+		dst_ptr = dst_buffer[offset_y]
+		  [comp_width - dst_blk_x - offset_x - 1];
+		for (i = 0; i < DCTSIZE; i++) {
+		  for (j = 0; j < DCTSIZE; j++)
+		    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+		  i++;
+		  for (j = 0; j < DCTSIZE; j++)
+		    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
+		}
+	      } else {
+		/* At lower right corner, just transpose, no mirroring */
+		dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
+		for (i = 0; i < DCTSIZE; i++)
+		  for (j = 0; j < DCTSIZE; j++)
+		    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+	      }
+	    }
+	  }
+	}
+      }
+    }
+  }
+}
+
+/* Request any required workspace.
+ *
+ * We allocate the workspace virtual arrays from the source decompression
+ * object, so that all the arrays (both the original data and the workspace)
+ * will be taken into account while making memory management decisions.
+ * Hence, this routine must be called after jpeg_read_header (which reads
+ * the image dimensions) and before jpeg_read_coefficients (which realizes
+ * the source's virtual arrays).
+ */
+
+void
+jtransform_request_workspace (j_decompress_ptr srcinfo,
+			      jpeg_transform_info *info)
+{
+  jvirt_barray_ptr *coef_arrays = NULL;
+  jpeg_component_info *compptr;
+  int ci;
+
+  if (info->force_grayscale &&
+      srcinfo->jpeg_color_space == JCS_YCbCr &&
+      srcinfo->num_components == 3) {
+    /* We'll only process the first component */
+    info->num_components = 1;
+  } else {
+    /* Process all the components */
+    info->num_components = srcinfo->num_components;
+  }
+
+  switch (info->transform) {
+  case JXFORM_NONE:
+  case JXFORM_FLIP_H:
+    /* Don't need a workspace array */
+    break;
+  case JXFORM_FLIP_V:
+  case JXFORM_ROT_180:
+    /* Need workspace arrays having same dimensions as source image.
+     * Note that we allocate arrays padded out to the next iMCU boundary,
+     * so that transform routines need not worry about missing edge blocks.
+     */
+    coef_arrays = (jvirt_barray_ptr *)
+      (*srcinfo->mem->alloc_small) ((j_common_ptr) srcinfo, JPOOL_IMAGE,
+	sizeof(jvirt_barray_ptr) * info->num_components);
+    for (ci = 0; ci < info->num_components; ci++) {
+      compptr = srcinfo->comp_info + ci;
+      coef_arrays[ci] = (*srcinfo->mem->request_virt_barray)
+	((j_common_ptr) srcinfo, JPOOL_IMAGE, FALSE,
+	 (JDIMENSION) jround_up((long) compptr->width_in_blocks,
+				(long) compptr->h_samp_factor),
+	 (JDIMENSION) jround_up((long) compptr->height_in_blocks,
+				(long) compptr->v_samp_factor),
+	 (JDIMENSION) compptr->v_samp_factor);
+    }
+    break;
+  case JXFORM_TRANSPOSE:
+  case JXFORM_TRANSVERSE:
+  case JXFORM_ROT_90:
+  case JXFORM_ROT_270:
+    /* Need workspace arrays having transposed dimensions.
+     * Note that we allocate arrays padded out to the next iMCU boundary,
+     * so that transform routines need not worry about missing edge blocks.
+     */
+    coef_arrays = (jvirt_barray_ptr *)
+      (*srcinfo->mem->alloc_small) ((j_common_ptr) srcinfo, JPOOL_IMAGE,
+	sizeof(jvirt_barray_ptr) * info->num_components);
+    for (ci = 0; ci < info->num_components; ci++) {
+      compptr = srcinfo->comp_info + ci;
+      coef_arrays[ci] = (*srcinfo->mem->request_virt_barray)
+	((j_common_ptr) srcinfo, JPOOL_IMAGE, FALSE,
+	 (JDIMENSION) jround_up((long) compptr->height_in_blocks,
+				(long) compptr->v_samp_factor),
+	 (JDIMENSION) jround_up((long) compptr->width_in_blocks,
+				(long) compptr->h_samp_factor),
+	 (JDIMENSION) compptr->h_samp_factor);
+    }
+    break;
+  }
+  info->workspace_coef_arrays = coef_arrays;
+}
+
+/* Transpose destination image parameters */
+
+static void
+transpose_critical_parameters (j_compress_ptr dstinfo)
+{
+  int tblno, i, j, ci, itemp;
+  jpeg_component_info *compptr;
+  JQUANT_TBL *qtblptr;
+  JDIMENSION dtemp;
+  UINT16 qtemp;
+
+  /* Transpose basic image dimensions */
+  dtemp = dstinfo->image_width;
+  dstinfo->image_width = dstinfo->image_height;
+  dstinfo->image_height = dtemp;
+
+  /* Transpose sampling factors */
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    compptr = dstinfo->comp_info + ci;
+    itemp = compptr->h_samp_factor;
+    compptr->h_samp_factor = compptr->v_samp_factor;
+    compptr->v_samp_factor = itemp;
+  }
+
+  /* Transpose quantization tables */
+  for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {
+    qtblptr = dstinfo->quant_tbl_ptrs[tblno];
+    if (qtblptr != NULL) {
+      for (i = 0; i < DCTSIZE; i++) {
+	for (j = 0; j < i; j++) {
+	  qtemp = qtblptr->quantval[i*DCTSIZE+j];
+	  qtblptr->quantval[i*DCTSIZE+j] = qtblptr->quantval[j*DCTSIZE+i];
+	  qtblptr->quantval[j*DCTSIZE+i] = qtemp;
+	}
+      }
+    }
+  }
+}
+
+/* Trim off any partial iMCUs on the indicated destination edge */
+
+static void
+trim_right_edge (j_compress_ptr dstinfo)
+{
+  int ci, max_h_samp_factor;
+  JDIMENSION MCU_cols;
+
+  /* We have to compute max_h_samp_factor ourselves,
+   * because it hasn't been set yet in the destination
+   * (and we don't want to use the source's value).
+   */
+  max_h_samp_factor = 1;
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    int h_samp_factor = dstinfo->comp_info[ci].h_samp_factor;
+    max_h_samp_factor = MAX(max_h_samp_factor, h_samp_factor);
+  }
+  MCU_cols = dstinfo->image_width / (max_h_samp_factor * DCTSIZE);
+  if (MCU_cols > 0)		/* can't trim to 0 pixels */
+    dstinfo->image_width = MCU_cols * (max_h_samp_factor * DCTSIZE);
+}
+
+static void
+trim_bottom_edge (j_compress_ptr dstinfo)
+{
+  int ci, max_v_samp_factor;
+  JDIMENSION MCU_rows;
+
+  /* We have to compute max_v_samp_factor ourselves,
+   * because it hasn't been set yet in the destination
+   * (and we don't want to use the source's value).
+   */
+  max_v_samp_factor = 1;
+  for (ci = 0; ci < dstinfo->num_components; ci++) {
+    int v_samp_factor = dstinfo->comp_info[ci].v_samp_factor;
+    max_v_samp_factor = MAX(max_v_samp_factor, v_samp_factor);
+  }
+  MCU_rows = dstinfo->image_height / (max_v_samp_factor * DCTSIZE);
+  if (MCU_rows > 0)		/* can't trim to 0 pixels */
+    dstinfo->image_height = MCU_rows * (max_v_samp_factor * DCTSIZE);
+}
+
+/* Adjust output image parameters as needed.
+ *
+ * This must be called after jpeg_copy_critical_parameters()
+ * and before jpeg_write_coefficients().
+ *
+ * The return value is the set of virtual coefficient arrays to be written
+ * (either the ones allocated by jtransform_request_workspace, or the
+ * original source data arrays).  The caller will need to pass this value
+ * to jpeg_write_coefficients().
+ */
+
+jvirt_barray_ptr *
+jtransform_adjust_parameters (j_decompress_ptr srcinfo,
+			      j_compress_ptr dstinfo,
+			      jvirt_barray_ptr *src_coef_arrays,
+			      jpeg_transform_info *info)
+{
+  /* If force-to-grayscale is requested, adjust destination parameters */
+  if (info->force_grayscale) {
+    /* We use jpeg_set_colorspace to make sure subsidiary settings get fixed
+     * properly.  Among other things, the target h_samp_factor & v_samp_factor
+     * will get set to 1, which typically won't match the source.
+     * In fact we do this even if the source is already grayscale; that
+     * provides an easy way of coercing a grayscale JPEG with funny sampling
+     * factors to the customary 1,1.  (Some decoders fail on other factors.)
+     */
+    if ((dstinfo->jpeg_color_space == JCS_YCbCr &&
+	 dstinfo->num_components == 3) ||
+	(dstinfo->jpeg_color_space == JCS_GRAYSCALE &&
+	 dstinfo->num_components == 1)) {
+      /* We have to preserve the source's quantization table number. */
+      int sv_quant_tbl_no = dstinfo->comp_info[0].quant_tbl_no;
+      jpeg_set_colorspace(dstinfo, JCS_GRAYSCALE);
+      dstinfo->comp_info[0].quant_tbl_no = sv_quant_tbl_no;
+    } else {
+      /* Sorry, can't do it */
+      ERREXIT(dstinfo, JERR_CONVERSION_NOTIMPL);
+    }
+  }
+
+  /* Correct the destination's image dimensions etc if necessary */
+  switch (info->transform) {
+  case JXFORM_NONE:
+    /* Nothing to do */
+    break;
+  case JXFORM_FLIP_H:
+    if (info->trim)
+      trim_right_edge(dstinfo);
+    break;
+  case JXFORM_FLIP_V:
+    if (info->trim)
+      trim_bottom_edge(dstinfo);
+    break;
+  case JXFORM_TRANSPOSE:
+    transpose_critical_parameters(dstinfo);
+    /* transpose does NOT have to trim anything */
+    break;
+  case JXFORM_TRANSVERSE:
+    transpose_critical_parameters(dstinfo);
+    if (info->trim) {
+      trim_right_edge(dstinfo);
+      trim_bottom_edge(dstinfo);
+    }
+    break;
+  case JXFORM_ROT_90:
+    transpose_critical_parameters(dstinfo);
+    if (info->trim)
+      trim_right_edge(dstinfo);
+    break;
+  case JXFORM_ROT_180:
+    if (info->trim) {
+      trim_right_edge(dstinfo);
+      trim_bottom_edge(dstinfo);
+    }
+    break;
+  case JXFORM_ROT_270:
+    transpose_critical_parameters(dstinfo);
+    if (info->trim)
+      trim_bottom_edge(dstinfo);
+    break;
+  }
+
+  /* Return the appropriate output data set */
+  if (info->workspace_coef_arrays != NULL)
+    return info->workspace_coef_arrays;
+  return src_coef_arrays;
+}
+
+/* Execute the actual transformation, if any.
+ *
+ * This must be called *after* jpeg_write_coefficients, because it depends
+ * on jpeg_write_coefficients to have computed subsidiary values such as
+ * the per-component width and height fields in the destination object.
+ *
+ * Note that some transformations will modify the source data arrays!
+ */
+
+void
+jtransform_execute_transformation (j_decompress_ptr srcinfo,
+				   j_compress_ptr dstinfo,
+				   jvirt_barray_ptr *src_coef_arrays,
+				   jpeg_transform_info *info)
+{
+  jvirt_barray_ptr *dst_coef_arrays = info->workspace_coef_arrays;
+
+  switch (info->transform) {
+  case JXFORM_NONE:
+    break;
+  case JXFORM_FLIP_H:
+    do_flip_h(srcinfo, dstinfo, src_coef_arrays);
+    break;
+  case JXFORM_FLIP_V:
+    do_flip_v(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
+    break;
+  case JXFORM_TRANSPOSE:
+    do_transpose(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
+    break;
+  case JXFORM_TRANSVERSE:
+    do_transverse(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
+    break;
+  case JXFORM_ROT_90:
+    do_rot_90(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
+    break;
+  case JXFORM_ROT_180:
+    do_rot_180(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
+    break;
+  case JXFORM_ROT_270:
+    do_rot_270(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
+    break;
+  }
+}
+
+/* Setup decompression object to save desired markers in memory.
+ * This must be called before jpeg_read_header() to have the desired effect.
+ */
+
+void
+jcopy_markers_setup (j_decompress_ptr srcinfo, JCOPY_OPTION option)
+{
+#ifdef SAVE_MARKERS_SUPPORTED
+  int m;
+
+  /* Save comments except under NONE option */
+  if (option != JCOPYOPT_NONE) {
+    jpeg_save_markers(srcinfo, JPEG_COM, 0xFFFF);
+  }
+  /* Save all types of APPn markers iff ALL option */
+  if (option == JCOPYOPT_ALL) {
+    for (m = 0; m < 16; m++)
+      jpeg_save_markers(srcinfo, JPEG_APP0 + m, 0xFFFF);
+  }
+#endif /* SAVE_MARKERS_SUPPORTED */
+}
+
+/* Copy markers saved in the given source object to the destination object.
+ * This should be called just after jpeg_start_compress() or
+ * jpeg_write_coefficients().
+ * Note that those routines will have written the SOI, and also the
+ * JFIF APP0 or Adobe APP14 markers if selected.
+ */
+
+void
+jcopy_markers_execute (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+		       JCOPY_OPTION option)
+{
+  jpeg_saved_marker_ptr marker;
+
+  /* In the current implementation, we don't actually need to examine the
+   * option flag here; we just copy everything that got saved.
+   * But to avoid confusion, we do not output JFIF and Adobe APP14 markers
+   * if the encoder library already wrote one.
+   */
+  for (marker = srcinfo->marker_list; marker != NULL; marker = marker->next) {
+    if (dstinfo->write_JFIF_header &&
+	marker->marker == JPEG_APP0 &&
+	marker->data_length >= 5 &&
+	GETJOCTET(marker->data[0]) == 0x4A &&
+	GETJOCTET(marker->data[1]) == 0x46 &&
+	GETJOCTET(marker->data[2]) == 0x49 &&
+	GETJOCTET(marker->data[3]) == 0x46 &&
+	GETJOCTET(marker->data[4]) == 0)
+      continue;			/* reject duplicate JFIF */
+    if (dstinfo->write_Adobe_marker &&
+	marker->marker == JPEG_APP0+14 &&
+	marker->data_length >= 5 &&
+	GETJOCTET(marker->data[0]) == 0x41 &&
+	GETJOCTET(marker->data[1]) == 0x64 &&
+	GETJOCTET(marker->data[2]) == 0x6F &&
+	GETJOCTET(marker->data[3]) == 0x62 &&
+	GETJOCTET(marker->data[4]) == 0x65)
+      continue;			/* reject duplicate Adobe */
+
+#ifdef NEED_FAR_POINTERS
+    /* We could use jpeg_write_marker if the data weren't FAR... */
+    {
+      unsigned int i;
+      jpeg_write_m_header(dstinfo, marker->marker, marker->data_length);
+      for (i = 0; i < marker->data_length; i++)
+	jpeg_write_m_byte(dstinfo, marker->data[i]);
+    }
+#else
+    jpeg_write_marker(dstinfo, marker->marker,
+		      marker->data, marker->data_length);
+#endif
+  }
+}
+
+#endif /* HAVE_LIBJPEG */
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/90.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/90.html new file mode 100644 index 0000000..dfd8f91 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/90.html @@ -0,0 +1,2373 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
   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
/* Eye Of Mate - Thumbnail View
+ *
+ * Copyright (C) 2006-2008 The Free Software Foundation
+ *
+ * Author: Claudio Saavedra <csaavedra@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"<--- Include file: "config.h" not found.
+#endif
+
+#include "eom-thumb-view.h"
+#include "eom-list-store.h"
+#include "eom-image.h"
+#include "eom-job-queue.h"
+
+#ifdef HAVE_EXIF
+#include "eom-exif-util.h"
+#include <libexif/exif-data.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <stdlib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+enum {
+  PROP_0,
+  PROP_ORIENTATION
+};
+
+#define EOM_THUMB_VIEW_SPACING 0
+
+static EomImage* eom_thumb_view_get_image_from_path (EomThumbView      *thumbview,
+						     GtkTreePath       *path);
+
+static void      eom_thumb_view_popup_menu          (EomThumbView      *widget,
+						     GdkEventButton    *event);
+
+static void      eom_thumb_view_update_columns (EomThumbView *view);
+
+static gboolean
+thumbview_on_query_tooltip_cb (GtkWidget  *widget,
+			       gint        x,
+			       gint        y,
+			       gboolean    keyboard_mode,
+			       GtkTooltip *tooltip,
+			       gpointer    user_data);
+static void
+thumbview_on_parent_set_cb (GtkWidget *widget,
+			    GtkWidget *old_parent,
+			    gpointer   user_data);
+
+static void
+thumbview_on_drag_data_get_cb (GtkWidget        *widget,
+			       GdkDragContext   *drag_context,
+			       GtkSelectionData *data,
+			       guint             info,
+			       guint             time,
+			       gpointer          user_data);
+
+struct _EomThumbViewPrivate {
+	gint start_thumb; /* the first visible thumbnail */
+	gint end_thumb;   /* the last visible thumbnail  */
+	GtkWidget *menu;  /* a contextual menu for thumbnails */
+	GtkCellRenderer *pixbuf_cell;
+	guint visible_range_changed_id;
+
+	GtkOrientation orientation;
+	gint n_images;
+	gulong image_add_id;
+	gulong image_removed_id;
+};
+
+G_DEFINE_TYPE_WITH_CODE (EomThumbView, eom_thumb_view, GTK_TYPE_ICON_VIEW,
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, NULL) \<--- There is an unknown macro here somewhere. Configuration is required. If G_IMPLEMENT_INTERFACE is a macro then please configure it.
+			 G_ADD_PRIVATE (EomThumbView));
+
+/* Drag 'n Drop */
+
+static void
+eom_thumb_view_constructed (GObject *object)
+{
+	EomThumbView *thumbview;
+
+	if (G_OBJECT_CLASS (eom_thumb_view_parent_class)->constructed)
+		G_OBJECT_CLASS (eom_thumb_view_parent_class)->constructed (object);
+
+	thumbview = EOM_THUMB_VIEW (object);
+
+	thumbview->priv->pixbuf_cell = gtk_cell_renderer_pixbuf_new ();
+
+	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (thumbview),
+				    thumbview->priv->pixbuf_cell,
+				    FALSE);
+
+	g_object_set (thumbview->priv->pixbuf_cell,
+	              "height", 100,
+	              "width", 115,
+	              "yalign", 0.5,
+	              "xalign", 0.5,
+	              NULL);
+
+	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (thumbview),
+					thumbview->priv->pixbuf_cell,
+					"pixbuf", EOM_LIST_STORE_THUMBNAIL,
+					NULL);
+
+	gtk_icon_view_set_selection_mode (GTK_ICON_VIEW (thumbview),
+					  GTK_SELECTION_MULTIPLE);
+
+	gtk_icon_view_set_column_spacing (GTK_ICON_VIEW (thumbview),
+					  EOM_THUMB_VIEW_SPACING);
+
+	gtk_icon_view_set_row_spacing (GTK_ICON_VIEW (thumbview),
+				       EOM_THUMB_VIEW_SPACING);
+
+	g_object_set (thumbview, "has-tooltip", TRUE, NULL);
+
+	g_signal_connect (thumbview, "query-tooltip",
+	                  G_CALLBACK (thumbview_on_query_tooltip_cb),
+	                  NULL);
+
+	thumbview->priv->start_thumb = 0;
+	thumbview->priv->end_thumb = 0;
+	thumbview->priv->menu = NULL;
+
+	g_signal_connect (thumbview, "parent-set",
+	                  G_CALLBACK (thumbview_on_parent_set_cb),
+	                  NULL);
+
+	gtk_icon_view_enable_model_drag_source (GTK_ICON_VIEW (thumbview), 0,
+						NULL, 0,
+						GDK_ACTION_COPY |
+						GDK_ACTION_MOVE |
+						GDK_ACTION_LINK |
+						GDK_ACTION_ASK);
+	gtk_drag_source_add_uri_targets (GTK_WIDGET (thumbview));
+
+	g_signal_connect (thumbview, "drag-data-get",
+	                  G_CALLBACK (thumbview_on_drag_data_get_cb),
+	                  NULL);
+}
+
+static void
+eom_thumb_view_dispose (GObject *object)
+{
+	EomThumbViewPrivate *priv = EOM_THUMB_VIEW (object)->priv;
+	GtkTreeModel *model;
+
+	if (priv->visible_range_changed_id != 0) {
+		g_source_remove (priv->visible_range_changed_id);
+		priv->visible_range_changed_id = 0;
+	}
+
+#if GLIB_CHECK_VERSION(2,62,0)
+	if ((model = gtk_icon_view_get_model (GTK_ICON_VIEW (object))) != NULL) {
+		g_clear_signal_handler (&priv->image_add_id, model);
+		g_clear_signal_handler (&priv->image_removed_id, model);
+	}
+#else
+	if ((model = gtk_icon_view_get_model (GTK_ICON_VIEW (object))) != NULL) {
+		if (priv->image_add_id != 0) {
+			g_signal_handler_disconnect (model, priv->image_add_id);
+			priv->image_add_id = 0;
+		}
+
+		if (priv->image_removed_id != 0) {
+			g_signal_handler_disconnect (model, priv->image_removed_id);
+			priv->image_removed_id = 0;
+		}
+	}
+#endif
+
+	G_OBJECT_CLASS (eom_thumb_view_parent_class)->dispose (object);
+}
+
+static void
+eom_thumb_view_get_property (GObject    *object,
+			     guint       prop_id,
+			     GValue     *value,
+			     GParamSpec *pspec)
+{
+	EomThumbView *view = EOM_THUMB_VIEW (object);
+
+	switch (prop_id)
+	{
+	case PROP_ORIENTATION:
+		g_value_set_enum (value, view->priv->orientation);
+		break;
+
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+		break;
+	}
+}
+
+static void
+eom_thumb_view_set_property (GObject      *object,
+			     guint         prop_id,
+			     const GValue *value,
+			     GParamSpec   *pspec)
+{
+	EomThumbView *view = EOM_THUMB_VIEW (object);
+
+	switch (prop_id)
+	{
+	case PROP_ORIENTATION:
+		view->priv->orientation = g_value_get_enum (value);
+		eom_thumb_view_update_columns (view);
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+		break;
+	}
+}
+
+static void
+eom_thumb_view_class_init (EomThumbViewClass *class)
+{
+	GObjectClass *gobject_class = G_OBJECT_CLASS (class);
+
+	gobject_class->constructed = eom_thumb_view_constructed;
+	gobject_class->dispose = eom_thumb_view_dispose;
+	gobject_class->get_property = eom_thumb_view_get_property;
+	gobject_class->set_property = eom_thumb_view_set_property;
+
+	g_object_class_override_property (gobject_class, PROP_ORIENTATION,
+	                                  "orientation");
+}
+
+static void
+eom_thumb_view_clear_range (EomThumbView *thumbview,
+			    const gint start_thumb,
+			    const gint end_thumb)
+{
+	GtkTreePath *path;
+	GtkTreeIter iter;
+	EomListStore *store = EOM_LIST_STORE (gtk_icon_view_get_model (GTK_ICON_VIEW (thumbview)));
+	gint thumb = start_thumb;
+	gboolean result;
+
+	g_assert (start_thumb <= end_thumb);
+
+	path = gtk_tree_path_new_from_indices (start_thumb, -1);
+	for (result = gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, path);
+	     result && thumb <= end_thumb;
+	     result = gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter), thumb++) {
+		eom_list_store_thumbnail_unset (store, &iter);
+	}
+	gtk_tree_path_free (path);
+}
+
+static void
+eom_thumb_view_add_range (EomThumbView *thumbview,
+			  const gint start_thumb,
+			  const gint end_thumb)
+{
+	GtkTreePath *path;
+	GtkTreeIter iter;
+	EomListStore *store = EOM_LIST_STORE (gtk_icon_view_get_model (GTK_ICON_VIEW (thumbview)));
+	gint thumb = start_thumb;
+	gboolean result;
+
+	g_assert (start_thumb <= end_thumb);
+
+	path = gtk_tree_path_new_from_indices (start_thumb, -1);
+	for (result = gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, path);
+	     result && thumb <= end_thumb;
+	     result = gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter), thumb++) {
+		eom_list_store_thumbnail_set (store, &iter);
+	}
+	gtk_tree_path_free (path);
+}
+
+static void
+eom_thumb_view_update_visible_range (EomThumbView *thumbview,
+				     const gint start_thumb,
+				     const gint end_thumb)
+{
+	EomThumbViewPrivate *priv = thumbview->priv;
+	int old_start_thumb, old_end_thumb;
+
+	old_start_thumb= priv->start_thumb;
+	old_end_thumb = priv->end_thumb;
+
+	if (start_thumb == old_start_thumb &&
+	    end_thumb == old_end_thumb) {
+		return;
+	}
+
+	if (old_start_thumb < start_thumb)
+		eom_thumb_view_clear_range (thumbview, old_start_thumb, MIN (start_thumb - 1, old_end_thumb));
+
+	if (old_end_thumb > end_thumb)
+		eom_thumb_view_clear_range (thumbview, MAX (end_thumb + 1, old_start_thumb), old_end_thumb);
+
+	eom_thumb_view_add_range (thumbview, start_thumb, end_thumb);
+
+	priv->start_thumb = start_thumb;
+	priv->end_thumb = end_thumb;
+}
+
+static gboolean
+visible_range_changed_cb (EomThumbView *thumbview)
+{
+	GtkTreePath *path1, *path2;
+
+	thumbview->priv->visible_range_changed_id = 0;
+
+	if (!gtk_icon_view_get_visible_range (GTK_ICON_VIEW (thumbview), &path1, &path2)) {
+		return FALSE;
+	}
+
+	if (path1 == NULL) {
+		path1 = gtk_tree_path_new_first ();
+	}
+	if (path2 == NULL) {
+		gint n_items = gtk_tree_model_iter_n_children (gtk_icon_view_get_model (GTK_ICON_VIEW (thumbview)), NULL);
+		path2 = gtk_tree_path_new_from_indices (n_items - 1 , -1);
+	}
+
+	eom_thumb_view_update_visible_range (thumbview, gtk_tree_path_get_indices (path1) [0],
+					     gtk_tree_path_get_indices (path2) [0]);
+
+	gtk_tree_path_free (path1);
+	gtk_tree_path_free (path2);
+
+	return FALSE;
+}
+
+static void
+eom_thumb_view_visible_range_changed (EomThumbView *thumbview)
+{
+	if (thumbview->priv->visible_range_changed_id == 0) {
+		g_idle_add ((GSourceFunc)visible_range_changed_cb, thumbview);
+	}
+
+}
+
+static void
+thumbview_on_visible_range_changed_cb (EomThumbView *thumbview,
+				       gpointer user_data)
+{
+	eom_thumb_view_visible_range_changed (thumbview);
+}
+
+static void
+thumbview_on_adjustment_changed_cb (EomThumbView *thumbview,
+				    gpointer user_data)
+{
+	eom_thumb_view_visible_range_changed (thumbview);
+}
+
+static void
+thumbview_on_parent_set_cb (GtkWidget *widget,
+			    GtkWidget *old_parent,
+			    gpointer   user_data)
+{
+	EomThumbView *thumbview = EOM_THUMB_VIEW (widget);
+	GtkScrolledWindow *sw;
+	GtkAdjustment *hadjustment;
+	GtkAdjustment *vadjustment;
+
+	GtkWidget *parent = gtk_widget_get_parent (GTK_WIDGET (thumbview));
+	if (!GTK_IS_SCROLLED_WINDOW (parent)) {
+		return;
+	}
+
+	/* if we have been set to a ScrolledWindow, we connect to the callback
+	   to set and unset thumbnails. */
+	sw = GTK_SCROLLED_WINDOW (parent);
+	hadjustment = gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (sw));
+	vadjustment = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (sw));
+
+	/* when scrolling */
+	g_signal_connect_data (hadjustment, "value-changed",
+	                       G_CALLBACK (thumbview_on_visible_range_changed_cb),
+	                       thumbview, NULL, G_CONNECT_SWAPPED | G_CONNECT_AFTER);
+	g_signal_connect_data (vadjustment, "value-changed",
+	                       G_CALLBACK (thumbview_on_visible_range_changed_cb),
+	                       thumbview, NULL, G_CONNECT_SWAPPED | G_CONNECT_AFTER);
+
+	/* when the adjustment is changed, ie. probably we have new images added. */
+	g_signal_connect_data (hadjustment, "changed",
+	                       G_CALLBACK (thumbview_on_adjustment_changed_cb),
+	                       thumbview, NULL, G_CONNECT_SWAPPED | G_CONNECT_AFTER);
+	g_signal_connect_data (vadjustment, "changed",
+	                       G_CALLBACK (thumbview_on_adjustment_changed_cb),
+	                       thumbview, NULL, G_CONNECT_SWAPPED | G_CONNECT_AFTER);
+
+	/* when resizing the scrolled window */
+	g_signal_connect_swapped (G_OBJECT (sw), "size-allocate",
+				  G_CALLBACK (thumbview_on_visible_range_changed_cb),
+				  thumbview);
+}
+
+static gboolean
+thumbview_on_button_press_event_cb (GtkWidget *thumbview, GdkEventButton *event,
+				    gpointer user_data)
+{
+	GtkTreePath *path;
+
+	/* Ignore double-clicks and triple-clicks */
+	if (event->button == 3 && event->type == GDK_BUTTON_PRESS)
+	{
+		path = gtk_icon_view_get_path_at_pos (GTK_ICON_VIEW (thumbview),
+						      (gint) event->x, (gint) event->y);
+		if (path == NULL) {
+			return FALSE;
+		}
+
+		if (!gtk_icon_view_path_is_selected (GTK_ICON_VIEW (thumbview), path) ||
+		    eom_thumb_view_get_n_selected (EOM_THUMB_VIEW (thumbview)) != 1) {
+			gtk_icon_view_unselect_all (GTK_ICON_VIEW (thumbview));
+			gtk_icon_view_select_path (GTK_ICON_VIEW (thumbview), path);
+			gtk_icon_view_set_cursor (GTK_ICON_VIEW (thumbview), path, NULL, FALSE);
+		}
+		eom_thumb_view_popup_menu (EOM_THUMB_VIEW (thumbview), event);
+
+		gtk_tree_path_free (path);
+
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+static void
+thumbview_on_drag_data_get_cb (GtkWidget        *widget,
+			       GdkDragContext   *drag_context,
+			       GtkSelectionData *data,
+			       guint             info,
+			       guint             time,
+			       gpointer          user_data)
+{
+	GList *list;
+	GList *node;
+	EomImage *image;
+	GFile *file;
+	gchar **uris = NULL;
+	gint i = 0, n_images;
+
+	list = eom_thumb_view_get_selected_images (EOM_THUMB_VIEW (widget));
+	n_images = eom_thumb_view_get_n_selected (EOM_THUMB_VIEW (widget));
+
+	uris = g_new (gchar *, n_images + 1);
+
+	for (node = list; node != NULL; node = node->next, i++) {
+		image = EOM_IMAGE (node->data);
+		file = eom_image_get_file (image);
+		uris[i] = g_file_get_uri (file);
+		g_object_unref (image);
+		g_object_unref (file);
+	}
+	uris[i] = NULL;
+
+	gtk_selection_data_set_uris (data, uris);
+	g_strfreev (uris);
+	g_list_free (list);
+}
+
+static gchar *
+thumbview_get_tooltip_string (EomImage *image)
+{
+	gchar *bytes;
+	char *type_str;
+	gint width, height;
+	GFile *file;
+	GFileInfo *file_info;
+	const char *mime_str;
+	gchar *tooltip_string;
+#ifdef HAVE_EXIF
+	ExifData *exif_data;
+#endif
+
+	bytes = g_format_size (eom_image_get_bytes (image));
+
+	eom_image_get_size (image, &width, &height);
+
+	file = eom_image_get_file (image);
+	file_info = g_file_query_info (file,
+				       G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+				       0, NULL, NULL);
+	g_object_unref (file);
+	if (file_info == NULL) {
+		g_free (bytes);
+		return NULL;
+	}
+
+	mime_str = g_file_info_get_content_type (file_info);
+
+	if (G_UNLIKELY (mime_str == NULL)) {
+		g_free (bytes);
+		g_object_unref (image);
+		return NULL;
+	}
+
+	type_str = g_content_type_get_description (mime_str);
+	g_object_unref (file_info);
+
+	if (width > -1 && height > -1) {
+		tooltip_string = g_markup_printf_escaped ("<b><big>%s</big></b>\n"
+							  "%i x %i %s\n"
+							  "%s\n"
+							  "%s",
+							  eom_image_get_caption (image),
+							  width,
+							  height,
+							  ngettext ("pixel",
+								    "pixels",
+								    height),
+							  bytes,
+							  type_str);
+	} else {
+		tooltip_string = g_markup_printf_escaped ("<b><big>%s</big></b>\n"
+							  "%s\n"
+							  "%s",
+							  eom_image_get_caption (image),
+							  bytes,
+							  type_str);
+
+	}
+
+#ifdef HAVE_EXIF
+	exif_data = (ExifData *) eom_image_get_exif_info (image);
+
+	if (exif_data) {
+		gchar *extra_info, *tmp, *date;
+		/* The EXIF standard says that the DATE_TIME tag is
+		 * 20 bytes long. A 32-byte buffer should be large enough. */
+		gchar time_buffer[32];
+
+		date = eom_exif_util_format_date (
+			eom_exif_data_get_value (exif_data, EXIF_TAG_DATE_TIME_ORIGINAL, time_buffer, 32));
+
+		if (date) {
+			extra_info = g_strdup_printf ("\n%s %s", _("Taken on"), date);
+
+			tmp = g_strconcat (tooltip_string, extra_info, NULL);
+
+			g_free (date);
+			g_free (extra_info);
+			g_free (tooltip_string);
+
+			tooltip_string = tmp;
+		}
+		exif_data_unref (exif_data);
+	}
+#endif
+
+	g_free (type_str);
+	g_free (bytes);
+
+	return tooltip_string;
+}
+
+static void
+on_data_loaded_cb (EomJob *job, gpointer data)
+{
+	if (!job->error) {
+		gtk_tooltip_trigger_tooltip_query (gdk_display_get_default());
+	}
+}
+
+static gboolean
+thumbview_on_query_tooltip_cb (GtkWidget  *widget,
+			       gint        x,
+			       gint        y,
+			       gboolean    keyboard_mode,
+			       GtkTooltip *tooltip,
+			       gpointer    user_data)
+{
+	GtkTreePath *path;
+	EomImage *image;
+	gchar *tooltip_string;
+	EomImageData data = 0;
+
+	if (!gtk_icon_view_get_tooltip_context (GTK_ICON_VIEW (widget),
+						&x, &y, keyboard_mode,
+						NULL, &path, NULL)) {
+		return FALSE;
+	}
+
+	image = eom_thumb_view_get_image_from_path (EOM_THUMB_VIEW (widget),
+						    path);
+	gtk_tree_path_free (path);
+
+	if (image == NULL) {
+		return FALSE;
+	}
+
+	if (!eom_image_has_data (image, EOM_IMAGE_DATA_EXIF) &&
+            eom_image_get_metadata_status (image) == EOM_IMAGE_METADATA_NOT_READ) {
+		data = EOM_IMAGE_DATA_EXIF;
+	}
+
+	if (!eom_image_has_data (image, EOM_IMAGE_DATA_DIMENSION)) {
+		data |= EOM_IMAGE_DATA_DIMENSION;
+	}
+
+	if (data) {
+		EomJob *job;
+
+		job = eom_job_load_new (image, data);
+		g_signal_connect (job, "finished",
+		                  G_CALLBACK (on_data_loaded_cb),
+		                  widget);
+		eom_job_queue_add_job (job);
+		g_object_unref (image);
+		g_object_unref (job);
+		return FALSE;
+	}
+
+	tooltip_string = thumbview_get_tooltip_string (image);
+	g_object_unref (image);
+
+	if (tooltip_string == NULL) {
+		return FALSE;
+	}
+
+	gtk_tooltip_set_markup (tooltip, tooltip_string);
+	g_free (tooltip_string);
+
+	return TRUE;
+}
+
+static void
+eom_thumb_view_init (EomThumbView *thumbview)
+{
+	thumbview->priv = eom_thumb_view_get_instance_private (thumbview);
+
+	thumbview->priv->visible_range_changed_id = 0;
+	thumbview->priv->image_add_id = 0;
+	thumbview->priv->image_removed_id = 0;
+}
+
+/**
+ * eom_thumb_view_new:
+ *
+ * Creates a new #EomThumbView object.
+ *
+ * Returns: a newly created #EomThumbView.
+ **/
+GtkWidget *
+eom_thumb_view_new (void)
+{
+	EomThumbView *thumbview;
+
+	thumbview = g_object_new (EOM_TYPE_THUMB_VIEW, NULL);
+
+	return GTK_WIDGET (thumbview);
+}
+
+static void
+eom_thumb_view_update_columns (EomThumbView *view)
+{
+	EomThumbViewPrivate *priv;
+
+	g_return_if_fail (EOM_IS_THUMB_VIEW (view));
+
+	priv = view->priv;
+
+	if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+			gtk_icon_view_set_columns (GTK_ICON_VIEW (view),
+			                           priv->n_images);
+}
+
+static void
+eom_thumb_view_row_inserted_cb (GtkTreeModel    *tree_model,
+                                GtkTreePath     *path,
+                                GtkTreeIter     *iter,
+                                EomThumbView    *view)
+{
+	EomThumbViewPrivate *priv = view->priv;
+
+	priv->n_images++;
+	eom_thumb_view_update_columns (view);
+}
+
+static void
+eom_thumb_view_row_deleted_cb (GtkTreeModel    *tree_model,
+                               GtkTreePath     *path,
+                               EomThumbView    *view)
+{
+	EomThumbViewPrivate *priv = view->priv;
+
+	priv->n_images--;
+	eom_thumb_view_update_columns (view);
+}
+
+/**
+ * eom_thumb_view_set_model:
+ * @thumbview: A #EomThumbView.
+ * @store: A #EomListStore.
+ *
+ * Sets the #EomListStore to be used with @thumbview. If an initial image
+ * was set during @store creation, its thumbnail will be selected and visible.
+ *
+ **/
+void
+eom_thumb_view_set_model (EomThumbView *thumbview, EomListStore *store)
+{
+	gint index;
+	EomThumbViewPrivate *priv;
+	GtkTreeModel *existing;
+
+	g_return_if_fail (EOM_IS_THUMB_VIEW (thumbview));
+	g_return_if_fail (EOM_IS_LIST_STORE (store));
+
+	priv = thumbview->priv;
+
+	existing = gtk_icon_view_get_model (GTK_ICON_VIEW (thumbview));
+
+	if (existing != NULL) {
+		if (priv->image_add_id != 0) {
+			g_signal_handler_disconnect (existing,
+			                             priv->image_add_id);
+		}
+		if (priv->image_removed_id != 0) {
+			g_signal_handler_disconnect (existing,
+			                             priv->image_removed_id);
+
+		}
+	}
+
+	priv->image_add_id = g_signal_connect (store, "row-inserted",
+	                                       G_CALLBACK (eom_thumb_view_row_inserted_cb),
+	                                       thumbview);
+	priv->image_removed_id = g_signal_connect (store, "row-deleted",
+	                                           G_CALLBACK (eom_thumb_view_row_deleted_cb),
+	                                           thumbview);
+
+	thumbview->priv->n_images = eom_list_store_length (store);
+
+	index = eom_list_store_get_initial_pos (store);
+
+	gtk_icon_view_set_model (GTK_ICON_VIEW (thumbview),
+	                         GTK_TREE_MODEL (store));
+
+	eom_thumb_view_update_columns (thumbview);
+
+	if (index >= 0) {
+		GtkTreePath *path = gtk_tree_path_new_from_indices (index, -1);
+		gtk_icon_view_select_path (GTK_ICON_VIEW (thumbview), path);
+		gtk_icon_view_set_cursor (GTK_ICON_VIEW (thumbview), path, NULL, FALSE);
+		gtk_icon_view_scroll_to_path (GTK_ICON_VIEW (thumbview), path, FALSE, 0, 0);
+		gtk_tree_path_free (path);
+	}
+}
+
+/**
+ * eom_thumb_view_set_item_height:
+ * @thumbview: A #EomThumbView.
+ * @height: The desired height.
+ *
+ * Sets the height of each thumbnail in @thumbview.
+ *
+ **/
+void
+eom_thumb_view_set_item_height (EomThumbView *thumbview, gint height)
+{
+	g_return_if_fail (EOM_IS_THUMB_VIEW (thumbview));
+
+	g_object_set (thumbview->priv->pixbuf_cell,
+	              "height", height,
+	              NULL);
+}
+
+static void
+eom_thumb_view_get_n_selected_helper (GtkIconView *thumbview,
+				      GtkTreePath *path,
+				      gpointer data)
+{
+	/* data is of type (guint *) */
+	(*(guint *) data) ++;
+}
+
+/**
+ * eom_thumb_view_get_n_selected:
+ * @thumbview: An #EomThumbView.
+ *
+ * Gets the number of images that are currently selected in @thumbview.
+ *
+ * Returns: the number of selected images in @thumbview.
+ **/
+guint
+eom_thumb_view_get_n_selected (EomThumbView *thumbview)
+{
+	guint count = 0;
+	gtk_icon_view_selected_foreach (GTK_ICON_VIEW (thumbview),
+					eom_thumb_view_get_n_selected_helper,
+					(&count));
+	return count;
+}
+
+/**
+ * eom_thumb_view_get_image_from_path:
+ * @thumbview: A #EomThumbView.
+ * @path: A #GtkTreePath pointing to a #EomImage in the model for @thumbview.
+ *
+ * Gets the #EomImage stored in @thumbview's #EomListStore at the position indicated
+ * by @path.
+ *
+ * Returns: (transfer full): A #EomImage.
+ **/
+static EomImage *
+eom_thumb_view_get_image_from_path (EomThumbView *thumbview, GtkTreePath *path)
+{
+	GtkTreeModel *model;
+	GtkTreeIter iter;
+	EomImage *image;
+
+	model = gtk_icon_view_get_model (GTK_ICON_VIEW (thumbview));
+	gtk_tree_model_get_iter (model, &iter, path);
+
+	gtk_tree_model_get (model, &iter,
+			    EOM_LIST_STORE_EOM_IMAGE, &image,
+			    -1);
+
+	return image;
+}
+
+/**
+ * eom_thumb_view_get_first_selected_image:
+ * @thumbview: A #EomThumbView.
+ *
+ * Returns the first selected image. Note that the returned #EomImage
+ * is not ensured to be really the first selected image in @thumbview, but
+ * generally, it will be.
+ *
+ * Returns: (transfer full): A #EomImage.
+ **/
+EomImage *
+eom_thumb_view_get_first_selected_image (EomThumbView *thumbview)
+{
+	/* The returned list is not sorted! We need to find the
+	   smaller tree path value => tricky and expensive. Do we really need this?
+	*/
+	EomImage *image;
+	GtkTreePath *path;
+	GList *list = gtk_icon_view_get_selected_items (GTK_ICON_VIEW (thumbview));
+
+	if (list == NULL) {
+		return NULL;
+	}
+
+	path = (GtkTreePath *) (list->data);
+
+	image = eom_thumb_view_get_image_from_path (thumbview, path);
+
+	g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free);
+
+	return image;
+}
+
+/**
+ * eom_thumb_view_get_selected_images:
+ * @thumbview: A #EomThumbView.
+ *
+ * Gets a list with the currently selected images. Note that a new reference is
+ * hold for each image and the list must be freed with g_list_free().
+ *
+ * Returns: (element-type EomImage) (transfer full): A newly allocated list of #EomImage's.
+ **/
+GList *
+eom_thumb_view_get_selected_images (EomThumbView *thumbview)
+{
+	GList *l, *item;
+	GList *list = NULL;
+
+	GtkTreePath *path;
+
+	l = gtk_icon_view_get_selected_items (GTK_ICON_VIEW (thumbview));
+
+	for (item = l; item != NULL; item = item->next) {
+		path = (GtkTreePath *) item->data;
+		list = g_list_prepend (list, eom_thumb_view_get_image_from_path (thumbview, path));
+		gtk_tree_path_free (path);
+	}
+
+	g_list_free (l);
+	list = g_list_reverse (list);
+
+	return list;
+}
+
+/**
+ * eom_thumb_view_set_current_image:
+ * @thumbview: A #EomThumbView.
+ * @image: The image to be selected.
+ * @deselect_other: Whether to deselect currently selected images.
+ *
+ * Changes the status of a image, marking it as currently selected.
+ * If @deselect_other is %TRUE, all other selected images will be
+ * deselected.
+ *
+ **/
+void
+eom_thumb_view_set_current_image (EomThumbView *thumbview, EomImage *image,
+				  gboolean deselect_other)
+{
+	GtkTreePath *path;
+	EomListStore *store;
+	gint pos;
+
+	store = EOM_LIST_STORE (gtk_icon_view_get_model (GTK_ICON_VIEW (thumbview)));
+	pos = eom_list_store_get_pos_by_image (store, image);
+	path = gtk_tree_path_new_from_indices (pos, -1);
+
+	if (path == NULL) {
+		return;
+	}
+
+	if (deselect_other) {
+		gtk_icon_view_unselect_all (GTK_ICON_VIEW (thumbview));
+	}
+
+	gtk_icon_view_select_path (GTK_ICON_VIEW (thumbview), path);
+	gtk_icon_view_set_cursor (GTK_ICON_VIEW (thumbview), path, NULL, FALSE);
+	gtk_icon_view_scroll_to_path (GTK_ICON_VIEW (thumbview), path, FALSE, 0, 0);
+
+	gtk_tree_path_free (path);
+}
+
+/**
+ * eom_thumb_view_select_single:
+ * @thumbview: A #EomThumbView.
+ * @change: A #EomThumbViewSelectionChange, describing the
+ * desired selection change.
+ *
+ * Changes the current selection according to a single movement
+ * described by #EomThumbViewSelectionChange. If there are no
+ * thumbnails currently selected, one is selected according to the
+ * natural selection according to the #EomThumbViewSelectionChange
+ * used, p.g., when %EOM_THUMB_VIEW_SELECT_RIGHT is the selected change,
+ * the first thumbnail will be selected.
+ *
+ **/
+void
+eom_thumb_view_select_single (EomThumbView *thumbview,
+			      EomThumbViewSelectionChange change)
+{
+  	GtkTreePath *path = NULL;
+	GtkTreeModel *model;
+	GList *list;
+	gint n_items;
+
+	g_return_if_fail (EOM_IS_THUMB_VIEW (thumbview));
+
+	model = gtk_icon_view_get_model (GTK_ICON_VIEW (thumbview));
+
+	n_items = eom_list_store_length (EOM_LIST_STORE (model));
+
+	if (n_items == 0) {
+		return;
+	}
+
+	if (eom_thumb_view_get_n_selected (thumbview) == 0) {
+		switch (change) {
+		case EOM_THUMB_VIEW_SELECT_CURRENT:
+			break;
+		case EOM_THUMB_VIEW_SELECT_RIGHT:
+		case EOM_THUMB_VIEW_SELECT_FIRST:
+			path = gtk_tree_path_new_first ();
+			break;
+		case EOM_THUMB_VIEW_SELECT_LEFT:
+		case EOM_THUMB_VIEW_SELECT_LAST:
+			path = gtk_tree_path_new_from_indices (n_items - 1, -1);
+			break;
+		case EOM_THUMB_VIEW_SELECT_RANDOM:
+			path = gtk_tree_path_new_from_indices (g_random_int_range (0, n_items), -1);
+			break;
+		}
+	} else {
+		list = gtk_icon_view_get_selected_items (GTK_ICON_VIEW (thumbview));
+		path = gtk_tree_path_copy ((GtkTreePath *) list->data);
+		g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free);
+
+		gtk_icon_view_unselect_all (GTK_ICON_VIEW (thumbview));
+
+		switch (change) {
+		case EOM_THUMB_VIEW_SELECT_CURRENT:
+			break;
+		case EOM_THUMB_VIEW_SELECT_LEFT:
+			if (!gtk_tree_path_prev (path)) {
+				gtk_tree_path_free (path);
+				path = gtk_tree_path_new_from_indices (n_items - 1, -1);
+			}
+			break;
+		case EOM_THUMB_VIEW_SELECT_RIGHT:
+			if (gtk_tree_path_get_indices (path) [0] == n_items - 1) {
+				gtk_tree_path_free (path);
+				path = gtk_tree_path_new_first ();
+			} else {
+				gtk_tree_path_next (path);
+			}
+			break;
+		case EOM_THUMB_VIEW_SELECT_FIRST:
+			gtk_tree_path_free (path);
+			path = gtk_tree_path_new_first ();
+			break;
+		case EOM_THUMB_VIEW_SELECT_LAST:
+			gtk_tree_path_free (path);
+			path = gtk_tree_path_new_from_indices (n_items - 1, -1);
+			break;
+		case EOM_THUMB_VIEW_SELECT_RANDOM:
+			gtk_tree_path_free (path);
+			path = gtk_tree_path_new_from_indices (g_random_int_range (0, n_items), -1);
+			break;
+		}
+	}
+
+	gtk_icon_view_select_path (GTK_ICON_VIEW (thumbview), path);
+	gtk_icon_view_set_cursor (GTK_ICON_VIEW (thumbview), path, NULL, FALSE);
+	gtk_icon_view_scroll_to_path (GTK_ICON_VIEW (thumbview), path, FALSE, 0, 0);
+	gtk_tree_path_free (path);
+}
+
+/**
+ * eom_thumb_view_set_thumbnail_popup:
+ * @thumbview: An #EomThumbView.
+ * @menu: A #GtkMenu.
+ *
+ * Set the contextual menu to be used with the thumbnails in the
+ * widget. This can be done only once.
+ *
+ **/
+void
+eom_thumb_view_set_thumbnail_popup (EomThumbView *thumbview,
+				    GtkMenu      *menu)
+{
+	g_return_if_fail (EOM_IS_THUMB_VIEW (thumbview));
+	g_return_if_fail (thumbview->priv->menu == NULL);
+
+	thumbview->priv->menu = g_object_ref (GTK_WIDGET (menu));
+
+	gtk_menu_attach_to_widget (GTK_MENU (thumbview->priv->menu),
+				   GTK_WIDGET (thumbview),
+				   NULL);
+
+	g_signal_connect (thumbview, "button_press_event",
+	                  G_CALLBACK (thumbview_on_button_press_event_cb),
+	                  NULL);
+}
+
+static void
+eom_thumb_view_popup_menu (EomThumbView *thumbview, GdkEventButton *event)
+{
+	g_return_if_fail (event != NULL);
+
+	gtk_menu_popup_at_pointer (GTK_MENU (thumbview->priv->menu),
+	                           (const GdkEvent*) event);
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/91.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/91.html new file mode 100644 index 0000000..53ca91d --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/91.html @@ -0,0 +1,1321 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye Of Mate - Thumbnailing functions
+ *
+ * Copyright (C) 2000-2008 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on eel code (eel/eel-graphic-effects.c) by:
+ * 	- Andy Hertzfeld <andy@eazel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+/* We must define MATE_DESKTOP_USE_UNSTABLE_API to be able
+   to use MateDesktopThumbnail */
+#ifndef MATE_DESKTOP_USE_UNSTABLE_API
+#define MATE_DESKTOP_USE_UNSTABLE_API
+#endif
+#include <libmate-desktop/mate-desktop-thumbnail.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "eom-thumbnail.h"
+#include "eom-list-store.h"
+#include "eom-debug.h"
+
+#define EOM_THUMB_ERROR eom_thumb_error_quark ()
+
+static MateDesktopThumbnailFactory *factory = NULL;
+static GdkPixbuf *frame = NULL;
+
+typedef enum {
+	EOM_THUMB_ERROR_VFS,
+	EOM_THUMB_ERROR_GENERIC,
+	EOM_THUMB_ERROR_UNKNOWN
+} EomThumbError;
+
+typedef struct {
+	char    *uri_str;
+	char    *thumb_path;
+	time_t   mtime;
+	char    *mime_type;
+	gboolean thumb_exists;
+	gboolean failed_thumb_exists;
+	gboolean can_read;
+} EomThumbData;
+
+static GQuark
+eom_thumb_error_quark (void)
+{
+	static GQuark q = 0;
+	if (q == 0)
+		q = g_quark_from_static_string ("eom-thumb-error-quark");
+
+	return q;
+}
+
+static void
+set_vfs_error (GError **error, GError *ioerror)
+{
+	g_set_error (error,
+		     EOM_THUMB_ERROR,
+		     EOM_THUMB_ERROR_VFS,
+		     "%s", ioerror ? ioerror->message : "VFS error making a thumbnail");
+}
+
+static void
+set_thumb_error (GError **error, int error_id, const char *string)
+{
+	g_set_error (error,
+		     EOM_THUMB_ERROR,
+		     error_id,
+		     "%s", string);
+}
+
+static GdkPixbuf*
+get_valid_thumbnail (EomThumbData *data, GError **error)
+{
+	GdkPixbuf *thumb = NULL;
+
+	g_return_val_if_fail (data != NULL, NULL);
+
+	/* does a thumbnail under the path exists? */
+	if (data->thumb_exists) {
+		thumb = gdk_pixbuf_new_from_file (data->thumb_path, error);
+
+		/* is this thumbnail file up to date? */
+		if (thumb != NULL && !mate_desktop_thumbnail_is_valid (thumb, data->uri_str, data->mtime)) {
+			g_object_unref (thumb);
+			thumb = NULL;
+		}
+	}
+
+	return thumb;
+}
+
+static GdkPixbuf *
+create_thumbnail_from_pixbuf (EomThumbData *data,
+			      GdkPixbuf *pixbuf,
+			      GError **error)
+{
+	GdkPixbuf *thumb;
+	gint width, height;
+	gfloat perc;
+
+	g_assert (factory != NULL);
+
+	width = gdk_pixbuf_get_width (pixbuf);
+	height = gdk_pixbuf_get_height (pixbuf);
+
+	perc = CLAMP (128.0/(MAX (width, height)), 0, 1);
+
+	thumb = gdk_pixbuf_scale_simple (pixbuf,
+	                                 width*perc,
+	                                 height*perc,
+	                                 GDK_INTERP_HYPER);
+
+	return thumb;
+}
+
+static void
+eom_thumb_data_free (EomThumbData *data)
+{
+	if (data == NULL)
+		return;
+
+	g_free (data->thumb_path);
+	g_free (data->mime_type);
+	g_free (data->uri_str);
+
+	g_slice_free (EomThumbData, data);
+}
+
+static EomThumbData*
+eom_thumb_data_new (GFile *file, GError **error)
+{
+	EomThumbData *data;
+	GFileInfo *file_info;
+	GError *ioerror = NULL;
+
+	g_return_val_if_fail (file != NULL, NULL);
+	g_return_val_if_fail (error != NULL && *error == NULL, NULL);
+
+	data = g_slice_new0 (EomThumbData);
+
+	data->uri_str    = g_file_get_uri (file);
+	data->thumb_path = mate_desktop_thumbnail_path_for_uri (data->uri_str, MATE_DESKTOP_THUMBNAIL_SIZE_NORMAL);
+
+	file_info = g_file_query_info (file,
+				       G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE ","
+				       G_FILE_ATTRIBUTE_TIME_MODIFIED ","<--- There is an unknown macro here somewhere. Configuration is required. If G_FILE_ATTRIBUTE_TIME_MODIFIED is a macro then please configure it.
+				       G_FILE_ATTRIBUTE_THUMBNAIL_PATH ","
+				       G_FILE_ATTRIBUTE_THUMBNAILING_FAILED ","
+				       G_FILE_ATTRIBUTE_ACCESS_CAN_READ,
+				       0, NULL, &ioerror);
+	if (file_info == NULL)
+	{
+		set_vfs_error (error, ioerror);
+		g_clear_error (&ioerror);
+	}
+
+	if (*error == NULL) {
+		/* if available, copy data */
+		data->mtime = g_file_info_get_attribute_uint64 (file_info,
+								G_FILE_ATTRIBUTE_TIME_MODIFIED);
+		data->mime_type = g_strdup (g_file_info_get_content_type (file_info));
+
+		data->thumb_exists = (g_file_info_get_attribute_byte_string (file_info,
+					                                     G_FILE_ATTRIBUTE_THUMBNAIL_PATH) != NULL);
+		data->failed_thumb_exists = g_file_info_get_attribute_boolean (file_info,
+									       G_FILE_ATTRIBUTE_THUMBNAILING_FAILED);
+		data->can_read = TRUE;
+		if (g_file_info_has_attribute (file_info, G_FILE_ATTRIBUTE_ACCESS_CAN_READ)) {
+			data->can_read = g_file_info_get_attribute_boolean (file_info,
+									    G_FILE_ATTRIBUTE_ACCESS_CAN_READ);
+		}
+	}
+	else {
+		eom_thumb_data_free (data);
+		data = NULL;
+		g_clear_error (&ioerror);
+	}
+
+	g_object_unref (file_info);
+
+	return data;
+}
+
+static void
+draw_frame_row (GdkPixbuf *frame_image,
+		gint target_width,
+		gint source_width,
+		gint source_v_position,
+		gint dest_v_position,
+		GdkPixbuf *result_pixbuf,
+		gint left_offset,
+		gint height)
+{
+	gint remaining_width, h_offset, slab_width;
+
+	remaining_width = target_width;
+	h_offset = 0;
+
+	while (remaining_width > 0) {
+		slab_width = remaining_width > source_width ?
+			     source_width : remaining_width;
+
+		gdk_pixbuf_copy_area (frame_image,
+				      left_offset,
+				      source_v_position,
+				      slab_width,
+				      height,
+				      result_pixbuf,
+				      left_offset + h_offset,
+				      dest_v_position);
+
+		remaining_width -= slab_width;
+		h_offset += slab_width;
+	}
+}
+
+static void
+draw_frame_column (GdkPixbuf *frame_image,
+		   gint target_height,
+		   gint source_height,
+		   gint source_h_position,
+		   gint dest_h_position,
+		   GdkPixbuf *result_pixbuf,
+		   gint top_offset,
+		   gint width)
+{
+	gint remaining_height, v_offset, slab_height;
+
+	remaining_height = target_height;
+	v_offset = 0;
+
+	while (remaining_height > 0) {
+		slab_height = remaining_height > source_height ?
+			      source_height : remaining_height;
+
+		gdk_pixbuf_copy_area (frame_image,
+				      source_h_position,
+				      top_offset,
+				      width,
+				      slab_height,
+				      result_pixbuf,
+				      dest_h_position,
+				      top_offset + v_offset);
+
+		remaining_height -= slab_height;
+		v_offset += slab_height;
+	}
+}
+
+static GdkPixbuf *
+eom_thumbnail_stretch_frame_image (GdkPixbuf *frame_image,
+				   gint left_offset,
+				   gint top_offset,
+				   gint right_offset,
+				   gint bottom_offset,
+                                   gint dest_width,
+				   gint dest_height,
+				   gboolean fill_flag)
+{
+        GdkPixbuf *result_pixbuf;
+        gint frame_width, frame_height;
+        gint target_width, target_frame_width;
+        gint target_height, target_frame_height;
+
+        frame_width  = gdk_pixbuf_get_width  (frame_image);
+        frame_height = gdk_pixbuf_get_height (frame_image);
+
+        if (fill_flag) {
+		result_pixbuf = gdk_pixbuf_scale_simple (frame_image,
+							 dest_width,
+							 dest_height,
+							 GDK_INTERP_NEAREST);
+        } else {
+                result_pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
+						TRUE,
+						8,
+						dest_width,
+						dest_height);
+
+		/* Clear pixbuf to fully opaque white */
+		gdk_pixbuf_fill (result_pixbuf, 0xffffffff);
+        }
+
+        target_width  = dest_width - left_offset - right_offset;
+        target_frame_width = frame_width - left_offset - right_offset;
+
+        target_height  = dest_height - top_offset - bottom_offset;
+        target_frame_height = frame_height - top_offset - bottom_offset;
+
+        /* Draw the left top corner  and top row */
+        gdk_pixbuf_copy_area (frame_image,
+			      0, 0,
+			      left_offset,
+			      top_offset,
+			      result_pixbuf,
+			      0, 0);
+
+        draw_frame_row (frame_image,
+			target_width,
+			target_frame_width,
+			0, 0,
+			result_pixbuf,
+			left_offset,
+			top_offset);
+
+        /* Draw the right top corner and left column */
+        gdk_pixbuf_copy_area (frame_image,
+			      frame_width - right_offset,
+			      0,
+			      right_offset,
+			      top_offset,
+			      result_pixbuf,
+			      dest_width - right_offset,
+			      0);
+
+        draw_frame_column (frame_image,
+			   target_height,
+			   target_frame_height,
+			   0, 0,
+			   result_pixbuf,
+			   top_offset,
+			   left_offset);
+
+        /* Draw the bottom right corner and bottom row */
+        gdk_pixbuf_copy_area (frame_image,
+			      frame_width - right_offset,
+			      frame_height - bottom_offset,
+			      right_offset,
+			      bottom_offset,
+			      result_pixbuf,
+			      dest_width - right_offset,
+			      dest_height - bottom_offset);
+
+        draw_frame_row (frame_image,
+			target_width,
+			target_frame_width,
+			frame_height - bottom_offset,
+			dest_height - bottom_offset,
+			result_pixbuf,
+			left_offset, bottom_offset);
+
+        /* Draw the bottom left corner and the right column */
+        gdk_pixbuf_copy_area (frame_image,
+			      0,
+			      frame_height - bottom_offset,
+			      left_offset,
+			      bottom_offset,
+			      result_pixbuf,
+			      0,
+			      dest_height - bottom_offset);
+
+        draw_frame_column (frame_image,
+			   target_height,
+			   target_frame_height,
+			   frame_width - right_offset,
+			   dest_width - right_offset,
+			   result_pixbuf, top_offset,
+			   right_offset);
+
+        return result_pixbuf;
+}
+
+/**
+ * eom_thumbnail_add_frame:
+ * @thumbnail: a #GdkPixbuf
+ *
+ * Adds a frame to @thumbnail
+ *
+ * Returns: (transfer full): a new #GdkPixbuf, storing @thumbnail nicely framed.
+ **/
+GdkPixbuf *
+eom_thumbnail_add_frame (GdkPixbuf *thumbnail)
+{
+	GdkPixbuf *result_pixbuf;
+	gint source_width, source_height;
+	gint dest_width, dest_height;
+
+	source_width  = gdk_pixbuf_get_width  (thumbnail);
+	source_height = gdk_pixbuf_get_height (thumbnail);
+
+	dest_width  = source_width  + 9;
+	dest_height = source_height + 9;
+
+	result_pixbuf = eom_thumbnail_stretch_frame_image (frame,
+							   3, 3, 6, 6,
+	                                	           dest_width,
+							   dest_height,
+							   FALSE);
+
+	gdk_pixbuf_copy_area (thumbnail,
+			      0, 0,
+			      source_width,
+			      source_height,
+			      result_pixbuf,
+			      3, 3);
+
+	return result_pixbuf;
+}
+
+/**
+ * eom_thumbnail_fit_to_size:
+ * @thumbnail: a #GdkPixbuf
+ * @dimension: the maximum width or height desired
+ *
+ * Ensures a pixbuf fits a given @dimension
+ *
+ * Returns: (transfer full): a new #GdkPixbuf
+ **/
+GdkPixbuf *
+eom_thumbnail_fit_to_size (GdkPixbuf *thumbnail, gint dimension)
+{
+	gint width, height;
+
+	width = gdk_pixbuf_get_width (thumbnail);
+	height = gdk_pixbuf_get_height (thumbnail);
+
+	if (width > dimension || height > dimension) {
+		GdkPixbuf *result_pixbuf;
+		gfloat factor;
+
+		if (width > height) {
+			factor = (gfloat) dimension / (gfloat) width;
+		} else {
+			factor = (gfloat) dimension / (gfloat) height;
+		}
+
+		width  = MAX (width  * factor, 1);
+		height = MAX (height * factor, 1);
+
+		result_pixbuf = gdk_pixbuf_scale_simple (thumbnail, width, height, GDK_INTERP_HYPER);
+
+		return result_pixbuf;
+	}
+	return gdk_pixbuf_copy (thumbnail);
+}
+
+/**
+ * eom_thumbnail_load:
+ * @image: a #EomImage
+ * @error: location to store the error ocurring or %NULL to ignore
+ *
+ * Loads the thumbnail for @image. In case of error, %NULL is returned
+ * and @error is set.
+ *
+ * Returns: (transfer full): a new #GdkPixbuf with the thumbnail for
+ * @image or %NULL in case of error.
+ **/
+GdkPixbuf*
+eom_thumbnail_load (EomImage *image, GError **error)
+{
+	GdkPixbuf *thumb = NULL;
+	GFile *file;
+	EomThumbData *data;
+	GdkPixbuf *pixbuf = NULL;
+
+	g_return_val_if_fail (image != NULL, NULL);
+	g_return_val_if_fail (error != NULL && *error == NULL, NULL);
+
+	file = eom_image_get_file (image);
+	data = eom_thumb_data_new (file, error);
+	g_object_unref (file);
+
+	if (data == NULL)
+		return NULL;
+
+	if (!data->can_read ||
+	    (data->failed_thumb_exists && mate_desktop_thumbnail_factory_has_valid_failed_thumbnail (factory, data->uri_str, data->mtime))) {
+		eom_debug_message (DEBUG_THUMBNAIL, "%s: bad permissions or valid failed thumbnail present",data->uri_str);
+		set_thumb_error (error, EOM_THUMB_ERROR_GENERIC, "Thumbnail creation failed");
+		return NULL;
+	}
+
+	/* check if there is already a valid cached thumbnail */
+	thumb = get_valid_thumbnail (data, error);
+
+	if (thumb != NULL) {
+		eom_debug_message (DEBUG_THUMBNAIL, "%s: loaded from cache",data->uri_str);
+	} else if (mate_desktop_thumbnail_factory_can_thumbnail (factory, data->uri_str, data->mime_type, data->mtime)) {
+		/* Only use the image pixbuf when it is up to date. */
+		if (!eom_image_is_file_changed (image))
+			pixbuf = eom_image_get_pixbuf (image);
+
+		if (pixbuf != NULL) {
+			/* generate a thumbnail from the in-memory image,
+			   if we have already loaded the image */
+			eom_debug_message (DEBUG_THUMBNAIL, "%s: creating from pixbuf",data->uri_str);
+			thumb = create_thumbnail_from_pixbuf (data, pixbuf, error);
+			g_object_unref (pixbuf);
+		} else {
+			/* generate a thumbnail from the file */
+			eom_debug_message (DEBUG_THUMBNAIL, "%s: creating from file",data->uri_str);
+			thumb = mate_desktop_thumbnail_factory_generate_thumbnail (factory, data->uri_str, data->mime_type);
+		}
+
+		if (thumb != NULL) {
+			/* Save the new thumbnail */
+			mate_desktop_thumbnail_factory_save_thumbnail (factory, thumb, data->uri_str, data->mtime);
+			eom_debug_message (DEBUG_THUMBNAIL, "%s: normal thumbnail saved",data->uri_str);
+		} else {
+			/* Save a failed thumbnail, to stop further thumbnail attempts */
+			mate_desktop_thumbnail_factory_create_failed_thumbnail (factory, data->uri_str, data->mtime);
+			eom_debug_message (DEBUG_THUMBNAIL, "%s: failed thumbnail saved",data->uri_str);
+			set_thumb_error (error, EOM_THUMB_ERROR_GENERIC, "Thumbnail creation failed");
+		}
+	}
+
+	eom_thumb_data_free (data);
+
+	return thumb;
+}
+
+void
+eom_thumbnail_init (void)
+{
+	if (factory == NULL) {
+		factory = mate_desktop_thumbnail_factory_new (MATE_DESKTOP_THUMBNAIL_SIZE_NORMAL);
+	}
+
+	if (frame == NULL) {
+		frame = gdk_pixbuf_new_from_resource (
+	                    "/org/mate/eom/ui/pixmaps/thumbnail-frame.png",
+	                    NULL);
+	}
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/92.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/92.html new file mode 100644 index 0000000..8d40b29 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/92.html @@ -0,0 +1,1129 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye Of MATE -- Affine Transformations
+ *
+ * Copyright (C) 2003-2009 The Free Software Foundation
+ *
+ * Portions based on code from libart_lgpl by Raph Levien.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <time.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <stdlib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <math.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <cairo/cairo.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "eom-transform.h"
+#include "eom-jobs.h"
+
+/* The number of progress updates per transformation */
+#define EOM_TRANSFORM_N_PROG_UPDATES 20
+
+struct _EomTransformPrivate {
+	cairo_matrix_t affine;
+};
+
+typedef struct {
+	gdouble x;
+	gdouble y;
+} EomPoint;
+
+/* Convert degrees into radians */
+#define EOM_DEG_TO_RAD(degree) ((degree) * (G_PI/180.0))
+
+G_DEFINE_TYPE_WITH_PRIVATE (EomTransform, eom_transform, G_TYPE_OBJECT)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
+
+static void
+eom_transform_init (EomTransform *trans)
+{
+	trans->priv = eom_transform_get_instance_private (trans);
+}
+
+static void
+eom_transform_class_init (EomTransformClass *klass)
+{
+
+}
+
+/**
+ * eom_transform_apply:
+ * @trans: a #EomTransform
+ * @pixbuf: a #GdkPixbuf
+ * @job: a #EomJob
+ *
+ * Applies the transformation in @trans to @pixbuf, setting its progress in @job.
+ *
+ * Returns: (transfer full): A new #GdkPixbuf with the transformation applied.
+ **/
+GdkPixbuf*
+eom_transform_apply (EomTransform *trans, GdkPixbuf *pixbuf, EomJob *job)
+{
+	EomPoint dest_top_left;
+	EomPoint dest_bottom_right;
+	EomPoint vertices[4] = { {0, 0}, {1, 0}, {1, 1}, {0, 1} };
+	double r_det;
+	int inverted [6];
+	EomPoint dest;
+
+	int src_width;
+	int src_height;
+	int src_rowstride;
+	int src_n_channels;
+	guchar *src_buffer;
+
+	GdkPixbuf *dest_pixbuf;
+	int dest_width;
+	int dest_height;
+	int dest_rowstride;
+	int dest_n_channels;
+	guchar *dest_buffer;
+
+	guchar *src_pos;
+	guchar *dest_pos;
+	int dx, dy, sx, sy;
+	int i, x, y;
+
+	int progress_delta;
+
+	g_return_val_if_fail (pixbuf != NULL, NULL);
+
+	g_object_ref (pixbuf);
+
+	src_width = gdk_pixbuf_get_width (pixbuf);
+	src_height = gdk_pixbuf_get_height (pixbuf);
+	src_rowstride = gdk_pixbuf_get_rowstride (pixbuf);
+	src_n_channels = gdk_pixbuf_get_n_channels (pixbuf);
+	src_buffer = gdk_pixbuf_get_pixels (pixbuf);
+
+	/* find out the dimension of the destination pixbuf */
+	dest_top_left.x = 100000;
+	dest_top_left.y = 100000;
+	dest_bottom_right.x = -100000;
+	dest_bottom_right.y = -100000;
+
+	for (i = 0; i < 4; i++) {
+		dest.x = vertices[i].x * (src_width - 1);
+		dest.y = vertices[i].y * (src_height -1);
+
+		cairo_matrix_transform_point (&trans->priv->affine,
+					      &dest.x, &dest.y);
+
+		dest_top_left.x = MIN (dest_top_left.x, dest.x);
+		dest_top_left.y = MIN (dest_top_left.y, dest.y);
+
+		dest_bottom_right.x = MAX (dest_bottom_right.x, dest.x);
+		dest_bottom_right.y = MAX (dest_bottom_right.y, dest.y);
+	}
+
+	/* create the resulting pixbuf */
+	dest_width = abs ((int) (dest_bottom_right.x - dest_top_left.x + 1));
+	dest_height = abs ((int) (dest_bottom_right.y - dest_top_left.y + 1));
+
+	dest_pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
+			       gdk_pixbuf_get_has_alpha (pixbuf),
+			       gdk_pixbuf_get_bits_per_sample (pixbuf),
+			       dest_width,
+			       dest_height);
+	dest_rowstride = gdk_pixbuf_get_rowstride (dest_pixbuf);
+	dest_n_channels = gdk_pixbuf_get_n_channels (dest_pixbuf);
+	dest_buffer = gdk_pixbuf_get_pixels (dest_pixbuf);
+
+	/* invert the matrix so that we can compute the source pixel
+	   from the target pixel and convert the values to integer
+	   ones (faster!)  FIXME: Maybe we can do some more
+	   improvements by using special mmx/3dnow features if
+	   available.
+	*/
+	r_det = 1.0 / (trans->priv->affine.xx * trans->priv->affine.yy - trans->priv->affine.yx * trans->priv->affine.xy);
+	inverted[0] =  trans->priv->affine.yy * r_det;
+	inverted[1] = -trans->priv->affine.yx * r_det;
+	inverted[2] = -trans->priv->affine.xy * r_det;
+	inverted[3] =  trans->priv->affine.xx * r_det;
+	inverted[4] = -trans->priv->affine.x0 * inverted[0] - trans->priv->affine.y0 * inverted[2];
+	inverted[5] = -trans->priv->affine.x0 * inverted[1] - trans->priv->affine.y0 * inverted[3];
+
+	progress_delta = MAX (1, dest_height / EOM_TRANSFORM_N_PROG_UPDATES);
+
+	/*
+	 * for every destination pixel (dx,dy) compute the source pixel (sx, sy)
+	 * and copy the color values
+	 */
+	for (y = 0, dy = dest_top_left.y; y < dest_height; y++, dy++) {
+		for (x = 0, dx = dest_top_left.x; x < dest_width; x++, dx++) {
+
+			sx = dx * inverted[0] + dy * inverted[2] + inverted[4];
+			sy = dx * inverted[1] + dy * inverted[3] + inverted[5];
+
+			if (sx >= 0 && sx < src_width && sy >= 0 && sy < src_height) {
+				src_pos  = src_buffer  + sy * src_rowstride  + sx * src_n_channels;
+				dest_pos = dest_buffer +  y * dest_rowstride +  x * dest_n_channels;
+
+				for (i = 0; i <  src_n_channels; i++) {
+					dest_pos[i] = src_pos[i];
+				}
+			}
+		}
+
+		if (job != NULL && y % progress_delta == 0) {
+			gfloat progress;
+
+			progress = (gfloat) (y + 1.0) / (gfloat) dest_height;
+
+			eom_job_set_progress (job, progress);
+		}
+	}
+
+	g_object_unref (pixbuf);
+
+	if (job != NULL) {
+		eom_job_set_progress (job, 1.0);
+	}
+
+	return dest_pixbuf;
+}
+
+static void
+_eom_cairo_matrix_copy (const cairo_matrix_t *src, cairo_matrix_t *dest)
+{
+	cairo_matrix_init (dest, src->xx, src->yx, src->xy, src->yy, src->x0, src->y0);
+}
+
+#define DOUBLE_EQUAL_MAX_DIFF 1e-6
+#define DOUBLE_EQUAL(a,b) (fabs (a - b) < DOUBLE_EQUAL_MAX_DIFF)
+/* art_affine_equal modified to work with cairo_matrix_t */
+static gboolean
+_eom_cairo_matrix_equal (const cairo_matrix_t *a, const cairo_matrix_t *b)
+{
+	return (DOUBLE_EQUAL (a->xx, b->xx) && DOUBLE_EQUAL (a->yx, b->yx) &&
+		DOUBLE_EQUAL (a->xy, b->xy) && DOUBLE_EQUAL (a->yy, b->yy) &&
+		DOUBLE_EQUAL (a->x0, b->x0) && DOUBLE_EQUAL (a->y0, b->y0) );
+}
+
+/* art_affine_flip modified to work with cairo_matrix_t */
+static void
+_eom_cairo_matrix_flip (cairo_matrix_t *dst, const cairo_matrix_t *src, gboolean horiz, gboolean vert)
+{
+	dst->xx = horiz ? -src->xx : src->xx;
+	dst->yx = horiz ? -src->yx : src->yx;
+	dst->xy = vert ? -src->xy : src->xy;
+	dst->yy = vert ? -src->yy : src->yy;
+	dst->x0 = horiz ? -src->x0 : src->x0;
+	dst->y0 = vert ? -src->y0 : src->y0;
+}
+
+/**
+ * eom_transform_reverse:
+ * @trans: a #EomTransform
+ *
+ * Creates the reverse transformation of @trans
+ *
+ * Returns: (transfer full): a new transformation
+ **/
+EomTransform*
+eom_transform_reverse (EomTransform *trans)
+{
+	EomTransform *reverse;
+
+	g_return_val_if_fail (EOM_IS_TRANSFORM (trans), NULL);
+
+	reverse = EOM_TRANSFORM (g_object_new (EOM_TYPE_TRANSFORM, NULL));
+
+	_eom_cairo_matrix_copy (&trans->priv->affine, &reverse->priv->affine);
+
+	g_return_val_if_fail (cairo_matrix_invert (&reverse->priv->affine) == CAIRO_STATUS_SUCCESS, reverse);
+
+	return reverse;
+}
+
+/**
+ * eom_transform_compose:
+ * @trans: a #EomTransform
+ * @compose: another #EomTransform
+ *
+ *
+ *
+ * Returns: (transfer full): a new transform
+ **/
+EomTransform*
+eom_transform_compose (EomTransform *trans, EomTransform *compose)
+{
+	EomTransform *composition;
+
+	g_return_val_if_fail (EOM_IS_TRANSFORM (trans), NULL);
+	g_return_val_if_fail (EOM_IS_TRANSFORM (compose), NULL);
+
+	composition = EOM_TRANSFORM (g_object_new (EOM_TYPE_TRANSFORM, NULL));
+
+	cairo_matrix_multiply (&composition->priv->affine,
+			       &trans->priv->affine,
+			       &compose->priv->affine);
+
+	return composition;
+}
+
+gboolean
+eom_transform_is_identity (EomTransform *trans)
+{
+	static const cairo_matrix_t identity = { 1, 0, 0, 1, 0, 0 };
+
+	g_return_val_if_fail (EOM_IS_TRANSFORM (trans), FALSE);
+
+	return _eom_cairo_matrix_equal (&identity, &trans->priv->affine);
+}
+
+EomTransform*
+eom_transform_identity_new (void)
+{
+	EomTransform *trans;
+
+	trans = EOM_TRANSFORM (g_object_new (EOM_TYPE_TRANSFORM, NULL));
+
+	cairo_matrix_init_identity (&trans->priv->affine);
+
+	return trans;
+}
+
+EomTransform*
+eom_transform_rotate_new (int degree)
+{
+	EomTransform *trans;
+
+	trans = EOM_TRANSFORM (g_object_new (EOM_TYPE_TRANSFORM, NULL));
+
+	cairo_matrix_init_rotate (&trans->priv->affine, EOM_DEG_TO_RAD(degree));
+
+	return trans;
+}
+
+EomTransform*
+eom_transform_flip_new   (EomTransformType type)
+{
+	EomTransform *trans;
+	gboolean horiz, vert;
+
+	trans = EOM_TRANSFORM (g_object_new (EOM_TYPE_TRANSFORM, NULL));
+
+	cairo_matrix_init_identity (&trans->priv->affine);
+
+	horiz = (type == EOM_TRANSFORM_FLIP_HORIZONTAL);
+	vert = (type == EOM_TRANSFORM_FLIP_VERTICAL);
+
+	_eom_cairo_matrix_flip (&trans->priv->affine,
+				&trans->priv->affine,
+				horiz, vert);
+
+	return trans;
+}
+
+EomTransform*
+eom_transform_new (EomTransformType type)
+{
+	EomTransform *trans = NULL;
+	EomTransform *temp1 = NULL, *temp2 = NULL;
+
+	switch (type) {
+	case EOM_TRANSFORM_NONE:
+		trans = eom_transform_identity_new ();
+		break;
+	case EOM_TRANSFORM_FLIP_HORIZONTAL:
+		trans = eom_transform_flip_new (EOM_TRANSFORM_FLIP_HORIZONTAL);
+		break;
+	case EOM_TRANSFORM_ROT_180:
+		trans = eom_transform_rotate_new (180);
+		break;
+	case EOM_TRANSFORM_FLIP_VERTICAL:
+		trans = eom_transform_flip_new (EOM_TRANSFORM_FLIP_VERTICAL);
+		break;
+	case EOM_TRANSFORM_TRANSPOSE:
+		temp1 = eom_transform_rotate_new (90);
+		temp2 = eom_transform_flip_new (EOM_TRANSFORM_FLIP_HORIZONTAL);
+		trans = eom_transform_compose (temp1, temp2);
+		g_object_unref (temp1);
+		g_object_unref (temp2);
+		break;
+	case EOM_TRANSFORM_ROT_90:
+		trans = eom_transform_rotate_new (90);
+		break;
+	case EOM_TRANSFORM_TRANSVERSE:
+		temp1 = eom_transform_rotate_new (90);
+		temp2 = eom_transform_flip_new (EOM_TRANSFORM_FLIP_VERTICAL);
+		trans = eom_transform_compose (temp1, temp2);
+		g_object_unref (temp1);
+		g_object_unref (temp2);
+		break;
+	case EOM_TRANSFORM_ROT_270:
+		trans = eom_transform_rotate_new (270);
+		break;
+	default:
+		trans = eom_transform_identity_new ();
+		break;
+	}
+
+	return trans;
+}
+
+EomTransformType
+eom_transform_get_transform_type (EomTransform *trans)
+{
+	cairo_matrix_t affine, a1, a2;
+	EomTransformPrivate *priv;
+
+	g_return_val_if_fail (EOM_IS_TRANSFORM (trans), EOM_TRANSFORM_NONE);
+
+	priv = trans->priv;
+
+	cairo_matrix_init_rotate (&affine, EOM_DEG_TO_RAD(90));
+	if (_eom_cairo_matrix_equal (&affine, &priv->affine)) {
+		return EOM_TRANSFORM_ROT_90;
+	}
+
+	cairo_matrix_init_rotate (&affine, EOM_DEG_TO_RAD(180));
+	if (_eom_cairo_matrix_equal (&affine, &priv->affine)) {
+		return EOM_TRANSFORM_ROT_180;
+	}
+
+	cairo_matrix_init_rotate (&affine, EOM_DEG_TO_RAD(270));
+	if (_eom_cairo_matrix_equal (&affine, &priv->affine)) {
+		return EOM_TRANSFORM_ROT_270;
+	}
+
+	cairo_matrix_init_identity (&affine);
+	_eom_cairo_matrix_flip (&affine, &affine, TRUE, FALSE);
+	if (_eom_cairo_matrix_equal (&affine, &priv->affine)) {
+		return EOM_TRANSFORM_FLIP_HORIZONTAL;
+	}
+
+	cairo_matrix_init_identity (&affine);
+	_eom_cairo_matrix_flip (&affine, &affine, FALSE, TRUE);
+	if (_eom_cairo_matrix_equal (&affine, &priv->affine)) {
+		return EOM_TRANSFORM_FLIP_VERTICAL;
+	}
+
+	cairo_matrix_init_rotate (&a1, EOM_DEG_TO_RAD(90));
+	cairo_matrix_init_identity (&a2);
+	_eom_cairo_matrix_flip (&a2, &a2, TRUE, FALSE);
+	cairo_matrix_multiply(&affine, &a1, &a2);
+	if (_eom_cairo_matrix_equal (&affine, &priv->affine)) {
+		return EOM_TRANSFORM_TRANSPOSE;
+	}
+
+	/* A transversion is a 180° rotation followed by a transposition */
+	/* Reuse the transposition from the previous step for this. */
+	cairo_matrix_init_rotate (&a1, EOM_DEG_TO_RAD(180));
+	cairo_matrix_multiply(&a2, &a1, &affine);
+	if (_eom_cairo_matrix_equal (&a2, &priv->affine)) {
+		return EOM_TRANSFORM_TRANSVERSE;
+	}
+
+	return EOM_TRANSFORM_NONE;
+}
+
+gboolean
+eom_transform_get_affine (EomTransform *trans, cairo_matrix_t *affine)
+{
+	g_return_val_if_fail (EOM_IS_TRANSFORM (trans), FALSE);
+
+	_eom_cairo_matrix_copy (&trans->priv->affine, affine);
+
+	return TRUE;
+}
+
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/93.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/93.html new file mode 100644 index 0000000..7673991 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/93.html @@ -0,0 +1,2197 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <math.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "eom-uri-converter.h"
+#include "eom-pixbuf-util.h"
+
+enum {
+	PROP_0,
+	PROP_CONVERT_SPACES,
+	PROP_SPACE_CHARACTER,
+	PROP_COUNTER_START,
+	PROP_COUNTER_N_DIGITS,
+	PROP_N_IMAGES
+};
+
+typedef struct {
+	EomUCType  type;
+	union {
+		char    *string;  /* if type == EOM_UC_STRING */
+		gulong  counter;  /* if type == EOM_UC_COUNTER */
+	} data;
+} EomUCToken;
+
+struct _EomURIConverterPrivate {
+	GFile           *base_file;
+	GList           *token_list;
+	char            *suffix;
+	GdkPixbufFormat *img_format;
+	gboolean        requires_exif;
+
+	/* options */
+	gboolean convert_spaces;
+	gchar    space_character;
+	gulong   counter_start;
+	guint    counter_n_digits;
+};
+
+static void eom_uri_converter_set_property (GObject      *object,
+					    guint         property_id,
+					    const GValue *value,
+					    GParamSpec   *pspec);
+
+static void eom_uri_converter_get_property (GObject    *object,
+					    guint       property_id,
+					    GValue     *value,
+					    GParamSpec *pspec);
+
+G_DEFINE_TYPE_WITH_PRIVATE (EomURIConverter, eom_uri_converter, G_TYPE_OBJECT)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
+
+static void
+free_token (gpointer data)
+{
+	EomUCToken *token = (EomUCToken*) data;
+
+	if (token->type == EOM_UC_STRING) {
+		g_free (token->data.string);
+	}
+
+	g_slice_free (EomUCToken, token);
+}
+
+static void
+eom_uri_converter_dispose (GObject *object)
+{
+	EomURIConverter *instance = EOM_URI_CONVERTER (object);
+	EomURIConverterPrivate *priv;
+
+	priv = instance->priv;
+
+	if (priv->base_file) {
+		g_object_unref (priv->base_file);
+		priv->base_file = NULL;
+	}
+
+	if (priv->token_list) {
+		g_list_free_full (priv->token_list, free_token);
+		priv->token_list = NULL;
+	}
+
+	if (priv->suffix) {
+		g_free (priv->suffix);
+		priv->suffix = NULL;
+	}
+
+	G_OBJECT_CLASS (eom_uri_converter_parent_class)->dispose (object);
+}
+
+static void
+eom_uri_converter_init (EomURIConverter *conv)
+{
+	EomURIConverterPrivate *priv;
+
+	priv = conv->priv = eom_uri_converter_get_instance_private (conv);
+
+	priv->convert_spaces   = FALSE;
+	priv->space_character  = '_';
+	priv->counter_start    = 0;
+	priv->counter_n_digits = 1;
+	priv->requires_exif     = FALSE;
+}
+
+static void
+eom_uri_converter_class_init (EomURIConverterClass *klass)
+{
+	GObjectClass *object_class = (GObjectClass*) klass;
+
+	object_class->dispose = eom_uri_converter_dispose;
+
+        /* GObjectClass */
+        object_class->set_property = eom_uri_converter_set_property;
+        object_class->get_property = eom_uri_converter_get_property;
+
+        /* Properties */
+        g_object_class_install_property (
+                object_class,
+                PROP_CONVERT_SPACES,
+                g_param_spec_boolean ("convert-spaces", NULL, NULL,
+				      FALSE, G_PARAM_READWRITE));
+
+        g_object_class_install_property (
+                object_class,
+                PROP_SPACE_CHARACTER,
+                g_param_spec_char ("space-character", NULL, NULL,
+				   ' ', '~', '_', G_PARAM_READWRITE));
+
+       g_object_class_install_property (
+                object_class,
+                PROP_COUNTER_START,
+                g_param_spec_ulong ("counter-start", NULL, NULL,
+                                   0,
+                                   G_MAXULONG,
+                                   1,
+                                   G_PARAM_READWRITE));
+
+       g_object_class_install_property (
+                object_class,
+                PROP_COUNTER_N_DIGITS,
+                g_param_spec_uint ("counter-n-digits", NULL, NULL,
+				  1,
+				  G_MAXUINT,
+				  1,
+				  G_PARAM_READWRITE));
+
+       g_object_class_install_property (
+                object_class,
+                PROP_N_IMAGES,
+                g_param_spec_uint ("n-images", NULL, NULL,
+				  1,
+				  G_MAXUINT,
+				  1,
+				  G_PARAM_WRITABLE));
+}
+
+GQuark
+eom_uc_error_quark (void)
+{
+	static GQuark q = 0;
+	if (q == 0)
+		q = g_quark_from_static_string ("eom-uri-converter-error-quark");
+
+	return q;
+}
+
+static void
+eom_uri_converter_set_property (GObject      *object,
+                                guint         property_id,
+                                const GValue *value,
+                                GParamSpec   *pspec)
+{
+	EomURIConverter *conv;
+	EomURIConverterPrivate *priv;
+
+        g_return_if_fail (EOM_IS_URI_CONVERTER (object));
+
+        conv = EOM_URI_CONVERTER (object);
+	priv = conv->priv;
+
+        switch (property_id)
+        {
+	case PROP_CONVERT_SPACES:
+		priv->convert_spaces = g_value_get_boolean (value);
+		break;
+
+	case PROP_SPACE_CHARACTER:
+		priv->space_character = g_value_get_schar (value);
+		break;
+
+	case PROP_COUNTER_START:
+	{
+		guint new_n_digits;
+
+		priv->counter_start = g_value_get_ulong (value);
+
+		new_n_digits = ceil (log10 (priv->counter_start + pow (10, priv->counter_n_digits) - 1));
+
+		if (new_n_digits != priv->counter_n_digits) {
+			priv->counter_n_digits = ceil (MIN (log10 (G_MAXULONG), new_n_digits));
+		}
+		break;
+	}
+
+	case PROP_COUNTER_N_DIGITS:
+		priv->counter_n_digits = ceil (MIN (log10 (G_MAXULONG), g_value_get_uint (value)));
+		break;
+
+	case PROP_N_IMAGES:
+		priv->counter_n_digits = ceil (MIN (log10 (G_MAXULONG),
+						    log10 (priv->counter_start + g_value_get_uint (value))));
+		break;
+
+        default:
+                g_assert_not_reached ();
+        }
+}
+
+static void
+eom_uri_converter_get_property (GObject    *object,
+                                guint       property_id,
+                                GValue     *value,
+                                GParamSpec *pspec)
+{
+	EomURIConverter *conv;
+	EomURIConverterPrivate *priv;
+
+        g_return_if_fail (EOM_IS_URI_CONVERTER (object));
+
+        conv = EOM_URI_CONVERTER (object);
+	priv = conv->priv;
+
+        switch (property_id)
+        {
+	case PROP_CONVERT_SPACES:
+		g_value_set_boolean (value, priv->convert_spaces);
+		break;
+
+	case PROP_SPACE_CHARACTER:
+		g_value_set_schar (value, priv->space_character);
+		break;
+
+	case PROP_COUNTER_START:
+		g_value_set_ulong (value, priv->counter_start);
+		break;
+
+	case PROP_COUNTER_N_DIGITS:
+		g_value_set_uint (value, priv->counter_n_digits);
+		break;
+
+        default:
+                g_assert_not_reached ();
+	}
+}
+
+/* parser states */
+enum {
+	PARSER_NONE,
+	PARSER_STRING,
+	PARSER_TOKEN
+};
+
+static EomUCToken*
+create_token_string (const char *string, int substr_start, int substr_len)
+{
+	char *start_byte;
+	char *end_byte;
+	int n_bytes;
+	EomUCToken *token;
+
+	if (string == NULL) return NULL;
+	if (substr_len <= 0) return NULL;
+
+	start_byte = g_utf8_offset_to_pointer (string, substr_start);
+	end_byte = g_utf8_offset_to_pointer (string, substr_start + substr_len);
+
+	/* FIXME: is this right? */
+	n_bytes = end_byte - start_byte;
+
+	token = g_slice_new0 (EomUCToken);
+	token->type = EOM_UC_STRING;
+	token->data.string = g_new0 (char, n_bytes);
+	token->data.string = g_utf8_strncpy (token->data.string, start_byte, substr_len);
+
+	return token;
+}
+
+static EomUCToken*
+create_token_counter (int start_counter)
+{
+	EomUCToken *token;
+
+	token = g_slice_new0 (EomUCToken);
+	token->type = EOM_UC_COUNTER;
+	token->data.counter = 0;
+
+	return token;
+}
+
+static EomUCToken*
+create_token_other (EomUCType type)
+{
+	EomUCToken *token;
+
+	token = g_slice_new0 (EomUCToken);
+	token->type = type;
+
+	return token;
+}
+
+static GList*
+eom_uri_converter_parse_string (EomURIConverter *conv, const char *string)
+{
+	EomURIConverterPrivate *priv;
+	GList *list = NULL;
+	gulong len;
+	int i;
+	int state = PARSER_NONE;
+	int start = -1;
+	int substr_len = 0;
+	gunichar c;
+	const char *s;
+	EomUCToken *token;
+
+	g_return_val_if_fail (EOM_IS_URI_CONVERTER (conv), NULL);
+
+	priv = conv->priv;
+
+	if (string == NULL) return NULL;
+
+	if (!g_utf8_validate (string, -1, NULL))
+		return NULL;
+
+	len = g_utf8_strlen (string, -1);
+	s = string;
+
+	for (i = 0; i < len; i++) {
+		c = g_utf8_get_char (s);
+		token = NULL;
+
+		switch (state) {
+		case PARSER_NONE:
+			if (c == '%') {
+				start = -1;
+				state = PARSER_TOKEN;
+			} else {
+				start = i;
+				substr_len = 1;
+				state = PARSER_STRING;
+			}
+			break;
+
+		case PARSER_STRING:
+			if (c == '%') {
+				if (start != -1) {
+					token = create_token_string (string, start, substr_len);
+				}
+
+				state = PARSER_TOKEN;
+				start = -1;
+			} else {
+				substr_len++;
+			}
+			break;
+
+		case PARSER_TOKEN: {
+			EomUCType type = EOM_UC_END;
+
+			if (c == 'f') {
+				type = EOM_UC_FILENAME;
+			}
+			else if (c == 'n') {
+				type = EOM_UC_COUNTER;
+				token = create_token_counter (priv->counter_start);
+			}
+			else if (c == 'c') {
+				type = EOM_UC_COMMENT;
+			}
+			else if (c == 'd') {
+				type = EOM_UC_DATE;
+			}
+			else if (c == 't') {
+				type = EOM_UC_TIME;
+			}
+			else if (c == 'a') {
+				type = EOM_UC_DAY;
+			}
+			else if (c == 'm') {
+				type = EOM_UC_MONTH;
+			}
+			else if (c == 'y') {
+				type = EOM_UC_YEAR;
+			}
+			else if (c == 'h') {
+				type = EOM_UC_HOUR;
+			}
+			else if (c == 'i') {
+				type = EOM_UC_MINUTE;
+			}
+			else if (c == 's') {
+				type = EOM_UC_SECOND;
+			}
+
+			if (type != EOM_UC_END && token == NULL) {
+				token = create_token_other (type);
+				priv->requires_exif = TRUE;
+			}
+			state = PARSER_NONE;
+			break;
+		}
+		default:
+			g_assert_not_reached ();
+		}
+
+		if (token != NULL) {
+			list = g_list_append (list, token);
+		}
+
+		s = g_utf8_next_char (s);
+	}
+
+	if (state != PARSER_TOKEN && start >= 0) {
+		/* add remaining chars as string token */
+		list = g_list_append (list, create_token_string (string, start, substr_len));
+	}
+
+	return list;
+}
+
+void
+eom_uri_converter_print_list (EomURIConverter *conv)
+{
+	EomURIConverterPrivate *priv;
+	GList *it;
+
+	g_return_if_fail (EOM_URI_CONVERTER (conv));
+
+	priv = conv->priv;
+
+	for (it = priv->token_list; it != NULL; it = it->next) {
+		EomUCToken *token;
+		char *str;
+
+		token = (EomUCToken*) it->data;
+
+		switch (token->type) {
+		case EOM_UC_STRING:
+			str = g_strdup_printf ("string [%s]", token->data.string);
+			break;
+		case EOM_UC_FILENAME:
+			str = "filename";
+			break;
+		case EOM_UC_COUNTER:
+			str = g_strdup_printf ("counter [%lu]", token->data.counter);
+			break;
+		case EOM_UC_COMMENT:
+			str = "comment";
+			break;
+		case EOM_UC_DATE:
+			str = "date";
+			break;
+		case EOM_UC_TIME:
+			str = "time";
+			break;
+		case EOM_UC_DAY:
+			str = "day";
+			break;
+		case EOM_UC_MONTH:
+			str = "month";
+			break;
+		case EOM_UC_YEAR:
+			str = "year";
+			break;
+		case EOM_UC_HOUR:
+			str = "hour";
+			break;
+		case EOM_UC_MINUTE:
+			str = "minute";
+			break;
+		case EOM_UC_SECOND:
+			str = "second";
+			break;
+		default:
+			str = "unknown";
+			break;
+		}
+
+		g_print ("- %s\n", str);
+
+		if (token->type == EOM_UC_STRING || token->type == EOM_UC_COUNTER) {
+			g_free (str);
+		}
+	}
+}
+
+EomURIConverter*
+eom_uri_converter_new (GFile *base_file, GdkPixbufFormat *img_format, const char *format_str)
+{
+	EomURIConverter *conv;
+
+	g_return_val_if_fail (format_str != NULL, NULL);
+
+	conv = g_object_new (EOM_TYPE_URI_CONVERTER, NULL);
+
+	if (base_file != NULL) {
+		conv->priv->base_file  = g_object_ref (base_file);
+	}
+	else {
+		conv->priv->base_file = NULL;
+	}
+	conv->priv->img_format = img_format;
+	conv->priv->token_list = eom_uri_converter_parse_string (conv, format_str);
+
+	return conv;
+}
+
+static GFile*
+get_file_directory (EomURIConverter *conv, EomImage *image)
+{
+	GFile *file = NULL;
+	EomURIConverterPrivate *priv;
+
+	g_return_val_if_fail (EOM_IS_URI_CONVERTER (conv), NULL);
+	g_return_val_if_fail (EOM_IS_IMAGE (image), NULL);
+
+	priv = conv->priv;
+
+	if (priv->base_file != NULL) {
+		file = g_object_ref (priv->base_file);
+	}
+	else {
+		GFile *img_file;
+
+		img_file = eom_image_get_file (image);
+		g_assert (img_file != NULL);
+
+		file = g_file_get_parent (img_file);
+
+		g_object_unref (img_file);
+	}
+
+	return file;
+}
+
+static void
+split_filename (GFile *file, char **name, char **suffix)
+{
+	char *basename;
+	char *suffix_start;
+	guint len;
+
+	*name = NULL;
+	*suffix = NULL;
+
+        /* get unescaped string */
+	basename = g_file_get_basename (file);
+
+	/* FIXME: does this work for all locales? */
+	suffix_start = g_utf8_strrchr (basename, -1, '.');
+
+	if (suffix_start == NULL) { /* no suffix found */
+		*name = g_strdup (basename);
+	}
+	else {
+		len = (suffix_start - basename);
+		*name = g_strndup (basename, len);
+
+		len = strlen (basename) - len - 1;
+		*suffix = g_strndup (suffix_start+1, len);
+	}
+
+	g_free (basename);
+}
+
+static GString*
+append_filename (GString *str, EomImage *img)
+{
+	/* appends the name of the original file without
+	   filetype suffix */
+	GFile *img_file;
+	char *name;
+	char *suffix;
+	GString *result;
+
+	img_file = eom_image_get_file (img);
+	split_filename (img_file, &name, &suffix);
+
+	result = g_string_append (str, name);
+
+	g_free (name);
+	g_free (suffix);
+
+	g_object_unref (img_file);
+
+	return result;
+}
+
+static GString*
+append_counter (GString *str, gulong counter,  EomURIConverter *conv)
+{
+	EomURIConverterPrivate *priv;
+
+	priv = conv->priv;
+
+	g_string_append_printf (str, "%.*lu", priv->counter_n_digits, counter);
+
+	return str;
+}
+
+static void
+build_absolute_file (EomURIConverter *conv, EomImage *image, GString *str,  /* input  */
+		     GFile **file, GdkPixbufFormat **format)                /* output */
+{
+	GFile *dir_file;
+	EomURIConverterPrivate *priv;
+
+	*file = NULL;
+	if (format != NULL)
+		*format = NULL;
+
+	g_return_if_fail (EOM_IS_URI_CONVERTER (conv));
+	g_return_if_fail (EOM_IS_IMAGE (image));
+	g_return_if_fail (file != NULL);
+	g_return_if_fail (str != NULL);
+
+	priv = conv->priv;
+
+	dir_file = get_file_directory (conv, image);
+	g_assert (dir_file != NULL);
+
+	if (priv->img_format == NULL) {
+		/* use same file type/suffix */
+		char *name;
+		char *old_suffix;
+		GFile *img_file;
+
+		img_file = eom_image_get_file (image);
+		split_filename (img_file, &name, &old_suffix);
+
+		g_assert (old_suffix != NULL);
+
+		g_string_append_unichar (str, '.');
+		g_string_append (str, old_suffix);
+
+		if (format != NULL)
+			*format = eom_pixbuf_get_format_by_suffix (old_suffix);
+
+		g_object_unref (img_file);
+	} else {
+		if (priv->suffix == NULL)
+			priv->suffix = eom_pixbuf_get_common_suffix (priv->img_format);
+
+		g_string_append_unichar (str, '.');
+		g_string_append (str, priv->suffix);
+
+		if (format != NULL)
+			*format = priv->img_format;
+	}
+
+	*file = g_file_get_child (dir_file, str->str);
+
+	g_object_unref (dir_file);
+}
+
+static GString*
+replace_remove_chars (GString *str, gboolean convert_spaces, gunichar space_char)
+{
+	GString *result;
+	guint len;
+	char *s;
+	int i;
+	gunichar c;
+
+	g_return_val_if_fail (str != NULL, NULL);
+
+	if (!g_utf8_validate (str->str, -1, NULL))
+	    return NULL;
+
+	result = g_string_new (NULL);
+
+	len = g_utf8_strlen (str->str, -1);
+	s = str->str;
+
+	for (i = 0; i < len; i++, s = g_utf8_next_char (s)) {
+		c = g_utf8_get_char (s);
+
+		if (c == '/') {
+			continue;
+		}
+		else if (g_unichar_isspace (c) && convert_spaces) {
+			result = g_string_append_unichar (result, space_char);
+		}
+		else {
+			result = g_string_append_unichar (result, c);
+		}
+	}
+
+	/* ensure maximum length of 250 characters */
+	len = MIN (result->len, 250);
+	result = g_string_truncate (result, len);
+
+	return result;
+}
+
+/*
+ * This function converts the uri of the EomImage object, according to the
+ * EomUCToken list. The absolute uri (converted filename appended to base uri)
+ * is returned in uri and the image format will be in the format pointer.
+ */
+gboolean
+eom_uri_converter_do (EomURIConverter *conv, EomImage *image,
+		      GFile **file, GdkPixbufFormat **format, GError **error)
+{
+	EomURIConverterPrivate *priv;
+	GList *it;
+	GString *str;
+	GString *repl_str;
+
+	g_return_val_if_fail (EOM_IS_URI_CONVERTER (conv), FALSE);
+
+	priv = conv->priv;
+
+	*file = NULL;
+	if (format != NULL)
+		*format = NULL;
+
+	str = g_string_new ("");
+
+	for (it = priv->token_list; it != NULL; it = it->next) {
+		EomUCToken *token = (EomUCToken*) it->data;
+
+		switch (token->type) {
+		case EOM_UC_STRING:
+			str = g_string_append (str, token->data.string);
+			break;
+
+		case EOM_UC_FILENAME:
+			str = append_filename (str, image);
+			break;
+
+		case EOM_UC_COUNTER: {
+			if (token->data.counter < priv->counter_start)
+				token->data.counter = priv->counter_start;
+
+			str = append_counter (str, token->data.counter++, conv);
+			break;
+		}
+#if 0
+		case EOM_UC_COMMENT:
+			str = g_string_append_printf ();
+			str = "comment";
+			break;
+		case EOM_UC_DATE:
+			str = "date";
+			break;
+		case EOM_UC_TIME:
+			str = "time";
+			break;
+		case EOM_UC_DAY:
+			str = "day";
+			break;
+		case EOM_UC_MONTH:
+			str = "month";
+			break;
+		case EOM_UC_YEAR:
+			str = "year";
+			break;
+		case EOM_UC_HOUR:
+			str = "hour";
+			break;
+		case EOM_UC_MINUTE:
+			str = "minute";
+			break;
+		case EOM_UC_SECOND:
+			str = "second";
+			break;
+#endif
+		default:
+		/* skip all others */
+
+			break;
+		}
+	}
+
+	repl_str = replace_remove_chars (str, priv->convert_spaces, priv->space_character);
+
+	if ((repl_str != NULL) && (repl_str->len > 0)) {
+		build_absolute_file (conv, image, repl_str, file, format);
+	}
+
+	g_string_free (repl_str, TRUE);
+	g_string_free (str, TRUE);
+
+	return (*file != NULL);
+}
+
+char*
+eom_uri_converter_preview (const char *format_str, EomImage *img, GdkPixbufFormat *format,
+			   gulong counter, guint n_images,
+			   gboolean convert_spaces, gunichar space_char)
+{
+	GString *str;
+	GString *repl_str;
+	guint n_digits;
+	guint len;
+	int i;
+	const char *s;
+	gunichar c;
+	char *filename;
+	gboolean token_next;
+
+	g_return_val_if_fail (format_str != NULL, NULL);
+	g_return_val_if_fail (EOM_IS_IMAGE (img), NULL);
+
+	if (n_images == 0) return NULL;
+
+	n_digits = ceil (MIN (log10 (G_MAXULONG), MAX (log10 (counter), log10 (n_images))));
+
+	if (!g_utf8_validate (format_str, -1, NULL))
+	    return NULL;
+
+	len = g_utf8_strlen (format_str, -1);
+	s = format_str;
+	token_next = FALSE;
+
+	str = g_string_new ("");
+
+	for (i = 0; i < len; i++, s = g_utf8_next_char (s)) {
+		c = g_utf8_get_char (s);
+
+		if (token_next) {
+			if (c == 'f') {
+				str = append_filename (str, img);
+			}
+			else if (c == 'n') {
+				g_string_append_printf (str, "%.*lu",
+							n_digits ,counter);
+
+			}
+#if 0                   /* ignore the rest for now */
+			else if (c == 'c') {
+				type = EOM_UC_COMMENT;
+			}
+			else if (c == 'd') {
+				type = EOM_UC_DATE;
+			}
+			else if (c == 't') {
+				type = EOM_UC_TIME;
+			}
+			else if (c == 'a') {
+				type = EOM_UC_DAY;
+			}
+			else if (c == 'm') {
+				type = EOM_UC_MONTH;
+			}
+			else if (c == 'y') {
+				type = EOM_UC_YEAR;
+			}
+			else if (c == 'h') {
+				type = EOM_UC_HOUR;
+			}
+			else if (c == 'i') {
+				type = EOM_UC_MINUTE;
+			}
+			else if (c == 's') {
+				type = EOM_UC_SECOND;
+			}
+#endif
+			token_next = FALSE;
+		}
+		else if (c == '%') {
+			token_next = TRUE;
+		}
+		else {
+			str = g_string_append_unichar (str, c);
+		}
+	}
+
+	filename = NULL;
+	repl_str = replace_remove_chars (str, convert_spaces, space_char);
+
+	if (repl_str->len > 0) {
+		if (format == NULL) {
+			/* use same file type/suffix */
+			char *name;
+			char *old_suffix;
+			GFile *img_file;
+
+			img_file = eom_image_get_file (img);
+			split_filename (img_file, &name, &old_suffix);
+
+			g_assert (old_suffix != NULL);
+
+			g_string_append_unichar (repl_str, '.');
+			g_string_append (repl_str, old_suffix);
+
+			g_free (old_suffix);
+			g_free (name);
+			g_object_unref (img_file);
+		}
+		else {
+			char *suffix = eom_pixbuf_get_common_suffix (format);
+
+			g_string_append_unichar (repl_str, '.');
+			g_string_append (repl_str, suffix);
+
+			g_free (suffix);
+		}
+
+		filename = repl_str->str;
+	}
+
+	g_string_free (repl_str, FALSE);
+	g_string_free (str, TRUE);
+
+	return filename;
+}
+
+gboolean
+eom_uri_converter_requires_exif (EomURIConverter *converter)
+{
+	g_return_val_if_fail (EOM_IS_URI_CONVERTER (converter), FALSE);
+
+	return converter->priv->requires_exif;
+}
+
+/**
+ * eom_uri_converter_check:
+ * @converter: a #EomURIConverter
+ * @img_list: (element-type GFile): a #Gfile list
+ * @error: a #GError location to store the error occurring, or NULL to ignore
+ */
+
+gboolean
+eom_uri_converter_check (EomURIConverter *converter, GList *img_list, GError **error)
+{
+	GList *it;
+	GList *file_list = NULL;
+	gboolean all_different = TRUE;
+
+	g_return_val_if_fail (EOM_IS_URI_CONVERTER (converter), FALSE);
+
+	/* convert all image uris */
+	for (it = img_list; it != NULL; it = it->next) {
+		gboolean result;
+		GFile *file;
+		GError *conv_error = NULL;
+
+		result = eom_uri_converter_do (converter, EOM_IMAGE (it->data),
+					       &file, NULL, &conv_error);
+
+		if (result) {
+			file_list = g_list_prepend (file_list, file);
+		}
+	}
+
+	/* check for all different uris */
+	for (it = file_list; it != NULL && all_different; it = it->next) {
+		GList *p;
+		GFile *file;
+
+		file = (GFile*) it->data;
+
+		for (p = it->next; p != NULL && all_different; p = p->next) {
+			all_different = !g_file_equal (file, (GFile*) p->data);
+		}
+	}
+
+	if (!all_different) {
+		g_set_error (error, EOM_UC_ERROR,
+			     EOM_UC_ERROR_EQUAL_FILENAMES,
+			     _("At least two file names are equal."));
+	}
+
+        g_list_free (file_list);
+
+	return all_different;
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/94.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/94.html new file mode 100644 index 0000000..39ca7ec --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/94.html @@ -0,0 +1,1229 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye Of Mate - General Utilities
+ *
+ * Copyright (C) 2006 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on code by:
+ *	- Jens Finke <jens@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"<--- Include file: "config.h" not found.
+#endif
+
+#include <sys/time.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <time.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "eom-util.h"
+
+#include <errno.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gprintf.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gstdio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+void
+eom_util_show_help (const gchar *section, GtkWindow *parent)
+{
+	GError *error = NULL;
+	gchar *uri = NULL;
+
+	if (section)
+		uri = g_strdup_printf ("help:eom/%s", section);
+
+	gtk_show_uri_on_window (parent, ((uri != NULL) ? uri : "help:eom"),
+		      gtk_get_current_event_time (), &error);
+
+	g_free (uri);
+
+	if (error) {
+		GtkWidget *dialog;
+
+		dialog = gtk_message_dialog_new (parent,
+						 0,
+						 GTK_MESSAGE_ERROR,
+						 GTK_BUTTONS_OK,
+						 _("Could not display help for Eye of MATE"));
+
+		gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+							  "%s", error->message);
+
+		g_signal_connect_swapped (dialog, "response",
+					  G_CALLBACK (gtk_widget_destroy),
+					  dialog);
+		gtk_widget_show (dialog);
+
+		g_error_free (error);
+	}
+}
+
+gchar *
+eom_util_make_valid_utf8 (const gchar *str)
+{
+	GString *string;
+	const char *remainder, *invalid;
+	int remaining_bytes, valid_bytes;
+
+	string = NULL;
+	remainder = str;
+	remaining_bytes = strlen (str);
+
+	while (remaining_bytes != 0) {
+		if (g_utf8_validate (remainder, remaining_bytes, &invalid)) {
+			break;
+		}
+
+		valid_bytes = invalid - remainder;
+
+		if (string == NULL) {
+			string = g_string_sized_new (remaining_bytes);
+		}
+
+		g_string_append_len (string, remainder, valid_bytes);
+		g_string_append_c (string, '?');
+
+		remaining_bytes -= valid_bytes + 1;
+		remainder = invalid + 1;
+	}
+
+	if (string == NULL) {
+		return g_strdup (str);
+	}
+
+	g_string_append (string, remainder);
+	g_string_append (string, _(" (invalid Unicode)"));
+
+	g_assert (g_utf8_validate (string->str, -1, NULL));
+
+	return g_string_free (string, FALSE);
+}
+
+GSList*
+eom_util_parse_uri_string_list_to_file_list (const gchar *uri_list)
+{
+	GSList* file_list = NULL;
+	gsize i = 0;
+	gchar **uris;
+
+	uris = g_uri_list_extract_uris (uri_list);
+
+	while (uris[i] != NULL) {
+		file_list = g_slist_append (file_list, g_file_new_for_uri (uris[i]));
+		i++;
+	}
+
+	g_strfreev (uris);
+
+	return file_list;
+}
+
+GSList*
+eom_util_string_list_to_file_list (GSList *string_list)
+{
+	GSList *it = NULL;
+	GSList *file_list = NULL;
+
+	for (it = string_list; it != NULL; it = it->next) {
+		char *uri_str;
+
+		uri_str = (gchar *) it->data;
+
+		file_list = g_slist_prepend (file_list,
+					     g_file_new_for_uri (uri_str));
+	}
+
+	return g_slist_reverse (file_list);
+}
+
+GSList*
+eom_util_strings_to_file_list (gchar **strings)
+{
+	int i;
+ 	GSList *file_list = NULL;
+
+	for (i = 0; strings[i]; i++) {
+ 		file_list = g_slist_prepend (file_list,
+					      g_file_new_for_uri (strings[i]));
+ 	}
+
+ 	return g_slist_reverse (file_list);
+}
+
+GSList*
+eom_util_string_array_to_list (const gchar **files, gboolean create_uri)
+{
+	gint i;
+	GSList *list = NULL;
+
+	if (files == NULL) return list;
+
+	for (i = 0; files[i]; i++) {
+		char *str;
+
+		if (create_uri) {
+			GFile *file;
+
+			file = g_file_new_for_commandline_arg (files[i]);
+			str = g_file_get_uri (file);
+
+			g_object_unref (file);
+		} else {
+			str = g_strdup (files[i]);
+		}
+
+		if (str) {
+			list = g_slist_prepend (list, g_strdup (str));
+			g_free (str);
+		}
+	}
+
+	return g_slist_reverse (list);
+}
+
+gchar **
+eom_util_string_array_make_absolute (gchar **files)
+{
+	int i;
+	int size;
+	gchar **abs_files;
+	GFile *file;
+
+	if (files == NULL)
+		return NULL;
+
+	size = g_strv_length (files);
+
+	/* Ensure new list is NULL-terminated */
+	abs_files = g_new0 (gchar *, size+1);
+
+	for (i = 0; i < size; i++) {
+		file = g_file_new_for_commandline_arg (files[i]);
+		abs_files[i] = g_file_get_uri (file);
+
+		g_object_unref (file);
+	}
+
+	return abs_files;
+}
+
+static gchar *dot_dir = NULL;
+
+static gboolean
+ensure_dir_exists (const char *dir)
+{
+	if (g_file_test (dir, G_FILE_TEST_IS_DIR))
+		return TRUE;
+
+	if (g_mkdir_with_parents (dir, 0700) == 0)
+		return TRUE;
+
+	if (errno == EEXIST)
+		return g_file_test (dir, G_FILE_TEST_IS_DIR);
+
+	g_warning ("Failed to create directory %s: %s", dir, strerror (errno));
+	return FALSE;
+}
+
+const gchar *
+eom_util_dot_dir (void)
+{
+	if (dot_dir == NULL) {
+		gboolean exists;
+
+			dot_dir = g_build_filename(g_get_user_config_dir(), "mate", "eom", NULL);
+
+		exists = ensure_dir_exists (dot_dir);
+
+		if (G_UNLIKELY (!exists)) {
+			static gboolean printed_warning = FALSE;
+
+			if (!printed_warning) {
+				g_warning ("EOM could not save some of your preferences in its settings directory due to a file with the same name (%s) blocking its creation. Please remove that file, or move it away.", dot_dir);
+				printed_warning = TRUE;
+			}
+			dot_dir = NULL;
+			return NULL;
+		}
+	}
+
+	return dot_dir;
+}
+
+/* Based on eel_filename_strip_extension() */
+
+/**
+ * eom_util_filename_get_extension:
+ * @filename: a filename
+ *
+ * Returns a reasonably good guess of the file extension of @filename.
+ *
+ * Returns: a newly allocated string with the file extension of @filename.
+ **/
+char *
+eom_util_filename_get_extension (const char * filename)
+{
+	char *begin, *begin2;
+
+	if (filename == NULL) {
+		return NULL;
+	}
+
+	begin = strrchr (filename, '.');
+
+	if (begin && begin != filename) {
+		if (strcmp (begin, ".gz") == 0 ||
+		    strcmp (begin, ".bz2") == 0 ||
+		    strcmp (begin, ".sit") == 0 ||
+		    strcmp (begin, ".Z") == 0) {
+			begin2 = begin - 1;
+			while (begin2 > filename &&
+			       *begin2 != '.') {
+				begin2--;
+			}
+			if (begin2 != filename) {
+				begin = begin2;
+			}
+		}
+		begin ++;
+	} else {
+		return NULL;
+	}
+
+	return g_strdup (begin);
+}
+
+/**
+ * eom_util_file_is_persistent:
+ * @file: a #GFile
+ *
+ * Checks whether @file is a non-removable local mount.
+ *
+ * Returns: %TRUE if @file is in a non-removable mount,
+ * %FALSE otherwise or when it is remote.
+ **/
+gboolean
+eom_util_file_is_persistent (GFile *file)
+{
+	GMount *mount;
+
+	if (!g_file_is_native (file))
+		return FALSE;
+
+	mount = g_file_find_enclosing_mount (file, NULL, NULL);
+	if (mount) {
+		if (g_mount_can_unmount (mount)) {
+			return FALSE;
+		}
+	}
+
+	return TRUE;
+}
+
+static void
+_eom_util_show_file_in_filemanager_fallback (GFile *file, GtkWindow *toplevel)
+{
+	gchar *uri = NULL;
+	GError *error = NULL;
+	guint32 timestamp = gtk_get_current_event_time ();
+
+	if (g_file_query_file_type (file, 0, NULL) == G_FILE_TYPE_DIRECTORY) {
+		uri = g_file_get_uri (file);
+	} else {
+		/* If input file is not a directory we must open it's
+		   folder/parent to avoid opening the file itself     */
+		GFile *parent_file;
+
+		parent_file = g_file_get_parent (file);
+		if (G_LIKELY (parent_file))
+			uri = g_file_get_uri (parent_file);
+		g_object_unref (parent_file);
+	}
+
+	if (uri && !gtk_show_uri_on_window (toplevel, uri, timestamp, &error)) {
+		g_warning ("Couldn't show containing folder \"%s\": %s", uri,
+			   error->message);
+		g_error_free (error);
+	}
+
+	g_free (uri);
+}
+
+void
+eom_util_show_file_in_filemanager (GFile *file, GtkWindow *toplevel)
+{
+	GDBusProxy *proxy;
+	gboolean done = FALSE;
+
+	g_return_if_fail (file != NULL);
+
+	proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
+				G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS |
+				G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
+				NULL, "org.freedesktop.FileManager1",
+				"/org/freedesktop/FileManager1",
+				"org.freedesktop.FileManager1",
+				NULL, NULL);
+
+	if (proxy) {
+		gchar *uri = g_file_get_uri (file);
+		gchar *startup_id;
+		GVariant *params, *result;
+		GVariantBuilder builder;
+
+		g_variant_builder_init (&builder,
+					G_VARIANT_TYPE ("as"));
+		g_variant_builder_add (&builder, "s", uri);
+
+		/* This seems to be the expected format, as other values
+		   cause the filemanager window not to get focus. */
+		startup_id = g_strdup_printf("_TIME%u",
+					     gtk_get_current_event_time());
+
+		/* params is floating! */
+		params = g_variant_new ("(ass)", &builder, startup_id);
+
+		g_free (startup_id);
+		g_variant_builder_clear (&builder);
+
+		/* Floating params-GVariant is consumed here */
+		result = g_dbus_proxy_call_sync (proxy, "ShowItems",
+						 params, G_DBUS_CALL_FLAGS_NONE,
+						 -1, NULL, NULL);
+
+		/* Receiving a non-NULL result counts as a successful call. */
+		if (G_LIKELY (result != NULL)) {
+			done = TRUE;
+			g_variant_unref (result);
+		}
+
+		g_free (uri);
+		g_object_unref (proxy);
+	}
+
+	/* Fallback to gtk_show_uri() if launch over DBus is not possible */
+	if (!done)
+		_eom_util_show_file_in_filemanager_fallback (file, toplevel);
+}
+
+gboolean
+eom_notebook_scroll_event_cb (GtkWidget         *widget,
+                              GdkEventScroll    *event)
+
+{
+    GtkNotebook *notebook = GTK_NOTEBOOK (widget);
+    GtkWidget *child, *event_widget, *action_widget;
+
+    child = gtk_notebook_get_nth_page (notebook, gtk_notebook_get_current_page (notebook));
+    if (child == NULL)
+        return FALSE;
+
+    event_widget = gtk_get_event_widget ((GdkEvent*) event);
+
+    /* Ignore scroll events from the content of the page */
+    if (event_widget == NULL || event_widget == child || gtk_widget_is_ancestor (event_widget, child))
+        return FALSE;
+
+    /* And also from the action widgets */
+    action_widget = gtk_notebook_get_action_widget (notebook, GTK_PACK_START);
+    if (event_widget == action_widget || (action_widget != NULL && gtk_widget_is_ancestor (event_widget, action_widget)))
+        return FALSE;
+
+    action_widget = gtk_notebook_get_action_widget (notebook, GTK_PACK_END);
+    if (event_widget == action_widget || (action_widget != NULL && gtk_widget_is_ancestor (event_widget, action_widget)))
+        return FALSE;
+
+    switch (event->direction) {
+        case GDK_SCROLL_RIGHT:
+        case GDK_SCROLL_DOWN:
+            gtk_notebook_next_page (notebook);
+            break;
+        case GDK_SCROLL_LEFT:
+        case GDK_SCROLL_UP:
+            gtk_notebook_prev_page (notebook);
+            break;
+        case GDK_SCROLL_SMOOTH:
+            switch (gtk_notebook_get_tab_pos (notebook)) {
+                case GTK_POS_LEFT:
+                case GTK_POS_RIGHT:
+                    if (event->delta_y > 0)
+                        gtk_notebook_next_page (notebook);
+                    else if (event->delta_y < 0)
+                        gtk_notebook_prev_page (notebook);
+                    break;
+                case GTK_POS_TOP:
+                case GTK_POS_BOTTOM:
+                    if (event->delta_x > 0)
+                        gtk_notebook_next_page (notebook);
+                    else if (event->delta_x < 0)
+                        gtk_notebook_prev_page (notebook);
+                    break;
+            }
+            break;
+    }
+
+    return TRUE;
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/95.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/95.html new file mode 100644 index 0000000..46b322f --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/95.html @@ -0,0 +1,375 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/*
+ * eom-window-activatable.h
+ * This file is part of eom
+ *
+ * Author: Felix Riemann <friemann@gnome.org>
+ *
+ * Copyright (C) 2011 Felix Riemann
+ *
+ * Base on code by:
+ * 	- Steve Frécinaux <code@istique.net>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+#ifndef __EOM_WINDOW_ACTIVATABLE_H__
+#define __EOM_WINDOW_ACTIVATABLE_H__
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+#define EOM_TYPE_WINDOW_ACTIVATABLE	(eom_window_activatable_get_type ())
+#define EOM_WINDOW_ACTIVATABLE(obj) 	(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+					 EOM_TYPE_WINDOW_ACTIVATABLE, \
+					 EomWindowActivatable))
+#define EOM_WINDOW_ACTIVATABLE_IFACE(obj) \
+					(G_TYPE_CHECK_CLASS_CAST ((obj), \
+					 EOM_TYPE_WINDOW_ACTIVATABLE, \
+					 EomWindowActivatableInterface))
+#define EOM_IS_WINDOW_ACTIVATABLE(obj)	(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+					 EOM_TYPE_WINDOW_ACTIVATABLE))
+#define EOM_WINDOW_ACTIVATABLE_GET_IFACE(obj) \
+					(G_TYPE_INSTANCE_GET_INTERFACE ((obj), \
+					 EOM_TYPE_WINDOW_ACTIVATABLE, \
+					 EomWindowActivatableInterface))
+
+typedef struct _EomWindowActivatable		EomWindowActivatable;
+typedef struct _EomWindowActivatableInterface	EomWindowActivatableInterface;
+
+struct _EomWindowActivatableInterface
+{
+	GTypeInterface g_iface;
+
+	/* vfuncs */
+
+	void	(*activate)	(EomWindowActivatable *activatable);
+	void	(*deactivate)	(EomWindowActivatable *activatable);
+};
+
+GType	eom_window_activatable_get_type	(void) G_GNUC_CONST;
+
+void	eom_window_activatable_activate	    (EomWindowActivatable *activatable);
+void	eom_window_activatable_deactivate   (EomWindowActivatable *activatable);
+
+G_END_DECLS
+#endif /* __EOM_WINDOW_ACTIVATABLE_H__ */
+
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/96.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/96.html new file mode 100644 index 0000000..a1cec6c --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/96.html @@ -0,0 +1,411 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
 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
/*
+ * eom-window-activatable.c
+ * This file is part of eom
+ *
+ * Author: Felix Riemann <friemann@gnome.org>
+ *
+ * Copyright (C) 2011 Felix Riemann
+ *
+ * Base on code by:
+ * 	- Steve Frécinaux <code@istique.net>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"<--- Include file: "config.h" not found.
+#endif
+
+#include "eom-window-activatable.h"
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "eom-window.h"
+
+G_DEFINE_INTERFACE(EomWindowActivatable, eom_window_activatable, G_TYPE_OBJECT)
+
+void
+eom_window_activatable_default_init (EomWindowActivatableInterface *iface)
+{
+	static gboolean initialized = FALSE;
+
+	if (!initialized) {
+		/**
+		 * EomWindowActivatable:window:
+		 *
+		 * This is the #EomWindow this #EomWindowActivatable instance
+		 * should be attached to.
+		 */
+		g_object_interface_install_property (iface,
+				g_param_spec_object ("window", "Window",
+						     "The EomWindow this "
+						     "instance it attached to",
+						     EOM_TYPE_WINDOW,
+						     G_PARAM_READWRITE |
+						     G_PARAM_CONSTRUCT_ONLY |
+						     G_PARAM_STATIC_STRINGS));
+		initialized = TRUE;
+	}
+}
+
+void
+eom_window_activatable_activate (EomWindowActivatable *activatable)
+{
+	EomWindowActivatableInterface *iface;
+
+	g_return_if_fail (EOM_IS_WINDOW_ACTIVATABLE (activatable));
+
+	iface = EOM_WINDOW_ACTIVATABLE_GET_IFACE (activatable);
+
+	if (G_LIKELY (iface->activate != NULL))
+		iface->activate (activatable);
+}
+
+void
+eom_window_activatable_deactivate (EomWindowActivatable *activatable)
+{
+	EomWindowActivatableInterface *iface;
+
+	g_return_if_fail (EOM_IS_WINDOW_ACTIVATABLE (activatable));
+
+	iface = EOM_WINDOW_ACTIVATABLE_GET_IFACE (activatable);
+
+	if (G_LIKELY (iface->deactivate != NULL))
+		iface->deactivate (activatable);
+}
+
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/97.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/97.html new file mode 100644 index 0000000..73cfe71 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/97.html @@ -0,0 +1,11723 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
   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
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+1682
+1683
+1684
+1685
+1686
+1687
+1688
+1689
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699
+1700
+1701
+1702
+1703
+1704
+1705
+1706
+1707
+1708
+1709
+1710
+1711
+1712
+1713
+1714
+1715
+1716
+1717
+1718
+1719
+1720
+1721
+1722
+1723
+1724
+1725
+1726
+1727
+1728
+1729
+1730
+1731
+1732
+1733
+1734
+1735
+1736
+1737
+1738
+1739
+1740
+1741
+1742
+1743
+1744
+1745
+1746
+1747
+1748
+1749
+1750
+1751
+1752
+1753
+1754
+1755
+1756
+1757
+1758
+1759
+1760
+1761
+1762
+1763
+1764
+1765
+1766
+1767
+1768
+1769
+1770
+1771
+1772
+1773
+1774
+1775
+1776
+1777
+1778
+1779
+1780
+1781
+1782
+1783
+1784
+1785
+1786
+1787
+1788
+1789
+1790
+1791
+1792
+1793
+1794
+1795
+1796
+1797
+1798
+1799
+1800
+1801
+1802
+1803
+1804
+1805
+1806
+1807
+1808
+1809
+1810
+1811
+1812
+1813
+1814
+1815
+1816
+1817
+1818
+1819
+1820
+1821
+1822
+1823
+1824
+1825
+1826
+1827
+1828
+1829
+1830
+1831
+1832
+1833
+1834
+1835
+1836
+1837
+1838
+1839
+1840
+1841
+1842
+1843
+1844
+1845
+1846
+1847
+1848
+1849
+1850
+1851
+1852
+1853
+1854
+1855
+1856
+1857
+1858
+1859
+1860
+1861
+1862
+1863
+1864
+1865
+1866
+1867
+1868
+1869
+1870
+1871
+1872
+1873
+1874
+1875
+1876
+1877
+1878
+1879
+1880
+1881
+1882
+1883
+1884
+1885
+1886
+1887
+1888
+1889
+1890
+1891
+1892
+1893
+1894
+1895
+1896
+1897
+1898
+1899
+1900
+1901
+1902
+1903
+1904
+1905
+1906
+1907
+1908
+1909
+1910
+1911
+1912
+1913
+1914
+1915
+1916
+1917
+1918
+1919
+1920
+1921
+1922
+1923
+1924
+1925
+1926
+1927
+1928
+1929
+1930
+1931
+1932
+1933
+1934
+1935
+1936
+1937
+1938
+1939
+1940
+1941
+1942
+1943
+1944
+1945
+1946
+1947
+1948
+1949
+1950
+1951
+1952
+1953
+1954
+1955
+1956
+1957
+1958
+1959
+1960
+1961
+1962
+1963
+1964
+1965
+1966
+1967
+1968
+1969
+1970
+1971
+1972
+1973
+1974
+1975
+1976
+1977
+1978
+1979
+1980
+1981
+1982
+1983
+1984
+1985
+1986
+1987
+1988
+1989
+1990
+1991
+1992
+1993
+1994
+1995
+1996
+1997
+1998
+1999
+2000
+2001
+2002
+2003
+2004
+2005
+2006
+2007
+2008
+2009
+2010
+2011
+2012
+2013
+2014
+2015
+2016
+2017
+2018
+2019
+2020
+2021
+2022
+2023
+2024
+2025
+2026
+2027
+2028
+2029
+2030
+2031
+2032
+2033
+2034
+2035
+2036
+2037
+2038
+2039
+2040
+2041
+2042
+2043
+2044
+2045
+2046
+2047
+2048
+2049
+2050
+2051
+2052
+2053
+2054
+2055
+2056
+2057
+2058
+2059
+2060
+2061
+2062
+2063
+2064
+2065
+2066
+2067
+2068
+2069
+2070
+2071
+2072
+2073
+2074
+2075
+2076
+2077
+2078
+2079
+2080
+2081
+2082
+2083
+2084
+2085
+2086
+2087
+2088
+2089
+2090
+2091
+2092
+2093
+2094
+2095
+2096
+2097
+2098
+2099
+2100
+2101
+2102
+2103
+2104
+2105
+2106
+2107
+2108
+2109
+2110
+2111
+2112
+2113
+2114
+2115
+2116
+2117
+2118
+2119
+2120
+2121
+2122
+2123
+2124
+2125
+2126
+2127
+2128
+2129
+2130
+2131
+2132
+2133
+2134
+2135
+2136
+2137
+2138
+2139
+2140
+2141
+2142
+2143
+2144
+2145
+2146
+2147
+2148
+2149
+2150
+2151
+2152
+2153
+2154
+2155
+2156
+2157
+2158
+2159
+2160
+2161
+2162
+2163
+2164
+2165
+2166
+2167
+2168
+2169
+2170
+2171
+2172
+2173
+2174
+2175
+2176
+2177
+2178
+2179
+2180
+2181
+2182
+2183
+2184
+2185
+2186
+2187
+2188
+2189
+2190
+2191
+2192
+2193
+2194
+2195
+2196
+2197
+2198
+2199
+2200
+2201
+2202
+2203
+2204
+2205
+2206
+2207
+2208
+2209
+2210
+2211
+2212
+2213
+2214
+2215
+2216
+2217
+2218
+2219
+2220
+2221
+2222
+2223
+2224
+2225
+2226
+2227
+2228
+2229
+2230
+2231
+2232
+2233
+2234
+2235
+2236
+2237
+2238
+2239
+2240
+2241
+2242
+2243
+2244
+2245
+2246
+2247
+2248
+2249
+2250
+2251
+2252
+2253
+2254
+2255
+2256
+2257
+2258
+2259
+2260
+2261
+2262
+2263
+2264
+2265
+2266
+2267
+2268
+2269
+2270
+2271
+2272
+2273
+2274
+2275
+2276
+2277
+2278
+2279
+2280
+2281
+2282
+2283
+2284
+2285
+2286
+2287
+2288
+2289
+2290
+2291
+2292
+2293
+2294
+2295
+2296
+2297
+2298
+2299
+2300
+2301
+2302
+2303
+2304
+2305
+2306
+2307
+2308
+2309
+2310
+2311
+2312
+2313
+2314
+2315
+2316
+2317
+2318
+2319
+2320
+2321
+2322
+2323
+2324
+2325
+2326
+2327
+2328
+2329
+2330
+2331
+2332
+2333
+2334
+2335
+2336
+2337
+2338
+2339
+2340
+2341
+2342
+2343
+2344
+2345
+2346
+2347
+2348
+2349
+2350
+2351
+2352
+2353
+2354
+2355
+2356
+2357
+2358
+2359
+2360
+2361
+2362
+2363
+2364
+2365
+2366
+2367
+2368
+2369
+2370
+2371
+2372
+2373
+2374
+2375
+2376
+2377
+2378
+2379
+2380
+2381
+2382
+2383
+2384
+2385
+2386
+2387
+2388
+2389
+2390
+2391
+2392
+2393
+2394
+2395
+2396
+2397
+2398
+2399
+2400
+2401
+2402
+2403
+2404
+2405
+2406
+2407
+2408
+2409
+2410
+2411
+2412
+2413
+2414
+2415
+2416
+2417
+2418
+2419
+2420
+2421
+2422
+2423
+2424
+2425
+2426
+2427
+2428
+2429
+2430
+2431
+2432
+2433
+2434
+2435
+2436
+2437
+2438
+2439
+2440
+2441
+2442
+2443
+2444
+2445
+2446
+2447
+2448
+2449
+2450
+2451
+2452
+2453
+2454
+2455
+2456
+2457
+2458
+2459
+2460
+2461
+2462
+2463
+2464
+2465
+2466
+2467
+2468
+2469
+2470
+2471
+2472
+2473
+2474
+2475
+2476
+2477
+2478
+2479
+2480
+2481
+2482
+2483
+2484
+2485
+2486
+2487
+2488
+2489
+2490
+2491
+2492
+2493
+2494
+2495
+2496
+2497
+2498
+2499
+2500
+2501
+2502
+2503
+2504
+2505
+2506
+2507
+2508
+2509
+2510
+2511
+2512
+2513
+2514
+2515
+2516
+2517
+2518
+2519
+2520
+2521
+2522
+2523
+2524
+2525
+2526
+2527
+2528
+2529
+2530
+2531
+2532
+2533
+2534
+2535
+2536
+2537
+2538
+2539
+2540
+2541
+2542
+2543
+2544
+2545
+2546
+2547
+2548
+2549
+2550
+2551
+2552
+2553
+2554
+2555
+2556
+2557
+2558
+2559
+2560
+2561
+2562
+2563
+2564
+2565
+2566
+2567
+2568
+2569
+2570
+2571
+2572
+2573
+2574
+2575
+2576
+2577
+2578
+2579
+2580
+2581
+2582
+2583
+2584
+2585
+2586
+2587
+2588
+2589
+2590
+2591
+2592
+2593
+2594
+2595
+2596
+2597
+2598
+2599
+2600
+2601
+2602
+2603
+2604
+2605
+2606
+2607
+2608
+2609
+2610
+2611
+2612
+2613
+2614
+2615
+2616
+2617
+2618
+2619
+2620
+2621
+2622
+2623
+2624
+2625
+2626
+2627
+2628
+2629
+2630
+2631
+2632
+2633
+2634
+2635
+2636
+2637
+2638
+2639
+2640
+2641
+2642
+2643
+2644
+2645
+2646
+2647
+2648
+2649
+2650
+2651
+2652
+2653
+2654
+2655
+2656
+2657
+2658
+2659
+2660
+2661
+2662
+2663
+2664
+2665
+2666
+2667
+2668
+2669
+2670
+2671
+2672
+2673
+2674
+2675
+2676
+2677
+2678
+2679
+2680
+2681
+2682
+2683
+2684
+2685
+2686
+2687
+2688
+2689
+2690
+2691
+2692
+2693
+2694
+2695
+2696
+2697
+2698
+2699
+2700
+2701
+2702
+2703
+2704
+2705
+2706
+2707
+2708
+2709
+2710
+2711
+2712
+2713
+2714
+2715
+2716
+2717
+2718
+2719
+2720
+2721
+2722
+2723
+2724
+2725
+2726
+2727
+2728
+2729
+2730
+2731
+2732
+2733
+2734
+2735
+2736
+2737
+2738
+2739
+2740
+2741
+2742
+2743
+2744
+2745
+2746
+2747
+2748
+2749
+2750
+2751
+2752
+2753
+2754
+2755
+2756
+2757
+2758
+2759
+2760
+2761
+2762
+2763
+2764
+2765
+2766
+2767
+2768
+2769
+2770
+2771
+2772
+2773
+2774
+2775
+2776
+2777
+2778
+2779
+2780
+2781
+2782
+2783
+2784
+2785
+2786
+2787
+2788
+2789
+2790
+2791
+2792
+2793
+2794
+2795
+2796
+2797
+2798
+2799
+2800
+2801
+2802
+2803
+2804
+2805
+2806
+2807
+2808
+2809
+2810
+2811
+2812
+2813
+2814
+2815
+2816
+2817
+2818
+2819
+2820
+2821
+2822
+2823
+2824
+2825
+2826
+2827
+2828
+2829
+2830
+2831
+2832
+2833
+2834
+2835
+2836
+2837
+2838
+2839
+2840
+2841
+2842
+2843
+2844
+2845
+2846
+2847
+2848
+2849
+2850
+2851
+2852
+2853
+2854
+2855
+2856
+2857
+2858
+2859
+2860
+2861
+2862
+2863
+2864
+2865
+2866
+2867
+2868
+2869
+2870
+2871
+2872
+2873
+2874
+2875
+2876
+2877
+2878
+2879
+2880
+2881
+2882
+2883
+2884
+2885
+2886
+2887
+2888
+2889
+2890
+2891
+2892
+2893
+2894
+2895
+2896
+2897
+2898
+2899
+2900
+2901
+2902
+2903
+2904
+2905
+2906
+2907
+2908
+2909
+2910
+2911
+2912
+2913
+2914
+2915
+2916
+2917
+2918
+2919
+2920
+2921
+2922
+2923
+2924
+2925
+2926
+2927
+2928
+2929
+2930
+2931
+2932
+2933
+2934
+2935
+2936
+2937
+2938
+2939
+2940
+2941
+2942
+2943
+2944
+2945
+2946
+2947
+2948
+2949
+2950
+2951
+2952
+2953
+2954
+2955
+2956
+2957
+2958
+2959
+2960
+2961
+2962
+2963
+2964
+2965
+2966
+2967
+2968
+2969
+2970
+2971
+2972
+2973
+2974
+2975
+2976
+2977
+2978
+2979
+2980
+2981
+2982
+2983
+2984
+2985
+2986
+2987
+2988
+2989
+2990
+2991
+2992
+2993
+2994
+2995
+2996
+2997
+2998
+2999
+3000
+3001
+3002
+3003
+3004
+3005
+3006
+3007
+3008
+3009
+3010
+3011
+3012
+3013
+3014
+3015
+3016
+3017
+3018
+3019
+3020
+3021
+3022
+3023
+3024
+3025
+3026
+3027
+3028
+3029
+3030
+3031
+3032
+3033
+3034
+3035
+3036
+3037
+3038
+3039
+3040
+3041
+3042
+3043
+3044
+3045
+3046
+3047
+3048
+3049
+3050
+3051
+3052
+3053
+3054
+3055
+3056
+3057
+3058
+3059
+3060
+3061
+3062
+3063
+3064
+3065
+3066
+3067
+3068
+3069
+3070
+3071
+3072
+3073
+3074
+3075
+3076
+3077
+3078
+3079
+3080
+3081
+3082
+3083
+3084
+3085
+3086
+3087
+3088
+3089
+3090
+3091
+3092
+3093
+3094
+3095
+3096
+3097
+3098
+3099
+3100
+3101
+3102
+3103
+3104
+3105
+3106
+3107
+3108
+3109
+3110
+3111
+3112
+3113
+3114
+3115
+3116
+3117
+3118
+3119
+3120
+3121
+3122
+3123
+3124
+3125
+3126
+3127
+3128
+3129
+3130
+3131
+3132
+3133
+3134
+3135
+3136
+3137
+3138
+3139
+3140
+3141
+3142
+3143
+3144
+3145
+3146
+3147
+3148
+3149
+3150
+3151
+3152
+3153
+3154
+3155
+3156
+3157
+3158
+3159
+3160
+3161
+3162
+3163
+3164
+3165
+3166
+3167
+3168
+3169
+3170
+3171
+3172
+3173
+3174
+3175
+3176
+3177
+3178
+3179
+3180
+3181
+3182
+3183
+3184
+3185
+3186
+3187
+3188
+3189
+3190
+3191
+3192
+3193
+3194
+3195
+3196
+3197
+3198
+3199
+3200
+3201
+3202
+3203
+3204
+3205
+3206
+3207
+3208
+3209
+3210
+3211
+3212
+3213
+3214
+3215
+3216
+3217
+3218
+3219
+3220
+3221
+3222
+3223
+3224
+3225
+3226
+3227
+3228
+3229
+3230
+3231
+3232
+3233
+3234
+3235
+3236
+3237
+3238
+3239
+3240
+3241
+3242
+3243
+3244
+3245
+3246
+3247
+3248
+3249
+3250
+3251
+3252
+3253
+3254
+3255
+3256
+3257
+3258
+3259
+3260
+3261
+3262
+3263
+3264
+3265
+3266
+3267
+3268
+3269
+3270
+3271
+3272
+3273
+3274
+3275
+3276
+3277
+3278
+3279
+3280
+3281
+3282
+3283
+3284
+3285
+3286
+3287
+3288
+3289
+3290
+3291
+3292
+3293
+3294
+3295
+3296
+3297
+3298
+3299
+3300
+3301
+3302
+3303
+3304
+3305
+3306
+3307
+3308
+3309
+3310
+3311
+3312
+3313
+3314
+3315
+3316
+3317
+3318
+3319
+3320
+3321
+3322
+3323
+3324
+3325
+3326
+3327
+3328
+3329
+3330
+3331
+3332
+3333
+3334
+3335
+3336
+3337
+3338
+3339
+3340
+3341
+3342
+3343
+3344
+3345
+3346
+3347
+3348
+3349
+3350
+3351
+3352
+3353
+3354
+3355
+3356
+3357
+3358
+3359
+3360
+3361
+3362
+3363
+3364
+3365
+3366
+3367
+3368
+3369
+3370
+3371
+3372
+3373
+3374
+3375
+3376
+3377
+3378
+3379
+3380
+3381
+3382
+3383
+3384
+3385
+3386
+3387
+3388
+3389
+3390
+3391
+3392
+3393
+3394
+3395
+3396
+3397
+3398
+3399
+3400
+3401
+3402
+3403
+3404
+3405
+3406
+3407
+3408
+3409
+3410
+3411
+3412
+3413
+3414
+3415
+3416
+3417
+3418
+3419
+3420
+3421
+3422
+3423
+3424
+3425
+3426
+3427
+3428
+3429
+3430
+3431
+3432
+3433
+3434
+3435
+3436
+3437
+3438
+3439
+3440
+3441
+3442
+3443
+3444
+3445
+3446
+3447
+3448
+3449
+3450
+3451
+3452
+3453
+3454
+3455
+3456
+3457
+3458
+3459
+3460
+3461
+3462
+3463
+3464
+3465
+3466
+3467
+3468
+3469
+3470
+3471
+3472
+3473
+3474
+3475
+3476
+3477
+3478
+3479
+3480
+3481
+3482
+3483
+3484
+3485
+3486
+3487
+3488
+3489
+3490
+3491
+3492
+3493
+3494
+3495
+3496
+3497
+3498
+3499
+3500
+3501
+3502
+3503
+3504
+3505
+3506
+3507
+3508
+3509
+3510
+3511
+3512
+3513
+3514
+3515
+3516
+3517
+3518
+3519
+3520
+3521
+3522
+3523
+3524
+3525
+3526
+3527
+3528
+3529
+3530
+3531
+3532
+3533
+3534
+3535
+3536
+3537
+3538
+3539
+3540
+3541
+3542
+3543
+3544
+3545
+3546
+3547
+3548
+3549
+3550
+3551
+3552
+3553
+3554
+3555
+3556
+3557
+3558
+3559
+3560
+3561
+3562
+3563
+3564
+3565
+3566
+3567
+3568
+3569
+3570
+3571
+3572
+3573
+3574
+3575
+3576
+3577
+3578
+3579
+3580
+3581
+3582
+3583
+3584
+3585
+3586
+3587
+3588
+3589
+3590
+3591
+3592
+3593
+3594
+3595
+3596
+3597
+3598
+3599
+3600
+3601
+3602
+3603
+3604
+3605
+3606
+3607
+3608
+3609
+3610
+3611
+3612
+3613
+3614
+3615
+3616
+3617
+3618
+3619
+3620
+3621
+3622
+3623
+3624
+3625
+3626
+3627
+3628
+3629
+3630
+3631
+3632
+3633
+3634
+3635
+3636
+3637
+3638
+3639
+3640
+3641
+3642
+3643
+3644
+3645
+3646
+3647
+3648
+3649
+3650
+3651
+3652
+3653
+3654
+3655
+3656
+3657
+3658
+3659
+3660
+3661
+3662
+3663
+3664
+3665
+3666
+3667
+3668
+3669
+3670
+3671
+3672
+3673
+3674
+3675
+3676
+3677
+3678
+3679
+3680
+3681
+3682
+3683
+3684
+3685
+3686
+3687
+3688
+3689
+3690
+3691
+3692
+3693
+3694
+3695
+3696
+3697
+3698
+3699
+3700
+3701
+3702
+3703
+3704
+3705
+3706
+3707
+3708
+3709
+3710
+3711
+3712
+3713
+3714
+3715
+3716
+3717
+3718
+3719
+3720
+3721
+3722
+3723
+3724
+3725
+3726
+3727
+3728
+3729
+3730
+3731
+3732
+3733
+3734
+3735
+3736
+3737
+3738
+3739
+3740
+3741
+3742
+3743
+3744
+3745
+3746
+3747
+3748
+3749
+3750
+3751
+3752
+3753
+3754
+3755
+3756
+3757
+3758
+3759
+3760
+3761
+3762
+3763
+3764
+3765
+3766
+3767
+3768
+3769
+3770
+3771
+3772
+3773
+3774
+3775
+3776
+3777
+3778
+3779
+3780
+3781
+3782
+3783
+3784
+3785
+3786
+3787
+3788
+3789
+3790
+3791
+3792
+3793
+3794
+3795
+3796
+3797
+3798
+3799
+3800
+3801
+3802
+3803
+3804
+3805
+3806
+3807
+3808
+3809
+3810
+3811
+3812
+3813
+3814
+3815
+3816
+3817
+3818
+3819
+3820
+3821
+3822
+3823
+3824
+3825
+3826
+3827
+3828
+3829
+3830
+3831
+3832
+3833
+3834
+3835
+3836
+3837
+3838
+3839
+3840
+3841
+3842
+3843
+3844
+3845
+3846
+3847
+3848
+3849
+3850
+3851
+3852
+3853
+3854
+3855
+3856
+3857
+3858
+3859
+3860
+3861
+3862
+3863
+3864
+3865
+3866
+3867
+3868
+3869
+3870
+3871
+3872
+3873
+3874
+3875
+3876
+3877
+3878
+3879
+3880
+3881
+3882
+3883
+3884
+3885
+3886
+3887
+3888
+3889
+3890
+3891
+3892
+3893
+3894
+3895
+3896
+3897
+3898
+3899
+3900
+3901
+3902
+3903
+3904
+3905
+3906
+3907
+3908
+3909
+3910
+3911
+3912
+3913
+3914
+3915
+3916
+3917
+3918
+3919
+3920
+3921
+3922
+3923
+3924
+3925
+3926
+3927
+3928
+3929
+3930
+3931
+3932
+3933
+3934
+3935
+3936
+3937
+3938
+3939
+3940
+3941
+3942
+3943
+3944
+3945
+3946
+3947
+3948
+3949
+3950
+3951
+3952
+3953
+3954
+3955
+3956
+3957
+3958
+3959
+3960
+3961
+3962
+3963
+3964
+3965
+3966
+3967
+3968
+3969
+3970
+3971
+3972
+3973
+3974
+3975
+3976
+3977
+3978
+3979
+3980
+3981
+3982
+3983
+3984
+3985
+3986
+3987
+3988
+3989
+3990
+3991
+3992
+3993
+3994
+3995
+3996
+3997
+3998
+3999
+4000
+4001
+4002
+4003
+4004
+4005
+4006
+4007
+4008
+4009
+4010
+4011
+4012
+4013
+4014
+4015
+4016
+4017
+4018
+4019
+4020
+4021
+4022
+4023
+4024
+4025
+4026
+4027
+4028
+4029
+4030
+4031
+4032
+4033
+4034
+4035
+4036
+4037
+4038
+4039
+4040
+4041
+4042
+4043
+4044
+4045
+4046
+4047
+4048
+4049
+4050
+4051
+4052
+4053
+4054
+4055
+4056
+4057
+4058
+4059
+4060
+4061
+4062
+4063
+4064
+4065
+4066
+4067
+4068
+4069
+4070
+4071
+4072
+4073
+4074
+4075
+4076
+4077
+4078
+4079
+4080
+4081
+4082
+4083
+4084
+4085
+4086
+4087
+4088
+4089
+4090
+4091
+4092
+4093
+4094
+4095
+4096
+4097
+4098
+4099
+4100
+4101
+4102
+4103
+4104
+4105
+4106
+4107
+4108
+4109
+4110
+4111
+4112
+4113
+4114
+4115
+4116
+4117
+4118
+4119
+4120
+4121
+4122
+4123
+4124
+4125
+4126
+4127
+4128
+4129
+4130
+4131
+4132
+4133
+4134
+4135
+4136
+4137
+4138
+4139
+4140
+4141
+4142
+4143
+4144
+4145
+4146
+4147
+4148
+4149
+4150
+4151
+4152
+4153
+4154
+4155
+4156
+4157
+4158
+4159
+4160
+4161
+4162
+4163
+4164
+4165
+4166
+4167
+4168
+4169
+4170
+4171
+4172
+4173
+4174
+4175
+4176
+4177
+4178
+4179
+4180
+4181
+4182
+4183
+4184
+4185
+4186
+4187
+4188
+4189
+4190
+4191
+4192
+4193
+4194
+4195
+4196
+4197
+4198
+4199
+4200
+4201
+4202
+4203
+4204
+4205
+4206
+4207
+4208
+4209
+4210
+4211
+4212
+4213
+4214
+4215
+4216
+4217
+4218
+4219
+4220
+4221
+4222
+4223
+4224
+4225
+4226
+4227
+4228
+4229
+4230
+4231
+4232
+4233
+4234
+4235
+4236
+4237
+4238
+4239
+4240
+4241
+4242
+4243
+4244
+4245
+4246
+4247
+4248
+4249
+4250
+4251
+4252
+4253
+4254
+4255
+4256
+4257
+4258
+4259
+4260
+4261
+4262
+4263
+4264
+4265
+4266
+4267
+4268
+4269
+4270
+4271
+4272
+4273
+4274
+4275
+4276
+4277
+4278
+4279
+4280
+4281
+4282
+4283
+4284
+4285
+4286
+4287
+4288
+4289
+4290
+4291
+4292
+4293
+4294
+4295
+4296
+4297
+4298
+4299
+4300
+4301
+4302
+4303
+4304
+4305
+4306
+4307
+4308
+4309
+4310
+4311
+4312
+4313
+4314
+4315
+4316
+4317
+4318
+4319
+4320
+4321
+4322
+4323
+4324
+4325
+4326
+4327
+4328
+4329
+4330
+4331
+4332
+4333
+4334
+4335
+4336
+4337
+4338
+4339
+4340
+4341
+4342
+4343
+4344
+4345
+4346
+4347
+4348
+4349
+4350
+4351
+4352
+4353
+4354
+4355
+4356
+4357
+4358
+4359
+4360
+4361
+4362
+4363
+4364
+4365
+4366
+4367
+4368
+4369
+4370
+4371
+4372
+4373
+4374
+4375
+4376
+4377
+4378
+4379
+4380
+4381
+4382
+4383
+4384
+4385
+4386
+4387
+4388
+4389
+4390
+4391
+4392
+4393
+4394
+4395
+4396
+4397
+4398
+4399
+4400
+4401
+4402
+4403
+4404
+4405
+4406
+4407
+4408
+4409
+4410
+4411
+4412
+4413
+4414
+4415
+4416
+4417
+4418
+4419
+4420
+4421
+4422
+4423
+4424
+4425
+4426
+4427
+4428
+4429
+4430
+4431
+4432
+4433
+4434
+4435
+4436
+4437
+4438
+4439
+4440
+4441
+4442
+4443
+4444
+4445
+4446
+4447
+4448
+4449
+4450
+4451
+4452
+4453
+4454
+4455
+4456
+4457
+4458
+4459
+4460
+4461
+4462
+4463
+4464
+4465
+4466
+4467
+4468
+4469
+4470
+4471
+4472
+4473
+4474
+4475
+4476
+4477
+4478
+4479
+4480
+4481
+4482
+4483
+4484
+4485
+4486
+4487
+4488
+4489
+4490
+4491
+4492
+4493
+4494
+4495
+4496
+4497
+4498
+4499
+4500
+4501
+4502
+4503
+4504
+4505
+4506
+4507
+4508
+4509
+4510
+4511
+4512
+4513
+4514
+4515
+4516
+4517
+4518
+4519
+4520
+4521
+4522
+4523
+4524
+4525
+4526
+4527
+4528
+4529
+4530
+4531
+4532
+4533
+4534
+4535
+4536
+4537
+4538
+4539
+4540
+4541
+4542
+4543
+4544
+4545
+4546
+4547
+4548
+4549
+4550
+4551
+4552
+4553
+4554
+4555
+4556
+4557
+4558
+4559
+4560
+4561
+4562
+4563
+4564
+4565
+4566
+4567
+4568
+4569
+4570
+4571
+4572
+4573
+4574
+4575
+4576
+4577
+4578
+4579
+4580
+4581
+4582
+4583
+4584
+4585
+4586
+4587
+4588
+4589
+4590
+4591
+4592
+4593
+4594
+4595
+4596
+4597
+4598
+4599
+4600
+4601
+4602
+4603
+4604
+4605
+4606
+4607
+4608
+4609
+4610
+4611
+4612
+4613
+4614
+4615
+4616
+4617
+4618
+4619
+4620
+4621
+4622
+4623
+4624
+4625
+4626
+4627
+4628
+4629
+4630
+4631
+4632
+4633
+4634
+4635
+4636
+4637
+4638
+4639
+4640
+4641
+4642
+4643
+4644
+4645
+4646
+4647
+4648
+4649
+4650
+4651
+4652
+4653
+4654
+4655
+4656
+4657
+4658
+4659
+4660
+4661
+4662
+4663
+4664
+4665
+4666
+4667
+4668
+4669
+4670
+4671
+4672
+4673
+4674
+4675
+4676
+4677
+4678
+4679
+4680
+4681
+4682
+4683
+4684
+4685
+4686
+4687
+4688
+4689
+4690
+4691
+4692
+4693
+4694
+4695
+4696
+4697
+4698
+4699
+4700
+4701
+4702
+4703
+4704
+4705
+4706
+4707
+4708
+4709
+4710
+4711
+4712
+4713
+4714
+4715
+4716
+4717
+4718
+4719
+4720
+4721
+4722
+4723
+4724
+4725
+4726
+4727
+4728
+4729
+4730
+4731
+4732
+4733
+4734
+4735
+4736
+4737
+4738
+4739
+4740
+4741
+4742
+4743
+4744
+4745
+4746
+4747
+4748
+4749
+4750
+4751
+4752
+4753
+4754
+4755
+4756
+4757
+4758
+4759
+4760
+4761
+4762
+4763
+4764
+4765
+4766
+4767
+4768
+4769
+4770
+4771
+4772
+4773
+4774
+4775
+4776
+4777
+4778
+4779
+4780
+4781
+4782
+4783
+4784
+4785
+4786
+4787
+4788
+4789
+4790
+4791
+4792
+4793
+4794
+4795
+4796
+4797
+4798
+4799
+4800
+4801
+4802
+4803
+4804
+4805
+4806
+4807
+4808
+4809
+4810
+4811
+4812
+4813
+4814
+4815
+4816
+4817
+4818
+4819
+4820
+4821
+4822
+4823
+4824
+4825
+4826
+4827
+4828
+4829
+4830
+4831
+4832
+4833
+4834
+4835
+4836
+4837
+4838
+4839
+4840
+4841
+4842
+4843
+4844
+4845
+4846
+4847
+4848
+4849
+4850
+4851
+4852
+4853
+4854
+4855
+4856
+4857
+4858
+4859
+4860
+4861
+4862
+4863
+4864
+4865
+4866
+4867
+4868
+4869
+4870
+4871
+4872
+4873
+4874
+4875
+4876
+4877
+4878
+4879
+4880
+4881
+4882
+4883
+4884
+4885
+4886
+4887
+4888
+4889
+4890
+4891
+4892
+4893
+4894
+4895
+4896
+4897
+4898
+4899
+4900
+4901
+4902
+4903
+4904
+4905
+4906
+4907
+4908
+4909
+4910
+4911
+4912
+4913
+4914
+4915
+4916
+4917
+4918
+4919
+4920
+4921
+4922
+4923
+4924
+4925
+4926
+4927
+4928
+4929
+4930
+4931
+4932
+4933
+4934
+4935
+4936
+4937
+4938
+4939
+4940
+4941
+4942
+4943
+4944
+4945
+4946
+4947
+4948
+4949
+4950
+4951
+4952
+4953
+4954
+4955
+4956
+4957
+4958
+4959
+4960
+4961
+4962
+4963
+4964
+4965
+4966
+4967
+4968
+4969
+4970
+4971
+4972
+4973
+4974
+4975
+4976
+4977
+4978
+4979
+4980
+4981
+4982
+4983
+4984
+4985
+4986
+4987
+4988
+4989
+4990
+4991
+4992
+4993
+4994
+4995
+4996
+4997
+4998
+4999
+5000
+5001
+5002
+5003
+5004
+5005
+5006
+5007
+5008
+5009
+5010
+5011
+5012
+5013
+5014
+5015
+5016
+5017
+5018
+5019
+5020
+5021
+5022
+5023
+5024
+5025
+5026
+5027
+5028
+5029
+5030
+5031
+5032
+5033
+5034
+5035
+5036
+5037
+5038
+5039
+5040
+5041
+5042
+5043
+5044
+5045
+5046
+5047
+5048
+5049
+5050
+5051
+5052
+5053
+5054
+5055
+5056
+5057
+5058
+5059
+5060
+5061
+5062
+5063
+5064
+5065
+5066
+5067
+5068
+5069
+5070
+5071
+5072
+5073
+5074
+5075
+5076
+5077
+5078
+5079
+5080
+5081
+5082
+5083
+5084
+5085
+5086
+5087
+5088
+5089
+5090
+5091
+5092
+5093
+5094
+5095
+5096
+5097
+5098
+5099
+5100
+5101
+5102
+5103
+5104
+5105
+5106
+5107
+5108
+5109
+5110
+5111
+5112
+5113
+5114
+5115
+5116
+5117
+5118
+5119
+5120
+5121
+5122
+5123
+5124
+5125
+5126
+5127
+5128
+5129
+5130
+5131
+5132
+5133
+5134
+5135
+5136
+5137
+5138
+5139
+5140
+5141
+5142
+5143
+5144
+5145
+5146
+5147
+5148
+5149
+5150
+5151
+5152
+5153
+5154
+5155
+5156
+5157
+5158
+5159
+5160
+5161
+5162
+5163
+5164
+5165
+5166
+5167
+5168
+5169
+5170
+5171
+5172
+5173
+5174
+5175
+5176
+5177
+5178
+5179
+5180
+5181
+5182
+5183
+5184
+5185
+5186
+5187
+5188
+5189
+5190
+5191
+5192
+5193
+5194
+5195
+5196
+5197
+5198
+5199
+5200
+5201
+5202
+5203
+5204
+5205
+5206
+5207
+5208
+5209
+5210
+5211
+5212
+5213
+5214
+5215
+5216
+5217
+5218
+5219
+5220
+5221
+5222
+5223
+5224
+5225
+5226
+5227
+5228
+5229
+5230
+5231
+5232
+5233
+5234
+5235
+5236
+5237
+5238
+5239
+5240
+5241
+5242
+5243
+5244
+5245
+5246
+5247
+5248
+5249
+5250
+5251
+5252
+5253
+5254
+5255
+5256
+5257
+5258
+5259
+5260
+5261
+5262
+5263
+5264
+5265
+5266
+5267
+5268
+5269
+5270
+5271
+5272
+5273
+5274
+5275
+5276
+5277
+5278
+5279
+5280
+5281
+5282
+5283
+5284
+5285
+5286
+5287
+5288
+5289
+5290
+5291
+5292
+5293
+5294
+5295
+5296
+5297
+5298
+5299
+5300
+5301
+5302
+5303
+5304
+5305
+5306
+5307
+5308
+5309
+5310
+5311
+5312
+5313
+5314
+5315
+5316
+5317
+5318
+5319
+5320
+5321
+5322
+5323
+5324
+5325
+5326
+5327
+5328
+5329
+5330
+5331
+5332
+5333
+5334
+5335
+5336
+5337
+5338
+5339
+5340
+5341
+5342
+5343
+5344
+5345
+5346
+5347
+5348
+5349
+5350
+5351
+5352
+5353
+5354
+5355
+5356
+5357
+5358
+5359
+5360
+5361
+5362
+5363
+5364
+5365
+5366
+5367
+5368
+5369
+5370
+5371
+5372
+5373
+5374
+5375
+5376
+5377
+5378
+5379
+5380
+5381
+5382
+5383
+5384
+5385
+5386
+5387
+5388
+5389
+5390
+5391
+5392
+5393
+5394
+5395
+5396
+5397
+5398
+5399
+5400
+5401
+5402
+5403
+5404
+5405
+5406
+5407
+5408
+5409
+5410
+5411
+5412
+5413
+5414
+5415
+5416
+5417
+5418
+5419
+5420
+5421
+5422
+5423
+5424
+5425
+5426
+5427
+5428
+5429
+5430
+5431
+5432
+5433
+5434
+5435
+5436
+5437
+5438
+5439
+5440
+5441
+5442
+5443
+5444
+5445
+5446
+5447
+5448
+5449
+5450
+5451
+5452
+5453
+5454
+5455
+5456
+5457
+5458
+5459
+5460
+5461
+5462
+5463
+5464
+5465
+5466
+5467
+5468
+5469
+5470
+5471
+5472
+5473
+5474
+5475
+5476
+5477
+5478
+5479
+5480
+5481
+5482
+5483
+5484
+5485
+5486
+5487
+5488
+5489
+5490
+5491
+5492
+5493
+5494
+5495
+5496
+5497
+5498
+5499
+5500
+5501
+5502
+5503
+5504
+5505
+5506
+5507
+5508
+5509
+5510
+5511
+5512
+5513
+5514
+5515
+5516
+5517
+5518
+5519
+5520
+5521
+5522
+5523
+5524
+5525
+5526
+5527
+5528
+5529
+5530
+5531
+5532
+5533
+5534
+5535
+5536
+5537
+5538
+5539
+5540
+5541
+5542
+5543
+5544
+5545
+5546
+5547
+5548
+5549
+5550
+5551
+5552
+5553
+5554
+5555
+5556
+5557
+5558
+5559
+5560
+5561
+5562
+5563
+5564
+5565
+5566
+5567
+5568
+5569
+5570
+5571
+5572
+5573
+5574
+5575
+5576
+5577
+5578
+5579
+5580
+5581
+5582
+5583
+5584
+5585
+5586
+5587
+5588
+5589
+5590
+5591
+5592
+5593
+5594
+5595
+5596
+5597
+5598
+5599
+5600
+5601
+5602
+5603
+5604
+5605
+5606
+5607
+5608
+5609
+5610
+5611
+5612
+5613
+5614
+5615
+5616
+5617
+5618
+5619
+5620
+5621
+5622
+5623
+5624
+5625
+5626
+5627
+5628
+5629
+5630
+5631
+5632
+5633
+5634
+5635
+5636
+5637
+5638
+5639
+5640
+5641
+5642
+5643
+5644
+5645
+5646
+5647
+5648
+5649
+5650
+5651
+5652
+5653
+5654
+5655
+5656
+5657
+5658
+5659
+5660
+5661
+5662
+5663
+5664
+5665
+5666
+5667
+5668
+5669
+5670
+5671
+5672
+5673
+5674
+5675
+5676
+5677
+5678
+5679
+5680
+5681
+5682
+5683
+5684
+5685
+5686
+5687
+5688
+5689
+5690
+5691
+5692
+5693
+5694
+5695
+5696
+5697
+5698
+5699
+5700
+5701
+5702
+5703
+5704
+5705
+5706
+5707
/* Eye Of Mate - Main Window
+ *
+ * Copyright (C) 2000-2008 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on code by:
+ * 	- Federico Mena-Quintero <federico@gnu.org>
+ *	- Jens Finke <jens@gnome.org>
+ * Based on evince code (shell/ev-window.c) by:
+ * 	- Martin Kretzschmar <martink@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"<--- Include file: "config.h" not found.
+#endif
+
+#include <math.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "eom-window.h"
+#include "eom-scroll-view.h"
+#include "eom-debug.h"
+#include "eom-file-chooser.h"
+#include "eom-thumb-view.h"
+#include "eom-list-store.h"
+#include "eom-sidebar.h"
+#include "eom-statusbar.h"
+#include "eom-preferences-dialog.h"
+#include "eom-properties-dialog.h"
+#include "eom-print.h"
+#include "eom-error-message-area.h"
+#include "eom-application.h"
+#include "eom-application-internal.h"
+#include "eom-thumb-nav.h"
+#include "eom-config-keys.h"
+#include "eom-job-queue.h"
+#include "eom-jobs.h"
+#include "eom-util.h"
+#include "eom-save-as-dialog-helper.h"
+#include "eom-close-confirmation-dialog.h"
+#include "eom-clipboard-handler.h"
+#include "eom-window-activatable.h"
+#include "eom-metadata-sidebar.h"
+
+#include "eom-enum-types.h"
+
+#include "egg-toolbar-editor.h"<--- Include file: "egg-toolbar-editor.h" not found.
+#include "egg-editable-toolbar.h"<--- Include file: "egg-editable-toolbar.h" not found.
+#include "egg-toolbars-model.h"<--- Include file: "egg-toolbars-model.h" not found.
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gdk/gdkkeysyms.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gio/gdesktopappinfo.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <libpeas/peas-extension-set.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libpeas/peas-activatable.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#if HAVE_LCMS
+#include <X11/Xlib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <X11/Xatom.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#ifdef GDK_WINDOWING_X11
+#include <gdk/gdkx.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+#include <lcms2.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#define MATE_DESKTOP_USE_UNSTABLE_API
+#include <libmate-desktop/mate-desktop-utils.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define EOM_WINDOW_MIN_WIDTH  440
+#define EOM_WINDOW_MIN_HEIGHT 350
+
+#define EOM_WINDOW_DEFAULT_WIDTH  540
+#define EOM_WINDOW_DEFAULT_HEIGHT 450
+
+#define EOM_WINDOW_FULLSCREEN_TIMEOUT 5 * 1000
+#define EOM_WINDOW_FULLSCREEN_POPUP_THRESHOLD 5
+
+#define EOM_RECENT_FILES_GROUP  "Graphics"
+#define EOM_RECENT_FILES_APP_NAME "Eye of MATE Image Viewer"
+#define EOM_RECENT_FILES_LIMIT  5
+
+#define EOM_WALLPAPER_FILENAME "eom-wallpaper"
+
+#define is_rtl (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL)
+
+typedef enum {
+	EOM_WINDOW_STATUS_UNKNOWN,
+	EOM_WINDOW_STATUS_INIT,
+	EOM_WINDOW_STATUS_NORMAL
+} EomWindowStatus;
+
+enum {
+	PROP_0,
+	PROP_COLLECTION_POS,
+	PROP_COLLECTION_RESIZABLE,
+	PROP_STARTUP_FLAGS
+};
+
+enum {
+	SIGNAL_PREPARED,
+	SIGNAL_LAST
+};
+
+static guint signals[SIGNAL_LAST] = { 0 };
+
+struct _EomWindowPrivate {
+	GSettings           *view_settings;
+	GSettings           *ui_settings;
+	GSettings           *fullscreen_settings;
+	GSettings           *lockdown_settings;
+
+	EomListStore        *store;
+	EomImage            *image;
+	EomWindowMode        mode;
+	EomWindowStatus      status;
+
+	GtkUIManager        *ui_mgr;
+	GtkWidget           *box;
+	GtkWidget           *layout;
+	GtkWidget           *cbox;
+	GtkWidget           *view;
+	GtkWidget           *sidebar;
+	GtkWidget           *thumbview;
+	GtkWidget           *statusbar;
+	GtkWidget           *nav;
+	GtkWidget           *message_area;
+	GtkWidget           *toolbar;
+	GtkWidget           *properties_dlg;
+
+	GtkActionGroup      *actions_window;
+	GtkActionGroup      *actions_image;
+	GtkActionGroup      *actions_collection;
+	GtkActionGroup      *actions_recent;
+
+	GtkWidget           *fullscreen_popup;
+	GSource             *fullscreen_timeout_source;
+
+	gboolean             slideshow_random;
+	gboolean             slideshow_loop;
+	gint                 slideshow_switch_timeout;
+	GSource             *slideshow_switch_source;
+
+	guint                fullscreen_idle_inhibit_cookie;
+
+	guint                recent_menu_id;
+
+	EomJob              *load_job;
+	EomJob              *transform_job;
+	EomJob              *save_job;
+	GFile               *last_save_as_folder;
+	EomJob              *copy_job;
+
+	guint                image_info_message_cid;
+	guint                tip_message_cid;
+	guint                copy_file_cid;
+
+	EomStartupFlags      flags;
+	GSList              *file_list;
+
+	EomWindowCollectionPos collection_position;
+	gboolean             collection_resizable;
+
+	GtkActionGroup      *actions_open_with;
+	guint                open_with_menu_id;
+
+	gboolean             save_disabled;
+	gboolean             needs_reload_confirmation;
+
+	GtkPageSetup        *page_setup;
+
+	PeasExtensionSet    *extensions;
+
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
+	cmsHPROFILE         *display_profile;
+#endif
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (EomWindow, eom_window, GTK_TYPE_APPLICATION_WINDOW);
+
+static void eom_window_cmd_fullscreen (GtkAction *action, gpointer user_data);
+static void eom_window_run_fullscreen (EomWindow *window, gboolean slideshow);
+static void eom_window_cmd_slideshow (GtkAction *action, gpointer user_data);
+static void eom_window_cmd_pause_slideshow (GtkAction *action, gpointer user_data);
+static void eom_window_stop_fullscreen (EomWindow *window, gboolean slideshow);
+static void eom_job_load_cb (EomJobLoad *job, gpointer data);
+static void eom_job_save_progress_cb (EomJobSave *job, float progress, gpointer data);
+static void eom_job_progress_cb (EomJobLoad *job, float progress, gpointer data);
+static void eom_job_transform_cb (EomJobTransform *job, gpointer data);
+static void fullscreen_set_timeout (EomWindow *window);
+static void fullscreen_clear_timeout (EomWindow *window);
+static void update_action_groups_state (EomWindow *window);
+static void open_with_launch_application_cb (GtkAction *action, gpointer callback_data);
+static void eom_window_update_openwith_menu (EomWindow *window, EomImage *image);
+static void eom_window_list_store_image_added (GtkTreeModel *tree_model,
+					       GtkTreePath  *path,
+					       GtkTreeIter  *iter,
+					       gpointer      user_data);
+static void eom_window_list_store_image_removed (GtkTreeModel *tree_model,
+                 				 GtkTreePath  *path,
+						 gpointer      user_data);
+static void eom_window_set_wallpaper (EomWindow *window, const gchar *filename, const gchar *visible_filename);
+static gboolean eom_window_save_images (EomWindow *window, GList *images);
+static void disconnect_proxy_cb (GtkUIManager *manager,
+                                 GtkAction *action,
+                                 GtkWidget *proxy,
+                                 EomWindow *window);
+static void eom_window_finish_saving (EomWindow *window);
+static GAppInfo *get_appinfo_for_editor (EomWindow *window);
+
+static GQuark
+eom_window_error_quark (void)
+{
+	static GQuark q = 0;
+
+	if (q == 0)
+		q = g_quark_from_static_string ("eom-window-error-quark");
+
+	return q;
+}
+
+static void
+eom_window_set_collection_mode (EomWindow *window, EomWindowCollectionPos position, gboolean resizable)
+{
+	EomWindowPrivate *priv;
+	GtkWidget *hpaned;
+	EomThumbNavMode mode = EOM_THUMB_NAV_MODE_ONE_ROW;
+
+	eom_debug (DEBUG_PREFERENCES);
+
+	g_return_if_fail (EOM_IS_WINDOW (window));
+
+	priv = window->priv;
+
+	if (priv->collection_position == position &&
+	    priv->collection_resizable == resizable)
+		return;
+
+	priv->collection_position = position;
+	priv->collection_resizable = resizable;
+
+	hpaned = gtk_widget_get_parent (priv->sidebar);
+
+	g_object_ref (hpaned);
+	g_object_ref (priv->nav);
+
+	gtk_container_remove (GTK_CONTAINER (priv->layout), hpaned);
+	gtk_container_remove (GTK_CONTAINER (priv->layout), priv->nav);
+
+	gtk_widget_destroy (priv->layout);
+
+	switch (position) {
+	case EOM_WINDOW_COLLECTION_POS_BOTTOM:
+	case EOM_WINDOW_COLLECTION_POS_TOP:
+		if (resizable) {
+			mode = EOM_THUMB_NAV_MODE_MULTIPLE_ROWS;
+
+			priv->layout = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
+
+			if (position == EOM_WINDOW_COLLECTION_POS_BOTTOM) {
+				gtk_paned_pack1 (GTK_PANED (priv->layout), hpaned, TRUE, FALSE);
+				gtk_paned_pack2 (GTK_PANED (priv->layout), priv->nav, FALSE, TRUE);
+			} else {
+				gtk_paned_pack1 (GTK_PANED (priv->layout), priv->nav, FALSE, TRUE);
+				gtk_paned_pack2 (GTK_PANED (priv->layout), hpaned, TRUE, FALSE);
+			}
+		} else {
+			mode = EOM_THUMB_NAV_MODE_ONE_ROW;
+
+			priv->layout = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
+
+			if (position == EOM_WINDOW_COLLECTION_POS_BOTTOM) {
+				gtk_box_pack_start (GTK_BOX (priv->layout), hpaned, TRUE, TRUE, 0);
+				gtk_box_pack_start (GTK_BOX (priv->layout), priv->nav, FALSE, FALSE, 0);
+			} else {
+				gtk_box_pack_start (GTK_BOX (priv->layout), priv->nav, FALSE, FALSE, 0);
+				gtk_box_pack_start (GTK_BOX (priv->layout), hpaned, TRUE, TRUE, 0);
+			}
+		}
+		break;
+
+	case EOM_WINDOW_COLLECTION_POS_LEFT:
+	case EOM_WINDOW_COLLECTION_POS_RIGHT:
+		if (resizable) {
+			mode = EOM_THUMB_NAV_MODE_MULTIPLE_COLUMNS;
+
+			priv->layout = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
+
+			if (position == EOM_WINDOW_COLLECTION_POS_LEFT) {
+				gtk_paned_pack1 (GTK_PANED (priv->layout), priv->nav, FALSE, TRUE);
+				gtk_paned_pack2 (GTK_PANED (priv->layout), hpaned, TRUE, FALSE);
+			} else {
+				gtk_paned_pack1 (GTK_PANED (priv->layout), hpaned, TRUE, FALSE);
+				gtk_paned_pack2 (GTK_PANED (priv->layout), priv->nav, FALSE, TRUE);
+			}
+		} else {
+			mode = EOM_THUMB_NAV_MODE_ONE_COLUMN;
+
+			priv->layout = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
+
+			if (position == EOM_WINDOW_COLLECTION_POS_LEFT) {
+				gtk_box_pack_start (GTK_BOX (priv->layout), priv->nav, FALSE, FALSE, 0);
+				gtk_box_pack_start (GTK_BOX (priv->layout), hpaned, TRUE, TRUE, 0);
+			} else {
+				gtk_box_pack_start (GTK_BOX (priv->layout), hpaned, TRUE, TRUE, 0);
+				gtk_box_pack_start (GTK_BOX (priv->layout), priv->nav, FALSE, FALSE, 0);
+			}
+		}
+
+		break;
+	}
+
+	gtk_box_pack_end (GTK_BOX (priv->cbox), priv->layout, TRUE, TRUE, 0);
+
+	eom_thumb_nav_set_mode (EOM_THUMB_NAV (priv->nav), mode);
+
+	if (priv->mode != EOM_WINDOW_MODE_UNKNOWN) {
+		update_action_groups_state (window);
+	}
+}
+
+static void
+eom_window_can_save_changed_cb (GSettings *settings, gchar *key, gpointer user_data)
+{
+	EomWindowPrivate *priv;
+	EomWindow *window;
+	gboolean save_disabled = FALSE;
+	GtkAction *action_save, *action_save_as;
+
+	eom_debug (DEBUG_PREFERENCES);
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	window = EOM_WINDOW (user_data);
+	priv = EOM_WINDOW (user_data)->priv;
+
+	save_disabled = g_settings_get_boolean (settings, key);
+
+	priv->save_disabled = save_disabled;
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	action_save =
+		gtk_action_group_get_action (priv->actions_image, "ImageSave");
+	action_save_as =
+		gtk_action_group_get_action (priv->actions_image, "ImageSaveAs");
+
+	if (priv->save_disabled) {
+		gtk_action_set_sensitive (action_save, FALSE);
+		gtk_action_set_sensitive (action_save_as, FALSE);
+	} else {
+		EomImage *image = eom_window_get_image (window);
+
+		if (EOM_IS_IMAGE (image)) {
+			gtk_action_set_sensitive (action_save,
+						  eom_image_is_modified (image));
+
+			gtk_action_set_sensitive (action_save_as, TRUE);
+		}
+	}
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+}
+
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
+static cmsHPROFILE *
+eom_window_get_display_profile (GdkScreen *screen)
+{
+	Display *dpy;
+	Atom icc_atom, type;
+	int format;
+	gulong nitems;
+	gulong bytes_after;
+	gulong length;
+	guchar *str;
+	int result;
+	cmsHPROFILE *profile = NULL;
+	char *atom_name;
+
+	if (!GDK_IS_X11_SCREEN (screen)) {
+		return NULL;
+	}
+
+	dpy = GDK_DISPLAY_XDISPLAY (gdk_screen_get_display (screen));
+
+	if (gdk_x11_screen_get_screen_number (screen) > 0)
+		atom_name = g_strdup_printf ("_ICC_PROFILE_%d", gdk_x11_screen_get_screen_number (screen));
+	else
+		atom_name = g_strdup ("_ICC_PROFILE");
+
+	icc_atom = gdk_x11_get_xatom_by_name_for_display (gdk_screen_get_display (screen), atom_name);
+
+	g_free (atom_name);
+
+	result = XGetWindowProperty (dpy,
+				     GDK_WINDOW_XID (gdk_screen_get_root_window (screen)),
+				     icc_atom,
+				     0,
+				     G_MAXLONG,
+				     False,
+				     XA_CARDINAL,
+				     &type,
+				     &format,
+				     &nitems,
+				     &bytes_after,
+                                     (guchar **)&str);
+
+	/* TODO: handle bytes_after != 0 */
+
+	if ((result == Success) && (type == XA_CARDINAL) && (nitems > 0)) {
+		switch (format)
+		{
+			case 8:
+				length = nitems;
+				break;
+			case 16:
+				length = sizeof(short) * nitems;
+				break;
+			case 32:
+				length = sizeof(long) * nitems;
+				break;
+			default:
+				eom_debug_message (DEBUG_LCMS, "Unable to read profile, not correcting");
+
+				XFree (str);
+				return NULL;
+		}
+
+		profile = cmsOpenProfileFromMem (str, length);
+
+		if (G_UNLIKELY (profile == NULL)) {
+			eom_debug_message (DEBUG_LCMS,
+					   "Invalid display profile set, "
+					   "not using it");
+		}
+
+		XFree (str);
+	}
+
+	if (profile == NULL) {
+		profile = cmsCreate_sRGBProfile ();
+		eom_debug_message (DEBUG_LCMS,
+				 "No valid display profile set, assuming sRGB");
+	}
+
+	return profile;
+}
+#endif
+
+static void
+update_image_pos (EomWindow *window)
+{
+	EomWindowPrivate *priv;
+	gint pos = -1, n_images = 0;
+
+	priv = window->priv;
+
+	n_images = eom_list_store_length (EOM_LIST_STORE (priv->store));
+
+	if (n_images > 0) {
+		pos = eom_list_store_get_pos_by_image (EOM_LIST_STORE (priv->store),
+						       priv->image);
+	}
+	/* Images: (image pos) / (n_total_images) */
+	eom_statusbar_set_image_number (EOM_STATUSBAR (priv->statusbar),
+					pos + 1,
+					n_images);
+
+}
+
+static void
+update_status_bar (EomWindow *window)
+{
+	EomWindowPrivate *priv;
+	char *str = NULL;
+
+	g_return_if_fail (EOM_IS_WINDOW (window));
+
+	eom_debug (DEBUG_WINDOW);
+
+	priv = window->priv;
+
+	if (priv->image != NULL)
+	{
+		if ( eom_image_has_data (priv->image, EOM_IMAGE_DATA_DIMENSION))
+		{
+			int zoom, width, height;
+			goffset bytes = 0;
+
+			zoom = floor (100 * eom_scroll_view_get_zoom (EOM_SCROLL_VIEW (priv->view)) + 0.5);
+
+			eom_image_get_size (priv->image, &width, &height);
+
+			bytes = eom_image_get_bytes (priv->image);
+
+			if ((width > 0) && (height > 0)) {
+				char *size_string;
+
+					size_string = g_format_size (bytes);
+
+				/* Translators: This is the string displayed in the statusbar
+				 * The tokens are from left to right:
+				 * - image width
+				 * - image height
+				 * - image size in bytes
+				 * - zoom in percent */
+				str = g_strdup_printf (ngettext("%i × %i pixel  %s    %i%%",
+								"%i × %i pixels  %s    %i%%", height),
+							width,
+							height,
+							size_string,
+							zoom);
+
+				g_free (size_string);
+			}
+		}
+		update_image_pos (window);
+	}
+
+	gtk_statusbar_pop (GTK_STATUSBAR (priv->statusbar),
+			   priv->image_info_message_cid);
+
+	gtk_statusbar_push (GTK_STATUSBAR (priv->statusbar),
+			    priv->image_info_message_cid, str ? str : "");
+
+	g_free (str);
+}
+
+static void
+eom_window_set_message_area (EomWindow *window,
+		             GtkWidget *message_area)
+{
+	if (window->priv->message_area == message_area)
+		return;
+
+	if (window->priv->message_area != NULL)
+		gtk_widget_destroy (window->priv->message_area);
+
+	window->priv->message_area = message_area;
+
+	if (message_area == NULL) return;
+
+	gtk_box_pack_start (GTK_BOX (window->priv->cbox),
+			    window->priv->message_area,
+			    FALSE,
+			    FALSE,
+			    0);
+
+	g_object_add_weak_pointer (G_OBJECT (window->priv->message_area),
+				   (void *) &window->priv->message_area);
+}
+
+static void
+update_action_groups_state (EomWindow *window)
+{
+	EomWindowPrivate *priv;
+	GtkAction *action_collection;
+	GtkAction *action_sidebar;
+	GtkAction *action_fscreen;
+	GtkAction *action_sshow;
+	GtkAction *action_print;
+	gboolean print_disabled = FALSE;
+	gint n_images = 0;
+
+	g_return_if_fail (EOM_IS_WINDOW (window));
+
+	eom_debug (DEBUG_WINDOW);
+
+	priv = window->priv;
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	action_collection =
+		gtk_action_group_get_action (priv->actions_window,
+					     "ViewImageCollection");
+
+	action_sidebar =
+		gtk_action_group_get_action (priv->actions_window,
+					     "ViewSidebar");
+
+	action_fscreen =
+		gtk_action_group_get_action (priv->actions_image,
+					     "ViewFullscreen");
+
+	action_sshow =
+		gtk_action_group_get_action (priv->actions_collection,
+					     "ViewSlideshow");
+
+	action_print =
+		gtk_action_group_get_action (priv->actions_image,
+					     "ImagePrint");
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+
+	g_assert (action_collection != NULL);
+	g_assert (action_sidebar != NULL);
+	g_assert (action_fscreen != NULL);
+	g_assert (action_sshow != NULL);
+	g_assert (action_print != NULL);
+
+	if (priv->store != NULL) {
+		n_images = eom_list_store_length (EOM_LIST_STORE (priv->store));
+	}
+
+	if (n_images == 0) {
+		gtk_widget_hide (priv->layout);
+
+		G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+		gtk_action_group_set_sensitive (priv->actions_window,      TRUE);
+		gtk_action_group_set_sensitive (priv->actions_image,       FALSE);
+		gtk_action_group_set_sensitive (priv->actions_collection,  FALSE);
+
+		gtk_action_set_sensitive (action_fscreen, FALSE);
+		gtk_action_set_sensitive (action_sshow,   FALSE);
+		G_GNUC_END_IGNORE_DEPRECATIONS;
+
+		/* If there are no images on model, initialization
+ 		   stops here. */
+		if (priv->status == EOM_WINDOW_STATUS_INIT) {
+			priv->status = EOM_WINDOW_STATUS_NORMAL;
+		}
+	} else {
+		gboolean show_image_collection;
+
+		if (priv->flags & EOM_STARTUP_DISABLE_COLLECTION) {
+			g_settings_set_boolean (priv->ui_settings, EOM_CONF_UI_IMAGE_COLLECTION, FALSE);
+
+			show_image_collection = FALSE;
+		} else {
+			show_image_collection =
+				g_settings_get_boolean (priv->ui_settings, EOM_CONF_UI_IMAGE_COLLECTION);
+		}
+
+		show_image_collection = show_image_collection &&
+					n_images > 1 &&
+					priv->mode != EOM_WINDOW_MODE_SLIDESHOW;
+
+		gtk_widget_show (priv->layout);
+
+		if (show_image_collection)
+			gtk_widget_show (priv->nav);
+
+		G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+		gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action_collection),
+					      show_image_collection);
+
+		gtk_action_group_set_sensitive (priv->actions_window, TRUE);
+		gtk_action_group_set_sensitive (priv->actions_image,  TRUE);
+
+		gtk_action_set_sensitive (action_fscreen, TRUE);
+
+		if (n_images == 1) {
+			gtk_action_group_set_sensitive (priv->actions_collection,  FALSE);
+			gtk_action_set_sensitive (action_collection, FALSE);
+			gtk_action_set_sensitive (action_sshow, FALSE);
+		} else {
+			gtk_action_group_set_sensitive (priv->actions_collection,  TRUE);
+			gtk_action_set_sensitive (action_sshow, TRUE);
+		}
+		G_GNUC_END_IGNORE_DEPRECATIONS;
+
+		if (show_image_collection)
+			gtk_widget_grab_focus (priv->thumbview);
+		else
+			gtk_widget_grab_focus (priv->view);
+	}
+
+	print_disabled = g_settings_get_boolean (priv->lockdown_settings,
+						EOM_CONF_LOCKDOWN_CAN_PRINT);
+
+	if (print_disabled) {
+		G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+		gtk_action_set_sensitive (action_print, FALSE);
+	}
+
+	if (eom_sidebar_is_empty (EOM_SIDEBAR (priv->sidebar))) {
+		gtk_action_set_sensitive (action_sidebar, FALSE);
+		G_GNUC_END_IGNORE_DEPRECATIONS;
+		gtk_widget_hide (priv->sidebar);
+	}
+}
+
+static void
+update_selection_ui_visibility (EomWindow *window)
+{
+	EomWindowPrivate *priv;
+	GtkAction *wallpaper_action;
+	gint n_selected;
+
+	priv = window->priv;
+
+	n_selected = eom_thumb_view_get_n_selected (EOM_THUMB_VIEW (priv->thumbview));
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	wallpaper_action =
+		gtk_action_group_get_action (priv->actions_image,
+					     "ImageSetAsWallpaper");
+
+	if (n_selected == 1) {
+		gtk_action_set_sensitive (wallpaper_action, TRUE);
+	} else {
+		gtk_action_set_sensitive (wallpaper_action, FALSE);
+	}
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+}
+
+static gboolean
+add_file_to_recent_files (GFile *file)
+{
+	gchar *text_uri;
+	GFileInfo *file_info;
+	GtkRecentData *recent_data;
+	static gchar *groups[2] = { EOM_RECENT_FILES_GROUP , NULL };
+
+	if (file == NULL) return FALSE;
+
+	/* The password gets stripped here because ~/.recently-used.xbel is
+	 * readable by everyone (chmod 644). It also makes the workaround
+	 * for the bug with gtk_recent_info_get_uri_display() easier
+	 * (see the comment in eom_window_update_recent_files_menu()). */
+	text_uri = g_file_get_uri (file);
+
+	if (text_uri == NULL)
+		return FALSE;
+
+	file_info = g_file_query_info (file,
+				       G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+				       0, NULL, NULL);
+	if (file_info == NULL)
+		return FALSE;
+
+	recent_data = g_slice_new (GtkRecentData);
+	recent_data->display_name = NULL;
+	recent_data->description = NULL;
+	recent_data->mime_type = (gchar *) g_file_info_get_content_type (file_info);
+	recent_data->app_name = EOM_RECENT_FILES_APP_NAME;
+	recent_data->app_exec = g_strjoin(" ", g_get_prgname (), "%u", NULL);
+	recent_data->groups = groups;
+	recent_data->is_private = FALSE;
+
+	gtk_recent_manager_add_full (gtk_recent_manager_get_default (),
+				     text_uri,
+				     recent_data);
+
+	g_free (recent_data->app_exec);
+	g_free (text_uri);
+	g_object_unref (file_info);
+
+	g_slice_free (GtkRecentData, recent_data);
+
+	return FALSE;
+}
+
+static void
+image_thumb_changed_cb (EomImage *image, gpointer data)
+{
+	EomWindow *window;
+	EomWindowPrivate *priv;
+	GdkPixbuf *thumb;
+
+	g_return_if_fail (EOM_IS_WINDOW (data));
+
+	window = EOM_WINDOW (data);
+	priv = window->priv;
+
+	thumb = eom_image_get_thumbnail (image);
+
+	if (thumb != NULL) {
+		gtk_window_set_icon (GTK_WINDOW (window), thumb);
+
+		if (window->priv->properties_dlg != NULL) {
+			eom_properties_dialog_update (EOM_PROPERTIES_DIALOG (priv->properties_dlg),
+						      image);
+		}
+
+		g_object_unref (thumb);
+	} else if (!gtk_widget_get_visible (window->priv->nav)) {
+		gint img_pos = eom_list_store_get_pos_by_image (window->priv->store, image);
+		GtkTreePath *path = gtk_tree_path_new_from_indices (img_pos,-1);
+		GtkTreeIter iter;
+
+		gtk_tree_model_get_iter (GTK_TREE_MODEL (window->priv->store), &iter, path);
+		eom_list_store_thumbnail_set (window->priv->store, &iter);
+		gtk_tree_path_free (path);
+	}
+}
+
+static void
+file_changed_info_bar_response (GtkInfoBar *info_bar,
+				gint response,
+				EomWindow *window)
+{
+	if (response == GTK_RESPONSE_YES) {
+		eom_window_reload_image (window);
+	}
+
+	window->priv->needs_reload_confirmation = TRUE;
+
+	eom_window_set_message_area (window, NULL);
+}
+static void
+image_file_changed_cb (EomImage *img, EomWindow *window)
+{
+	GtkWidget *info_bar;
+	gchar *text, *markup;
+	GtkWidget *image;
+	GtkWidget *label;
+	GtkWidget *hbox;
+
+	if (window->priv->needs_reload_confirmation == FALSE)
+		return;
+
+	if (!eom_image_is_modified (img)) {
+		/* Auto-reload when image is unmodified */
+		eom_window_reload_image (window);
+		return;
+	}
+
+	window->priv->needs_reload_confirmation = FALSE;
+
+	info_bar = gtk_info_bar_new_with_buttons (_("_Reload"),
+						  GTK_RESPONSE_YES,
+						  C_("MessageArea", "Hi_de"),
+						  GTK_RESPONSE_NO, NULL);
+	gtk_info_bar_set_message_type (GTK_INFO_BAR (info_bar),
+				       GTK_MESSAGE_QUESTION);
+	image = gtk_image_new_from_icon_name ("dialog-question",
+					  GTK_ICON_SIZE_DIALOG);
+	label = gtk_label_new (NULL);
+
+	/* The newline character is currently necessary due to a problem
+	 * with the automatic line break. */
+	text = g_strdup_printf (_("The image \"%s\" has been modified by an external application."
+				  "\nWould you like to reload it?"), eom_image_get_caption (img));
+	markup = g_markup_printf_escaped ("<b>%s</b>", text);
+	gtk_label_set_markup (GTK_LABEL (label), markup);
+	g_free (text);
+	g_free (markup);
+
+	hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
+	gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
+	gtk_widget_set_halign (image, GTK_ALIGN_START);
+	gtk_widget_set_valign (image, GTK_ALIGN_END);
+	gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
+	gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+	gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (info_bar))), hbox, TRUE, TRUE, 0);
+	gtk_widget_show_all (hbox);
+	gtk_widget_show (info_bar);
+
+	eom_window_set_message_area (window, info_bar);
+	g_signal_connect (info_bar, "response",
+	                  G_CALLBACK (file_changed_info_bar_response),
+	                  window);
+}
+
+static void
+eom_window_display_image (EomWindow *window, EomImage *image)
+{
+	EomWindowPrivate *priv;
+	GFile *file;
+
+	g_return_if_fail (EOM_IS_WINDOW (window));
+	g_return_if_fail (EOM_IS_IMAGE (image));
+
+	eom_debug (DEBUG_WINDOW);
+
+	g_assert (eom_image_has_data (image, EOM_IMAGE_DATA_IMAGE));
+
+	priv = window->priv;
+
+	if (image != NULL) {
+		g_signal_connect (image, "thumbnail_changed",
+		                  G_CALLBACK (image_thumb_changed_cb),
+		                  window);
+		g_signal_connect (image, "file-changed",
+		                  G_CALLBACK (image_file_changed_cb),
+		                  window);
+
+		image_thumb_changed_cb (image, window);
+	}
+
+	priv->needs_reload_confirmation = TRUE;
+
+	eom_scroll_view_set_image (EOM_SCROLL_VIEW (priv->view), image);
+
+	gtk_window_set_title (GTK_WINDOW (window), eom_image_get_caption (image));
+
+	update_status_bar (window);
+
+	file = eom_image_get_file (image);
+	g_idle_add_full (G_PRIORITY_LOW,
+			 (GSourceFunc) add_file_to_recent_files,
+			 file,
+			 (GDestroyNotify) g_object_unref);
+
+	eom_window_update_openwith_menu (window, image);
+}
+
+static void
+open_with_launch_application_cb (GtkAction *action, gpointer data) {
+	EomImage *image;
+	GAppInfo *app;
+	GFile *file;
+	GList *files = NULL;
+
+	image = EOM_IMAGE (data);
+	file = eom_image_get_file (image);
+
+	app = g_object_get_data (G_OBJECT (action), "app");
+	files = g_list_append (files, file);
+	g_app_info_launch (app,
+			   files,
+			   NULL, NULL);
+
+	g_object_unref (file);
+	g_list_free (files);
+}
+
+static void
+eom_window_update_openwith_menu (EomWindow *window, EomImage *image)
+{
+	gboolean edit_button_active;
+	GAppInfo *editor_app;
+	GFile *file;
+	GFileInfo *file_info;
+	GList *iter;
+	gchar *label, *tip;
+	const gchar *mime_type;
+	GtkAction *action;
+	EomWindowPrivate *priv;
+	GList *apps;
+	guint action_id = 0;
+	GIcon *app_icon;
+	char *path;
+	GtkWidget *menuitem;
+
+	priv = window->priv;
+
+	edit_button_active = FALSE;
+	editor_app = get_appinfo_for_editor (window);
+
+	file = eom_image_get_file (image);
+	file_info = g_file_query_info (file,
+				       G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+				       0, NULL, NULL);
+
+	if (file_info == NULL)
+		return;
+	else {
+		mime_type = g_file_info_get_content_type (file_info);
+	}
+
+	if (priv->open_with_menu_id != 0) {
+		gtk_ui_manager_remove_ui (priv->ui_mgr, priv->open_with_menu_id);
+		priv->open_with_menu_id = 0;
+	}
+
+	if (priv->actions_open_with != NULL) {
+		gtk_ui_manager_remove_action_group (priv->ui_mgr, priv->actions_open_with);
+		g_object_unref (priv->actions_open_with);
+		priv->actions_open_with = NULL;
+	}
+
+	if (mime_type == NULL) {
+		g_object_unref (file_info);
+		return;
+	}
+
+	apps = g_app_info_get_all_for_type (mime_type);
+
+	g_object_unref (file_info);
+
+	if (!apps)
+		return;
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	priv->actions_open_with = gtk_action_group_new ("OpenWithActions");
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+	gtk_ui_manager_insert_action_group (priv->ui_mgr, priv->actions_open_with, -1);
+
+	priv->open_with_menu_id = gtk_ui_manager_new_merge_id (priv->ui_mgr);
+
+	for (iter = apps; iter; iter = iter->next) {
+		GAppInfo *app = iter->data;
+		gchar name[64];
+
+		if (editor_app != NULL && g_app_info_equal (editor_app, app)) {
+			edit_button_active = TRUE;
+		}
+
+		/* Do not include eom itself */
+		if (g_ascii_strcasecmp (g_app_info_get_executable (app),
+				                g_get_prgname ()) == 0) {
+			g_object_unref (app);
+			continue;
+		}
+
+		g_snprintf (name, sizeof (name), "OpenWith%u", action_id++);
+
+		label = g_strdup (g_app_info_get_name (app));
+		tip = g_strdup_printf (_("Use \"%s\" to open the selected image"), g_app_info_get_name (app));
+
+		G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+		action = gtk_action_new (name, label, tip, NULL);
+		G_GNUC_END_IGNORE_DEPRECATIONS;
+
+		app_icon = g_app_info_get_icon (app);
+		if (G_LIKELY (app_icon != NULL)) {
+			g_object_ref (app_icon);
+			G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+			gtk_action_set_gicon (action, app_icon);
+			G_GNUC_END_IGNORE_DEPRECATIONS;
+			g_object_unref (app_icon);
+		}
+
+		g_free (label);
+		g_free (tip);
+
+		g_object_set_data_full (G_OBJECT (action), "app", app,
+				                (GDestroyNotify) g_object_unref);
+
+		g_signal_connect (action, "activate",
+		                  G_CALLBACK (open_with_launch_application_cb),
+		                  image);
+
+		G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+		gtk_action_group_add_action (priv->actions_open_with, action);
+		G_GNUC_END_IGNORE_DEPRECATIONS;
+		g_object_unref (action);
+
+		gtk_ui_manager_add_ui (priv->ui_mgr,
+				        priv->open_with_menu_id,
+				        "/MainMenu/Image/ImageOpenWith/Applications Placeholder",
+				        name,
+				        name,
+				        GTK_UI_MANAGER_MENUITEM,
+				        FALSE);
+
+		gtk_ui_manager_add_ui (priv->ui_mgr,
+				        priv->open_with_menu_id,
+				        "/ThumbnailPopup/ImageOpenWith/Applications Placeholder",
+				        name,
+				        name,
+				        GTK_UI_MANAGER_MENUITEM,
+				        FALSE);
+		gtk_ui_manager_add_ui (priv->ui_mgr,
+				        priv->open_with_menu_id,
+				        "/ViewPopup/ImageOpenWith/Applications Placeholder",
+				        name,
+				        name,
+				        GTK_UI_MANAGER_MENUITEM,
+				        FALSE);
+
+		path = g_strdup_printf ("/MainMenu/Image/ImageOpenWith/Applications Placeholder/%s", name);
+
+		menuitem = gtk_ui_manager_get_widget (priv->ui_mgr, path);
+
+		/* Only force displaying the icon if it is an application icon */
+		gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (menuitem), app_icon != NULL);
+
+		g_free (path);
+
+		path = g_strdup_printf ("/ThumbnailPopup/ImageOpenWith/Applications Placeholder/%s", name);
+
+		menuitem = gtk_ui_manager_get_widget (priv->ui_mgr, path);
+
+		/* Only force displaying the icon if it is an application icon */
+		gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (menuitem), app_icon != NULL);
+
+		g_free (path);
+
+		path = g_strdup_printf ("/ViewPopup/ImageOpenWith/Applications Placeholder/%s", name);
+
+		menuitem = gtk_ui_manager_get_widget (priv->ui_mgr, path);
+
+		/* Only force displaying the icon if it is an application icon */
+		gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (menuitem), app_icon != NULL);
+
+		g_free (path);
+	}
+
+	g_list_free (apps);
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	action = gtk_action_group_get_action (window->priv->actions_image,
+		                                  "OpenEditor");
+	if (action != NULL) {
+		gtk_action_set_sensitive (action, edit_button_active);
+	}
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+}
+
+static void
+eom_window_clear_load_job (EomWindow *window)
+{
+	EomWindowPrivate *priv = window->priv;
+
+	if (priv->load_job != NULL) {
+		if (!priv->load_job->finished)
+			eom_job_queue_remove_job (priv->load_job);
+
+		g_signal_handlers_disconnect_by_func (priv->load_job,
+		                                      eom_job_progress_cb,
+		                                      window);
+
+		g_signal_handlers_disconnect_by_func (priv->load_job,
+		                                      eom_job_load_cb,
+		                                      window);
+
+		eom_image_cancel_load (EOM_JOB_LOAD (priv->load_job)->image);
+
+		g_object_unref (priv->load_job);
+		priv->load_job = NULL;
+
+		/* Hide statusbar */
+		eom_statusbar_set_progress (EOM_STATUSBAR (priv->statusbar), 0);
+	}
+}
+
+static void
+eom_job_progress_cb (EomJobLoad *job, float progress, gpointer user_data)
+{
+	EomWindow *window;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	window = EOM_WINDOW (user_data);
+
+	eom_statusbar_set_progress (EOM_STATUSBAR (window->priv->statusbar),
+				    progress);
+}
+
+static void
+eom_job_save_progress_cb (EomJobSave *job, float progress, gpointer user_data)
+{
+	EomWindowPrivate *priv;
+	EomWindow *window;
+
+	static EomImage *image = NULL;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	window = EOM_WINDOW (user_data);
+	priv = window->priv;
+
+	eom_statusbar_set_progress (EOM_STATUSBAR (priv->statusbar),
+				    progress);
+
+	if (image != job->current_image) {
+		gchar *str_image, *status_message;
+		guint n_images;
+
+		image = job->current_image;
+
+		n_images = g_list_length (job->images);
+
+		str_image = eom_image_get_uri_for_display (image);
+
+		/* Translators: This string is displayed in the statusbar
+		 * while saving images. The tokens are from left to right:
+		 * - the original filename
+		 * - the current image's position in the queue
+		 * - the total number of images queued for saving */
+		status_message = g_strdup_printf (_("Saving image \"%s\" (%u/%u)"),
+					          str_image,
+						  job->current_pos + 1,
+						  n_images);
+		g_free (str_image);
+
+		gtk_statusbar_pop (GTK_STATUSBAR (priv->statusbar),
+				   priv->image_info_message_cid);
+
+		gtk_statusbar_push (GTK_STATUSBAR (priv->statusbar),
+				    priv->image_info_message_cid,
+				    status_message);
+
+		g_free (status_message);
+	}
+
+	if (progress == 1.0)
+		image = NULL;
+}
+
+static void
+eom_window_obtain_desired_size (EomImage  *image,
+				gint       width,
+				gint       height,
+				EomWindow *window)
+{
+	GdkScreen *screen;
+	GdkDisplay *display;
+	GdkRectangle monitor;
+	GtkAllocation allocation;
+	gint final_width, final_height;
+	gint screen_width, screen_height;
+	gint window_width, window_height;
+	gint img_width, img_height;
+	gint view_width, view_height;
+	gint deco_width, deco_height;
+
+	update_action_groups_state (window);
+
+	img_width = width;
+	img_height = height;
+
+	if (!gtk_widget_get_realized (window->priv->view)) {
+		gtk_widget_realize (window->priv->view);
+	}
+
+	gtk_widget_get_allocation (window->priv->view, &allocation);
+	view_width  = allocation.width;
+	view_height = allocation.height;
+
+	if (!gtk_widget_get_realized (GTK_WIDGET (window))) {
+		gtk_widget_realize (GTK_WIDGET (window));
+	}
+
+	gtk_widget_get_allocation (GTK_WIDGET (window), &allocation);
+	window_width  = allocation.width;
+	window_height = allocation.height;
+
+	screen = gtk_window_get_screen (GTK_WINDOW (window));
+	display = gdk_screen_get_display (screen);
+
+	gdk_monitor_get_geometry (gdk_display_get_monitor_at_window (display,
+								     gtk_widget_get_window (GTK_WIDGET (window))),
+				  &monitor);
+
+	screen_width  = monitor.width;
+	screen_height = monitor.height;
+
+	deco_width = window_width - view_width;
+	deco_height = window_height - view_height;
+
+	if (img_width > 0 && img_height > 0) {
+		if ((img_width + deco_width > screen_width) ||
+		    (img_height + deco_height > screen_height))
+		{
+			double factor;
+
+			if (img_width > img_height) {
+				factor = (screen_width * 0.75 - deco_width) / (double) img_width;
+			} else {
+				factor = (screen_height * 0.75 - deco_height) / (double) img_height;
+			}
+
+			img_width = img_width * factor;
+			img_height = img_height * factor;
+		}
+	}
+
+	final_width = MAX (EOM_WINDOW_MIN_WIDTH, img_width + deco_width);
+	final_height = MAX (EOM_WINDOW_MIN_HEIGHT, img_height + deco_height);
+
+	eom_debug_message (DEBUG_WINDOW, "Setting window size: %d x %d", final_width, final_height);
+
+	gtk_window_set_default_size (GTK_WINDOW (window), final_width, final_height);
+
+	g_signal_emit (window, signals[SIGNAL_PREPARED], 0);
+}
+
+static void
+eom_window_error_message_area_response (GtkInfoBar       *message_area,
+					gint              response_id,
+					EomWindow        *window)
+{
+	if (response_id != GTK_RESPONSE_OK) {
+		eom_window_set_message_area (window, NULL);
+
+		return;
+	}
+
+	/* Trigger loading for current image again */
+	eom_thumb_view_select_single (EOM_THUMB_VIEW (window->priv->thumbview),
+				      EOM_THUMB_VIEW_SELECT_CURRENT);
+}
+
+static void
+eom_job_load_cb (EomJobLoad *job, gpointer data)
+{
+	EomWindow *window;
+	EomWindowPrivate *priv;
+	GtkAction *action_undo, *action_save;
+
+	g_return_if_fail (EOM_IS_WINDOW (data));
+
+	eom_debug (DEBUG_WINDOW);
+
+	window = EOM_WINDOW (data);
+	priv = window->priv;
+
+	eom_statusbar_set_progress (EOM_STATUSBAR (priv->statusbar), 0.0);
+
+	gtk_statusbar_pop (GTK_STATUSBAR (window->priv->statusbar),
+			   priv->image_info_message_cid);
+
+	if (priv->image != NULL) {
+		g_signal_handlers_disconnect_by_func (priv->image,
+		                                      image_thumb_changed_cb,
+		                                      window);
+		g_signal_handlers_disconnect_by_func (priv->image,
+		                                      image_file_changed_cb,
+		                                      window);
+
+		g_object_unref (priv->image);
+	}
+
+	priv->image = g_object_ref (job->image);
+
+	if (EOM_JOB (job)->error == NULL) {
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
+		eom_image_apply_display_profile (job->image,
+						 priv->display_profile);
+#endif
+
+		G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+		gtk_action_group_set_sensitive (priv->actions_image, TRUE);
+		G_GNUC_END_IGNORE_DEPRECATIONS;
+
+		eom_window_display_image (window, job->image);
+	} else {
+		GtkWidget *message_area;
+
+		message_area = eom_image_load_error_message_area_new (
+					eom_image_get_caption (job->image),
+					EOM_JOB (job)->error);
+
+		g_signal_connect (message_area, "response",
+		                  G_CALLBACK (eom_window_error_message_area_response),
+		                  window);
+
+		gtk_window_set_icon (GTK_WINDOW (window), NULL);
+		gtk_window_set_title (GTK_WINDOW (window),
+				      eom_image_get_caption (job->image));
+
+		eom_window_set_message_area (window, message_area);
+
+		gtk_info_bar_set_default_response (GTK_INFO_BAR (message_area),
+						   GTK_RESPONSE_CANCEL);
+
+		gtk_widget_show (message_area);
+
+		update_status_bar (window);
+
+		eom_scroll_view_set_image (EOM_SCROLL_VIEW (priv->view), NULL);
+
+        	if (window->priv->status == EOM_WINDOW_STATUS_INIT) {
+			update_action_groups_state (window);
+
+			g_signal_emit (window, signals[SIGNAL_PREPARED], 0);
+		}
+
+		G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+		gtk_action_group_set_sensitive (priv->actions_image, FALSE);
+		G_GNUC_END_IGNORE_DEPRECATIONS;
+	}
+
+	eom_window_clear_load_job (window);
+
+	if (window->priv->status == EOM_WINDOW_STATUS_INIT) {
+		window->priv->status = EOM_WINDOW_STATUS_NORMAL;
+
+		g_signal_handlers_disconnect_by_func (job->image,
+		                                      eom_window_obtain_desired_size,
+		                                      window);
+	}
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	action_save = gtk_action_group_get_action (priv->actions_image, "ImageSave");
+	action_undo = gtk_action_group_get_action (priv->actions_image, "EditUndo");
+
+	/* Set Save and Undo sensitive according to image state.
+	 * Respect lockdown in case of Save.*/
+	gtk_action_set_sensitive (action_save, (!priv->save_disabled && eom_image_is_modified (job->image)));
+	gtk_action_set_sensitive (action_undo, eom_image_is_modified (job->image));
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+
+	g_object_unref (job->image);
+}
+
+static void
+eom_window_clear_transform_job (EomWindow *window)
+{
+	EomWindowPrivate *priv = window->priv;
+
+	if (priv->transform_job != NULL) {
+		if (!priv->transform_job->finished)
+			eom_job_queue_remove_job (priv->transform_job);
+
+		g_signal_handlers_disconnect_by_func (priv->transform_job,
+		                                      eom_job_transform_cb,
+		                                      window);
+		g_object_unref (priv->transform_job);
+		priv->transform_job = NULL;
+	}
+}
+
+static void
+eom_job_transform_cb (EomJobTransform *job, gpointer data)
+{
+	EomWindow *window;
+	GtkAction *action_undo, *action_save;
+	EomImage *image;
+
+	g_return_if_fail (EOM_IS_WINDOW (data));
+
+	window = EOM_WINDOW (data);
+
+	eom_window_clear_transform_job (window);
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	action_undo =
+		gtk_action_group_get_action (window->priv->actions_image, "EditUndo");
+	action_save =
+		gtk_action_group_get_action (window->priv->actions_image, "ImageSave");
+
+	image = eom_window_get_image (window);
+
+	gtk_action_set_sensitive (action_undo, eom_image_is_modified (image));
+
+	if (!window->priv->save_disabled)
+	{
+		gtk_action_set_sensitive (action_save, eom_image_is_modified (image));
+	}
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+}
+
+static void
+apply_transformation (EomWindow *window, EomTransform *trans)
+{
+	EomWindowPrivate *priv;
+	GList *images;
+
+	g_return_if_fail (EOM_IS_WINDOW (window));
+
+	priv = window->priv;
+
+	images = eom_thumb_view_get_selected_images (EOM_THUMB_VIEW (priv->thumbview));
+
+	eom_window_clear_transform_job (window);
+
+	priv->transform_job = eom_job_transform_new (images, trans);
+
+	g_signal_connect (priv->transform_job, "finished",
+	                  G_CALLBACK (eom_job_transform_cb),
+	                  window);
+
+	g_signal_connect (priv->transform_job, "progress",
+	                  G_CALLBACK (eom_job_progress_cb),
+	                  window);
+
+	eom_job_queue_add_job (priv->transform_job);
+}
+
+static void
+handle_image_selection_changed_cb (EomThumbView *thumbview, EomWindow *window)
+{
+	EomWindowPrivate *priv;
+	EomImage *image;
+	gchar *status_message;
+	gchar *str_image;
+
+	priv = window->priv;
+
+	if (eom_list_store_length (EOM_LIST_STORE (priv->store)) == 0) {
+		gtk_window_set_title (GTK_WINDOW (window),
+				      g_get_application_name());
+		gtk_statusbar_remove_all (GTK_STATUSBAR (priv->statusbar),
+					  priv->image_info_message_cid);
+		eom_scroll_view_set_image (EOM_SCROLL_VIEW (priv->view),
+					   NULL);
+	}
+
+	if (eom_thumb_view_get_n_selected (EOM_THUMB_VIEW (priv->thumbview)) == 0)
+		return;
+
+	update_selection_ui_visibility (window);
+
+	image = eom_thumb_view_get_first_selected_image (EOM_THUMB_VIEW (priv->thumbview));
+
+	g_assert (EOM_IS_IMAGE (image));
+
+	eom_window_clear_load_job (window);
+
+	eom_window_set_message_area (window, NULL);
+
+	gtk_statusbar_pop (GTK_STATUSBAR (priv->statusbar),
+			   priv->image_info_message_cid);
+
+	if (image == priv->image) {
+		update_status_bar (window);
+		return;
+	}
+
+	if (eom_image_has_data (image, EOM_IMAGE_DATA_IMAGE)) {
+		if (priv->image != NULL)
+			g_object_unref (priv->image);
+
+		priv->image = image;
+		eom_window_display_image (window, image);
+		return;
+	}
+
+	if (priv->status == EOM_WINDOW_STATUS_INIT) {
+		g_signal_connect (image, "size-prepared",
+		                  G_CALLBACK (eom_window_obtain_desired_size),
+		                  window);
+	}
+
+	priv->load_job = eom_job_load_new (image, EOM_IMAGE_DATA_ALL);
+
+	g_signal_connect (priv->load_job, "finished",
+	                  G_CALLBACK (eom_job_load_cb),
+	                  window);
+
+	g_signal_connect (priv->load_job, "progress",
+	                  G_CALLBACK (eom_job_progress_cb),
+	                  window);
+
+	eom_job_queue_add_job (priv->load_job);
+
+	str_image = eom_image_get_uri_for_display (image);
+
+	status_message = g_strdup_printf (_("Opening image \"%s\""),
+				          str_image);
+
+	g_free (str_image);
+
+	gtk_statusbar_push (GTK_STATUSBAR (priv->statusbar),
+			    priv->image_info_message_cid, status_message);
+
+	g_free (status_message);
+}
+
+static void
+view_zoom_changed_cb (GtkWidget *widget, double zoom, gpointer user_data)
+{
+	EomWindow *window;
+	GtkAction *action_zoom_in;
+	GtkAction *action_zoom_out;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	window = EOM_WINDOW (user_data);
+
+	update_status_bar (window);
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	action_zoom_in =
+		gtk_action_group_get_action (window->priv->actions_image,
+					     "ViewZoomIn");
+
+	action_zoom_out =
+		gtk_action_group_get_action (window->priv->actions_image,
+					     "ViewZoomOut");
+
+	gtk_action_set_sensitive (action_zoom_in,
+			!eom_scroll_view_get_zoom_is_max (EOM_SCROLL_VIEW (window->priv->view)));
+	gtk_action_set_sensitive (action_zoom_out,
+			!eom_scroll_view_get_zoom_is_min (EOM_SCROLL_VIEW (window->priv->view)));
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+}
+
+static void
+eom_window_open_recent_cb (GtkAction *action, EomWindow *window)
+{
+	GtkRecentInfo *info;
+	const gchar *uri;
+	GSList *list = NULL;
+
+	info = g_object_get_data (G_OBJECT (action), "gtk-recent-info");
+	g_return_if_fail (info != NULL);
+
+	uri = gtk_recent_info_get_uri (info);
+	list = g_slist_prepend (list, g_strdup (uri));
+
+	eom_application_open_uri_list (EOM_APP,
+				       list,
+				       GDK_CURRENT_TIME,
+				       0,
+				       NULL);
+
+	g_slist_free_full (list, g_free);
+}
+
+static void
+file_open_dialog_response_cb (GtkWidget *chooser,
+			      gint       response_id,
+			      EomWindow  *ev_window)
+{
+	if (response_id == GTK_RESPONSE_OK) {
+		GSList *uris;
+
+		uris = gtk_file_chooser_get_uris (GTK_FILE_CHOOSER (chooser));
+
+		eom_application_open_uri_list (EOM_APP,
+					       uris,
+					       GDK_CURRENT_TIME,
+					       0,
+					       NULL);
+
+		g_slist_free_full (uris, g_free);
+	}
+
+	gtk_widget_destroy (chooser);
+}
+
+static void
+eom_window_update_fullscreen_action (EomWindow *window)
+{
+	GtkAction *action;
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	action = gtk_action_group_get_action (window->priv->actions_image,
+					      "ViewFullscreen");
+
+	g_signal_handlers_block_by_func (action,
+	                                 eom_window_cmd_fullscreen,
+	                                 window);
+
+	gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
+				      window->priv->mode == EOM_WINDOW_MODE_FULLSCREEN);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+
+	g_signal_handlers_unblock_by_func (action,
+	                                   eom_window_cmd_fullscreen,
+	                                   window);
+}
+
+static void
+eom_window_update_slideshow_action (EomWindow *window)
+{
+	GtkAction *action;
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	action = gtk_action_group_get_action (window->priv->actions_collection,
+					      "ViewSlideshow");
+
+	g_signal_handlers_block_by_func (action,
+	                                 eom_window_cmd_slideshow,
+	                                 window);
+
+	gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
+				      window->priv->mode == EOM_WINDOW_MODE_SLIDESHOW);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+
+	g_signal_handlers_unblock_by_func (action,
+	                                   eom_window_cmd_slideshow,
+	                                   window);
+}
+
+static void
+eom_window_update_pause_slideshow_action (EomWindow *window)
+{
+	GtkAction *action;
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	action = gtk_action_group_get_action (window->priv->actions_image,
+					      "PauseSlideshow");
+
+	g_signal_handlers_block_by_func (action,
+	                                 eom_window_cmd_pause_slideshow,
+	                                 window);
+
+	gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
+				      window->priv->mode != EOM_WINDOW_MODE_SLIDESHOW);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+
+	g_signal_handlers_unblock_by_func (action,
+	                                   eom_window_cmd_pause_slideshow,
+	                                   window);
+}
+
+static void
+eom_window_update_fullscreen_popup (EomWindow *window)
+{
+	GtkWidget *popup = window->priv->fullscreen_popup;
+	GdkRectangle screen_rect;
+	GdkScreen *screen;
+	GdkDisplay *display;
+
+	g_return_if_fail (popup != NULL);
+
+	if (gtk_widget_get_window (GTK_WIDGET (window)) == NULL) return;
+
+	screen = gtk_widget_get_screen (GTK_WIDGET (window));
+	display = gdk_screen_get_display (screen);
+
+	gdk_monitor_get_geometry (gdk_display_get_monitor_at_window (display,
+								     gtk_widget_get_window (GTK_WIDGET (window))),
+				  &screen_rect);
+
+	gtk_widget_set_size_request (popup,
+				     screen_rect.width,
+				     -1);
+
+	gtk_window_move (GTK_WINDOW (popup), screen_rect.x, screen_rect.y);
+}
+
+static void
+screen_size_changed_cb (GdkScreen *screen, EomWindow *window)
+{
+	eom_window_update_fullscreen_popup (window);
+}
+
+static gboolean
+fullscreen_timeout_cb (gpointer data)
+{
+	EomWindow *window = EOM_WINDOW (data);
+
+	gtk_widget_hide (window->priv->fullscreen_popup);
+
+	eom_scroll_view_hide_cursor (EOM_SCROLL_VIEW (window->priv->view));
+
+	fullscreen_clear_timeout (window);
+
+	return FALSE;
+}
+
+static gboolean
+slideshow_is_loop_end (EomWindow *window)
+{
+	EomWindowPrivate *priv = window->priv;
+	EomImage *image = NULL;
+	gint pos;
+
+	image = eom_thumb_view_get_first_selected_image (EOM_THUMB_VIEW (priv->thumbview));
+
+	pos = eom_list_store_get_pos_by_image (priv->store, image);
+
+	return (pos == (eom_list_store_length (priv->store) - 1));
+}
+
+static gboolean
+slideshow_switch_cb (gpointer data)
+{
+	EomWindow *window = EOM_WINDOW (data);
+	EomWindowPrivate *priv = window->priv;
+
+	eom_debug (DEBUG_WINDOW);
+
+	if (priv->slideshow_random) {
+		eom_thumb_view_select_single (EOM_THUMB_VIEW (priv->thumbview),
+					      EOM_THUMB_VIEW_SELECT_RANDOM);
+		return TRUE;
+	}
+
+	if (!priv->slideshow_loop && slideshow_is_loop_end (window)) {
+		eom_window_stop_fullscreen (window, TRUE);
+		return FALSE;
+	}
+
+	eom_thumb_view_select_single (EOM_THUMB_VIEW (priv->thumbview),
+				      EOM_THUMB_VIEW_SELECT_RIGHT);
+
+	return TRUE;
+}
+
+static void
+fullscreen_clear_timeout (EomWindow *window)
+{
+	eom_debug (DEBUG_WINDOW);
+
+	if (window->priv->fullscreen_timeout_source != NULL) {
+		g_source_unref (window->priv->fullscreen_timeout_source);
+		g_source_destroy (window->priv->fullscreen_timeout_source);
+	}
+
+	window->priv->fullscreen_timeout_source = NULL;
+}
+
+static void
+fullscreen_set_timeout (EomWindow *window)
+{
+	GSource *source;
+
+	eom_debug (DEBUG_WINDOW);
+
+	fullscreen_clear_timeout (window);
+
+	source = g_timeout_source_new (EOM_WINDOW_FULLSCREEN_TIMEOUT);
+	g_source_set_callback (source, fullscreen_timeout_cb, window, NULL);
+
+	g_source_attach (source, NULL);
+
+	window->priv->fullscreen_timeout_source = source;
+
+	eom_scroll_view_show_cursor (EOM_SCROLL_VIEW (window->priv->view));
+}
+
+static void
+slideshow_clear_timeout (EomWindow *window)
+{
+	eom_debug (DEBUG_WINDOW);
+
+	if (window->priv->slideshow_switch_source != NULL) {
+		g_source_unref (window->priv->slideshow_switch_source);
+		g_source_destroy (window->priv->slideshow_switch_source);
+	}
+
+	window->priv->slideshow_switch_source = NULL;
+}
+
+static void
+slideshow_set_timeout (EomWindow *window)
+{
+	GSource *source;
+
+	eom_debug (DEBUG_WINDOW);
+
+	slideshow_clear_timeout (window);
+
+	if (window->priv->slideshow_switch_timeout <= 0)
+		return;
+
+	source = g_timeout_source_new (window->priv->slideshow_switch_timeout * 1000);
+	g_source_set_callback (source, slideshow_switch_cb, window, NULL);
+
+	g_source_attach (source, NULL);
+
+	window->priv->slideshow_switch_source = source;
+}
+
+static void
+show_fullscreen_popup (EomWindow *window)
+{
+	eom_debug (DEBUG_WINDOW);
+
+	if (!gtk_widget_get_visible (window->priv->fullscreen_popup)) {
+		gtk_widget_show_all (GTK_WIDGET (window->priv->fullscreen_popup));
+	}
+
+	fullscreen_set_timeout (window);
+}
+
+static gboolean
+fullscreen_motion_notify_cb (GtkWidget      *widget,
+			     GdkEventMotion *event,<--- Parameter 'event' can be declared as pointer to const
+			     gpointer       user_data)
+{
+	EomWindow *window = EOM_WINDOW (user_data);
+
+	eom_debug (DEBUG_WINDOW);
+
+	if (event->y < EOM_WINDOW_FULLSCREEN_POPUP_THRESHOLD) {
+		show_fullscreen_popup (window);
+	} else {
+		fullscreen_set_timeout (window);
+	}
+
+	return FALSE;
+}
+
+static gboolean
+fullscreen_leave_notify_cb (GtkWidget *widget,
+			    GdkEventCrossing *event,
+			    gpointer user_data)
+{
+	EomWindow *window = EOM_WINDOW (user_data);
+
+	eom_debug (DEBUG_WINDOW);
+
+	fullscreen_clear_timeout (window);
+
+	return FALSE;
+}
+
+static void
+exit_fullscreen_button_clicked_cb (GtkWidget *button, EomWindow *window)
+{
+	GtkAction *action;
+
+	eom_debug (DEBUG_WINDOW);
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	if (window->priv->mode == EOM_WINDOW_MODE_SLIDESHOW) {
+		action = gtk_action_group_get_action (window->priv->actions_collection,
+						      "ViewSlideshow");
+	} else {
+		action = gtk_action_group_get_action (window->priv->actions_image,
+						      "ViewFullscreen");
+	}
+	g_return_if_fail (action != NULL);
+
+	gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), FALSE);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+}
+
+static GtkWidget *
+eom_window_get_exit_fullscreen_button (EomWindow *window)
+{
+	GtkWidget *button;
+
+	button = gtk_button_new_with_mnemonic (_("Leave Fullscreen"));
+	gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_icon_name ("view-restore", GTK_ICON_SIZE_BUTTON));
+
+	g_signal_connect (button, "clicked",
+	                  G_CALLBACK (exit_fullscreen_button_clicked_cb),
+	                  window);
+
+	return button;
+}
+
+static GtkWidget *
+eom_window_create_fullscreen_popup (EomWindow *window)
+{
+	GtkWidget *popup;
+	GtkWidget *hbox;
+	GtkWidget *button;
+	GtkWidget *toolbar;
+	GdkScreen *screen;
+
+	eom_debug (DEBUG_WINDOW);
+
+	popup = gtk_window_new (GTK_WINDOW_POPUP);
+
+	hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+	gtk_container_add (GTK_CONTAINER (popup), hbox);
+
+	toolbar = gtk_ui_manager_get_widget (window->priv->ui_mgr,
+					     "/FullscreenToolbar");
+	g_assert (GTK_IS_WIDGET (toolbar));
+	gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS);
+	gtk_box_pack_start (GTK_BOX (hbox), toolbar, TRUE, TRUE, 0);
+
+	button = eom_window_get_exit_fullscreen_button (window);
+	gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
+
+	gtk_window_set_resizable (GTK_WINDOW (popup), FALSE);
+
+	screen = gtk_widget_get_screen (GTK_WIDGET (window));
+
+	g_signal_connect_object (screen, "size-changed",
+	                         G_CALLBACK (screen_size_changed_cb),
+	                         window, 0);
+
+	g_signal_connect (popup, "enter-notify-event",
+	                  G_CALLBACK (fullscreen_leave_notify_cb),
+	                  window);
+
+	gtk_window_set_screen (GTK_WINDOW (popup), screen);
+
+	return popup;
+}
+
+static void
+update_ui_visibility (EomWindow *window)
+{
+	EomWindowPrivate *priv;
+
+	GtkAction *action;
+	GtkWidget *menubar;
+
+	gboolean fullscreen_mode, visible;
+
+	g_return_if_fail (EOM_IS_WINDOW (window));
+
+	eom_debug (DEBUG_WINDOW);
+
+	priv = window->priv;
+
+	fullscreen_mode = priv->mode == EOM_WINDOW_MODE_FULLSCREEN ||
+			  priv->mode == EOM_WINDOW_MODE_SLIDESHOW;
+
+	menubar = gtk_ui_manager_get_widget (priv->ui_mgr, "/MainMenu");
+	g_assert (GTK_IS_WIDGET (menubar));
+
+	visible = g_settings_get_boolean (priv->ui_settings, EOM_CONF_UI_TOOLBAR);
+	visible = visible && !fullscreen_mode;
+
+	action = gtk_ui_manager_get_action (priv->ui_mgr, "/MainMenu/View/ToolbarToggle");
+	g_assert (action != NULL);
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), visible);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+	g_object_set (G_OBJECT (priv->toolbar), "visible", visible, NULL);
+
+	visible = g_settings_get_boolean (priv->ui_settings, EOM_CONF_UI_STATUSBAR);
+	visible = visible && !fullscreen_mode;
+
+	action = gtk_ui_manager_get_action (priv->ui_mgr, "/MainMenu/View/StatusbarToggle");
+	g_assert (action != NULL);
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), visible);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+	g_object_set (G_OBJECT (priv->statusbar), "visible", visible, NULL);
+
+	if (priv->status != EOM_WINDOW_STATUS_INIT) {
+		visible = g_settings_get_boolean (priv->ui_settings, EOM_CONF_UI_IMAGE_COLLECTION);
+		visible = visible && priv->mode != EOM_WINDOW_MODE_SLIDESHOW;
+		action = gtk_ui_manager_get_action (priv->ui_mgr, "/MainMenu/View/ImageCollectionToggle");
+		g_assert (action != NULL);
+		G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+		gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), visible);
+		G_GNUC_END_IGNORE_DEPRECATIONS;
+		if (visible) {
+			gtk_widget_show (priv->nav);
+		} else {
+			gtk_widget_hide (priv->nav);
+		}
+	}
+
+	visible = g_settings_get_boolean (priv->ui_settings, EOM_CONF_UI_SIDEBAR);
+	visible = visible && !fullscreen_mode;
+	action = gtk_ui_manager_get_action (priv->ui_mgr, "/MainMenu/View/SidebarToggle");
+	g_assert (action != NULL);
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), visible);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+	if (visible) {
+		gtk_widget_show (priv->sidebar);
+	} else {
+		gtk_widget_hide (priv->sidebar);
+	}
+
+	if (priv->fullscreen_popup != NULL) {
+		gtk_widget_hide (priv->fullscreen_popup);
+	}
+}
+
+static void
+eom_window_inhibit_screensaver (EomWindow *window)
+{
+	EomWindowPrivate *priv = window->priv;<--- Variable 'priv' can be declared as pointer to const
+
+	g_return_if_fail (priv->fullscreen_idle_inhibit_cookie == 0);
+
+	eom_debug (DEBUG_WINDOW);
+
+	window->priv->fullscreen_idle_inhibit_cookie =
+		gtk_application_inhibit (GTK_APPLICATION (EOM_APP),
+		                         GTK_WINDOW (window),
+		                         GTK_APPLICATION_INHIBIT_IDLE,
+		                         _("Viewing a slideshow"));
+}
+
+static void
+eom_window_uninhibit_screensaver (EomWindow *window)
+{
+	EomWindowPrivate *priv = window->priv;
+
+	if (G_UNLIKELY (priv->fullscreen_idle_inhibit_cookie == 0))
+		return;
+
+	eom_debug (DEBUG_WINDOW);
+
+	gtk_application_uninhibit (GTK_APPLICATION (EOM_APP),
+	                           priv->fullscreen_idle_inhibit_cookie);
+	priv->fullscreen_idle_inhibit_cookie = 0;
+}
+
+static void
+eom_window_run_fullscreen (EomWindow *window, gboolean slideshow)
+{
+	static const GdkRGBA black = { 0., 0., 0., 1.};
+
+	EomWindowPrivate *priv;
+	GtkWidget *menubar;
+	gboolean upscale;
+
+	eom_debug (DEBUG_WINDOW);
+
+	priv = window->priv;
+
+	if (slideshow) {
+		priv->mode = EOM_WINDOW_MODE_SLIDESHOW;
+	} else {
+		/* Stop the timer if we come from slideshowing */
+		if (priv->mode == EOM_WINDOW_MODE_SLIDESHOW)
+			slideshow_clear_timeout (window);
+
+		priv->mode = EOM_WINDOW_MODE_FULLSCREEN;
+	}
+
+	if (window->priv->fullscreen_popup == NULL)
+		priv->fullscreen_popup
+			= eom_window_create_fullscreen_popup (window);
+
+	update_ui_visibility (window);
+
+	menubar = gtk_ui_manager_get_widget (priv->ui_mgr, "/MainMenu");
+	g_assert (GTK_IS_WIDGET (menubar));
+	gtk_widget_hide (menubar);
+
+	g_signal_connect (priv->view, "motion-notify-event",
+	                  G_CALLBACK (fullscreen_motion_notify_cb),
+	                  window);
+
+	g_signal_connect (priv->view, "leave-notify-event",
+	                  G_CALLBACK (fullscreen_leave_notify_cb),
+	                  window);
+
+	g_signal_connect (priv->thumbview, "motion-notify-event",
+	                  G_CALLBACK (fullscreen_motion_notify_cb),
+	                  window);
+
+	g_signal_connect (priv->thumbview, "leave-notify-event",
+	                  G_CALLBACK (fullscreen_leave_notify_cb),
+	                  window);
+
+	fullscreen_set_timeout (window);
+
+	if (slideshow) {
+		priv->slideshow_random =
+				g_settings_get_boolean (priv->fullscreen_settings,
+						       EOM_CONF_FULLSCREEN_RANDOM);
+
+		priv->slideshow_loop =
+				g_settings_get_boolean (priv->fullscreen_settings,
+						       EOM_CONF_FULLSCREEN_LOOP);
+
+		priv->slideshow_switch_timeout =
+				g_settings_get_int (priv->fullscreen_settings,
+						      EOM_CONF_FULLSCREEN_SECONDS);
+
+		slideshow_set_timeout (window);
+	}
+
+	upscale = g_settings_get_boolean (priv->fullscreen_settings,
+					 EOM_CONF_FULLSCREEN_UPSCALE);
+
+	eom_scroll_view_set_zoom_upscale (EOM_SCROLL_VIEW (priv->view),
+					  upscale);
+
+	gtk_widget_grab_focus (priv->view);
+
+	eom_scroll_view_override_bg_color (EOM_SCROLL_VIEW (window->priv->view),
+	                                   &black);
+
+	gtk_window_fullscreen (GTK_WINDOW (window));
+	eom_window_update_fullscreen_popup (window);
+
+	eom_window_inhibit_screensaver (window);
+
+	/* Update both actions as we could've already been in one those modes */
+	eom_window_update_slideshow_action (window);
+	eom_window_update_fullscreen_action (window);
+	eom_window_update_pause_slideshow_action (window);
+}
+
+static void
+eom_window_stop_fullscreen (EomWindow *window, gboolean slideshow)
+{
+	EomWindowPrivate *priv;
+	GtkWidget *menubar;
+
+	eom_debug (DEBUG_WINDOW);
+
+	priv = window->priv;
+
+	if (priv->mode != EOM_WINDOW_MODE_SLIDESHOW &&
+	    priv->mode != EOM_WINDOW_MODE_FULLSCREEN) return;
+
+	priv->mode = EOM_WINDOW_MODE_NORMAL;
+
+	fullscreen_clear_timeout (window);
+
+	if (slideshow) {
+		slideshow_clear_timeout (window);
+	}
+
+	g_signal_handlers_disconnect_by_func (priv->view,
+	                                      fullscreen_motion_notify_cb,
+	                                      window);
+
+	g_signal_handlers_disconnect_by_func (priv->view,
+	                                      fullscreen_leave_notify_cb,
+					      window);
+
+	g_signal_handlers_disconnect_by_func (priv->thumbview,
+	                                      fullscreen_motion_notify_cb,<--- You might need to cast the function pointer here
+	                                      window);
+
+	g_signal_handlers_disconnect_by_func (priv->thumbview,
+	                                      fullscreen_leave_notify_cb,
+	                                      window);
+
+	update_ui_visibility (window);
+
+	menubar = gtk_ui_manager_get_widget (priv->ui_mgr, "/MainMenu");
+	g_assert (GTK_IS_WIDGET (menubar));
+	gtk_widget_show (menubar);
+
+	eom_scroll_view_set_zoom_upscale (EOM_SCROLL_VIEW (priv->view), FALSE);
+
+	eom_scroll_view_override_bg_color (EOM_SCROLL_VIEW (window->priv->view),
+					   NULL);
+	gtk_window_unfullscreen (GTK_WINDOW (window));
+
+	if (slideshow) {
+		eom_window_update_slideshow_action (window);
+	} else {
+		eom_window_update_fullscreen_action (window);
+	}
+
+	eom_scroll_view_show_cursor (EOM_SCROLL_VIEW (priv->view));
+
+	eom_window_uninhibit_screensaver (window);
+}
+
+static void
+eom_window_print (EomWindow *window)
+{
+	GtkWidget *dialog;
+	GError *error = NULL;
+	GtkPrintOperation *print;
+	GtkPrintOperationResult res;
+	GtkPageSetup *page_setup;
+	GtkPrintSettings *print_settings;
+	gboolean page_setup_disabled = FALSE;
+
+	eom_debug (DEBUG_PRINTING);
+
+	print_settings = eom_print_get_print_settings ();
+
+	/* Make sure the window stays valid while printing */
+	g_object_ref (window);
+
+	if (window->priv->page_setup != NULL)
+		page_setup = g_object_ref (window->priv->page_setup);
+	else
+		page_setup = eom_print_get_page_setup ();
+
+	print = eom_print_operation_new (window->priv->image,
+					 print_settings,
+					 page_setup);
+
+	// Disable page setup options if they are locked down
+	page_setup_disabled = g_settings_get_boolean (window->priv->lockdown_settings,
+						      EOM_CONF_LOCKDOWN_CAN_SETUP_PAGE);
+	if (page_setup_disabled)
+		gtk_print_operation_set_embed_page_setup (print, FALSE);
+
+	res = gtk_print_operation_run (print,
+				       GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
+				       GTK_WINDOW (window), &error);
+
+	if (res == GTK_PRINT_OPERATION_RESULT_ERROR) {
+		dialog = gtk_message_dialog_new (GTK_WINDOW (window),
+						 GTK_DIALOG_DESTROY_WITH_PARENT,
+						 GTK_MESSAGE_ERROR,
+						 GTK_BUTTONS_CLOSE,
+						 _("Error printing file:\n%s"),
+						 error->message);
+		g_signal_connect (dialog, "response",
+		                  G_CALLBACK (gtk_widget_destroy),
+		                  NULL);
+		gtk_widget_show (dialog);
+		g_error_free (error);
+	} else if (res == GTK_PRINT_OPERATION_RESULT_APPLY) {
+		GtkPageSetup *new_page_setup;
+		eom_print_set_print_settings (gtk_print_operation_get_print_settings (print));
+		new_page_setup = gtk_print_operation_get_default_page_setup (print);
+		if (window->priv->page_setup != NULL)
+			g_object_unref (window->priv->page_setup);
+		window->priv->page_setup = g_object_ref (new_page_setup);
+		eom_print_set_page_setup (window->priv->page_setup);
+	}
+
+	if (page_setup != NULL)
+		g_object_unref (page_setup);
+	g_object_unref (print_settings);
+	g_object_unref (window);
+}
+
+static void
+eom_window_cmd_file_open (GtkAction *action, gpointer user_data)
+{
+	EomWindow *window;
+	EomWindowPrivate *priv;
+        EomImage *current;
+	GtkWidget *dlg;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	window = EOM_WINDOW (user_data);
+
+        priv = window->priv;
+
+	dlg = eom_file_chooser_new (GTK_FILE_CHOOSER_ACTION_OPEN);
+	gtk_window_set_transient_for (GTK_WINDOW (dlg), GTK_WINDOW (window));
+
+	current = eom_thumb_view_get_first_selected_image (EOM_THUMB_VIEW (priv->thumbview));
+
+	if (current != NULL) {
+		gchar *dir_uri, *file_uri;
+
+		file_uri = eom_image_get_uri_for_display (current);
+		dir_uri = g_path_get_dirname (file_uri);
+
+	        gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (dlg),
+                                                         dir_uri);
+		g_free (file_uri);
+		g_free (dir_uri);
+		g_object_unref (current);
+	} else {
+		/* If desired by the user,
+		   fallback to the XDG_PICTURES_DIR (if available) */
+		const gchar *pics_dir;
+		gboolean use_fallback;
+
+		use_fallback = g_settings_get_boolean (priv->ui_settings,
+					   EOM_CONF_UI_FILECHOOSER_XDG_FALLBACK);
+		pics_dir = g_get_user_special_dir (G_USER_DIRECTORY_PICTURES);
+		if (use_fallback && pics_dir) {
+			gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dlg),
+							     pics_dir);
+		}
+	}
+
+	g_signal_connect (dlg, "response",
+	                  G_CALLBACK (file_open_dialog_response_cb),
+	                  window);
+
+	gtk_widget_show_all (dlg);
+}
+
+static void
+eom_job_close_save_cb (EomJobSave *job, gpointer user_data)
+{
+	EomWindow *window = EOM_WINDOW (user_data);
+
+	g_signal_handlers_disconnect_by_func (job,
+	                                      eom_job_close_save_cb,
+	                                      window);
+
+	gtk_widget_destroy (GTK_WIDGET (window));
+}
+
+static void
+close_confirmation_dialog_response_handler (EomCloseConfirmationDialog *dlg,
+					    gint                        response_id,
+					    EomWindow                  *window)
+{
+	GList *selected_images;
+	EomWindowPrivate *priv;
+
+	priv = window->priv;
+
+	switch (response_id)
+	{
+		case GTK_RESPONSE_YES:
+			/* save selected images */
+			selected_images = eom_close_confirmation_dialog_get_selected_images (dlg);
+			if (eom_window_save_images (window, selected_images)) {
+				g_signal_connect (priv->save_job, "finished",
+				                  G_CALLBACK (eom_job_close_save_cb),
+				                  window);
+
+				eom_job_queue_add_job (priv->save_job);
+			}
+
+			break;
+
+		case GTK_RESPONSE_NO:
+			/* dont save */
+			gtk_widget_destroy (GTK_WIDGET (window));
+			break;
+
+		default:
+			/* Cancel */
+			gtk_widget_destroy (GTK_WIDGET (dlg));
+			break;
+	}
+}
+
+static gboolean
+eom_window_unsaved_images_confirm (EomWindow *window)
+{
+	EomWindowPrivate *priv;
+	gboolean disabled;
+	GtkWidget *dialog;
+	GList *list;
+	EomImage *image;
+	GtkTreeIter iter;
+
+	priv = window->priv;
+
+	disabled = g_settings_get_boolean(priv->ui_settings,
+					EOM_CONF_UI_DISABLE_CLOSE_CONFIRMATION);
+	disabled |= window->priv->save_disabled;
+	if (disabled || !priv->store) {
+		return FALSE;
+	}
+
+	list = NULL;
+	if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->store), &iter)) {
+		do {
+			gtk_tree_model_get (GTK_TREE_MODEL (priv->store), &iter,
+					    EOM_LIST_STORE_EOM_IMAGE, &image,
+					    -1);
+			if (!image)
+				continue;
+
+			if (eom_image_is_modified (image)) {
+				list = g_list_prepend (list, image);
+			}
+		} while (gtk_tree_model_iter_next (GTK_TREE_MODEL (priv->store), &iter));
+	}
+
+	if (list) {
+		list = g_list_reverse (list);
+		dialog = eom_close_confirmation_dialog_new (GTK_WINDOW (window),
+							    list);
+
+		g_list_free (list);
+		g_signal_connect (dialog, "response",
+		                  G_CALLBACK (close_confirmation_dialog_response_handler),
+		                  window);
+		gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
+
+		gtk_widget_show (dialog);
+		return TRUE;
+
+	}
+	return FALSE;
+}
+
+static void
+eom_window_cmd_close_window (GtkAction *action, gpointer user_data)
+{
+	EomWindow *window;
+	EomWindowPrivate *priv;<--- Variable 'priv' can be declared as pointer to const
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	window = EOM_WINDOW (user_data);
+	priv = window->priv;
+
+	if (priv->save_job != NULL) {
+		eom_window_finish_saving (window);
+	}
+
+	if (!eom_window_unsaved_images_confirm (window)) {
+		gtk_widget_destroy (GTK_WIDGET (user_data));
+	}
+}
+
+static void
+eom_window_cmd_preferences (GtkAction *action, gpointer user_data)
+{
+	EomWindow *window;
+	GtkWidget *pref_dlg;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	window = EOM_WINDOW (user_data);
+
+	pref_dlg = eom_preferences_dialog_get_instance (GTK_WINDOW (window));
+
+	gtk_widget_show (pref_dlg);
+}
+
+#define EOM_TB_EDITOR_DLG_RESET_RESPONSE 128
+
+static void
+eom_window_cmd_edit_toolbar_cb (GtkDialog *dialog, gint response, gpointer data)
+{
+	EomWindow *window = EOM_WINDOW (data);
+
+	if (response == EOM_TB_EDITOR_DLG_RESET_RESPONSE) {
+		EggToolbarsModel *model;
+		EggToolbarEditor *editor;
+
+		editor = g_object_get_data (G_OBJECT (dialog),
+					    "EggToolbarEditor");
+
+		g_return_if_fail (editor != NULL);
+
+		egg_editable_toolbar_set_edit_mode
+			(EGG_EDITABLE_TOOLBAR (window->priv->toolbar), FALSE);
+
+		eom_application_reset_toolbars_model (EOM_APP);
+		model = eom_application_get_toolbars_model (EOM_APP);
+		egg_editable_toolbar_set_model
+			(EGG_EDITABLE_TOOLBAR (window->priv->toolbar), model);
+		egg_toolbar_editor_set_model (editor, model);
+
+		/* Toolbar would be uneditable now otherwise */
+		egg_editable_toolbar_set_edit_mode
+			(EGG_EDITABLE_TOOLBAR (window->priv->toolbar), TRUE);
+	} else if (response == GTK_RESPONSE_HELP) {
+		eom_util_show_help ("eom-toolbareditor", NULL);
+	} else {
+		egg_editable_toolbar_set_edit_mode
+			(EGG_EDITABLE_TOOLBAR (window->priv->toolbar), FALSE);
+
+		eom_application_save_toolbars_model (EOM_APP);
+
+		gtk_widget_destroy (GTK_WIDGET (dialog));
+	}
+}
+
+static void
+eom_window_cmd_edit_toolbar (GtkAction *action, gpointer *user_data)
+{
+	EomWindow *window;
+	GtkWidget *dialog;
+	GtkWidget *editor;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	window = EOM_WINDOW (user_data);
+
+	dialog = gtk_dialog_new_with_buttons (_("Toolbar Editor"),
+					      GTK_WINDOW (window),
+				              GTK_DIALOG_DESTROY_WITH_PARENT,
+					      _("_Reset to Default"),
+					      EOM_TB_EDITOR_DLG_RESET_RESPONSE,
+ 					      "gtk-close",
+					      GTK_RESPONSE_CLOSE,
+					      "gtk-help",
+					      GTK_RESPONSE_HELP,
+					      NULL);
+
+	gtk_dialog_set_default_response (GTK_DIALOG (dialog),
+					 GTK_RESPONSE_CLOSE);
+
+	gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
+
+	gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 2);
+
+	gtk_window_set_default_size (GTK_WINDOW (dialog), 500, 400);
+
+	editor = egg_toolbar_editor_new (window->priv->ui_mgr,
+					 eom_application_get_toolbars_model (EOM_APP));
+
+	gtk_container_set_border_width (GTK_CONTAINER (editor), 5);
+
+	// Use as much vertical space as available
+	gtk_widget_set_vexpand (GTK_WIDGET (editor), TRUE);
+
+	gtk_box_set_spacing (GTK_BOX (EGG_TOOLBAR_EDITOR (editor)), 5);
+
+	gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), editor);
+
+	egg_editable_toolbar_set_edit_mode
+		(EGG_EDITABLE_TOOLBAR (window->priv->toolbar), TRUE);
+
+	g_object_set_data (G_OBJECT (dialog), "EggToolbarEditor", editor);
+
+	g_signal_connect (dialog, "response",
+	                  G_CALLBACK (eom_window_cmd_edit_toolbar_cb),
+	                  window);
+
+	gtk_widget_show_all (dialog);
+}
+
+static void
+eom_window_cmd_help (GtkAction *action, gpointer user_data)
+{
+	EomWindow *window;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	window = EOM_WINDOW (user_data);
+
+	eom_util_show_help (NULL, GTK_WINDOW (window));
+}
+
+#define ABOUT_GROUP "About"
+#define EMAILIFY(string) (g_strdelimit ((string), "%", '@'))
+
+static void
+eom_window_cmd_about (GtkAction *action, gpointer user_data)
+{
+	EomWindow *window;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	const char *license[] = {
+		N_("This program is free software; you can redistribute it and/or modify "
+		   "it under the terms of the GNU General Public License as published by "
+		   "the Free Software Foundation; either version 2 of the License, or "
+		   "(at your option) any later version.\n"),
+		N_("This program 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 General Public License for more details.\n"),
+		N_("You should have received a copy of the GNU General Public License "
+		   "along with this program; if not, write to the Free Software "
+		   "Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.")
+	};
+
+	char *license_trans;
+	GKeyFile *key_file;
+	GBytes *bytes;
+	const guint8 *data;
+	gsize data_len;
+	GError *error = NULL;
+	char **authors, **documenters;
+	gsize n_authors = 0, n_documenters = 0 , i;
+
+	bytes = g_resources_lookup_data ("/org/mate/eom/ui/eom.about", G_RESOURCE_LOOKUP_FLAGS_NONE, &error);
+	g_assert_no_error (error);
+
+	data = g_bytes_get_data (bytes, &data_len);
+	key_file = g_key_file_new ();
+	g_key_file_load_from_data (key_file, (const char *) data, data_len, 0, &error);
+	g_assert_no_error (error);
+
+	authors = g_key_file_get_string_list (key_file, ABOUT_GROUP, "Authors", &n_authors, NULL);
+	documenters = g_key_file_get_string_list (key_file, ABOUT_GROUP, "Documenters", &n_documenters, NULL);
+
+	g_key_file_free (key_file);
+	g_bytes_unref (bytes);
+
+	for (i = 0; i < n_authors; ++i)
+		authors[i] = EMAILIFY (authors[i]);
+	for (i = 0; i < n_documenters; ++i)
+		documenters[i] = EMAILIFY (documenters[i]);
+
+	license_trans = g_strconcat (_(license[0]), "\n", _(license[1]), "\n", _(license[2]), "\n", NULL);
+
+	window = EOM_WINDOW (user_data);
+
+	gtk_show_about_dialog (GTK_WINDOW (window),
+			       "program-name", _("Eye of MATE"),
+			       "title", _("About Eye of MATE"),
+			       "version", VERSION,
+			       "copyright", _("Copyright \xc2\xa9 2000-2010 Free Software Foundation, Inc.\n"
+			                      "Copyright \xc2\xa9 2011 Perberos\n"
+			                      "Copyright \xc2\xa9 2012-2021 MATE developers"),
+			       "comments",_("Eye of MATE is a simple graphics viewer for the MATE Desktop Environment."),
+			       "authors", authors,
+			       "documenters", documenters,
+			       "translator-credits", _("translator-credits"),
+			       "website", PACKAGE_URL,
+			       "logo-icon-name", "eom",
+			       "wrap-license", TRUE,
+			       "license", license_trans,
+			       NULL);
+
+	g_strfreev (authors);
+	g_strfreev (documenters);
+	g_free (license_trans);
+}
+
+static void
+eom_window_cmd_show_hide_bar (GtkAction *action, gpointer user_data)
+{
+	EomWindow *window;
+	EomWindowPrivate *priv;
+	gboolean visible;
+	const gchar *action_name;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	window = EOM_WINDOW (user_data);
+	priv = window->priv;
+
+	if (priv->mode != EOM_WINDOW_MODE_NORMAL &&
+            priv->mode != EOM_WINDOW_MODE_FULLSCREEN) return;
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	visible = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+	action_name = gtk_action_get_name (action);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+
+	if (g_ascii_strcasecmp (action_name, "ViewToolbar") == 0) {
+		g_object_set (G_OBJECT (priv->toolbar), "visible", visible, NULL);
+
+		if (priv->mode == EOM_WINDOW_MODE_NORMAL)
+			g_settings_set_boolean (priv->ui_settings, EOM_CONF_UI_TOOLBAR, visible);
+
+	} else if (g_ascii_strcasecmp (action_name, "ViewStatusbar") == 0) {
+		g_object_set (G_OBJECT (priv->statusbar), "visible", visible, NULL);
+
+		if (priv->mode == EOM_WINDOW_MODE_NORMAL)
+			g_settings_set_boolean (priv->ui_settings, EOM_CONF_UI_STATUSBAR, visible);
+
+	} else if (g_ascii_strcasecmp (action_name, "ViewImageCollection") == 0) {
+		if (visible) {
+			/* Make sure the focus widget is realized to
+			 * avoid warnings on keypress events */
+			if (!gtk_widget_get_realized (window->priv->thumbview))
+				gtk_widget_realize (window->priv->thumbview);
+
+			gtk_widget_show (priv->nav);
+			gtk_widget_grab_focus (priv->thumbview);
+		} else {
+			/* Make sure the focus widget is realized to
+			 * avoid warnings on keypress events.
+			 * Don't do it during init phase or the view
+			 * will get a bogus allocation. */
+			if (!gtk_widget_get_realized (priv->view)
+			    && priv->status == EOM_WINDOW_STATUS_NORMAL)
+				gtk_widget_realize (priv->view);
+
+			gtk_widget_hide (priv->nav);
+
+			if (gtk_widget_get_realized (priv->view))
+				gtk_widget_grab_focus (priv->view);
+		}
+		g_settings_set_boolean (priv->ui_settings, EOM_CONF_UI_IMAGE_COLLECTION, visible);
+
+	} else if (g_ascii_strcasecmp (action_name, "ViewSidebar") == 0) {
+		if (visible) {
+			gtk_widget_show (priv->sidebar);
+		} else {
+			gtk_widget_hide (priv->sidebar);
+		}
+		g_settings_set_boolean (priv->ui_settings, EOM_CONF_UI_SIDEBAR, visible);
+	}
+}
+
+static void
+wallpaper_info_bar_response (GtkInfoBar *bar, gint response, EomWindow *window)
+{
+	if (response == GTK_RESPONSE_YES) {
+		GAppInfo *app_info;
+		GError *error = NULL;
+
+		app_info = g_app_info_create_from_commandline ("mate-appearance-properties --show-page=background",
+							       "mate-appearance-properties",
+							       G_APP_INFO_CREATE_NONE,
+							       &error);
+
+		if (error != NULL) {
+			g_warning ("%s%s", _("Error launching appearance preferences dialog: "),
+				   error->message);
+			g_error_free (error);
+			error = NULL;
+		}
+
+		if (app_info != NULL) {
+			GdkAppLaunchContext *context;
+			GdkDisplay *display;
+
+			display = gtk_widget_get_display (GTK_WIDGET (window));
+			context = gdk_display_get_app_launch_context (display);
+			g_app_info_launch (app_info, NULL, G_APP_LAUNCH_CONTEXT (context), &error);
+
+			if (error != NULL) {
+				g_warning ("%s%s", _("Error launching appearance preferences dialog: "),
+					   error->message);
+				g_error_free (error);
+				error = NULL;
+			}
+
+			g_object_unref (context);
+			g_object_unref (app_info);
+		}
+	}
+
+	/* Close message area on every response */
+	eom_window_set_message_area (window, NULL);
+}
+
+static void
+eom_window_set_wallpaper (EomWindow *window, const gchar *filename, const gchar *visible_filename)
+{
+	GtkWidget *info_bar;
+	GtkWidget *image;
+	GtkWidget *label;
+	GtkWidget *hbox;
+	gchar *markup;
+	gchar *text;
+	gchar *basename;
+	GSettings *wallpaper_settings;
+
+	wallpaper_settings = g_settings_new (EOM_CONF_BACKGROUND_SCHEMA);
+	g_settings_set_string (wallpaper_settings,
+				 EOM_CONF_BACKGROUND_FILE,
+				 filename);
+	g_object_unref (wallpaper_settings);
+
+	/* I18N: When setting mnemonics for these strings, watch out to not
+	   clash with mnemonics from eom's menubar */
+	info_bar = gtk_info_bar_new_with_buttons (_("_Open Background Preferences"),
+						  GTK_RESPONSE_YES,
+						  C_("MessageArea","Hi_de"),
+						  GTK_RESPONSE_NO, NULL);
+	gtk_info_bar_set_message_type (GTK_INFO_BAR (info_bar),
+				       GTK_MESSAGE_QUESTION);
+
+	image = gtk_image_new_from_icon_name ("dialog-question",
+					  GTK_ICON_SIZE_DIALOG);
+	label = gtk_label_new (NULL);
+
+	if (!visible_filename)
+		basename = g_path_get_basename (filename);
+
+	/* The newline character is currently necessary due to a problem
+	 * with the automatic line break. */
+	text = g_strdup_printf (_("The image \"%s\" has been set as Desktop Background."
+				  "\nWould you like to modify its appearance?"),
+				visible_filename ? visible_filename : basename);
+	markup = g_markup_printf_escaped ("<b>%s</b>", text);
+	gtk_label_set_markup (GTK_LABEL (label), markup);
+	g_free (markup);
+	g_free (text);
+	if (!visible_filename)
+		g_free (basename);
+
+	hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
+	gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
+	gtk_widget_set_halign (image, GTK_ALIGN_START);
+	gtk_widget_set_valign (image, GTK_ALIGN_END);
+	gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
+	gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+	gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (info_bar))), hbox, TRUE, TRUE, 0);
+	gtk_widget_show_all (hbox);
+	gtk_widget_show (info_bar);
+
+	eom_window_set_message_area (window, info_bar);
+	gtk_info_bar_set_default_response (GTK_INFO_BAR (info_bar),
+					   GTK_RESPONSE_YES);
+	g_signal_connect (info_bar, "response",
+	                  G_CALLBACK (wallpaper_info_bar_response),
+	                  window);
+}
+
+static void
+eom_job_save_cb (EomJobSave *job, gpointer user_data)
+{
+	EomWindow *window = EOM_WINDOW (user_data);
+	GtkAction *action_save;
+
+	g_signal_handlers_disconnect_by_func (job,
+	                                      eom_job_save_cb,
+	                                      window);
+
+	g_signal_handlers_disconnect_by_func (job,
+	                                      eom_job_save_progress_cb,
+	                                      window);
+
+	g_object_unref (window->priv->save_job);
+	window->priv->save_job = NULL;
+
+	update_status_bar (window);
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	action_save = gtk_action_group_get_action (window->priv->actions_image,
+						   "ImageSave");
+	gtk_action_set_sensitive (action_save, FALSE);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+}
+
+static void
+eom_job_copy_cb (EomJobCopy *job, gpointer user_data)
+{
+	EomWindow *window = EOM_WINDOW (user_data);
+	gchar *filepath, *basename, *filename, *extension;
+	GtkAction *action;
+	GFile *source_file, *dest_file;
+
+	/* Create source GFile */
+	basename = g_file_get_basename (job->images->data);
+	filepath = g_build_filename (job->dest, basename, NULL);
+	source_file = g_file_new_for_path (filepath);
+	g_free (filepath);
+
+	/* Create destination GFile */
+	extension = eom_util_filename_get_extension (basename);
+	filename = g_strdup_printf  ("%s.%s", EOM_WALLPAPER_FILENAME, extension);
+	filepath = g_build_filename (job->dest, filename, NULL);
+	dest_file = g_file_new_for_path (filepath);
+	g_free (filename);
+	g_free (extension);
+
+	/* Move the file */
+	g_file_move (source_file, dest_file, G_FILE_COPY_OVERWRITE,
+		     NULL, NULL, NULL, NULL);
+
+	/* Set the wallpaper */
+	eom_window_set_wallpaper (window, filepath, basename);
+	g_free (basename);
+	g_free (filepath);
+
+	gtk_statusbar_pop (GTK_STATUSBAR (window->priv->statusbar),
+			   window->priv->copy_file_cid);
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	action = gtk_action_group_get_action (window->priv->actions_image,
+					      "ImageSetAsWallpaper");
+	gtk_action_set_sensitive (action, TRUE);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+
+	window->priv->copy_job = NULL;
+
+	g_object_unref (source_file);
+	g_object_unref (dest_file);
+	g_object_unref (G_OBJECT (job->images->data));
+	g_list_free (job->images);
+	g_object_unref (job);
+}
+
+static gboolean
+eom_window_save_images (EomWindow *window, GList *images)
+{
+	EomWindowPrivate *priv;
+
+	priv = window->priv;
+
+	if (window->priv->save_job != NULL)
+		return FALSE;
+
+	priv->save_job = eom_job_save_new (images);
+
+	g_signal_connect (priv->save_job, "finished",
+	                  G_CALLBACK (eom_job_save_cb),
+	                  window);
+
+	g_signal_connect (priv->save_job, "progress",
+	                  G_CALLBACK (eom_job_save_progress_cb),
+	                  window);
+
+	return TRUE;
+}
+
+static void
+eom_window_cmd_save (GtkAction *action, gpointer user_data)
+{
+	EomWindowPrivate *priv;
+	EomWindow *window;
+	GList *images;
+
+	window = EOM_WINDOW (user_data);
+	priv = window->priv;
+
+	if (window->priv->save_job != NULL)
+		return;
+
+	images = eom_thumb_view_get_selected_images (EOM_THUMB_VIEW (priv->thumbview));
+
+	if (eom_window_save_images (window, images)) {
+		eom_job_queue_add_job (priv->save_job);
+	}
+}
+
+static GFile*
+eom_window_retrieve_save_as_file (EomWindow *window, EomImage *image)
+{
+	GtkWidget *dialog;
+	GFile *save_file = NULL;
+	GFile *last_dest_folder;
+	gint response;
+
+	g_assert (image != NULL);
+
+	dialog = eom_file_chooser_new (GTK_FILE_CHOOSER_ACTION_SAVE);
+
+	last_dest_folder = window->priv->last_save_as_folder;
+
+	if (last_dest_folder && g_file_query_exists (last_dest_folder, NULL)) {
+		gtk_file_chooser_set_current_folder_file (GTK_FILE_CHOOSER (dialog), last_dest_folder, NULL);
+		gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog),
+						 eom_image_get_caption (image));
+	} else {
+		GFile *image_file;
+
+		image_file = eom_image_get_file (image);
+		/* Setting the file will also navigate to its parent folder */
+		gtk_file_chooser_set_file (GTK_FILE_CHOOSER (dialog),
+					   image_file, NULL);
+		g_object_unref (image_file);
+	}
+
+	response = gtk_dialog_run (GTK_DIALOG (dialog));
+	gtk_widget_hide (dialog);
+
+	if (response == GTK_RESPONSE_OK) {
+		save_file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (dialog));
+		if (window->priv->last_save_as_folder)
+			g_object_unref (window->priv->last_save_as_folder);
+		window->priv->last_save_as_folder = g_file_get_parent (save_file);
+	}
+	gtk_widget_destroy (dialog);
+
+	return save_file;
+}
+
+static void
+eom_window_cmd_save_as (GtkAction *action, gpointer user_data)
+{
+        EomWindowPrivate *priv;
+        EomWindow *window;
+	GList *images;
+	guint n_images;
+
+        window = EOM_WINDOW (user_data);
+	priv = window->priv;
+
+	if (window->priv->save_job != NULL)
+		return;
+
+	images = eom_thumb_view_get_selected_images (EOM_THUMB_VIEW (priv->thumbview));
+	n_images = g_list_length (images);
+
+	if (n_images == 1) {
+		GFile *file;
+
+		file = eom_window_retrieve_save_as_file (window, images->data);
+
+		if (!file) {
+			g_list_free (images);
+			return;
+		}
+
+		priv->save_job = eom_job_save_as_new (images, NULL, file);
+
+		g_object_unref (file);
+	} else if (n_images > 1) {
+		GFile *base_file;
+		GtkWidget *dialog;
+		gchar *basedir;
+		EomURIConverter *converter;
+
+		basedir = g_get_current_dir ();
+		base_file = g_file_new_for_path (basedir);
+		g_free (basedir);
+
+		dialog = eom_save_as_dialog_new (GTK_WINDOW (window),
+						 images,
+						 base_file);
+
+		gtk_widget_show_all (dialog);
+
+		if (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_OK) {
+			g_object_unref (base_file);
+			g_list_free (images);
+			gtk_widget_destroy (dialog);
+
+			return;
+		}
+
+		converter = eom_save_as_dialog_get_converter (dialog);
+
+		g_assert (converter != NULL);
+
+		priv->save_job = eom_job_save_as_new (images, converter, NULL);
+
+		gtk_widget_destroy (dialog);
+
+		g_object_unref (converter);
+		g_object_unref (base_file);
+	} else {
+		/* n_images = 0 -- No Image selected */
+		return;
+	}
+
+	g_signal_connect (priv->save_job, "finished",
+	                  G_CALLBACK (eom_job_save_cb),
+	                  window);
+
+	g_signal_connect (priv->save_job, "progress",
+	                  G_CALLBACK (eom_job_save_progress_cb),
+	                  window);
+
+	eom_job_queue_add_job (priv->save_job);
+}
+
+static void
+eom_window_cmd_open_containing_folder (GtkAction *action, gpointer user_data)
+{
+	EomWindowPrivate *priv;
+
+	GFile *file;
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	priv = EOM_WINDOW (user_data)->priv;
+
+	g_return_if_fail (priv->image != NULL);
+
+	file = eom_image_get_file (priv->image);
+
+	g_return_if_fail (file != NULL);
+
+	eom_util_show_file_in_filemanager (file,
+	                                   GTK_WINDOW (user_data));
+}
+
+static void
+eom_window_cmd_print (GtkAction *action, gpointer user_data)
+{
+	EomWindow *window = EOM_WINDOW (user_data);
+
+	eom_window_print (window);
+}
+
+/**
+ * eom_window_get_properties_dialog:
+ * @window: a #EomWindow
+ *
+ * Gets the @window property dialog. The widget will be built on the first call to this function.
+ *
+ * Returns: (transfer none): a #GtkDialog.
+ */
+
+GtkWidget*
+eom_window_get_properties_dialog (EomWindow *window)
+{
+	EomWindowPrivate *priv;
+
+	g_return_val_if_fail (EOM_IS_WINDOW (window), NULL);
+
+	priv = window->priv;
+
+	if (priv->properties_dlg == NULL) {
+		GtkAction *next_image_action, *previous_image_action;
+
+		G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+		next_image_action =
+			gtk_action_group_get_action (priv->actions_collection,
+						     "GoNext");
+
+		previous_image_action =
+			gtk_action_group_get_action (priv->actions_collection,
+						     "GoPrevious");
+		G_GNUC_END_IGNORE_DEPRECATIONS;
+		priv->properties_dlg =
+			eom_properties_dialog_new (GTK_WINDOW (window),
+						   EOM_THUMB_VIEW (priv->thumbview),
+						   next_image_action,
+						   previous_image_action);
+
+		eom_properties_dialog_update (EOM_PROPERTIES_DIALOG (priv->properties_dlg),
+					      priv->image);
+		g_settings_bind (priv->ui_settings,
+				 EOM_CONF_UI_PROPSDIALOG_NETBOOK_MODE,
+				 priv->properties_dlg, "netbook-mode",
+				 G_SETTINGS_BIND_GET);
+	}
+
+	return priv->properties_dlg;
+}
+
+static void
+eom_window_cmd_properties (GtkAction *action, gpointer user_data)
+{
+	EomWindow *window = EOM_WINDOW (user_data);
+	GtkWidget *dialog;
+
+	dialog = eom_window_get_properties_dialog (window);
+	gtk_widget_show (dialog);
+}
+
+static void
+eom_window_cmd_undo (GtkAction *action, gpointer user_data)
+{
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	apply_transformation (EOM_WINDOW (user_data), NULL);
+}
+
+static void
+eom_window_cmd_flip_horizontal (GtkAction *action, gpointer user_data)
+{
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	apply_transformation (EOM_WINDOW (user_data),
+			      eom_transform_flip_new (EOM_TRANSFORM_FLIP_HORIZONTAL));
+}
+
+static void
+eom_window_cmd_flip_vertical (GtkAction *action, gpointer user_data)
+{
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	apply_transformation (EOM_WINDOW (user_data),
+			      eom_transform_flip_new (EOM_TRANSFORM_FLIP_VERTICAL));
+}
+
+static void
+eom_window_cmd_rotate_90 (GtkAction *action, gpointer user_data)
+{
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	apply_transformation (EOM_WINDOW (user_data),
+			      eom_transform_rotate_new (90));
+}
+
+static void
+eom_window_cmd_rotate_270 (GtkAction *action, gpointer user_data)
+{
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	apply_transformation (EOM_WINDOW (user_data),
+			      eom_transform_rotate_new (270));
+}
+
+static void
+eom_window_cmd_wallpaper (GtkAction *action, gpointer user_data)
+{
+	EomWindow *window;
+	EomWindowPrivate *priv;
+	EomImage *image;
+	GFile *file;
+	char *filename = NULL;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	window = EOM_WINDOW (user_data);
+	priv = window->priv;
+
+	/* If currently copying an image to set it as wallpaper, return. */
+	if (priv->copy_job != NULL)
+		return;
+
+	image = eom_thumb_view_get_first_selected_image (EOM_THUMB_VIEW (priv->thumbview));
+
+	g_return_if_fail (EOM_IS_IMAGE (image));
+
+	file = eom_image_get_file (image);
+
+	filename = g_file_get_path (file);
+
+	/* Currently only local files can be set as wallpaper */
+	if (filename == NULL || !eom_util_file_is_persistent (file))
+	{
+		GList *files = NULL;
+		GtkAction *action_set_as_wp;
+
+		G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+		action_set_as_wp = gtk_action_group_get_action (window->priv->actions_image,
+		                                                "ImageSetAsWallpaper");
+		gtk_action_set_sensitive (action_set_as_wp, FALSE);
+		G_GNUC_END_IGNORE_DEPRECATIONS;
+
+		priv->copy_file_cid = gtk_statusbar_get_context_id (GTK_STATUSBAR (priv->statusbar),
+								    "copy_file_cid");
+		gtk_statusbar_push (GTK_STATUSBAR (priv->statusbar),
+				    priv->copy_file_cid,
+				    _("Saving image locally…"));
+
+		files = g_list_append (files, eom_image_get_file (image));
+		priv->copy_job = eom_job_copy_new (files, g_get_user_data_dir ());
+		g_signal_connect (priv->copy_job, "finished",
+		                  G_CALLBACK (eom_job_copy_cb),
+		                  window);
+		g_signal_connect (priv->copy_job, "progress",
+		                  G_CALLBACK (eom_job_progress_cb),
+		                  window);
+		eom_job_queue_add_job (priv->copy_job);
+
+		g_object_unref (file);
+		g_free (filename);
+		return;
+	}
+
+	g_object_unref (file);
+
+	eom_window_set_wallpaper (window, filename, NULL);
+
+	g_free (filename);
+}
+
+static gboolean
+eom_window_all_images_trasheable (GList *images)
+{
+	GFile *file;
+	GFileInfo *file_info;
+	GList *iter;
+	EomImage *image;
+	gboolean can_trash = TRUE;
+
+	for (iter = images; iter != NULL; iter = g_list_next (iter)) {
+		image = (EomImage *) iter->data;
+		file = eom_image_get_file (image);
+		file_info = g_file_query_info (file,
+					       G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH,
+					       0, NULL, NULL);
+		can_trash = g_file_info_get_attribute_boolean (file_info,
+							       G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH);
+
+		g_object_unref (file_info);
+		g_object_unref (file);
+
+		if (can_trash == FALSE)
+			break;
+	}
+
+	return can_trash;
+}
+
+static int
+show_move_to_trash_confirm_dialog (EomWindow *window, GList *images, gboolean can_trash)
+{
+	GtkWidget *dlg;
+	char *prompt;
+	int response;
+	int n_images;
+	EomImage *image;
+	static gboolean dontaskagain = FALSE;
+	gboolean neverask = FALSE;
+	GtkWidget* dontask_cbutton = NULL;
+
+	/* Check if the user never wants to be bugged. */
+	neverask = g_settings_get_boolean (window->priv->ui_settings,
+					 EOM_CONF_UI_DISABLE_TRASH_CONFIRMATION);
+
+	/* Assume agreement, if the user doesn't want to be
+	 * asked and the trash is available */
+	if (can_trash && (dontaskagain || neverask))
+		return GTK_RESPONSE_OK;
+
+	n_images = g_list_length (images);
+
+	if (n_images == 1) {
+		image = EOM_IMAGE (images->data);
+		if (can_trash) {
+			prompt = g_strdup_printf (_("Are you sure you want to move\n\"%s\" to the trash?"),
+						  eom_image_get_caption (image));
+		} else {
+			prompt = g_strdup_printf (_("A trash for \"%s\" couldn't be found. Do you want to remove "
+						    "this image permanently?"), eom_image_get_caption (image));
+		}
+	} else {
+		if (can_trash) {
+			prompt = g_strdup_printf (ngettext("Are you sure you want to move\n"
+							   "the %d selected image to the trash?",
+							   "Are you sure you want to move\n"
+							   "the %d selected images to the trash?", n_images), n_images);
+		} else {
+			prompt = g_strdup (_("Some of the selected images can't be moved to the trash "
+					     "and will be removed permanently. Are you sure you want "
+					     "to proceed?"));
+		}
+	}
+
+	dlg = gtk_message_dialog_new_with_markup (GTK_WINDOW (window),
+						  GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+						  GTK_MESSAGE_WARNING,
+						  GTK_BUTTONS_NONE,
+						  "<span weight=\"bold\" size=\"larger\">%s</span>",
+						  prompt);
+	g_free (prompt);
+
+	gtk_dialog_add_button (GTK_DIALOG (dlg), "gtk-cancel", GTK_RESPONSE_CANCEL);
+
+	if (can_trash) {
+		gtk_dialog_add_button (GTK_DIALOG (dlg), _("Move to _Trash"), GTK_RESPONSE_OK);
+
+		dontask_cbutton = gtk_check_button_new_with_mnemonic (_("_Do not ask again during this session"));
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dontask_cbutton), FALSE);
+
+		gtk_box_pack_end (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), dontask_cbutton, TRUE, TRUE, 0);
+	} else {
+		if (n_images == 1) {
+			gtk_dialog_add_button (GTK_DIALOG (dlg), "gtk-delete", GTK_RESPONSE_OK);
+		} else {
+			gtk_dialog_add_button (GTK_DIALOG (dlg), "gtk-yes", GTK_RESPONSE_OK);
+		}
+	}
+
+	gtk_dialog_set_default_response (GTK_DIALOG (dlg), GTK_RESPONSE_OK);
+	gtk_window_set_title (GTK_WINDOW (dlg), "");
+	gtk_widget_show_all (dlg);
+
+	response = gtk_dialog_run (GTK_DIALOG (dlg));
+
+	/* Only update the property if the user has accepted */
+	if (can_trash && response == GTK_RESPONSE_OK)
+		dontaskagain = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dontask_cbutton));
+
+	/* The checkbutton is destroyed together with the dialog */
+	gtk_widget_destroy (dlg);
+
+	return response;
+}
+
+static gboolean
+move_to_trash_real (EomImage *image, GError **error)
+{
+	GFile *file;
+	GFileInfo *file_info;
+	gboolean can_trash, result;
+
+	g_return_val_if_fail (EOM_IS_IMAGE (image), FALSE);
+
+	file = eom_image_get_file (image);
+	file_info = g_file_query_info (file,
+				       G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH,
+				       0, NULL, NULL);
+	if (file_info == NULL) {
+		g_set_error (error,
+			     EOM_WINDOW_ERROR,
+			     EOM_WINDOW_ERROR_TRASH_NOT_FOUND,
+			     _("Couldn't access trash."));
+		return FALSE;
+	}
+
+	can_trash = g_file_info_get_attribute_boolean (file_info,
+						       G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH);
+	g_object_unref (file_info);
+	if (can_trash)
+	{
+		result = g_file_trash (file, NULL, NULL);
+		if (result == FALSE) {
+			g_set_error (error,
+				     EOM_WINDOW_ERROR,
+				     EOM_WINDOW_ERROR_TRASH_NOT_FOUND,
+				     _("Couldn't access trash."));
+		}
+	} else {
+		result = g_file_delete (file, NULL, NULL);
+		if (result == FALSE) {
+			g_set_error (error,
+				     EOM_WINDOW_ERROR,
+				     EOM_WINDOW_ERROR_IO,
+				     _("Couldn't delete file"));
+		}
+	}
+
+        g_object_unref (file);
+
+	return result;
+}
+
+static void
+eom_window_cmd_copy_image (GtkAction *action, gpointer user_data)
+{
+	GtkClipboard *clipboard;
+	EomWindow *window;
+	EomWindowPrivate *priv;
+	EomImage *image;
+	EomClipboardHandler *cbhandler;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	window = EOM_WINDOW (user_data);
+	priv = window->priv;
+
+	image = eom_thumb_view_get_first_selected_image (EOM_THUMB_VIEW (priv->thumbview));
+
+	g_return_if_fail (EOM_IS_IMAGE (image));
+
+	clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
+
+	cbhandler = eom_clipboard_handler_new (image);
+	// cbhandler will self-destruct when it's not needed anymore
+	eom_clipboard_handler_copy_to_clipboard (cbhandler, clipboard);
+
+}
+
+static void
+eom_window_cmd_move_to_trash (GtkAction *action, gpointer user_data)
+{
+	GList *images;
+	GList *it;
+	EomWindowPrivate *priv;
+	EomListStore *list;
+	int pos;
+	EomImage *img;
+	EomWindow *window;
+	int response;
+	int n_images;
+	gboolean success;
+	gboolean can_trash;
+	const gchar *action_name;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	window = EOM_WINDOW (user_data);
+	priv = window->priv;
+	list = priv->store;
+
+	n_images = eom_thumb_view_get_n_selected (EOM_THUMB_VIEW (priv->thumbview));
+
+	if (n_images < 1) return;
+
+	/* save position of selected image after the deletion */
+	images = eom_thumb_view_get_selected_images (EOM_THUMB_VIEW (priv->thumbview));
+
+	g_assert (images != NULL);
+
+	/* HACK: eom_list_store_get_n_selected return list in reverse order */
+	images = g_list_reverse (images);
+
+	can_trash = eom_window_all_images_trasheable (images);
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	action_name = gtk_action_get_name (action);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+
+	if (g_ascii_strcasecmp (action_name, "Delete") == 0 ||
+	    can_trash == FALSE) {
+		response = show_move_to_trash_confirm_dialog (window, images, can_trash);
+
+		if (response != GTK_RESPONSE_OK) return;
+	}
+
+	pos = eom_list_store_get_pos_by_image (list, EOM_IMAGE (images->data));
+
+	/* FIXME: make a nice progress dialog */
+	/* Do the work actually. First try to delete the image from the disk. If this
+	 * is successful, remove it from the screen. Otherwise show error dialog.
+	 */
+	for (it = images; it != NULL; it = it->next) {
+		GError *error = NULL;
+		EomImage *image;
+
+		image = EOM_IMAGE (it->data);
+
+		success = move_to_trash_real (image, &error);
+
+		if (success) {
+			eom_list_store_remove_image (list, image);
+		} else {
+			char *header;
+			GtkWidget *dlg;
+
+			header = g_strdup_printf (_("Error on deleting image %s"),
+						  eom_image_get_caption (image));
+
+			dlg = gtk_message_dialog_new (GTK_WINDOW (window),
+						      GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+						      GTK_MESSAGE_ERROR,
+						      GTK_BUTTONS_OK,
+						      "%s", header);
+
+			gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dlg),
+								  "%s", error->message);
+
+			gtk_dialog_run (GTK_DIALOG (dlg));
+
+			gtk_widget_destroy (dlg);
+
+			g_free (header);
+		}
+	}
+
+	/* free list */
+	g_list_free_full (images, g_object_unref);
+
+	/* select image at previously saved position */
+	pos = MIN (pos, eom_list_store_length (list) - 1);
+
+	if (pos >= 0) {
+		img = eom_list_store_get_image_by_pos (list, pos);
+
+		eom_thumb_view_set_current_image (EOM_THUMB_VIEW (priv->thumbview),
+						  img,
+						  TRUE);
+
+		if (img != NULL) {
+			g_object_unref (img);
+		}
+	}
+}
+
+static void
+eom_window_cmd_fullscreen (GtkAction *action, gpointer user_data)
+{
+	EomWindow *window;
+	gboolean fullscreen;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	eom_debug (DEBUG_WINDOW);
+
+	window = EOM_WINDOW (user_data);
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	fullscreen = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+
+	if (fullscreen) {
+		eom_window_run_fullscreen (window, FALSE);
+	} else {
+		eom_window_stop_fullscreen (window, FALSE);
+	}
+}
+
+static void
+eom_window_cmd_slideshow (GtkAction *action, gpointer user_data)
+{
+	EomWindow *window;
+	gboolean slideshow;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	eom_debug (DEBUG_WINDOW);
+
+	window = EOM_WINDOW (user_data);
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	slideshow = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+
+	if (slideshow) {
+		eom_window_run_fullscreen (window, TRUE);
+	} else {
+		eom_window_stop_fullscreen (window, TRUE);
+	}
+}
+
+static void
+eom_window_cmd_pause_slideshow (GtkAction *action, gpointer user_data)
+{
+	EomWindow *window;
+	gboolean slideshow;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	eom_debug (DEBUG_WINDOW);
+
+	window = EOM_WINDOW (user_data);
+
+	slideshow = window->priv->mode == EOM_WINDOW_MODE_SLIDESHOW;
+
+	if (!slideshow && window->priv->mode != EOM_WINDOW_MODE_FULLSCREEN)
+		return;
+
+	eom_window_run_fullscreen (window, !slideshow);
+}
+
+static void
+eom_window_cmd_zoom_in (GtkAction *action, gpointer user_data)
+{
+	EomWindowPrivate *priv;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	eom_debug (DEBUG_WINDOW);
+
+	priv = EOM_WINDOW (user_data)->priv;
+
+	if (priv->view) {
+		eom_scroll_view_zoom_in (EOM_SCROLL_VIEW (priv->view), FALSE);
+	}
+}
+
+static void
+eom_window_cmd_zoom_out (GtkAction *action, gpointer user_data)
+{
+	EomWindowPrivate *priv;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	eom_debug (DEBUG_WINDOW);
+
+	priv = EOM_WINDOW (user_data)->priv;
+
+	if (priv->view) {
+		eom_scroll_view_zoom_out (EOM_SCROLL_VIEW (priv->view), FALSE);
+	}
+}
+
+static void
+eom_window_cmd_zoom_normal (GtkAction *action, gpointer user_data)
+{
+	EomWindowPrivate *priv;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	eom_debug (DEBUG_WINDOW);
+
+	priv = EOM_WINDOW (user_data)->priv;
+
+	if (priv->view) {
+		eom_scroll_view_set_zoom (EOM_SCROLL_VIEW (priv->view), 1.0);
+	}
+}
+
+static void
+eom_window_cmd_zoom_fit (GtkAction *action, gpointer user_data)
+{
+	EomWindowPrivate *priv;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	eom_debug (DEBUG_WINDOW);
+
+	priv = EOM_WINDOW (user_data)->priv;
+
+	if (priv->view) {
+		eom_scroll_view_zoom_fit (EOM_SCROLL_VIEW (priv->view));
+	}
+}
+
+static void
+eom_window_cmd_go_prev (GtkAction *action, gpointer user_data)
+{
+	EomWindowPrivate *priv;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	eom_debug (DEBUG_WINDOW);
+
+	priv = EOM_WINDOW (user_data)->priv;
+
+	eom_thumb_view_select_single (EOM_THUMB_VIEW (priv->thumbview),
+				      EOM_THUMB_VIEW_SELECT_LEFT);
+}
+
+static void
+eom_window_cmd_go_next (GtkAction *action, gpointer user_data)
+{
+	EomWindowPrivate *priv;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	eom_debug (DEBUG_WINDOW);
+
+	priv = EOM_WINDOW (user_data)->priv;
+
+	eom_thumb_view_select_single (EOM_THUMB_VIEW (priv->thumbview),
+				      EOM_THUMB_VIEW_SELECT_RIGHT);
+}
+
+static void
+eom_window_cmd_go_first (GtkAction *action, gpointer user_data)
+{
+	EomWindowPrivate *priv;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	eom_debug (DEBUG_WINDOW);
+
+	priv = EOM_WINDOW (user_data)->priv;
+
+	eom_thumb_view_select_single (EOM_THUMB_VIEW (priv->thumbview),
+				      EOM_THUMB_VIEW_SELECT_FIRST);
+}
+
+static void
+eom_window_cmd_go_last (GtkAction *action, gpointer user_data)
+{
+	EomWindowPrivate *priv;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	eom_debug (DEBUG_WINDOW);
+
+	priv = EOM_WINDOW (user_data)->priv;
+
+	eom_thumb_view_select_single (EOM_THUMB_VIEW (priv->thumbview),
+				      EOM_THUMB_VIEW_SELECT_LAST);
+}
+
+static void
+eom_window_cmd_go_random (GtkAction *action, gpointer user_data)
+{
+	EomWindowPrivate *priv;
+
+	g_return_if_fail (EOM_IS_WINDOW (user_data));
+
+	eom_debug (DEBUG_WINDOW);
+
+	priv = EOM_WINDOW (user_data)->priv;
+
+	eom_thumb_view_select_single (EOM_THUMB_VIEW (priv->thumbview),
+				      EOM_THUMB_VIEW_SELECT_RANDOM);
+}
+
+static const GtkActionEntry action_entries_window[] = {
+	{ "Image", NULL, N_("_Image"), NULL, NULL, NULL },
+	{ "Edit",  NULL, N_("_Edit"),  NULL, NULL, NULL },
+	{ "View",  NULL, N_("_View"),  NULL, NULL, NULL },
+	{ "Go",    NULL, N_("_Go"),    NULL, NULL, NULL },
+	{ "Tools", NULL, N_("_Tools"), NULL, NULL, NULL },
+	{ "Help",  NULL, N_("_Help"),  NULL, NULL, NULL },
+
+	{ "ImageOpen", "document-open",  N_("_Open…"), "<control>O",
+	  N_("Open a file"),
+	  G_CALLBACK (eom_window_cmd_file_open) },
+	{ "ImageClose", "window-close", N_("_Close"), "<control>W",
+	  N_("Close window"),
+	  G_CALLBACK (eom_window_cmd_close_window) },
+	{ "EditToolbar", NULL, N_("T_oolbar"), NULL,
+	  N_("Edit the application toolbar"),
+	  G_CALLBACK (eom_window_cmd_edit_toolbar) },
+	{ "EditPreferences", "preferences-desktop", N_("Prefere_nces"), NULL,
+	  N_("Preferences for Eye of MATE"),
+	  G_CALLBACK (eom_window_cmd_preferences) },
+	{ "HelpManual", "help-browser", N_("_Contents"), "F1",
+	  N_("Help on this application"),
+	  G_CALLBACK (eom_window_cmd_help) },
+	{ "HelpAbout", "help-about", N_("_About"), NULL,
+	  N_("About this application"),
+	  G_CALLBACK (eom_window_cmd_about) }
+};
+
+static const GtkToggleActionEntry toggle_entries_window[] = {
+	{ "ViewToolbar", NULL, N_("_Toolbar"), NULL,
+	  N_("Changes the visibility of the toolbar in the current window"),
+	  G_CALLBACK (eom_window_cmd_show_hide_bar), TRUE },
+	{ "ViewStatusbar", NULL, N_("_Statusbar"), NULL,
+	  N_("Changes the visibility of the statusbar in the current window"),
+	  G_CALLBACK (eom_window_cmd_show_hide_bar), TRUE },
+	{ "ViewImageCollection", "eom-image-collection", N_("_Image Collection"), "<control>F9",
+	  N_("Changes the visibility of the image collection pane in the current window"),
+	  G_CALLBACK (eom_window_cmd_show_hide_bar), TRUE },
+	{ "ViewSidebar", NULL, N_("Side _Pane"), "F9",
+	  N_("Changes the visibility of the side pane in the current window"),
+	  G_CALLBACK (eom_window_cmd_show_hide_bar), TRUE },
+};
+
+static const GtkActionEntry action_entries_image[] = {
+	{ "ImageSave", "document-save", N_("_Save"), "<control>s",
+	  N_("Save changes in currently selected images"),
+	  G_CALLBACK (eom_window_cmd_save) },
+	{ "ImageOpenWith", NULL, N_("Open _with"), NULL,
+	  N_("Open the selected image with a different application"),
+	  NULL},
+	{ "ImageSaveAs", "document-save-as", N_("Save _As…"), "<control><shift>s",
+	  N_("Save the selected images with a different name"),
+	  G_CALLBACK (eom_window_cmd_save_as) },
+	{ "ImageOpenContainingFolder", "folder", N_("Open Containing _Folder"), NULL,
+	  N_("Show the folder which contains this file in the file manager"),
+	  G_CALLBACK (eom_window_cmd_open_containing_folder) },
+	{ "ImagePrint", "document-print", N_("_Print…"), "<control>p",
+	  N_("Print the selected image"),
+	  G_CALLBACK (eom_window_cmd_print) },
+	{ "ImageProperties", "document-properties", N_("Prope_rties"), "<alt>Return",
+	  N_("Show the properties and metadata of the selected image"),
+	  G_CALLBACK (eom_window_cmd_properties) },
+	{ "EditUndo", "edit-undo", N_("_Undo"), "<control>z",
+	  N_("Undo the last change in the image"),
+	  G_CALLBACK (eom_window_cmd_undo) },
+	{ "EditFlipHorizontal", "object-flip-horizontal", N_("Flip _Horizontal"), NULL,
+	  N_("Mirror the image horizontally"),
+	  G_CALLBACK (eom_window_cmd_flip_horizontal) },
+	{ "EditFlipVertical", "object-flip-vertical", N_("Flip _Vertical"), NULL,
+	  N_("Mirror the image vertically"),
+	  G_CALLBACK (eom_window_cmd_flip_vertical) },
+	{ "EditRotate90",  "object-rotate-right",  N_("_Rotate Clockwise"), "<control>r",
+	  N_("Rotate the image 90 degrees to the right"),
+	  G_CALLBACK (eom_window_cmd_rotate_90) },
+	{ "EditRotate270", "object-rotate-left", N_("Rotate Counterc_lockwise"), "<ctrl><shift>r",
+	  N_("Rotate the image 90 degrees to the left"),
+	  G_CALLBACK (eom_window_cmd_rotate_270) },
+	{ "ImageSetAsWallpaper", NULL, N_("Set as _Desktop Background"),
+	  "<control>F8", N_("Set the selected image as the desktop background"),
+	  G_CALLBACK (eom_window_cmd_wallpaper) },
+	{ "EditMoveToTrash", "user-trash", N_("Move to _Trash"), NULL,
+	  N_("Move the selected image to the trash folder"),
+	  G_CALLBACK (eom_window_cmd_move_to_trash) },
+	{ "EditCopyImage", "edit-copy", N_("_Copy"), "<control>C",
+	  N_("Copy the selected image to the clipboard"),
+	  G_CALLBACK (eom_window_cmd_copy_image) },
+	{ "ViewZoomIn", "zoom-in", N_("_Zoom In"), "<control>plus",
+	  N_("Enlarge the image"),
+	  G_CALLBACK (eom_window_cmd_zoom_in) },
+	{ "ViewZoomOut", "zoom-out", N_("Zoom _Out"), "<control>minus",
+	  N_("Shrink the image"),
+	  G_CALLBACK (eom_window_cmd_zoom_out) },
+	{ "ViewZoomNormal", "zoom-original", N_("_Normal Size"), "<control>0",
+	  N_("Show the image at its normal size"),
+	  G_CALLBACK (eom_window_cmd_zoom_normal) },
+	{ "ViewZoomFit", "zoom-fit-best", N_("_Best Fit"), "F",
+	  N_("Fit the image to the window"),
+	  G_CALLBACK (eom_window_cmd_zoom_fit) },
+	{ "ControlEqual", "zoom-in", N_("_Zoom In"), "<control>equal",
+	  N_("Enlarge the image"),
+	  G_CALLBACK (eom_window_cmd_zoom_in) },
+	{ "ControlKpAdd", "zoom-in", N_("_Zoom In"), "<control>KP_Add",
+	  N_("Shrink the image"),
+	  G_CALLBACK (eom_window_cmd_zoom_in) },
+	{ "ControlKpSub", "zoom-out", N_("Zoom _Out"), "<control>KP_Subtract",
+	  N_("Shrink the image"),
+	  G_CALLBACK (eom_window_cmd_zoom_out) },
+	{ "Delete", NULL, N_("Move to _Trash"), "Delete",
+	  NULL,
+	  G_CALLBACK (eom_window_cmd_move_to_trash) },
+};
+
+static const GtkToggleActionEntry toggle_entries_image[] = {
+	{ "ViewFullscreen", "view-fullscreen", N_("_Fullscreen"), "F11",
+	  N_("Show the current image in fullscreen mode"),
+	  G_CALLBACK (eom_window_cmd_fullscreen), FALSE },
+	{ "PauseSlideshow", "media-playback-pause", N_("Pause Slideshow"),
+	  NULL, N_("Pause or resume the slideshow"),
+	  G_CALLBACK (eom_window_cmd_pause_slideshow), FALSE },
+};
+
+static const GtkActionEntry action_entries_collection[] = {
+	{ "GoPrevious", "go-previous", N_("_Previous Image"), "<Alt>Left",
+	  N_("Go to the previous image of the collection"),
+	  G_CALLBACK (eom_window_cmd_go_prev) },
+	{ "GoNext", "go-next", N_("_Next Image"), "<Alt>Right",
+	  N_("Go to the next image of the collection"),
+	  G_CALLBACK (eom_window_cmd_go_next) },
+	{ "GoFirst", "go-first", N_("_First Image"), "<Alt>Home",
+	  N_("Go to the first image of the collection"),
+	  G_CALLBACK (eom_window_cmd_go_first) },
+	{ "GoLast", "go-last", N_("_Last Image"), "<Alt>End",
+	  N_("Go to the last image of the collection"),
+	  G_CALLBACK (eom_window_cmd_go_last) },
+	{ "GoRandom", NULL, N_("_Random Image"), "<control>M",
+	  N_("Go to a random image of the collection"),
+	  G_CALLBACK (eom_window_cmd_go_random) },
+	{ "BackSpace", NULL, N_("_Previous Image"), "BackSpace",
+	  NULL,
+	  G_CALLBACK (eom_window_cmd_go_prev) },
+	{ "Home", NULL, N_("_First Image"), "Home",
+	  NULL,
+	  G_CALLBACK (eom_window_cmd_go_first) },
+	{ "End", NULL, N_("_Last Image"), "End",
+	  NULL,
+	  G_CALLBACK (eom_window_cmd_go_last) },
+};
+
+static const GtkToggleActionEntry toggle_entries_collection[] = {
+	{ "ViewSlideshow", "slideshow-play", N_("S_lideshow"), "F5",
+	  N_("Start a slideshow view of the images"),
+	  G_CALLBACK (eom_window_cmd_slideshow), FALSE },
+};
+
+static void
+menu_item_select_cb (GtkMenuItem *proxy, EomWindow *window)
+{
+	GtkAction *action;
+	char *message;
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	action = gtk_activatable_get_related_action (GTK_ACTIVATABLE (proxy));
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+
+	g_return_if_fail (action != NULL);
+
+	g_object_get (G_OBJECT (action), "tooltip", &message, NULL);
+
+	if (message) {
+		gtk_statusbar_push (GTK_STATUSBAR (window->priv->statusbar),
+				    window->priv->tip_message_cid, message);
+		g_free (message);
+	}
+}
+
+static void
+menu_item_deselect_cb (GtkMenuItem *proxy, EomWindow *window)
+{
+	gtk_statusbar_pop (GTK_STATUSBAR (window->priv->statusbar),
+			   window->priv->tip_message_cid);
+}
+
+static void
+connect_proxy_cb (GtkUIManager *manager,
+                  GtkAction *action,
+                  GtkWidget *proxy,
+                  EomWindow *window)
+{
+	if (GTK_IS_MENU_ITEM (proxy)) {
+		disconnect_proxy_cb (manager, action, proxy, window);
+		g_signal_connect (proxy, "select",
+		                  G_CALLBACK (menu_item_select_cb),
+		                  window);
+		g_signal_connect (proxy, "deselect",
+		                  G_CALLBACK (menu_item_deselect_cb),
+		                  window);
+	}
+}
+
+static void
+disconnect_proxy_cb (GtkUIManager *manager,
+                     GtkAction *action,
+                     GtkWidget *proxy,
+                     EomWindow *window)
+{
+	if (GTK_IS_MENU_ITEM (proxy)) {
+		g_signal_handlers_disconnect_by_func (proxy,
+		                                      menu_item_select_cb,
+		                                      window);
+		g_signal_handlers_disconnect_by_func (proxy,
+		                                      menu_item_deselect_cb,
+		                                      window);
+	}
+}
+
+static void
+set_action_properties (GtkActionGroup *window_group,
+		       GtkActionGroup *image_group,
+		       GtkActionGroup *collection_group)
+{
+        GtkAction *action;
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+        action = gtk_action_group_get_action (collection_group, "GoPrevious");
+        g_object_set (action, "short_label", _("_Previous"), NULL);
+        g_object_set (action, "is-important", TRUE, NULL);
+
+        action = gtk_action_group_get_action (collection_group, "GoNext");
+        g_object_set (action, "short_label", _("_Next"), NULL);
+        g_object_set (action, "is-important", TRUE, NULL);
+
+        action = gtk_action_group_get_action (image_group, "EditRotate90");
+        g_object_set (action, "short_label", _("Right"), NULL);
+
+        action = gtk_action_group_get_action (image_group, "EditRotate270");
+        g_object_set (action, "short_label", _("Left"), NULL);
+
+        action = gtk_action_group_get_action (image_group, "ImageOpenContainingFolder");
+        g_object_set (action, "short_label", _("Open Folder"), NULL);
+
+        action = gtk_action_group_get_action (image_group, "ViewZoomIn");
+        g_object_set (action, "short_label", _("In"), NULL);
+
+        action = gtk_action_group_get_action (image_group, "ViewZoomOut");
+        g_object_set (action, "short_label", _("Out"), NULL);
+
+        action = gtk_action_group_get_action (image_group, "ViewZoomNormal");
+        g_object_set (action, "short_label", _("Normal"), NULL);
+
+        action = gtk_action_group_get_action (image_group, "ViewZoomFit");
+        g_object_set (action, "short_label", _("Fit"), NULL);
+
+        action = gtk_action_group_get_action (window_group, "ViewImageCollection");
+        g_object_set (action, "short_label", _("Collection"), NULL);
+
+        action = gtk_action_group_get_action (image_group, "EditMoveToTrash");
+        g_object_set (action, "short_label", C_("action (to trash)", "Trash"), NULL);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+}
+
+static gint
+sort_recents_mru (GtkRecentInfo *a, GtkRecentInfo *b)
+{
+	gboolean has_eom_a, has_eom_b;
+
+	/* We need to check this first as gtk_recent_info_get_application_info
+	 * will treat it as a non-fatal error when the GtkRecentInfo doesn't
+	 * have the application registered. */
+	has_eom_a = gtk_recent_info_has_application (a,
+						     EOM_RECENT_FILES_APP_NAME);
+	has_eom_b = gtk_recent_info_has_application (b,
+						     EOM_RECENT_FILES_APP_NAME);
+	if (has_eom_a && has_eom_b) {
+		time_t time_a, time_b;
+
+		/* These should not fail as we already checked that
+		 * the application is registered with the info objects */
+		gtk_recent_info_get_application_info (a,
+						      EOM_RECENT_FILES_APP_NAME,
+						      NULL,
+						      NULL,
+						      &time_a);
+		gtk_recent_info_get_application_info (b,
+						      EOM_RECENT_FILES_APP_NAME,
+						      NULL,
+						      NULL,
+						      &time_b);
+
+		return (time_b - time_a);
+	} else if (has_eom_a) {
+		return -1;
+	} else if (has_eom_b) {
+		return 1;
+	}
+
+	return 0;
+}
+
+static void
+eom_window_update_recent_files_menu (EomWindow *window)
+{
+	EomWindowPrivate *priv;
+	GList *actions = NULL, *li = NULL, *items = NULL;
+	guint count_recent = 0;
+
+	priv = window->priv;
+
+	if (priv->recent_menu_id != 0)
+		gtk_ui_manager_remove_ui (priv->ui_mgr, priv->recent_menu_id);
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	actions = gtk_action_group_list_actions (priv->actions_recent);
+
+	for (li = actions; li != NULL; li = li->next) {
+		g_signal_handlers_disconnect_by_func (li->data,
+		                                      eom_window_open_recent_cb,
+		                                      window);
+
+		gtk_action_group_remove_action (priv->actions_recent,
+						GTK_ACTION (li->data));
+	}
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+
+	g_list_free (actions);
+
+	priv->recent_menu_id = gtk_ui_manager_new_merge_id (priv->ui_mgr);
+	items = gtk_recent_manager_get_items (gtk_recent_manager_get_default());
+	items = g_list_sort (items, (GCompareFunc) sort_recents_mru);
+
+	for (li = items; li != NULL && count_recent < EOM_RECENT_FILES_LIMIT; li = li->next) {
+		gchar *action_name;
+		gchar *label;
+		gchar *tip;
+		gchar **display_name;
+		gchar *label_filename;
+		GtkAction *action;
+		GtkRecentInfo *info = li->data;
+
+		/* Sorting moves non-EOM files to the end of the list.
+		 * So no file of interest will follow if this test fails */
+		if (!gtk_recent_info_has_application (info, EOM_RECENT_FILES_APP_NAME))
+			break;
+
+		count_recent++;
+
+		action_name = g_strdup_printf ("recent-info-%d", count_recent);
+		display_name = g_strsplit (gtk_recent_info_get_display_name (info), "_", -1);
+		label_filename = g_strjoinv ("__", display_name);
+		label = g_strdup_printf ("%s_%d. %s",
+				(is_rtl ? "\xE2\x80\x8F" : ""), count_recent, label_filename);
+		g_free (label_filename);
+		g_strfreev (display_name);
+
+		tip = gtk_recent_info_get_uri_display (info);
+
+		/* This is a workaround for a bug (#351945) regarding
+		 * gtk_recent_info_get_uri_display() and remote URIs.
+		 * mate_vfs_format_uri_for_display is sufficient here
+		 * since the password gets stripped when adding the
+		 * file to the recently used list. */
+		if (tip == NULL)
+			tip = g_uri_unescape_string (gtk_recent_info_get_uri (info), NULL);
+
+		G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+		action = gtk_action_new (action_name, label, tip, NULL);
+		gtk_action_set_always_show_image (action, TRUE);
+		G_GNUC_END_IGNORE_DEPRECATIONS;
+
+		g_object_set_data_full (G_OBJECT (action), "gtk-recent-info",
+					gtk_recent_info_ref (info),
+					(GDestroyNotify) gtk_recent_info_unref);
+
+		g_object_set (G_OBJECT (action), "icon-name", "image-x-generic", NULL);
+
+		g_signal_connect (action, "activate",
+		                  G_CALLBACK (eom_window_open_recent_cb),
+		                  window);
+
+		G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+		gtk_action_group_add_action (priv->actions_recent, action);
+		G_GNUC_END_IGNORE_DEPRECATIONS;
+
+		g_object_unref (action);
+
+		gtk_ui_manager_add_ui (priv->ui_mgr, priv->recent_menu_id,
+				       "/MainMenu/Image/RecentDocuments",
+				       action_name, action_name,
+				       GTK_UI_MANAGER_AUTO, FALSE);
+
+		g_free (action_name);
+		g_free (label);
+		g_free (tip);
+	}
+
+	g_list_free_full (items, (GDestroyNotify) gtk_recent_info_unref);
+}
+
+static void
+eom_window_recent_manager_changed_cb (GtkRecentManager *manager, EomWindow *window)
+{
+	eom_window_update_recent_files_menu (window);
+}
+
+static void
+eom_window_drag_data_received (GtkWidget *widget,
+                               GdkDragContext *context,
+                               gint x, gint y,
+                               GtkSelectionData *selection_data,
+                               guint info, guint time)
+{
+	GSList *file_list;
+	EomWindow *window;
+	GdkAtom target;
+	GtkWidget *src;
+
+	target = gtk_selection_data_get_target (selection_data);
+
+	if (!gtk_targets_include_uri (&target, 1))
+		return;
+
+	/* if the request is from another process this will return NULL */
+	src = gtk_drag_get_source_widget (context);
+
+	/* if the drag request originates from the current eom instance, ignore
+	   the request if the source window is the same as the dest window */
+	if (src &&
+	    gtk_widget_get_toplevel (src) == gtk_widget_get_toplevel (widget))
+	{
+		gdk_drag_status (context, 0, time);
+		return;
+	}
+
+	if (gdk_drag_context_get_suggested_action (context) == GDK_ACTION_COPY) {
+		window = EOM_WINDOW (widget);
+
+		file_list = eom_util_parse_uri_string_list_to_file_list ((const gchar *) gtk_selection_data_get_data (selection_data));
+
+		eom_window_open_file_list (window, file_list);
+	}
+}
+
+static void
+eom_window_set_drag_dest (EomWindow *window)
+{
+	gtk_drag_dest_set (GTK_WIDGET (window),
+                           GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP,
+                           NULL, 0,
+                           GDK_ACTION_COPY | GDK_ACTION_ASK);
+	gtk_drag_dest_add_uri_targets (GTK_WIDGET (window));
+}
+
+static void
+eom_window_sidebar_visibility_changed (GtkWidget *widget, EomWindow *window)
+{
+	GtkAction *action;
+	gboolean visible;
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	visible = gtk_widget_get_visible (window->priv->sidebar);
+
+	action = gtk_action_group_get_action (window->priv->actions_window,
+					      "ViewSidebar");
+
+	if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)) != visible)
+		gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), visible);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+
+	/* Focus the image */
+	if (!visible && window->priv->image != NULL)
+		gtk_widget_grab_focus (window->priv->view);
+}
+
+static void
+eom_window_sidebar_page_added (EomSidebar  *sidebar,
+			       GtkWidget   *main_widget,
+			       EomWindow   *window)
+{
+	if (eom_sidebar_get_n_pages (sidebar) == 1) {
+		GtkAction *action;
+		gboolean show;
+
+		G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+		action = gtk_action_group_get_action (window->priv->actions_window,
+						      "ViewSidebar");
+
+		gtk_action_set_sensitive (action, TRUE);
+
+		show = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+		G_GNUC_END_IGNORE_DEPRECATIONS;
+
+		if (show)
+			gtk_widget_show (GTK_WIDGET (sidebar));
+	}
+}
+static void
+eom_window_sidebar_page_removed (EomSidebar  *sidebar,
+			         GtkWidget   *main_widget,
+			         EomWindow   *window)
+{
+	if (eom_sidebar_is_empty (sidebar)) {
+		GtkAction *action;
+
+		gtk_widget_hide (GTK_WIDGET (sidebar));
+
+		G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+		action = gtk_action_group_get_action (window->priv->actions_window,
+						      "ViewSidebar");
+
+		gtk_action_set_sensitive (action, FALSE);
+		G_GNUC_END_IGNORE_DEPRECATIONS;
+	}
+}
+
+static void
+eom_window_finish_saving (EomWindow *window)
+{
+	EomWindowPrivate *priv = window->priv;<--- Variable 'priv' can be declared as pointer to const
+
+	gtk_widget_set_sensitive (GTK_WIDGET (window), FALSE);
+
+	do {
+		gtk_main_iteration ();
+	} while (priv->save_job != NULL);
+}
+
+static GAppInfo *
+get_appinfo_for_editor (EomWindow *window)
+{
+	/* We want this function to always return the same thing, not
+	 * just for performance reasons, but because if someone edits
+	 * GConf while eom is running, the application could get into an
+	 * inconsistent state.  If the editor exists once, it gets added
+	 * to the "available" list of the EggToolbarsModel (for which
+	 * there is no API to remove it).  If later the editor no longer
+	 * existed when constructing a new window, we'd be unable to
+	 * construct a GtkAction for the editor for that window, causing
+	 * assertion failures when viewing the "Edit Toolbars" dialog
+	 * (item is available, but can't find the GtkAction for it).
+	 *
+	 * By ensuring we keep the GAppInfo around, we avoid the
+	 * possibility of that situation occurring.
+	 */
+	static GDesktopAppInfo *app_info = NULL;
+	static gboolean initialised;
+
+	if (!initialised) {
+		gchar *editor;
+
+		editor = g_settings_get_string (window->priv->ui_settings,
+		                                EOM_CONF_UI_EXTERNAL_EDITOR);
+
+		if (editor != NULL) {
+			app_info = g_desktop_app_info_new (editor);
+		}
+
+		initialised = TRUE;
+		g_free (editor);
+	}
+
+	return (GAppInfo *) app_info;
+}
+
+static void
+eom_window_open_editor (GtkAction *action,
+                        EomWindow *window)
+{
+	GdkAppLaunchContext *context;
+	GAppInfo *app_info;
+	GList *files = NULL;
+	GFile *file;
+
+	app_info = get_appinfo_for_editor (window);
+
+	if (app_info == NULL)
+		return;
+
+	context = gdk_display_get_app_launch_context (
+	  gtk_widget_get_display (GTK_WIDGET (window)));
+	gdk_app_launch_context_set_screen (context,
+	  gtk_widget_get_screen (GTK_WIDGET (window)));
+	gdk_app_launch_context_set_icon (context,
+	  g_app_info_get_icon (app_info));
+	gdk_app_launch_context_set_timestamp (context,
+	  gtk_get_current_event_time ());
+
+	file = eom_image_get_file (window->priv->image);
+	files = g_list_append (files, file);
+
+	g_app_info_launch (app_info, files,
+                           G_APP_LAUNCH_CONTEXT (context), NULL);
+
+	g_list_free (files);
+	g_object_unref (file);
+	g_object_unref (context);
+}
+
+static void
+eom_window_add_open_editor_action (EomWindow *window)
+{
+	EggToolbarsModel *model;
+	GAppInfo *app_info;
+	GtkAction *action;
+        gchar *tooltip;
+
+	app_info = get_appinfo_for_editor (window);
+
+	if (app_info == NULL)
+		return;
+
+	model = eom_application_get_toolbars_model (EOM_APP);
+	egg_toolbars_model_set_name_flags (model, "OpenEditor",
+	                                   EGG_TB_MODEL_NAME_KNOWN);
+
+	tooltip = g_strdup_printf (_("Edit the current image using %s"),
+	                           g_app_info_get_name (app_info));
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	action = gtk_action_new ("OpenEditor", _("Edit Image"), tooltip, NULL);
+	gtk_action_set_gicon (action, g_app_info_get_icon (app_info));
+	gtk_action_set_is_important (action, TRUE);
+
+	g_signal_connect (action, "activate",
+	                  G_CALLBACK (eom_window_open_editor),
+	                  window);
+
+	gtk_action_group_add_action (window->priv->actions_image, action);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+
+	g_object_unref (action);
+	g_free (tooltip);
+}
+
+static void
+eom_window_construct_ui (EomWindow *window)
+{
+	EomWindowPrivate *priv;
+
+	GError *error = NULL;
+
+	GtkWidget *menubar;
+	GtkWidget *thumb_popup;
+	GtkWidget *view_popup;
+	GtkWidget *hpaned;
+	GtkWidget *menuitem;
+
+	g_return_if_fail (EOM_IS_WINDOW (window));
+
+	priv = window->priv;
+
+	priv->box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+	gtk_container_add (GTK_CONTAINER (window), priv->box);
+	gtk_widget_show (priv->box);
+
+	priv->ui_mgr = gtk_ui_manager_new ();
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	priv->actions_window = gtk_action_group_new ("MenuActionsWindow");
+
+#ifdef ENABLE_NLS
+	gtk_action_group_set_translation_domain (priv->actions_window,
+						 GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
+
+	gtk_action_group_add_actions (priv->actions_window,
+				      action_entries_window,
+				      G_N_ELEMENTS (action_entries_window),
+				      window);
+
+	gtk_action_group_add_toggle_actions (priv->actions_window,
+					     toggle_entries_window,
+					     G_N_ELEMENTS (toggle_entries_window),
+					     window);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+
+	gtk_ui_manager_insert_action_group (priv->ui_mgr, priv->actions_window, 0);
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	priv->actions_image = gtk_action_group_new ("MenuActionsImage");
+#ifdef ENABLE_NLS
+	gtk_action_group_set_translation_domain (priv->actions_image,
+						 GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
+
+	gtk_action_group_add_actions (priv->actions_image,
+				      action_entries_image,
+				      G_N_ELEMENTS (action_entries_image),
+				      window);
+
+	eom_window_add_open_editor_action (window);
+
+	gtk_action_group_add_toggle_actions (priv->actions_image,
+					     toggle_entries_image,
+					     G_N_ELEMENTS (toggle_entries_image),
+					     window);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+
+	gtk_ui_manager_insert_action_group (priv->ui_mgr, priv->actions_image, 0);
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	priv->actions_collection = gtk_action_group_new ("MenuActionsCollection");
+#ifdef ENABLE_NLS
+	gtk_action_group_set_translation_domain (priv->actions_collection,
+						 GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
+
+	gtk_action_group_add_actions (priv->actions_collection,
+				      action_entries_collection,
+				      G_N_ELEMENTS (action_entries_collection),
+				      window);
+
+	gtk_action_group_add_toggle_actions (priv->actions_collection,
+					     toggle_entries_collection,
+					     G_N_ELEMENTS (toggle_entries_collection),
+					     window);
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+
+	set_action_properties (priv->actions_window,
+			       priv->actions_image,
+			       priv->actions_collection);
+
+	gtk_ui_manager_insert_action_group (priv->ui_mgr, priv->actions_collection, 0);
+
+	if (!gtk_ui_manager_add_ui_from_resource (priv->ui_mgr,
+	                                          "/org/mate/eom/ui/eom-ui.xml",
+	                                          &error)) {
+		g_warning ("building menus failed: %s", error->message);
+		g_error_free (error);
+	}
+
+	g_signal_connect (priv->ui_mgr, "connect_proxy",
+	                  G_CALLBACK (connect_proxy_cb),
+	                  window);
+
+	g_signal_connect (priv->ui_mgr, "disconnect_proxy",
+	                  G_CALLBACK (disconnect_proxy_cb),
+	                  window);
+
+	menubar = gtk_ui_manager_get_widget (priv->ui_mgr, "/MainMenu");
+	g_assert (GTK_IS_WIDGET (menubar));
+	gtk_box_pack_start (GTK_BOX (priv->box), menubar, FALSE, FALSE, 0);
+	gtk_widget_show (menubar);
+
+	menuitem = gtk_ui_manager_get_widget (priv->ui_mgr,
+			"/MainMenu/Edit/EditFlipHorizontal");
+	gtk_image_menu_item_set_always_show_image (
+			GTK_IMAGE_MENU_ITEM (menuitem), TRUE);
+
+	menuitem = gtk_ui_manager_get_widget (priv->ui_mgr,
+			"/MainMenu/Edit/EditFlipVertical");
+	gtk_image_menu_item_set_always_show_image (
+			GTK_IMAGE_MENU_ITEM (menuitem), TRUE);
+
+	menuitem = gtk_ui_manager_get_widget (priv->ui_mgr,
+			"/MainMenu/Edit/EditRotate90");
+	gtk_image_menu_item_set_always_show_image (
+			GTK_IMAGE_MENU_ITEM (menuitem), TRUE);
+
+	menuitem = gtk_ui_manager_get_widget (priv->ui_mgr,
+			"/MainMenu/Edit/EditRotate270");
+	gtk_image_menu_item_set_always_show_image (
+			GTK_IMAGE_MENU_ITEM (menuitem), TRUE);
+
+	priv->toolbar = GTK_WIDGET
+		(g_object_new (EGG_TYPE_EDITABLE_TOOLBAR,
+			       "ui-manager", priv->ui_mgr,
+			       "popup-path", "/ToolbarPopup",
+			       "model", eom_application_get_toolbars_model (EOM_APP),
+			       NULL));
+
+	gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (priv->toolbar)),
+				     GTK_STYLE_CLASS_PRIMARY_TOOLBAR);
+
+	egg_editable_toolbar_show (EGG_EDITABLE_TOOLBAR (priv->toolbar),
+				   "Toolbar");
+
+	gtk_box_pack_start (GTK_BOX (priv->box),
+			    priv->toolbar,
+			    FALSE,
+			    FALSE,
+			    0);
+
+	gtk_widget_show (priv->toolbar);
+
+	gtk_window_add_accel_group (GTK_WINDOW (window),
+				    gtk_ui_manager_get_accel_group (priv->ui_mgr));
+
+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+	priv->actions_recent = gtk_action_group_new ("RecentFilesActions");
+#ifdef ENABLE_NLS
+	gtk_action_group_set_translation_domain (priv->actions_recent,
+						 GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
+	G_GNUC_END_IGNORE_DEPRECATIONS;
+
+	g_signal_connect (gtk_recent_manager_get_default (), "changed",
+	                  G_CALLBACK (eom_window_recent_manager_changed_cb),
+	                  window);
+
+	eom_window_update_recent_files_menu (window);
+
+	gtk_ui_manager_insert_action_group (priv->ui_mgr, priv->actions_recent, 0);
+
+	priv->cbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+	gtk_box_pack_start (GTK_BOX (priv->box), priv->cbox, TRUE, TRUE, 0);
+	gtk_widget_show (priv->cbox);
+
+	priv->statusbar = eom_statusbar_new ();
+	gtk_box_pack_end (GTK_BOX (priv->box),
+			  GTK_WIDGET (priv->statusbar),
+			  FALSE, FALSE, 0);
+	gtk_widget_show (priv->statusbar);
+
+	priv->image_info_message_cid =
+		gtk_statusbar_get_context_id (GTK_STATUSBAR (priv->statusbar),
+					      "image_info_message");
+	priv->tip_message_cid =
+		gtk_statusbar_get_context_id (GTK_STATUSBAR (priv->statusbar),
+					      "tip_message");
+
+	priv->layout = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
+
+	hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
+
+	priv->sidebar = eom_sidebar_new ();
+	/* The sidebar shouldn't be shown automatically on show_all(),
+	   but only when the user actually wants it. */
+	gtk_widget_set_no_show_all (priv->sidebar, TRUE);
+
+	gtk_widget_set_size_request (priv->sidebar, 210, -1);
+
+	g_signal_connect_after (priv->sidebar, "show",
+	                        G_CALLBACK (eom_window_sidebar_visibility_changed),
+	                        window);
+
+	g_signal_connect_after (priv->sidebar, "hide",
+	                        G_CALLBACK (eom_window_sidebar_visibility_changed),
+	                        window);
+
+	g_signal_connect_after (priv->sidebar, "page-added",
+	                        G_CALLBACK (eom_window_sidebar_page_added),
+	                        window);
+
+	g_signal_connect_after (priv->sidebar, "page-removed",
+	                        G_CALLBACK (eom_window_sidebar_page_removed),
+	                        window);
+
+ 	priv->view = eom_scroll_view_new ();
+
+	eom_sidebar_add_page (EOM_SIDEBAR (priv->sidebar),
+			      _("Properties"),
+			      GTK_WIDGET (eom_metadata_sidebar_new (window)));
+
+	gtk_widget_set_size_request (GTK_WIDGET (priv->view), 100, 100);
+	g_signal_connect (priv->view, "zoom_changed",
+	                  G_CALLBACK (view_zoom_changed_cb),
+	                  window);
+
+	g_settings_bind (priv->view_settings, EOM_CONF_VIEW_SCROLL_WHEEL_ZOOM,
+			 priv->view, "scrollwheel-zoom", G_SETTINGS_BIND_GET);
+	g_settings_bind (priv->view_settings, EOM_CONF_VIEW_ZOOM_MULTIPLIER,
+			 priv->view, "zoom-multiplier", G_SETTINGS_BIND_GET);
+
+	view_popup = gtk_ui_manager_get_widget (priv->ui_mgr, "/ViewPopup");
+	eom_scroll_view_set_popup (EOM_SCROLL_VIEW (priv->view),
+				   GTK_MENU (view_popup));
+
+	gtk_paned_pack1 (GTK_PANED (hpaned),
+			 priv->sidebar,
+			 FALSE,
+			 FALSE);
+
+	gtk_paned_pack2 (GTK_PANED (hpaned),
+			 priv->view,
+			 TRUE,
+			 FALSE);
+
+	gtk_widget_show_all (hpaned);
+
+	gtk_box_pack_start (GTK_BOX (priv->layout), hpaned, TRUE, TRUE, 0);
+
+	priv->thumbview = g_object_ref (eom_thumb_view_new ());
+
+	/* giving shape to the view */
+	gtk_icon_view_set_margin (GTK_ICON_VIEW (priv->thumbview), 4);
+	gtk_icon_view_set_row_spacing (GTK_ICON_VIEW (priv->thumbview), 0);
+
+	g_signal_connect (priv->thumbview, "selection_changed",
+	                  G_CALLBACK (handle_image_selection_changed_cb),
+	                  window);
+
+	priv->nav = eom_thumb_nav_new (priv->thumbview,
+				       EOM_THUMB_NAV_MODE_ONE_ROW,
+				       g_settings_get_boolean (priv->ui_settings,
+							      EOM_CONF_UI_SCROLL_BUTTONS));
+
+	// Bind the scroll buttons to their GSettings key
+	g_settings_bind (priv->ui_settings, EOM_CONF_UI_SCROLL_BUTTONS,
+			 priv->nav, "show-buttons", G_SETTINGS_BIND_GET);
+
+	thumb_popup = gtk_ui_manager_get_widget (priv->ui_mgr, "/ThumbnailPopup");
+	eom_thumb_view_set_thumbnail_popup (EOM_THUMB_VIEW (priv->thumbview),
+					    GTK_MENU (thumb_popup));
+
+	gtk_box_pack_start (GTK_BOX (priv->layout), priv->nav, FALSE, FALSE, 0);
+
+	gtk_box_pack_end (GTK_BOX (priv->cbox), priv->layout, TRUE, TRUE, 0);
+
+	eom_window_can_save_changed_cb (priv->lockdown_settings,
+					EOM_CONF_LOCKDOWN_CAN_SAVE,
+					window);
+	g_settings_bind (priv->ui_settings, EOM_CONF_UI_IMAGE_COLLECTION_POSITION,
+			 window, "collection-position", G_SETTINGS_BIND_GET);
+	g_settings_bind (priv->ui_settings, EOM_CONF_UI_IMAGE_COLLECTION_RESIZABLE,
+			 window, "collection-resizable", G_SETTINGS_BIND_GET);
+
+	update_action_groups_state (window);
+
+	if ((priv->flags & EOM_STARTUP_FULLSCREEN) ||
+	    (priv->flags & EOM_STARTUP_SLIDE_SHOW)) {
+		eom_window_run_fullscreen (window, (priv->flags & EOM_STARTUP_SLIDE_SHOW));
+	} else {
+		priv->mode = EOM_WINDOW_MODE_NORMAL;
+		update_ui_visibility (window);
+	}
+
+	eom_window_set_drag_dest (window);
+}
+
+static void
+eom_window_init (EomWindow *window)
+{
+	GdkGeometry hints;
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
+	GdkScreen *screen;
+#endif
+	EomWindowPrivate *priv;
+
+	eom_debug (DEBUG_WINDOW);
+
+	GtkStyleContext *context;
+
+	context = gtk_widget_get_style_context (GTK_WIDGET (window));
+	gtk_style_context_add_class (context, "eom-window");
+
+	hints.min_width  = EOM_WINDOW_MIN_WIDTH;
+	hints.min_height = EOM_WINDOW_MIN_HEIGHT;
+
+	priv = window->priv = eom_window_get_instance_private (window);
+
+	priv->view_settings = g_settings_new (EOM_CONF_VIEW);
+	priv->ui_settings = g_settings_new (EOM_CONF_UI);
+	priv->fullscreen_settings = g_settings_new (EOM_CONF_FULLSCREEN);
+	priv->lockdown_settings = g_settings_new (EOM_CONF_LOCKDOWN_SCHEMA);
+
+	g_signal_connect (priv->lockdown_settings, "changed::" EOM_CONF_LOCKDOWN_CAN_SAVE,
+	                  G_CALLBACK (eom_window_can_save_changed_cb),
+	                  window);
+
+	window->priv->store = NULL;
+	window->priv->image = NULL;
+
+	window->priv->fullscreen_popup = NULL;
+	window->priv->fullscreen_timeout_source = NULL;
+	window->priv->slideshow_random = FALSE;
+	window->priv->slideshow_loop = FALSE;
+	window->priv->slideshow_switch_timeout = 0;
+	window->priv->slideshow_switch_source = NULL;
+	window->priv->fullscreen_idle_inhibit_cookie = 0;
+
+	gtk_window_set_geometry_hints (GTK_WINDOW (window),
+				       GTK_WIDGET (window),
+				       &hints,
+				       GDK_HINT_MIN_SIZE);
+
+	gtk_window_set_default_size (GTK_WINDOW (window),
+				     EOM_WINDOW_DEFAULT_WIDTH,
+				     EOM_WINDOW_DEFAULT_HEIGHT);
+
+	gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
+
+	window->priv->mode = EOM_WINDOW_MODE_UNKNOWN;
+	window->priv->status = EOM_WINDOW_STATUS_UNKNOWN;
+
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
+	screen = gtk_widget_get_screen (GTK_WIDGET (window));
+	window->priv->display_profile =
+		eom_window_get_display_profile (screen);
+#endif
+
+	window->priv->recent_menu_id = 0;
+
+	window->priv->collection_position = 0;
+	window->priv->collection_resizable = FALSE;
+
+	window->priv->save_disabled = FALSE;
+
+	window->priv->page_setup = NULL;
+
+	gtk_window_set_application (GTK_WINDOW (window), GTK_APPLICATION (EOM_APP));
+}
+
+static void
+eom_window_dispose (GObject *object)
+{
+	EomWindow *window;
+	EomWindowPrivate *priv;
+
+	g_return_if_fail (object != NULL);
+	g_return_if_fail (EOM_IS_WINDOW (object));
+
+	eom_debug (DEBUG_WINDOW);
+
+	window = EOM_WINDOW (object);
+	priv = window->priv;
+
+	peas_engine_garbage_collect (PEAS_ENGINE (EOM_APP->priv->plugin_engine));
+
+	if (priv->extensions != NULL) {
+		g_object_unref (priv->extensions);
+		priv->extensions = NULL;
+		peas_engine_garbage_collect (PEAS_ENGINE (EOM_APP->priv->plugin_engine));
+	}
+
+	if (priv->page_setup != NULL) {
+		g_object_unref (priv->page_setup);
+		priv->page_setup = NULL;
+	}
+
+	if (priv->thumbview)
+	{
+		/* Disconnect so we don't get any unwanted callbacks
+		 * when the thumb view is disposed. */
+		g_signal_handlers_disconnect_by_func (priv->thumbview,
+		                                      handle_image_selection_changed_cb,
+		                                      window);
+		g_clear_object (&priv->thumbview);
+	}
+
+	if (priv->store != NULL) {
+		g_signal_handlers_disconnect_by_func (priv->store,
+		                                      eom_window_list_store_image_added,
+		                                      window);
+		g_signal_handlers_disconnect_by_func (priv->store,
+		                                      eom_window_list_store_image_removed,
+		                                      window);
+		g_object_unref (priv->store);
+		priv->store = NULL;
+	}
+
+	if (priv->image != NULL) {
+	  	g_signal_handlers_disconnect_by_func (priv->image,
+		                                      image_thumb_changed_cb,
+		                                      window);
+		g_signal_handlers_disconnect_by_func (priv->image,
+		                                      image_file_changed_cb,
+		                                      window);
+		g_object_unref (priv->image);
+		priv->image = NULL;
+	}
+
+	if (priv->actions_window != NULL) {
+		g_object_unref (priv->actions_window);
+		priv->actions_window = NULL;
+	}
+
+	if (priv->actions_image != NULL) {
+		g_object_unref (priv->actions_image);
+		priv->actions_image = NULL;
+	}
+
+	if (priv->actions_collection != NULL) {
+		g_object_unref (priv->actions_collection);
+		priv->actions_collection = NULL;
+	}
+
+	if (priv->actions_recent != NULL) {
+		g_object_unref (priv->actions_recent);
+		priv->actions_recent = NULL;
+	}
+
+        if (priv->actions_open_with != NULL) {
+                g_object_unref (priv->actions_open_with);
+                priv->actions_open_with = NULL;
+        }
+
+	fullscreen_clear_timeout (window);
+
+	if (window->priv->fullscreen_popup != NULL) {
+		gtk_widget_destroy (priv->fullscreen_popup);
+		priv->fullscreen_popup = NULL;
+	}
+
+	slideshow_clear_timeout (window);
+	eom_window_uninhibit_screensaver (window);
+
+	g_signal_handlers_disconnect_by_func (gtk_recent_manager_get_default (),
+	                                      eom_window_recent_manager_changed_cb,
+	                                      window);
+
+	priv->recent_menu_id = 0;
+
+	eom_window_clear_load_job (window);
+
+	eom_window_clear_transform_job (window);
+
+	if (priv->view_settings) {
+		g_object_unref (priv->view_settings);
+		priv->view_settings = NULL;
+	}
+	if (priv->ui_settings) {
+		g_object_unref (priv->ui_settings);
+		priv->ui_settings = NULL;
+	}
+	if (priv->fullscreen_settings) {
+		g_object_unref (priv->fullscreen_settings);
+		priv->fullscreen_settings = NULL;
+	}
+	if (priv->lockdown_settings) {
+		g_object_unref (priv->lockdown_settings);
+		priv->lockdown_settings = NULL;
+	}
+
+	if (priv->file_list != NULL) {
+		g_slist_free_full (priv->file_list, g_object_unref);
+		priv->file_list = NULL;
+	}
+
+#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11)
+	if (priv->display_profile != NULL) {
+		cmsCloseProfile (priv->display_profile);
+		priv->display_profile = NULL;
+	}
+#endif
+
+	if (priv->last_save_as_folder != NULL) {
+		g_object_unref (priv->last_save_as_folder);
+		priv->last_save_as_folder = NULL;
+	}
+
+	peas_engine_garbage_collect (PEAS_ENGINE (EOM_APP->priv->plugin_engine));
+
+	G_OBJECT_CLASS (eom_window_parent_class)->dispose (object);
+}
+
+static gint
+eom_window_delete (GtkWidget *widget, GdkEventAny *event)
+{
+	EomWindow *window;
+	EomWindowPrivate *priv;<--- Variable 'priv' can be declared as pointer to const
+
+	g_return_val_if_fail (EOM_IS_WINDOW (widget), FALSE);
+
+	window = EOM_WINDOW (widget);
+	priv = window->priv;
+
+	if (priv->save_job != NULL) {
+		eom_window_finish_saving (window);
+	}
+
+	if (eom_window_unsaved_images_confirm (window)) {
+		return TRUE;
+	}
+
+	gtk_widget_destroy (widget);
+
+	return TRUE;
+}
+
+static gint
+eom_window_key_press (GtkWidget *widget, GdkEventKey *event)
+{
+	GtkContainer *tbcontainer = GTK_CONTAINER ((EOM_WINDOW (widget)->priv->toolbar));
+	gint result = FALSE;
+	gboolean handle_selection = FALSE;
+
+	switch (event->keyval) {
+	case GDK_KEY_space:
+		if (event->state & GDK_CONTROL_MASK) {
+			handle_selection = TRUE;
+			break;
+		}
+	case GDK_KEY_Return:
+		if (gtk_container_get_focus_child (tbcontainer) == NULL) {
+			/* Image properties dialog case */
+			if (event->state & GDK_MOD1_MASK) {
+				result = FALSE;
+				break;
+			}
+
+			if (event->state & GDK_SHIFT_MASK) {
+				eom_window_cmd_go_prev (NULL, EOM_WINDOW (widget));
+			} else {
+				eom_window_cmd_go_next (NULL, EOM_WINDOW (widget));
+			}
+			result = TRUE;
+		}
+		break;
+	case GDK_KEY_p:
+	case GDK_KEY_P:
+		if (EOM_WINDOW (widget)->priv->mode == EOM_WINDOW_MODE_FULLSCREEN || EOM_WINDOW (widget)->priv->mode == EOM_WINDOW_MODE_SLIDESHOW) {
+			gboolean slideshow;
+
+			slideshow = EOM_WINDOW (widget)->priv->mode == EOM_WINDOW_MODE_SLIDESHOW;
+			eom_window_run_fullscreen (EOM_WINDOW (widget), !slideshow);
+		}
+		break;
+	case GDK_KEY_Q:
+	case GDK_KEY_q:
+	case GDK_KEY_Escape:
+		if (EOM_WINDOW (widget)->priv->mode == EOM_WINDOW_MODE_FULLSCREEN) {
+			eom_window_stop_fullscreen (EOM_WINDOW (widget), FALSE);
+		} else if (EOM_WINDOW (widget)->priv->mode == EOM_WINDOW_MODE_SLIDESHOW) {
+			eom_window_stop_fullscreen (EOM_WINDOW (widget), TRUE);
+		} else {
+			eom_window_cmd_close_window (NULL, EOM_WINDOW (widget));
+			return TRUE;
+		}
+		break;
+	case GDK_KEY_Left:
+		if (event->state & GDK_MOD1_MASK) {
+			/* Alt+Left moves to previous image */
+			if (is_rtl) { /* move to next in RTL mode */
+				eom_window_cmd_go_next (NULL, EOM_WINDOW (widget));
+			} else {
+				eom_window_cmd_go_prev (NULL, EOM_WINDOW (widget));
+			}
+			result = TRUE;
+			break;
+		} /* else fall-trough is intended */
+	case GDK_KEY_Up:
+		if (eom_scroll_view_scrollbars_visible (EOM_SCROLL_VIEW (EOM_WINDOW (widget)->priv->view))) {
+			/* break to let scrollview handle the key */
+			break;
+		}
+		if (gtk_container_get_focus_child (tbcontainer) != NULL)
+			break;
+		if (!gtk_widget_get_visible (EOM_WINDOW (widget)->priv->nav)) {
+			if (is_rtl && event->keyval == GDK_KEY_Left) {
+				/* handle RTL fall-through,
+				 * need to behave like GDK_Down then */
+				eom_window_cmd_go_next (NULL,
+							EOM_WINDOW (widget));
+			} else {
+				eom_window_cmd_go_prev (NULL,
+							EOM_WINDOW (widget));
+			}
+			result = TRUE;
+			break;
+		}
+	case GDK_KEY_Right:
+		if (event->state & GDK_MOD1_MASK) {
+			/* Alt+Right moves to next image */
+			if (is_rtl) { /* move to previous in RTL mode */
+				eom_window_cmd_go_prev (NULL, EOM_WINDOW (widget));
+			} else {
+				eom_window_cmd_go_next (NULL, EOM_WINDOW (widget));
+			}
+			result = TRUE;
+			break;
+		} /* else fall-trough is intended */
+	case GDK_KEY_Down:
+		if (eom_scroll_view_scrollbars_visible (EOM_SCROLL_VIEW (EOM_WINDOW (widget)->priv->view))) {
+			/* break to let scrollview handle the key */
+			break;
+		}
+		if (gtk_container_get_focus_child (tbcontainer) != NULL)
+			break;
+		if (!gtk_widget_get_visible (EOM_WINDOW (widget)->priv->nav)) {
+			if (is_rtl && event->keyval == GDK_KEY_Right) {
+				/* handle RTL fall-through,
+				 * need to behave like GDK_Up then */
+				eom_window_cmd_go_prev (NULL,
+							EOM_WINDOW (widget));
+			} else {
+				eom_window_cmd_go_next (NULL,
+							EOM_WINDOW (widget));
+			}
+			result = TRUE;
+			break;
+		}
+	case GDK_KEY_Page_Up:
+		if (!eom_scroll_view_scrollbars_visible (EOM_SCROLL_VIEW (EOM_WINDOW (widget)->priv->view))) {
+			if (!gtk_widget_get_visible (EOM_WINDOW (widget)->priv->nav)) {
+				/* If the iconview is not visible skip to the
+				 * previous image manually as it won't handle
+				 * the keypress then. */
+				eom_window_cmd_go_prev (NULL,
+							EOM_WINDOW (widget));
+				result = TRUE;
+			} else
+				handle_selection = TRUE;
+		}
+		break;
+	case GDK_KEY_Page_Down:
+		if (!eom_scroll_view_scrollbars_visible (EOM_SCROLL_VIEW (EOM_WINDOW (widget)->priv->view))) {
+			if (!gtk_widget_get_visible (EOM_WINDOW (widget)->priv->nav)) {
+				/* If the iconview is not visible skip to the
+				 * next image manually as it won't handle
+				 * the keypress then. */
+				eom_window_cmd_go_next (NULL,
+							EOM_WINDOW (widget));
+				result = TRUE;
+			} else
+				handle_selection = TRUE;
+		}
+		break;
+	}
+
+	/* Update slideshow timeout */
+	if (result && (EOM_WINDOW (widget)->priv->mode == EOM_WINDOW_MODE_SLIDESHOW)) {
+		slideshow_set_timeout (EOM_WINDOW (widget));
+	}
+
+	if (handle_selection == TRUE && result == FALSE) {
+		gtk_widget_grab_focus (GTK_WIDGET (EOM_WINDOW (widget)->priv->thumbview));
+
+		result = gtk_widget_event (GTK_WIDGET (EOM_WINDOW (widget)->priv->thumbview),
+					   (GdkEvent *) event);
+	}
+
+	/* If the focus is not in the toolbar and we still haven't handled the
+	   event, give the scrollview a chance to do it.  */
+	if (!gtk_container_get_focus_child (tbcontainer) && result == FALSE &&
+		gtk_widget_get_realized (GTK_WIDGET (EOM_WINDOW (widget)->priv->view))) {
+			result = gtk_widget_event (GTK_WIDGET (EOM_WINDOW (widget)->priv->view),
+						   (GdkEvent *) event);
+	}
+
+	if (result == FALSE && GTK_WIDGET_CLASS (eom_window_parent_class)->key_press_event) {
+		result = (* GTK_WIDGET_CLASS (eom_window_parent_class)->key_press_event) (widget, event);
+	}
+
+	return result;
+}
+
+static gint
+eom_window_button_press (GtkWidget *widget, GdkEventButton *event)
+{
+	EomWindow *window = EOM_WINDOW (widget);
+	gint result = FALSE;
+
+	if (event->type == GDK_BUTTON_PRESS) {
+		switch (event->button) {
+		case 6:
+			eom_thumb_view_select_single (EOM_THUMB_VIEW (window->priv->thumbview),
+						      EOM_THUMB_VIEW_SELECT_LEFT);
+			result = TRUE;
+		       	break;
+		case 7:
+			eom_thumb_view_select_single (EOM_THUMB_VIEW (window->priv->thumbview),
+						      EOM_THUMB_VIEW_SELECT_RIGHT);
+			result = TRUE;
+		       	break;
+		}
+	}
+
+	if (result == FALSE && GTK_WIDGET_CLASS (eom_window_parent_class)->button_press_event) {
+		result = (* GTK_WIDGET_CLASS (eom_window_parent_class)->button_press_event) (widget, event);
+	}
+
+	return result;
+}
+
+static gboolean
+eom_window_focus_out_event (GtkWidget *widget, GdkEventFocus *event)
+{
+	EomWindow *window = EOM_WINDOW (widget);
+	EomWindowPrivate *priv = window->priv;
+	gboolean fullscreen;
+
+	eom_debug (DEBUG_WINDOW);
+
+	fullscreen = priv->mode == EOM_WINDOW_MODE_FULLSCREEN ||
+		     priv->mode == EOM_WINDOW_MODE_SLIDESHOW;
+
+	if (fullscreen) {
+		gtk_widget_hide (priv->fullscreen_popup);
+	}
+
+	return GTK_WIDGET_CLASS (eom_window_parent_class)->focus_out_event (widget, event);
+}
+
+static void
+eom_window_set_property (GObject      *object,
+			 guint         property_id,
+			 const GValue *value,
+			 GParamSpec   *pspec)
+{
+	EomWindow *window;
+	EomWindowPrivate *priv;
+
+	g_return_if_fail (EOM_IS_WINDOW (object));
+
+	window = EOM_WINDOW (object);
+	priv = window->priv;
+
+	switch (property_id) {
+	case PROP_COLLECTION_POS:
+		eom_window_set_collection_mode (window, g_value_get_enum (value),
+					     priv->collection_resizable);
+		break;
+	case PROP_COLLECTION_RESIZABLE:
+		eom_window_set_collection_mode (window, priv->collection_position,
+					     g_value_get_boolean (value));
+		break;
+	case PROP_STARTUP_FLAGS:
+		priv->flags = g_value_get_flags (value);
+		break;
+
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+	}
+}
+
+static void
+eom_window_get_property (GObject    *object,
+			 guint       property_id,
+			 GValue     *value,
+			 GParamSpec *pspec)
+{
+	EomWindow *window;
+	EomWindowPrivate *priv;
+
+	g_return_if_fail (EOM_IS_WINDOW (object));
+
+	window = EOM_WINDOW (object);
+	priv = window->priv;
+
+	switch (property_id) {
+	case PROP_COLLECTION_POS:
+		g_value_set_enum (value, priv->collection_position);
+		break;
+	case PROP_COLLECTION_RESIZABLE:
+		g_value_set_boolean (value, priv->collection_resizable);
+		break;
+	case PROP_STARTUP_FLAGS:
+		g_value_set_flags (value, priv->flags);
+		break;
+
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+	}
+}
+
+static void
+on_extension_added (PeasExtensionSet *set,
+		    PeasPluginInfo   *info,
+		    PeasExtension    *exten,
+		    GtkWindow        *window)
+{
+	peas_extension_call (exten, "activate", window);
+}
+
+static void
+on_extension_removed (PeasExtensionSet *set,
+		      PeasPluginInfo   *info,
+		      PeasExtension    *exten,
+		      GtkWindow        *window)
+{
+	peas_extension_call (exten, "deactivate", window);
+}
+
+static GObject *
+eom_window_constructor (GType type,
+			guint n_construct_properties,
+			GObjectConstructParam *construct_params)
+{
+	GObject *object;
+	EomWindowPrivate *priv;
+
+	object = G_OBJECT_CLASS (eom_window_parent_class)->constructor
+			(type, n_construct_properties, construct_params);
+
+	priv = EOM_WINDOW (object)->priv;
+
+	eom_window_construct_ui (EOM_WINDOW (object));
+
+	priv->extensions = peas_extension_set_new (PEAS_ENGINE (EOM_APP->priv->plugin_engine),
+	                                           EOM_TYPE_WINDOW_ACTIVATABLE,
+	                                           "window",
+	                                           EOM_WINDOW (object), NULL);
+
+	peas_extension_set_call (priv->extensions, "activate");
+
+	g_signal_connect (priv->extensions, "extension-added",
+	                  G_CALLBACK (on_extension_added),
+	                  object);
+	g_signal_connect (priv->extensions, "extension-removed",
+	                  G_CALLBACK (on_extension_removed),
+	                  object);
+
+	return object;
+}
+
+static void
+eom_window_class_init (EomWindowClass *class)
+{
+	GObjectClass *g_object_class = (GObjectClass *) class;
+	GtkWidgetClass *widget_class = (GtkWidgetClass *) class;
+
+	g_object_class->constructor = eom_window_constructor;
+	g_object_class->dispose = eom_window_dispose;
+	g_object_class->set_property = eom_window_set_property;
+	g_object_class->get_property = eom_window_get_property;
+
+	widget_class->delete_event = eom_window_delete;
+	widget_class->key_press_event = eom_window_key_press;
+	widget_class->button_press_event = eom_window_button_press;
+	widget_class->drag_data_received = eom_window_drag_data_received;
+	widget_class->focus_out_event = eom_window_focus_out_event;
+
+/**
+ * EomWindow:collection-position:
+ *
+ * Determines the position of the image collection in the window
+ * relative to the image.
+ */
+	g_object_class_install_property (
+		g_object_class, PROP_COLLECTION_POS,
+		g_param_spec_enum ("collection-position", NULL, NULL,
+				   EOM_TYPE_WINDOW_COLLECTION_POS,
+				   EOM_WINDOW_COLLECTION_POS_BOTTOM,
+				   G_PARAM_READWRITE | G_PARAM_STATIC_NAME));
+
+/**
+ * EomWindow:collection-resizable:
+ *
+ * If %TRUE the collection will be resizable by the user otherwise it will be
+ * in single column/row mode.
+ */
+	g_object_class_install_property (
+		g_object_class, PROP_COLLECTION_RESIZABLE,
+		g_param_spec_boolean ("collection-resizable", NULL, NULL, FALSE,
+				      G_PARAM_READWRITE | G_PARAM_STATIC_NAME));
+
+/**
+ * EomWindow:startup-flags:
+ *
+ * A bitwise OR of #EomStartupFlags elements, indicating how the window
+ * should behave upon creation.
+ */
+	g_object_class_install_property (g_object_class,
+					 PROP_STARTUP_FLAGS,
+					 g_param_spec_flags ("startup-flags",
+							     NULL,
+							     NULL,
+							     EOM_TYPE_STARTUP_FLAGS,
+					 		     0,
+					 		     G_PARAM_READWRITE |
+							     G_PARAM_CONSTRUCT_ONLY));
+
+/**
+ * EomWindow::prepared:
+ * @window: the object which received the signal.
+ *
+ * The #EomWindow::prepared signal is emitted when the @window is ready
+ * to be shown.
+ */
+	signals [SIGNAL_PREPARED] =
+		g_signal_new ("prepared",
+			      EOM_TYPE_WINDOW,
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (EomWindowClass, prepared),
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE, 0);
+}
+
+/**
+ * eom_window_new:
+ * @flags: the initialization parameters for the new window.
+ *
+ *
+ * Creates a new and empty #EomWindow. Use @flags to indicate
+ * if the window should be initialized fullscreen, in slideshow mode,
+ * and/or without the thumbnails collection visible. See #EomStartupFlags.
+ *
+ * Returns: a newly created #EomWindow.
+ **/
+GtkWidget*
+eom_window_new (EomStartupFlags flags)
+{
+	EomWindow *window;
+
+	eom_debug (DEBUG_WINDOW);
+
+	window = EOM_WINDOW (g_object_new (EOM_TYPE_WINDOW,
+	                                   "type", GTK_WINDOW_TOPLEVEL,
+	                                   "application", EOM_APP,
+	                                   "show-menubar", FALSE,
+	                                   "startup-flags", flags,
+	                                   NULL));
+
+	return GTK_WIDGET (window);
+}
+
+static void
+eom_window_list_store_image_added (GtkTreeModel *tree_model,
+                                   GtkTreePath  *path,
+                                   GtkTreeIter  *iter,
+                                   gpointer      user_data)
+{
+	EomWindow *window = EOM_WINDOW (user_data);
+
+	update_image_pos (window);
+	update_action_groups_state (window);
+}
+
+static void
+eom_window_list_store_image_removed (GtkTreeModel *tree_model,
+                                     GtkTreePath  *path,
+                                     gpointer      user_data)
+{
+	EomWindow *window = EOM_WINDOW (user_data);
+
+	update_image_pos (window);
+	update_action_groups_state (window);
+}
+
+static void
+eom_job_model_cb (EomJobModel *job, gpointer data)
+{
+	EomWindow *window;
+	EomWindowPrivate *priv;
+	gint n_images;
+
+	eom_debug (DEBUG_WINDOW);
+
+#ifdef HAVE_EXIF
+	int i;
+	EomImage *image;
+#endif
+
+	g_return_if_fail (EOM_IS_WINDOW (data));
+
+	window = EOM_WINDOW (data);
+	priv = window->priv;
+
+	if (priv->store != NULL) {
+		g_object_unref (priv->store);
+		priv->store = NULL;
+	}
+
+	priv->store = g_object_ref (job->store);
+
+	n_images = eom_list_store_length (EOM_LIST_STORE (priv->store));
+
+#ifdef HAVE_EXIF
+	if (g_settings_get_boolean (priv->view_settings, EOM_CONF_VIEW_AUTOROTATE)) {
+		for (i = 0; i < n_images; i++) {
+			image = eom_list_store_get_image_by_pos (priv->store, i);
+			eom_image_autorotate (image);
+			g_object_unref (image);
+		}
+	}
+#endif
+
+	eom_thumb_view_set_model (EOM_THUMB_VIEW (priv->thumbview), priv->store);
+
+	g_signal_connect (priv->store, "row-inserted",
+	                  G_CALLBACK (eom_window_list_store_image_added),
+	                  window);
+
+	g_signal_connect (priv->store, "row-deleted",
+	                  G_CALLBACK (eom_window_list_store_image_removed),
+	                  window);
+
+	if (n_images == 0) {
+		gint n_files;
+
+		priv->status = EOM_WINDOW_STATUS_NORMAL;
+		update_action_groups_state (window);
+
+		n_files = g_slist_length (priv->file_list);
+
+		if (n_files > 0) {
+			GtkWidget *message_area;
+			GFile *file = NULL;
+
+			if (n_files == 1) {
+				file = (GFile *) priv->file_list->data;
+			}
+
+			message_area = eom_no_images_error_message_area_new (file);
+
+			eom_window_set_message_area (window, message_area);
+
+			gtk_widget_show (message_area);
+		}
+
+		g_signal_emit (window, signals[SIGNAL_PREPARED], 0);
+	}
+}
+
+/**
+ * eom_window_open_file_list:
+ * @window: An #EomWindow.
+ * @file_list: (element-type GFile): A %NULL-terminated list of #GFile's.
+ *
+ * Opens a list of files, adding them to the collection in @window.
+ * Files will be checked to be readable and later filtered according
+ * with eom_list_store_add_files().
+ **/
+void
+eom_window_open_file_list (EomWindow *window, GSList *file_list)
+{
+	EomJob *job;
+
+	eom_debug (DEBUG_WINDOW);
+
+	window->priv->status = EOM_WINDOW_STATUS_INIT;
+
+	g_slist_foreach (file_list, (GFunc) g_object_ref, NULL);
+	window->priv->file_list = file_list;
+
+	job = eom_job_model_new (file_list);
+
+	g_signal_connect (job, "finished",
+	                  G_CALLBACK (eom_job_model_cb),
+	                  window);
+
+	eom_job_queue_add_job (job);
+	g_object_unref (job);
+}
+
+/**
+ * eom_window_get_ui_manager:
+ * @window: An #EomWindow.
+ *
+ * Gets the #GtkUIManager that describes the UI of @window.
+ *
+ * Returns: (transfer none): A #GtkUIManager.
+ **/
+GtkUIManager *
+eom_window_get_ui_manager (EomWindow *window)
+{
+	g_return_val_if_fail (EOM_IS_WINDOW (window), NULL);
+
+	return window->priv->ui_mgr;
+}
+
+/**
+ * eom_window_get_mode:
+ * @window: An #EomWindow.
+ *
+ * Gets the mode of @window. See #EomWindowMode for details.
+ *
+ * Returns: An #EomWindowMode.
+ **/
+EomWindowMode
+eom_window_get_mode (EomWindow *window)
+{
+	g_return_val_if_fail (EOM_IS_WINDOW (window), EOM_WINDOW_MODE_UNKNOWN);
+
+	return window->priv->mode;
+}
+
+/**
+ * eom_window_set_mode:
+ * @window: an #EomWindow.
+ * @mode: an #EomWindowMode value.
+ *
+ * Changes the mode of @window to normal, fullscreen, or slideshow.
+ * See #EomWindowMode for details.
+ **/
+void
+eom_window_set_mode (EomWindow *window, EomWindowMode mode)
+{
+	g_return_if_fail (EOM_IS_WINDOW (window));
+
+	if (window->priv->mode == mode)
+		return;
+
+	switch (mode) {
+	case EOM_WINDOW_MODE_NORMAL:
+		eom_window_stop_fullscreen (window,
+					    window->priv->mode == EOM_WINDOW_MODE_SLIDESHOW);
+		break;
+	case EOM_WINDOW_MODE_FULLSCREEN:
+		eom_window_run_fullscreen (window, FALSE);
+		break;
+	case EOM_WINDOW_MODE_SLIDESHOW:
+		eom_window_run_fullscreen (window, TRUE);
+		break;
+	case EOM_WINDOW_MODE_UNKNOWN:
+		break;
+	}
+}
+
+/**
+ * eom_window_get_store:
+ * @window: An #EomWindow.
+ *
+ * Gets the #EomListStore that contains the images in the collection
+ * of @window.
+ *
+ * Returns: (transfer none): an #EomListStore.
+ **/
+EomListStore *
+eom_window_get_store (EomWindow *window)
+{
+	g_return_val_if_fail (EOM_IS_WINDOW (window), NULL);
+
+	return EOM_LIST_STORE (window->priv->store);
+}
+
+/**
+ * eom_window_get_view:
+ * @window: An #EomWindow.
+ *
+ * Gets the #EomScrollView in the window.
+ *
+ * Returns: (transfer none): the #EomScrollView.
+ **/
+GtkWidget *
+eom_window_get_view (EomWindow *window)
+{
+	g_return_val_if_fail (EOM_IS_WINDOW (window), NULL);
+
+	return window->priv->view;
+}
+
+/**
+ * eom_window_get_sidebar:
+ * @window: An #EomWindow.
+ *
+ * Gets the sidebar widget of @window.
+ *
+ * Returns: (transfer none): the #EomSidebar.
+ **/
+GtkWidget *
+eom_window_get_sidebar (EomWindow *window)
+{
+	g_return_val_if_fail (EOM_IS_WINDOW (window), NULL);
+
+	return window->priv->sidebar;
+}
+
+/**
+ * eom_window_get_thumb_view:
+ * @window: an #EomWindow.
+ *
+ * Gets the thumbnails view in @window.
+ *
+ * Returns: (transfer none): an #EomThumbView.
+ **/
+GtkWidget *
+eom_window_get_thumb_view (EomWindow *window)
+{
+	g_return_val_if_fail (EOM_IS_WINDOW (window), NULL);
+
+	return window->priv->thumbview;
+}
+
+/**
+ * eom_window_get_thumb_nav:
+ * @window: an #EomWindow.
+ *
+ * Gets the thumbnails navigation pane in @window.
+ *
+ * Returns: (transfer none): an #EomThumbNav.
+ **/
+GtkWidget *
+eom_window_get_thumb_nav (EomWindow *window)
+{
+	g_return_val_if_fail (EOM_IS_WINDOW (window), NULL);
+
+	return window->priv->nav;
+}
+
+/**
+ * eom_window_get_statusbar:
+ * @window: an #EomWindow.
+ *
+ * Gets the statusbar in @window.
+ *
+ * Returns: (transfer none): a #EomStatusBar.
+ **/
+GtkWidget *
+eom_window_get_statusbar (EomWindow *window)
+{
+	g_return_val_if_fail (EOM_IS_WINDOW (window), NULL);
+
+	return window->priv->statusbar;
+}
+
+/**
+ * eom_window_get_image:
+ * @window: an #EomWindow.
+ *
+ * Gets the image currently displayed in @window or %NULL if
+ * no image is being displayed.
+ *
+ * Returns: (transfer none): an #EomImage.
+ **/
+EomImage *
+eom_window_get_image (EomWindow *window)
+{
+	g_return_val_if_fail (EOM_IS_WINDOW (window), NULL);
+
+	return window->priv->image;
+}
+
+/**
+ * eom_window_is_empty:
+ * @window: an #EomWindow.
+ *
+ * Tells whether @window is currently empty or not.
+ *
+ * Returns: %TRUE if @window has no images, %FALSE otherwise.
+ **/
+gboolean
+eom_window_is_empty (EomWindow *window)
+{
+	EomWindowPrivate *priv;
+	gboolean empty = TRUE;
+
+	eom_debug (DEBUG_WINDOW);
+
+	g_return_val_if_fail (EOM_IS_WINDOW (window), FALSE);
+
+	priv = window->priv;
+
+	if (priv->store != NULL) {
+		empty = (eom_list_store_length (EOM_LIST_STORE (priv->store)) == 0);
+	}
+
+	return empty;
+}
+
+void
+eom_window_reload_image (EomWindow *window)
+{
+	GtkWidget *view;
+
+	g_return_if_fail (EOM_IS_WINDOW (window));
+
+	if (window->priv->image == NULL)
+		return;
+
+	g_object_unref (window->priv->image);
+	window->priv->image = NULL;
+
+	view = eom_window_get_view (window);
+	eom_scroll_view_set_image (EOM_SCROLL_VIEW (view), NULL);
+
+	eom_thumb_view_select_single (EOM_THUMB_VIEW (window->priv->thumbview),
+				      EOM_THUMB_VIEW_SELECT_CURRENT);
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/98.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/98.html new file mode 100644 index 0000000..730c6ab --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/98.html @@ -0,0 +1,605 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye Of Mate - Main
+ *
+ * Copyright (C) 2000-2006 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr@gnome.org>
+ *
+ * Based on code by:
+ * 	- Federico Mena-Quintero <federico@gnu.org>
+ *	- Jens Finke <jens@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"<--- Include file: "config.h" not found.
+#endif
+#ifdef HAVE_INTROSPECTION
+#include <girepository.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include "eom-session.h"
+#include "eom-debug.h"
+#include "eom-thumbnail.h"
+#include "eom-job-queue.h"
+#include "eom-application.h"
+#include "eom-application-internal.h"
+#include "eom-util.h"
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <stdlib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#if HAVE_EXEMPI
+#include <exempi/xmp.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+static EomStartupFlags flags;
+
+static gboolean fullscreen = FALSE;
+static gboolean slide_show = FALSE;
+static gboolean disable_collection = FALSE;
+static gboolean force_new_instance = FALSE;
+static gchar **startup_files = NULL;
+
+static gboolean
+_print_version_and_exit (const gchar *option_name,
+			 const gchar *value,
+			 gpointer data,
+			 GError **error)
+{
+	g_print("%s %s\n", _("Eye of MATE Image Viewer"), VERSION);
+	exit (EXIT_SUCCESS);
+	return TRUE;
+}
+
+static const GOptionEntry goption_options[] =
+{
+	{ "fullscreen", 'f', 0, G_OPTION_ARG_NONE, &fullscreen, N_("Open in fullscreen mode"), NULL  },
+	{ "disable-image-collection", 'c', 0, G_OPTION_ARG_NONE, &disable_collection, N_("Disable image collection"), NULL  },
+	{ "slide-show", 's', 0, G_OPTION_ARG_NONE, &slide_show, N_("Open in slideshow mode"), NULL  },
+	{ "new-instance", 'n', 0, G_OPTION_ARG_NONE, &force_new_instance, N_("Start a new instance instead of reusing an existing one"), NULL },
+	{ "version", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
+	  _print_version_and_exit, N_("Show the application's version"), NULL},
+	{ NULL }
+};
+
+static void
+set_startup_flags (void)
+{
+  if (fullscreen)
+    flags |= EOM_STARTUP_FULLSCREEN;
+
+  if (disable_collection)
+    flags |= EOM_STARTUP_DISABLE_COLLECTION;
+
+  if (slide_show)
+    flags |= EOM_STARTUP_SLIDE_SHOW;
+}
+
+int
+main (int argc, char **argv)
+{
+	GError *error = NULL;
+	GOptionContext *ctx;
+	GFile *css_file;
+	GtkCssProvider *provider;
+
+#ifdef ENABLE_NLS
+	bindtextdomain (GETTEXT_PACKAGE, EOM_LOCALE_DIR);
+	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+	textdomain (GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
+
+	gdk_set_allowed_backends ("wayland,x11");
+
+	ctx = g_option_context_new (_("[FILE…]"));
+	g_option_context_add_main_entries (ctx, goption_options, PACKAGE);
+	/* Option groups are free'd together with the context
+	 * Using gtk_get_option_group here initializes gtk during parsing */
+	g_option_context_add_group (ctx, gtk_get_option_group (TRUE));
+#ifdef HAVE_INTROSPECTION
+	g_option_context_add_group (ctx, g_irepository_get_option_group ());
+#endif
+
+	if (!g_option_context_parse (ctx, &argc, &argv, &error)) {
+		gchar *help_msg;
+
+		/* I18N: The '%s' is replaced with eom's command name. */
+		help_msg = g_strdup_printf (_("Run '%s --help' to see a full "
+					      "list of available command line "
+					      "options."), argv[0]);
+                g_printerr ("%s\n%s\n", error->message, help_msg);
+                g_error_free (error);
+		g_free (help_msg);
+                g_option_context_free (ctx);
+
+                return 1;
+        }
+	g_option_context_free (ctx);
+
+	set_startup_flags ();
+
+#ifdef HAVE_EXEMPI
+ 	xmp_init();
+#endif
+	eom_debug_init ();
+	eom_job_queue_init ();
+	eom_thumbnail_init ();
+
+	/* Load special style properties for EomThumbView's scrollbar */
+	css_file = g_file_new_for_uri ("resource:///org/mate/eom/ui/eom.css");
+	provider = gtk_css_provider_new ();
+	if (G_UNLIKELY (!gtk_css_provider_load_from_file(provider,
+	                                                 css_file,
+	                                                 &error)))
+	{
+		g_critical ("Could not load CSS data: %s", error->message);
+		g_clear_error (&error);
+	} else {
+		gtk_style_context_add_provider_for_screen (
+				gdk_screen_get_default(),
+				GTK_STYLE_PROVIDER (provider),
+				GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+	}
+	g_object_unref (provider);
+	g_object_unref (css_file);
+
+	/* Add application specific icons to search path */
+	gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
+                                           EOM_DATA_DIR G_DIR_SEPARATOR_S "icons");
+
+	gtk_window_set_default_icon_name ("eom");
+	g_set_application_name (_("Eye of MATE Image Viewer"));
+
+	EOM_APP->priv->flags = flags;
+	if (force_new_instance) {
+		GApplicationFlags app_flags = g_application_get_flags (G_APPLICATION (EOM_APP));
+		app_flags |= G_APPLICATION_NON_UNIQUE;
+		g_application_set_flags (G_APPLICATION (EOM_APP), app_flags);
+	}
+
+	g_application_run (G_APPLICATION (EOM_APP), argc, argv);
+	g_object_unref (EOM_APP);
+
+  	if (startup_files)
+		g_strfreev (startup_files);
+
+#ifdef HAVE_EXEMPI
+	xmp_terminate();
+#endif
+	return 0;
+}
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/99.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/99.html new file mode 100644 index 0000000..a1e1607 --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/99.html @@ -0,0 +1,469 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+
  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
/* Eye of Mate image viewer - utility functions for computing zoom factors
+ *
+ * Copyright (C) 2000 The Free Software Foundation
+ *
+ * Author: Federico Mena-Quintero <federico@gnu.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <math.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "zoom.h"
+
+/**
+ * zoom_fit_size:
+ * @dest_width: Width of destination area.
+ * @dest_height: Height of destination area.
+ * @src_width: Width of source image.
+ * @src_height: Height of source image.
+ * @upscale_smaller: Whether to scale up images smaller than the destination size.
+ * @width: Return value for image width.
+ * @height: Return value for image height.
+ *
+ * Computes the final dimensions of an image that is to be scaled to fit to a
+ * certain size.  If @upscale_smaller is TRUE, then images smaller than the
+ * destination size will be scaled up; otherwise, they will be left at their
+ * original size.
+ **/
+void
+zoom_fit_size (guint dest_width, guint dest_height,
+	       guint src_width, guint src_height,
+	       gboolean upscale_smaller,
+	       guint *width, guint *height)
+{
+	guint w, h;
+
+	g_return_if_fail (width != NULL);
+	g_return_if_fail (height != NULL);
+
+	if (src_width == 0 || src_height == 0) {
+		*width = 0;
+		*height = 0;
+		return;
+	}
+
+	if (src_width <= dest_width && src_height <= dest_height && !upscale_smaller) {
+		*width = src_width;
+		*height = src_height;
+		return;
+	}
+
+	w = dest_width;
+	h = floor ((double) (src_height * w) / src_width + 0.5);
+
+	if (h > dest_height) {
+		h = dest_height;
+		w = floor ((double) (src_width * h) / src_height + 0.5);
+	}
+
+	g_assert (w <= dest_width);
+	g_assert (h <= dest_height);
+
+	*width = w;
+	*height = h;
+}
+
+/**
+ * zoom_fit_scale:
+ * @dest_width: Width of destination area.
+ * @dest_height: Height of destination area.
+ * @src_width: Width of source image.
+ * @src_height: Height of source image.
+ * @upscale_smaller: Whether to scale up images smaller than the destination size.
+ *
+ * Similar to zoom_fit_size(), but returns the zoom factor of the final image
+ * with respect to the original image's size.
+ *
+ * Return value: Zoom factor with respect to the original size.
+ **/
+double
+zoom_fit_scale (guint dest_width, guint dest_height,
+		guint src_width, guint src_height,
+		gboolean upscale_smaller)
+{
+	guint w, h;
+	double wfactor, hfactor;
+	double factor;
+
+	if (src_width == 0 || src_height == 0)
+		return 1.0;
+
+	if (dest_width == 0 || dest_height == 0)
+		return 0.0;
+
+	zoom_fit_size (dest_width, dest_height, src_width, src_height, upscale_smaller, &w, &h);
+
+	wfactor = (double) w / src_width;
+	hfactor = (double) h / src_height;
+
+	factor = MIN (wfactor, hfactor);
+
+	return factor;
+}
+
+
+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/index.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/index.html new file mode 100644 index 0000000..dde6bfc --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/index.html @@ -0,0 +1,867 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineIdCWESeverityMessage
checkersReportinformationActive checkers: There was critical errors (use --checkers-report=<filename> to see details)
cut-n-paste/toolbar-editor/egg-editable-toolbar.c
22missingIncludeinformationInclude file: "config.h" not found.
28missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
82unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
cut-n-paste/toolbar-editor/egg-editable-toolbar.h
27missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
cut-n-paste/toolbar-editor/egg-toolbar-editor.c
21missingIncludeinformationInclude file: "config.h" not found.
26missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <libxml/tree.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
71unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
cut-n-paste/toolbar-editor/egg-toolbar-editor.h
22missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
cut-n-paste/toolbar-editor/egg-toolbars-model.c
22missingIncludeinformationInclude file: "config.h" not found.
28missingIncludeSysteminformationInclude file: <unistd.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <libxml/globals.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <libxml/parser.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <libxml/tree.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <gdk/gdk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
67unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
cut-n-paste/toolbar-editor/egg-toolbars-model.h
24missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <gdk/gdk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
cut-n-paste/toolbar-editor/eggmarshalers.c
2missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
cut-n-paste/toolbar-editor/eggmarshalers.h
5missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
cut-n-paste/toolbar-editor/eggtypebuiltins.h
7missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
jpegutils/transupp-6b.c
40missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
46missingIncludeSysteminformationInclude file: <stdio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
47missingIncludeSysteminformationInclude file: <jpeglib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
133variableScope398styleThe scope of the variable 'compptr' can be reduced.
182variableScope398styleThe scope of the variable 'compptr' can be reduced.
251variableScope398styleThe scope of the variable 'compptr' can be reduced.
298variableScope398styleThe scope of the variable 'compptr' can be reduced.
361variableScope398styleThe scope of the variable 'compptr' can be reduced.
425variableScope398styleThe scope of the variable 'compptr' can be reduced.
528variableScope398styleThe scope of the variable 'compptr' can be reduced.
692variableScope398styleThe scope of the variable 'itemp' can be reduced.
908variableScope398styleThe scope of the variable 'm' can be reduced.
jpegutils/transupp-6b.h
53missingIncludeSysteminformationInclude file: <jpeglib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
jpegutils/transupp-8a.c
45missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
46missingIncludeSysteminformationInclude file: <stdio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
47missingIncludeSysteminformationInclude file: <jpeglib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
49missingIncludeSysteminformationInclude file: <ctype.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
jpegutils/transupp-8a.h
159unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If EXTERN is a macro then please configure it.
plugins/fullscreen/eom-fullscreen-plugin.c
2missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
7missingIncludeSysteminformationInclude file: <gmodule.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
8missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
9missingIncludeSysteminformationInclude file: <libpeas/peas-activatable.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
11missingIncludeSysteminformationInclude file: <eom-debug.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
12missingIncludeSysteminformationInclude file: <eom-window.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
13missingIncludeSysteminformationInclude file: <eom-window-activatable.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31constParameterCallback398styleParameter 'event' can be declared as pointer to const. However it seems that 'on_button_press' is a callback function, if 'event' is declared with const you might also need to cast function pointer(s).
plugins/fullscreen/eom-fullscreen-plugin.h
4missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
5missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
6missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
7missingIncludeSysteminformationInclude file: <libpeas/peas-extension-base.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
8missingIncludeSysteminformationInclude file: <libpeas/peas-object-module.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
10missingIncludeSysteminformationInclude file: <eom-window.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
plugins/reload/eom-reload-plugin.c
2missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
7missingIncludeSysteminformationInclude file: <gmodule.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
8missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
9missingIncludeSysteminformationInclude file: <libpeas/peas-activatable.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
11missingIncludeSysteminformationInclude file: <eom-debug.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
12missingIncludeSysteminformationInclude file: <eom-window.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
13missingIncludeSysteminformationInclude file: <eom-window-activatable.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
plugins/reload/eom-reload-plugin.h
4missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
5missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
6missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
7missingIncludeSysteminformationInclude file: <libpeas/peas-extension-base.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
8missingIncludeSysteminformationInclude file: <libpeas/peas-object-module.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
10missingIncludeSysteminformationInclude file: <eom-window.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
plugins/statusbar-date/eom-statusbar-date-plugin.c
23missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <gmodule.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <libpeas/peas-activatable.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <eom-debug.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <eom-image.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <eom-thumb-view.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <eom-exif-util.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
36missingIncludeSysteminformationInclude file: <eom-window.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
37missingIncludeSysteminformationInclude file: <eom-window-activatable.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
plugins/statusbar-date/eom-statusbar-date-plugin.h
25missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <libpeas/peas-extension-base.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <libpeas/peas-object-module.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <eom-window.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-application-activatable.c
29missingIncludeinformationInclude file: "config.h" not found.
34missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-application-activatable.h
31missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-application-internal.h
29missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <libpeas/peas-extension-set.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
36missingIncludeinformationInclude file: "egg-toolbars-model.h" not found.
src/eom-application.c
26missingIncludeinformationInclude file: "config.h" not found.
37missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
38missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
39missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
40missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
41missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
42missingIncludeSysteminformationInclude file: <gdk/gdkx.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-application.h
28missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <libpeas/peas-extension-set.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-clipboard-handler.c
25missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <gdk-pixbuf/gdk-pixbuf.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
50unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
src/eom-clipboard-handler.h
27missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-close-confirmation-dialog.c
28missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <eom-window.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
76unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
src/eom-close-confirmation-dialog.h
30missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <eom-image.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-debug.c
29missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <stdio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-debug.h
31missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-enum-types.h
7missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-error-message-area.c
26missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
36missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
48variableScope398styleThe scope of the variable 'secondary_markup' can be reduced.
50variableScope398styleThe scope of the variable 'secondary_label' can be reduced.
src/eom-error-message-area.h
28missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-exif-util.c
28missingIncludeinformationInclude file: "config.h" not found.
35missingIncludeSysteminformationInclude file: <time.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
40missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
41missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
56unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_BOXED_TYPE is a macro then please configure it.
src/eom-exif-util.h
30missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <libexif/exif-data.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-file-chooser.c
19missingIncludeinformationInclude file: "config.h" not found.
26missingIncludeSysteminformationInclude file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
38missingIncludeSysteminformationInclude file: <libmate-desktop/mate-desktop-thumbnail.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
54unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
src/eom-file-chooser.h
21missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
22missingIncludeSysteminformationInclude file: <gdk-pixbuf/gdk-pixbuf.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-image-jpeg.c
32missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
40missingIncludeSysteminformationInclude file: <sys/types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
41missingIncludeSysteminformationInclude file: <unistd.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
42missingIncludeSysteminformationInclude file: <stdio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
43missingIncludeSysteminformationInclude file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
44missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
45missingIncludeSysteminformationInclude file: <setjmp.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
46missingIncludeSysteminformationInclude file: <jpeglib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
47missingIncludeSysteminformationInclude file: <jerror.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
48missingIncludeinformationInclude file: "transupp.h" not found.
49missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
50missingIncludeSysteminformationInclude file: <gdk-pixbuf/gdk-pixbuf.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
51missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
53missingIncludeSysteminformationInclude file: <libexif/exif-data.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
207unreadVariable563styleVariable 'jsrcerr.error' is assigned a value that is never used.
213unreadVariable563styleVariable 'jdsterr.filename' is assigned a value that is never used.
217unreadVariable563styleVariable 'jdsterr.error' is assigned a value that is never used.
352constVariablePointer398styleVariable 'ptr' can be declared as pointer to const
399unreadVariable563styleVariable 'jerr.filename' is assigned a value that is never used.
403unreadVariable563styleVariable 'jerr.error' is assigned a value that is never used.
src/eom-image-jpeg.h
6missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-image-private.h
27missingIncludeSysteminformationInclude file: <librsvg/rsvg.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-image-save-info.c
2missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
5missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
11unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE is a macro then please configure it.
src/eom-image-save-info.h
4missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
5missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
6missingIncludeSysteminformationInclude file: <gdk-pixbuf/gdk-pixbuf.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-image.c
23missingIncludeinformationInclude file: "config.h" not found.
27missingIncludeSysteminformationInclude file: <gdk/gdkx.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
46missingIncludeSysteminformationInclude file: <unistd.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
47missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
49missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
50missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
51missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
52missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
53missingIncludeSysteminformationInclude file: <gdk-pixbuf/gdk-pixbuf.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
57missingIncludeSysteminformationInclude file: <libexif/exif-data.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
58missingIncludeSysteminformationInclude file: <libexif/exif-utils.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
59missingIncludeSysteminformationInclude file: <libexif/exif-loader.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
63missingIncludeSysteminformationInclude file: <lcms2.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
67missingIncludeSysteminformationInclude file: <librsvg/rsvg.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
623variableScope398styleThe scope of the variable 'p' can be reduced.
1203constVariablePointer398styleVariable 'priv' can be declared as pointer to const
1381constVariablePointer398styleVariable 'priv' can be declared as pointer to const
1402variableScope398styleThe scope of the variable 'inverse' can be reduced.
1432variableScope398styleThe scope of the variable 'tmp_file' can be reduced.
2211variableScope398styleThe scope of the variable 'mime_types' can be reduced.
2212variableScope398styleThe scope of the variable 'i' can be reduced.
2242constVariablePointer398styleVariable 'result' can be declared as pointer to const
src/eom-image.h
31missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <gdk-pixbuf/gdk-pixbuf.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
36missingIncludeSysteminformationInclude file: <libexif/exif-data.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
41missingIncludeSysteminformationInclude file: <lcms2.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
45missingIncludeSysteminformationInclude file: <exempi/xmp.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
49missingIncludeSysteminformationInclude file: <librsvg/rsvg.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-job-queue.h
30missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-jobs.c
34missingIncludeSysteminformationInclude file: <gdk-pixbuf/gdk-pixbuf.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
910variableScope398styleThe scope of the variable 'src' can be reduced.
910variableScope398styleThe scope of the variable 'dest' can be reduced.
911variableScope398styleThe scope of the variable 'filename' can be reduced.
911variableScope398styleThe scope of the variable 'dest_filename' can be reduced.
src/eom-jobs.h
32missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <gdk-pixbuf/gdk-pixbuf.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-list-store.c
30missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
514unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME is a macro then please configure it.
src/eom-list-store.h
27missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-marshal.c
2missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-marshal.h
5missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-metadata-details.c
23missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <libexif/exif-entry.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <libexif/exif-utils.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <exempi/xmp.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <exempi/xmpconsts.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
38missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
39missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
41missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
42missingIncludeSysteminformationInclude file: <math.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
208unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
src/eom-metadata-details.h
25missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <libexif/exif-data.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <exempi/xmp.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-metadata-reader-jpg.c
25missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <gdk/gdkx.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
91unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_CODE is a macro then please configure it.
src/eom-metadata-reader-png.c
25missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <math.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <zlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <gdk/gdkx.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
93unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_CODE is a macro then please configure it.
src/eom-metadata-reader.c
23missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <gdk/gdk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_INTERFACE is a macro then please configure it.
src/eom-metadata-reader.h
25missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <exempi/xmp.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <lcms2.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-metadata-sidebar.c
28missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
43missingIncludeSysteminformationInclude file: <libexif/exif-data.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
44missingIncludeSysteminformationInclude file: <libexif/exif-tag.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
49missingIncludeSysteminformationInclude file: <exempi/xmp.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
50missingIncludeSysteminformationInclude file: <exempi/xmpconsts.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
94unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
src/eom-metadata-sidebar.h
27missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-pixbuf-util.c
2missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
5missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-pixbuf-util.h
4missingIncludeSysteminformationInclude file: <gdk-pixbuf/gdk-pixbuf.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
5missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-plugin-engine.c
26missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
36missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
37missingIncludeSysteminformationInclude file: <girepository.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
45unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
src/eom-plugin-engine.h
28missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <libpeas/peas-engine.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-preferences-dialog.c
26missingIncludeinformationInclude file: "config.h" not found.
34missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
36missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
37missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
38missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
39missingIncludeSysteminformationInclude file: <libpeas-gtk/peas-gtk-plugin-manager.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
45unusedStructMember563stylestruct member '_EomPreferencesDialogPrivate::ui_settings' is never used.
src/eom-preferences-dialog.h
28missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-print-image-setup.c
23missingIncludeinformationInclude file: "config.h" not found.
26missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <gtk/gtkunixprint.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <glib/gprintf.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <langinfo.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
141constParameterPointer398styleParameter 'setup' can be declared as pointer to const
688variableScope398styleThe scope of the variable 'pixbuf' can be reduced.
864constVariablePointer398styleVariable 'locale_scale' can be declared as pointer to const
src/eom-print-preview.c
22missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
23missingIncludeSysteminformationInclude file: <cairo.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <gdk/gdkkeysyms.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
94unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
src/eom-print.c
22missingIncludeinformationInclude file: "config.h" not found.
24missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <librsvg/rsvg.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-print.h
26missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-properties-dialog.c
24missingIncludeinformationInclude file: "config.h" not found.
36missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
37missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
38missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
39missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
40missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
43missingIncludeSysteminformationInclude file: <exempi/xmp.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
44missingIncludeSysteminformationInclude file: <exempi/xmpconsts.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
71unusedStructMember563stylestruct member '_EomPropertiesDialogPrivate::general_box' is never used.
97unusedStructMember563stylestruct member '_EomPropertiesDialogPrivate::xmp_box' is never used.
98unusedStructMember563stylestruct member '_EomPropertiesDialogPrivate::xmp_box_label' is never used.
147variableScope398styleThe scope of the variable 'mime_str' can be reduced.
src/eom-properties-dialog.h
28missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-resources.c
1missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
9unusedStructMember563styleunion member 'Anonymous0::alignment' is never used.
9unusedStructMember563styleunion member 'Anonymous0::ptr' is never used.
src/eom-save-as-dialog-helper.c
2missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
5missingIncludeSysteminformationInclude file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
6missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
7missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-save-as-dialog-helper.h
4missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
5missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-scroll-view.c
2missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
5missingIncludeSysteminformationInclude file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
6missingIncludeSysteminformationInclude file: <math.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
7missingIncludeSysteminformationInclude file: <gdk-pixbuf/gdk-pixbuf.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
8missingIncludeSysteminformationInclude file: <gdk/gdkkeysyms.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
10missingIncludeSysteminformationInclude file: <librsvg/rsvg.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
20missingIncludeSysteminformationInclude file: <gdk/gdk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
164unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
src/eom-scroll-view.h
4missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-session.c
27missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-session.h
31missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-sidebar.c
27missingIncludeinformationInclude file: "config.h" not found.
30missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <gdk/gdkkeysyms.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
68unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
src/eom-sidebar.h
29missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-statusbar.c
24missingIncludeinformationInclude file: "config.h" not found.
29missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
39unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
src/eom-statusbar.h
26missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-thumb-nav.c
23missingIncludeinformationInclude file: "config.h" not found.
29missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <math.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-thumb-nav.h
27missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-thumb-view.c
23missingIncludeinformationInclude file: "config.h" not found.
33missingIncludeSysteminformationInclude file: <libexif/exif-data.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
36missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
37missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
38missingIncludeSysteminformationInclude file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
39missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
90unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_IMPLEMENT_INTERFACE is a macro then please configure it.
src/eom-thumbnail.c
26missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <libmate-desktop/mate-desktop-thumbnail.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
164unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_FILE_ATTRIBUTE_TIME_MODIFIED is a macro then please configure it.
src/eom-thumbnail.h
28missingIncludeSysteminformationInclude file: <gdk-pixbuf/gdk-pixbuf.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-transform.c
23missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <time.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <math.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <cairo/cairo.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
50unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
src/eom-transform.h
4missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
5missingIncludeSysteminformationInclude file: <gdk-pixbuf/gdk-pixbuf.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-uri-converter.c
2missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
5missingIncludeSysteminformationInclude file: <math.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
6missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
7missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
53unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
src/eom-uri-converter.h
4missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
5missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-util.c
26missingIncludeinformationInclude file: "config.h" not found.
29missingIncludeSysteminformationInclude file: <sys/time.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <time.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <errno.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
36missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
37missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
38missingIncludeSysteminformationInclude file: <glib/gprintf.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
39missingIncludeSysteminformationInclude file: <glib/gstdio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
40missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
41missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
42missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
84variableScope398styleThe scope of the variable 'valid_bytes' can be reduced.
208variableScope398styleThe scope of the variable 'file' can be reduced.
src/eom-util.h
28missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-window-activatable.c
28missingIncludeinformationInclude file: "config.h" not found.
33missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-window-activatable.h
30missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/eom-window.c
29missingIncludeinformationInclude file: "config.h" not found.
32missingIncludeSysteminformationInclude file: <math.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
61missingIncludeinformationInclude file: "egg-toolbar-editor.h" not found.
62missingIncludeinformationInclude file: "egg-editable-toolbar.h" not found.
63missingIncludeinformationInclude file: "egg-toolbars-model.h" not found.
65missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
66missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
67missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
68missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
69missingIncludeSysteminformationInclude file: <gdk/gdkkeysyms.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
70missingIncludeSysteminformationInclude file: <gio/gdesktopappinfo.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
71missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
73missingIncludeSysteminformationInclude file: <libpeas/peas-extension-set.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
74missingIncludeSysteminformationInclude file: <libpeas/peas-activatable.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
77missingIncludeSysteminformationInclude file: <X11/Xlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
78missingIncludeSysteminformationInclude file: <X11/Xatom.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
80missingIncludeSysteminformationInclude file: <gdk/gdkx.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
82missingIncludeSysteminformationInclude file: <lcms2.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
86missingIncludeSysteminformationInclude file: <libmate-desktop/mate-desktop-utils.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
1852constParameterCallback398styleParameter 'event' can be declared as pointer to const. However it seems that 'fullscreen_motion_notify_cb' is a callback function, if 'event' is declared with const you might also need to cast function pointer(s).
2038constVariablePointer398styleVariable 'priv' can be declared as pointer to const
2218variableScope398styleThe scope of the variable 'dialog' can be reduced.
2386variableScope398styleThe scope of the variable 'dialog' can be reduced.
2437constVariablePointer398styleVariable 'priv' can be declared as pointer to const
3264variableScope398styleThe scope of the variable 'file' can be reduced.
3265variableScope398styleThe scope of the variable 'file_info' can be reduced.
3459variableScope398styleThe scope of the variable 'response' can be reduced.
4170variableScope398styleThe scope of the variable 'file_list' can be reduced.
4276constVariablePointer398styleVariable 'priv' can be declared as pointer to const
4907constVariablePointer398styleVariable 'priv' can be declared as pointer to const
src/eom-window.h
34missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
36missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/main.c
27missingIncludeinformationInclude file: "config.h" not found.
30missingIncludeSysteminformationInclude file: <girepository.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
41missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
42missingIncludeSysteminformationInclude file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
43missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
46missingIncludeSysteminformationInclude file: <exempi/xmp.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/zoom.c
22missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
23missingIncludeSysteminformationInclude file: <math.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/zoom.h
25missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
thumbnailer/eom-thumbnailer.c
26missingIncludeinformationInclude file: "config.h" not found.
29missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <math.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
37missingIncludeSysteminformationInclude file: <MagickWand/MagickWand.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
40missingIncludeSysteminformationInclude file: <wand/magick_wand.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/stats.html b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/stats.html new file mode 100644 index 0000000..28f47ba --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/stats.html @@ -0,0 +1,200 @@ + + + + + + Cppcheck - HTML report - eom + + + + + +
+ + + +
+

Top 10 files for error severity, total findings: 24
+   1  src/eom-uri-converter.c
+   1  src/eom-transform.c
+   1  src/eom-thumbnail.c
+   1  src/eom-thumb-view.c
+   1  src/eom-statusbar.c
+   1  src/eom-sidebar.c
+   1  src/eom-scroll-view.c
+   1  src/eom-print-preview.c
+   1  src/eom-plugin-engine.c
+   1  src/eom-metadata-sidebar.c
+

+

Top 10 files for style severity, total findings: 53
+   11  src/eom-window.c
+   9   jpegutils/transupp-6b.c
+   8   src/eom-image.c
+   6   src/eom-image-jpeg.c
+   4   src/eom-properties-dialog.c
+   4   src/eom-jobs.c
+   3   src/eom-print-image-setup.c
+   2   src/eom-util.c
+   2   src/eom-resources.c
+   2   src/eom-error-message-area.c
+

+

Top 10 files for information severity, total findings: 386
+   19  src/eom-window.c
+   14  src/eom-image.c
+   14  src/eom-image-jpeg.c
+   11  src/eom-util.c
+   10  plugins/statusbar-date/eom-statusbar-date-plugin.c
+   9   src/eom-metadata-details.c
+   8   thumbnailer/eom-thumbnailer.c
+   8   src/eom-properties-dialog.c
+   8   src/eom-metadata-sidebar.c
+   7   src/eom-thumb-nav.c
+

+ +
+ +
+ + diff --git a/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/style.css b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/style.css new file mode 100644 index 0000000..3897bfa --- /dev/null +++ b/2024-02-14-000002-0416-cppcheck@a2ffc585b0d4_master/style.css @@ -0,0 +1,177 @@ + +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; + font-size: 13px; + line-height: 1.5; + height: 100%; + margin: 0; +} + +#wrapper { + position: fixed; + height: 100vh; + width: 100vw; + display: grid; + grid-template-rows: fit-content(8rem) auto fit-content(8rem); + grid-template-columns: fit-content(25%) 1fr; + grid-template-areas: + "header header" + "menu content" + "footer footer"; +} + +h1 { + margin: 0 0 8px -2px; + font-size: 175%; +} + +.header { + padding: 0 0 5px 15px; + grid-area: header; + border-bottom: thin solid #aaa; +} + +.footer { + grid-area: footer; + border-top: thin solid #aaa; + font-size: 85%; + +} + +.footer > p { + margin: 4px; +} + +#menu, +#menu_index { + grid-area: menu; + text-align: left; + overflow: auto; + padding: 0 23px 15px 15px; + border-right: thin solid #aaa; + min-width: 200px; +} + +#menu > a { + display: block; + margin-left: 10px; + font-size: 12px; +} + +#content, +#content_index { + grid-area: content; + padding: 0px 5px 15px 15px; + overflow: auto; +} + +label { + white-space: nowrap; +} + +label.checkBtn.disabled { + color: #606060; + background: #e0e0e0; + font-style: italic; +} + +label.checkBtn, input[type="text"] { + border: 1px solid grey; + border-radius: 4px; + box-shadow: 1px 1px inset; + padding: 1px 5px; +} + +label.checkBtn { + white-space: nowrap; + background: #ccddff; +} + +label.unchecked { + background: #eff8ff; + box-shadow: 1px 1px 1px; +} + +label.checkBtn:hover, label.unchecked:hover{ + box-shadow: 0 0 2px; +} + +label.disabled:hover { + box-shadow: 1px 1px inset; +} + +label.checkBtn > input { + display:none; +} + +.summaryTable { + width: 100%; +} + +table.summaryTable td { padding: 0 5px 0 5px; } + +.statHeader, .severityHeader { + font-weight: bold; +} + +.warning { + background-color: #ffffa7; +} + +.error { + background-color: #ffb7b7; +} + +.error2 { + background-color: #faa; + display: inline-block; + margin-left: 4px; +} + +.inconclusive { + background-color: #b6b6b4; +} + +.inconclusive2 { + background-color: #b6b6b4; + display: inline-block; + margin-left: 4px; +} + +.verbose { + display: inline-block; + vertical-align: top; + cursor: help; +} + +.verbose .content { + display: none; + position: absolute; + padding: 10px; + margin: 4px; + max-width: 40%; + white-space: pre-wrap; + border: 1px solid #000; + background-color: #ffffcc; + cursor: auto; +} + +.highlight .hll { + padding: 1px; +} + +.highlighttable { + background-color: #fff; + position: relative; + margin: -10px; +} + +.linenos { + border-right: thin solid #aaa; + color: #d3d3d3; + padding-right: 6px; +} + +.id-filtered, .severity-filtered, .file-filtered, .tool-filtered, .text-filtered { + visibility: collapse; +} -- cgit v1.2.1