From 2417eddf3c141555f4b7735be5b48eed3e262793 Mon Sep 17 00:00:00 2001 From: "Colomban Wendling (via Travis CI)" Date: Wed, 14 May 2025 17:49:50 +0000 Subject: Deploy mate-desktop/mate-control-center to github.com/mate-desktop/mate-control-center.git:gh-pages --- .../0.html | 1215 +++++ .../1.html | 367 ++ .../10.html | 967 ++++ .../100.html | 311 ++ .../101.html | 2293 ++++++++ .../102.html | 463 ++ .../103.html | 383 ++ .../104.html | 1463 ++++++ .../105.html | 631 +++ .../106.html | 1749 +++++++ .../107.html | 483 ++ .../108.html | 903 ++++ .../109.html | 521 ++ .../11.html | 545 ++ .../110.html | 381 ++ .../111.html | 491 ++ .../112.html | 385 ++ .../113.html | 3301 ++++++++++++ .../114.html | 367 ++ .../115.html | 315 ++ .../116.html | 369 ++ .../117.html | 351 ++ .../118.html | 371 ++ .../119.html | 345 ++ .../12.html | 321 ++ .../120.html | 1765 +++++++ .../121.html | 265 + .../122.html | 433 ++ .../123.html | 2737 ++++++++++ .../124.html | 635 +++ .../125.html | 353 ++ .../126.html | 305 ++ .../127.html | 411 ++ .../128.html | 377 ++ .../129.html | 413 ++ .../13.html | 411 ++ .../130.html | 785 +++ .../131.html | 267 + .../132.html | 337 ++ .../133.html | 713 +++ .../134.html | 403 ++ .../135.html | 569 ++ .../136.html | 555 ++ .../137.html | 455 ++ .../138.html | 1295 +++++ .../139.html | 1455 ++++++ .../14.html | 3039 +++++++++++ .../140.html | 295 ++ .../141.html | 349 ++ .../142.html | 633 +++ .../143.html | 339 ++ .../144.html | 635 +++ .../145.html | 337 ++ .../146.html | 635 +++ .../147.html | 1607 ++++++ .../148.html | 509 ++ .../15.html | 1959 +++++++ .../16.html | 743 +++ .../17.html | 2407 +++++++++ .../18.html | 511 ++ .../19.html | 2545 +++++++++ .../2.html | 1911 +++++++ .../20.html | 497 ++ .../21.html | 1913 +++++++ .../22.html | 433 ++ .../23.html | 935 ++++ .../24.html | 1363 +++++ .../25.html | 1997 +++++++ .../26.html | 1027 ++++ .../27.html | 825 +++ .../28.html | 363 ++ .../29.html | 255 + .../3.html | 2837 ++++++++++ .../30.html | 757 +++ .../31.html | 327 ++ .../32.html | 441 ++ .../33.html | 329 ++ .../34.html | 1423 +++++ .../35.html | 377 ++ .../36.html | 845 +++ .../37.html | 521 ++ .../38.html | 619 +++ .../39.html | 3987 ++++++++++++++ .../4.html | 255 + .../40.html | 533 ++ .../41.html | 2469 +++++++++ .../42.html | 311 ++ .../43.html | 621 +++ .../44.html | 1907 +++++++ .../45.html | 437 ++ .../46.html | 1009 ++++ .../47.html | 369 ++ .../48.html | 801 +++ .../49.html | 951 ++++ .../5.html | 1415 +++++ .../50.html | 3231 ++++++++++++ .../51.html | 497 ++ .../52.html | 911 ++++ .../53.html | 5517 ++++++++++++++++++++ .../54.html | 427 ++ .../55.html | 1511 ++++++ .../56.html | 1721 ++++++ .../57.html | 413 ++ .../58.html | 903 ++++ .../59.html | 4257 +++++++++++++++ .../6.html | 1339 +++++ .../60.html | 301 ++ .../61.html | 881 ++++ .../62.html | 2153 ++++++++ .../63.html | 799 +++ .../64.html | 429 ++ .../65.html | 1175 +++++ .../66.html | 1335 +++++ .../67.html | 947 ++++ .../68.html | 1299 +++++ .../69.html | 521 ++ .../7.html | 299 ++ .../70.html | 643 +++ .../71.html | 2107 ++++++++ .../72.html | 1191 +++++ .../73.html | 309 ++ .../74.html | 487 ++ .../75.html | 1073 ++++ .../76.html | 1239 +++++ .../77.html | 503 ++ .../78.html | 283 + .../79.html | 319 ++ .../8.html | 555 ++ .../80.html | 307 ++ .../81.html | 1123 ++++ .../82.html | 1787 +++++++ .../83.html | 251 + .../84.html | 851 +++ .../85.html | 375 ++ .../86.html | 405 ++ .../87.html | 969 ++++ .../88.html | 1505 ++++++ .../89.html | 339 ++ .../9.html | 801 +++ .../90.html | 827 +++ .../91.html | 1671 ++++++ .../92.html | 381 ++ .../93.html | 1061 ++++ .../94.html | 1621 ++++++ .../95.html | 1561 ++++++ .../96.html | 375 ++ .../97.html | 307 ++ .../98.html | 341 ++ .../99.html | 925 ++++ .../index.html | 1327 +++++ .../stats.html | 209 + .../style.css | 177 + 152 files changed, 144904 insertions(+) create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/0.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/1.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/10.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/100.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/101.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/102.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/103.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/104.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/105.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/106.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/107.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/108.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/109.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/11.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/110.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/111.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/112.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/113.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/114.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/115.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/116.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/117.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/118.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/119.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/12.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/120.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/121.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/122.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/123.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/124.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/125.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/126.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/127.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/128.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/129.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/13.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/130.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/131.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/132.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/133.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/134.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/135.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/136.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/137.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/138.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/139.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/14.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/140.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/141.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/142.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/143.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/144.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/145.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/146.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/147.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/148.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/15.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/16.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/17.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/18.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/19.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/2.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/20.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/21.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/22.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/23.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/24.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/25.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/26.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/27.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/28.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/29.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/3.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/30.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/31.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/32.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/33.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/34.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/35.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/36.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/37.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/38.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/39.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/4.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/40.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/41.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/42.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/43.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/44.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/45.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/46.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/47.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/48.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/49.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/5.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/50.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/51.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/52.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/53.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/54.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/55.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/56.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/57.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/58.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/59.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/6.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/60.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/61.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/62.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/63.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/64.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/65.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/66.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/67.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/68.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/69.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/7.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/70.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/71.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/72.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/73.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/74.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/75.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/76.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/77.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/78.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/79.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/8.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/80.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/81.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/82.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/83.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/84.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/85.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/86.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/87.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/88.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/89.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/9.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/90.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/91.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/92.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/93.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/94.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/95.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/96.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/97.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/98.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/99.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/index.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/stats.html create mode 100644 2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/style.css (limited to '2024-04-01-013612-3018-cppcheck@9c2e88747e09_master') diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/0.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/0.html new file mode 100644 index 00000000..6fa038ef --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/0.html @@ -0,0 +1,1215 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* e-image-chooser.c
+ * Copyright (C) 2004  Novell, Inc.
+ * Author: Chris Toshok <toshok@ximian.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * 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 library; 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 <string.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 <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "e-image-chooser.h"
+
+typedef struct _EImageChooserPrivate EImageChooserPrivate;
+struct _EImageChooserPrivate {
+
+	GtkWidget *image;
+
+	char *image_buf;
+	int   image_buf_size;
+	int   width;
+	int   height;
+
+	gboolean editable;
+	gboolean scaleable;
+};
+
+enum {
+	CHANGED,
+	LAST_SIGNAL
+};
+
+enum {
+    PROP_0,
+    PROP_WIDTH,
+    PROP_HEIGHT,
+    NUM_PROPERTIES
+};
+
+static GParamSpec *properties[NUM_PROPERTIES] = { NULL, };
+static guint image_chooser_signals [LAST_SIGNAL] = { 0 };
+
+static void e_image_chooser_dispose      (GObject *object);
+
+static gboolean image_drag_motion_cb (GtkWidget *widget,
+				      GdkDragContext *context,
+				      gint x, gint y, guint time, EImageChooser *chooser);
+static gboolean image_drag_drop_cb (GtkWidget *widget,
+				    GdkDragContext *context,
+				    gint x, gint y, guint time, EImageChooser *chooser);
+static void image_drag_data_received_cb (GtkWidget *widget,
+					 GdkDragContext *context,
+					 gint x, gint y,
+					 GtkSelectionData *selection_data,
+					 guint info, guint time, EImageChooser *chooser);
+
+G_DEFINE_TYPE_WITH_PRIVATE (EImageChooser, e_image_chooser, GTK_TYPE_BOX);
+
+enum DndTargetType {
+	DND_TARGET_TYPE_URI_LIST
+};
+#define URI_LIST_TYPE "text/uri-list"
+
+static GtkTargetEntry image_drag_types[] = {
+	{ URI_LIST_TYPE, 0, DND_TARGET_TYPE_URI_LIST },
+};
+static const int num_image_drag_types = sizeof (image_drag_types) / sizeof (image_drag_types[0]);
+
+GtkWidget *
+e_image_chooser_new (void)
+{
+	return g_object_new (E_TYPE_IMAGE_CHOOSER, "orientation", GTK_ORIENTATION_VERTICAL, NULL);
+}
+
+GtkWidget *e_image_chooser_new_with_size (int width, int height)
+{
+	return g_object_new (E_TYPE_IMAGE_CHOOSER,
+			"width", width,
+			"height", height,
+			"orientation", GTK_ORIENTATION_VERTICAL, NULL);
+}
+
+static void
+e_image_chooser_set_property (GObject      *object,
+			guint         prop_id,
+			const GValue *value,
+			GParamSpec   *pspec)
+{
+	EImageChooserPrivate *priv;
+
+	priv = e_image_chooser_get_instance_private (E_IMAGE_CHOOSER (object));
+
+	switch (prop_id)
+	{
+		case PROP_WIDTH:
+			priv->width = g_value_get_int (value);
+			priv->scaleable = FALSE;
+			break;
+		case PROP_HEIGHT:
+			priv->height = g_value_get_int (value);
+			priv->scaleable = FALSE;
+			break;
+		default:
+			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+			break;
+	}
+}
+
+static void
+e_image_chooser_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+{
+	EImageChooserPrivate *priv;
+
+	priv = e_image_chooser_get_instance_private (E_IMAGE_CHOOSER (object));
+
+	switch (prop_id)
+	{
+		case PROP_WIDTH:
+			g_value_set_int (value, priv->width);
+			break;
+		case PROP_HEIGHT:
+			g_value_set_int (value, priv->height);
+			break;
+		default:
+			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+			break;
+	}
+}
+
+static void
+e_image_chooser_class_init (EImageChooserClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	object_class->dispose = e_image_chooser_dispose;
+	object_class->set_property = e_image_chooser_set_property;
+	object_class->get_property = e_image_chooser_get_property;
+
+	image_chooser_signals [CHANGED] =
+		g_signal_new ("changed",
+			      G_OBJECT_CLASS_TYPE (object_class),
+			      G_SIGNAL_RUN_FIRST,
+			      G_STRUCT_OFFSET (EImageChooserClass, changed),
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE, 0);
+	properties[PROP_WIDTH] =
+		g_param_spec_int ("width",
+				"Chooser width",
+				"Chooser width to show image",
+				0, G_MAXINT,
+				32,
+				G_PARAM_READWRITE);
+	properties[PROP_HEIGHT] =
+		g_param_spec_int ("height",
+				"Chooser height",
+				"Chooser height to show image",
+				0, G_MAXINT,
+				32,
+				G_PARAM_READWRITE);
+
+	g_object_class_install_properties (object_class, NUM_PROPERTIES, properties);
+}
+
+static void
+e_image_chooser_init (EImageChooser *chooser)
+{
+	EImageChooserPrivate *priv;
+
+	priv = e_image_chooser_get_instance_private (chooser);
+
+	priv->image = gtk_image_new ();
+	priv->scaleable = TRUE;
+
+	gtk_box_set_homogeneous (GTK_BOX (chooser), FALSE);
+	gtk_box_pack_start (GTK_BOX (chooser), priv->image, TRUE, TRUE, 0);
+
+	gtk_drag_dest_set (priv->image, 0, image_drag_types, num_image_drag_types, GDK_ACTION_COPY);
+	g_signal_connect (priv->image,
+			  "drag_motion", G_CALLBACK (image_drag_motion_cb), chooser);
+	g_signal_connect (priv->image,
+			  "drag_drop", G_CALLBACK (image_drag_drop_cb), chooser);
+	g_signal_connect (priv->image,
+			  "drag_data_received", G_CALLBACK (image_drag_data_received_cb), chooser);
+
+	gtk_widget_show_all (priv->image);
+
+	/* we default to being editable */
+	priv->editable = TRUE;
+}
+
+static void
+e_image_chooser_dispose (GObject *object)
+{
+	EImageChooserPrivate *priv;
+
+	priv = e_image_chooser_get_instance_private (E_IMAGE_CHOOSER (object));
+
+	if (priv->image_buf) {
+		g_free (priv->image_buf);
+		priv->image_buf = NULL;
+	}
+
+	if (G_OBJECT_CLASS (e_image_chooser_parent_class)->dispose)
+		(* G_OBJECT_CLASS (e_image_chooser_parent_class)->dispose) (object);
+}
+
+static gboolean
+set_image_from_data (EImageChooser *chooser,
+		     char *data, int length)
+{
+	gboolean rv = FALSE;
+	GdkPixbufLoader *loader = gdk_pixbuf_loader_new ();
+	GdkPixbuf *pixbuf;
+	EImageChooserPrivate *priv;
+
+	priv = e_image_chooser_get_instance_private (chooser);
+
+	gdk_pixbuf_loader_write (loader, (guchar *) data, length, NULL);
+	gdk_pixbuf_loader_close (loader, NULL);
+
+	pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
+	if (pixbuf)
+		g_object_ref (pixbuf);
+	g_object_unref (loader);
+
+	if (pixbuf) {
+		GdkPixbuf *scaled;
+		if (priv->scaleable) {
+			gtk_image_set_from_pixbuf (GTK_IMAGE (priv->image), pixbuf);
+		} else {
+			scaled = gdk_pixbuf_scale_simple (pixbuf,
+							  priv->width, priv->height,
+							  GDK_INTERP_BILINEAR);
+
+			gtk_image_set_from_pixbuf (GTK_IMAGE (priv->image), scaled);
+			g_object_unref (scaled);
+		}
+
+		g_object_unref (pixbuf);
+
+		g_free (priv->image_buf);
+		priv->image_buf = data;
+		priv->image_buf_size = length;
+
+		g_signal_emit (chooser,
+			       image_chooser_signals [CHANGED], 0);
+
+		rv = TRUE;
+	}
+
+	return rv;
+}
+
+static gboolean
+image_drag_motion_cb (GtkWidget *widget,
+		      GdkDragContext *context,
+		      gint x, gint y, guint time, EImageChooser *chooser)
+{
+	GList *p;
+	EImageChooserPrivate *priv;
+
+	priv = e_image_chooser_get_instance_private (chooser);
+
+	if (!priv->editable)
+		return FALSE;
+
+	for (p = gdk_drag_context_list_targets (context); p; p = p->next) {
+		char *possible_type;
+
+		possible_type = gdk_atom_name (GDK_POINTER_TO_ATOM (p->data));
+		if (!strcmp (possible_type, URI_LIST_TYPE)) {
+			g_free (possible_type);
+			gdk_drag_status (context, GDK_ACTION_COPY, time);
+			return TRUE;
+		}
+
+		g_free (possible_type);
+	}
+
+	return FALSE;
+}
+
+static gboolean
+image_drag_drop_cb (GtkWidget *widget,
+		    GdkDragContext *context,
+		    gint x, gint y, guint time, EImageChooser *chooser)
+{
+	GList *p;
+	EImageChooserPrivate *priv;
+
+	priv = e_image_chooser_get_instance_private (chooser);
+
+	if (!priv->editable)
+		return FALSE;
+
+	if (gdk_drag_context_list_targets (context) == NULL) {
+		return FALSE;
+	}
+
+	for (p = gdk_drag_context_list_targets (context); p; p = p->next) {
+		char *possible_type;
+
+		possible_type = gdk_atom_name (GDK_POINTER_TO_ATOM (p->data));
+		if (!strcmp (possible_type, URI_LIST_TYPE)) {
+			g_free (possible_type);
+			gtk_drag_get_data (widget, context,
+					   GDK_POINTER_TO_ATOM (p->data),
+					   time);
+			return TRUE;
+		}
+
+		g_free (possible_type);
+	}
+
+	return FALSE;
+}
+
+static void
+image_drag_data_received_cb (GtkWidget *widget,
+			     GdkDragContext *context,
+			     gint x, gint y,
+			     GtkSelectionData *selection_data,
+			     guint info, guint time, EImageChooser *chooser)<--- Shadowed declaration
+{
+	char *target_type;<--- Variable 'target_type' can be declared as pointer to const
+	gboolean handled = FALSE;
+
+	target_type = gdk_atom_name (gtk_selection_data_get_target (selection_data));
+
+	if (!strcmp (target_type, URI_LIST_TYPE)) {
+		const char *data = (const char *) gtk_selection_data_get_data (selection_data);
+		char *uri;
+		GFile *file;
+		GInputStream *istream;
+		char *nl = strstr (data, "\r\n");<--- Variable 'nl' can be declared as pointer to const
+
+		if (nl)
+			uri = g_strndup (data, nl - (char *) data);
+		else
+			uri = g_strdup (data);
+
+		file = g_file_new_for_uri (uri);
+		istream = G_INPUT_STREAM (g_file_read (file, NULL, NULL));
+
+		if (istream != NULL) {
+			GFileInfo *info;<--- Shadow variable
+
+			info = g_file_query_info (file,
+						  G_FILE_ATTRIBUTE_STANDARD_SIZE,
+						  G_FILE_QUERY_INFO_NONE,
+						  NULL, NULL);
+
+			if (info != NULL) {
+				gsize size;
+				gboolean success;
+				gchar *buf;
+
+				size = g_file_info_get_size (info);
+				g_object_unref (info);
+
+				buf = g_malloc (size);
+
+				success = g_input_stream_read_all (istream,
+								   buf,
+								   size,
+								   &size,
+								   NULL,
+								   NULL);
+				g_input_stream_close (istream, NULL, NULL);
+
+				if (success &&
+						set_image_from_data (chooser, buf, size))
+					handled = TRUE;
+				else
+					g_free (buf);
+			}
+
+			g_object_unref (istream);
+		}
+
+		g_object_unref (file);
+		g_free (uri);
+	}
+
+	gtk_drag_finish (context, handled, FALSE, time);
+}
+
+gboolean
+e_image_chooser_set_from_file (EImageChooser *chooser, const char *filename)
+{
+	gchar *data;
+	gsize data_length;
+
+	g_return_val_if_fail (E_IS_IMAGE_CHOOSER (chooser), FALSE);
+	g_return_val_if_fail (filename, FALSE);
+
+	if (!g_file_get_contents (filename, &data, &data_length, NULL)) {
+		return FALSE;
+	}
+
+	if (!set_image_from_data (chooser, data, data_length))
+		g_free (data);
+
+	return TRUE;
+}
+
+void
+e_image_chooser_set_editable (EImageChooser *chooser, gboolean editable)
+{
+	g_return_if_fail (E_IS_IMAGE_CHOOSER (chooser));
+	EImageChooserPrivate *priv;
+
+	priv = e_image_chooser_get_instance_private (chooser);
+
+	priv->editable = editable;
+}
+
+void
+e_image_chooser_set_scaleable  (EImageChooser *chooser, gboolean scaleable)
+{
+	g_return_if_fail (E_IS_IMAGE_CHOOSER (chooser));
+	EImageChooserPrivate *priv;
+
+	priv = e_image_chooser_get_instance_private (chooser);
+
+	priv->scaleable = scaleable;
+}
+
+gboolean
+e_image_chooser_get_image_data (EImageChooser *chooser, char **data, gsize *data_length)
+{
+	g_return_val_if_fail (E_IS_IMAGE_CHOOSER (chooser), FALSE);
+	g_return_val_if_fail (data != NULL, FALSE);
+	g_return_val_if_fail (data_length != NULL, FALSE);
+	EImageChooserPrivate *priv;
+
+	priv = e_image_chooser_get_instance_private (chooser);
+
+	*data_length = priv->image_buf_size;
+	*data = g_malloc (*data_length);
+	memcpy (*data, priv->image_buf, *data_length);
+
+	return TRUE;
+}
+
+gboolean
+e_image_chooser_set_image_data (EImageChooser *chooser, char *data, gsize data_length)<--- Parameter 'data' can be declared as pointer to const
+{
+	char *buf;
+
+	g_return_val_if_fail (E_IS_IMAGE_CHOOSER (chooser), FALSE);
+	g_return_val_if_fail (data != NULL, FALSE);
+
+	/* yuck, a copy... */
+	buf = g_malloc (data_length);
+	memcpy (buf, data, data_length);
+
+	if (!set_image_from_data (chooser, buf, data_length)) {
+		g_free (buf);
+		return FALSE;
+	}
+
+	return TRUE;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/1.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/1.html new file mode 100644 index 00000000..733f0ae0 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/1.html @@ -0,0 +1,367 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* e-image-chooser.c
+ * Copyright (C) 2004  Novell, Inc.
+ * Author: Chris Toshok <toshok@ximian.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * 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 library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _E_IMAGE_CHOOSER_H_
+#define _E_IMAGE_CHOOSER_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 E_TYPE_IMAGE_CHOOSER	        (e_image_chooser_get_type ())
+#define E_IMAGE_CHOOSER(obj)	        (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_IMAGE_CHOOSER, EImageChooser))
+#define E_IMAGE_CHOOSER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_IMAGE_CHOOSER, EImageChooserClass))
+#define E_IS_IMAGE_CHOOSER(obj)	        (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_IMAGE_CHOOSER))
+#define E_IS_IMAGE_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_IMAGE_CHOOSER))
+
+typedef struct _EImageChooser        EImageChooser;
+typedef struct _EImageChooserClass   EImageChooserClass;
+
+struct _EImageChooser
+{
+	GtkBox parent;
+};
+
+struct _EImageChooserClass
+{
+	GtkBoxClass parent_class;
+
+	/* signals */
+	void (*changed) (EImageChooser *chooser);
+
+
+};
+
+GtkWidget *e_image_chooser_new            (void);
+GtkWidget *e_image_chooser_new_with_size  (int width, int height);
+GType      e_image_chooser_get_type       (void);
+
+gboolean   e_image_chooser_set_from_file  (EImageChooser *chooser, const char *filename);
+gboolean   e_image_chooser_set_image_data (EImageChooser *chooser, char *data, gsize data_length);
+void       e_image_chooser_set_editable   (EImageChooser *chooser, gboolean editable);
+void       e_image_chooser_set_scaleable  (EImageChooser *chooser, gboolean scaleable);
+
+gboolean   e_image_chooser_get_image_data (EImageChooser *chooser, char **data, gsize *data_length);
+
+G_END_DECLS
+
+#endif /* _E_IMAGE_CHOOSER_H_ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/10.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/10.html new file mode 100644 index 00000000..4c57cc1a --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/10.html @@ -0,0 +1,967 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
#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.accessibility"), aligned (8)))
+#else
+# define SECTION
+#endif
+
+static const SECTION union { const guint8 data[2528]; const double alignment; void * const ptr;}  accessibility_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, 0344, 0000, 0000, 0000, 0000, 0000, 0000, 0050, 0007, 0000, 0000, 0000, 
+  0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0001, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 
+  0003, 0000, 0000, 0000, 0004, 0000, 0000, 0000, 0004, 0000, 0000, 0000, 0113, 0120, 0220, 0013, 
+  0002, 0000, 0000, 0000, 0344, 0000, 0000, 0000, 0004, 0000, 0114, 0000, 0350, 0000, 0000, 0000, 
+  0354, 0000, 0000, 0000, 0232, 0215, 0006, 0232, 0004, 0000, 0000, 0000, 0354, 0000, 0000, 0000, 
+  0016, 0000, 0114, 0000, 0374, 0000, 0000, 0000, 0000, 0001, 0000, 0000, 0324, 0265, 0002, 0000, 
+  0377, 0377, 0377, 0377, 0000, 0001, 0000, 0000, 0001, 0000, 0114, 0000, 0004, 0001, 0000, 0000, 
+  0010, 0001, 0000, 0000, 0201, 0321, 0040, 0031, 0000, 0000, 0000, 0000, 0010, 0001, 0000, 0000, 
+  0005, 0000, 0114, 0000, 0020, 0001, 0000, 0000, 0024, 0001, 0000, 0000, 0143, 0041, 0175, 0170, 
+  0003, 0000, 0000, 0000, 0024, 0001, 0000, 0000, 0004, 0000, 0114, 0000, 0030, 0001, 0000, 0000, 
+  0034, 0001, 0000, 0000, 0036, 0213, 0355, 0361, 0001, 0000, 0000, 0000, 0034, 0001, 0000, 0000, 
+  0003, 0000, 0114, 0000, 0040, 0001, 0000, 0000, 0044, 0001, 0000, 0000, 0160, 0224, 0217, 0210, 
+  0005, 0000, 0000, 0000, 0044, 0001, 0000, 0000, 0023, 0000, 0166, 0000, 0070, 0001, 0000, 0000, 
+  0337, 0011, 0000, 0000, 0157, 0162, 0147, 0057, 0003, 0000, 0000, 0000, 0141, 0143, 0143, 0145, 
+  0163, 0163, 0151, 0142, 0151, 0154, 0151, 0164, 0171, 0057, 0000, 0000, 0005, 0000, 0000, 0000, 
+  0057, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0155, 0141, 0164, 0145, 0057, 0000, 0000, 0000, 
+  0004, 0000, 0000, 0000, 0155, 0143, 0143, 0057, 0001, 0000, 0000, 0000, 0141, 0164, 0057, 0000, 
+  0006, 0000, 0000, 0000, 0141, 0164, 0055, 0145, 0156, 0141, 0142, 0154, 0145, 0055, 0144, 0151, 
+  0141, 0154, 0157, 0147, 0056, 0165, 0151, 0000, 0266, 0133, 0000, 0000, 0001, 0000, 0000, 0000, 
+  0170, 0332, 0355, 0134, 0335, 0163, 0032, 0071, 0022, 0177, 0347, 0257, 0350, 0233, 0247, 0335, 
+  0072, 0217, 0155, 0310, 0345, 0066, 0225, 0330, 0336, 0042, 0336, 0070, 0361, 0235, 0023, 0273, 
+  0154, 0134, 0251, 0074, 0121, 0142, 0106, 0200, 0326, 0142, 0304, 0112, 0302, 0230, 0373, 0353, 
+  0257, 0065, 0063, 0206, 0001, 0004, 0363, 0231, 0065, 0266, 0347, 0015, 0006, 0251, 0107, 0375, 
+  0123, 0177, 0267, 0320, 0321, 0357, 0017, 0043, 0016, 0367, 0124, 0052, 0046, 0202, 0143, 0247, 
+  0271, 0177, 0350, 0000, 0015, 0074, 0341, 0263, 0140, 0160, 0354, 0334, 0166, 0316, 0334, 0167, 
+  0316, 0357, 0047, 0215, 0243, 0177, 0270, 0056, 0174, 0246, 0001, 0225, 0104, 0123, 0037, 0246, 
+  0114, 0017, 0141, 0300, 0211, 0117, 0341, 0315, 0176, 0253, 0265, 0177, 0010, 0215, 0006, 0321, 
+  0056, 0015, 0110, 0217, 0123, 0327, 0147, 0204, 0213, 0001, 0270, 0020, 0175, 0007, 0242, 0041, 
+  0176, 0064, 0145, 0201, 0057, 0246, 0215, 0123, 0061, 0236, 0111, 0066, 0030, 0152, 0370, 0345, 
+  0364, 0127, 0370, 0332, 0356, 0174, 0202, 0077, 0350, 0075, 0345, 0142, 0214, 0353, 0150, 0064, 
+  0072, 0103, 0246, 0140, 0054, 0305, 0100, 0222, 0021, 0340, 0307, 0276, 0244, 0024, 0224, 0350, 
+  0353, 0051, 0221, 0364, 0003, 0314, 0304, 0004, 0074, 0022, 0200, 0244, 0076, 0123, 0132, 0262, 
+  0336, 0104, 0123, 0140, 0032, 0110, 0340, 0037, 0010, 0331, 0030, 0341, 0332, 0373, 0063, 0363, 
+  0140, 0022, 0370, 0124, 0202, 0036, 0122, 0320, 0124, 0216, 0024, 0210, 0176, 0370, 0345, 0363, 
+  0267, 0333, 0230, 0025, 0016, 0127, 0223, 0036, 0147, 0036, 0134, 0060, 0217, 0006, 0212, 0066, 
+  0010, 0276, 0327, 0074, 0121, 0103, 0144, 0262, 0067, 0013, 0207, 0237, 0231, 0267, 0337, 0304, 
+  0157, 0207, 0063, 0201, 0124, 0211, 0106, 0260, 0076, 0000, 0105, 0024, 0360, 0005, 0061, 0170, 
+  0320, 0152, 0304, 0057, 0210, 0251, 0355, 0201, 0220, 0360, 0013, 0062, 0217, 0013, 0226, 0040, 
+  0306, 0146, 0322, 0257, 0270, 0312, 0031, 0160, 0004, 0161, 0076, 0157, 0177, 0235, 0341, 0005, 
+  0137, 0076, 0260, 0040, 0244, 0071, 0104, 0154, 0360, 0003, 0122, 0103, 0306, 0246, 0214, 0163, 
+  0350, 0121, 0230, 0050, 0332, 0237, 0360, 0275, 0006, 0216, 0204, 0357, 0347, 0235, 0057, 0227, 
+  0267, 0035, 0150, 0177, 0373, 0001, 0337, 0333, 0327, 0327, 0355, 0157, 0235, 0037, 0037, 0302, 
+  0215, 0022, 0370, 0053, 0242, 0033, 0321, 0141, 0243, 0061, 0147, 0146, 0007, 0211, 0224, 0044, 
+  0320, 0063, 0004, 0245, 0361, 0365, 0323, 0365, 0351, 0027, 0034, 0337, 0376, 0170, 0176, 0161, 
+  0336, 0371, 0141, 0226, 0175, 0166, 0336, 0371, 0366, 0351, 0346, 0006, 0316, 0056, 0257, 0241, 
+  0015, 0127, 0355, 0353, 0316, 0371, 0351, 0355, 0105, 0373, 0032, 0256, 0156, 0257, 0257, 0056, 
+  0157, 0076, 0355, 0003, 0334, 0120, 0263, 0040, 0332, 0330, 0014, 0047, 0364, 0221, 0322, 0110, 
+  0040, 0152, 0076, 0325, 0204, 0161, 0205, 0254, 0376, 0300, 0315, 0123, 0270, 0044, 0356, 0303, 
+  0220, 0334, 0123, 0334, 0104, 0217, 0262, 0173, 0134, 0020, 0001, 0017, 0245, 0042, 0313, 0036, 
+  0161, 0021, 0014, 0042, 0011, 0324, 0011, 0334, 0076, 0000, 0353, 0103, 0040, 0364, 0036, 0114, 
+  0045, 0103, 0201, 0320, 0142, 0175, 0367, 0032, 0213, 0335, 0333, 0203, 0363, 0300, 0333, 0337, 
+  0203, 0267, 0115, 0034, 0102, 0202, 0073, 0216, 0070, 0337, 0150, 0034, 0214, 0004, 0316, 0130, 
+  0037, 0211, 0237, 0161, 0041, 0344, 0036, 0174, 0024, 0112, 0233, 0341, 0137, 0333, 0000, 0207, 
+  0255, 0146, 0363, 0320, 0155, 0276, 0071, 0154, 0356, 0301, 0355, 0115, 0033, 0331, 0151, 0117, 
+  0020, 0137, 0371, 0036, 0276, 0013, 0336, 0037, 0020, 0134, 0327, 0055, 0357, 0111, 0346, 0015, 
+  0033, 0015, 0327, 0105, 0255, 0141, 0001, 0156, 0164, 0237, 0170, 0364, 0244, 0001, 0160, 0044, 
+  0351, 0137, 0023, 0046, 0251, 0002, 0316, 0172, 0307, 0316, 0100, 0337, 0375, 0323, 0131, 0150, 
+  0236, 0321, 0043, 0347, 0040, 0034, 0147, 0164, 0155, 0076, 0323, 0345, 0021, 0337, 0256, 0236, 
+  0241, 0004, 0014, 0306, 0374, 0276, 0005, 0206, 0366, 0332, 0270, 0200, 0214, 0214, 0252, 0255, 
+  0052, 0241, 0155, 0250, 0117, 0225, 0047, 0131, 0050, 0220, 0233, 0164, 0324, 0076, 0321, 0233, 
+  0053, 0356, 0212, 0322, 0332, 0207, 0223, 0020, 0035, 0265, 0206, 0316, 0343, 0150, 0321, 0373, 
+  0223, 0172, 0032, 0074, 0116, 0224, 0072, 0166, 0076, 0353, 0273, 0363, 0021, 0031, 0120, 0007, 
+  0230, 0177, 0354, 0170, 0134, 0050, 0332, 0305, 0005, 0241, 0370, 0166, 0121, 0300, 0161, 0023, 
+  0272, 0154, 0064, 0160, 0314, 0104, 0234, 0212, 0273, 0216, 0357, 0105, 0371, 0065, 0154, 0037, 
+  0073, 0367, 0114, 0061, 0144, 0303, 0071, 0351, 0310, 0011, 0075, 0072, 0170, 0374, 0325, 0076, 
+  0030, 0215, 0107, 0267, 0057, 0274, 0211, 0162, 0116, 0316, 0010, 0127, 0251, 0343, 0231, 0207, 
+  0357, 0066, 0037, 0235, 0023, 0062, 0106, 0365, 0361, 0102, 0011, 0162, 0351, 0003, 0323, 0313, 
+  0123, 0217, 0016, 0042, 0216, 0122, 0231, 0033, 0122, 0076, 0136, 0060, 0145, 0036, 0077, 0055, 
+  0133, 0146, 0075, 0156, 0117, 0212, 0251, 0242, 0262, 0040, 0113, 0167, 0164, 0326, 0023, 0104, 
+  0372, 0273, 0263, 0127, 0003, 0341, 0376, 0071, 0031, 0215, 0013, 0362, 0203, 0222, 0307, 0202, 
+  0227, 0302, 0314, 0110, 0240, 0253, 0170, 0051, 0314, 0214, 0045, 0355, 0277, 0024, 0136, 0042, 
+  0143, 0333, 0215, 0214, 0335, 0316, 0360, 0024, 0255, 0312, 0015, 0127, 0225, 0207, 0261, 0077, 
+  0102, 0017, 0022, 0161, 0106, 0164, 0067, 0236, 0310, 0250, 0352, 0106, 0276, 0145, 0003, 0133, 
+  0261, 0151, 0325, 0356, 0142, 0102, 0354, 0276, 0252, 0346, 0261, 0047, 0044, 0206, 0204, 0335, 
+  0051, 0363, 0365, 0320, 0071, 0171, 0233, 0066, 0134, 0063, 0215, 0150, 0203, 0306, 0000, 0101, 
+  0141, 0314, 0146, 0034, 0345, 0261, 0063, 0243, 0370, 0266, 0266, 0122, 0030, 0243, 0141, 0340, 
+  0002, 0035, 0352, 0015, 0003, 0141, 0254, 0005, 0072, 0366, 0053, 0024, 0115, 0052, 0061, 0176, 
+  0246, 0052, 0215, 0066, 0306, 0001, 0354, 0177, 0044, 0334, 0315, 0114, 0113, 0067, 0356, 0277, 
+  0073, 0104, 0337, 0352, 0234, 0154, 0300, 0306, 0033, 0062, 0356, 0107, 0336, 0067, 0040, 0334, 
+  0015, 0277, 0242, 0314, 0364, 0304, 0103, 0214, 0273, 0155, 0313, 0076, 0342, 0257, 0341, 0176, 
+  0105, 0104, 0135, 0063, 0274, 0071, 0037, 0237, 0123, 0004, 0213, 0154, 0221, 0155, 0216, 0220, 
+  0214, 0006, 0072, 0364, 0262, 0316, 0311, 0275, 0221, 0010, 0217, 0360, 0054, 0023, 0325, 0230, 
+  0170, 0230, 0270, 0070, 0047, 0055, 0353, 0150, 0073, 0102, 0304, 0063, 0057, 0352, 0142, 0174, 
+  0110, 0022, 0214, 0133, 0301, 0012, 0025, 0164, 0025, 0262, 0304, 0374, 0346, 0022, 0201, 0002, 
+  0350, 0025, 0105, 0320, 0066, 0217, 0223, 0231, 0211, 0235, 0224, 0236, 0231, 0067, 0322, 0300, 
+  0337, 0070, 0061, 0004, 0142, 0371, 0331, 0146, 0366, 0347, 0352, 0235, 0010, 0142, 0234, 0325, 
+  0311, 0266, 0325, 0364, 0050, 0267, 0352, 0122, 0367, 0013, 0022, 0332, 0264, 0266, 0302, 0050, 
+  0246, 0040, 0131, 0144, 0252, 0117, 0373, 0144, 0302, 0165, 0376, 0311, 0161, 0222, 0243, 0026, 
+  0024, 0266, 0156, 0244, 0325, 0072, 0107, 0121, 0342, 0132, 0340, 0230, 0207, 0206, 0211, 0001, 
+  0302, 0234, 0030, 0223, 0235, 0124, 0364, 0222, 0226, 0176, 0231, 0050, 0361, 0356, 0120, 0307, 
+  0322, 0137, 0107, 0037, 0306, 0230, 0222, 0027, 0340, 0265, 0217, 0351, 0155, 0201, 0151, 0143, 
+  0241, 0130, 0144, 0062, 0016, 0267, 0261, 0145, 0135, 0377, 0321, 0201, 0105, 0007, 0012, 0352, 
+  0205, 0045, 0163, 0051, 0245, 0037, 0247, 0206, 0236, 0251, 0156, 0100, 0367, 0002, 0363, 0263, 
+  0313, 0211, 0376, 0133, 0224, 0105, 0141, 0326, 0311, 0214, 0213, 0053, 0260, 0025, 0317, 0137, 
+  0321, 0066, 0244, 0237, 0265, 0272, 0131, 0324, 0255, 0271, 0003, 0352, 0126, 0205, 0037, 0072, 
+  0135, 0217, 0167, 0137, 0230, 0043, 0032, 0022, 0265, 0013, 0312, 0265, 0041, 0353, 0251, 0225, 
+  0313, 0242, 0134, 0255, 0052, 0224, 0313, 0006, 0200, 0235, 0371, 0102, 0214, 0027, 0140, 0172, 
+  0215, 0141, 0134, 0114, 0327, 0344, 0070, 0333, 0043, 0325, 0274, 0056, 0337, 0002, 0321, 0032, 
+  0074, 0353, 0166, 0147, 0113, 0232, 0264, 0232, 0037, 0075, 0171, 0224, 0237, 0222, 0322, 0226, 
+  0116, 0261, 0266, 0246, 0131, 0315, 0167, 0245, 0163, 0212, 0107, 0140, 0321, 0222, 0253, 0311, 
+  0170, 0054, 0244, 0356, 0366, 0145, 0130, 0020, 0370, 0133, 0314, 0157, 0156, 0315, 0314, 0005, 
+  0334, 0146, 0044, 0062, 0210, 0131, 0313, 0261, 0115, 0052, 0001, 0103, 0131, 0050, 0052, 0201, 
+  0143, 0253, 0074, 0375, 0073, 0165, 0346, 0106, 0060, 0355, 0200, 0136, 0104, 0336, 0076, 0054, 
+  0350, 0232, 0217, 0377, 0162, 0066, 0315, 0055, 0211, 0153, 0025, 0330, 0332, 0075, 0066, 0147, 
+  0003, 0204, 0126, 0151, 0042, 0165, 0021, 0002, 0233, 0343, 0035, 0173, 0015, 0053, 0323, 0073, 
+  0210, 0216, 0373, 0223, 0152, 0363, 0240, 0344, 0260, 0170, 0055, 0123, 0152, 0172, 0107, 0016, 
+  0334, 0023, 0076, 0011, 0115, 0027, 0367, 0243, 0226, 0327, 0206, 0371, 0007, 0351, 0357, 0331, 
+  0344, 0332, 0323, 0135, 0174, 0151, 0127, 0137, 0322, 0345, 0227, 0112, 0143, 0123, 0102, 0200, 
+  0255, 0161, 0166, 0121, 0135, 0232, 0033, 0247, 0341, 0026, 0343, 0264, 0263, 0212, 0264, 0360, 
+  0131, 0255, 0114, 0323, 0267, 0202, 0143, 0007, 0050, 0121, 0327, 0107, 0157, 0026, 0065, 0126, 
+  0227, 0332, 0173, 0077, 0015, 0260, 0252, 0100, 0263, 0056, 0046, 0257, 0005, 0112, 0127, 0312, 
+  0154, 0212, 0131, 0211, 0162, 0126, 0240, 0240, 0245, 0225, 0064, 0203, 0242, 0246, 0052, 0153, 
+  0121, 0231, 0134, 0212, 0050, 0336, 0074, 0147, 0071, 0034, 0076, 0356, 0175, 0231, 0305, 0024, 
+  0012, 0127, 0312, 0207, 0055, 0331, 0167, 0060, 0123, 0311, 0043, 0321, 0001, 0165, 0322, 0210, 
+  0345, 0252, 0200, 0104, 0375, 0053, 0111, 0175, 0150, 0057, 0016, 0072, 0250, 0254, 0334, 0125, 
+  0046, 0102, 0045, 0113, 0046, 0077, 0241, 0220, 0221, 0261, 0260, 0261, 0322, 0232, 0056, 0103, 
+  0061, 0127, 0201, 0143, 0223, 0244, 0131, 0172, 0135, 0036, 0125, 0361, 0216, 0244, 0322, 0130, 
+  0223, 0304, 0266, 0276, 0273, 0014, 0037, 0330, 0044, 0321, 0045, 0372, 0056, 0032, 0236, 0211, 
+  0364, 0072, 0307, 0163, 0352, 0357, 0337, 0057, 0226, 0231, 0074, 0253, 0144, 0225, 0331, 0377, 
+  0114, 0106, 0143, 0163, 0330, 0313, 0056, 0272, 0140, 0357, 0225, 0246, 0054, 0054, 0203, 0373, 
+  0312, 0150, 0262, 0363, 0021, 0314, 0346, 0023, 0053, 0363, 0213, 0025, 0371, 0306, 0112, 0374, 
+  0143, 0106, 0037, 0231, 0031, 0364, 0242, 0226, 0366, 0164, 0110, 0275, 0125, 0163, 0033, 0107, 
+  0162, 0132, 0014, 0006, 0231, 0364, 0046, 0207, 0301, 0375, 0024, 0237, 0276, 0233, 0247, 0142, 
+  0072, 0147, 0052, 0366, 0312, 0355, 0156, 0131, 0053, 0271, 0102, 0316, 0227, 0144, 0332, 0145, 
+  0201, 0157, 0314, 0207, 0220, 0073, 0153, 0165, 0227, 0004, 0362, 0211, 0354, 0356, 0351, 0220, 
+  0004, 0003, 0252, 0214, 0351, 0245, 0333, 0204, 0070, 0072, 0254, 0034, 0010, 0015, 0232, 0334, 
+  0121, 0240, 0375, 0276, 0141, 0155, 0022, 0150, 0306, 0243, 0203, 0321, 0001, 0175, 0320, 0140, 
+  0016, 0236, 0262, 0140, 0277, 0266, 0323, 0117, 0146, 0247, 0233, 0117, 0141, 0247, 0237, 0105, 
+  0242, 0130, 0046, 0337, 0310, 0215, 0157, 0371, 0074, 0161, 0147, 0053, 0142, 0105, 0253, 0077, 
+  0271, 0060, 0054, 0136, 0020, 0333, 0206, 0333, 0166, 0314, 0112, 0341, 0125, 0034, 0253, 0302, 
+  0061, 0327, 0026, 0214, 0066, 0340, 0363, 0344, 0015, 0324, 0274, 0035, 0236, 0247, 0073, 0013, 
+  0224, 0350, 0147, 0045, 0376, 0054, 0240, 0352, 0246, 0126, 0124, 0202, 0372, 0255, 0156, 0152, 
+  0125, 0331, 0324, 0012, 0363, 0357, 0050, 0277, 0250, 0033, 0133, 0217, 0241, 0351, 0226, 0123, 
+  0330, 0165, 0067, 0253, 0356, 0146, 0131, 0272, 0131, 0157, 0352, 0156, 0126, 0112, 0067, 0153, 
+  0311, 0227, 0325, 0075, 0255, 0272, 0247, 0265, 0053, 0075, 0255, 0267, 0317, 0131, 0016, 0237, 
+  0153, 0073, 0052, 0271, 0001, 0357, 0234, 0335, 0250, 0116, 0226, 0256, 0205, 0224, 0332, 0214, 
+  0354, 0160, 0246, 0167, 0370, 0126, 0376, 0112, 0133, 0260, 0254, 0267, 0245, 0352, 0374, 0337, 
+  0370, 0005, 0320, 0216, 0353, 0175, 0214, 0063, 0075, 0313, 0127, 0174, 0253, 0160, 0123, 0053, 
+  0056, 0073, 0377, 0244, 0322, 0363, 0226, 0266, 0237, 0345, 0277, 0317, 0145, 0051, 0227, 0054, 
+  0154, 0127, 0127, 0214, 0116, 0057, 0110, 0257, 0160, 0237, 0273, 0036, 0135, 0175, 0057, 0320, 
+  0134, 0374, 0140, 0227, 0361, 0102, 0375, 0300, 0174, 0265, 0346, 0034, 0365, 0346, 0274, 0204, 
+  0263, 0327, 0235, 0053, 0255, 0075, 0127, 0130, 0177, 0266, 0306, 0035, 0304, 0367, 0103, 0277, 
+  0365, 0266, 0064, 0245, 0042, 0135, 0307, 0034, 0025, 0355, 0134, 0133, 0133, 0225, 0067, 0110, 
+  0376, 0167, 0277, 0172, 0127, 0360, 0325, 0120, 0257, 0375, 0100, 0065, 0176, 0140, 0365, 0232, 
+  0205, 0127, 0344, 0004, 0222, 0254, 0357, 0210, 0007, 0260, 0210, 0166, 0155, 0376, 0137, 0207, 
+  0371, 0157, 0276, 0034, 0363, 0237, 0274, 0207, 0246, 0162, 0363, 0337, 0236, 0153, 0026, 0134, 
+  0210, 0056, 0276, 0250, 0266, 0375, 0105, 0155, 0377, 0352, 0175, 0101, 0257, 0310, 0366, 0047, 
+  0131, 0337, 0021, 0333, 0277, 0044, 0330, 0270, 0272, 0332, 0360, 0277, 0016, 0303, 0337, 0172, 
+  0152, 0303, 0137, 0037, 0365, 0174, 0161, 0107, 0210, 0312, 0024, 0212, 0353, 0023, 0104, 0365, 
+  0011, 0242, 0247, 0071, 0101, 0124, 0150, 0152, 0175, 0204, 0350, 0247, 0335, 0157, 0362, 0014, 
+  0256, 0140, 0110, 0143, 0070, 0375, 0062, 0205, 0145, 0046, 0227, 0176, 0074, 0212, 0256, 0111, 
+  0163, 0247, 0314, 0037, 0120, 0075, 0077, 0001, 0261, 0374, 0030, 0044, 0125, 0143, 0021, 0050, 
+  0134, 0215, 0333, 0154, 0232, 0073, 0001, 0223, 0267, 0214, 0035, 0035, 0054, 0015, 0116, 0045, 
+  0161, 0030, 0022, 0260, 0334, 0344, 0223, 0227, 0220, 0373, 0133, 0202, 0322, 0026, 0022, 0053, 
+  0017, 0325, 0322, 0305, 0174, 0346, 0162, 0213, 0370, 0112, 0301, 0036, 0221, 0213, 0053, 0371, 
+  0306, 0234, 0170, 0164, 0050, 0070, 0206, 0372, 0007, 0153, 0270, 0055, 0000, 0075, 0072, 0110, 
+  0134, 0046, 0374, 0177, 0053, 0264, 0353, 0236, 0000, 0050, 0165, 0165, 0141, 0171, 0051
+} };
+
+static GStaticResource static_resource = { accessibility_resource_data.data, sizeof (accessibility_resource_data.data) - 1 /* nul terminator */, NULL, NULL, NULL };
+
+G_MODULE_EXPORT
+GResource *accessibility_get_resource (void);
+GResource *accessibility_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(accessibilityresource_constructor)
+#endif
+G_DEFINE_CONSTRUCTOR(accessibilityresource_constructor)
+#ifdef G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA
+#pragma G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(accessibilityresource_destructor)
+#endif
+G_DEFINE_DESTRUCTOR(accessibilityresource_destructor)
+
+#else
+#warning "Constructor not supported on this compiler, linking in resources will not work"
+#endif
+
+static void accessibilityresource_constructor (void)
+{
+  g_static_resource_init (&static_resource);
+}
+
+static void accessibilityresource_destructor (void)
+{
+  g_static_resource_fini (&static_resource);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/100.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/100.html new file mode 100644 index 00000000..f7b28832 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/100.html @@ -0,0 +1,311 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/*
+ * Copyright (C) 2007 Bastien Nocera <hadess@hadess.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.
+ *
+ * The Totem project hereby grant permission for non-gpl compatible GStreamer
+ * plugins to be used and distributed together with GStreamer and Totem. This
+ * permission are above and beyond the permissions granted by the GPL license
+ * Totem is covered by.
+ *
+ * Monday 7th February 2005: Christian Schaller: Add exception clause.
+ * See license_change file for details.
+ *
+ */
+
+#ifndef __TOTEM_RESOURCES_H__
+#define __TOTEM_RESOURCES_H__
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+void totem_resources_monitor_start	(const char *input,
+					 gint wall_clock_time);
+void totem_resources_monitor_stop	(void);
+
+#endif /* __TOTEM_RESOURCES_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/101.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/101.html new file mode 100644 index 00000000..2601fd5e --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/101.html @@ -0,0 +1,2293 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- mode: C; c-basic-offset: 4 -*- */
+
+/*
+ * font-view: a font viewer for MATE
+ *
+ * Copyright (C) 2002-2003  James Henstridge <james@daa.com.au>
+ * Copyright (C) 2010 Cosimo Cecchi <cosimoc@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., 59 Temple - Place Suite 330, 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 <ft2build.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include FT_FREETYPE_H
+#include FT_TYPE1_TABLES_H
+#include FT_SFNT_NAMES_H
+#include FT_TRUETYPE_IDS_H
+#include <cairo/cairo-ft.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <fontconfig/fontconfig.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 <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "font-model.h"
+#include "gd-main-toolbar.h"
+#include "sushi-font-widget.h"
+
+#define FONT_VIEW_TYPE_APPLICATION font_view_application_get_type()
+#define FONT_VIEW_ICON_NAME "preferences-desktop-font"
+#define FONT_VIEW_APPLICATION(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_VIEW_TYPE_APPLICATION, FontViewApplication))
+
+static GType font_view_application_get_type (void);
+typedef struct {
+    GtkApplication parent;
+
+    GtkWidget *main_window;
+    GtkWidget *main_grid;
+    GtkWidget *toolbar;
+    GtkWidget *title_label;<--- struct member 'FontViewApplication::title_label' is never used.
+    GtkWidget *side_grid;<--- struct member 'FontViewApplication::side_grid' is never used.
+    GtkWidget *font_widget;
+    GtkWidget *info_button;
+    GtkWidget *install_button;
+    GtkWidget *back_button;
+    GtkWidget *notebook;
+    GtkWidget *swin_view;
+    GtkWidget *swin_preview;
+    GtkWidget *icon_view;
+    GtkWidget *search_bar;
+    GtkWidget *entry;
+    GtkWidget *search_button;
+
+    GtkTreeModel *model;
+    GtkTreeModel *filter_model;
+
+    GFile *font_file;
+} FontViewApplication;
+
+typedef struct {
+    GtkApplicationClass parent_class;
+} FontViewApplicationClass;
+
+G_DEFINE_TYPE (FontViewApplication, font_view_application, GTK_TYPE_APPLICATION);
+
+static void font_view_application_do_overview (FontViewApplication *self);
+
+static const gchar *app_menu =
+    "<interface>"
+    "  <menu id=\"app-menu\">"
+    "    <section>"
+    "      <item>"
+    "        <attribute name=\"action\">app.about</attribute>"
+    "	     <attribute name=\"label\" translatable=\"yes\">About Font Viewer</attribute>"
+    "      </item>"
+    "      <item>"
+    "       <attribute name=\"action\">app.quit</attribute>"
+    "	    <attribute name=\"label\" translatable=\"yes\">Quit</attribute>"
+    "      </item>"
+    "    </section>"
+    "  <menu>"
+    "</interface>";
+
+#define VIEW_ITEM_WRAP_WIDTH 128
+#define VIEW_COLUMN_SPACING 36
+#define VIEW_MARGIN 16
+
+#define WHITESPACE_CHARS "\f \t"
+
+static void
+strip_whitespace (gchar **original)
+{
+    GString *reassembled;
+    gchar **split;
+    const gchar *str;
+    gint idx, n_stripped;
+    size_t len;
+
+    split = g_strsplit (*original, "\n", -1);
+    reassembled = g_string_new (NULL);
+    n_stripped = 0;
+
+    for (idx = 0; split[idx] != NULL; idx++) {
+        str = split[idx];
+
+        len = strspn (str, WHITESPACE_CHARS);
+        if (len)
+            str += len;
+
+        if (strlen (str) == 0 &&
+            ((split[idx + 1] == NULL) || strlen (split[idx + 1]) == 0))
+            continue;
+
+        if (n_stripped++ > 0)
+            g_string_append (reassembled, "\n");
+        g_string_append (reassembled, str);
+    }
+
+    g_strfreev (split);
+    g_free (*original);
+
+    *original = g_string_free (reassembled, FALSE);
+}
+
+#define MATCH_VERSION_STR "Version"
+
+static void
+strip_version (gchar **original)
+{
+    gchar *ptr, *stripped;
+
+    ptr = g_strstr_len (*original, -1, MATCH_VERSION_STR);
+    if (!ptr)
+        return;
+
+    ptr += strlen (MATCH_VERSION_STR);
+    stripped = g_strdup (ptr);
+
+    strip_whitespace (&stripped);
+
+    g_free (*original);
+    *original = stripped;
+}
+
+static void
+add_row (GtkWidget *grid,
+	 const gchar *name,
+	 const gchar *value,
+	 gboolean multiline)
+{
+    GtkWidget *name_w, *label;
+
+    name_w = gtk_label_new (name);
+    gtk_style_context_add_class (gtk_widget_get_style_context (name_w), "dim-label");
+    gtk_label_set_xalign (GTK_LABEL (name_w), 1.0);
+    gtk_label_set_yalign (GTK_LABEL (name_w), 0.0);
+
+    gtk_container_add (GTK_CONTAINER (grid), name_w);
+
+    label = gtk_label_new (value);
+    gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+    gtk_label_set_yalign (GTK_LABEL (label), 0.0);
+    gtk_label_set_selectable (GTK_LABEL(label), TRUE);
+
+    gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+
+    if (multiline && g_utf8_strlen (value, -1) > 64) {
+        gtk_label_set_width_chars (GTK_LABEL (label), 64);
+        gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
+    }
+    gtk_label_set_max_width_chars (GTK_LABEL (label), 64);
+
+    gtk_grid_attach_next_to (GTK_GRID (grid), label,
+                             name_w, GTK_POS_RIGHT,
+                             1, 1);
+}
+
+static void
+populate_grid (FontViewApplication *self,
+               GtkWidget *grid,
+	       FT_Face face)
+{
+    gchar *s;
+    GFileInfo *info;
+    PS_FontInfoRec ps_info;
+
+    add_row (grid, _("Name"), face->family_name, FALSE);
+
+    if (face->style_name)
+        add_row (grid, _("Style"), face->style_name, FALSE);
+
+    info = g_file_query_info (self->font_file,
+                              G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE ","
+                              G_FILE_ATTRIBUTE_STANDARD_SIZE,
+                              G_FILE_QUERY_INFO_NONE,
+                              NULL, NULL);
+
+    if (info != NULL) {
+        s = g_content_type_get_description (g_file_info_get_content_type (info));
+        add_row (grid, _("Type"), s, FALSE);
+        g_free (s);
+
+        g_object_unref (info);
+    }
+
+    if (FT_IS_SFNT (face)) {
+        gint i, len;
+        gchar *version = NULL, *copyright = NULL, *description = NULL;
+
+        len = FT_Get_Sfnt_Name_Count (face);
+        for (i = 0; i < len; i++) {
+            FT_SfntName sname;
+
+            if (FT_Get_Sfnt_Name (face, i, &sname) != 0)
+                continue;
+
+            /* only handle the unicode names for US langid */
+            if (!(sname.platform_id == TT_PLATFORM_MICROSOFT &&
+                  sname.encoding_id == TT_MS_ID_UNICODE_CS &&
+                  sname.language_id == TT_MS_LANGID_ENGLISH_UNITED_STATES))
+                continue;
+
+            switch (sname.name_id) {
+            case TT_NAME_ID_COPYRIGHT:
+                g_free (copyright);
+                copyright = g_convert ((gchar *)sname.string, sname.string_len,
+                                       "UTF-8", "UTF-16BE", NULL, NULL, NULL);
+                break;
+            case TT_NAME_ID_VERSION_STRING:
+            g_free (version);
+            version = g_convert ((gchar *)sname.string, sname.string_len,
+                                 "UTF-8", "UTF-16BE", NULL, NULL, NULL);
+                break;
+            case TT_NAME_ID_DESCRIPTION:
+                g_free (description);
+                description = g_convert ((gchar *)sname.string, sname.string_len,
+                                         "UTF-8", "UTF-16BE", NULL, NULL, NULL);
+                break;
+            default:
+                break;
+            }
+        }
+
+	if (version) {
+            strip_version (&version);
+            add_row (grid, _("Version"), version, FALSE);
+	    g_free (version);
+	}
+	if (copyright) {
+	    strip_whitespace (&copyright);
+	    add_row (grid, _("Copyright"), copyright, TRUE);
+	    g_free (copyright);
+	}
+	if (description) {
+	    strip_whitespace (&description);
+	    add_row (grid, _("Description"), description, TRUE);
+	    g_free (description);
+	}
+    } else if (FT_Get_PS_Font_Info (face, &ps_info) == 0) {
+	if (ps_info.version && g_utf8_validate (ps_info.version, -1, NULL))
+	    add_row (grid, _("Version"), ps_info.version, FALSE);
+	if (ps_info.notice && g_utf8_validate (ps_info.notice, -1, NULL))
+	    add_row (grid, _("Copyright"), ps_info.notice, TRUE);
+    }
+}
+
+static void
+install_button_refresh_appearance (FontViewApplication *self,
+                                   GError *error)<--- Parameter 'error' can be declared as pointer to const
+{
+    FT_Face face;
+
+    if (error != NULL) {
+        gtk_button_set_label (GTK_BUTTON (self->install_button), _("Install Failed"));
+        gtk_widget_set_sensitive (self->install_button, FALSE);
+    } else {
+        face = sushi_font_widget_get_ft_face (SUSHI_FONT_WIDGET (self->font_widget));
+
+        if (font_view_model_get_iter_for_face (FONT_VIEW_MODEL (self->model), face, NULL)) {
+            gtk_button_set_label (GTK_BUTTON (self->install_button), _("Installed"));
+            gtk_widget_set_sensitive (self->install_button, FALSE);
+        } else {
+            gtk_button_set_label (GTK_BUTTON (self->install_button), _("Install"));
+            gtk_widget_set_sensitive (self->install_button, TRUE);
+        }
+    }
+}
+
+static void
+font_install_finished_cb (GObject      *source_object,
+                          GAsyncResult *res,
+                          gpointer      user_data)
+{
+    FontViewApplication *self = user_data;
+    GError *err = NULL;
+
+    g_file_copy_finish (G_FILE (source_object), res, &err);
+
+    if (err != NULL) {
+        install_button_refresh_appearance (self, err);
+
+        g_debug ("Install failed: %s", err->message);
+        g_error_free (err);
+    }
+}
+
+static void
+font_model_config_changed_cb (FontViewModel *model,
+                              gpointer user_data)
+{
+    FontViewApplication *self = user_data;
+
+    if (self->font_file != NULL)
+        install_button_refresh_appearance (self, NULL);
+}
+
+static void
+install_button_clicked_cb (GtkButton *button,
+                           gpointer user_data)
+{
+    FontViewApplication *self = user_data;
+    gchar *dest_filename;
+    GError *err = NULL;
+    FcConfig *config;
+    FcStrList *str_list;
+    FcChar8 *path;
+    GFile *xdg_prefix, *home_prefix, *file;
+    GFile *xdg_location = NULL, *home_location = NULL;
+    GFile *dest_location = NULL, *dest_file;
+
+    config = FcConfigGetCurrent ();
+    str_list = FcConfigGetFontDirs (config);
+
+    home_prefix = g_file_new_for_path (g_get_home_dir ());
+    xdg_prefix = g_file_new_for_path (g_get_user_data_dir ());
+
+    /* pick the XDG location, if any, or fallback to the first location
+     * under the home directory.
+     */
+    while ((path = FcStrListNext (str_list)) != NULL) {
+        file = g_file_new_for_path ((const gchar *) path);
+
+        if (g_file_has_prefix (file, xdg_prefix)) {
+            xdg_location = file;
+            break;
+        }
+
+        if ((home_location == NULL) &&
+            g_file_has_prefix (file, home_prefix)) {
+            home_location = file;
+            break;
+        }
+
+        g_object_unref (file);
+    }
+
+    FcStrListDone (str_list);
+    g_object_unref (home_prefix);
+    g_object_unref (xdg_prefix);
+
+    if (xdg_location != NULL)
+        dest_location = g_object_ref (xdg_location);
+    else if (home_location != NULL)
+        dest_location = g_object_ref (home_location);
+
+    g_clear_object (&home_location);
+    g_clear_object (&xdg_location);
+
+    if (dest_location == NULL) {
+        g_warning ("Install failed: can't find any configured user font directory.");
+        return;
+    }
+
+    if (!g_file_query_exists (dest_location, NULL)) {
+        g_file_make_directory_with_parents (dest_location, NULL, &err);
+        if (err) {
+            /* TODO: show error dialog */
+            g_warning ("Could not create fonts directory: %s", err->message);
+            g_error_free (err);
+            g_object_unref (dest_location);
+            return;
+        }
+    }
+
+    /* create destination filename */
+    dest_filename = g_file_get_basename (self->font_file);
+    dest_file = g_file_get_child (dest_location, dest_filename);
+    g_free (dest_filename);
+
+    /* TODO: show error dialog if file exists */
+    g_file_copy_async (self->font_file, dest_file, G_FILE_COPY_NONE, 0, NULL, NULL, NULL,
+                       font_install_finished_cb, self);
+
+    g_object_unref (dest_file);
+    g_object_unref (dest_location);
+}
+
+static void
+back_button_clicked_cb (GtkButton *button,
+                        gpointer user_data)
+{
+    FontViewApplication *self = user_data;
+    font_view_application_do_overview (self);
+}
+
+static void
+font_view_show_font_error (FontViewApplication *self,
+                           const gchar *message)
+{
+    GtkWidget *dialog;
+
+    dialog = gtk_message_dialog_new (GTK_WINDOW (self->main_window),
+                                     GTK_DIALOG_MODAL,
+                                     GTK_MESSAGE_ERROR,
+                                     GTK_BUTTONS_CLOSE,
+                                     _("This font could not be displayed."));
+    gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+                                              "%s",
+                                              message);
+    g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+    gtk_widget_show (dialog);
+}
+
+static void
+font_widget_error_cb (SushiFontWidget *font_widget,
+                      const gchar *message,
+                      gpointer user_data)
+{
+    FontViewApplication *self = user_data;
+
+    font_view_application_do_overview (self);
+    font_view_show_font_error (self, message);
+}
+
+static void
+font_widget_loaded_cb (SushiFontWidget *font_widget,
+                       gpointer user_data)
+{
+    FontViewApplication *self = user_data;
+    FT_Face face = sushi_font_widget_get_ft_face (font_widget);
+    const gchar *uri;
+
+    if (face == NULL)
+        return;
+
+    uri = sushi_font_widget_get_uri (font_widget);
+    self->font_file = g_file_new_for_uri (uri);
+
+    gd_main_toolbar_set_labels (GD_MAIN_TOOLBAR (self->toolbar),
+                                face->family_name, face->style_name);
+
+    install_button_refresh_appearance (self, NULL);
+}
+
+static void
+info_button_clicked_cb (GtkButton *button,
+                        gpointer user_data)
+{
+    FontViewApplication *self = user_data;
+    GtkWidget *grid, *dialog;
+    FT_Face face = sushi_font_widget_get_ft_face (SUSHI_FONT_WIDGET (self->font_widget));
+
+    if (face == NULL)
+        return;
+
+    grid = gtk_grid_new ();
+    gtk_orientable_set_orientation (GTK_ORIENTABLE (grid), GTK_ORIENTATION_VERTICAL);
+    g_object_set (grid,
+                  "margin-top", 6,
+                  "margin-start", 16,
+                  "margin-end", 16,
+                  "margin-bottom", 6,
+                  NULL);
+    gtk_grid_set_column_spacing (GTK_GRID (grid), 8);
+    gtk_grid_set_row_spacing (GTK_GRID (grid), 2);
+
+    populate_grid (self, grid, face);
+
+    dialog = gtk_dialog_new_with_buttons ( _("Info"), GTK_WINDOW (self->main_window),
+                                          GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+                                          "gtk-close", GTK_RESPONSE_CLOSE,
+                                          NULL);
+    gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), grid);
+    g_signal_connect (dialog, "response",
+                      G_CALLBACK (gtk_widget_destroy), NULL);
+    gtk_widget_show_all (dialog);
+}
+
+static gboolean
+font_visible_func (GtkTreeModel *model,
+                   GtkTreeIter  *iter,
+                   gpointer      data)
+{
+  FontViewApplication *self = data;
+  gboolean ret;
+  const char *search;
+  char *name;
+  char *cf_name;
+  char *cf_search;
+
+  if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->search_button)))
+    return TRUE;
+
+  search = gtk_entry_get_text (GTK_ENTRY (self->entry));
+
+  gtk_tree_model_get (model, iter,
+                      COLUMN_NAME, &name,
+                      -1);
+
+  cf_name = g_utf8_casefold (name, -1);
+  cf_search = g_utf8_casefold (search, -1);
+
+  ret = strstr (cf_name, cf_search) != NULL;
+
+  g_free (name);
+  g_free (cf_name);
+  g_free (cf_search);
+
+  return ret;
+}
+
+static void
+font_view_ensure_model (FontViewApplication *self)
+{
+    if (self->model != NULL)
+        return;
+
+    self->model = font_view_model_new ();
+    g_signal_connect (self->model, "config-changed",
+                      G_CALLBACK (font_model_config_changed_cb), self);
+    self->filter_model = gtk_tree_model_filter_new (self->model, NULL);
+    gtk_tree_model_filter_set_visible_func (GTK_TREE_MODEL_FILTER (self->filter_model),
+                                            font_visible_func, self, NULL);
+}
+
+static void
+set_override_background_color (GtkWidget *widget,
+                               GdkRGBA   *rgba)
+{
+    gchar          *css;
+    GtkCssProvider *provider;
+
+    provider = gtk_css_provider_new ();
+
+    css = g_strdup_printf ("* { background-color: %s;}",
+                           gdk_rgba_to_string (rgba));
+    gtk_css_provider_load_from_data (provider, css, -1, NULL);
+    g_free (css);
+
+    gtk_style_context_add_provider (gtk_widget_get_style_context (widget),
+                                    GTK_STYLE_PROVIDER (provider),
+                                    GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+    g_object_unref (provider);
+}
+
+static void
+set_override_color (GtkWidget *widget,
+                    GdkRGBA   *rgba)
+{
+    gchar          *css;
+    GtkCssProvider *provider;
+
+    provider = gtk_css_provider_new ();
+
+    css = g_strdup_printf ("* { color: %s;}",
+                           gdk_rgba_to_string (rgba));
+    gtk_css_provider_load_from_data (provider, css, -1, NULL);
+    g_free (css);
+
+    gtk_style_context_add_provider (gtk_widget_get_style_context (widget),
+                                    GTK_STYLE_PROVIDER (provider),
+                                    GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+    g_object_unref (provider);
+}
+
+static void
+font_view_application_do_open (FontViewApplication *self,
+                               GFile *file,
+                               gint face_index)
+{
+    gchar *uri;
+
+    font_view_ensure_model (self);
+
+    self->info_button = gd_main_toolbar_add_button (GD_MAIN_TOOLBAR (self->toolbar),
+                                                    NULL, _("Info"),
+                                                    FALSE);
+    g_signal_connect (self->info_button, "clicked",
+                      G_CALLBACK (info_button_clicked_cb), self);
+
+    /* add install button */
+    self->install_button = gd_main_toolbar_add_button (GD_MAIN_TOOLBAR (self->toolbar),
+                                                       NULL, _("Install"),
+                                                       FALSE);
+    g_signal_connect (self->install_button, "clicked",
+                      G_CALLBACK (install_button_clicked_cb), self);
+
+    self->back_button = gd_main_toolbar_add_button (GD_MAIN_TOOLBAR (self->toolbar),
+                                                    "go-previous-symbolic", _("Back"),
+                                                    TRUE);
+    g_signal_connect (self->back_button, "clicked",
+                      G_CALLBACK (back_button_clicked_cb), self);
+
+    gtk_widget_set_vexpand (self->toolbar, FALSE);
+
+    uri = g_file_get_uri (file);
+
+    if (self->font_widget == NULL) {
+        GdkRGBA white = { 1.0, 1.0, 1.0, 1.0 };
+        GdkRGBA black = { 0.0, 0.0, 0.0, 1.0 };
+        GtkWidget *w;
+
+        self->font_widget = GTK_WIDGET (sushi_font_widget_new (uri, face_index));
+
+        set_override_color (self->font_widget, &black);
+        set_override_background_color (self->font_widget, &white);
+
+        w = gtk_viewport_new (NULL, NULL);
+        gtk_viewport_set_shadow_type (GTK_VIEWPORT (w), GTK_SHADOW_NONE);
+
+        gtk_container_add (GTK_CONTAINER (w), self->font_widget);
+        gtk_container_add (GTK_CONTAINER (self->swin_preview), w);
+
+        g_signal_connect (self->font_widget, "loaded",
+                          G_CALLBACK (font_widget_loaded_cb), self);
+        g_signal_connect (self->font_widget, "error",
+                          G_CALLBACK (font_widget_error_cb), self);
+    } else {
+        g_object_set (self->font_widget, "uri", uri, "face-index", face_index, NULL);
+        sushi_font_widget_load (SUSHI_FONT_WIDGET (self->font_widget));
+    }
+
+    g_free (uri);
+
+    gtk_widget_show_all (self->swin_preview);
+    gtk_notebook_set_current_page (GTK_NOTEBOOK (self->notebook), 1);
+}
+
+static gboolean
+icon_view_release_cb (GtkWidget *widget,
+                      GdkEventButton *event,
+                      gpointer user_data)
+{
+    FontViewApplication *self = user_data;
+    GtkTreePath *path;
+    GtkTreeIter iter;
+    GtkTreeIter filter_iter;
+    gchar *font_path;
+    gint face_index;
+    GFile *file;
+
+    /* eat double/triple click events */
+    if (event->type != GDK_BUTTON_RELEASE)
+        return TRUE;
+
+    path = gtk_icon_view_get_path_at_pos (GTK_ICON_VIEW (widget),
+                                          event->x, event->y);
+
+    if (path != NULL &&
+        gtk_tree_model_get_iter (self->filter_model, &filter_iter, path)) {
+        gtk_tree_model_filter_convert_iter_to_child_iter (GTK_TREE_MODEL_FILTER (self->filter_model),
+                                                          &iter,
+                                                          &filter_iter);
+        gtk_tree_model_get (self->model, &iter,
+                            COLUMN_PATH, &font_path,
+                            COLUMN_FACE_INDEX, &face_index,
+                            -1);
+
+        if (font_path != NULL) {
+            file = g_file_new_for_path (font_path);
+            font_view_application_do_open (self, file, face_index);
+            g_object_unref (file);
+        }
+        gtk_tree_path_free (path);
+        g_free (font_path);
+    }
+
+    return FALSE;
+}
+
+static void
+font_view_application_do_overview (FontViewApplication *self)
+{
+    g_clear_object (&self->font_file);
+
+    if (self->back_button) {
+        gtk_widget_destroy (self->back_button);
+        self->back_button = NULL;
+    }
+
+    if (self->info_button) {
+        gtk_widget_destroy (self->info_button);
+        self->info_button = NULL;
+    }
+
+    if (self->install_button) {
+        gtk_widget_destroy (self->install_button);
+        self->install_button = NULL;
+    }
+
+    font_view_ensure_model (self);
+
+    gd_main_toolbar_set_labels (GD_MAIN_TOOLBAR (self->toolbar), _("All Fonts"), NULL);
+
+    if (self->icon_view == NULL) {
+        GtkWidget *icon_view;
+        GtkCellRenderer *cell;
+
+        self->icon_view = icon_view = gtk_icon_view_new_with_model (self->filter_model);
+        g_object_set (icon_view,
+                      "column-spacing", VIEW_COLUMN_SPACING,
+                      "margin", VIEW_MARGIN,
+                      NULL);
+
+        gtk_widget_set_vexpand (GTK_WIDGET (icon_view), TRUE);
+        gtk_icon_view_set_selection_mode (GTK_ICON_VIEW (icon_view), GTK_SELECTION_NONE);
+        gtk_container_add (GTK_CONTAINER (self->swin_view), icon_view);
+
+        cell = gtk_cell_renderer_pixbuf_new ();
+        g_object_set (cell,
+                      "xalign", 0.5,
+                      "yalign", 0.5,
+                      NULL);
+
+        gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (icon_view), cell, FALSE);
+        gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (icon_view), cell,
+                                       "pixbuf", COLUMN_ICON);
+
+        cell = gtk_cell_renderer_text_new ();
+        g_object_set (cell,
+                      "alignment", PANGO_ALIGN_CENTER,
+                      "xalign", 0.5,
+                      "wrap-mode", PANGO_WRAP_WORD_CHAR,
+                      "wrap-width", VIEW_ITEM_WRAP_WIDTH,
+                      NULL);
+        gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (icon_view), cell, FALSE);
+        gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (icon_view), cell,
+                                       "text", COLUMN_NAME);
+
+        g_signal_connect (icon_view, "button-release-event",
+                          G_CALLBACK (icon_view_release_cb), self);
+    }
+
+    gtk_notebook_set_current_page (GTK_NOTEBOOK (self->notebook), 0);
+    gtk_widget_show_all (self->swin_view);
+}
+
+static void
+query_info_ready_cb (GObject *object,
+                     GAsyncResult *res,
+                     gpointer user_data)
+{
+    FontViewApplication *self = user_data;
+    GFileInfo *info;
+    GError *error = NULL;
+
+    info = g_file_query_info_finish (G_FILE (object), res, &error);
+    if (error != NULL) {
+        font_view_application_do_overview (self);
+        font_view_show_font_error (self, error->message);
+        g_error_free (error);
+    } else {
+        font_view_application_do_open (self, G_FILE (object), 0);
+    }
+
+    g_clear_object (&info);
+}
+
+static void
+font_view_application_open (GApplication *application,
+                            GFile **files,
+                            gint n_files,
+                            const gchar *hint)
+{
+    FontViewApplication *self = FONT_VIEW_APPLICATION (application);
+    g_file_query_info_async (files[0], G_FILE_ATTRIBUTE_STANDARD_NAME,
+                             G_FILE_QUERY_INFO_NONE,
+                             G_PRIORITY_DEFAULT, NULL,
+                             query_info_ready_cb, self);
+}
+
+static void
+action_quit (GSimpleAction *action,
+             GVariant *parameter,
+             gpointer user_data)
+{
+    FontViewApplication *self = user_data;
+    gtk_widget_destroy (self->main_window);
+}
+
+static void
+action_about (GSimpleAction *action,
+              GVariant *parameter,
+              gpointer user_data)
+{
+    FontViewApplication *self = user_data;
+    const gchar *authors[] = {
+        "Mate Developer",
+        "Cosimo Cecchi",
+        "James Henstridge",
+        NULL
+    };
+
+    gtk_show_about_dialog (GTK_WINDOW (self->main_window),
+                           "version", VERSION,
+                           "authors", authors,
+                           "program-name", _("Font Viewer"),
+                           "comments", _("View fonts on your system"),
+                           "logo-icon-name", FONT_VIEW_ICON_NAME,
+                           "translator-credits", _("translator-credits"),
+                           "license-type", GTK_LICENSE_GPL_2_0,
+                           "wrap-license", TRUE,
+                           NULL);
+
+}
+
+static GActionEntry action_entries[] = {
+    { "about", action_about, NULL, NULL, NULL, { 0 } },
+    { "quit", action_quit, NULL, NULL, NULL, { 0 } }
+};
+
+static void
+search_text_changed (GtkEntry *entry,
+                     FontViewApplication *self)
+{
+  gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (self->filter_model));
+}
+
+static void
+font_view_application_startup (GApplication *application)
+{
+    FontViewApplication *self = FONT_VIEW_APPLICATION (application);
+    GtkWidget *window, *swin;
+    GtkBuilder *builder;
+    GMenuModel *menu;
+
+    G_APPLICATION_CLASS (font_view_application_parent_class)->startup (application);
+
+    g_action_map_add_action_entries (G_ACTION_MAP (self), action_entries,
+                                     G_N_ELEMENTS (action_entries), self);
+    builder = gtk_builder_new ();
+    gtk_builder_add_from_string (builder, app_menu, -1, NULL);
+    menu = G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu"));
+    gtk_application_set_app_menu (GTK_APPLICATION (self), menu);
+
+    g_object_unref (builder);
+    g_object_unref (menu);
+
+    self->main_window = window = gtk_application_window_new (GTK_APPLICATION (application));
+
+    GtkStyleContext *context;
+    context = gtk_widget_get_style_context (GTK_WIDGET (self->main_window));
+    gtk_style_context_add_class (context, "font-viewer");
+
+    gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
+    gtk_window_set_default_size (GTK_WINDOW (window), 800, 600);
+    gtk_window_set_icon_name (GTK_WINDOW (window), FONT_VIEW_ICON_NAME);
+    gtk_window_set_hide_titlebar_when_maximized (GTK_WINDOW (window), TRUE);
+    gtk_window_set_title (GTK_WINDOW (window), _("Font Viewer"));
+
+    self->main_grid = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+    gtk_container_add (GTK_CONTAINER (self->main_window), self->main_grid);
+
+    self->toolbar = gd_main_toolbar_new ();
+    gtk_style_context_add_class (gtk_widget_get_style_context (self->toolbar), "menubar");
+    self->search_button = gd_main_toolbar_add_toggle (GD_MAIN_TOOLBAR (self->toolbar),
+                                                        NULL, _("Search"),
+                                                        FALSE);
+    gtk_container_add (GTK_CONTAINER (self->main_grid), self->toolbar);
+
+    self->notebook = gtk_notebook_new ();
+    gtk_container_add (GTK_CONTAINER (self->main_grid), self->notebook);
+    gtk_widget_set_hexpand (self->notebook, TRUE);
+    gtk_widget_set_vexpand (self->notebook, TRUE);
+    gtk_notebook_set_show_tabs (GTK_NOTEBOOK (self->notebook), FALSE);
+
+    self->swin_view = swin = gtk_scrolled_window_new (NULL, NULL);
+    gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (swin), GTK_SHADOW_IN);
+    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swin),
+				    GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+    gtk_container_add (GTK_CONTAINER (self->notebook), swin);
+
+    self->swin_preview = swin = gtk_scrolled_window_new (NULL, NULL);
+    gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (swin), GTK_SHADOW_IN);
+    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swin),
+         			    GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER);
+    gtk_container_add (GTK_CONTAINER (self->notebook), swin);
+
+    self->search_bar = gtk_search_bar_new();
+    gtk_container_add (GTK_CONTAINER (self->main_grid), self->search_bar);
+
+    self->entry = gtk_search_entry_new();
+    gtk_entry_set_width_chars (GTK_ENTRY (self->entry), 40);
+    gtk_container_add (GTK_CONTAINER (self->search_bar), self->entry);
+
+    g_object_bind_property (self->search_bar, "search-mode-enabled",
+                            self->search_button, "active",
+                            G_BINDING_BIDIRECTIONAL);
+
+    g_signal_connect (self->entry, "search-changed", G_CALLBACK (search_text_changed), self);
+
+    gtk_widget_show_all (window);
+}
+
+static void
+font_view_application_activate (GApplication *application)
+{
+    FontViewApplication *self = FONT_VIEW_APPLICATION (application);
+
+    G_APPLICATION_CLASS (font_view_application_parent_class)->activate (application);
+    font_view_application_do_overview (self);
+}
+
+static void
+font_view_application_quit_mainloop (GApplication *application)
+{
+    G_APPLICATION_CLASS (font_view_application_parent_class)->quit_mainloop (application);
+
+    FcFini ();
+}
+
+static void
+font_view_application_dispose (GObject *obj)
+{
+    FontViewApplication *self = FONT_VIEW_APPLICATION (obj);
+
+    g_clear_object (&self->model);
+    g_clear_object (&self->filter_model);
+
+    G_OBJECT_CLASS (font_view_application_parent_class)->dispose (obj);
+}
+
+static void
+font_view_application_init (FontViewApplication *self)
+{
+    /* do nothing */
+}
+
+static void
+font_view_application_class_init (FontViewApplicationClass *klass)
+{
+    GObjectClass *oclass = G_OBJECT_CLASS (klass);
+    GApplicationClass *aclass = G_APPLICATION_CLASS (klass);
+
+    aclass->activate = font_view_application_activate;
+    aclass->startup = font_view_application_startup;
+    aclass->open = font_view_application_open;
+    aclass->quit_mainloop = font_view_application_quit_mainloop;
+
+    oclass->dispose = font_view_application_dispose;
+}
+
+static GApplication *
+font_view_application_new (void)
+{
+    if (!FcInit ())
+        g_critical ("Can't initialize fontconfig library");
+
+    return g_object_new (FONT_VIEW_TYPE_APPLICATION,
+                         "application-id", "org.mate.font-viewer",
+                         "flags", G_APPLICATION_HANDLES_OPEN,
+                         NULL);
+}
+
+int
+main (int argc,
+      char **argv)
+{
+    GApplication *app;
+    gint retval;
+
+#ifdef ENABLE_NLS
+    bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
+    bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+    textdomain (GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
+
+    app = font_view_application_new ();
+    retval = g_application_run (app, argc, argv);
+
+    g_object_unref (app);
+    return retval;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/102.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/102.html new file mode 100644 index 00000000..bc5ad620 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/102.html @@ -0,0 +1,463 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * Copyright (c) 2011, 2012 Red Hat, Inc.
+ * Copyright (C) 2013-2021 MATE Developers
+ *
+ * This program 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 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * Author: Cosimo Cecchi <cosimoc@redhat.com>
+ *
+ */
+
+#ifndef __GD_MAIN_TOOLBAR_H__
+#define __GD_MAIN_TOOLBAR_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.
+
+G_BEGIN_DECLS
+
+#define GD_TYPE_MAIN_TOOLBAR gd_main_toolbar_get_type()
+
+#define GD_MAIN_TOOLBAR(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+   GD_TYPE_MAIN_TOOLBAR, GdMainToolbar))
+
+#define GD_MAIN_TOOLBAR_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST ((klass), \
+   GD_TYPE_MAIN_TOOLBAR, GdMainToolbarClass))
+
+#define GD_IS_MAIN_TOOLBAR(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+   GD_TYPE_MAIN_TOOLBAR))
+
+#define GD_IS_MAIN_TOOLBAR_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+   GD_TYPE_MAIN_TOOLBAR))
+
+#define GD_MAIN_TOOLBAR_GET_CLASS(obj) \
+  (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+   GD_TYPE_MAIN_TOOLBAR, GdMainToolbarClass))
+
+typedef struct _GdMainToolbar GdMainToolbar;
+typedef struct _GdMainToolbarClass GdMainToolbarClass;
+typedef struct _GdMainToolbarPrivate GdMainToolbarPrivate;
+
+struct _GdMainToolbar
+{
+  GtkToolbar parent;
+
+  GdMainToolbarPrivate *priv;
+};
+
+struct _GdMainToolbarClass
+{
+  GtkToolbarClass parent_class;
+};
+
+GType gd_main_toolbar_get_type (void) G_GNUC_CONST;
+
+GtkWidget     *gd_main_toolbar_new (void);
+
+void        gd_main_toolbar_set_labels (GdMainToolbar *self,
+                                        const gchar *primary,
+                                        const gchar *detail);
+
+void        gd_main_toolbar_set_labels_menu (GdMainToolbar *self,
+                                             GMenuModel    *menu);
+
+GtkWidget * gd_main_toolbar_add_mode (GdMainToolbar *self,
+                                      const gchar *label);
+
+void        gd_main_toolbar_clear (GdMainToolbar *self);
+
+GtkWidget * gd_main_toolbar_add_button (GdMainToolbar *self,
+                                        const gchar *icon_name,
+                                        const gchar *label,
+                                        gboolean pack_start);
+
+GtkWidget * gd_main_toolbar_add_toggle (GdMainToolbar *self,
+                                        const gchar *icon_name,
+                                        const gchar *label,
+                                        gboolean pack_start);
+
+GtkWidget * gd_main_toolbar_add_menu (GdMainToolbar *self,
+                                      const gchar *icon_name,
+                                      const gchar *label,
+                                      gboolean pack_start);
+
+void        gd_main_toolbar_add_widget (GdMainToolbar *self,
+                                        GtkWidget *widget,
+                                        gboolean pack_start);
+
+gboolean    gd_main_toolbar_get_show_modes (GdMainToolbar *self);
+
+void        gd_main_toolbar_set_show_modes (GdMainToolbar *self,
+                                            gboolean show_modes);
+
+G_END_DECLS
+
+#endif /* __GD_MAIN_TOOLBAR_H__ */
+
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/103.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/103.html new file mode 100644 index 00000000..03f8c042 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/103.html @@ -0,0 +1,383 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/*
+ * Copyright (C) 2011 Red Hat, 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., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * The Sushi project hereby grant permission for non-gpl compatible GStreamer
+ * plugins to be used and distributed together with GStreamer and Sushi. This
+ * permission is above and beyond the permissions granted by the GPL license
+ * Sushi is covered by.
+ *
+ * Authors: Cosimo Cecchi <cosimoc@redhat.com>
+ *
+ */
+
+#ifndef __SUSHI_FONT_WIDGET_H__
+#define __SUSHI_FONT_WIDGET_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 <cairo/cairo-ft.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+#define SUSHI_TYPE_FONT_WIDGET            (sushi_font_widget_get_type ())
+#define SUSHI_FONT_WIDGET(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), SUSHI_TYPE_FONT_WIDGET, SushiFontWidget))
+#define SUSHI_IS_FONT_WIDGET(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SUSHI_TYPE_FONT_WIDGET))
+#define SUSHI_FONT_WIDGET_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  SUSHI_TYPE_FONT_WIDGET, SushiFontWidgetClass))
+#define SUSHI_IS_FONT_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  SUSHI_TYPE_FONT_WIDGET))
+#define SUSHI_FONT_WIDGET_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  SUSHI_TYPE_FONT_WIDGET, SushiFontWidgetClass))
+
+typedef struct _SushiFontWidget          SushiFontWidget;
+typedef struct _SushiFontWidgetPrivate   SushiFontWidgetPrivate;
+typedef struct _SushiFontWidgetClass     SushiFontWidgetClass;
+
+struct _SushiFontWidget
+{
+  GtkDrawingArea parent_instance;
+
+  SushiFontWidgetPrivate *priv;
+};
+
+struct _SushiFontWidgetClass
+{
+  GtkDrawingAreaClass parent_class;
+};
+
+GType    sushi_font_widget_get_type     (void) G_GNUC_CONST;
+
+SushiFontWidget *sushi_font_widget_new (const gchar *uri, gint face_index);
+
+FT_Face sushi_font_widget_get_ft_face (SushiFontWidget *self);
+
+const gchar *sushi_font_widget_get_uri (SushiFontWidget *self);
+
+void sushi_font_widget_load (SushiFontWidget *self);
+
+G_END_DECLS
+
+#endif /* __SUSHI_FONT_WIDGET_H__ */
+
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/104.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/104.html new file mode 100644 index 00000000..3a00a76b --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/104.html @@ -0,0 +1,1463 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * Copyright (c) 2011, 2012 Red Hat, Inc.
+ * Copyright (C) 2013-2021 MATE Developers
+ *
+ * This program 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 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * Author: Cosimo Cecchi <cosimoc@redhat.com>
+ *
+ */
+
+#include "gd-main-toolbar.h"
+
+#include <math.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.
+
+typedef enum {
+  CHILD_NORMAL = 0,
+  CHILD_TOGGLE = 1,
+  CHILD_MENU = 2,
+} ChildType;
+
+struct _GdMainToolbarPrivate {
+  GtkSizeGroup *size_group;
+  GtkSizeGroup *vertical_size_group;
+
+  GtkToolItem *left_group;
+  GtkToolItem *center_group;
+  GtkToolItem *right_group;
+
+  GtkWidget *left_grid;
+  GtkWidget *center_grid;
+
+  GtkWidget *labels_grid;
+  GtkWidget *title_label;
+  GtkWidget *detail_label;
+
+  GtkWidget *modes_box;
+
+  GtkWidget *center_menu;
+  GtkWidget *center_menu_child;
+
+  GtkWidget *right_grid;
+
+  gboolean show_modes;
+};
+
+enum {
+        PROP_0,
+        PROP_SHOW_MODES,
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (GdMainToolbar, gd_main_toolbar, GTK_TYPE_TOOLBAR)<--- 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
+gd_main_toolbar_dispose (GObject *obj)
+{
+  GdMainToolbar *self = GD_MAIN_TOOLBAR (obj);
+
+  g_clear_object (&self->priv->size_group);
+  g_clear_object (&self->priv->vertical_size_group);
+
+  G_OBJECT_CLASS (gd_main_toolbar_parent_class)->dispose (obj);
+}
+
+static GtkWidget *
+get_empty_button (ChildType type)
+{
+  GtkWidget *button;
+
+  switch (type)
+    {
+    case CHILD_MENU:
+      button = gtk_menu_button_new ();
+      break;
+    case CHILD_TOGGLE:
+      button = gtk_toggle_button_new ();
+      break;
+    case CHILD_NORMAL:
+    default:
+      button = gtk_button_new ();
+      break;
+    }
+
+  return button;
+}
+
+static GtkWidget *
+get_symbolic_button (const gchar *icon_name,
+                     ChildType    type)
+{
+  GtkWidget *button, *w;
+
+  switch (type)
+    {
+    case CHILD_MENU:
+      button = gtk_menu_button_new ();
+      gtk_widget_destroy (gtk_bin_get_child (GTK_BIN (button)));
+      break;
+    case CHILD_TOGGLE:
+      button = gtk_toggle_button_new ();
+      break;
+    case CHILD_NORMAL:
+    default:
+      button = gtk_button_new ();
+      break;
+    }
+
+  gtk_style_context_add_class (gtk_widget_get_style_context (button), "raised");
+  gtk_style_context_add_class (gtk_widget_get_style_context (button), "image-button");
+
+  w = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
+  gtk_widget_show (w);
+  gtk_container_add (GTK_CONTAINER (button), w);
+
+  return button;
+}
+
+static GtkWidget *
+get_text_button (const gchar *label,
+                 ChildType    type)
+{
+  GtkWidget *button, *w;
+
+  switch (type)
+    {
+    case CHILD_MENU:
+      button = gtk_menu_button_new ();
+      gtk_widget_destroy (gtk_bin_get_child (GTK_BIN (button)));
+
+      w = gtk_label_new (label);
+      gtk_widget_show (w);
+      gtk_container_add (GTK_CONTAINER (button), w);
+      break;
+    case CHILD_TOGGLE:
+      button = gtk_toggle_button_new_with_label (label);
+      break;
+    case CHILD_NORMAL:
+    default:
+      button = gtk_button_new_with_label (label);
+      break;
+    }
+
+  gtk_style_context_add_class (gtk_widget_get_style_context (button), "raised");
+  gtk_style_context_add_class (gtk_widget_get_style_context (button), "text-button");
+
+  return button;
+}
+
+static GtkSizeGroup *
+get_vertical_size_group (GdMainToolbar *self)
+{
+  GtkSizeGroup *retval;
+  GtkWidget *dummy;
+  GtkToolItem *container;
+
+  dummy = get_text_button ("Dummy", CHILD_NORMAL);
+  container = gtk_tool_item_new ();
+  gtk_widget_set_no_show_all (GTK_WIDGET (container), TRUE);
+  gtk_container_add (GTK_CONTAINER (container), dummy);
+  gtk_toolbar_insert (GTK_TOOLBAR (self), container, -1);
+
+  retval = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
+  gtk_size_group_add_widget (retval, dummy);
+
+  return retval;
+}
+
+gboolean
+gd_main_toolbar_get_show_modes (GdMainToolbar *self)
+{
+  return self->priv->show_modes;
+}
+
+void
+gd_main_toolbar_set_show_modes (GdMainToolbar *self,
+                                gboolean show_modes)
+{
+  if (self->priv->show_modes == show_modes)
+    return;
+
+  self->priv->show_modes = show_modes;
+  if (self->priv->show_modes)
+    {
+      gtk_widget_set_no_show_all (self->priv->labels_grid, TRUE);
+      gtk_widget_hide (self->priv->labels_grid);
+
+      gtk_widget_set_valign (self->priv->center_grid, GTK_ALIGN_FILL);
+      gtk_widget_set_no_show_all (self->priv->modes_box, FALSE);
+      gtk_widget_show_all (self->priv->modes_box);
+    }
+  else
+    {
+      gtk_widget_set_no_show_all (self->priv->modes_box, TRUE);
+      gtk_widget_hide (self->priv->modes_box);
+
+      gtk_widget_set_valign (self->priv->center_grid, GTK_ALIGN_CENTER);
+      gtk_widget_set_no_show_all (self->priv->labels_grid, FALSE);
+      gtk_widget_show_all (self->priv->labels_grid);
+    }
+
+  g_object_notify (G_OBJECT (self), "show-modes");
+}
+
+static void
+gd_main_toolbar_set_property (GObject      *object,
+                              guint         prop_id,
+                              const GValue *value,
+                              GParamSpec   *pspec)
+{
+
+  GdMainToolbar *self = GD_MAIN_TOOLBAR (object);
+
+  switch (prop_id)
+    {
+    case PROP_SHOW_MODES:
+      gd_main_toolbar_set_show_modes (GD_MAIN_TOOLBAR (self), g_value_get_boolean (value));
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+    }
+}
+
+static void
+gd_main_toolbar_get_property (GObject    *object,
+                              guint       prop_id,
+                              GValue     *value,
+                              GParamSpec *pspec)
+{
+  GdMainToolbar *self = GD_MAIN_TOOLBAR (object);
+
+  switch (prop_id)
+    {
+    case PROP_SHOW_MODES:
+      g_value_set_boolean (value, self->priv->show_modes);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+    }
+}
+
+static void
+gd_main_toolbar_constructed (GObject *obj)
+{
+  GdMainToolbar *self = GD_MAIN_TOOLBAR (obj);
+  GtkToolbar *tb = GTK_TOOLBAR (obj);
+  GtkWidget *grid;
+
+  G_OBJECT_CLASS (gd_main_toolbar_parent_class)->constructed (obj);
+
+  self->priv->vertical_size_group = get_vertical_size_group (self);
+
+  /* left section */
+  self->priv->left_group = gtk_tool_item_new ();
+  gtk_widget_set_margin_end (GTK_WIDGET (self->priv->left_group), 12);
+  gtk_toolbar_insert (tb, self->priv->left_group, -1);
+  gtk_size_group_add_widget (self->priv->vertical_size_group,
+                             GTK_WIDGET (self->priv->left_group));
+
+  /* left button group */
+  self->priv->left_grid = gtk_grid_new ();
+  gtk_grid_set_column_spacing (GTK_GRID (self->priv->left_grid), 12);
+  gtk_container_add (GTK_CONTAINER (self->priv->left_group), self->priv->left_grid);
+  gtk_widget_set_halign (self->priv->left_grid, GTK_ALIGN_START);
+
+  /* center section */
+  self->priv->center_group = gtk_tool_item_new ();
+  gtk_tool_item_set_expand (self->priv->center_group, TRUE);
+  gtk_toolbar_insert (tb, self->priv->center_group, -1);
+  self->priv->center_grid = gtk_grid_new ();
+  gtk_widget_set_halign (self->priv->center_grid, GTK_ALIGN_CENTER);
+  gtk_widget_set_valign (self->priv->center_grid, GTK_ALIGN_CENTER);
+  gtk_container_add (GTK_CONTAINER (self->priv->center_group), self->priv->center_grid);
+  gtk_size_group_add_widget (self->priv->vertical_size_group,
+                             GTK_WIDGET (self->priv->center_group));
+
+  /* centered label group */
+  self->priv->labels_grid = grid = gtk_grid_new ();
+  gtk_grid_set_column_spacing (GTK_GRID (grid), 12);
+  gtk_container_add (GTK_CONTAINER (self->priv->center_grid), grid);
+
+  self->priv->title_label = gtk_label_new (NULL);
+  gtk_label_set_ellipsize (GTK_LABEL (self->priv->title_label), PANGO_ELLIPSIZE_END);
+  gtk_container_add (GTK_CONTAINER (grid), self->priv->title_label);
+
+  self->priv->detail_label = gtk_label_new (NULL);
+  gtk_label_set_ellipsize (GTK_LABEL (self->priv->detail_label), PANGO_ELLIPSIZE_END);
+  gtk_widget_set_no_show_all (self->priv->detail_label, TRUE);
+  gtk_style_context_add_class (gtk_widget_get_style_context (self->priv->detail_label), "dim-label");
+  gtk_container_add (GTK_CONTAINER (grid), self->priv->detail_label);
+
+  /* centered mode group */
+  self->priv->modes_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+  gtk_box_set_homogeneous (GTK_BOX (self->priv->modes_box), TRUE);
+  gtk_widget_set_no_show_all (self->priv->modes_box, TRUE);
+  gtk_style_context_add_class (gtk_widget_get_style_context (self->priv->modes_box), "linked");
+  gtk_container_add (GTK_CONTAINER (self->priv->center_grid), self->priv->modes_box);
+
+  /* right section */
+  self->priv->right_group = gtk_tool_item_new ();
+  gtk_widget_set_margin_start (GTK_WIDGET (self->priv->right_group), 12);
+  gtk_toolbar_insert (tb, self->priv->right_group, -1);
+  gtk_size_group_add_widget (self->priv->vertical_size_group,
+                             GTK_WIDGET (self->priv->right_group));
+
+  self->priv->right_grid = gtk_grid_new ();
+  gtk_grid_set_column_spacing (GTK_GRID (self->priv->right_grid), 12);
+  gtk_container_add (GTK_CONTAINER (self->priv->right_group), self->priv->right_grid);
+  gtk_widget_set_halign (self->priv->right_grid, GTK_ALIGN_END);
+
+  self->priv->size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+  gtk_size_group_add_widget (self->priv->size_group, GTK_WIDGET (self->priv->left_group));
+  gtk_size_group_add_widget (self->priv->size_group, GTK_WIDGET (self->priv->right_group));
+}
+
+static void
+gd_main_toolbar_init (GdMainToolbar *self)
+{
+  self->priv = gd_main_toolbar_get_instance_private (self);
+}
+
+static void
+gd_main_toolbar_class_init (GdMainToolbarClass *klass)
+{
+  GObjectClass *oclass;
+
+  oclass = G_OBJECT_CLASS (klass);
+  oclass->constructed = gd_main_toolbar_constructed;
+  oclass->set_property = gd_main_toolbar_set_property;
+  oclass->get_property = gd_main_toolbar_get_property;
+  oclass->dispose = gd_main_toolbar_dispose;
+
+  g_object_class_install_property (oclass,
+                                   PROP_SHOW_MODES,
+                                   g_param_spec_boolean ("show-modes",
+                                                         "Show Modes",
+                                                         "Show Modes",
+                                                         FALSE,
+                                                         G_PARAM_READWRITE));
+}
+
+void
+gd_main_toolbar_clear (GdMainToolbar *self)
+{
+  /* reset labels */
+  gtk_label_set_text (GTK_LABEL (self->priv->title_label), "");
+  gtk_label_set_text (GTK_LABEL (self->priv->detail_label), "");
+
+  /* clear all added buttons */
+  gtk_container_foreach (GTK_CONTAINER (self->priv->left_grid),
+                         (GtkCallback) gtk_widget_destroy, self);
+  gtk_container_foreach (GTK_CONTAINER (self->priv->modes_box),
+                         (GtkCallback) gtk_widget_destroy, self);
+  gtk_container_foreach (GTK_CONTAINER (self->priv->right_grid),
+                         (GtkCallback) gtk_widget_destroy, self);
+}
+
+/**
+ * gd_main_toolbar_set_labels:
+ * @self:
+ * @primary: (allow-none):
+ * @detail: (allow-none):
+ *
+ */
+void
+gd_main_toolbar_set_labels (GdMainToolbar *self,
+                            const gchar *primary,
+                            const gchar *detail)
+{
+  gchar *real_primary = NULL;
+
+  if (primary != NULL)
+    real_primary = g_markup_printf_escaped ("<b>%s</b>", primary);
+
+  if (real_primary == NULL)
+    {
+      gtk_label_set_markup (GTK_LABEL (self->priv->title_label), "");
+      gtk_widget_hide (self->priv->title_label);
+    }
+  else
+    {
+      gtk_label_set_markup (GTK_LABEL (self->priv->title_label), real_primary);
+      gtk_widget_show (self->priv->title_label);
+    }
+
+  if (detail == NULL)
+    {
+      gtk_label_set_text (GTK_LABEL (self->priv->detail_label), "");
+      gtk_widget_hide (self->priv->detail_label);
+    }
+  else
+    {
+      gtk_label_set_text (GTK_LABEL (self->priv->detail_label), detail);
+      gtk_widget_show (self->priv->detail_label);
+    }
+
+  g_free (real_primary);
+}
+
+GtkWidget *
+gd_main_toolbar_new (void)
+{
+  return g_object_new (GD_TYPE_MAIN_TOOLBAR, NULL);
+}
+
+static GtkWidget *
+add_button_internal (GdMainToolbar *self,
+                     const gchar *icon_name,
+                     const gchar *label,
+                     gboolean pack_start,
+                     ChildType type)
+{
+  GtkWidget *button;
+
+  if (icon_name != NULL)
+    {
+      button = get_symbolic_button (icon_name, type);
+      if (label != NULL)
+        gtk_widget_set_tooltip_text (button, label);
+    }
+  else if (label != NULL)
+    {
+      button = get_text_button (label, type);
+    }
+  else
+    {
+      button = get_empty_button (type);
+    }
+
+  gd_main_toolbar_add_widget (self, button, pack_start);
+
+  gtk_widget_show_all (button);
+
+  return button;
+}
+
+/**
+ * gd_main_toolbar_set_labels_menu:
+ * @self:
+ * @menu: (allow-none):
+ *
+ */
+void
+gd_main_toolbar_set_labels_menu (GdMainToolbar *self,
+                                 GMenuModel    *menu)
+{
+  GtkWidget *button, *grid, *w;
+
+  if (menu == NULL &&
+      ((gtk_widget_get_parent (self->priv->labels_grid) == self->priv->center_grid) ||
+       self->priv->center_menu_child == NULL))
+    return;
+
+  if (menu != NULL)
+    {
+      g_object_ref (self->priv->labels_grid);
+      gtk_container_remove (GTK_CONTAINER (self->priv->center_grid),
+                            self->priv->labels_grid);
+
+      self->priv->center_menu_child = grid = gtk_grid_new ();
+      gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
+      gtk_container_add (GTK_CONTAINER (grid), self->priv->labels_grid);
+      g_object_unref (self->priv->labels_grid);
+
+      w = gtk_image_new_from_icon_name ("pan-down-symbolic", GTK_ICON_SIZE_BUTTON);
+      gtk_container_add (GTK_CONTAINER (grid), w);
+
+      self->priv->center_menu = button = gtk_menu_button_new ();
+      gtk_style_context_add_class (gtk_widget_get_style_context (self->priv->center_menu),
+                                   "selection-menu");
+      gtk_widget_destroy (gtk_bin_get_child (GTK_BIN (button)));
+      gtk_widget_set_halign (button, GTK_ALIGN_CENTER);
+      gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (button), menu);
+      gtk_container_add (GTK_CONTAINER (self->priv->center_menu), grid);
+
+      gtk_container_add (GTK_CONTAINER (self->priv->center_grid), button);
+    }
+  else
+    {
+      g_object_ref (self->priv->labels_grid);
+      gtk_container_remove (GTK_CONTAINER (self->priv->center_menu_child),
+                            self->priv->labels_grid);
+      gtk_widget_destroy (self->priv->center_menu);
+
+      self->priv->center_menu = NULL;
+      self->priv->center_menu_child = NULL;
+
+      gtk_container_add (GTK_CONTAINER (self->priv->center_grid),
+                         self->priv->labels_grid);
+      g_object_unref (self->priv->labels_grid);
+    }
+
+  gtk_widget_show_all (self->priv->center_grid);
+}
+
+/**
+ * gd_main_toolbar_add_mode:
+ * @self:
+ * @label:
+ *
+ * Returns: (transfer none):
+ */
+GtkWidget *
+gd_main_toolbar_add_mode (GdMainToolbar *self,
+                          const gchar *label)
+{
+  GtkWidget *button;
+  GList *group;
+
+  button = gtk_radio_button_new_with_label (NULL, label);
+  gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE);
+  gtk_widget_set_size_request (button, 100, -1);
+  gtk_style_context_add_class (gtk_widget_get_style_context (button), "raised");
+  gtk_style_context_add_class (gtk_widget_get_style_context (button), "text-button");
+
+  group = gtk_container_get_children (GTK_CONTAINER (self->priv->modes_box));
+  if (group != NULL)
+    {
+      gtk_radio_button_join_group (GTK_RADIO_BUTTON (button), GTK_RADIO_BUTTON (group->data));
+      g_list_free (group);
+    }
+
+  gtk_container_add (GTK_CONTAINER (self->priv->modes_box), button);
+  gtk_widget_show (button);
+
+  return button;
+}
+
+/**
+ * gd_main_toolbar_add_button:
+ * @self:
+ * @icon_name: (allow-none):
+ * @label: (allow-none):
+ * @pack_start:
+ *
+ * Returns: (transfer none):
+ */
+GtkWidget *
+gd_main_toolbar_add_button (GdMainToolbar *self,
+                            const gchar *icon_name,
+                            const gchar *label,
+                            gboolean pack_start)
+{
+  return add_button_internal (self, icon_name, label, pack_start, CHILD_NORMAL);
+}
+
+/**
+ * gd_main_toolbar_add_menu:
+ * @self:
+ * @icon_name: (allow-none):
+ * @label: (allow-none):
+ * @pack_start:
+ *
+ * Returns: (transfer none):
+ */
+GtkWidget *
+gd_main_toolbar_add_menu (GdMainToolbar *self,
+                          const gchar *icon_name,
+                          const gchar *label,
+                          gboolean pack_start)
+{
+  return add_button_internal (self, icon_name, label, pack_start, CHILD_MENU);
+}
+
+/**
+ * gd_main_toolbar_add_toggle:
+ * @self:
+ * @icon_name: (allow-none):
+ * @label: (allow-none):
+ * @pack_start:
+ *
+ * Returns: (transfer none):
+ */
+GtkWidget *
+gd_main_toolbar_add_toggle (GdMainToolbar *self,
+                            const gchar *icon_name,
+                            const gchar *label,
+                            gboolean pack_start)
+{
+  return add_button_internal (self, icon_name, label, pack_start, CHILD_TOGGLE);
+}
+
+/**
+ * gd_main_toolbar_add_widget:
+ * @self:
+ * @widget:
+ * @pack_start:
+ *
+ */
+void
+gd_main_toolbar_add_widget (GdMainToolbar *self,
+                            GtkWidget *widget,
+                            gboolean pack_start)
+{
+  if (pack_start)
+    gtk_container_add (GTK_CONTAINER (self->priv->left_grid), widget);
+  else
+    gtk_container_add (GTK_CONTAINER (self->priv->right_grid), widget);
+}
+
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/105.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/105.html new file mode 100644 index 00000000..1c7d138c --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/105.html @@ -0,0 +1,631 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * Copyright (C) 2011 Red Hat, 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., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * The Sushi project hereby grant permission for non-gpl compatible GStreamer
+ * plugins to be used and distributed together with GStreamer and Sushi. This
+ * permission is above and beyond the permissions granted by the GPL license
+ * Sushi is covered by.
+ *
+ * Authors: Cosimo Cecchi <cosimoc@redhat.com>
+ *
+ */
+
+#include "sushi-font-loader.h"
+
+#include <stdlib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <ft2build.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include FT_FREETYPE_H
+
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+typedef struct {
+  FT_Library library;
+  FT_Long face_index;
+  GFile *file;
+
+  gchar *face_contents;
+  gsize face_length;
+} FontLoadJob;
+
+static FontLoadJob *
+font_load_job_new (FT_Library library,
+                   const gchar *uri,
+                   gint face_index,
+                   GAsyncReadyCallback callback,
+                   gpointer user_data)
+{
+  FontLoadJob *job = g_slice_new0 (FontLoadJob);
+
+  job->library = library;
+  job->face_index = (FT_Long) face_index;
+  job->file = g_file_new_for_uri (uri);
+
+  return job;
+}
+
+static void
+font_load_job_free (FontLoadJob *job)
+{
+  g_clear_object (&job->file);
+
+  g_slice_free (FontLoadJob, job);
+}
+
+static FT_Face
+create_face_from_contents (FontLoadJob *job,
+                           gchar **contents,
+                           GError **error)
+{
+  FT_Error ft_error;
+  FT_Face retval;
+
+  ft_error = FT_New_Memory_Face (job->library,
+                                 (const FT_Byte *) job->face_contents,
+                                 (FT_Long) job->face_length,
+                                 job->face_index,
+                                 &retval);
+
+  if (ft_error != 0) {
+    gchar *uri;
+    uri = g_file_get_uri (job->file);
+    g_set_error (error, G_IO_ERROR, 0,
+                 "Unable to read the font face file '%s'", uri);
+    retval = NULL;
+    g_free (job->face_contents);
+    g_free (uri);
+  } else {
+    *contents = job->face_contents;
+  }
+
+  return retval;
+}
+
+static void
+font_load_job_do_load (FontLoadJob *job,
+                       GError **error)
+{
+  gchar *contents;
+  gsize length;
+
+  g_file_load_contents (job->file, NULL,
+                        &contents, &length, NULL, error);
+
+  if ((error != NULL) && (*error == NULL)) {
+    job->face_contents = contents;
+    job->face_length = length;
+  }
+}
+
+static void
+font_load_job (GTask *task,
+	       gpointer source_object,
+	       gpointer user_data,
+               GCancellable *cancellable)
+{
+  FontLoadJob *job = user_data;
+  GError *error = NULL;
+
+  font_load_job_do_load (job, &error);
+
+  if (error != NULL)
+    g_task_return_error (task, error);
+  else
+    g_task_return_boolean (task, TRUE);
+}
+
+/**
+ * sushi_new_ft_face_from_uri: (skip)
+ *
+ */
+FT_Face
+sushi_new_ft_face_from_uri (FT_Library library,
+                            const gchar *uri,
+                            gint face_index,
+                            gchar **contents,
+                            GError **error)
+{
+  FontLoadJob *job = NULL;
+  FT_Face face;
+
+  job = font_load_job_new (library, uri, face_index, NULL, NULL);
+  font_load_job_do_load (job, error);
+
+  if ((error != NULL) && (*error != NULL)) {
+    font_load_job_free (job);
+    return NULL;
+  }
+
+  face = create_face_from_contents (job, contents, error);
+  font_load_job_free (job);
+
+  return face;
+}
+
+/**
+ * sushi_new_ft_face_from_uri_async: (skip)
+ *
+ */
+void
+sushi_new_ft_face_from_uri_async (FT_Library library,
+                                  const gchar *uri,
+                                  gint face_index,
+                                  GAsyncReadyCallback callback,
+                                  gpointer user_data)
+{
+  FontLoadJob *job = font_load_job_new (library, uri, face_index, callback, user_data);
+  GTask *task;
+
+  task = g_task_new (NULL, NULL, callback, user_data);
+  g_task_set_task_data (task, job, (GDestroyNotify) font_load_job_free);
+  g_task_run_in_thread (task, font_load_job);
+  g_object_unref (task);
+}
+
+/**
+ * sushi_new_ft_face_from_uri_finish: (skip)
+ *
+ */
+FT_Face
+sushi_new_ft_face_from_uri_finish (GAsyncResult *result,
+                                   gchar **contents,
+                                   GError **error)
+{
+  FontLoadJob *job;
+
+  if (!g_task_propagate_boolean (G_TASK (result), error))
+     return NULL;
+
+  job = g_task_get_task_data (G_TASK (result));
+
+  return create_face_from_contents (job, contents, error);
+}
+
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/106.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/106.html new file mode 100644 index 00000000..032c6fa8 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/106.html @@ -0,0 +1,1749 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * Copyright (C) 2011 Red Hat, 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., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * The Sushi project hereby grant permission for non-gpl compatible GStreamer
+ * plugins to be used and distributed together with GStreamer and Sushi. This
+ * permission is above and beyond the permissions granted by the GPL license
+ * Sushi is covered by.
+ *
+ * Authors: Cosimo Cecchi <cosimoc@redhat.com>
+ *
+ */
+
+#include "sushi-font-widget.h"
+#include "sushi-font-loader.h"
+
+#include <math.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+enum {
+  PROP_URI = 1,
+  PROP_FACE_INDEX,
+  NUM_PROPERTIES
+};
+
+enum {
+  LOADED,
+  ERROR,
+  NUM_SIGNALS
+};
+
+struct _SushiFontWidgetPrivate {
+  gchar *uri;
+  gint face_index;
+
+  FT_Library library;
+  FT_Face face;
+  gchar *face_contents;
+
+  const gchar *lowercase_text;
+  const gchar *uppercase_text;
+  const gchar *punctuation_text;
+
+  gchar *sample_string;
+
+  gchar *font_name;
+};
+
+static GParamSpec *properties[NUM_PROPERTIES] = { NULL, };
+static guint signals[NUM_SIGNALS] = { 0, };
+
+G_DEFINE_TYPE_WITH_PRIVATE (SushiFontWidget, sushi_font_widget, GTK_TYPE_DRAWING_AREA);
+
+#define SURFACE_SIZE 4
+#define SECTION_SPACING 16
+#define LINE_SPACING 2
+
+static const gchar lowercase_text_stock[] = "abcdefghijklmnopqrstuvwxyz";
+static const gchar uppercase_text_stock[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+static const gchar punctuation_text_stock[] = "0123456789.:,;(*!?')";
+
+/* adapted from gnome-utils:font-viewer/font-view.c
+ *
+ * Copyright (C) 2002-2003  James Henstridge <james@daa.com.au>
+ * Copyright (C) 2010 Cosimo Cecchi <cosimoc@gnome.org>
+ *
+ * License: GPLv2+
+ */
+static void
+draw_string (SushiFontWidget *self,
+             cairo_t *cr,
+             GtkBorder padding,
+	     const gchar *text,
+	     gint *pos_y)
+{
+  cairo_font_extents_t font_extents;
+  cairo_text_extents_t extents;
+  GtkTextDirection text_dir;
+  gint pos_x;
+
+  text_dir = gtk_widget_get_direction (GTK_WIDGET (self));
+
+  cairo_font_extents (cr, &font_extents);
+  cairo_text_extents (cr, text, &extents);
+
+  if (pos_y != NULL)
+    *pos_y += font_extents.ascent + font_extents.descent +
+      extents.y_advance + LINE_SPACING / 2;
+  if (text_dir == GTK_TEXT_DIR_LTR)
+    pos_x = padding.left;
+  else {
+    pos_x = gtk_widget_get_allocated_width (GTK_WIDGET (self)) -
+      extents.x_advance - padding.right;
+  }
+
+  cairo_move_to (cr, pos_x, *pos_y);
+  cairo_show_text (cr, text);
+
+  *pos_y += LINE_SPACING / 2;
+}
+
+static gboolean
+check_font_contain_text (FT_Face face,
+                         const gchar *text)
+{
+  gunichar *string;
+  glong len, idx, map;
+  FT_CharMap charmap;
+  gboolean retval = FALSE;
+
+  string = g_utf8_to_ucs4_fast (text, -1, &len);
+
+  for (map = 0; map < face->num_charmaps; map++) {
+    charmap = face->charmaps[map];
+    FT_Set_Charmap (face, charmap);
+
+    retval = TRUE;
+
+    for (idx = 0; idx < len; idx++) {
+      gunichar c = string[idx];
+
+      if (!FT_Get_Char_Index (face, c)) {
+        retval = FALSE;
+        break;
+      }
+    }
+
+    if (retval)
+      break;
+  }
+
+  g_free (string);
+
+  return retval;
+}
+
+static gchar *
+build_charlist_for_face (FT_Face face,
+                         gint *length)
+{
+  GString *string;
+  gulong c;
+  guint glyph;
+  gint total_chars = 0;
+
+  string = g_string_new (NULL);
+
+  c = FT_Get_First_Char (face, &glyph);
+
+  while (glyph != 0) {
+    g_string_append_unichar (string, (gunichar) c);
+    c = FT_Get_Next_Char (face, c, &glyph);
+    total_chars++;
+  }
+
+  if (length)
+    *length = total_chars;
+
+  return g_string_free (string, FALSE);
+}
+
+static gchar *
+random_string_from_available_chars (FT_Face face,
+                                    gint n_chars)
+{
+  gchar *chars;
+  gint idx, rand, total_chars;
+  GString *retval;
+  gchar *ptr, *end;<--- Variable 'end' can be declared as pointer to const
+
+  idx = 0;
+  chars = build_charlist_for_face (face, &total_chars);
+
+  if (total_chars == 0)
+    return NULL;
+
+  retval = g_string_new (NULL);
+
+  while (idx < n_chars) {
+    rand = g_random_int_range (0, total_chars);
+
+    ptr = g_utf8_offset_to_pointer (chars, rand);
+    end = g_utf8_find_next_char (ptr, NULL);
+
+    g_string_append_len (retval, ptr, end - ptr);
+    idx++;
+  }
+
+  return g_string_free (retval, FALSE);
+}
+
+static gboolean
+set_pango_sample_string (SushiFontWidget *self)
+{
+  const gchar *sample_string;
+  gboolean retval = FALSE;
+
+  sample_string = pango_language_get_sample_string (pango_language_from_string (NULL));
+  if (check_font_contain_text (self->priv->face, sample_string))
+    retval = TRUE;
+
+  if (!retval) {
+    sample_string = pango_language_get_sample_string (pango_language_from_string ("C"));
+    if (check_font_contain_text (self->priv->face, sample_string))
+      retval = TRUE;
+  }
+
+  if (retval) {
+    g_free (self->priv->sample_string);
+    self->priv->sample_string = g_strdup (sample_string);
+  }
+
+  return retval;
+}
+
+static void
+build_strings_for_face (SushiFontWidget *self)
+{
+  /* if we don't have lowercase/uppercase/punctuation text in the face,
+   * we omit it directly, and render a random text below.
+   */
+  if (check_font_contain_text (self->priv->face, lowercase_text_stock))
+    self->priv->lowercase_text = lowercase_text_stock;
+  else
+    self->priv->lowercase_text = NULL;
+
+  if (check_font_contain_text (self->priv->face, uppercase_text_stock))
+    self->priv->uppercase_text = uppercase_text_stock;
+  else
+    self->priv->uppercase_text = NULL;
+
+  if (check_font_contain_text (self->priv->face, punctuation_text_stock))
+    self->priv->punctuation_text = punctuation_text_stock;
+  else
+    self->priv->punctuation_text = NULL;
+
+  if (!set_pango_sample_string (self))
+    self->priv->sample_string = random_string_from_available_chars (self->priv->face, 36);
+
+  g_free (self->priv->font_name);
+  self->priv->font_name = NULL;
+
+  if (self->priv->face->family_name != NULL) {
+    gchar *font_name =
+      g_strconcat (self->priv->face->family_name, " ",
+                   self->priv->face->style_name, NULL);
+
+    if (check_font_contain_text (self->priv->face, font_name))
+      self->priv->font_name = font_name;
+    else
+      g_free (font_name);
+  }
+}
+
+static gint *
+build_sizes_table (FT_Face face,
+		   gint *n_sizes,
+		   gint *alpha_size,
+		   gint *title_size)
+{
+  gint *sizes = NULL;
+  gint i;
+
+  /* work out what sizes to render */
+  if (FT_IS_SCALABLE (face)) {
+    *n_sizes = 14;
+    sizes = g_new (gint, *n_sizes);
+    sizes[0] = 8;
+    sizes[1] = 10;
+    sizes[2] = 12;
+    sizes[3] = 18;
+    sizes[4] = 24;
+    sizes[5] = 36;
+    sizes[6] = 48;
+    sizes[7] = 72;
+    sizes[8] = 96;
+    sizes[9] = 120;
+    sizes[10] = 144;
+    sizes[11] = 168;
+    sizes[12] = 192;
+    sizes[13] = 216;
+
+    *alpha_size = 24;
+    *title_size = 48;
+  } else {
+    gint alpha_diff = G_MAXINT;
+    gint title_diff = G_MAXINT;
+
+    /* use fixed sizes */
+    *n_sizes = face->num_fixed_sizes;
+    sizes = g_new (gint, *n_sizes);
+    *alpha_size = 0;
+
+    for (i = 0; i < face->num_fixed_sizes; i++) {
+      sizes[i] = face->available_sizes[i].height;
+
+      if ((gint) (abs (sizes[i] - 24)) < alpha_diff) {
+        alpha_diff = (gint) abs (sizes[i] - 24);
+        *alpha_size = sizes[i];
+      }
+      if ((gint) (abs (sizes[i] - 24)) < title_diff) {
+        title_diff = (gint) abs (sizes[i] - 24);
+        *title_size = sizes[i];
+      }
+    }
+  }
+
+  return sizes;
+}
+
+static void
+sushi_font_widget_size_request (GtkWidget *drawing_area,
+                                gint *width,
+                                gint *height,
+                                gint *min_height)
+{
+  SushiFontWidget *self = SUSHI_FONT_WIDGET (drawing_area);
+  SushiFontWidgetPrivate *priv = self->priv;<--- Variable 'priv' can be declared as pointer to const
+  gint i, pixmap_width, pixmap_height;
+  cairo_text_extents_t extents;
+  cairo_font_extents_t font_extents;
+  cairo_font_face_t *font;
+  gint *sizes = NULL, n_sizes, alpha_size, title_size;
+  cairo_t *cr;
+  cairo_surface_t *surface;
+  FT_Face face = priv->face;
+  GtkStyleContext *context;
+  GtkStateFlags state;
+  GtkBorder padding;
+
+  if (face == NULL) {
+    if (width != NULL)
+      *width = 1;
+    if (height != NULL)
+      *height = 1;
+    if (min_height != NULL)
+      *min_height = 1;
+
+    return;
+  }
+
+  if (min_height != NULL)
+    *min_height = -1;
+
+  surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
+                                        SURFACE_SIZE, SURFACE_SIZE);
+  cr = cairo_create (surface);
+  context = gtk_widget_get_style_context (drawing_area);
+  state = gtk_style_context_get_state (context);
+  gtk_style_context_get_padding (context, state, &padding);
+
+  sizes = build_sizes_table (face, &n_sizes, &alpha_size, &title_size);
+
+  /* calculate size of pixmap to use */
+  pixmap_width = padding.left + padding.right;
+  pixmap_height = padding.top + padding.bottom;
+
+  font = cairo_ft_font_face_create_for_ft_face (face, 0);
+  cairo_set_font_face (cr, font);
+  cairo_font_face_destroy (font);
+
+  if (self->priv->font_name != NULL) {
+      cairo_set_font_size (cr, title_size);
+      cairo_font_extents (cr, &font_extents);
+      cairo_text_extents (cr, self->priv->font_name, &extents);
+      pixmap_height += font_extents.ascent + font_extents.descent +
+        extents.y_advance + LINE_SPACING;
+      pixmap_width = MAX (pixmap_width, extents.width + padding.left + padding.right);
+  }
+
+  pixmap_height += SECTION_SPACING / 2;
+  cairo_set_font_size (cr, alpha_size);
+  cairo_font_extents (cr, &font_extents);
+
+  if (self->priv->lowercase_text != NULL) {
+    cairo_text_extents (cr, self->priv->lowercase_text, &extents);
+    pixmap_height += font_extents.ascent + font_extents.descent +
+      extents.y_advance + LINE_SPACING;
+    pixmap_width = MAX (pixmap_width, extents.width + padding.left + padding.right);
+  }
+
+  if (self->priv->uppercase_text != NULL) {
+    cairo_text_extents (cr, self->priv->uppercase_text, &extents);
+    pixmap_height += font_extents.ascent + font_extents.descent +
+      extents.y_advance + LINE_SPACING;
+    pixmap_width = MAX (pixmap_width, extents.width + padding.left + padding.right);
+  }
+
+  if (self->priv->punctuation_text != NULL) {
+    cairo_text_extents (cr, self->priv->punctuation_text, &extents);
+    pixmap_height += font_extents.ascent + font_extents.descent +
+      extents.y_advance + LINE_SPACING;
+    pixmap_width = MAX (pixmap_width, extents.width + padding.left + padding.right);
+  }
+
+  if (self->priv->sample_string != NULL) {
+    pixmap_height += SECTION_SPACING;
+
+    for (i = 0; i < n_sizes; i++) {
+      cairo_set_font_size (cr, sizes[i]);
+      cairo_font_extents (cr, &font_extents);
+      cairo_text_extents (cr, self->priv->sample_string, &extents);
+      pixmap_height += font_extents.ascent + font_extents.descent +
+        extents.y_advance + LINE_SPACING;
+      pixmap_width = MAX (pixmap_width, extents.width + padding.left + padding.right);
+
+      if ((i == 7) && (min_height != NULL))
+        *min_height = pixmap_height;
+    }
+  }
+
+  pixmap_height += padding.bottom + SECTION_SPACING;
+
+  if (min_height != NULL && *min_height == -1)
+    *min_height = pixmap_height;
+
+  if (width != NULL)
+    *width = pixmap_width;
+
+  if (height != NULL)
+    *height = pixmap_height;
+
+  cairo_destroy (cr);
+  cairo_surface_destroy (surface);
+  g_free (sizes);
+}
+
+static void
+sushi_font_widget_get_preferred_width (GtkWidget *drawing_area,
+                                       gint *minimum_width,
+                                       gint *natural_width)
+{
+  gint width;
+
+  sushi_font_widget_size_request (drawing_area, &width, NULL, NULL);
+
+  *minimum_width = *natural_width = width;
+}
+
+static void
+sushi_font_widget_get_preferred_height (GtkWidget *drawing_area,
+                                        gint *minimum_height,
+                                        gint *natural_height)
+{
+  gint height, min_height;
+
+  sushi_font_widget_size_request (drawing_area, NULL, &height, &min_height);
+
+  *minimum_height = min_height;
+  *natural_height = height;
+}
+
+static gboolean
+sushi_font_widget_draw (GtkWidget *drawing_area,
+                        cairo_t *cr)
+{
+  SushiFontWidget *self = SUSHI_FONT_WIDGET (drawing_area);
+  SushiFontWidgetPrivate *priv = self->priv;<--- Variable 'priv' can be declared as pointer to const
+  gint *sizes = NULL, n_sizes, alpha_size, title_size, pos_y = 0, i;
+  cairo_font_face_t *font;
+  FT_Face face = priv->face;
+  GtkStyleContext *context;
+  GdkRGBA color;
+  GtkBorder padding;
+  GtkStateFlags state;
+  gint allocated_width, allocated_height;
+
+  if (face == NULL)
+    goto end;
+
+  context = gtk_widget_get_style_context (drawing_area);
+  state = gtk_style_context_get_state (context);
+
+  allocated_width = gtk_widget_get_allocated_width (drawing_area);
+  allocated_height = gtk_widget_get_allocated_height (drawing_area);
+
+  gtk_render_background (context, cr,
+                         0, 0, allocated_width, allocated_height);
+
+  gtk_style_context_get_color (context, state, &color);
+  gtk_style_context_get_padding (context, state, &padding);
+
+  gdk_cairo_set_source_rgba (cr, &color);
+
+  sizes = build_sizes_table (face, &n_sizes, &alpha_size, &title_size);
+
+  font = cairo_ft_font_face_create_for_ft_face (face, 0);
+  cairo_set_font_face (cr, font);
+  cairo_font_face_destroy (font);
+
+  /* draw text */
+
+  if (self->priv->font_name != NULL) {
+    cairo_set_font_size (cr, title_size);
+    draw_string (self, cr, padding, self->priv->font_name, &pos_y);
+  }
+
+  if (pos_y > allocated_height)
+    goto end;
+
+  pos_y += SECTION_SPACING / 2;
+  cairo_set_font_size (cr, alpha_size);
+
+  if (self->priv->lowercase_text != NULL)
+    draw_string (self, cr, padding, self->priv->lowercase_text, &pos_y);
+  if (pos_y > allocated_height)
+    goto end;
+
+  if (self->priv->uppercase_text != NULL)
+    draw_string (self, cr, padding, self->priv->uppercase_text, &pos_y);
+  if (pos_y > allocated_height)
+    goto end;
+
+  if (self->priv->punctuation_text != NULL)
+    draw_string (self, cr, padding, self->priv->punctuation_text, &pos_y);
+  if (pos_y > allocated_height)
+    goto end;
+
+  pos_y += SECTION_SPACING;
+
+  for (i = 0; i < n_sizes; i++) {
+    cairo_set_font_size (cr, sizes[i]);
+    draw_string (self, cr, padding, self->priv->sample_string, &pos_y);
+    if (pos_y > allocated_height)
+      break;
+  }
+
+ end:
+  g_free (sizes);
+
+  return FALSE;
+}
+
+static void
+font_face_async_ready_cb (GObject *object,
+                          GAsyncResult *result,
+                          gpointer user_data)
+{
+  SushiFontWidget *self = user_data;
+  GError *error = NULL;
+
+  self->priv->face =
+    sushi_new_ft_face_from_uri_finish (result,
+                                       &self->priv->face_contents,
+                                       &error);
+
+  if (error != NULL) {
+    g_signal_emit (self, signals[ERROR], 0, error->message);
+    g_print ("Can't load the font face: %s\n", error->message);
+    g_error_free (error);
+
+    return;
+  }
+
+  build_strings_for_face (self);
+
+  gtk_widget_queue_resize (GTK_WIDGET (self));
+  g_signal_emit (self, signals[LOADED], 0);
+}
+
+void
+sushi_font_widget_load (SushiFontWidget *self)
+{
+  sushi_new_ft_face_from_uri_async (self->priv->library,
+                                    self->priv->uri,
+                                    self->priv->face_index,
+                                    font_face_async_ready_cb,
+                                    self);
+}
+
+static void
+sushi_font_widget_init (SushiFontWidget *self)
+{
+  FT_Error err;
+
+  self->priv = sushi_font_widget_get_instance_private (self);
+
+  self->priv->face = NULL;
+  err = FT_Init_FreeType (&self->priv->library);
+
+  if (err != FT_Err_Ok)
+    g_error ("Unable to initialize FreeType");
+
+  gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (self)),
+                               GTK_STYLE_CLASS_VIEW);
+}
+
+static void
+sushi_font_widget_get_property (GObject *object,
+                                guint       prop_id,
+                                GValue     *value,
+                                GParamSpec *pspec)
+{
+  SushiFontWidget *self = SUSHI_FONT_WIDGET (object);
+
+  switch (prop_id) {
+  case PROP_URI:
+    g_value_set_string (value, self->priv->uri);
+    break;
+  case PROP_FACE_INDEX:
+    g_value_set_int (value, self->priv->face_index);
+    break;
+  default:
+    G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+    break;
+  }
+}
+
+static void
+sushi_font_widget_set_property (GObject *object,
+                               guint       prop_id,
+                               const GValue *value,
+                               GParamSpec *pspec)
+{
+  SushiFontWidget *self = SUSHI_FONT_WIDGET (object);
+
+  switch (prop_id) {
+  case PROP_URI:
+    self->priv->uri = g_value_dup_string (value);
+    break;
+  case PROP_FACE_INDEX:
+    self->priv->face_index = g_value_get_int (value);
+    break;
+  default:
+    G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+    break;
+  }
+}
+
+static void
+sushi_font_widget_finalize (GObject *object)
+{
+  SushiFontWidget *self = SUSHI_FONT_WIDGET (object);
+
+  g_free (self->priv->uri);
+
+  if (self->priv->face != NULL) {
+    FT_Done_Face (self->priv->face);
+    self->priv->face = NULL;
+  }
+
+  g_free (self->priv->font_name);
+  g_free (self->priv->sample_string);
+  g_free (self->priv->face_contents);
+
+  if (self->priv->library != NULL) {
+    FT_Done_FreeType (self->priv->library);
+    self->priv->library = NULL;
+  }
+
+  G_OBJECT_CLASS (sushi_font_widget_parent_class)->finalize (object);
+}
+
+static void
+sushi_font_widget_constructed (GObject *object)
+{
+  SushiFontWidget *self = SUSHI_FONT_WIDGET (object);
+
+  sushi_font_widget_load (self);
+
+  G_OBJECT_CLASS (sushi_font_widget_parent_class)->constructed (object);
+}
+
+static void
+sushi_font_widget_class_init (SushiFontWidgetClass *klass)
+{
+  GObjectClass *oclass = G_OBJECT_CLASS (klass);
+  GtkWidgetClass *wclass = GTK_WIDGET_CLASS (klass);
+
+  oclass->finalize = sushi_font_widget_finalize;
+  oclass->set_property = sushi_font_widget_set_property;
+  oclass->get_property = sushi_font_widget_get_property;
+  oclass->constructed = sushi_font_widget_constructed;
+
+  wclass->draw = sushi_font_widget_draw;
+  wclass->get_preferred_width = sushi_font_widget_get_preferred_width;
+  wclass->get_preferred_height = sushi_font_widget_get_preferred_height;
+
+  properties[PROP_URI] =
+    g_param_spec_string ("uri",
+                         "Uri", "Uri",
+                         NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
+  properties[PROP_FACE_INDEX] =
+    g_param_spec_int ("face-index",
+                      "Face index", "Face index",
+                      0, G_MAXINT,
+                      0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
+
+  signals[LOADED] =
+    g_signal_new ("loaded",
+                  G_TYPE_FROM_CLASS (klass),
+                  G_SIGNAL_RUN_FIRST,
+                  0, NULL, NULL,
+                  g_cclosure_marshal_VOID__VOID,
+                  G_TYPE_NONE, 0);
+  signals[ERROR] =
+    g_signal_new ("error",
+                  G_TYPE_FROM_CLASS (klass),
+                  G_SIGNAL_RUN_FIRST,
+                  0, NULL, NULL,
+                  g_cclosure_marshal_VOID__STRING,
+                  G_TYPE_NONE, 1, G_TYPE_STRING);
+
+  g_object_class_install_properties (oclass, NUM_PROPERTIES, properties);
+}
+
+SushiFontWidget *
+sushi_font_widget_new (const gchar *uri, gint face_index)
+{
+  return g_object_new (SUSHI_TYPE_FONT_WIDGET,
+                       "uri", uri,
+                       "face-index", face_index,
+                       NULL);
+}
+
+/**
+ * sushi_font_widget_get_ft_face: (skip)
+ *
+ */
+FT_Face
+sushi_font_widget_get_ft_face (SushiFontWidget *self)
+{
+  return self->priv->face;
+}
+
+const gchar *
+sushi_font_widget_get_uri (SushiFontWidget *self)
+{
+  return self->priv->uri;
+}
+
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/107.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/107.html new file mode 100644 index 00000000..2c87a8d6 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/107.html @@ -0,0 +1,483 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * Copyright (C) 2007 Bastien Nocera <hadess@hadess.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.
+ *
+ * The Totem project hereby grant permission for non-gpl compatible GStreamer
+ * plugins to be used and distributed together with GStreamer and Totem. This
+ * permission are above and beyond the permissions granted by the GPL license
+ * Totem is covered by.
+ *
+ * Monday 7th February 2005: Christian Schaller: Add exception clause.
+ * See license_change file for details.
+ *
+ */
+
+#include <config.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/gstdio.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 <stdlib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/stat.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/resource.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "totem-resources.h"
+
+#define MAX_HELPER_MEMORY (256 * 1024 * 1024)	/* 256 MB */
+#define MAX_HELPER_SECONDS (15)			/* 15 seconds */
+#define DEFAULT_SLEEP_TIME (30 * G_USEC_PER_SEC) /* 30 seconds */
+
+static guint sleep_time = DEFAULT_SLEEP_TIME;
+static gboolean finished = TRUE;
+
+static void
+set_resource_limits (const char *input)
+{
+	struct rlimit limit;
+	struct stat buf;
+	rlim_t max;
+
+	max = MAX_HELPER_MEMORY;
+
+	/* Set the maximum virtual size depending on the size
+	 * of the file to process, as we wouldn't be able to
+	 * mmap it otherwise */
+	if (input == NULL) {
+		max = MAX_HELPER_MEMORY;
+	} else if (g_stat (input, &buf) == 0) {
+		max = MAX_HELPER_MEMORY + buf.st_size;
+	} else if (g_str_has_prefix (input, "file://") != FALSE) {
+		char *file;
+		file = g_filename_from_uri (input, NULL, NULL);
+		if (file != NULL && g_stat (file, &buf) == 0)
+			max = MAX_HELPER_MEMORY + buf.st_size;
+		g_free (file);
+	}
+
+	limit.rlim_cur = max;
+	limit.rlim_max = max;
+
+	setrlimit (RLIMIT_DATA, &limit);
+
+	limit.rlim_cur = MAX_HELPER_SECONDS;
+	limit.rlim_max = MAX_HELPER_SECONDS;
+	setrlimit (RLIMIT_CPU, &limit);
+}
+
+G_GNUC_NORETURN static gpointer
+time_monitor (gpointer data)
+{
+	const char *app_name;
+
+	g_usleep (sleep_time);
+
+	if (finished != FALSE)
+		g_thread_exit (NULL);
+
+	app_name = g_get_application_name ();
+	if (app_name == NULL)
+		app_name = g_get_prgname ();
+	g_print ("%s couldn't process file: '%s'\n"
+		 "Reason: Took too much time to process.\n",
+		 app_name,
+		 (const char *) data);
+
+	exit (0);
+}
+
+void
+totem_resources_monitor_start (const char *input, gint wall_clock_time)
+{
+	set_resource_limits (input);
+
+	if (wall_clock_time < 0)
+		return;
+
+	if (wall_clock_time > 0)
+		sleep_time = wall_clock_time;
+
+	finished = FALSE;
+	g_thread_new ("time-monitor", time_monitor, (gpointer) input);
+}
+
+void
+totem_resources_monitor_stop (void)
+{
+	finished = TRUE;
+}
+
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/108.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/108.html new file mode 100644 index 00000000..2761dff8 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/108.html @@ -0,0 +1,903 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * This file is part of libslab.
+ *
+ * Copyright (c) 2006 Novell, Inc.
+ *
+ * Libslab 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.
+ *
+ * Libslab 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 libslab; 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 "app-shell.h"
+#include "app-resizer.h"
+
+static void app_resizer_size_allocate (GtkWidget * resizer, GtkAllocation * allocation);
+static gboolean app_resizer_paint_window (GtkWidget * widget, cairo_t * cr, AppShellData * app_data);
+
+G_DEFINE_TYPE (AppResizer, app_resizer, GTK_TYPE_LAYOUT);
+
+static void
+app_resizer_class_init (AppResizerClass * klass)
+{
+	GtkWidgetClass *widget_class;
+
+	widget_class = GTK_WIDGET_CLASS (klass);
+	widget_class->size_allocate = app_resizer_size_allocate;
+}
+
+static void
+app_resizer_init (AppResizer * window)
+{
+    gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (window)),
+                                 GTK_STYLE_CLASS_VIEW);
+}
+
+void
+remove_container_entries (GtkContainer * widget)
+{
+	GList *children, *l;
+
+	children = gtk_container_get_children (widget);
+	for (l = children; l; l = l->next)
+	{
+		GtkWidget *child = GTK_WIDGET (l->data);
+		gtk_container_remove (GTK_CONTAINER (widget), GTK_WIDGET (child));
+	}
+
+	if (children)
+		g_list_free (children);
+}
+
+static void
+resize_table (AppResizer *widget, GtkGrid * table, gint columns)
+{
+	remove_container_entries (GTK_CONTAINER (table));
+	widget->column = columns;
+}
+
+static void
+relayout_table (AppResizer *widget, GtkGrid * table, GList * element_list)<--- Parameter 'widget' can be declared as pointer to const
+{
+	gint row = 0, col = 0;
+	do
+	{
+		GtkWidget *element = GTK_WIDGET (element_list->data);
+		gtk_grid_attach (table, element, col, row, 1, 1);
+		col++;
+		if (col == widget->column)
+		{
+			col = 0;
+			row++;
+		}
+	}
+	while (NULL != (element_list = g_list_next (element_list)));
+}
+
+void
+app_resizer_layout_table_default (AppResizer * widget, GtkGrid * table, GList * element_list)
+{
+	resize_table (widget, table, widget->cur_num_cols);
+	relayout_table (widget, table, element_list);
+}
+
+static void
+relayout_tables (AppResizer * widget, gint num_cols)
+{
+	GtkGrid *table;
+	GList *table_list, *launcher_list;
+
+	for (table_list = widget->cached_tables_list; table_list != NULL;
+		table_list = g_list_next (table_list))
+	{
+		table = GTK_GRID (table_list->data);
+		launcher_list = gtk_container_get_children (GTK_CONTAINER (table));
+		launcher_list = g_list_reverse (launcher_list);	/* Fixme - ugly hack because table stores prepend */
+		resize_table (widget, table, num_cols);
+		relayout_table (widget, table, launcher_list);
+		g_list_free (launcher_list);
+	}
+}
+
+static gint
+calculate_num_cols (AppResizer * resizer, gint avail_width)
+{
+	if (resizer->table_elements_homogeneous)
+	{
+		gint num_cols;
+
+		if (resizer->cached_element_width == -1)
+		{
+			GtkGrid *table = GTK_GRID (resizer->cached_tables_list->data);
+			GList *children = gtk_container_get_children (GTK_CONTAINER (table));
+			GtkWidget *table_element = GTK_WIDGET (children->data);
+			gint natural_width;
+			g_list_free (children);
+
+			gtk_widget_get_preferred_width (table_element, NULL, &natural_width);
+			resizer->cached_element_width = natural_width;
+			resizer->cached_table_spacing = gtk_grid_get_column_spacing (table);
+		}
+
+		num_cols =
+			(avail_width +
+			resizer->cached_table_spacing) / (resizer->cached_element_width +
+			resizer->cached_table_spacing);
+		return num_cols;
+	}
+	else
+		g_assert_not_reached ();	/* Fixme - implement... */
+}
+
+static gint
+relayout_tables_if_needed (AppResizer * widget, gint avail_width, gint current_num_cols)
+{
+	gint num_cols = calculate_num_cols (widget, avail_width);
+	if (num_cols < 1)
+	{
+		num_cols = 1;	/* just horiz scroll if avail_width is less than one column */
+	}
+
+	if (current_num_cols != num_cols)
+	{
+		relayout_tables (widget, num_cols);
+		current_num_cols = num_cols;
+	}
+	return current_num_cols;
+}
+
+void
+app_resizer_set_table_cache (AppResizer * widget, GList * cache_list)
+{
+	widget->cached_tables_list = cache_list;
+}
+
+static void
+app_resizer_size_allocate (GtkWidget * widget, GtkAllocation * allocation)
+{
+	AppResizer *resizer = APP_RESIZER (widget);
+	GtkWidget *child = GTK_WIDGET (APP_RESIZER (resizer)->child);
+	GtkAllocation widget_allocation;
+	GtkRequisition child_requisition;
+
+	static gboolean first_time = TRUE;
+	gint new_num_cols;
+
+	if (first_time)
+	{
+		/* we are letting the first show be the "natural" size of the child widget so do nothing. */
+		if (GTK_WIDGET_CLASS (app_resizer_parent_class)->size_allocate)
+			(*GTK_WIDGET_CLASS (app_resizer_parent_class)->size_allocate) (widget, allocation);
+
+		first_time = FALSE;
+		gtk_widget_get_allocation (child, &widget_allocation);
+		gtk_layout_set_size (GTK_LAYOUT (resizer), widget_allocation.width,
+			widget_allocation.height);
+		return;
+	}
+
+	gtk_widget_get_preferred_size (child, &child_requisition, NULL);
+
+	if (!resizer->cached_tables_list)	/* if everthing is currently filtered out - just return */
+	{
+		GtkAllocation child_allocation;
+
+		if (GTK_WIDGET_CLASS (app_resizer_parent_class)->size_allocate)
+			(*GTK_WIDGET_CLASS (app_resizer_parent_class)->size_allocate) (widget, allocation);
+
+		/* We want the message to center itself and only scroll if it's bigger than the available real size. */
+		child_allocation.x = 0;
+		child_allocation.y = 0;
+		child_allocation.width = MAX (allocation->width, child_requisition.width);
+		child_allocation.height = MAX (allocation->height, child_requisition.height);
+
+		gtk_widget_size_allocate (child, &child_allocation);
+		gtk_layout_set_size (GTK_LAYOUT (resizer), child_allocation.width,
+			child_allocation.height);
+		return;
+	}
+	GtkRequisition other_requisiton;
+	gtk_widget_get_preferred_size (GTK_WIDGET (resizer->cached_tables_list->data), &other_requisiton, NULL);
+
+	new_num_cols =
+		relayout_tables_if_needed (APP_RESIZER (resizer), allocation->width,
+		resizer->cur_num_cols);
+	if (resizer->cur_num_cols != new_num_cols)
+	{
+		GtkRequisition req;
+
+		/* Have to do this so that it requests, and thus gets allocated, new amount */
+		gtk_widget_get_preferred_size (child, &req, NULL);
+
+		resizer->cur_num_cols = new_num_cols;
+	}
+
+	if (GTK_WIDGET_CLASS (app_resizer_parent_class)->size_allocate)
+		(*GTK_WIDGET_CLASS (app_resizer_parent_class)->size_allocate) (widget, allocation);
+	gtk_widget_get_allocation (child, &widget_allocation);
+	gtk_layout_set_size (GTK_LAYOUT (resizer), widget_allocation.width,
+		widget_allocation.height);
+}
+
+GtkWidget *
+app_resizer_new (GtkBox * child, gint initial_num_columns, gboolean homogeneous,
+	AppShellData * app_data)
+{
+	AppResizer *widget;
+
+	g_assert (child != NULL);
+
+	widget = g_object_new (APP_RESIZER_TYPE, NULL);
+	widget->cached_element_width = -1;
+	widget->cur_num_cols = initial_num_columns;
+	widget->table_elements_homogeneous = homogeneous;
+	widget->setting_style = FALSE;
+	widget->app_data = app_data;
+
+	g_signal_connect (widget, "draw",
+	                  G_CALLBACK (app_resizer_paint_window),
+	                  app_data);
+
+	gtk_container_add (GTK_CONTAINER (widget), GTK_WIDGET (child));
+	widget->child = child;
+
+	return GTK_WIDGET (widget);
+}
+
+void
+app_resizer_set_vadjustment_value (GtkWidget * widget, gdouble value)
+{
+	GtkAdjustment *adjust;
+
+	adjust = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (widget));
+
+	gdouble upper = gtk_adjustment_get_upper (adjust);
+	gdouble page_size = gtk_adjustment_get_page_size (adjust);
+	if (value > upper - page_size)
+	{
+		value = upper - page_size;
+	}
+	gtk_adjustment_set_value (adjust, value);
+}
+
+static gboolean
+app_resizer_paint_window (GtkWidget * widget, cairo_t * cr, AppShellData * app_data)
+{
+	cairo_save(cr);
+	GtkStyleContext *context;
+	GdkRGBA *bg_rgba = NULL;
+
+	GtkAllocation widget_allocation;
+	gtk_widget_get_allocation (widget, &widget_allocation);
+
+	context = gtk_widget_get_style_context (widget);
+	gtk_style_context_get (context,
+	                       GTK_STATE_FLAG_NORMAL,
+	                       "background-color", &bg_rgba,
+	                       NULL);
+
+	gdk_cairo_set_source_rgba (cr, bg_rgba);
+	cairo_set_line_width(cr, 1);
+
+	cairo_rectangle(cr, widget_allocation.x, widget_allocation.y, widget_allocation.width, widget_allocation.height);
+	cairo_stroke_preserve(cr);
+	cairo_fill(cr);
+
+	if (app_data->selected_group)
+	{
+		GtkWidget *selected_widget = GTK_WIDGET (app_data->selected_group);
+		GdkRGBA *rgba;
+		GtkAllocation selected_widget_allocation;
+		gtk_widget_get_allocation (selected_widget, &selected_widget_allocation);
+
+		gtk_style_context_get (context,
+		                       GTK_STATE_FLAG_PRELIGHT,
+		                       "background-color", &rgba,
+		                       NULL);
+
+		gdk_cairo_set_source_rgba (cr, rgba);
+		cairo_set_line_width(cr, 1);
+		cairo_rectangle(cr, selected_widget_allocation.x, selected_widget_allocation.y, selected_widget_allocation.width, selected_widget_allocation.height);
+		cairo_stroke_preserve(cr);
+		cairo_fill(cr);
+		gdk_rgba_free (rgba);
+	}
+
+	cairo_restore(cr);
+	gdk_rgba_free (bg_rgba);
+
+	return FALSE;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/109.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/109.html new file mode 100644 index 00000000..e28c65e5 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/109.html @@ -0,0 +1,521 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * This file is part of libslab.
+ *
+ * Copyright (c) 2006 Novell, Inc.
+ *
+ * Libslab 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.
+ *
+ * Libslab 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 libslab; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef __APP_SHELL_H__
+#define __APP_SHELL_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 <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#define MATEMENU_I_KNOW_THIS_IS_UNSTABLE
+#include <matemenu-tree.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libmate-desktop/mate-desktop-item.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "slab-section.h"
+#include "tile.h"
+
+G_BEGIN_DECLS
+
+#define GROUP_POSITION_NUMBER_KEY "Unique Group Position Number"
+#define APP_ACTION_KEY  "Unique Application Action Key"
+
+/* constants for initial sizing */
+#define SIZING_SCREEN_WIDTH_LARGE  1024
+#define SIZING_SCREEN_WIDTH_MEDIUM 800
+#define SIZING_SCREEN_WIDTH_SMALL  640
+#define SIZING_SCREEN_WIDTH_LARGE_NUMCOLS  3
+#define SIZING_SCREEN_WIDTH_MEDIUM_NUMCOLS 2
+#define SIZING_SCREEN_WIDTH_SMALL_NUMCOLS  1
+#define SIZING_TILE_WIDTH 230
+#define SIZING_HEIGHT_PERCENT 0.8
+
+typedef struct
+{
+	const gchar *name;
+	gint max_items;
+	GArray *garray;
+} NewAppConfig;
+
+typedef struct _AppShellData
+{
+	GtkWidget *main_app;
+	gint main_app_window_x;
+	gint main_app_window_y;
+	gboolean main_app_window_shown_once;
+
+	GtkWidget *shell;
+	GtkWidget *groups_section;
+
+	GtkWidget *actions_section;
+	/*
+		NULL      - if the available actions depend on the current tile selected
+		NON-NULL  - a list of AppAction that are always shown
+	*/
+	GSList *static_actions;
+
+	GtkWidget *filter_section;
+	gchar *filter_string;
+	GdkCursor *busy_cursor;
+
+	GtkWidget *category_layout;
+	GList *categories_list;
+	GList *cached_tables_list;	/* list of currently showing (not filtered out) tables */
+	Tile *last_clicked_launcher;
+	SlabSection *selected_group;
+	GtkIconSize icon_size;
+	const gchar *menu_name;
+	NewAppConfig *new_apps;
+	MateMenuTree *tree;
+	GHashTable *hash;
+
+	guint filter_changed_timeout;
+	gboolean stop_incremental_relayout;
+	GList *incremental_relayout_cat_list;
+	gboolean filtered_out_everything;
+	GtkWidget *filtered_out_everything_widget;
+	GtkLabel *filtered_out_everything_widget_label;
+
+	gboolean show_tile_generic_name;
+	gboolean exit_on_close;
+
+	GSettings *settings;
+} AppShellData;
+
+typedef struct
+{
+	gchar *category;
+	Tile *group_launcher;
+
+	SlabSection *section;
+	GList *launcher_list;
+	GList *filtered_launcher_list;
+} CategoryData;
+
+typedef struct
+{
+	gchar *name;
+	MateDesktopItem *item;
+} AppAction;
+
+typedef struct
+{
+	long time;
+	MateDesktopItem *item;
+} NewAppData;
+
+void generate_categories (AppShellData * app_data);
+
+/* If new_apps_max_items is 0 then the new applications category is not created */
+AppShellData *appshelldata_new (const gchar * menu_name,
+	GtkIconSize icon_size, gboolean show_tile_generic_name, gboolean exit_on_close, gint new_apps_max_items);
+
+void layout_shell (AppShellData * app_data, const gchar * filter_title, const gchar * groups_title,
+	const gchar * actions_title, GSList * actions,
+	void (*actions_handler) (Tile *, TileEvent *, gpointer));
+
+gboolean create_main_window (AppShellData * app_data, const gchar * app_name, const gchar * title,
+	const gchar * window_icon, gint width, gint height, gboolean hidden);
+
+void hide_shell (AppShellData * app_data);
+
+void show_shell (AppShellData * app_data);
+
+G_END_DECLS
+
+#endif /* __APP_SHELL_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/11.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/11.html new file mode 100644 index 00000000..d7b500c4 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/11.html @@ -0,0 +1,545 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * Copyright (C) 2007 The GNOME Foundation
+ * Written by Thomas Wood <thos@gnome.org>
+ * All Rights Reserved
+ *
+ * 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 __APPEARANCE_H__
+#define __APPEARANCE_H__
+
+#include "config.h"<--- Include file: "config.h" not found.
+
+#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.
+#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 <libmate-desktop/mate-image-menu-item.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "mate-theme-info.h"<--- Include file: "mate-theme-info.h" not found.
+
+#define APPEARANCE_SCHEMA            "org.mate.control-center.appearance"
+#define FILECHOOSER_SCHEMA           "org.gtk.Settings.FileChooser"
+#define MORE_THEMES_URL_KEY          "more-themes-url"
+#define MORE_BACKGROUNDS_URL_KEY     "more-backgrounds-url"
+
+#define WP_SCHEMA                    "org.mate.background"
+#define WP_FILE_KEY                  "picture-filename"
+#define WP_OPTIONS_KEY               "picture-options"
+#define WP_SHADING_KEY               "color-shading-type"
+#define WP_PCOLOR_KEY                "primary-color"
+#define WP_SCOLOR_KEY                "secondary-color"
+
+#define ACCEL_CHANGE_KEY             "can-change-accels"
+#define BUTTON_ICONS_KEY             "buttons-have-icons"
+#define COLOR_SCHEME_KEY             "gtk-color-scheme"
+#define DOCUMENT_FONT_KEY            "document-font-name"
+#define FILECHOOSER_DIR_FIRST_KEY    "sort-directories-first"
+#define FILECHOOSER_HIDDEN_ITEMS_KEY "show-hidden"
+#define FILECHOOSER_SIZE_COL_KEY     "show-size-column"
+#if GTK_CHECK_VERSION(3, 24, 12)
+#define FILECHOOSER_TYPE_COL_KEY     "show-type-column"
+#endif /* GTK_CHECK_VERSION(3, 24, 12) */
+#define GTK_FONT_DEFAULT_VALUE       "Sans 10"
+#define GTK_FONT_KEY                 "font-name"
+#define GTK_THEME_KEY                "gtk-theme"
+#define ICON_THEME_KEY               "icon-theme"
+#define INTERFACE_SCHEMA             "org.mate.interface"
+#define MENU_ICONS_KEY               "menus-have-icons"
+#define MONOSPACE_FONT_KEY           "monospace-font-name"
+#define TOOLBAR_STYLE_KEY            "toolbar-style"
+
+#define LOCKDOWN_SCHEMA              "org.mate.lockdown"
+#define DISABLE_THEMES_SETTINGS_KEY  "disable-theme-settings"
+
+#define CAJA_SCHEMA                  "org.mate.caja.desktop"
+#define DESKTOP_FONT_KEY             "font"
+
+#define MARCO_SCHEMA                 "org.mate.Marco.general"
+#define MARCO_THEME_KEY              "theme"
+#define WINDOW_TITLE_FONT_KEY        "titlebar-font"
+#define WINDOW_TITLE_USES_SYSTEM_KEY "titlebar-uses-system-font"
+
+#define NOTIFICATION_SCHEMA          "org.mate.NotificationDaemon"
+#define NOTIFICATION_THEME_KEY       "theme"
+
+#define MOUSE_SCHEMA                 "org.mate.peripherals-mouse"
+#define CURSOR_THEME_KEY             "cursor-theme"
+#define CURSOR_SIZE_KEY              "cursor-size"
+
+#define FONT_RENDER_SCHEMA           "org.mate.font-rendering"
+#define FONT_ANTIALIASING_KEY        "antialiasing"
+#define FONT_HINTING_KEY             "hinting"
+#define FONT_RGBA_ORDER_KEY          "rgba-order"
+#define FONT_DPI_KEY                 "dpi"
+
+typedef struct {
+	GSettings* settings;
+	GSettings* wp_settings;
+	GSettings* caja_settings;
+	GSettings* filechooser_settings;
+	GSettings* interface_settings;
+	GSettings* marco_settings;
+	GSettings* mouse_settings;
+	GSettings* font_settings;
+	GtkBuilder* ui;
+	MateDesktopThumbnailFactory* thumb_factory;
+	gulong screen_size_handler;
+	gulong screen_monitors_handler;
+
+	/* desktop */
+	GHashTable* wp_hash;
+	GtkIconView* wp_view;
+	GtkTreeModel* wp_model;
+	GtkWidget* wp_scpicker;
+	GtkWidget* wp_pcpicker;
+	GtkWidget* wp_style_menu;
+	GtkWidget* wp_color_menu;
+	GtkWidget* wp_rem_button;
+	GtkFileChooser* wp_filesel;
+	GtkWidget* wp_image;
+	GSList* wp_uris;
+	gint frame;
+	gint thumb_width;
+	gint thumb_height;
+
+	/* font */
+	GtkWidget* font_details;
+	GSList* font_groups;
+
+	/* themes */
+	GtkListStore* theme_store;
+	MateThemeMetaInfo* theme_custom;
+	GdkPixbuf* theme_icon;
+	GtkWidget* theme_save_dialog;
+	GtkWidget* theme_message_area;
+	GtkWidget* theme_message_label;
+	GtkWidget* apply_background_button;
+	GtkWidget* revert_font_button;
+	GtkWidget* apply_font_button;
+	GtkWidget* install_button;
+	GtkWidget* theme_info_icon;
+	GtkWidget* theme_error_icon;
+	gchar* revert_application_font;
+	gchar* revert_documents_font;
+	gchar* revert_desktop_font;
+	gchar* revert_windowtitle_font;
+	gchar* revert_monospace_font;
+
+	/* style */
+	GdkPixbuf* gtk_theme_icon;
+	GdkPixbuf* window_theme_icon;
+	GdkPixbuf* icon_theme_icon;
+	GtkWidget* style_message_area;
+	GtkWidget* style_message_label;
+	GtkWidget* style_install_button;
+} AppearanceData;
+
+#define appearance_capplet_get_widget(x, y) (GtkWidget*) gtk_builder_get_object(x->ui, y)
+#define GET_WINDOW(x) (GTK_WINDOW (gtk_builder_get_object (data->ui, (x))))
+
+#endif /* __APPEARANCE_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/110.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/110.html new file mode 100644 index 00000000..9e2e648d --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/110.html @@ -0,0 +1,381 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/*
+ * This file is part of libslab.
+ *
+ * Copyright (c) 2006 Novell, Inc.
+ *
+ * Libslab 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.
+ *
+ * Libslab 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 libslab; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef __SLAB_SECTION_H__
+#define __SLAB_SECTION_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.
+
+G_BEGIN_DECLS
+
+#define SLAB_SECTION_TYPE (slab_section_get_type ())
+#define SLAB_SECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SLAB_SECTION_TYPE,    SlabSection))
+#define SLAB_SECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SLAB_SECTION_TYPE, SlabSectionClass))
+#define IS_SLAB_SECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SLAB_SECTION_TYPE ))
+#define IS_SLAB_SECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SLAB_SECTION_TYPE ))
+#define SLAB_SECTION_GET_CLASS(obj) (G_TYPE_CHECK_GET_CLASS ((obj), SLAB_SECTION_TYPE, SlabSectionClass))
+
+#define SLAB_TOP_PADDING  5
+#define SLAB_BOTTOM_PADDING  5
+#define SLAB_LEFT_PADDING 10
+
+typedef enum
+{
+	Style1,		/* SlabSections in left pane - no padding */
+	Style2		/* SlabSections in right pane - padding, label text changes as group is selected */
+} SlabStyle;
+
+typedef struct
+{
+	GtkBox parent_vbox;
+
+	GtkWidget *title;
+	GtkWidget *contents;
+	SlabStyle style;
+	gulong expose_handler_id;
+	GtkBox *childbox;
+	gboolean selected;
+} SlabSection;
+
+typedef struct
+{
+	GtkBoxClass parent_class;
+} SlabSectionClass;
+
+GType slab_section_get_type (void);
+GtkWidget *slab_section_new (const gchar * title, SlabStyle style);
+GtkWidget *slab_section_new_with_markup (const gchar * title_markup, SlabStyle style);
+void slab_section_set_title (SlabSection * section, const gchar * title);
+void slab_section_set_contents (SlabSection * section, GtkWidget * contents);
+void slab_section_set_selected (SlabSection * section, gboolean selected);
+
+G_END_DECLS
+
+#endif /* __SLAB_SECTION_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/111.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/111.html new file mode 100644 index 00000000..9d1d7361 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/111.html @@ -0,0 +1,491 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * This file is part of libtile.
+ *
+ * Copyright (c) 2006 Novell, Inc.
+ *
+ * Libtile 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.
+ *
+ * Libtile 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 libslab; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef __TILE_H__
+#define __TILE_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.
+
+G_BEGIN_DECLS
+
+#define TILE_TYPE         (tile_get_type ())
+#define TILE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), TILE_TYPE, Tile))
+#define TILE_CLASS(c)     (G_TYPE_CHECK_CLASS_CAST ((c), TILE_TYPE, TileClass))
+#define IS_TILE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), TILE_TYPE))
+#define IS_TILE_CLASS(c)  (G_TYPE_CHECK_CLASS_TYPE ((c), TILE_TYPE))
+#define TILE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TILE_TYPE, TileClass))
+#define TILE_ACTION_TYPE         (tile_action_get_type ())
+#define TILE_ACTION(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), TILE_ACTION_TYPE, TileAction))
+#define TILE_ACTION_CLASS(c)     (G_TYPE_CHECK_CLASS_CAST ((c), TILE_ACTION_TYPE, TileActionClass))
+#define IS_TILE_ACTION(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), TILE_ACTION_TYPE))
+#define IS_TILE_ACTION_CLASS(c)  (G_TYPE_CHECK_CLASS_TYPE ((c), TILE_ACTION_TYPE))
+#define TILE_ACTION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TILE_ACTION_TYPE, TileActionClass))
+#define TILE_ACTION_CHECK_FLAG(action,flag) ((TILE_ACTION (action)->flags & (flag)) != 0)
+#define TILE_STATE_ENTERED GTK_STATE_FLAG_PRELIGHT
+#define TILE_STATE_FOCUSED GTK_STATE_FLAG_PRELIGHT
+
+typedef struct _Tile Tile;
+typedef struct _TileClass TileClass;
+typedef struct _TileAction TileAction;
+typedef struct _TileActionClass TileActionClass;
+typedef struct _TileEvent TileEvent;
+
+typedef void (*TileActionFunc) (Tile *, TileEvent *, TileAction *);
+
+typedef enum
+{
+	TILE_EVENT_ACTIVATED_SINGLE_CLICK,
+	TILE_EVENT_ACTIVATED_DOUBLE_CLICK,
+	TILE_EVENT_ACTIVATED_KEYBOARD,
+	TILE_EVENT_ACTION_TRIGGERED
+} TileEventType;
+
+typedef enum
+{
+	TILE_ACTION_OPENS_NEW_WINDOW = 1 << 0,
+	TILE_ACTION_OPENS_HELP = 1 << 1
+} TileActionFlags;
+
+struct _Tile
+{
+	GtkButton gtk_button;
+
+	gchar *uri;
+	GtkMenu *context_menu;
+	gboolean entered;
+	gboolean enabled;
+
+	TileAction **actions;
+	gint n_actions;
+
+	TileAction *default_action;
+};
+
+struct _TileClass
+{
+	GtkButtonClass gtk_button_class;
+
+	void (*tile_activated) (Tile *, TileEvent *);
+	void (*tile_action_triggered) (Tile *, TileEvent *, TileAction *);
+};
+
+struct _TileAction
+{
+	GObject parent;
+
+	Tile *tile;
+
+	TileActionFunc func;
+	GtkMenuItem *menu_item;
+
+	guint32 flags;
+};
+
+struct _TileActionClass
+{
+	GObjectClass parent_class;
+};
+
+struct _TileEvent
+{
+	TileEventType type;
+	guint32 time;
+};
+
+GType tile_get_type (void);
+GType tile_action_get_type (void);
+
+void tile_trigger_action (Tile * tile, TileAction * action);
+void tile_trigger_action_with_time (Tile * tile, TileAction * action, guint32 time);
+
+TileAction *tile_action_new (Tile * tile, TileActionFunc func, const gchar * menu_item_markup,
+	guint32 flags);
+
+void tile_action_set_menu_item_label (TileAction * action, const gchar * markup);
+GtkMenuItem *tile_action_get_menu_item (TileAction * action);
+
+G_END_DECLS
+
+#endif /* __TILE_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/112.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/112.html new file mode 100644 index 00000000..5d3bd00a --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/112.html @@ -0,0 +1,385 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/*
+ * This file is part of libslab.
+ *
+ * Copyright (c) 2006 Novell, Inc.
+ *
+ * Libslab 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.
+ *
+ * Libslab 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 libslab; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef __APP_RESIZER_H__
+#define __APP_RESIZER_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 "app-shell.h"
+
+G_BEGIN_DECLS
+
+#define INITIAL_NUM_COLS 3
+#define APP_RESIZER_TYPE            (app_resizer_get_type ())
+#define APP_RESIZER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), APP_RESIZER_TYPE, AppResizer))
+#define APP_RESIZER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), APP_RESIZER_TYPE, AppResizerClass))
+#define IS_APP_RESIZER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), APP_RESIZER_TYPE))
+#define IS_APP_RESIZER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), APP_RESIZER_TYPE))
+#define APP_RESIZER_GET_CLASS(obj)  (G_TYPE_CHECK_GET_CLASS ((obj), APP_RESIZER_TYPE, AppResizerClass))
+
+typedef struct _AppResizer AppResizer;
+typedef struct _AppResizerClass AppResizerClass;
+
+struct _AppResizer
+{
+	GtkLayout parent;
+
+	GtkBox *child;
+	GList *cached_tables_list;
+	gint cached_element_width;
+	gint cached_table_spacing;
+	gboolean table_elements_homogeneous;
+	gint cur_num_cols;
+	gboolean setting_style;
+
+	guint column;
+	AppShellData *app_data;
+};
+
+struct _AppResizerClass
+{
+	GtkLayoutClass parent_class;
+};
+
+void remove_container_entries (GtkContainer * widget);
+
+GType app_resizer_get_type (void);
+GtkWidget *app_resizer_new (GtkBox * child, gint initial_num_columns, gboolean homogeneous,
+	AppShellData * app_data);
+void app_resizer_set_table_cache (AppResizer * widget, GList * cache_list);
+void app_resizer_layout_table_default (AppResizer * widget, GtkGrid * table, GList * element_list);
+void app_resizer_set_vadjustment_value (GtkWidget * widget, gdouble value);
+
+G_END_DECLS
+
+#endif /* __APP_RESIZER_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/113.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/113.html new file mode 100644 index 00000000..14417444 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/113.html @@ -0,0 +1,3301 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
   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
/*
+ * This file is part of libslab.
+ *
+ * Copyright (c) 2006 Novell, Inc.
+ *
+ * Libslab 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.
+ *
+ * Libslab 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 libslab; 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 <libmate-desktop/mate-desktop-item.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/gdkkeysyms.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/stat.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 <stdlib.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 "app-shell.h"
+#include "shell-window.h"
+#include "app-resizer.h"
+#include "slab-section.h"
+#include "slab-mate-util.h"
+#include "search-bar.h"
+
+#include "application-tile.h"
+#include "themed-icon.h"
+
+#define TILE_EXEC_NAME "Tile_desktop_exec_name"
+#define CC_SCHEMA "org.mate.control-center"
+#define EXIT_SHELL_ON_ACTION_START "cc-exit-shell-on-action-start"
+#define EXIT_SHELL_ON_ACTION_HELP "cc-exit-shell-on-action-help"
+#define EXIT_SHELL_ON_ACTION_ADD_REMOVE "cc-exit-shell-on-action-add-remove"
+#define EXIT_SHELL_ON_ACTION_UPGRADE_UNINSTALL "cc-exit-shell-on-action-upgrade-uninstall"
+
+static void create_application_category_sections (AppShellData * app_data);
+static GtkWidget *create_filter_section (AppShellData * app_data, const gchar * title);
+static GtkWidget *create_groups_section (AppShellData * app_data, const gchar * title);
+static GtkWidget *create_actions_section (AppShellData * app_data, const gchar * title,
+	void (*actions_handler) (Tile *, TileEvent *, gpointer));
+
+static void generate_category (const char * category, MateMenuTreeDirectory * root_dir, AppShellData * app_data, gboolean recursive);
+static void generate_launchers (MateMenuTreeDirectory * root_dir, AppShellData * app_data,
+	CategoryData * cat_data, gboolean recursive);
+static void generate_new_apps (AppShellData * app_data);
+static void insert_launcher_into_category (CategoryData * cat_data, MateDesktopItem * desktop_item,
+	AppShellData * app_data);
+
+static gboolean main_keypress_callback (GtkWidget * widget, GdkEventKey * event,
+	AppShellData * app_data);
+static gboolean main_delete_callback (GtkWidget * widget, GdkEvent * event,
+	AppShellData * app_data);
+static void application_launcher_clear_search_bar (AppShellData * app_data);
+static void launch_selected_app (AppShellData * app_data);
+static void generate_potential_apps (gpointer catdata, gpointer user_data);
+
+static void relayout_shell (AppShellData * app_data);
+static gboolean handle_filter_changed (NldSearchBar * search_bar, const char *text,
+	gpointer user_data);
+static void handle_group_clicked (Tile * tile, TileEvent * event, gpointer user_data);
+static void set_state (AppShellData * app_data, GtkWidget * widget);
+static void populate_groups_section (AppShellData * app_data);
+static void generate_filtered_lists (gpointer catdata, gpointer user_data);
+static void show_no_results_message (AppShellData * app_data, GtkWidget * containing_vbox);
+static void populate_application_category_sections (AppShellData * app_data,
+	GtkWidget * containing_vbox);
+static void populate_application_category_section (AppShellData * app_data, SlabSection * section,
+	GList * launcher_list);
+static void tile_activated_cb (Tile * tile, TileEvent * event, gpointer user_data);
+static void handle_launcher_single_clicked (Tile * launcher, gpointer data);
+static void handle_menu_action_performed (Tile * launcher, TileEvent * event, TileAction * action,
+	gpointer data);
+static gint application_launcher_compare (gconstpointer a, gconstpointer b);
+static void matemenu_tree_changed_callback (MateMenuTree * tree, gpointer user_data);
+gboolean regenerate_categories (AppShellData * app_data);
+
+void
+hide_shell (AppShellData * app_data)
+{
+	gtk_window_get_position (GTK_WINDOW (app_data->main_app),
+		&app_data->main_app_window_x, &app_data->main_app_window_y);
+	/* clear the search bar now so reshowing is fast and flicker free - BNC#283186 */
+	application_launcher_clear_search_bar (app_data);
+	gtk_widget_hide (app_data->main_app);
+}
+
+void
+show_shell (AppShellData * app_data)
+{
+	gtk_widget_show_all (app_data->main_app);
+	if (!app_data->static_actions)
+		gtk_widget_hide (app_data->actions_section);  /* don't show unless a launcher is selected */
+
+	if (app_data->main_app_window_shown_once)
+		gtk_window_move (GTK_WINDOW (app_data->main_app),
+			app_data->main_app_window_x, app_data->main_app_window_y);
+
+	/* if this is the first time shown, need to clear this handler */
+	else
+		shell_window_clear_resize_handler (SHELL_WINDOW (app_data->shell));
+	app_data->main_app_window_shown_once = TRUE;
+}
+
+gboolean
+create_main_window (AppShellData * app_data, const gchar * app_name, const gchar * title,
+	const gchar * window_icon, gint width, gint height, gboolean hidden)
+{
+	GtkWidget *main_app = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+	app_data->main_app = main_app;
+	gtk_widget_set_name (main_app, app_name);
+	gtk_window_set_title (GTK_WINDOW (main_app), title);
+	gtk_window_set_default_size(GTK_WINDOW(main_app), width, height);
+	gtk_window_set_icon_name (GTK_WINDOW (main_app), window_icon);
+	gtk_container_add (GTK_CONTAINER (main_app), app_data->shell);
+
+	g_signal_connect (main_app, "delete-event", G_CALLBACK (main_delete_callback), app_data);
+	g_signal_connect (main_app, "key-press-event", G_CALLBACK (main_keypress_callback),<--- You might need to cast the function pointer here
+		app_data);
+
+	gtk_window_set_position (GTK_WINDOW (app_data->main_app), GTK_WIN_POS_CENTER);
+	if (!hidden)
+		show_shell (app_data);
+
+	return TRUE;
+}
+
+static void
+generate_potential_apps (gpointer catdata, gpointer user_data)
+{
+	GHashTable *app_hash = (GHashTable *) user_data;
+	CategoryData *data = (CategoryData *) catdata;
+	gchar *uri;
+
+	GList *launcher_list = data->filtered_launcher_list;
+
+	while (launcher_list)
+	{
+		g_object_get (launcher_list->data, "tile-uri", &uri, NULL);
+		/* eliminate dups of same app in multiple categories */
+		if (!g_hash_table_lookup (app_hash, uri))
+			g_hash_table_insert (app_hash, uri, launcher_list->data);
+		else
+			g_free (uri);
+		launcher_list = g_list_next (launcher_list);
+	}
+}
+
+static gboolean
+return_first_entry (gpointer key, gpointer value, gpointer unused)
+{
+	return TRUE;	/*better way to pull an entry out ? */
+}
+
+static void
+launch_selected_app (AppShellData * app_data)
+{
+	GHashTable *app_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+	guint num_apps;
+
+	g_list_foreach (app_data->categories_list, generate_potential_apps, app_hash);
+	num_apps = g_hash_table_size (app_hash);
+	if (num_apps == 1)
+	{
+		ApplicationTile *launcher =
+			APPLICATION_TILE (g_hash_table_find (app_hash, return_first_entry, NULL));
+		g_hash_table_destroy (app_hash);
+		handle_launcher_single_clicked (TILE (launcher), app_data);
+		return;
+	}
+
+	g_hash_table_destroy (app_hash);
+}
+
+static gboolean
+main_keypress_callback (GtkWidget * widget, GdkEventKey * event, AppShellData * app_data)<--- Parameter 'event' can be declared as pointer to const
+{
+	GApplication *app;
+
+	if (event->keyval == GDK_KEY_Return)
+	{
+		SlabSection *section = SLAB_SECTION (app_data->filter_section);
+		NldSearchBar *search_bar;
+
+		/* Make sure our implementation has not changed */
+		g_assert (NLD_IS_SEARCH_BAR (section->contents));
+		search_bar = NLD_SEARCH_BAR (section->contents);
+		if (nld_search_bar_has_focus (search_bar))
+		{
+			launch_selected_app (app_data);
+			return TRUE;
+		}
+	}
+
+	/* quit on ESC or Ctl-W or Ctl-Q */
+	if (event->keyval == GDK_KEY_Escape ||
+		((event->keyval == GDK_KEY_w || event->keyval == GDK_KEY_W)	&& (event->state & GDK_CONTROL_MASK)) ||
+		((event->keyval == GDK_KEY_q || event->keyval == GDK_KEY_Q) && (event->state & GDK_CONTROL_MASK)))
+	{
+		if (app_data->exit_on_close)
+		{
+			app=g_application_get_default();
+			g_application_quit(app);
+		}
+		else
+			hide_shell (app_data);
+
+		return TRUE;
+	}
+	return FALSE;
+}
+
+static gboolean
+main_delete_callback (GtkWidget * widget, GdkEvent * event, AppShellData * app_data)
+{
+	GApplication *app;
+
+	if (app_data->exit_on_close)
+	{
+		app=g_application_get_default();
+		g_application_quit(app);
+		return FALSE;
+	}
+
+	hide_shell (app_data);
+	return TRUE;		/* stop the processing of this event */
+}
+
+void
+layout_shell (AppShellData * app_data, const gchar * filter_title, const gchar * groups_title,
+	const gchar * actions_title, GSList * actions,
+	void (*actions_handler) (Tile *, TileEvent *, gpointer))
+{
+	GtkWidget *filter_section;
+	GtkWidget *groups_section;
+	GtkWidget *actions_section;
+
+	GtkWidget *left_vbox;
+	GtkWidget *right_vbox;
+	gint num_cols;
+
+	GtkWidget *sw;
+	GtkAdjustment *adjustment;
+
+	app_data->shell = shell_window_new (app_data);
+	app_data->static_actions = actions;
+
+	right_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+
+	num_cols = SIZING_SCREEN_WIDTH_LARGE_NUMCOLS;
+
+	GdkRectangle geometry = {0};
+
+	GdkDisplay *display;
+	GdkMonitor *monitor;
+
+	display= gdk_screen_get_display (gdk_screen_get_default ());
+	monitor = gdk_display_get_monitor (display, 0);
+	gdk_monitor_get_geometry (monitor, &geometry);
+
+	if (geometry.width <= SIZING_SCREEN_WIDTH_LARGE)
+	{
+		if (geometry.width <= SIZING_SCREEN_WIDTH_MEDIUM)
+			num_cols = SIZING_SCREEN_WIDTH_SMALL_NUMCOLS;
+		else
+			num_cols = SIZING_SCREEN_WIDTH_MEDIUM_NUMCOLS;
+	}
+	app_data->category_layout =
+		app_resizer_new (GTK_BOX (right_vbox), num_cols, TRUE, app_data);
+
+	sw = gtk_scrolled_window_new (NULL, NULL);
+	gtk_widget_set_vexpand (GTK_WIDGET (sw), TRUE);
+	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC,
+		GTK_POLICY_AUTOMATIC);
+	gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN);
+	gtk_container_add (GTK_CONTAINER (sw), app_data->category_layout);
+	adjustment = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (sw));
+	g_object_set (adjustment, "step-increment", (double) 20, NULL);
+
+	create_application_category_sections (app_data);
+	populate_application_category_sections (app_data, right_vbox);
+	app_resizer_set_table_cache (APP_RESIZER (app_data->category_layout),
+		app_data->cached_tables_list);
+
+	gtk_container_set_focus_vadjustment (GTK_CONTAINER (right_vbox),
+		gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (sw)));
+
+	left_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 15);
+
+	filter_section = create_filter_section (app_data, filter_title);
+	app_data->filter_section = filter_section;
+	gtk_box_pack_start (GTK_BOX (left_vbox), filter_section, FALSE, FALSE, 0);
+
+	groups_section = create_groups_section (app_data, groups_title);
+	app_data->groups_section = groups_section;
+	populate_groups_section (app_data);
+	gtk_box_pack_start (GTK_BOX (left_vbox), groups_section, FALSE, FALSE, 0);
+
+	actions_section = create_actions_section (app_data, actions_title, actions_handler);
+	app_data->actions_section = actions_section;
+	gtk_box_pack_start (GTK_BOX (left_vbox), actions_section, FALSE, FALSE, 0);
+
+	shell_window_set_contents (SHELL_WINDOW (app_data->shell), left_vbox, sw);
+}
+
+static gboolean
+relayout_shell_partial (gpointer user_data)
+{
+	AppShellData *app_data = (AppShellData *) user_data;
+	GtkBox *vbox = APP_RESIZER (app_data->category_layout)->child;
+	CategoryData *data;
+
+	if (app_data->stop_incremental_relayout)
+		return FALSE;
+
+	if (app_data->incremental_relayout_cat_list != NULL)
+	{
+		/* There are still categories to layout */
+		data = (CategoryData *) app_data->incremental_relayout_cat_list->data;
+		if (data->filtered_launcher_list != NULL)
+		{
+			populate_application_category_section (app_data, data->section,
+				data->filtered_launcher_list);
+			gtk_box_pack_start (vbox, GTK_WIDGET (data->section), TRUE, TRUE,
+				0);
+			app_data->filtered_out_everything = FALSE;
+		}
+
+		app_data->incremental_relayout_cat_list =
+			g_list_next (app_data->incremental_relayout_cat_list);
+		return TRUE;
+	}
+
+	/* We're done laying out the categories; finish up */
+	if (app_data->filtered_out_everything)
+		show_no_results_message (app_data, GTK_WIDGET (vbox));
+
+	app_resizer_set_table_cache (APP_RESIZER (app_data->category_layout),
+		app_data->cached_tables_list);
+	populate_groups_section (app_data);
+
+	gtk_widget_show_all (app_data->category_layout);
+	gdk_window_set_cursor (gtk_widget_get_window (app_data->shell), NULL);
+
+	app_data->stop_incremental_relayout = TRUE;
+	return FALSE;
+}
+
+static void
+relayout_shell_incremental (AppShellData * app_data)
+{
+	GtkBox *vbox = APP_RESIZER (app_data->category_layout)->child;
+
+	app_data->stop_incremental_relayout = FALSE;
+	app_data->filtered_out_everything = TRUE;
+	app_data->incremental_relayout_cat_list = app_data->categories_list;
+
+	if (app_data->cached_tables_list)
+		g_list_free (app_data->cached_tables_list);
+	app_data->cached_tables_list = NULL;
+
+	remove_container_entries (GTK_CONTAINER (vbox));
+
+	g_idle_add ((GSourceFunc) relayout_shell_partial, app_data);
+}
+
+static void
+relayout_shell (AppShellData * app_data)
+{
+	GtkWidget *shell = app_data->shell;
+	GtkBox *vbox = APP_RESIZER (app_data->category_layout)->child;
+
+	populate_application_category_sections (app_data, GTK_WIDGET (vbox));
+	app_resizer_set_table_cache (APP_RESIZER (app_data->category_layout),
+		app_data->cached_tables_list);
+	populate_groups_section (app_data);
+
+	gtk_widget_show_all (shell);
+	if (!app_data->static_actions && !app_data->last_clicked_launcher)
+		gtk_widget_hide (app_data->actions_section);  /* don't show unless a launcher is selected */
+}
+
+static GtkWidget *
+create_actions_section (AppShellData * app_data, const gchar * title,
+	void (*actions_handler) (Tile *, TileEvent *, gpointer))
+{
+	GtkWidget *section, *launcher;
+	GtkWidget *vbox;
+	GSList *actions;
+	AppAction *action;
+	AtkObject *a11y_cat;
+
+	g_assert (app_data != NULL);
+
+	section = slab_section_new (title, Style1);
+	g_object_ref (section);
+
+	vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+	slab_section_set_contents (SLAB_SECTION (section), vbox);
+
+	if (app_data->static_actions)
+	{
+		for (actions = app_data->static_actions; actions; actions = actions->next)
+		{
+			GtkWidget *header;
+
+			action = (AppAction *) actions->data;
+			header = gtk_label_new (action->name);
+			gtk_label_set_line_wrap (GTK_LABEL (header), TRUE);
+			gtk_label_set_max_width_chars (GTK_LABEL (header), 0);
+			gtk_label_set_xalign (GTK_LABEL (header), 0.0);
+			launcher = nameplate_tile_new (NULL, NULL, header, NULL);
+
+			g_object_set_data (G_OBJECT (launcher), APP_ACTION_KEY, action->item);
+			g_signal_connect (launcher, "tile-activated", G_CALLBACK (actions_handler),
+				app_data);
+			gtk_box_pack_start (GTK_BOX (vbox), launcher, FALSE, FALSE, 0);
+
+			a11y_cat = gtk_widget_get_accessible (GTK_WIDGET (launcher));
+			atk_object_set_name (a11y_cat, action->name);
+		}
+	}
+
+	return section;
+}
+
+static GtkWidget *
+create_groups_section (AppShellData * app_data, const gchar * title)<--- Parameter 'app_data' can be declared as pointer to const
+{
+	GtkWidget *section;
+	GtkWidget *vbox;
+
+	g_assert (app_data != NULL);
+
+	section = slab_section_new (title, Style1);
+	g_object_ref (section);
+
+	vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+	slab_section_set_contents (SLAB_SECTION (section), vbox);
+
+	return section;
+}
+
+static void
+populate_groups_section (AppShellData * app_data)
+{
+	SlabSection *section = SLAB_SECTION (app_data->groups_section);
+	GtkBox *vbox;
+	GList *cat_list;
+
+	vbox = GTK_BOX (section->contents);
+	remove_container_entries (GTK_CONTAINER (vbox));
+
+	cat_list = app_data->categories_list;
+	do
+	{
+		CategoryData *data = (CategoryData *) cat_list->data;
+		if (NULL != data->filtered_launcher_list)
+		{
+			gtk_widget_set_state_flags (GTK_WIDGET (data->group_launcher), GTK_STATE_FLAG_NORMAL, FALSE);
+			gtk_box_pack_start (vbox, GTK_WIDGET (data->group_launcher),
+				FALSE, FALSE, 0);
+		}
+	}
+	while (NULL != (cat_list = g_list_next (cat_list)));
+}
+
+static void
+handle_group_clicked (Tile * tile, TileEvent * event, gpointer user_data)
+{
+	AppShellData *app_data = (AppShellData *) user_data;
+	GtkWidget *section = NULL;
+	GtkAllocation allocation;
+
+	gint clicked_pos =
+		GPOINTER_TO_INT (g_object_get_data (G_OBJECT (tile), GROUP_POSITION_NUMBER_KEY));
+
+	GList *cat_list = app_data->categories_list;
+
+	gint total = 0;
+	do
+	{
+		CategoryData *cat_data = (CategoryData *) cat_list->data;
+		gint pos =
+			GPOINTER_TO_INT (g_object_get_data (G_OBJECT (cat_data->group_launcher),
+				GROUP_POSITION_NUMBER_KEY));
+		if (pos == clicked_pos)
+		{
+			section = GTK_WIDGET (cat_data->section);
+			break;
+		}
+
+		if (NULL != cat_data->filtered_launcher_list)
+		{
+			gtk_widget_get_allocation (GTK_WIDGET (cat_data->section), &allocation);
+			total += allocation.height;
+		}
+	}
+	while (NULL != (cat_list = g_list_next (cat_list)));
+
+	g_assert (section != NULL);
+	set_state (app_data, section);
+
+	app_resizer_set_vadjustment_value (app_data->category_layout, total);
+}
+
+static void
+set_state (AppShellData * app_data, GtkWidget * widget)
+{
+	if (app_data->selected_group)
+	{
+		slab_section_set_selected (app_data->selected_group, FALSE);
+		app_data->selected_group = NULL;
+	}
+
+	if (widget)
+	{
+		app_data->selected_group = SLAB_SECTION (widget);
+		slab_section_set_selected (SLAB_SECTION (widget), TRUE);
+	}
+	gtk_widget_queue_draw (app_data->shell);
+}
+
+static GtkWidget *
+create_filter_section (AppShellData * app_data, const gchar * title)
+{
+	GtkWidget *section;
+
+	GtkWidget *search_bar;
+
+	section = slab_section_new (title, Style1);
+	g_object_ref (section);
+
+	search_bar = nld_search_bar_new ();
+	nld_search_bar_set_search_timeout (NLD_SEARCH_BAR (search_bar), 0);
+	slab_section_set_contents (SLAB_SECTION (section), search_bar);
+
+	g_signal_connect (search_bar, "search",
+	                  G_CALLBACK (handle_filter_changed),
+	                  app_data);
+
+	return section;
+}
+
+static gboolean
+handle_filter_changed_delayed (gpointer user_data)
+{
+	AppShellData *app_data = (AppShellData *) user_data;
+
+	g_list_foreach (app_data->categories_list, generate_filtered_lists,
+		(gpointer) app_data->filter_string);
+	app_data->last_clicked_launcher = NULL;
+
+	/*  showing the updates incremtally is very visually distracting. Much worse than just blanking until
+	   the incremental work is done and then doing one show. It would be nice to optimize this though
+	   somehow and not even show any change but the cursor change until all the work is done. But since
+	   we do the work incrementally in an idle loop I don't know how else besides hiding to not show
+	   incremental updates
+	 */
+	/* gdk_window_freeze_updates(app_data->category_layout->window); */
+	gtk_widget_hide (app_data->category_layout);
+	app_data->busy_cursor =
+		gdk_cursor_new_for_display (gtk_widget_get_display (app_data->shell), GDK_WATCH);
+	gdk_window_set_cursor (gtk_widget_get_window (app_data->shell), app_data->busy_cursor);
+	g_object_unref (app_data->busy_cursor);
+
+	set_state (app_data, NULL);
+	app_resizer_set_vadjustment_value (app_data->category_layout, 0);
+
+	relayout_shell_incremental (app_data);
+
+	app_data->filter_changed_timeout = 0;
+	return FALSE;
+}
+
+static gboolean
+handle_filter_changed (NldSearchBar * search_bar, const char *text, gpointer data)
+{
+	AppShellData *app_data;
+
+	app_data = (AppShellData *) data;
+
+	if (app_data->filter_string)
+		g_free (app_data->filter_string);
+	app_data->filter_string = g_strdup (text);
+
+	if (app_data->filter_changed_timeout)
+		g_source_remove (app_data->filter_changed_timeout);
+
+	app_data->filter_changed_timeout =
+		g_timeout_add (75, handle_filter_changed_delayed, app_data);
+	app_data->stop_incremental_relayout = TRUE;
+
+	return FALSE;
+}
+
+static void
+generate_filtered_lists (gpointer catdata, gpointer user_data)
+{
+	CategoryData *data = (CategoryData *) catdata;
+
+	/* Fixme - everywhere you use ascii you need to fix up for multibyte */
+	gchar *filter_string = g_ascii_strdown (user_data, -1);
+	gchar *temp1, *temp2;
+	GList *launcher_list = data->launcher_list;
+
+	g_list_free (data->filtered_launcher_list);
+	data->filtered_launcher_list = NULL;
+
+	do
+	{
+		ApplicationTile *launcher = APPLICATION_TILE (launcher_list->data);
+		const gchar *filename;
+
+		temp1 = NULL;
+		temp2 = NULL;
+
+		/* Since the filter may remove this entry from the
+		   container it will not get a mouse out event */
+		gtk_widget_set_state_flags (GTK_WIDGET (launcher), GTK_STATE_FLAG_NORMAL, FALSE);
+		filename = g_object_get_data (G_OBJECT (launcher), TILE_EXEC_NAME); /* do I need to free this */
+
+		temp1 = g_ascii_strdown (launcher->name, -1);
+		if (launcher->description)
+			temp2 = g_ascii_strdown (launcher->description, -1);
+		if (g_strrstr (temp1, filter_string) || (launcher->description
+				&& g_strrstr (temp2, filter_string))
+			|| g_strrstr (filename, filter_string))
+		{
+			data->filtered_launcher_list =
+				g_list_append (data->filtered_launcher_list, launcher);
+		}
+		if (temp1)
+			g_free (temp1);
+		if (temp2)
+			g_free (temp2);
+	}
+	while (NULL != (launcher_list = g_list_next (launcher_list)));
+	g_free (filter_string);
+}
+
+static void
+delete_old_data (AppShellData * app_data)
+{
+	GList *temp;
+	GList *cat_list;
+
+	g_assert (app_data != NULL);
+	g_assert (app_data->categories_list != NULL);
+
+	cat_list = app_data->categories_list;
+
+	do
+	{
+		CategoryData *data = (CategoryData *) cat_list->data;
+		gtk_widget_destroy (GTK_WIDGET (data->section));
+		gtk_widget_destroy (GTK_WIDGET (data->group_launcher));
+		g_object_unref (data->section);
+		g_object_unref (data->group_launcher);
+		g_free (data->category);
+
+		for (temp = data->launcher_list; temp; temp = g_list_next (temp))
+		{
+			g_free (g_object_get_data (G_OBJECT (temp->data), TILE_EXEC_NAME));
+			g_object_unref (temp->data);
+		}
+
+		g_list_free (data->launcher_list);
+		g_list_free (data->filtered_launcher_list);
+		g_free (data);
+	}
+	while (NULL != (cat_list = g_list_next (cat_list)));
+
+	g_list_free (app_data->categories_list);
+	app_data->categories_list = NULL;
+	app_data->selected_group = NULL;
+}
+
+static void
+create_application_category_sections (AppShellData * app_data)
+{
+	GList *cat_list;
+	AtkObject *a11y_cat;
+	gint pos = 0;
+
+	g_assert (app_data != NULL);
+	g_assert (app_data->categories_list != NULL);	/* Fixme - pop up a dialog box and then close */
+
+	cat_list = app_data->categories_list;
+
+	do
+	{
+		CategoryData *data = (CategoryData *) cat_list->data;
+		GtkWidget *header = gtk_label_new (data->category);
+		gchar *markup;
+		GtkWidget *hbox;
+		GtkWidget *table;
+
+		gtk_label_set_xalign (GTK_LABEL (header), 0.0);
+		data->group_launcher = TILE (nameplate_tile_new (NULL, NULL, header, NULL));
+		g_object_ref (data->group_launcher);
+
+		g_object_set_data (G_OBJECT (data->group_launcher), GROUP_POSITION_NUMBER_KEY,
+			GINT_TO_POINTER (pos));
+		pos++;
+		g_signal_connect (data->group_launcher, "tile-activated",
+			G_CALLBACK (handle_group_clicked), app_data);
+		a11y_cat = gtk_widget_get_accessible (GTK_WIDGET (data->group_launcher));
+		atk_object_set_name (a11y_cat, data->category);
+
+		markup = g_markup_printf_escaped ("<span size=\"x-large\" weight=\"bold\">%s</span>",
+			data->category);
+		data->section = SLAB_SECTION (slab_section_new_with_markup (markup, Style2));
+
+		/* as we filter these will be added/removed from parent container and we dont want them destroyed */
+		g_object_ref (data->section);
+		g_free (markup);
+
+		hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+		table = gtk_grid_new ();
+		gtk_grid_set_column_spacing (GTK_GRID (table), 5);
+		gtk_grid_set_row_spacing (GTK_GRID (table), 5);
+		gtk_box_pack_start (GTK_BOX (hbox), table, FALSE, FALSE, 15);
+		slab_section_set_contents (SLAB_SECTION (data->section), hbox);
+	}
+	while (NULL != (cat_list = g_list_next (cat_list)));
+}
+
+static void
+show_no_results_message (AppShellData * app_data, GtkWidget * containing_vbox)
+{
+	gchar *markup;
+	gchar *str1;
+	gchar *str2;
+
+	if (!app_data->filtered_out_everything_widget)
+	{
+		GtkWidget *image;
+		GtkWidget *label;
+
+		app_data->filtered_out_everything_widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+		gtk_widget_set_halign (app_data->filtered_out_everything_widget, GTK_ALIGN_CENTER);
+		gtk_widget_set_valign (app_data->filtered_out_everything_widget, GTK_ALIGN_CENTER);
+		g_object_ref (app_data->filtered_out_everything_widget);
+
+		image = themed_icon_new ("face-surprise", GTK_ICON_SIZE_DIALOG);
+		gtk_box_pack_start (GTK_BOX (app_data->filtered_out_everything_widget), image, FALSE, FALSE, 0);
+
+		label = gtk_label_new (NULL);
+		gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+		gtk_box_pack_start (GTK_BOX (app_data->filtered_out_everything_widget), label, TRUE, TRUE, 15);
+		app_data->filtered_out_everything_widget_label = GTK_LABEL (label);
+	}
+
+	str1 = g_markup_printf_escaped ("<b>%s</b>", app_data->filter_string);
+	str2 = g_strdup_printf (_("Your filter \"%s\" does not match any items."), str1);
+	markup = g_strdup_printf ("<span size=\"large\"><b>%s</b></span>\n\n%s",
+		_("No matches found."), str2);
+	gtk_label_set_text (app_data->filtered_out_everything_widget_label, markup);
+	gtk_label_set_use_markup (app_data->filtered_out_everything_widget_label, TRUE);
+	gtk_box_pack_start (GTK_BOX (containing_vbox), app_data->filtered_out_everything_widget,
+		TRUE, TRUE, 0);
+	g_free (str1);
+	g_free (str2);
+	g_free (markup);
+}
+
+static void
+populate_application_category_sections (AppShellData * app_data, GtkWidget * containing_vbox)
+{
+	GList *cat_list = app_data->categories_list;
+	gboolean filtered_out_everything = TRUE;
+	if (app_data->cached_tables_list)
+		g_list_free (app_data->cached_tables_list);
+	app_data->cached_tables_list = NULL;
+
+	remove_container_entries (GTK_CONTAINER (containing_vbox));
+	do
+	{
+		CategoryData *data = (CategoryData *) cat_list->data;
+		if (NULL != data->filtered_launcher_list)
+		{
+			populate_application_category_section (app_data, data->section,
+				data->filtered_launcher_list);
+			gtk_box_pack_start (GTK_BOX (containing_vbox), GTK_WIDGET (data->section),
+				TRUE, TRUE, 0);
+			filtered_out_everything = FALSE;
+		}
+	}
+	while (NULL != (cat_list = g_list_next (cat_list)));
+
+	if (TRUE == filtered_out_everything)
+		show_no_results_message (app_data, containing_vbox);
+}
+
+static void
+populate_application_category_section (AppShellData * app_data, SlabSection * section,
+	GList * launcher_list)
+{
+	GtkWidget *hbox;
+	GtkGrid *table;
+	GList *children;
+
+	hbox = GTK_WIDGET (section->contents);
+
+	children = gtk_container_get_children (GTK_CONTAINER (hbox));
+	table = children->data;
+	g_list_free (children);
+
+	/* Make sure our implementation has not changed and it's still a GtkGrid */
+	g_assert (GTK_IS_GRID (table));
+
+	app_data->cached_tables_list = g_list_append (app_data->cached_tables_list, table);
+
+	app_resizer_layout_table_default (APP_RESIZER (app_data->category_layout), table,
+		launcher_list);
+
+}
+
+gboolean
+regenerate_categories (AppShellData * app_data)
+{
+	delete_old_data (app_data);
+	generate_categories (app_data);
+	create_application_category_sections (app_data);
+	relayout_shell (app_data);
+
+	return FALSE;	/* remove this function from the list */
+}
+
+static void
+matemenu_tree_changed_callback (MateMenuTree * old_tree, gpointer user_data)
+{
+	/*
+	This method only gets called on the first change (matemenu appears to ignore subsequent) until
+	we reget the root dir which we can't do in this method because if we do for some reason this
+	method then gets called multiple times for one actual change. This actually is okay because
+	it's probably a good idea to wait a couple seconds to regenerate the categories in case there
+	are multiple quick changes being made, no sense regenerating multiple times.
+	*/
+	GError *error = NULL;
+	AppShellData * app_data = user_data;
+	if (!matemenu_tree_load_sync (app_data->tree, &error)) {
+		g_warning ("Menu tree loading got error:%s\n", error->message);
+		g_object_unref (app_data->tree);
+		app_data->tree = NULL;
+		g_error_free (error);
+	} else {
+		g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE, 3000, (GSourceFunc) regenerate_categories,
+		                    user_data, NULL);
+	}
+}
+
+AppShellData *
+appshelldata_new (const gchar * menu_name, GtkIconSize icon_size, gboolean show_tile_generic_name, gboolean exit_on_close, gint new_apps_max_items)
+{
+	AppShellData *app_data = g_new0 (AppShellData, 1);
+	app_data->settings = g_settings_new (CC_SCHEMA);
+	app_data->menu_name = menu_name;
+	app_data->icon_size = icon_size;
+	app_data->stop_incremental_relayout = TRUE;
+	app_data->show_tile_generic_name = show_tile_generic_name;
+	app_data->exit_on_close = exit_on_close;
+	if (new_apps_max_items > 0) {
+		app_data->new_apps = g_new0 (NewAppConfig, 1);
+		app_data->new_apps->max_items = new_apps_max_items;
+		app_data->new_apps->name = _("New Applications");
+	}
+	return app_data;
+}
+
+void
+generate_categories (AppShellData * app_data)
+{
+	MateMenuTreeDirectory *root_dir;
+	gboolean need_misc = FALSE;
+	MateMenuTreeIter *iter;
+	MateMenuTreeItemType type;
+
+	if (!app_data->tree)
+	{
+		GError *error = NULL;
+
+		app_data->tree = matemenu_tree_new (app_data->menu_name, MATEMENU_TREE_FLAGS_NONE);
+		g_signal_connect (app_data->tree, "changed", G_CALLBACK (matemenu_tree_changed_callback), app_data);
+		if (! matemenu_tree_load_sync (app_data->tree, &error)) {
+			g_warning("Menu tree loading got error:%s\n", error->message);
+			g_error_free(error);
+			g_object_unref(app_data->tree);
+			app_data->tree = NULL;
+		}
+	}
+
+	if (app_data->tree != NULL)
+		root_dir = matemenu_tree_get_root_directory (app_data->tree);
+	else
+		root_dir = NULL;
+
+	if ( app_data->tree == NULL || root_dir == NULL) {
+		GtkWidget *dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
+				GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "Failure loading - %s",
+				app_data->menu_name);
+		gtk_dialog_run (GTK_DIALOG (dialog));
+		gtk_widget_destroy (dialog);
+		exit (1);	/* Fixme - is there a MATE/GTK way to do this. */
+	}
+
+	iter = matemenu_tree_directory_iter (root_dir);
+	while ((type = matemenu_tree_iter_next (iter)) != MATEMENU_TREE_ITEM_INVALID) {
+		gpointer item;
+		const char *category;
+		switch (type) {
+			case MATEMENU_TREE_ITEM_DIRECTORY:
+				item = matemenu_tree_iter_get_directory (iter);
+				category = matemenu_tree_directory_get_name (item);
+				generate_category(category, item, app_data, TRUE);
+				matemenu_tree_item_unref (item);
+				break;
+			case MATEMENU_TREE_ITEM_ENTRY:
+				need_misc = TRUE;
+				break;
+			default:
+				break;
+		}
+	}
+	matemenu_tree_iter_unref(iter);
+
+	if (need_misc)
+		generate_category (_("Other"), root_dir, app_data, FALSE);
+
+	if (app_data->hash)
+	{
+		g_hash_table_destroy (app_data->hash);
+		app_data->hash = NULL;
+	}
+
+	matemenu_tree_item_unref (root_dir);
+
+	if (app_data->new_apps && (app_data->new_apps->max_items > 0))
+		generate_new_apps (app_data);
+}
+
+static void
+generate_category (const char * category, MateMenuTreeDirectory * root_dir, AppShellData * app_data, gboolean recursive)
+{
+	CategoryData *data;
+	/* This is not needed. MateMenu already returns an ordered, non duplicate list
+	GList *list_entry;
+	list_entry =
+		g_list_find_custom (app_data->categories_list, category,
+		category_name_compare);
+	if (!list_entry)
+	{
+	*/
+		data = g_new0 (CategoryData, 1);
+		data->category = g_strdup (category);
+		app_data->categories_list =
+			/* use the matemenu order instead of alphabetical */
+			g_list_append (app_data->categories_list, data);
+			/* g_list_insert_sorted (app_data->categories_list, data, category_data_compare); */
+	/*
+	}
+	else
+	{
+		data = list_entry->data;
+	}
+	*/
+
+	if (app_data->hash)	/* used to eliminate dups on a per category basis. */
+		g_hash_table_destroy (app_data->hash);
+	app_data->hash = g_hash_table_new (g_str_hash, g_str_equal);
+	generate_launchers (root_dir, app_data, data, recursive);
+}
+
+static gboolean
+check_specific_apps_hack (MateDesktopItem * item)
+{
+	static const gchar *COMMAND_LINE_LOCKDOWN_SCHEMA = "org.mate.lockdown";
+	static const gchar *COMMAND_LINE_LOCKDOWN_KEY = "disable-command-line";
+	static const gchar *COMMAND_LINE_LOCKDOWN_DESKTOP_CATEGORY = "TerminalEmulator";
+	static gboolean got_lockdown_value = FALSE;
+	static gboolean command_line_lockdown;
+
+	gchar *path;
+	const char *exec;
+
+	if (!got_lockdown_value)
+	{
+		got_lockdown_value = TRUE;
+		GSettings *lockdown_settings;
+		lockdown_settings = g_settings_new (COMMAND_LINE_LOCKDOWN_SCHEMA);
+		command_line_lockdown = g_settings_get_boolean (lockdown_settings, COMMAND_LINE_LOCKDOWN_KEY);
+		g_object_unref (lockdown_settings);
+	}
+
+	/* This seems like an ugly hack but it's the way it's currently done in the old control center */
+	exec = mate_desktop_item_get_string (item, MATE_DESKTOP_ITEM_EXEC);
+
+	/* discard xscreensaver if mate-screensaver is installed */
+	if ((exec && !strcmp (exec, "xscreensaver-demo"))
+		&& (path = g_find_program_in_path ("mate-screensaver-preferences")))
+	{
+		g_free (path);
+		return TRUE;
+	}
+
+	/* discard gnome-keyring-manager if CASA is installed */
+	if ((exec && !strcmp (exec, "gnome-keyring-manager"))
+		&& (path = g_find_program_in_path ("CASAManager.sh")))
+	{
+		g_free (path);
+		return TRUE;
+	}
+
+	/* discard terminals if lockdown key is set */
+	if (command_line_lockdown)
+	{
+		const gchar *categories =
+			mate_desktop_item_get_string (item, MATE_DESKTOP_ITEM_CATEGORIES);
+		if (g_strrstr (categories, COMMAND_LINE_LOCKDOWN_DESKTOP_CATEGORY))
+		{
+			return TRUE;
+		}
+	}
+
+	return FALSE;
+}
+
+static void
+generate_launchers (MateMenuTreeDirectory * root_dir, AppShellData * app_data, CategoryData * cat_data, gboolean recursive)
+{
+	MateDesktopItem *desktop_item;
+	const gchar *desktop_file;
+	MateMenuTreeIter *iter;
+	MateMenuTreeItemType type;
+
+	iter = matemenu_tree_directory_iter (root_dir);
+	while ((type = matemenu_tree_iter_next (iter)) != MATEMENU_TREE_ITEM_INVALID) {
+		gpointer item;
+		switch (type) {
+			case MATEMENU_TREE_ITEM_DIRECTORY:
+				item = matemenu_tree_iter_get_directory(iter);
+				/* g_message ("Found sub-category %s", matemenu_tree_directory_get_name (item)); */
+				if (recursive)
+					generate_launchers (item, app_data, cat_data, TRUE);
+				matemenu_tree_item_unref (item);
+				break;
+			case MATEMENU_TREE_ITEM_ENTRY:
+				item = matemenu_tree_iter_get_entry(iter);
+				/* g_message ("Found item name is:%s", matemenu_tree_entry_get_desktop_file_id(item)); */
+				desktop_file = matemenu_tree_entry_get_desktop_file_path (item);
+				if (desktop_file)
+				{
+					if (g_hash_table_lookup (app_data->hash, desktop_file))
+					{
+						break;	/* duplicate */
+					}
+					/* Fixme - make sure it's safe to store this without duping it. As far as I can tell it is
+					   safe as long as I don't hang on to this anylonger than I hang on to the MateMenuTreeEntry*
+					   which brings up another point - am I supposed to free these or does freeing the top level recurse
+					   */
+					g_hash_table_insert (app_data->hash, (gpointer) desktop_file,
+							(gpointer) desktop_file);
+				}
+				desktop_item = mate_desktop_item_new_from_file (desktop_file, 0, NULL);
+				if (!desktop_item)
+				{
+					g_critical ("Failure - mate_desktop_item_new_from_file(%s)",
+							desktop_file);
+					break;
+				}
+				if (!check_specific_apps_hack (desktop_item))
+					insert_launcher_into_category (cat_data, desktop_item, app_data);
+				mate_desktop_item_unref (desktop_item);
+				matemenu_tree_item_unref (item);
+				break;
+			default:
+				break;
+		}
+	}
+	matemenu_tree_iter_unref(iter);
+}
+
+static void
+generate_new_apps (AppShellData * app_data)
+{
+	GHashTable *all_apps_cache = NULL;
+	gchar *all_apps;
+	GError *error = NULL;
+	gchar *separator = "\n";
+
+	gchar *all_apps_file_name;
+	gchar **all_apps_split;
+	gint x;
+	gboolean got_new_apps;
+	CategoryData *new_apps_category = NULL;
+	GList *categories, *launchers;<--- Shadowed declaration<--- Shadowed declaration
+	GHashTable *new_apps_dups;
+
+	all_apps_file_name = g_build_filename (g_get_user_config_dir (), "mate", "ab-newapps.txt", NULL);
+
+	if (!g_file_get_contents (all_apps_file_name, &all_apps, NULL, &error))
+	{
+		/* If file does not exist, this is the first time this user has run this, create the baseline file */
+		GList *categories, *launchers;<--- Shadow variable<--- Shadow variable
+		GString *gstr;
+		gchar *dirname;
+
+		g_error_free (error);
+		error = NULL;
+
+		/* best initial size determined by running on a couple different platforms */
+		gstr = g_string_sized_new (10000);
+
+		for (categories = app_data->categories_list; categories; categories = categories->next)
+		{
+			CategoryData *data = categories->data;
+			for (launchers = data->launcher_list; launchers; launchers = launchers->next)
+			{
+				Tile *tile = TILE (launchers->data);
+				MateDesktopItem *item =
+					application_tile_get_desktop_item (APPLICATION_TILE (tile));
+				const gchar *uri = mate_desktop_item_get_location (item);
+				g_string_append (gstr, uri);
+				g_string_append (gstr, separator);
+			}
+		}
+
+		dirname = g_path_get_dirname (all_apps_file_name);
+		g_mkdir_with_parents (dirname, 0700);	/* creates if does not exist */
+		g_free (dirname);
+
+		if (!g_file_set_contents (all_apps_file_name, gstr->str, -1, &error))
+			g_warning ("Error setting all apps file:%s\n", error->message);
+
+		g_string_free (gstr, TRUE);
+		g_free (all_apps_file_name);
+		return;
+	}
+
+	all_apps_cache = g_hash_table_new (g_str_hash, g_str_equal);
+	all_apps_split = g_strsplit (all_apps, separator, -1);
+	for (x = 0; all_apps_split[x]; x++)
+	{
+		g_hash_table_insert (all_apps_cache, all_apps_split[x], all_apps_split[x]);
+	}
+
+	got_new_apps = FALSE;
+	new_apps_dups = g_hash_table_new (g_str_hash, g_str_equal);
+	for (categories = app_data->categories_list; categories; categories = categories->next)
+	{
+		CategoryData *cat_data = categories->data;
+		for (launchers = cat_data->launcher_list; launchers; launchers = launchers->next)
+		{
+			Tile *tile = TILE (launchers->data);
+			MateDesktopItem *item =
+				application_tile_get_desktop_item (APPLICATION_TILE (tile));
+			const gchar *uri = mate_desktop_item_get_location (item);
+			if (!g_hash_table_lookup (all_apps_cache, uri))
+			{
+				GFile *file;
+				GFileInfo *info;
+				long filetime;
+
+				if (g_hash_table_lookup (new_apps_dups, uri))
+				{
+					/* if a desktop file is in 2 or more top level categories, only show it once */
+					break;
+				}
+				g_hash_table_insert (new_apps_dups, (gpointer) uri, (gpointer) uri);
+
+				if (!got_new_apps)
+				{
+					new_apps_category = g_new0 (CategoryData, 1);
+					new_apps_category->category =
+						g_strdup (app_data->new_apps->name);
+					app_data->new_apps->garray =
+						g_array_sized_new (FALSE, TRUE,
+						sizeof (NewAppData *),
+						app_data->new_apps->max_items);
+
+					/* should not need this, but a bug in glib does not actually clear the elements until you call this method */
+					g_array_set_size (app_data->new_apps->garray, app_data->new_apps->max_items);
+					got_new_apps = TRUE;
+				}
+
+				file = g_file_new_for_uri (uri);
+				info = g_file_query_info (file,
+							  G_FILE_ATTRIBUTE_TIME_MODIFIED,
+							  0, NULL, NULL);
+
+				if (!info)
+				{
+					g_object_unref (file);
+					g_warning ("Cant get vfs info for %s\n", uri);
+					if (new_apps_category) {
+						g_free (new_apps_category->category);
+						g_free (new_apps_category);
+					}
+					g_free (all_apps_file_name);
+					g_strfreev (all_apps_split);
+					return;
+				}
+				filetime = (long) g_file_info_get_attribute_uint64 (info,
+										    G_FILE_ATTRIBUTE_TIME_MODIFIED);
+				g_object_unref (info);
+				g_object_unref (file);
+
+				for (x = 0; x < app_data->new_apps->max_items; x++)
+				{
+					NewAppData *temp_data = (NewAppData *)<--- Variable 'temp_data' can be declared as pointer to const
+						g_array_index (app_data->new_apps->garray, NewAppData *, x);
+					if (!temp_data || filetime > temp_data->time)	/* if this slot is empty or we are newer than this slot */
+					{
+						NewAppData *temp = g_new0 (NewAppData, 1);
+						temp->time = filetime;
+						temp->item = item;
+						g_array_insert_val (app_data->new_apps->garray, x,
+							temp);
+						break;
+					}
+				}
+			}
+		}
+	}
+	g_hash_table_destroy (new_apps_dups);
+	g_hash_table_destroy (all_apps_cache);
+
+	if (got_new_apps)
+	{
+		for (x = 0; x < app_data->new_apps->max_items; x++)
+		{
+			NewAppData *data =
+				(NewAppData *) g_array_index (app_data->new_apps->garray,
+				NewAppData *, x);
+			if (data)
+			{
+				insert_launcher_into_category (new_apps_category, data->item,
+					app_data);
+				g_free (data);
+			}
+			else
+				break;
+		}
+		app_data->categories_list =
+			g_list_prepend (app_data->categories_list, new_apps_category);
+
+		g_array_free (app_data->new_apps->garray, TRUE);
+	}
+	g_free (all_apps);
+	g_free (all_apps_file_name);
+	g_strfreev (all_apps_split);
+}
+
+static void
+insert_launcher_into_category (CategoryData * cat_data, MateDesktopItem * desktop_item,
+	AppShellData * app_data)
+{
+	GtkWidget *launcher;
+	static GtkSizeGroup *icon_group = NULL;
+
+	gchar *filepath;
+	gchar *filename;
+	GtkWidget *tile_icon;
+
+	if (!icon_group)
+		icon_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+
+	launcher =
+		application_tile_new_full (mate_desktop_item_get_location (desktop_item),
+		app_data->icon_size, app_data->show_tile_generic_name);
+	gtk_widget_set_size_request (launcher, SIZING_TILE_WIDTH, -1);
+
+	filepath =
+		g_strdup (mate_desktop_item_get_string (desktop_item, MATE_DESKTOP_ITEM_EXEC));
+	g_strdelimit (filepath, " ", '\0');	/* just want the file name - no args or replacements */
+	filename = g_strrstr (filepath, "/");
+	if (filename)
+		g_stpcpy (filepath, filename + 1);
+	filename = g_ascii_strdown (filepath, -1);
+	g_free (filepath);
+	g_object_set_data (G_OBJECT (launcher), TILE_EXEC_NAME, filename);
+
+	tile_icon = NAMEPLATE_TILE (launcher)->image;
+	gtk_size_group_add_widget (icon_group, tile_icon);
+
+	g_signal_connect (launcher, "tile-activated", G_CALLBACK (tile_activated_cb), app_data);<--- You might need to cast the function pointer here
+
+	/* Note that this will handle the case of the action being launched via the side panel as
+	   well as directly from the context menu of an individual launcher, because they both
+	   funnel through tile_button_action_activate.
+	*/
+	g_signal_connect (launcher, "tile-action-triggered",
+		G_CALLBACK (handle_menu_action_performed), app_data);<--- You might need to cast the function pointer here<--- You might need to cast the function pointer here
+
+	/* These will be inserted/removed from tables as the filter changes and we dont want them */
+	/* destroyed when they are removed */
+	g_object_ref (launcher);
+
+	/* use alphabetical order instead of the matemenu order. We group all sub items in each top level
+	category together, ignoring sub menus, so we also ignore sub menu layout hints */
+	cat_data->launcher_list =
+		/* g_list_insert (cat_data->launcher_list, launcher, -1); */
+		g_list_insert_sorted (cat_data->launcher_list, launcher, application_launcher_compare);
+	cat_data->filtered_launcher_list =
+		/* g_list_insert (cat_data->filtered_launcher_list, launcher, -1); */
+		g_list_insert_sorted (cat_data->filtered_launcher_list, launcher, application_launcher_compare);
+}
+
+static gint
+application_launcher_compare (gconstpointer a, gconstpointer b)
+{
+	ApplicationTile *launcher1 = APPLICATION_TILE (a);
+	ApplicationTile *launcher2 = APPLICATION_TILE (b);
+
+	gchar *val1 = launcher1->name;
+	gchar *val2 = launcher2->name;
+
+	if (val1 == NULL || val2 == NULL)
+	{
+		g_assert_not_reached ();
+	}
+	return g_ascii_strcasecmp (val1, val2);
+}
+
+static void
+application_launcher_clear_search_bar (AppShellData * app_data)
+{
+	SlabSection *section = SLAB_SECTION (app_data->filter_section);
+	NldSearchBar *search_bar;
+	g_assert (NLD_IS_SEARCH_BAR (section->contents));
+	search_bar = NLD_SEARCH_BAR (section->contents);
+	nld_search_bar_set_text (search_bar, "", TRUE);
+}
+
+/*
+static gint
+category_name_compare (gconstpointer a, gconstpointer b)
+{
+	CategoryData *data = (CategoryData *) a;
+	const gchar *category = b;
+
+	if (category == NULL || data->category == NULL)
+	{
+		g_assert_not_reached ();
+	}
+	return g_ascii_strcasecmp (category, data->category);
+}
+*/
+
+static void
+tile_activated_cb (Tile * tile, TileEvent * event, gpointer user_data)<--- Parameter 'event' can be declared as pointer to const
+{
+	switch (event->type)
+	{
+	case TILE_EVENT_ACTIVATED_SINGLE_CLICK:
+	case TILE_EVENT_ACTIVATED_KEYBOARD:
+		handle_launcher_single_clicked (tile, user_data);
+		break;
+	default:
+		break;
+	}
+
+}
+
+static void
+handle_launcher_single_clicked (Tile * launcher, gpointer data)
+{
+	GApplication *app;
+	AppShellData *app_data = (AppShellData *) data;
+
+	tile_trigger_action (launcher, launcher->actions[APPLICATION_TILE_ACTION_START]);
+
+	if (g_settings_get_boolean (app_data->settings, EXIT_SHELL_ON_ACTION_START))
+	{
+		if (app_data->exit_on_close)
+		{
+			app=g_application_get_default();
+			g_application_quit(app);
+		}
+		else
+			hide_shell (app_data);
+	}
+}
+
+static void
+handle_menu_action_performed (Tile * launcher, TileEvent * event, TileAction * action,<--- Parameter 'action' can be declared as pointer to const<--- Parameter 'launcher' can be declared as pointer to const
+	gpointer data)
+{
+	GApplication *app;
+	AppShellData *app_data = (AppShellData *) data;
+	gchar *temp;
+
+	temp = NULL;
+	if (action == launcher->actions[APPLICATION_TILE_ACTION_START])
+	{
+		temp = EXIT_SHELL_ON_ACTION_START;
+	}
+
+	else if (action == launcher->actions[APPLICATION_TILE_ACTION_HELP])
+	{
+		temp = EXIT_SHELL_ON_ACTION_HELP;
+	}
+
+	else if (action == launcher->actions[APPLICATION_TILE_ACTION_UPDATE_MAIN_MENU]
+		|| action == launcher->actions[APPLICATION_TILE_ACTION_UPDATE_STARTUP])
+	{
+		temp = EXIT_SHELL_ON_ACTION_ADD_REMOVE;
+	}
+
+	else if (action == launcher->actions[APPLICATION_TILE_ACTION_UPGRADE_PACKAGE]
+		|| action == launcher->actions[APPLICATION_TILE_ACTION_UNINSTALL_PACKAGE])
+	{
+		temp = EXIT_SHELL_ON_ACTION_UPGRADE_UNINSTALL;
+	}
+
+	if (temp)
+	{
+		if (g_settings_get_boolean (app_data->settings, temp))
+		{
+			if (app_data->exit_on_close)
+			{
+				app=g_application_get_default();
+				g_application_quit(app);
+			}
+			else
+				hide_shell (app_data);
+		}
+	}
+	else
+		g_warning ("Unknown Action");
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/114.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/114.html new file mode 100644 index 00000000..a749cb99 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/114.html @@ -0,0 +1,367 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/*
+ * This file is part of libslab.
+ *
+ * Copyright (c) 2006 Novell, Inc.
+ *
+ * Libslab 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.
+ *
+ * Libslab 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 libslab; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef __SHELL_WINDOW_H__
+#define __SHELL_WINDOW_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 "app-shell.h"
+
+G_BEGIN_DECLS
+
+#define SHELL_WINDOW_TYPE            (shell_window_get_type ())
+#define SHELL_WINDOW(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHELL_WINDOW_TYPE, ShellWindow))
+#define SHELL_WINDOW_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_WINDOW_TYPE, ShellWindowClass))
+#define IS_SHELL_WINDOW(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHELL_WINDOW_TYPE))
+#define IS_SHELL_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_WINDOW_TYPE))
+#define SHELL_WINDOW_GET_CLASS(obj)  (G_TYPE_CHECK_GET_CLASS ((obj), SHELL_WINDOW_TYPE, ShellWindowClass))
+
+typedef struct _ShellWindow ShellWindow;
+typedef struct _ShellWindowClass ShellWindowClass;
+
+struct _ShellWindow
+{
+	GtkFrame frame;
+
+	GtkBox *_hbox;
+	GtkWidget *_left_pane;
+	GtkWidget *_right_pane;
+
+	gulong resize_handler_id;
+};
+
+struct _ShellWindowClass
+{
+	GtkFrameClass parent_class;
+};
+
+GType shell_window_get_type (void);
+GtkWidget *shell_window_new (AppShellData * app_data);
+void shell_window_set_contents (ShellWindow * window, GtkWidget * left_pane,
+	GtkWidget * right_pane);
+void shell_window_clear_resize_handler (ShellWindow * win);
+
+G_END_DECLS
+
+#endif /* __SHELL_WINDOW_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/115.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/115.html new file mode 100644 index 00000000..fbb1f1ce --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/115.html @@ -0,0 +1,315 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/*
+ * This file is part of libslab.
+ *
+ * Copyright (c) 2006 Novell, Inc.
+ *
+ * Libslab 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.
+ *
+ * Libslab 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 libslab; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef __SLAB_MATE_UTIL_H__
+#define __SLAB_MATE_UTIL_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 <libmate-desktop/mate-desktop-item.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+MateDesktopItem *load_desktop_item_from_unknown (const gchar * id);
+
+gboolean open_desktop_item_exec (MateDesktopItem * desktop_item);
+gboolean open_desktop_item_help (MateDesktopItem * desktop_item);
+
+void copy_file (const gchar * src_uri, const gchar * dst_uri);
+
+G_END_DECLS
+
+#endif /* __SLAB_MATE_UTIL_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/116.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/116.html new file mode 100644 index 00000000..5e6cd478 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/116.html @@ -0,0 +1,369 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/*
+ * This file is part of libslab.
+ *
+ * Copyright (c) 2006 Novell, Inc.
+ *
+ * Libslab 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.
+ *
+ * Libslab 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 libslab; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef __NLD_SEARCH_BAR_H__
+#define __NLD_SEARCH_BAR_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.
+
+G_BEGIN_DECLS
+
+#define NLD_TYPE_SEARCH_BAR            (nld_search_bar_get_type ())
+#define NLD_SEARCH_BAR(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NLD_TYPE_SEARCH_BAR, NldSearchBar))
+#define NLD_SEARCH_BAR_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), NLD_TYPE_SEARCH_BAR, NldSearchBarClass))
+#define NLD_IS_SEARCH_BAR(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NLD_TYPE_SEARCH_BAR))
+#define NLD_IS_SEARCH_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NLD_TYPE_SEARCH_BAR))
+#define NLD_SEARCH_BAR_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), NLD_TYPE_SEARCH_BAR, NldSearchBarClass))
+
+typedef struct
+{
+	GtkBox parent;
+} NldSearchBar;
+
+typedef struct
+{
+	GtkBoxClass parent_class;
+
+	void (*search) (NldSearchBar *, const char *text);
+} NldSearchBarClass;
+
+GType nld_search_bar_get_type (void);
+
+GtkWidget *nld_search_bar_new (void);
+
+void nld_search_bar_clear (NldSearchBar * search_bar);
+gboolean nld_search_bar_has_focus (NldSearchBar * search_bar);
+
+gboolean nld_search_bar_get_show_button (NldSearchBar * search_bar);
+void nld_search_bar_set_show_button (NldSearchBar * search_bar, gboolean show_button);
+
+int nld_search_bar_get_search_timeout (NldSearchBar * search_bar);
+void nld_search_bar_set_search_timeout (NldSearchBar * search_bar, int search_timeout);
+
+const char *nld_search_bar_get_text (NldSearchBar * search_bar);
+void nld_search_bar_set_text (NldSearchBar * search_bar, const char *text, gboolean activate);
+
+G_END_DECLS
+
+#endif /* __NLD_SEARCH_BAR_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/117.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/117.html new file mode 100644 index 00000000..dc3b8486 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/117.html @@ -0,0 +1,351 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/*
+ * This file is part of libtile.
+ *
+ * Copyright (c) 2006 Novell, Inc.
+ *
+ * Libtile 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.
+ *
+ * Libtile 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 libslab; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef __NAMEPLATE_TILE_H__
+#define __NAMEPLATE_TILE_H__
+
+#include "tile.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.
+
+G_BEGIN_DECLS
+
+#define NAMEPLATE_TILE_TYPE         (nameplate_tile_get_type ())
+#define NAMEPLATE_TILE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), NAMEPLATE_TILE_TYPE, NameplateTile))
+#define NAMEPLATE_TILE_CLASS(c)     (G_TYPE_CHECK_CLASS_CAST ((c), NAMEPLATE_TILE_TYPE, NameplateTileClass))
+#define IS_NAMEPLATE_TILE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), NAMEPLATE_TILE_TYPE))
+#define IS_NAMEPLATE_TILE_CLASS(c)  (G_TYPE_CHECK_CLASS_TYPE ((c), NAMEPLATE_TILE_TYPE))
+#define NAMEPLATE_TILE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), NAMEPLATE_TILE_TYPE, NameplateTileClass))
+
+typedef struct {
+	Tile tile;
+
+	GtkWidget *image;
+	GtkWidget *header;
+	GtkWidget *subheader;
+} NameplateTile;
+
+typedef struct {
+	TileClass tile_class;
+} NameplateTileClass;
+
+GType nameplate_tile_get_type (void);
+
+GtkWidget *nameplate_tile_new (const gchar * uri, GtkWidget * image, GtkWidget * header,
+	GtkWidget * subheader);
+
+G_END_DECLS
+
+#endif /* __NAMEPLATE_TILE_H__  */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/118.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/118.html new file mode 100644 index 00000000..0b75e911 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/118.html @@ -0,0 +1,371 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/*
+ * This file is part of libtile.
+ *
+ * Copyright (c) 2006 Novell, Inc.
+ *
+ * Libtile 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.
+ *
+ * Libtile 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 libslab; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef __APPLICATION_TILE_H__
+#define __APPLICATION_TILE_H__
+
+#include "nameplate-tile.h"
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libmate-desktop/mate-desktop-item.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+#define APPLICATION_TILE_TYPE         (application_tile_get_type ())
+#define APPLICATION_TILE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), APPLICATION_TILE_TYPE, ApplicationTile))
+#define APPLICATION_TILE_CLASS(c)     (G_TYPE_CHECK_CLASS_CAST ((c), APPLICATION_TILE_TYPE, ApplicationTileClass))
+#define IS_APPLICATION_TILE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), APPLICATION_TILE_TYPE))
+#define IS_APPLICATION_TILE_CLASS(c)  (G_TYPE_CHECK_CLASS_TYPE ((c), APPLICATION_TILE_TYPE))
+#define APPLICATION_TILE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), APPLICATION_TILE_TYPE, ApplicationTileClass))
+#define APPLICATION_TILE_ACTION_START             0
+#define APPLICATION_TILE_ACTION_HELP              1
+#define APPLICATION_TILE_ACTION_UPDATE_MAIN_MENU  2
+#define APPLICATION_TILE_ACTION_UPDATE_STARTUP    3
+#define APPLICATION_TILE_ACTION_UPGRADE_PACKAGE   4
+#define APPLICATION_TILE_ACTION_UNINSTALL_PACKAGE 5
+
+typedef struct
+{
+	NameplateTile nameplate_tile;
+
+	gchar *name;
+	gchar *description;
+} ApplicationTile;
+
+typedef struct
+{
+	NameplateTileClass nameplate_tile_class;
+} ApplicationTileClass;
+
+GType application_tile_get_type (void);
+
+GtkWidget *application_tile_new (const gchar * desktop_item_id);
+GtkWidget *application_tile_new_full (const gchar * desktop_item_id,
+	GtkIconSize icon_size, gboolean show_generic_name);
+
+MateDesktopItem *application_tile_get_desktop_item (ApplicationTile * tile);
+
+G_END_DECLS
+
+#endif /* __APPLICATION_TILE_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/119.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/119.html new file mode 100644 index 00000000..fd4ebd7c --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/119.html @@ -0,0 +1,345 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/*
+ * This file is part of libslab.
+ *
+ * Copyright (c) 2006 Novell, Inc.
+ *
+ * Libslab 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.
+ *
+ * Libslab 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 libslab; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef __THEMED_ICON_H__
+#define __THEMED_ICON_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.
+
+G_BEGIN_DECLS
+
+#define THEMED_ICON_TYPE            (themed_icon_get_type ())
+#define THEMED_ICON(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), THEMED_ICON_TYPE, ThemedIcon))
+#define THEMED_ICON_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), THEMED_ICON_TYPE, ThemedIconClass))
+#define IS_THEMED_ICON(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THEMED_ICON_TYPE))
+#define IS_THEMED_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), THEMED_ICON_TYPE))
+#define THEMED_ICON_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), THEMED_ICON_TYPE, ThemedIconClass))
+
+typedef struct
+{
+	GtkImage parent;
+
+	GtkIconSize size;
+	gchar *id;
+} ThemedIcon;
+
+typedef struct
+{
+	GtkImageClass parent_class;
+} ThemedIconClass;
+
+GType themed_icon_get_type (void);
+GtkWidget *themed_icon_new (const gchar * id, GtkIconSize size);
+
+G_END_DECLS
+
+#endif /* __THEMED_ICON_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/12.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/12.html new file mode 100644 index 00000000..259bcda8 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/12.html @@ -0,0 +1,321 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/*
+ *  Authors: Rodney Dawes <dobey@ximian.com>
+ *
+ *  Copyright 2003-2006 Novell, Inc. (www.novell.com)
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of version 2 of the GNU General Public License
+ *  as published by the Free Software Foundation
+ *
+ *  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., 59 Temple Street #330, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef _MATE_WP_INFO_H_
+#define _MATE_WP_INFO_H_
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libmate-desktop/mate-desktop-thumbnail.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+typedef struct _MateWPInfo {
+	char* uri;
+	char* thumburi;
+	char* name;
+	char* mime_type;
+
+	goffset size;
+
+	time_t mtime;
+} MateWPInfo;
+
+MateWPInfo* mate_wp_info_new(const char* uri, MateDesktopThumbnailFactory* thumbs);
+void mate_wp_info_free(MateWPInfo* info);
+
+#endif
+
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/120.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/120.html new file mode 100644 index 00000000..a294784a --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/120.html @@ -0,0 +1,1765 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * This file is part of libtile.
+ *
+ * Copyright (c) 2006, 2007 Novell, Inc.
+ *
+ * Libtile 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.
+ *
+ * Libtile 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 libslab; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "application-tile.h"
+#include "config.h"<--- Include file: "config.h" not found.
+
+#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-lib.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 <unistd.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "slab-mate-util.h"
+#include "libslab-utils.h"
+#include "bookmark-agent.h"
+#include "themed-icon.h"
+
+typedef enum {
+	APP_IN_USER_STARTUP_DIR,
+	APP_NOT_IN_STARTUP_DIR,
+	APP_NOT_ELIGIBLE
+} StartupStatus;
+
+static void application_tile_get_property (GObject *, guint,       GValue *, GParamSpec *);
+static void application_tile_set_property (GObject *, guint, const GValue *, GParamSpec *);
+static void application_tile_finalize     (GObject *);
+
+static void application_tile_setup (ApplicationTile *);
+
+static GtkWidget *create_header    (const gchar *);
+static GtkWidget *create_subheader (const gchar *);
+
+static void header_size_allocate_cb (GtkWidget *, GtkAllocation *, gpointer);
+
+static void start_trigger     (Tile *, TileEvent *, TileAction *);
+static void help_trigger      (Tile *, TileEvent *, TileAction *);
+static void user_apps_trigger (Tile *, TileEvent *, TileAction *);
+static void startup_trigger   (Tile *, TileEvent *, TileAction *);
+
+static void add_to_user_list         (ApplicationTile *);
+static void remove_from_user_list    (ApplicationTile *);
+static void add_to_startup_list      (ApplicationTile *);
+static void remove_from_startup_list (ApplicationTile *);
+
+static void update_user_list_menu_item (ApplicationTile *);
+static void agent_notify_cb (GObject *, GParamSpec *, gpointer);
+
+static StartupStatus get_desktop_item_startup_status (MateDesktopItem *);
+static void          update_startup_menu_item (ApplicationTile *);
+
+typedef struct {
+	MateDesktopItem *desktop_item;
+
+	gchar       *image_id;
+	gboolean     image_is_broken;
+	GtkIconSize  image_size;
+
+	gboolean show_generic_name;
+	StartupStatus startup_status;
+
+	BookmarkAgent       *agent;
+	BookmarkStoreStatus  agent_status;
+	gboolean             is_bookmarked;
+	gulong               notify_signal_id;
+} ApplicationTilePrivate;
+
+enum {
+	PROP_0,
+	PROP_APPLICATION_NAME,
+	PROP_APPLICATION_DESCRIPTION
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (ApplicationTile, application_tile, NAMEPLATE_TILE_TYPE)<--- 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
+application_tile_class_init (ApplicationTileClass *app_tile_class)
+{
+	GObjectClass *g_obj_class = G_OBJECT_CLASS (app_tile_class);
+
+	g_obj_class->get_property = application_tile_get_property;
+	g_obj_class->set_property = application_tile_set_property;
+	g_obj_class->finalize     = application_tile_finalize;
+
+	g_object_class_install_property (
+		g_obj_class, PROP_APPLICATION_NAME,
+		g_param_spec_string (
+			"application-name", "application-name",
+			"the name of the application", NULL,
+			G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+
+	g_object_class_install_property (
+		g_obj_class, PROP_APPLICATION_DESCRIPTION,
+		g_param_spec_string (
+			"application-description", "application-description",
+			"the name of the application", NULL,
+			G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+}
+
+GtkWidget *
+application_tile_new (const gchar *desktop_item_id)
+{
+	return application_tile_new_full (desktop_item_id, GTK_ICON_SIZE_DND, TRUE);
+}
+
+GtkWidget *
+application_tile_new_full (const gchar *desktop_item_id,
+	GtkIconSize image_size, gboolean show_generic_name)
+{
+	ApplicationTile        *this;
+	ApplicationTilePrivate *priv;
+
+	const gchar *uri = NULL;
+
+	MateDesktopItem *desktop_item;
+
+	desktop_item = load_desktop_item_from_unknown (desktop_item_id);
+
+	if (
+		desktop_item &&
+		mate_desktop_item_get_entry_type (desktop_item) == MATE_DESKTOP_ITEM_TYPE_APPLICATION
+	)
+		uri = mate_desktop_item_get_location (desktop_item);
+
+	if (! uri) {
+		if (desktop_item)
+			mate_desktop_item_unref (desktop_item);
+
+		return NULL;
+	}
+
+	this = g_object_new (APPLICATION_TILE_TYPE, "tile-uri", uri, NULL);
+	priv = application_tile_get_instance_private (this);
+
+	priv->image_size   = image_size;
+	priv->desktop_item = desktop_item;
+	priv->show_generic_name = show_generic_name;
+
+	application_tile_setup (this);
+
+	return GTK_WIDGET (this);
+}
+
+static void
+application_tile_init (ApplicationTile *tile)
+{
+	ApplicationTilePrivate *priv = application_tile_get_instance_private (tile);
+
+	priv->desktop_item    = NULL;
+	priv->image_id        = NULL;
+	priv->image_is_broken = TRUE;
+
+	priv->agent            = NULL;
+	priv->agent_status     = BOOKMARK_STORE_ABSENT;
+	priv->is_bookmarked    = FALSE;
+	priv->notify_signal_id = 0;
+
+	tile->name = tile->description = NULL;
+}
+
+static void
+application_tile_finalize (GObject *g_object)
+{
+	ApplicationTile *tile = APPLICATION_TILE (g_object);
+	ApplicationTilePrivate *priv = application_tile_get_instance_private (tile);
+
+	if (tile->name) {
+		g_free (tile->name);
+		tile->name = NULL;
+	}
+	if (tile->description) {
+		g_free (tile->description);
+		tile->description = NULL;
+	}
+
+	if (priv->desktop_item) {
+		mate_desktop_item_unref (priv->desktop_item);
+		priv->desktop_item = NULL;
+	}
+	if (priv->image_id) {
+		g_free (priv->image_id);
+		priv->image_id = NULL;
+	}
+
+	if (priv->notify_signal_id)
+		g_signal_handler_disconnect (priv->agent, priv->notify_signal_id);
+
+	g_object_unref (G_OBJECT (priv->agent));
+
+	G_OBJECT_CLASS (application_tile_parent_class)->finalize (g_object);
+}
+
+static void
+application_tile_get_property (GObject *g_obj, guint prop_id, GValue *value, GParamSpec *param_spec)
+{
+	ApplicationTile *tile = APPLICATION_TILE (g_obj);
+
+	switch (prop_id) {
+	case PROP_APPLICATION_NAME:
+		g_value_set_string (value, tile->name);
+		break;
+
+	case PROP_APPLICATION_DESCRIPTION:
+		g_value_set_string (value, tile->description);
+		break;
+
+	default:
+		break;
+	}
+}
+
+static void
+application_tile_set_property (GObject *g_obj, guint prop_id, const GValue *value, GParamSpec *param_spec)
+{
+	ApplicationTile *tile = APPLICATION_TILE (g_obj);
+
+	switch (prop_id) {
+	case PROP_APPLICATION_NAME:
+		if (tile->name)
+			g_free (tile->name);
+		tile->name = g_strdup (g_value_get_string (value));
+		break;
+
+	case PROP_APPLICATION_DESCRIPTION:
+		if (tile->description)
+			g_free (tile->description);
+		tile->description = g_strdup (g_value_get_string (value));
+		break;
+
+	default:
+		break;
+	}
+}
+
+static void
+application_tile_setup (ApplicationTile *this)
+{
+	ApplicationTilePrivate *priv = application_tile_get_instance_private (this);
+
+	GtkWidget *image;
+	GtkWidget *header;
+	GtkWidget *subheader;
+	GtkMenu   *context_menu;
+	AtkObject *accessible;
+
+	TileAction  **actions;
+	TileAction   *action;
+	GtkWidget    *menu_item;
+	GtkContainer *menu_ctnr;
+
+	gchar *name;
+	gchar *desc;
+
+	gchar *comment;
+
+	gchar *markup;
+	gchar *str;
+
+	if (! priv->desktop_item) {
+		priv->desktop_item = load_desktop_item_from_unknown (TILE (this)->uri);
+
+		if (! priv->desktop_item)
+			return;
+	}
+
+	priv->image_id = g_strdup (mate_desktop_item_get_localestring (priv->desktop_item, "Icon"));
+	image = themed_icon_new (priv->image_id, priv->image_size);
+
+	gchar *filename = g_filename_from_uri (mate_desktop_item_get_location (priv->desktop_item), NULL, NULL);
+	GKeyFile *keyfile = g_key_file_new ();
+	g_key_file_load_from_file (keyfile, filename, G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS, NULL);
+
+	name = g_key_file_get_locale_string (keyfile, G_KEY_FILE_DESKTOP_GROUP, "Name", NULL, NULL);
+	desc = g_key_file_get_locale_string (keyfile, G_KEY_FILE_DESKTOP_GROUP, "GenericName", NULL, NULL);
+	comment = g_key_file_get_locale_string (keyfile, G_KEY_FILE_DESKTOP_GROUP, "Comment", NULL, NULL);
+
+	accessible = gtk_widget_get_accessible (GTK_WIDGET (this));
+	if (name)
+	  atk_object_set_name (accessible, name);
+	if (desc)
+	  atk_object_set_description (accessible, desc);
+
+	header    = create_header    (name);
+
+	/*if no GenericName then just show and center the Name */
+	if (desc && priv->show_generic_name
+	    && (!name || strcmp(name, desc) != 0))
+		subheader = create_subheader (desc);
+	else
+		subheader = NULL;
+
+	context_menu = GTK_MENU (gtk_menu_new ());
+
+	g_object_set (
+		G_OBJECT (this),
+		"nameplate-image",         image,
+		"nameplate-header",        header,
+		"nameplate-subheader",     subheader,
+		"context-menu",            context_menu,
+		"application-name",        name,
+		"application-description", desc,
+		NULL);
+	gtk_widget_set_tooltip_text (GTK_WIDGET (this), comment);
+
+	priv->agent = bookmark_agent_get_instance (BOOKMARK_STORE_USER_APPS);
+	g_object_get (G_OBJECT (priv->agent), BOOKMARK_AGENT_STORE_STATUS_PROP, & priv->agent_status, NULL);
+
+	priv->notify_signal_id = g_signal_connect (
+		G_OBJECT (priv->agent), "notify", G_CALLBACK (agent_notify_cb), this);
+
+	priv->startup_status  = get_desktop_item_startup_status (priv->desktop_item);
+
+	actions = g_new0 (TileAction *, 6);
+
+	TILE (this)->actions   = actions;
+	TILE (this)->n_actions = 6;
+
+	menu_ctnr = GTK_CONTAINER (TILE (this)->context_menu);
+
+/* make start action */
+
+	str = g_strdup_printf (_("Start %s"), this->name);
+	markup = g_markup_printf_escaped ("<b>%s</b>", str);
+	action = tile_action_new (TILE (this), start_trigger, markup, TILE_ACTION_OPENS_NEW_WINDOW);
+	actions [APPLICATION_TILE_ACTION_START] = action;
+	g_free (markup);
+	g_free (str);
+
+	menu_item = GTK_WIDGET (tile_action_get_menu_item (action));
+
+	gtk_container_add (menu_ctnr, menu_item);
+
+	TILE (this)->default_action = action;
+
+/* insert separator */
+
+	gtk_container_add (menu_ctnr, gtk_separator_menu_item_new ());
+
+/* make help action */
+
+	if (mate_desktop_item_get_string (priv->desktop_item, "DocPath")) {
+		action = tile_action_new (
+			TILE (this), help_trigger, _("Help"),
+			TILE_ACTION_OPENS_NEW_WINDOW | TILE_ACTION_OPENS_HELP);
+
+		menu_item = GTK_WIDGET (tile_action_get_menu_item (action));
+		gtk_container_add (menu_ctnr, menu_item);
+	}
+	else {
+		action = NULL;
+	}
+
+	actions [APPLICATION_TILE_ACTION_HELP] = action;
+
+/* insert separator */
+
+	if (action != NULL)
+		gtk_container_add (menu_ctnr, gtk_separator_menu_item_new ());
+
+/* make "add/remove to favorites" action */
+
+	update_user_list_menu_item (this);
+
+/* make "add/remove to startup" action */
+
+	if (priv->startup_status != APP_NOT_ELIGIBLE) {
+		action = tile_action_new (TILE (this), startup_trigger, NULL, 0);
+		actions [APPLICATION_TILE_ACTION_UPDATE_STARTUP] = action;
+
+		update_startup_menu_item (this);
+
+		menu_item = GTK_WIDGET (tile_action_get_menu_item (action));
+
+		gtk_container_add (menu_ctnr, menu_item);
+	}
+
+	gtk_widget_show_all (GTK_WIDGET (TILE (this)->context_menu));
+
+	g_free (name);
+	g_free (desc);
+	g_free (comment);
+	g_free (filename);
+	g_key_file_unref (keyfile);
+}
+
+static GtkWidget *
+create_header (const gchar *name)
+{
+	GtkWidget *header;
+
+	header = gtk_label_new (name);
+	gtk_label_set_line_wrap (GTK_LABEL (header), TRUE);
+	gtk_label_set_xalign (GTK_LABEL (header), 0.0);
+
+	g_signal_connect (
+		G_OBJECT (header),
+		"size-allocate",
+		G_CALLBACK (header_size_allocate_cb),
+		NULL);
+
+	return header;
+}
+
+static void
+set_background_color (GtkWidget *widget,
+                      GdkRGBA   *rgba)
+{
+  gchar          *css;
+  GtkCssProvider *provider;
+
+  provider = gtk_css_provider_new ();
+
+  css = g_strdup_printf ("* { background-color: %s;}",
+                         gdk_rgba_to_string (rgba));
+  gtk_css_provider_load_from_data (provider, css, -1, NULL);
+  g_free (css);
+
+  gtk_style_context_add_provider (gtk_widget_get_style_context (widget),
+                                  GTK_STYLE_PROVIDER (provider),
+                                  GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+  g_object_unref (provider);
+}
+
+static GtkWidget *
+create_subheader (const gchar *desc)
+{
+	GtkWidget       *subheader;
+	GtkStyleContext *context;
+	GdkRGBA         *rgba = NULL;
+
+	subheader = gtk_label_new (desc);
+	gtk_label_set_ellipsize (GTK_LABEL (subheader), PANGO_ELLIPSIZE_END);
+	gtk_label_set_xalign (GTK_LABEL (subheader), 0.0);
+	context = gtk_widget_get_style_context (subheader);
+	gtk_style_context_get (context,
+	                       GTK_STATE_FLAG_INSENSITIVE,
+	                       "background-color", &rgba,
+	                       NULL);
+
+	set_background_color (subheader, rgba);
+
+	return subheader;
+}
+
+static void
+start_trigger (Tile *tile, TileEvent *event, TileAction *action)
+{
+	ApplicationTile *this = APPLICATION_TILE (tile);
+	ApplicationTilePrivate *priv = application_tile_get_instance_private (this);
+	open_desktop_item_exec (priv->desktop_item);
+}
+
+static void
+help_trigger (Tile *tile, TileEvent *event, TileAction *action)
+{
+	ApplicationTile *this = APPLICATION_TILE (tile);
+	ApplicationTilePrivate *priv = application_tile_get_instance_private (this);
+	open_desktop_item_help (priv->desktop_item);
+}
+
+static void
+user_apps_trigger (Tile *tile, TileEvent *event, TileAction *action)
+{
+	ApplicationTile *this = APPLICATION_TILE (tile);
+	ApplicationTilePrivate *priv = application_tile_get_instance_private (this);
+
+	if (priv->is_bookmarked)
+		remove_from_user_list (this);
+	else
+		add_to_user_list (this);
+
+	update_user_list_menu_item (this);
+}
+
+static void
+add_to_user_list (ApplicationTile *this)
+{
+	ApplicationTilePrivate *priv = application_tile_get_instance_private (this);
+
+	BookmarkItem *item;
+
+	item = g_new0 (BookmarkItem, 1);
+	item->uri       = TILE (this)->uri;
+	item->mime_type = "application/x-desktop";
+
+	bookmark_agent_add_item (priv->agent, item);
+	g_free (item);
+
+	priv->is_bookmarked = TRUE;
+}
+
+static void
+remove_from_user_list (ApplicationTile *this)
+{
+	ApplicationTilePrivate *priv = application_tile_get_instance_private (this);
+
+	bookmark_agent_remove_item (priv->agent, TILE (this)->uri);
+
+	priv->is_bookmarked = FALSE;
+}
+
+static void
+startup_trigger (Tile *tile, TileEvent *event, TileAction *action)
+{
+	ApplicationTile *this = APPLICATION_TILE (tile);
+	ApplicationTilePrivate *priv = application_tile_get_instance_private (this);
+
+	switch (priv->startup_status) {
+		case APP_IN_USER_STARTUP_DIR:
+			remove_from_startup_list (this);
+			break;
+
+		case APP_NOT_IN_STARTUP_DIR:
+			add_to_startup_list (this);
+			break;
+
+		default:
+			break;
+	}
+
+	update_startup_menu_item (this);
+}
+
+static void
+add_to_startup_list (ApplicationTile *this)
+{
+	ApplicationTilePrivate *priv = application_tile_get_instance_private (this);
+
+	gchar *desktop_item_filename;
+	gchar *desktop_item_basename;
+
+	gchar *startup_dir;
+	gchar *dst_filename;
+
+	const gchar *src_uri;
+	gchar *dst_uri;
+
+	desktop_item_filename =
+		g_filename_from_uri (mate_desktop_item_get_location (priv->desktop_item), NULL,
+		NULL);
+
+	g_return_if_fail (desktop_item_filename != NULL);
+
+	desktop_item_basename = g_path_get_basename (desktop_item_filename);
+
+	startup_dir = g_build_filename (g_get_user_config_dir (), "autostart", NULL);
+
+	if (! g_file_test (startup_dir, G_FILE_TEST_EXISTS))
+		g_mkdir_with_parents (startup_dir, 0700);
+
+	dst_filename = g_build_filename (startup_dir, desktop_item_basename, NULL);
+
+	src_uri = mate_desktop_item_get_location (priv->desktop_item);
+	dst_uri = g_filename_to_uri (dst_filename, NULL, NULL);
+
+	copy_file (src_uri, dst_uri);
+	priv->startup_status = APP_IN_USER_STARTUP_DIR;
+
+	g_free (desktop_item_filename);
+	g_free (desktop_item_basename);
+	g_free (startup_dir);
+	g_free (dst_filename);
+	g_free (dst_uri);
+}
+
+static void
+remove_from_startup_list (ApplicationTile *this)
+{
+	ApplicationTilePrivate *priv = application_tile_get_instance_private (this);
+
+	gchar *ditem_filename;
+	gchar *ditem_basename;
+	gchar *src_filename;
+
+	ditem_filename =
+		g_filename_from_uri (mate_desktop_item_get_location (priv->desktop_item), NULL,
+		NULL);
+
+	g_return_if_fail (ditem_filename != NULL);
+
+	ditem_basename = g_path_get_basename (ditem_filename);
+
+	src_filename = g_build_filename (g_get_user_config_dir (), "autostart", ditem_basename, NULL);
+
+	priv->startup_status = APP_NOT_IN_STARTUP_DIR;
+	if (g_file_test (src_filename, G_FILE_TEST_EXISTS))
+	{
+		if(g_file_test (src_filename, G_FILE_TEST_IS_DIR))
+			g_assert_not_reached ();
+		g_unlink (src_filename);
+	}
+
+	g_free (ditem_filename);
+	g_free (ditem_basename);
+	g_free (src_filename);
+}
+
+MateDesktopItem *
+application_tile_get_desktop_item (ApplicationTile *tile)
+{
+        ApplicationTilePrivate *priv;
+
+        priv = application_tile_get_instance_private (tile);
+	return priv->desktop_item;
+}
+
+static void
+update_user_list_menu_item (ApplicationTile *this)
+{
+	ApplicationTilePrivate *priv = application_tile_get_instance_private (this);
+
+	TileAction *action;
+	GtkWidget  *item;
+
+	if (priv->agent_status == BOOKMARK_STORE_ABSENT) {
+		if (TILE (this)->actions [APPLICATION_TILE_ACTION_UPDATE_MAIN_MENU])
+			g_object_unref (TILE (this)->actions [APPLICATION_TILE_ACTION_UPDATE_MAIN_MENU]);
+
+		TILE (this)->actions [APPLICATION_TILE_ACTION_UPDATE_MAIN_MENU] = NULL;
+	}
+	else if (! TILE (this)->actions [APPLICATION_TILE_ACTION_UPDATE_MAIN_MENU]) {
+		TILE (this)->actions [APPLICATION_TILE_ACTION_UPDATE_MAIN_MENU] =
+			tile_action_new (TILE (this), user_apps_trigger, NULL, 0);
+
+		tile_action_set_menu_item_label (
+			TILE (this)->actions [APPLICATION_TILE_ACTION_UPDATE_MAIN_MENU], "blah");
+
+		item = GTK_WIDGET (tile_action_get_menu_item (
+			TILE (this)->actions [APPLICATION_TILE_ACTION_UPDATE_MAIN_MENU]));
+		gtk_menu_shell_insert (GTK_MENU_SHELL (TILE (this)->context_menu), item, 4);
+
+		gtk_widget_show_all (item);
+	}
+	else {
+		/* do nothing */ ;
+	}
+
+	action = TILE (this)->actions [APPLICATION_TILE_ACTION_UPDATE_MAIN_MENU];
+
+	if (! action)
+		return;
+
+	priv->is_bookmarked = bookmark_agent_has_item (priv->agent, TILE (this)->uri);
+
+	if (priv->is_bookmarked)
+		tile_action_set_menu_item_label (action, _("Remove from Favorites"));
+	else
+		tile_action_set_menu_item_label (action, _("Add to Favorites"));
+
+	item = GTK_WIDGET (tile_action_get_menu_item (action));
+
+	if (! GTK_IS_MENU_ITEM (item))
+		return;
+
+	g_object_get (G_OBJECT (priv->agent), BOOKMARK_AGENT_STORE_STATUS_PROP, & priv->agent_status, NULL);
+
+	gtk_widget_set_sensitive (item, (priv->agent_status != BOOKMARK_STORE_DEFAULT_ONLY));
+}
+
+static StartupStatus
+get_desktop_item_startup_status (MateDesktopItem *desktop_item)
+{
+	gchar *filename;
+	gchar *basename;
+
+	const gchar * const * global_dirs;
+	gchar *global_target;
+	gchar *user_target;
+
+	StartupStatus retval;
+	gint x;
+
+	filename = g_filename_from_uri (mate_desktop_item_get_location (desktop_item), NULL, NULL);
+	if (!filename)
+		return APP_NOT_ELIGIBLE;
+	basename = g_path_get_basename (filename);
+
+	retval = APP_NOT_IN_STARTUP_DIR;
+	global_dirs = g_get_system_config_dirs();
+	for(x=0; global_dirs[x]; x++)
+	{
+		global_target = g_build_filename (global_dirs[x], "autostart", basename, NULL);
+		if (g_file_test (global_target, G_FILE_TEST_EXISTS))
+		{
+			retval = APP_NOT_ELIGIBLE;
+			g_free (global_target);
+			break;
+		}
+		g_free (global_target);
+	}
+
+	/* mate-session currently checks these dirs also. see startup-programs.c */
+	if (retval != APP_NOT_ELIGIBLE)
+	{
+		global_dirs = g_get_system_data_dirs();
+		for(x=0; global_dirs[x]; x++)
+		{
+			global_target = g_build_filename (global_dirs[x], "mate", "autostart", basename, NULL);
+			if (g_file_test (global_target, G_FILE_TEST_EXISTS))
+			{
+				retval = APP_NOT_ELIGIBLE;
+				g_free (global_target);
+				break;
+			}
+			g_free (global_target);
+		}
+	}
+
+	if (retval != APP_NOT_ELIGIBLE)
+	{
+		user_target = g_build_filename (g_get_user_config_dir (), "autostart", basename, NULL);
+		if (g_file_test (user_target, G_FILE_TEST_EXISTS))
+			retval = APP_IN_USER_STARTUP_DIR;
+		g_free (user_target);
+	}
+
+	g_free (basename);
+	g_free (filename);
+
+	return retval;
+}
+
+static void
+update_startup_menu_item (ApplicationTile *this)
+{
+	TileAction *action = TILE (this)->actions [APPLICATION_TILE_ACTION_UPDATE_STARTUP];
+	ApplicationTilePrivate *priv = application_tile_get_instance_private (this);
+
+	if (!action)
+		return;
+
+	if (priv->startup_status == APP_IN_USER_STARTUP_DIR)
+		tile_action_set_menu_item_label (action, _("Remove from Startup Programs"));
+	else
+		tile_action_set_menu_item_label (action, _("Add to Startup Programs"));
+}
+
+static void
+header_size_allocate_cb (GtkWidget *widget, GtkAllocation *alloc, gpointer user_data)
+{
+	gtk_widget_set_size_request (widget, alloc->width, -1);
+}
+
+static void
+agent_notify_cb (GObject *g_obj, GParamSpec *pspec, gpointer user_data)
+{
+	update_user_list_menu_item (APPLICATION_TILE (user_data));
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/121.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/121.html new file mode 100644 index 00000000..f7d2b108 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/121.html @@ -0,0 +1,265 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
#ifndef __LIBSLAB_UTILS_H__
+#define __LIBSLAB_UTILS_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 <libmate-desktop/mate-desktop-item.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+MateDesktopItem *libslab_mate_desktop_item_new_from_unknown_id (const gchar *id);
+
+G_END_DECLS
+
+#endif /* __LIBSLAB_UTILS_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/122.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/122.html new file mode 100644 index 00000000..17290b21 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/122.html @@ -0,0 +1,433 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/*
+ * This file is part of the Main Menu.
+ *
+ * Copyright (c) 2007 Novell, Inc.
+ *
+ * The Main Menu 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.
+ *
+ * The Main Menu 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
+ * the Main Menu; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef __BOOKMARK_AGENT_H__
+#define __BOOKMARK_AGENT_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.
+
+#if !GLIB_CHECK_VERSION(2,66,0)
+#include <time.h>
+#endif
+
+G_BEGIN_DECLS
+
+#define BOOKMARK_AGENT_TYPE         (bookmark_agent_get_type ())
+#define BOOKMARK_AGENT(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), BOOKMARK_AGENT_TYPE, BookmarkAgent))
+#define BOOKMARK_AGENT_CLASS(c)     (G_TYPE_CHECK_CLASS_CAST ((c), BOOKMARK_AGENT_TYPE, BookmarkAgentClass))
+#define IS_BOOKMARK_AGENT(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), BOOKMARK_AGENT_TYPE))
+#define IS_BOOKMARK_AGENT_CLASS(c)  (G_TYPE_CHECK_CLASS_TYPE ((c), BOOKMARK_AGENT_TYPE))
+#define BOOKMARK_AGENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), BOOKMARK_AGENT_TYPE, BookmarkAgentClass))
+
+#define BOOKMARK_AGENT_STORE_STATUS_PROP "store-status"
+#define BOOKMARK_AGENT_ITEMS_PROP        "items"
+
+typedef struct {
+	gchar  *uri;
+	gchar  *title;
+	gchar  *mime_type;
+#if GLIB_CHECK_VERSION(2,66,0)
+	GDateTime  *mtime;
+#else
+	time_t  mtime;
+#endif
+	gchar  *icon;
+	gchar  *app_name;
+	gchar  *app_exec;
+} BookmarkItem;
+
+typedef enum {
+	BOOKMARK_STORE_DEFAULT_ONLY,
+	BOOKMARK_STORE_DEFAULT,
+	BOOKMARK_STORE_USER,
+	BOOKMARK_STORE_ABSENT
+} BookmarkStoreStatus;
+
+typedef enum {
+	BOOKMARK_STORE_USER_APPS   = 0,
+	BOOKMARK_STORE_USER_DOCS   = 1,
+	BOOKMARK_STORE_USER_DIRS   = 2,
+	BOOKMARK_STORE_RECENT_APPS = 3,
+	BOOKMARK_STORE_RECENT_DOCS = 4,
+	BOOKMARK_STORE_SYSTEM      = 5,
+	BOOKMARK_STORE_N_TYPES     = 6
+} BookmarkStoreType;
+
+typedef struct {
+	GObject g_object;
+} BookmarkAgent;
+
+typedef struct {
+	GObjectClass g_object_class;
+} BookmarkAgentClass;
+
+GType bookmark_agent_get_type (void);
+
+BookmarkAgent *bookmark_agent_get_instance  (BookmarkStoreType type);
+gboolean       bookmark_agent_has_item      (BookmarkAgent *this, const gchar *uri);
+void           bookmark_agent_add_item      (BookmarkAgent *this, const BookmarkItem *item);
+void           bookmark_agent_move_item     (BookmarkAgent *this, const gchar *uri, const gchar *uri_new);
+void           bookmark_agent_remove_item   (BookmarkAgent *this, const gchar *uri);
+void           bookmark_agent_reorder_items (BookmarkAgent *this, const gchar **uris);
+
+void	       bookmark_agent_update_from_bookmark_file (BookmarkAgent *this, GBookmarkFile *store);
+void	       bookmark_agent_purge_items (BookmarkAgent *this);
+
+void           bookmark_item_free           (BookmarkItem *item);
+
+G_END_DECLS
+
+#endif /* __BOOKMARK_AGENT_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/123.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/123.html new file mode 100644 index 00000000..373a7dd7 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/123.html @@ -0,0 +1,2737 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
   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
/*
+ * This file is part of the Main Menu.
+ *
+ * Copyright (c) 2007 Novell, Inc.
+ *
+ * The Main Menu 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.
+ *
+ * The Main Menu 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
+ * the Main Menu; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "bookmark-agent.h"
+
+#ifdef HAVE_CONFIG_H
+#	include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#else
+#	define PACKAGE "mate-main-menu"
+#endif
+
+#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 <stdlib.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 <glib/gstdio.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 "libslab-utils.h"
+
+#define USER_APPS_STORE_FILE_NAME "applications.xbel"
+#define USER_DOCS_STORE_FILE_NAME "documents.xbel"
+#define USER_DIRS_STORE_FILE_NAME "places.xbel"
+#define SYSTEM_STORE_FILE_NAME    "system-items.xbel"
+#define CALC_TEMPLATE_FILE_NAME   "empty.ots"
+#define WRITER_TEMPLATE_FILE_NAME "empty.ott"
+
+#define GTK_BOOKMARKS_FILE "bookmarks"
+
+#define TYPE_IS_RECENT(type) ((type) == BOOKMARK_STORE_RECENT_APPS || (type) == BOOKMARK_STORE_RECENT_DOCS)
+
+typedef struct {
+	BookmarkStoreType        type;
+
+	BookmarkItem           **items;
+	gint                     n_items;
+	BookmarkStoreStatus      status;
+
+	GBookmarkFile           *store;
+	gboolean                 needs_sync;
+
+	gchar                   *store_path;
+	gchar                   *user_store_path;
+	gboolean                 user_modifiable;
+	gboolean                 reorderable;
+	const gchar             *store_filename;
+
+	GFileMonitor            *store_monitor;
+	GFileMonitor            *user_store_monitor;
+
+	void                  (* update_path) (BookmarkAgent *);
+	void                  (* load_store)  (BookmarkAgent *);
+	void                  (* save_store)  (BookmarkAgent *);
+	void                  (* create_item) (BookmarkAgent *, const gchar *);
+
+	gchar                   *gtk_store_path;
+	GFileMonitor            *gtk_store_monitor;
+} BookmarkAgentPrivate;
+
+enum {
+	PROP_0,
+	PROP_ITEMS,
+	PROP_STATUS
+};
+
+static BookmarkAgent *instances [BOOKMARK_STORE_N_TYPES];
+
+static BookmarkAgentClass *bookmark_agent_parent_class = NULL;
+
+static void           bookmark_agent_base_init  (BookmarkAgentClass *);
+static void           bookmark_agent_class_init (BookmarkAgentClass *);
+static void           bookmark_agent_init       (BookmarkAgent      *);
+static BookmarkAgent *bookmark_agent_new        (BookmarkStoreType   );
+
+static void get_property (GObject *, guint, GValue *, GParamSpec *);
+static void set_property (GObject *, guint, const GValue *, GParamSpec *);
+static void finalize     (GObject *);
+
+static void update_agent (BookmarkAgent *);
+static void update_items (BookmarkAgent *);
+static void save_store   (BookmarkAgent *);
+static gint get_rank     (BookmarkAgent *, const gchar *);
+static void set_rank     (BookmarkAgent *, const gchar *, gint);
+
+static void load_xbel_store          (BookmarkAgent *);
+static void load_places_store        (BookmarkAgent *);
+static void update_user_spec_path    (BookmarkAgent *);
+static void save_xbel_store          (BookmarkAgent *);
+static void create_app_item          (BookmarkAgent *, const gchar *);
+static void create_doc_item          (BookmarkAgent *, const gchar *);
+static void create_dir_item          (BookmarkAgent *, const gchar *);
+
+static void store_monitor_cb (GFileMonitor *, GFile *, GFile *,
+                              GFileMonitorEvent, gpointer);
+static void weak_destroy_cb  (gpointer, GObject *);
+
+static gchar *find_package_data_file (const gchar *filename);
+
+static gint BookmarkAgent_private_offset;
+
+static inline gpointer bookmark_agent_get_instance_private (BookmarkAgent *this)
+{
+	return (G_STRUCT_MEMBER_P (this, BookmarkAgent_private_offset));
+}
+
+GType
+bookmark_agent_get_type ()
+{
+	static GType g_define_type_id = 0;
+
+	if (G_UNLIKELY (g_define_type_id == 0)) {
+		static const GTypeInfo info = {
+			sizeof (BookmarkAgentClass),
+			(GBaseInitFunc) bookmark_agent_base_init,
+			NULL,
+			(GClassInitFunc) bookmark_agent_class_init,
+			NULL, NULL,
+			sizeof (BookmarkAgent), 0,
+			(GInstanceInitFunc) bookmark_agent_init,
+			NULL
+		};
+
+		g_define_type_id = g_type_register_static (
+			G_TYPE_OBJECT, "BookmarkAgent", & info, 0);
+		G_ADD_PRIVATE (BookmarkAgent);
+	}
+
+	return g_define_type_id;
+}
+
+gboolean
+bookmark_agent_has_item (BookmarkAgent *this, const gchar *uri)
+{
+	BookmarkAgentPrivate *priv = bookmark_agent_get_instance_private (this);
+	return g_bookmark_file_has_item (priv->store, uri);
+}
+
+void
+bookmark_agent_add_item (BookmarkAgent *this, const BookmarkItem *item)
+{
+	BookmarkAgentPrivate *priv = bookmark_agent_get_instance_private (this);
+
+	if (! item)
+		return;
+
+	g_return_if_fail (priv->user_modifiable);
+	g_return_if_fail (item->uri);
+	g_return_if_fail (item->mime_type);
+
+	g_bookmark_file_set_mime_type (priv->store, item->uri, item->mime_type);
+
+	if (item->mtime)
+#if GLIB_CHECK_VERSION(2,66,0)
+		g_bookmark_file_set_modified_date_time (priv->store, item->uri, item->mtime);
+#else
+		g_bookmark_file_set_modified (priv->store, item->uri, item->mtime);
+#endif
+
+	if (item->title)
+		g_bookmark_file_set_title (priv->store, item->uri, item->title);
+
+	g_bookmark_file_add_application (priv->store, item->uri, item->app_name, item->app_exec);
+
+	set_rank (this, item->uri, g_bookmark_file_get_size (priv->store) - 1);
+
+	save_store (this);
+}
+
+void
+bookmark_agent_move_item (BookmarkAgent *this, const gchar *uri, const gchar *uri_new)
+{
+	BookmarkAgentPrivate *priv = bookmark_agent_get_instance_private (this);
+
+	GError *error = NULL;
+
+	if (! TYPE_IS_RECENT (priv->type))
+		return;
+
+	gtk_recent_manager_move_item (gtk_recent_manager_get_default (), uri, uri_new, &error);
+	if (error) {
+		g_warning ("Unable to update %s with renamed file, [%s] -> [%s]: %s",
+		           priv->store_path, uri, uri_new, error->message);
+		g_error_free (error);
+	}
+}
+
+void
+bookmark_agent_purge_items (BookmarkAgent *this)
+{
+	BookmarkAgentPrivate *priv = bookmark_agent_get_instance_private (this);
+
+	GError *error = NULL;
+
+	gchar **uris = NULL;
+	gsize   uris_len;
+	gint    i;
+	g_return_if_fail (priv->user_modifiable);
+
+	uris = g_bookmark_file_get_uris (priv->store, &uris_len);
+	if (TYPE_IS_RECENT (priv->type)) {
+		for (i = 0; i < uris_len; i++) {
+			gtk_recent_manager_remove_item (gtk_recent_manager_get_default (), uris [i], &error);
+			if (error) {
+				g_warning ("Unable to remove [%s] from %s: %s",
+				           priv->store_path, uris [i], error->message);
+				g_error_free (error);
+			}
+		}
+	} else {
+		for (i = 0; i < uris_len; i++) {
+			g_bookmark_file_remove_item (priv->store, uris [i], NULL);
+		}
+		save_store (this);
+	}
+	g_strfreev (uris);
+}
+
+void
+bookmark_agent_remove_item (BookmarkAgent *this, const gchar *uri)
+{
+        BookmarkAgentPrivate *priv = bookmark_agent_get_instance_private (this);
+        gint rank;
+
+        GError *error = NULL;
+
+        gchar **uris = NULL;
+        gint    rank_i;
+        gint    i;
+
+        g_return_if_fail (priv->user_modifiable);
+
+	if (! bookmark_agent_has_item (this, uri))
+		return;
+
+	if (TYPE_IS_RECENT (priv->type)) {
+		gtk_recent_manager_remove_item (gtk_recent_manager_get_default (), uri, &error);
+		if (error) {
+			g_warning ("Unable to remove [%s] from %s: %s", priv->store_path, uri, error->message);
+			g_error_free (error);
+		}
+	}
+	else {
+		rank = get_rank (this, uri);
+
+		g_bookmark_file_remove_item (priv->store, uri, NULL);
+
+		if (rank >= 0) {
+			uris = g_bookmark_file_get_uris (priv->store, NULL);
+
+			for (i =  0; uris && uris [i]; ++i) {
+				rank_i = get_rank (this, uris [i]);
+
+				if (rank_i > rank)
+					set_rank (this, uris [i], rank_i - 1);
+			}
+
+			g_strfreev (uris);
+		}
+
+		save_store (this);
+	}
+}
+
+void
+bookmark_agent_reorder_items (BookmarkAgent *this, const gchar **uris)
+{
+	BookmarkAgentPrivate *priv = bookmark_agent_get_instance_private (this);
+
+	gint i;
+
+	g_return_if_fail (priv->reorderable);
+
+	for (i = 0; uris && uris [i]; ++i)
+		set_rank (this, uris [i], i);
+
+	save_store (this);
+}
+
+#if !GLIB_CHECK_VERSION(2,66,0)
+static gint
+recent_item_mru_comp_func (gconstpointer a, gconstpointer b)
+{
+	return ((BookmarkItem *) b)->mtime - ((BookmarkItem *) a)->mtime;
+}
+#endif
+
+static GList *
+make_items_from_bookmark_file (BookmarkAgent *this, GBookmarkFile *store)
+{
+	BookmarkAgentPrivate *priv = bookmark_agent_get_instance_private (this);<--- Variable 'priv' can be declared as pointer to const
+	gchar **uris;
+	gint i;
+	GList *items_ordered;
+
+	if (!store)
+		return NULL;
+
+	uris = g_bookmark_file_get_uris (store, NULL);
+	items_ordered = NULL;
+
+	for (i = 0; uris && uris [i]; ++i) {
+		gboolean include;
+
+		if (priv->type == BOOKMARK_STORE_RECENT_APPS)
+			include = g_bookmark_file_has_group (store, uris [i], "recently-used-apps", NULL);
+		else
+			include = ! g_bookmark_file_get_is_private (store, uris [i], NULL);
+
+		if (include) {
+			BookmarkItem *item;
+
+			item = g_new0 (BookmarkItem, 1);
+
+			item->uri       = g_strdup (uris [i]);
+			item->mime_type = g_bookmark_file_get_mime_type (store, uris [i], NULL);
+#if GLIB_CHECK_VERSION(2,66,0)
+			item->mtime     = g_bookmark_file_get_modified_date_time  (store, uris [i], NULL);
+#else
+			item->mtime     = g_bookmark_file_get_modified (store, uris [i], NULL);
+#endif
+
+			items_ordered = g_list_prepend (items_ordered, item);
+		}
+	}
+
+#if GLIB_CHECK_VERSION(2,66,0)
+	items_ordered = g_list_sort (items_ordered, g_date_time_compare);
+#else
+	items_ordered = g_list_sort (items_ordered, recent_item_mru_comp_func);
+#endif
+	g_strfreev (uris);
+
+	return items_ordered;
+}
+
+void
+bookmark_agent_update_from_bookmark_file (BookmarkAgent *this, GBookmarkFile *store)
+{
+	BookmarkAgentPrivate *priv;
+	GList *items_ordered;
+	GList  *node;
+
+	g_return_if_fail (IS_BOOKMARK_AGENT (this));
+
+	priv = bookmark_agent_get_instance_private (this);
+
+	items_ordered = make_items_from_bookmark_file (this, store);
+
+	g_bookmark_file_free (priv->store);
+	priv->store = g_bookmark_file_new ();
+
+	for (node = items_ordered; node; node = node->next) {
+		BookmarkItem *item;
+
+		item = (BookmarkItem *) node->data;
+
+		g_bookmark_file_set_mime_type (priv->store, item->uri, item->mime_type);
+		#if GLIB_CHECK_VERSION(2,66,0)
+		g_bookmark_file_set_modified_date_time  (priv->store, item->uri, item->mtime);
+		#else
+		g_bookmark_file_set_modified (priv->store, item->uri, item->mtime);
+		#endif
+
+		bookmark_item_free (item);
+	}
+
+	g_list_free (items_ordered);
+
+	update_items (this);
+}
+
+void
+bookmark_item_free (BookmarkItem *item)
+{
+	if (! item)
+		return;
+
+	g_free (item->uri);
+	g_free (item->title);
+	g_free (item->mime_type);
+	g_free (item->icon);
+	g_free (item->app_name);
+	g_free (item->app_exec);
+	g_free (item);
+}
+
+static void
+bookmark_agent_base_init (BookmarkAgentClass *this_class)
+{
+	gint i;
+
+	for (i = 0; i < BOOKMARK_STORE_N_TYPES; ++i)
+		instances [i] = NULL;
+}
+
+static void
+bookmark_agent_class_init (BookmarkAgentClass *this_class)
+{
+	GObjectClass *g_obj_class = G_OBJECT_CLASS (this_class);
+
+	GParamSpec *items_pspec;
+	GParamSpec *status_pspec;
+
+	if (BookmarkAgent_private_offset != 0)
+		g_type_class_adjust_private_offset (this_class, &BookmarkAgent_private_offset);
+
+	g_obj_class->get_property = get_property;
+	g_obj_class->set_property = set_property;
+	g_obj_class->finalize     = finalize;
+
+	items_pspec = g_param_spec_pointer (
+		BOOKMARK_AGENT_ITEMS_PROP, BOOKMARK_AGENT_ITEMS_PROP,
+		"the null-terminated list which contains the bookmark items in this store",
+		G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB);
+
+	status_pspec = g_param_spec_int (
+		BOOKMARK_AGENT_STORE_STATUS_PROP, BOOKMARK_AGENT_STORE_STATUS_PROP, "the status of the store",
+		BOOKMARK_STORE_DEFAULT_ONLY, BOOKMARK_STORE_USER, BOOKMARK_STORE_DEFAULT,
+		G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB);
+
+	g_object_class_install_property (g_obj_class, PROP_ITEMS,  items_pspec);
+	g_object_class_install_property (g_obj_class, PROP_STATUS, status_pspec);
+
+	bookmark_agent_parent_class = g_type_class_peek_parent (this_class);
+}
+
+static void
+bookmark_agent_init (BookmarkAgent *this)
+{
+	BookmarkAgentPrivate *priv = bookmark_agent_get_instance_private (this);
+
+	priv->type                = -1;
+
+ 	priv->items               = NULL;
+ 	priv->n_items             = 0;
+	priv->status              = BOOKMARK_STORE_ABSENT;
+
+	priv->store               = NULL;
+	priv->needs_sync          = FALSE;
+
+	priv->store_path          = NULL;
+	priv->user_store_path     = NULL;
+	priv->user_modifiable     = FALSE;
+	priv->reorderable         = FALSE;
+	priv->store_filename      = NULL;
+
+	priv->store_monitor       = NULL;
+	priv->user_store_monitor  = NULL;
+
+	priv->update_path         = NULL;
+	priv->load_store          = NULL;
+	priv->save_store          = NULL;
+	priv->create_item         = NULL;
+
+	priv->gtk_store_path      = NULL;
+	priv->gtk_store_monitor   = NULL;
+}
+
+static BookmarkAgent *
+bookmark_agent_new (BookmarkStoreType type)
+{
+	BookmarkAgent        *this;
+	BookmarkAgentPrivate *priv;
+	GFile *gtk_store_file;
+
+	this = g_object_new (BOOKMARK_AGENT_TYPE, NULL);
+	priv = bookmark_agent_get_instance_private (this);
+
+	priv->type  = type;
+	priv->store = g_bookmark_file_new ();
+
+	switch (type) {
+		case BOOKMARK_STORE_USER_APPS:
+			priv->store_filename = USER_APPS_STORE_FILE_NAME;
+			priv->create_item    = create_app_item;
+
+			break;
+
+		case BOOKMARK_STORE_USER_DOCS:
+			priv->store_filename = USER_DOCS_STORE_FILE_NAME;
+			priv->create_item    = create_doc_item;
+
+			break;
+
+		case BOOKMARK_STORE_USER_DIRS:
+			priv->store_filename = USER_DIRS_STORE_FILE_NAME;
+			priv->create_item    = create_dir_item;
+
+			priv->user_modifiable = TRUE;
+			priv->reorderable     = FALSE;
+
+			priv->load_store = load_places_store;
+
+			priv->gtk_store_path = g_build_filename (g_get_user_config_dir (),
+                                                     "gtk-3.0", GTK_BOOKMARKS_FILE, NULL);
+			gtk_store_file = g_file_new_for_path (priv->gtk_store_path);
+			priv->gtk_store_monitor = g_file_monitor_file (gtk_store_file,
+								       0, NULL, NULL);
+			if (priv->gtk_store_monitor) {
+				g_signal_connect (priv->gtk_store_monitor, "changed",
+						  G_CALLBACK (store_monitor_cb), this);
+			}
+
+			g_object_unref (gtk_store_file);
+
+			break;
+
+		case BOOKMARK_STORE_RECENT_APPS:
+		case BOOKMARK_STORE_RECENT_DOCS:
+			priv->user_modifiable = TRUE;
+			priv->reorderable     = FALSE;
+
+			priv->store_path = g_build_filename (g_get_user_data_dir (), "recently-used.xbel", NULL);
+
+			break;
+
+		case BOOKMARK_STORE_SYSTEM:
+			priv->store_filename = SYSTEM_STORE_FILE_NAME;
+			priv->create_item    = create_app_item;
+
+			break;
+
+		default:
+			break;
+	}
+
+	if (
+		type == BOOKMARK_STORE_USER_APPS || type == BOOKMARK_STORE_USER_DOCS ||
+		type == BOOKMARK_STORE_USER_DIRS || type == BOOKMARK_STORE_SYSTEM)
+	{
+		priv->user_modifiable = TRUE;
+
+		priv->user_store_path = g_build_filename (
+			g_get_user_data_dir (), PACKAGE, priv->store_filename, NULL);
+
+		priv->update_path = update_user_spec_path;
+	}
+
+	if (type == BOOKMARK_STORE_USER_APPS || type == BOOKMARK_STORE_USER_DOCS || type == BOOKMARK_STORE_SYSTEM) {
+		priv->reorderable = TRUE;
+		priv->load_store  = load_xbel_store;
+		priv->save_store  = save_xbel_store;
+	}
+
+	update_agent (this);
+
+	return this;
+}
+
+BookmarkAgent *
+bookmark_agent_get_instance (BookmarkStoreType type)
+{
+	g_return_val_if_fail (0 <= type, NULL);
+	g_return_val_if_fail (type < BOOKMARK_STORE_N_TYPES, NULL);
+
+	if (! instances [type]) {
+		instances [type] = bookmark_agent_new (type);
+		g_object_weak_ref (G_OBJECT (instances [type]), weak_destroy_cb, GINT_TO_POINTER (type));
+	}
+	else
+		g_object_ref (G_OBJECT (instances [type]));
+
+	return instances [type];
+}
+
+static void
+get_property (GObject *g_obj, guint prop_id, GValue *value, GParamSpec *pspec)
+{
+	BookmarkAgent        *this = BOOKMARK_AGENT (g_obj);
+	BookmarkAgentPrivate *priv = bookmark_agent_get_instance_private (this);
+
+	switch (prop_id) {
+		case PROP_ITEMS:
+			g_value_set_pointer (value, priv->items);
+			break;
+
+		case PROP_STATUS:
+			g_value_set_int (value, priv->status);
+			break;
+	}
+}
+
+static void
+set_property (GObject *g_obj, guint prop_id, const GValue *value, GParamSpec *pspec)
+{
+	/* no writeable properties */
+}
+
+static void
+finalize (GObject *g_obj)
+{
+	BookmarkAgent *this = BOOKMARK_AGENT (g_obj);
+	BookmarkAgentPrivate *priv = bookmark_agent_get_instance_private (this);
+
+	gint i;
+
+	for (i = 0; priv->items && priv->items [i]; ++i)
+		bookmark_item_free (priv->items [i]);
+
+	g_free (priv->items);
+	g_free (priv->store_path);
+	g_free (priv->user_store_path);
+	g_free (priv->gtk_store_path);
+
+	if (priv->store_monitor) {
+		g_signal_handlers_disconnect_by_func (priv->store_monitor, store_monitor_cb, this);
+		g_file_monitor_cancel (priv->store_monitor);
+		g_object_unref (priv->store_monitor);
+	}
+
+	if (priv->user_store_monitor) {
+		g_signal_handlers_disconnect_by_func (priv->user_store_monitor, store_monitor_cb, this);
+		g_file_monitor_cancel (priv->user_store_monitor);
+		g_object_unref (priv->user_store_monitor);
+	}
+
+	if (priv->gtk_store_monitor) {
+		g_signal_handlers_disconnect_by_func (priv->gtk_store_monitor, store_monitor_cb, this);
+		g_file_monitor_cancel (priv->gtk_store_monitor);
+		g_object_unref (priv->gtk_store_monitor);
+	}
+
+	g_bookmark_file_free (priv->store);
+
+	G_OBJECT_CLASS (bookmark_agent_parent_class)->finalize (g_obj);
+}
+
+static void
+update_agent (BookmarkAgent *this)
+{
+	BookmarkAgentPrivate *priv = bookmark_agent_get_instance_private (this);
+
+	if (priv->update_path)
+		priv->update_path (this);
+
+	if (priv->load_store)
+		priv->load_store (this);
+
+	update_items (this);
+}
+
+static void
+update_items (BookmarkAgent *this)
+{
+	BookmarkAgentPrivate *priv = bookmark_agent_get_instance_private (this);
+
+	gchar    **uris            = NULL;
+	gchar    **uris_ordered    = NULL;
+	gsize      n_uris          = 0;
+	gint       rank            = -1;<--- Variable 'rank' is assigned a value that is never used.
+	gint       rank_corr       = -1;<--- Variable 'rank_corr' is assigned a value that is never used.
+	gboolean   needs_update    = FALSE;
+	gboolean   store_corrupted = FALSE;
+	gchar     *new_title, *old_title;<--- Variable 'old_title' can be declared as pointer to const
+
+	gint i;
+
+	uris = g_bookmark_file_get_uris (priv->store, & n_uris);
+	uris_ordered = g_new0 (gchar *, n_uris + 1);
+	uris_ordered [n_uris] = NULL;
+
+	for (i = 0; uris && uris [i]; ++i) {
+		rank = get_rank (this, uris [i]);
+
+		if (rank < 0 || rank >= n_uris)
+			rank = i;
+
+		if (uris_ordered [rank]) {
+			store_corrupted = TRUE;
+			rank_corr = rank;
+
+			for (rank = 0; rank < n_uris; ++rank)
+				if (! uris_ordered [rank])
+					break;
+
+			g_warning (
+				"store corruption [%s] - multiple uris with same rank (%d): [%s] [%s], moving latter to %d",
+				priv->store_path, rank_corr, uris_ordered [rank_corr], uris [i], rank);
+		}
+
+		set_rank (this, uris [i], rank);
+
+		uris_ordered [rank] = uris [i];
+	}
+
+	if (priv->n_items != n_uris)
+		needs_update = TRUE;
+
+	for (i = 0; ! needs_update && uris_ordered && uris_ordered [i]; ++i) {
+		if (priv->type == BOOKMARK_STORE_USER_DIRS) {
+			new_title = g_bookmark_file_get_title (priv->store, uris_ordered [i], NULL);
+			old_title = priv->items [i]->title;
+			if (!new_title && !old_title) {
+				if (strcmp (priv->items [i]->uri, uris_ordered [i]))
+					needs_update = TRUE;
+			}
+			else if ((new_title && !old_title) || (!new_title && old_title))
+				needs_update = TRUE;
+			else if (strcmp (old_title, new_title))
+				needs_update = TRUE;
+			g_free (new_title);
+		}
+		else if (strcmp (priv->items [i]->uri, uris_ordered [i]))
+			needs_update = TRUE;
+	}
+
+	if (needs_update) {
+		for (i = 0; priv->items && priv->items [i]; ++i)
+			bookmark_item_free (priv->items [i]);
+
+		g_free (priv->items);
+
+		priv->n_items = n_uris;
+		priv->items = g_new0 (BookmarkItem *, priv->n_items + 1);
+
+		for (i = 0; uris_ordered && uris_ordered [i]; ++i) {
+			priv->items [i]            = g_new0 (BookmarkItem, 1);
+			priv->items [i]->uri       = g_strdup (uris_ordered [i]);
+			priv->items [i]->title     = g_bookmark_file_get_title     (priv->store, uris_ordered [i], NULL);
+			priv->items [i]->mime_type = g_bookmark_file_get_mime_type (priv->store, uris_ordered [i], NULL);
+			#if GLIB_CHECK_VERSION(2,66,0)
+			priv->items [i]->mtime     = g_bookmark_file_get_modified_date_time (priv->store, uris_ordered [i], NULL);
+			#else
+			priv->items [i]->mtime     = g_bookmark_file_get_modified (priv->store, uris_ordered [i], NULL);
+			#endif
+			priv->items [i]->app_name  = NULL;
+			priv->items [i]->app_exec  = NULL;
+
+			g_bookmark_file_get_icon (priv->store, uris_ordered [i], & priv->items [i]->icon, NULL, NULL);
+		}
+
+		/* Since the bookmark store for recently-used items is updated by the caller of BookmarkAgent,
+		 * we don't emit notifications in that case.  The caller will know when to update itself.
+		 */
+		if (!TYPE_IS_RECENT (priv->type))
+			g_object_notify (G_OBJECT (this), BOOKMARK_AGENT_ITEMS_PROP);
+	}
+
+	if (store_corrupted)
+		save_store (this);
+
+	g_strfreev (uris);
+	g_free (uris_ordered);
+}
+
+static void
+save_store (BookmarkAgent *this)
+{
+	BookmarkAgentPrivate *priv = bookmark_agent_get_instance_private (this);
+
+	gchar *dir;
+
+	g_return_if_fail (priv->user_modifiable);
+
+	priv->needs_sync = TRUE;
+	priv->update_path (this);
+
+	dir = g_path_get_dirname (priv->store_path);
+	g_mkdir_with_parents (dir, 0700);
+	g_free (dir);
+
+	priv->save_store (this);
+	update_items (this);
+}
+
+static gint
+get_rank (BookmarkAgent *this, const gchar *uri)
+{
+	BookmarkAgentPrivate *priv = bookmark_agent_get_instance_private (this);
+
+	gchar **groups;
+	gint    rank;
+
+	gint i;
+
+	if (! priv->reorderable)
+		return -1;
+
+	groups = g_bookmark_file_get_groups (priv->store, uri, NULL, NULL);
+	rank   = -1;
+
+	for (i = 0; groups && groups [i]; ++i) {
+		if (g_str_has_prefix (groups [i], "rank-")) {
+			if (rank >= 0)
+				g_warning (
+					"store corruption - multiple ranks for same uri: [%s] [%s]",
+					priv->store_path, uri);
+
+			rank = atoi (& groups [i] [5]);
+		}
+	}
+
+	g_strfreev (groups);
+
+	return rank;
+}
+
+static void
+set_rank (BookmarkAgent *this, const gchar *uri, gint rank)
+{
+	BookmarkAgentPrivate *priv = bookmark_agent_get_instance_private (this);
+
+	gchar **groups;
+	gchar  *group;
+
+	gint i;
+
+	if (! (priv->reorderable && bookmark_agent_has_item (this, uri)))
+		return;
+
+	groups = g_bookmark_file_get_groups (priv->store, uri, NULL, NULL);
+
+	for (i = 0; groups && groups [i]; ++i)
+		if (g_str_has_prefix (groups [i], "rank-"))
+			g_bookmark_file_remove_group (priv->store, uri, groups [i], NULL);
+
+	g_strfreev (groups);
+
+	group = g_strdup_printf ("rank-%d", rank);
+	g_bookmark_file_add_group (priv->store, uri, group);
+	g_free (group);
+}
+
+static void
+load_xbel_store (BookmarkAgent *this)
+{
+	BookmarkAgentPrivate *priv = bookmark_agent_get_instance_private (this);
+
+	gchar **uris = NULL;
+
+	GError *error = NULL;
+
+	gint i;
+	gboolean success;
+
+	if (!priv->store_path)
+		success = FALSE;
+	else {
+		success = g_bookmark_file_load_from_file (priv->store, priv->store_path, & error);
+	}
+
+	if (!success) {
+		g_bookmark_file_free (priv->store);
+		priv->store = g_bookmark_file_new ();
+
+		if (error) {
+			g_debug ("Couldn't load bookmark file [%s]: %s", priv->store_path, error->message);
+			g_error_free (error);
+		} else {
+			g_debug ("Couldn't load bookmark file [NULL]");
+		}
+		return;
+	}
+
+	uris = g_bookmark_file_get_uris (priv->store, NULL);
+
+	for (i = 0; uris && uris [i]; ++i)
+		priv->create_item (this, uris [i]);
+
+	g_strfreev (uris);
+}
+
+static void
+load_places_store (BookmarkAgent *this)
+{
+	BookmarkAgentPrivate *priv = bookmark_agent_get_instance_private (this);
+
+	gchar **uris;
+	gchar **groups;
+	gchar **bookmarks = NULL;
+
+	gchar  *buf, *label, *uri;
+
+	gint i, j, bookmark_len;
+
+	load_xbel_store (this);
+
+	uris = g_bookmark_file_get_uris (priv->store, NULL);
+
+	for (i = 0; uris && uris [i]; ++i) {
+		groups = g_bookmark_file_get_groups (priv->store, uris [i], NULL, NULL);
+
+		for (j = 0; groups && groups [j]; ++j) {
+			if (! strcmp (groups [j], "gtk-bookmarks")) {
+				g_bookmark_file_remove_item (priv->store, uris [i], NULL);
+
+				break;
+			}
+		}
+
+		g_strfreev (groups);
+	}
+
+	g_strfreev (uris);
+
+	g_file_get_contents (priv->gtk_store_path, & buf, NULL, NULL);
+
+	if (buf) {
+		bookmarks = g_strsplit (buf, "\n", -1);
+		g_free (buf);
+	}
+
+	for (i = 0; bookmarks && bookmarks [i]; ++i) {
+		bookmark_len = strlen (bookmarks [i]);
+		if (bookmark_len > 0) {
+			label = strstr (bookmarks[i], " ");
+			if (label != NULL)
+				uri = g_strndup (bookmarks [i], bookmark_len - strlen (label));
+			else
+				uri = bookmarks [i];
+			g_bookmark_file_add_group (priv->store, uri, "gtk-bookmarks");
+			priv->create_item (this, uri);
+			if (label != NULL) {
+				label++;
+				if (strlen (label) > 0)
+					g_bookmark_file_set_title (priv->store, uri, label);
+				g_free (uri);
+			}
+		}
+	}
+
+	g_strfreev (bookmarks);
+}
+
+static gchar *
+find_package_data_file (const gchar *filename)
+{
+	const gchar * const *dirs = NULL;
+	gchar               *path = NULL;
+	gint                 i;
+
+	dirs = g_get_system_data_dirs ();
+
+	for (i = 0; ! path && dirs && dirs [i]; ++i) {
+		path = g_build_filename (dirs [i], PACKAGE, filename, NULL);
+
+		if (! g_file_test (path, G_FILE_TEST_EXISTS)) {
+			g_free (path);
+			path = NULL;
+		}
+	}
+
+	return path;
+}
+
+static void
+update_user_spec_path (BookmarkAgent *this)
+{
+	BookmarkAgentPrivate *priv = bookmark_agent_get_instance_private (this);
+
+	gboolean  use_user_path;
+	gchar    *path = NULL;
+
+	BookmarkStoreStatus status;
+
+	use_user_path = priv->user_modifiable &&
+		(priv->needs_sync || g_file_test (priv->user_store_path, G_FILE_TEST_EXISTS));
+
+	if (use_user_path)
+		path = g_strdup (priv->user_store_path);
+	else
+		path = find_package_data_file (priv->store_filename);
+
+	if (use_user_path)
+		status = BOOKMARK_STORE_USER;
+	else if (path && priv->user_modifiable)
+		status = BOOKMARK_STORE_DEFAULT;
+	else if (path)
+		status = BOOKMARK_STORE_DEFAULT_ONLY;
+	else
+		status = BOOKMARK_STORE_ABSENT;
+
+	if (priv->status != status) {
+		priv->status = status;
+		g_object_notify (G_OBJECT (this), BOOKMARK_AGENT_STORE_STATUS_PROP);
+
+		if (priv->user_store_monitor) {
+			g_file_monitor_cancel (priv->user_store_monitor);
+			g_object_unref (priv->user_store_monitor);
+			priv->user_store_monitor = NULL;
+		}
+
+		if (priv->status == BOOKMARK_STORE_DEFAULT) {
+			GFile *user_store_file;
+
+			user_store_file = g_file_new_for_path (priv->user_store_path);
+			priv->user_store_monitor = g_file_monitor_file (user_store_file,
+									0, NULL, NULL);
+			if (priv->user_store_monitor) {
+				g_signal_connect (priv->user_store_monitor, "changed",
+						  G_CALLBACK (store_monitor_cb), this);
+			}
+
+			g_object_unref (user_store_file);
+		}
+	}
+
+	if (g_strcmp0 (priv->store_path, path)) {
+		g_free (priv->store_path);
+		priv->store_path = path;
+
+		if (priv->store_monitor) {
+			g_file_monitor_cancel (priv->store_monitor);
+			g_object_unref (priv->store_monitor);
+		}
+
+		if (priv->store_path) {
+			GFile *store_file;
+
+			store_file = g_file_new_for_path (priv->store_path);
+			priv->store_monitor = g_file_monitor_file (store_file,
+								   0, NULL, NULL);
+			if (priv->store_monitor) {
+				g_signal_connect (priv->store_monitor, "changed",
+						  G_CALLBACK (store_monitor_cb), this);
+			}
+
+			g_object_unref (store_file);
+		}
+	}
+	else
+		g_free (path);
+}
+
+static void
+save_xbel_store (BookmarkAgent *this)
+{
+	BookmarkAgentPrivate *priv = bookmark_agent_get_instance_private (this);
+
+	GError *error = NULL;
+
+	if (g_bookmark_file_to_file (priv->store, priv->store_path, &error))
+		return;
+
+	if (error) {
+		g_warning ("Couldn't save bookmark file [%s]: %s", priv->store_path, error->message);
+		g_error_free (error);
+	} else {
+		g_warning ("Couldn't save bookmark file [%s]", priv->store_path);
+	}
+}
+
+static void
+create_app_item (BookmarkAgent *this, const gchar *uri)
+{
+	BookmarkAgentPrivate *priv = bookmark_agent_get_instance_private (this);
+
+	MateDesktopItem *ditem;
+	gchar *uri_new = NULL;
+
+	ditem = libslab_mate_desktop_item_new_from_unknown_id (uri);
+
+	if (ditem) {
+		uri_new = g_strdup (mate_desktop_item_get_location (ditem));
+		mate_desktop_item_unref (ditem);
+	}
+
+	if (! uri_new)
+		return;
+
+	if (g_strcmp0 (uri, uri_new))
+		g_bookmark_file_move_item (priv->store, uri, uri_new, NULL);
+
+	g_free (uri_new);
+}
+
+static void
+create_doc_item (BookmarkAgent *this, const gchar *uri)
+{
+	BookmarkAgentPrivate *priv = bookmark_agent_get_instance_private (this);
+
+	gchar *uri_new = NULL;
+
+	if ((strcmp (uri, "BLANK_SPREADSHEET") == 0) || (strcmp (uri, "BLANK_DOCUMENT") == 0)) {
+		gchar *template = NULL;
+		gchar *file;
+
+		gchar *dir = g_strdup (g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS));
+		if (!dir)
+			dir = g_build_filename (g_get_home_dir (), "Documents", NULL);
+
+		if (strcmp (uri, "BLANK_SPREADSHEET") == 0) {
+			g_bookmark_file_set_title (priv->store, uri, "BLANK_SPREADSHEET");
+			file = g_strconcat (_("New Spreadsheet"), ".ots", NULL);
+			template = find_package_data_file (CALC_TEMPLATE_FILE_NAME);
+		} else {
+			g_bookmark_file_set_title (priv->store, uri, "BLANK_DOCUMENT");
+			file = g_strconcat (_("New Document"), ".ott", NULL);
+			template = find_package_data_file (WRITER_TEMPLATE_FILE_NAME);
+		}
+
+		gchar *path = g_build_filename (dir, file, NULL);
+		if (!g_file_test (path, G_FILE_TEST_EXISTS)) {
+			g_mkdir_with_parents (dir, 0700);
+
+			if (template != NULL) {
+				gchar *contents;
+				gsize length;
+
+				if (g_file_get_contents (template, &contents, &length, NULL))
+					g_file_set_contents (path, contents, length, NULL);
+
+				g_free (contents);
+			} else {
+				fclose (g_fopen (path, "w"));
+			}
+		}
+
+		uri_new = g_filename_to_uri (path, NULL, NULL);
+
+		g_free (dir);
+		g_free (file);
+		g_free (path);
+		g_free (template);
+	}
+
+	if (!uri_new)
+		return;
+
+	if (g_strcmp0 (uri, uri_new))
+		g_bookmark_file_move_item (priv->store, uri, uri_new, NULL);
+
+	g_free (uri_new);
+}
+
+static void
+create_dir_item (BookmarkAgent *this, const gchar *uri)
+{
+	BookmarkAgentPrivate *priv = bookmark_agent_get_instance_private (this);
+
+	gchar *uri_new = NULL;
+	gchar *path = NULL;
+	gchar *name = NULL;
+	gchar *icon = NULL;
+
+	gchar *search_string = NULL;
+
+	gboolean gotta_free_name = FALSE;
+
+	if (strcmp (uri, "HOME") == 0) {
+		uri_new = g_filename_to_uri (g_get_home_dir (), NULL, NULL);
+		name = g_strdup (C_("Home folder", "Home"));
+		gotta_free_name = TRUE;
+		icon = "user-home";
+	} else if (strcmp (uri, "DOCUMENTS") == 0) {
+		path = g_strdup (g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS));
+		if (!path)
+			path = g_build_filename (g_get_home_dir (), "Documents", NULL);
+		name = _("Documents");
+		uri_new = g_filename_to_uri (path, NULL, NULL);
+	} else if (strcmp (uri, "DESKTOP") == 0) {
+		path = g_strdup (g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP));
+		if (!path)
+			path = g_build_filename (g_get_home_dir (), "Desktop", NULL);
+		name = _("Desktop");
+		uri_new = g_filename_to_uri (path, NULL, NULL);
+		icon = "user-desktop";
+	} else if (strcmp (uri, "file:///") == 0) {
+		icon = "drive-harddisk";
+		name = _("File System");
+	} else if (strcmp (uri, "network:") == 0) {
+		icon = "network-workgroup";
+		name = _("Network Servers");
+	} else if (g_str_has_prefix (uri, "x-caja-search")) {
+		icon = "system-search";
+
+		path = g_build_filename (g_get_user_data_dir (), "caja", "searches", & uri [21], NULL);
+
+		if (g_file_test (path, G_FILE_TEST_EXISTS)) {
+			gchar *buf = NULL;
+			g_file_get_contents (path, &buf, NULL, NULL);
+
+			gchar *tag_open_ptr  = NULL;
+			gchar *tag_close_ptr = NULL;
+
+			if (buf) {
+				tag_open_ptr  = strstr (buf, "<text>");
+				tag_close_ptr = strstr (buf, "</text>");
+			}
+
+			if (tag_open_ptr && tag_close_ptr) {
+				tag_close_ptr [0] = '\0';<--- tag_close_ptr[0] is assigned
+				tag_close_ptr [0] = 'a';<--- tag_close_ptr[0] is overwritten
+				search_string = g_strdup_printf ("\"%s\"", &tag_open_ptr[6]);
+			}
+
+			g_free (buf);
+		}
+
+		if (search_string) {
+			name = search_string;
+			gotta_free_name = TRUE;
+		} else {
+			name = _("Search");
+		}
+	}
+
+	if (icon)
+		g_bookmark_file_set_icon (priv->store, uri, icon, "image/png");
+
+	if (name)
+		g_bookmark_file_set_title (priv->store, uri, name);
+
+	if (uri_new && g_strcmp0 (uri, uri_new))
+		g_bookmark_file_move_item (priv->store, uri, uri_new, NULL);
+
+	if (gotta_free_name) {
+		g_free (name);
+	}
+
+	g_free (path);
+	g_free (uri_new);
+}
+
+static void
+store_monitor_cb (GFileMonitor *mon, GFile *f1, GFile *f2,
+                  GFileMonitorEvent event_type, gpointer user_data)
+{
+	update_agent (BOOKMARK_AGENT (user_data));
+}
+
+static void
+weak_destroy_cb (gpointer data, GObject *g_obj)
+{
+	instances [GPOINTER_TO_INT (data)] = NULL;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/124.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/124.html new file mode 100644 index 00000000..0ea63b3c --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/124.html @@ -0,0 +1,635 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * This file is part of the Control Center.
+ *
+ * Copyright (c) 2006 Novell, Inc.
+ *
+ * The Control Center 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.
+ *
+ * The Control Center 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
+ * the Control Center; 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 <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 <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "slab.h"
+
+void handle_static_action_clicked(Tile* tile, TileEvent* event, gpointer data);
+static GSList* get_actions_list(void);
+
+#define CONTROL_CENTER_SCHEMA "org.mate.control-center"
+#define CONTROL_CENTER_ACTIONS_LIST_KEY "cc-actions-list"
+#define CONTROL_CENTER_ACTIONS_SEPARATOR ";"
+#define EXIT_SHELL_ON_STATIC_ACTION "cc-exit-shell-on-static-action"
+
+static GSList* get_actions_list(void)
+{
+	GSettings *settings;
+	GSList* l;
+	GSList* key_list = NULL;
+	GSList* actions_list = NULL;
+	AppAction* action;
+	gchar **array;
+	gint i;
+
+	settings = g_settings_new (CONTROL_CENTER_SCHEMA);
+	array = g_settings_get_strv (settings, CONTROL_CENTER_ACTIONS_LIST_KEY);
+	if (array != NULL) {
+		for (i = 0; array[i]; i++) {
+			key_list = g_slist_append (key_list, g_strdup (array[i]));
+		}
+	}
+	g_strfreev (array);
+	g_object_unref (settings);
+
+	if (!key_list)
+	{
+		g_warning(_("%s key is empty\n"), CONTROL_CENTER_ACTIONS_LIST_KEY);
+		return NULL;
+	}
+
+	for (l = key_list; l != NULL; l = l->next)
+	{
+		gchar* entry = (gchar*) l->data;
+		gchar** temp;
+
+		action = g_new(AppAction, 1);
+		temp = g_strsplit(entry, CONTROL_CENTER_ACTIONS_SEPARATOR, 2);
+		action->name = g_strdup(temp[0]);
+
+		if ((action->item = load_desktop_item_from_unknown(temp[1])) == NULL)
+		{
+			g_free (action->name);
+			g_free (action);
+			g_warning("get_actions_list() - PROBLEM - Can't load %s\n", temp[1]);
+		}
+		else
+		{
+			actions_list = g_slist_prepend(actions_list, action);
+		}
+
+		g_strfreev(temp);
+		g_free(entry);
+	}
+
+	g_slist_free(key_list);
+
+	return g_slist_reverse(actions_list);
+}
+
+void handle_static_action_clicked(Tile* tile, TileEvent* event, gpointer data)<--- Parameter 'event' can be declared as pointer to const
+{
+	AppShellData* app_data = (AppShellData*) data;
+	MateDesktopItem* item = (MateDesktopItem*) g_object_get_data(G_OBJECT(tile), APP_ACTION_KEY);
+	GSettings *settings;
+	GApplication *app;
+
+	if (event->type == TILE_EVENT_ACTIVATED_DOUBLE_CLICK)
+	{
+		return;
+	}
+
+	open_desktop_item_exec(item);
+
+	settings = g_settings_new (CONTROL_CENTER_SCHEMA);
+
+	if (g_settings_get_boolean(settings, EXIT_SHELL_ON_STATIC_ACTION))
+	{
+		if (app_data->exit_on_close)
+		{
+			app=g_application_get_default();
+			g_application_quit(app);
+		}
+		else
+		{
+			hide_shell(app_data);
+		}
+	}
+
+	g_object_unref(settings);
+}
+
+static void
+activate (GtkApplication *app)
+{
+	GList *list;
+	GSList* actions;
+	gboolean hidden = FALSE;
+
+	list = gtk_application_get_windows (app);
+
+	AppShellData* app_data = appshelldata_new("matecc.menu", GTK_ICON_SIZE_DND, FALSE, TRUE, 0);
+
+	generate_categories(app_data);
+
+	actions = get_actions_list();
+	layout_shell(app_data, _("Filter"), _("Groups"), _("Common Tasks"), actions, handle_static_action_clicked);<--- You might need to cast the function pointer here
+
+	if (list)
+	{
+		gtk_window_present (GTK_WINDOW (list->data));
+	}
+	else
+	{
+		create_main_window(app_data, "MyControlCenter", _("Control Center"), "preferences-desktop", 975, 600, hidden);
+		gtk_application_add_window (app, GTK_WINDOW(app_data->main_app));
+	}
+}
+
+static void
+quit (GApplication *app)
+{
+	g_application_quit(app);
+}
+
+int main(int argc, char* argv[])
+{
+	gboolean hidden = FALSE;
+	GtkApplication *app;
+	gint retval;
+	app = gtk_application_new ("org.mate.mate-control-center.shell", 0);
+	GError* error;
+	GOptionEntry options[] = {
+		{"hide", 0, 0, G_OPTION_ARG_NONE, &hidden, N_("Hide on start (useful to preload the shell)"), NULL},
+		{NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL}
+	};
+
+#ifdef ENABLE_NLS
+	bindtextdomain(GETTEXT_PACKAGE, MATELOCALEDIR);
+	bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
+	textdomain(GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
+
+	error = NULL;
+
+	if (!gtk_init_with_args(&argc, &argv, NULL, options, GETTEXT_PACKAGE, &error))
+	{
+		g_printerr("%s\n", error->message);
+		g_error_free(error);
+		return 1;
+	}
+
+	g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
+	g_signal_connect (app, "window-removed", G_CALLBACK (quit), NULL);
+	retval = g_application_run (G_APPLICATION (app), argc, argv);
+	return retval;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/125.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/125.html new file mode 100644 index 00000000..eac05def --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/125.html @@ -0,0 +1,353 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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 part of libslab.
+ *
+ * Copyright (c) 2006 Novell, Inc.
+ *
+ * Libslab 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.
+ *
+ * Libslab 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 libslab; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef __DOUBLE_CLICK_DETECTOR_H__
+#define __DOUBLE_CLICK_DETECTOR_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.
+
+G_BEGIN_DECLS
+
+#define DOUBLE_CLICK_DETECTOR_TYPE         (double_click_detector_get_type ())
+#define DOUBLE_CLICK_DETECTOR(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), DOUBLE_CLICK_DETECTOR_TYPE, DoubleClickDetector))
+#define DOUBLE_CLICK_DETECTOR_CLASS(c)     (G_TYPE_CHECK_CLASS_CAST ((c), DOUBLE_CLICK_DETECTOR_TYPE, DoubleClickDetectorClass))
+#define IS_DOUBLE_CLICK_DETECTOR(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), DOUBLE_CLICK_DETECTOR_TYPE))
+#define IS_DOUBLE_CLICK_DETECTOR_CLASS(c)  (G_TYPE_CHECK_CLASS_TYPE ((c), DOUBLE_CLICK_DETECTOR_TYPE))
+#define DOUBLE_CLICK_DETECTOR_GET_CLASS(o) (G_TYPE_CHECK_GET_CLASS ((o), DOUBLE_CLICK_DETECTOR_TYPE, DoubleClickDetectorClass))
+
+typedef struct
+{
+	GObject parent_placeholder;
+
+	gint32 double_click_time;
+	guint32 last_click_time;
+} DoubleClickDetector;
+
+typedef struct
+{
+	GObjectClass parent_class;
+} DoubleClickDetectorClass;
+
+GType double_click_detector_get_type (void);
+
+DoubleClickDetector *double_click_detector_new (void);
+
+gboolean double_click_detector_is_double_click (DoubleClickDetector * detector, guint32 event_time,
+	gboolean auto_update);
+
+G_END_DECLS
+
+#endif /* __DOUBLE_CLICK_DETECTOR_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/126.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/126.html new file mode 100644 index 00000000..2d3133c0 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/126.html @@ -0,0 +1,305 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/*
+ * This file is part of libslab.
+ *
+ * Copyright (c) 2006 Novell, Inc.
+ *
+ * Libslab 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.
+ *
+ * Libslab 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 libslab; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef __MATE_UTILS_H__
+#define __MATE_UTILS_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.
+
+G_BEGIN_DECLS
+
+gboolean load_image_by_id (GtkImage * image, GtkIconSize size,
+	const gchar * image_id);
+
+G_END_DECLS
+
+#endif /* __MATE_UTILS_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/127.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/127.html new file mode 100644 index 00000000..cd07787f --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/127.html @@ -0,0 +1,411 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/*
+ * This file is part of libslab.
+ *
+ * Copyright (c) 2006, 2007 Novell, Inc.
+ *
+ * Libslab 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.
+ *
+ * Libslab 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 libslab; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "double-click-detector.h"
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "libslab-utils.h"
+
+G_DEFINE_TYPE (DoubleClickDetector, double_click_detector, G_TYPE_OBJECT);
+
+void double_click_detector_update_click_time (DoubleClickDetector * detector, guint32 event_time);
+
+static void
+double_click_detector_class_init (DoubleClickDetectorClass * detector_class)
+{
+}
+
+static void
+double_click_detector_init (DoubleClickDetector * detector)
+{
+	GtkSettings *settings;
+	gint click_interval;
+
+	settings = gtk_settings_get_default ();
+
+	g_object_get (G_OBJECT (settings), "gtk-double-click-time", &click_interval, NULL);
+
+	detector->double_click_time = (gint32) click_interval;
+	detector->last_click_time = 0;
+}
+
+DoubleClickDetector *
+double_click_detector_new ()
+{
+	return g_object_new (DOUBLE_CLICK_DETECTOR_TYPE, NULL);
+}
+
+gboolean
+double_click_detector_is_double_click (DoubleClickDetector *this, guint32 event_time,
+                                       gboolean auto_update)
+{
+	gint32 delta;
+
+	if (event_time == 0)
+		event_time = (guint32) (g_get_monotonic_time () / 1000); /* milliseconds */
+
+	if (this->last_click_time == 0) {
+		if (auto_update)
+			double_click_detector_update_click_time (this, event_time);
+
+		return FALSE;
+	}
+
+	delta = (gint32) event_time - (gint32) this->last_click_time;
+
+	if (auto_update)
+		double_click_detector_update_click_time (this, event_time);
+
+	return delta < this->double_click_time;
+}
+
+void
+double_click_detector_update_click_time (DoubleClickDetector *this, guint32 event_time)
+{
+	if (event_time == 0)
+		event_time = (guint32) (g_get_monotonic_time () / 1000); /* milliseconds */
+
+	this->last_click_time = event_time;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/128.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/128.html new file mode 100644 index 00000000..db1ff05f --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/128.html @@ -0,0 +1,377 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
#include "libslab-utils.h"
+
+#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 <stdio.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 <time.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/stat.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/resource.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/time.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.
+
+MateDesktopItem *
+libslab_mate_desktop_item_new_from_unknown_id (const gchar *id)
+{
+	MateDesktopItem *item;
+	gchar            *basename;
+
+	GError *error = NULL;
+
+	if (! id)
+		return NULL;
+
+	item = mate_desktop_item_new_from_uri (id, 0, & error);
+
+	if (! error)
+		return item;
+	else {
+		g_error_free (error);
+		error = NULL;
+	}
+
+	item = mate_desktop_item_new_from_file (id, 0, & error);
+
+	if (! error)
+		return item;
+	else {
+		g_error_free (error);
+		error = NULL;
+	}
+
+	item = mate_desktop_item_new_from_basename (id, 0, & error);
+
+	if (! error)
+		return item;
+	else {
+		g_error_free (error);
+		error = NULL;
+	}
+
+	basename = g_strrstr (id, "/");
+
+	if (basename) {
+		basename++;
+
+		item = mate_desktop_item_new_from_basename (basename, 0, &error);
+
+		if (! error)
+			return item;
+		else {
+			g_error_free (error);
+			error = NULL;
+		}
+	}
+
+	return NULL;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/129.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/129.html new file mode 100644 index 00000000..c1d7ef7b --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/129.html @@ -0,0 +1,413 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
#include "mate-utils.h"
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+gboolean
+load_image_by_id (GtkImage *image, GtkIconSize size, const gchar *image_id)
+{
+	cairo_surface_t *surface;
+	gint width;
+	gint height;
+	gint scale_factor;
+
+	GtkIconTheme *icon_theme;
+
+	gchar *id;
+
+	gboolean icon_exists;
+
+	if (!image_id)
+		return FALSE;
+
+	id = g_strdup (image_id);
+	scale_factor = gtk_widget_get_scale_factor (GTK_WIDGET (image));
+
+	gtk_icon_size_lookup (size, &width, &height);
+	gtk_image_set_pixel_size (image, width);
+
+	if (g_path_is_absolute (id))
+	{
+		GdkPixbuf *pixbuf;
+
+		pixbuf = gdk_pixbuf_new_from_file_at_size (id, width * scale_factor, height * scale_factor, NULL);
+
+		icon_exists = (pixbuf != NULL);
+
+		if (icon_exists)
+		{
+			surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, scale_factor, NULL);
+			gtk_image_set_from_surface (image, surface);
+
+			cairo_surface_destroy (surface);
+			g_object_unref (pixbuf);
+		}
+		else
+			gtk_image_set_from_icon_name (image, "image-missing", size);
+	}
+	else
+	{
+		if (		/* file extensions are not copesetic with loading by "name" */
+			g_str_has_suffix (id, ".png") ||
+			g_str_has_suffix (id, ".svg") ||
+			g_str_has_suffix (id, ".xpm")
+		   )
+
+			id[strlen (id) - 4] = '\0';
+
+		if (gtk_widget_has_screen (GTK_WIDGET (image)))
+			icon_theme =
+				gtk_icon_theme_get_for_screen (gtk_widget_get_screen (GTK_WIDGET
+					(image)));
+		else
+			icon_theme = gtk_icon_theme_get_default ();
+
+		surface = gtk_icon_theme_load_surface (icon_theme, id,
+		                                       width, scale_factor,
+		                                       NULL,
+		                                       GTK_ICON_LOOKUP_FORCE_SIZE,
+		                                       NULL);
+		icon_exists = (surface != NULL);
+		if (icon_exists) {
+			gtk_image_set_from_surface (image, surface);
+			cairo_surface_destroy (surface);
+		}
+		else
+			gtk_image_set_from_icon_name (image, "image-missing", size);
+
+	}
+
+	g_free (id);
+
+	return icon_exists;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/13.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/13.html new file mode 100644 index 00000000..1c43f34d --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/13.html @@ -0,0 +1,411 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/*
+ *  Authors: Rodney Dawes <dobey@ximian.com>
+ *
+ *  Copyright 2003-2006 Novell, Inc. (www.novell.com)
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of version 2 of the GNU General Public License
+ *  as published by the Free Software Foundation
+ *
+ *  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., 59 Temple Street #330, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef __MATE_WP_ITEM_H__
+#define __MATE_WP_ITEM_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 <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 <libmate-desktop/mate-desktop-thumbnail.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libmate-desktop/mate-bg.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "mate-wp-info.h"
+
+typedef struct _MateWPItem MateWPItem;
+
+struct _MateWPItem {
+  MateBG *bg;
+
+  gchar * name;
+  gchar * filename;
+  gchar * description;
+  MateBGPlacement options;
+  MateBGColorType shade_type;
+
+  /* Where the Item is in the List */
+  GtkTreeRowReference * rowref;
+
+  /* Real colors */
+  GdkRGBA * pcolor;
+  GdkRGBA * scolor;
+
+  MateWPInfo * fileinfo;
+
+  /* Did the user remove us? */
+  gboolean deleted;
+
+  /* Wallpaper author, if present */
+  gchar *artist;
+
+  /* Width and Height of the original image */
+  gint width;
+  gint height;
+};
+
+MateWPItem * mate_wp_item_new (const gchar *filename,
+				 GHashTable *wallpapers,
+				 MateDesktopThumbnailFactory *thumbnails);
+
+void mate_wp_item_free (MateWPItem *item);
+GdkPixbuf * mate_wp_item_get_thumbnail (MateWPItem *item,
+					 MateDesktopThumbnailFactory *thumbs,
+                                         gint width,
+                                         gint height);
+GdkPixbuf * mate_wp_item_get_frame_thumbnail (MateWPItem *item,
+                                               MateDesktopThumbnailFactory *thumbs,
+                                               gint width,
+                                               gint height,
+                                               gint frame);
+void mate_wp_item_update (MateWPItem *item);
+void mate_wp_item_update_description (MateWPItem *item);
+void mate_wp_item_ensure_mate_bg (MateWPItem *item);
+
+const gchar *wp_item_option_to_string (MateBGPlacement type);
+const gchar *wp_item_shading_to_string (MateBGColorType type);
+MateBGPlacement wp_item_string_to_option (const gchar *option);
+MateBGColorType wp_item_string_to_shading (const gchar *shade_type);
+
+#endif /* __MATE_WP_ITEM_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/130.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/130.html new file mode 100644 index 00000000..df315266 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/130.html @@ -0,0 +1,785 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * This file is part of libtile.
+ *
+ * Copyright (c) 2006 Novell, Inc.
+ *
+ * Libtile 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.
+ *
+ * Libtile 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 libslab; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "nameplate-tile.h"
+
+static void nameplate_tile_get_property (GObject *, guint, GValue *, GParamSpec *);
+static void nameplate_tile_set_property (GObject *, guint, const GValue *, GParamSpec *);
+static GObject *nameplate_tile_constructor (GType, guint, GObjectConstructParam *);
+
+static void nameplate_tile_drag_begin (GtkWidget *, GdkDragContext *);
+
+static void nameplate_tile_setup (NameplateTile *);
+
+typedef struct
+{
+	GtkContainer *image_ctnr;
+	GtkContainer *header_ctnr;
+	GtkContainer *subheader_ctnr;
+} NameplateTilePrivate;
+
+enum
+{
+	PROP_0,
+	PROP_NAMEPLATE_IMAGE,
+	PROP_NAMEPLATE_HEADER,
+	PROP_NAMEPLATE_SUBHEADER,
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (NameplateTile, nameplate_tile, TILE_TYPE)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
+
+GtkWidget *nameplate_tile_new (const gchar * uri, GtkWidget * image, GtkWidget * header,
+	GtkWidget * subheader)
+{
+	return GTK_WIDGET (
+		g_object_new (NAMEPLATE_TILE_TYPE,
+		"tile-uri",            uri,
+		"nameplate-image",     image,
+		"nameplate-header",    header,
+		"nameplate-subheader", subheader,
+		NULL));
+}
+
+static void
+nameplate_tile_class_init (NameplateTileClass * this_class)
+{
+	GObjectClass *g_obj_class = G_OBJECT_CLASS (this_class);
+	GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (this_class);
+
+	g_obj_class->constructor = nameplate_tile_constructor;
+	g_obj_class->get_property = nameplate_tile_get_property;
+	g_obj_class->set_property = nameplate_tile_set_property;
+
+	widget_class->drag_begin = nameplate_tile_drag_begin;
+
+	g_object_class_install_property (g_obj_class, PROP_NAMEPLATE_IMAGE,
+		g_param_spec_object ("nameplate-image", "nameplate-image", "nameplate image",
+			GTK_TYPE_WIDGET, G_PARAM_READWRITE));
+
+	g_object_class_install_property (g_obj_class, PROP_NAMEPLATE_HEADER,
+		g_param_spec_object ("nameplate-header", "nameplate-header", "nameplate header",
+			GTK_TYPE_WIDGET, G_PARAM_READWRITE));
+
+	g_object_class_install_property (g_obj_class, PROP_NAMEPLATE_SUBHEADER,
+		g_param_spec_object ("nameplate-subheader", "nameplate-subheader",
+			"nameplate subheader", GTK_TYPE_WIDGET, G_PARAM_READWRITE));
+}
+
+static void
+nameplate_tile_init (NameplateTile * this)
+{
+}
+
+static GObject *
+nameplate_tile_constructor (GType type, guint n_param, GObjectConstructParam * param)
+{
+	GObject *g_obj =
+		(*G_OBJECT_CLASS (nameplate_tile_parent_class)->constructor) (type, n_param, param);
+
+	nameplate_tile_setup (NAMEPLATE_TILE (g_obj));
+
+	return g_obj;
+}
+
+static void
+nameplate_tile_get_property (GObject * g_object, guint prop_id, GValue * value,
+	GParamSpec * param_spec)
+{
+	NameplateTile *np_tile = NAMEPLATE_TILE (g_object);
+
+	switch (prop_id)
+	{
+	case PROP_NAMEPLATE_IMAGE:
+		g_value_set_object (value, np_tile->image);
+		break;
+
+	case PROP_NAMEPLATE_HEADER:
+		g_value_set_object (value, np_tile->header);
+		break;
+
+	case PROP_NAMEPLATE_SUBHEADER:
+		g_value_set_object (value, np_tile->subheader);
+		break;
+	default:
+		break;
+	}
+}
+
+static void
+nameplate_tile_set_property (GObject * g_object, guint prop_id, const GValue * value,
+	GParamSpec * param_spec)
+{
+	NameplateTile *this = NAMEPLATE_TILE (g_object);
+	NameplateTilePrivate *priv = nameplate_tile_get_instance_private (this);
+
+	GObject *widget_obj = NULL;
+
+	switch (prop_id) {
+		case PROP_NAMEPLATE_IMAGE:
+		case PROP_NAMEPLATE_HEADER:
+		case PROP_NAMEPLATE_SUBHEADER:
+			widget_obj = g_value_get_object (value);
+			break;
+		default:
+			break;
+	}
+
+	switch (prop_id)
+	{
+	case PROP_NAMEPLATE_IMAGE:
+		if (GTK_IS_WIDGET (widget_obj))
+		{
+			if (GTK_IS_WIDGET (this->image))
+				gtk_widget_destroy (this->image);
+
+			this->image = GTK_WIDGET (widget_obj);
+
+			gtk_container_add (priv->image_ctnr, this->image);
+
+			gtk_widget_show_all (this->image);
+		}
+		else if (GTK_IS_WIDGET (this->image))
+			gtk_widget_destroy (this->image);
+
+		break;
+
+	case PROP_NAMEPLATE_HEADER:
+		if (GTK_IS_WIDGET (widget_obj))
+		{
+			if (GTK_IS_WIDGET (this->header))
+				gtk_widget_destroy (this->header);
+
+			this->header = GTK_WIDGET (widget_obj);
+
+			gtk_container_add (priv->header_ctnr, this->header);
+
+			gtk_widget_show_all (this->header);
+		}
+		else if (GTK_IS_WIDGET (this->header))
+			gtk_widget_destroy (this->header);
+
+		break;
+
+	case PROP_NAMEPLATE_SUBHEADER:
+		if (GTK_IS_WIDGET (widget_obj))
+		{
+			if (GTK_IS_WIDGET (this->subheader))
+				gtk_widget_destroy (this->subheader);
+
+			this->subheader = GTK_WIDGET (widget_obj);
+
+			gtk_container_add (priv->subheader_ctnr, this->subheader);
+
+			gtk_widget_show_all (this->subheader);
+		}
+		else if (GTK_IS_WIDGET (this->subheader))
+			gtk_widget_destroy (this->subheader);
+
+		break;
+
+	default:
+		break;
+	}
+}
+
+static void
+nameplate_tile_setup (NameplateTile *this)
+{
+	NameplateTilePrivate *priv = nameplate_tile_get_instance_private (this);
+
+	GtkWidget *hbox;
+	GtkWidget *vbox;
+
+	priv->image_ctnr = GTK_CONTAINER (gtk_box_new (GTK_ORIENTATION_VERTICAL, 0));
+	gtk_widget_set_valign (GTK_WIDGET (priv->image_ctnr), GTK_ALIGN_CENTER);
+
+	priv->header_ctnr = GTK_CONTAINER (gtk_box_new (GTK_ORIENTATION_VERTICAL, 0));
+
+	priv->subheader_ctnr = GTK_CONTAINER (gtk_box_new (GTK_ORIENTATION_VERTICAL, 0));
+	gtk_widget_set_halign (GTK_WIDGET (priv->subheader_ctnr), GTK_ALIGN_START);
+
+	hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+	vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+	gtk_widget_set_halign (vbox, GTK_ALIGN_FILL);
+	gtk_widget_set_valign (vbox, GTK_ALIGN_CENTER);
+
+	gtk_container_add (GTK_CONTAINER (this), hbox);
+	gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (priv->image_ctnr), FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
+
+	gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (priv->header_ctnr), FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (priv->subheader_ctnr), FALSE, FALSE, 0);
+
+	if (GTK_IS_WIDGET (this->image))
+		gtk_container_add (priv->image_ctnr, this->image);
+
+	if (GTK_IS_WIDGET (this->header))
+		gtk_container_add (priv->header_ctnr, this->header);
+
+	if (GTK_IS_WIDGET (this->subheader))
+		gtk_container_add (priv->subheader_ctnr, this->subheader);
+
+	gtk_widget_set_focus_on_click (GTK_WIDGET (this), FALSE);
+}
+
+static void
+nameplate_tile_drag_begin (GtkWidget * widget, GdkDragContext * context)
+{
+	NameplateTile *this = NAMEPLATE_TILE (widget);
+	GtkImage *image;
+	const gchar *name;
+
+	(*GTK_WIDGET_CLASS (nameplate_tile_parent_class)->drag_begin) (widget, context);
+
+	if (!this->image || !GTK_IS_IMAGE (this->image))
+		return;
+
+	image = GTK_IMAGE (this->image);
+
+	switch (gtk_image_get_storage_type (image))
+	{
+	case GTK_IMAGE_PIXBUF:
+		if (gtk_image_get_pixbuf (image))
+			gtk_drag_set_icon_pixbuf (context, gtk_image_get_pixbuf (image), 0, 0);
+
+		break;
+
+	case GTK_IMAGE_ICON_NAME:
+		gtk_image_get_icon_name (image, &name, NULL);
+		if (name)
+			gtk_drag_set_icon_name (context, name, 0, 0);
+
+		break;
+
+	default:
+		break;
+	}
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/131.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/131.html new file mode 100644 index 00000000..92533fe5 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/131.html @@ -0,0 +1,267 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
/* 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 __NLD_MARSHAL_MARSHAL_H__
+#define __NLD_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:STRING (./nld-marshal.list:1) */
+#define nld_marshal_VOID__STRING	g_cclosure_marshal_VOID__STRING
+
+
+G_END_DECLS
+
+#endif /* __NLD_MARSHAL_MARSHAL_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/132.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/132.html new file mode 100644 index 00000000..763eeaf7 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/132.html @@ -0,0 +1,337 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
#include "nld-marshal.h"
+/* 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 */
+
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/133.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/133.html new file mode 100644 index 00000000..6e809087 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/133.html @@ -0,0 +1,713 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * This file is part of libslab.
+ *
+ * Copyright (c) 2006 Novell, Inc.
+ *
+ * Libslab 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.
+ *
+ * Libslab 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 libslab; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "search-bar.h"
+#include "config.h"<--- Include file: "config.h" not found.
+
+#include "nld-marshal.h"
+
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+typedef struct
+{
+	GtkWidget *hbox;
+	GtkEntry *entry;
+	GtkWidget *button;
+
+	int search_timeout;
+	guint timeout_id;
+
+	gboolean block_signal;
+} NldSearchBarPrivate;
+
+static void nld_search_bar_finalize (GObject *);
+
+static gboolean nld_search_bar_focus (GtkWidget *, GtkDirectionType);
+static void nld_search_bar_grab_focus (GtkWidget *);
+
+enum
+{
+	SEARCH,
+	LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
+G_DEFINE_TYPE_WITH_PRIVATE (NldSearchBar, nld_search_bar, 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 emit_search (NldSearchBar * search_bar);
+static void emit_search_callback (GtkWidget * widget, gpointer search_bar);
+
+static void nld_search_bar_class_init (NldSearchBarClass * nld_search_bar_class)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (nld_search_bar_class);
+	GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (nld_search_bar_class);
+
+	object_class->finalize = nld_search_bar_finalize;
+	widget_class->focus = nld_search_bar_focus;
+	widget_class->grab_focus = nld_search_bar_grab_focus;
+
+	signals[SEARCH] =
+		g_signal_new ("search", G_TYPE_FROM_CLASS (nld_search_bar_class),
+		G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, G_STRUCT_OFFSET (NldSearchBarClass, search),
+		NULL, NULL, nld_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
+}
+
+static void
+nld_search_bar_init (NldSearchBar * search_bar)
+{
+	NldSearchBarPrivate *priv = nld_search_bar_get_instance_private (search_bar);
+	GtkWidget *entry;
+
+	gtk_widget_set_can_focus (GTK_WIDGET (search_bar), TRUE);
+	gtk_orientable_set_orientation (GTK_ORIENTABLE (search_bar), GTK_ORIENTATION_VERTICAL);
+
+	priv->hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
+	gtk_box_pack_start (GTK_BOX (search_bar), priv->hbox, TRUE, FALSE, 0);
+
+	entry = gtk_search_entry_new ();
+	gtk_widget_set_halign (entry, GTK_ALIGN_START);
+	gtk_widget_set_valign (entry, GTK_ALIGN_CENTER);
+	priv->entry = GTK_ENTRY (entry);
+	gtk_widget_show (entry);
+	gtk_box_pack_start (GTK_BOX (priv->hbox), entry, TRUE, TRUE, 0);
+
+	g_signal_connect (entry, "activate", G_CALLBACK (emit_search_callback), search_bar);
+
+	priv->search_timeout = -1;
+}
+
+static void
+nld_search_bar_finalize (GObject * object)
+{
+	NldSearchBarPrivate *priv = nld_search_bar_get_instance_private (NLD_SEARCH_BAR(object));
+
+	if (priv->timeout_id)
+		g_source_remove (priv->timeout_id);
+
+	G_OBJECT_CLASS (nld_search_bar_parent_class)->finalize (object);
+}
+
+static gboolean
+nld_search_bar_focus (GtkWidget * widget, GtkDirectionType dir)
+{
+	NldSearchBarPrivate *priv = nld_search_bar_get_instance_private (NLD_SEARCH_BAR(widget));
+
+	return gtk_widget_child_focus (priv->hbox, dir);
+}
+
+gboolean
+nld_search_bar_has_focus (NldSearchBar * search_bar)
+{
+	NldSearchBarPrivate *priv = nld_search_bar_get_instance_private (search_bar);
+
+	return gtk_widget_has_focus (GTK_WIDGET (priv->entry));
+}
+
+static void
+nld_search_bar_grab_focus (GtkWidget * widget)
+{
+	NldSearchBarPrivate *priv = nld_search_bar_get_instance_private (NLD_SEARCH_BAR(widget));
+
+	gtk_widget_grab_focus (GTK_WIDGET (priv->entry));
+}
+
+GtkWidget *
+nld_search_bar_new (void)
+{
+	return g_object_new (NLD_TYPE_SEARCH_BAR, NULL);
+}
+
+void
+nld_search_bar_clear (NldSearchBar * search_bar)
+{
+	NldSearchBarPrivate *priv = nld_search_bar_get_instance_private (search_bar);
+
+	priv->block_signal = TRUE;
+	gtk_entry_set_text (priv->entry, "");
+	priv->block_signal = FALSE;
+}
+
+static void
+emit_search (NldSearchBar * search_bar)
+{
+	NldSearchBarPrivate *priv = nld_search_bar_get_instance_private (search_bar);
+
+	if (priv->block_signal)
+		return;
+
+	if (priv->timeout_id)
+	{
+		g_source_remove (priv->timeout_id);
+		priv->timeout_id = 0;
+	}
+
+	g_signal_emit (search_bar, signals[SEARCH], 0,
+		nld_search_bar_get_text (search_bar));
+}
+
+static void
+emit_search_callback (GtkWidget * widget, gpointer search_bar)
+{
+	emit_search (search_bar);
+}
+
+static gboolean
+search_timeout (gpointer search_bar)
+{
+	NldSearchBarPrivate *priv = nld_search_bar_get_instance_private (search_bar);
+
+	priv->timeout_id = 0;
+	emit_search (search_bar);
+	return FALSE;
+}
+
+static void
+entry_changed (GtkWidget * entry, gpointer search_bar)
+{
+	NldSearchBarPrivate *priv = nld_search_bar_get_instance_private (search_bar);
+
+	if (priv->search_timeout == 0)
+		emit_search (search_bar);
+	else if (priv->search_timeout > 0)
+	{
+		if (priv->timeout_id != 0)
+			g_source_remove (priv->timeout_id);
+		priv->timeout_id =
+			g_timeout_add (priv->search_timeout * 1000, search_timeout, search_bar);
+	}
+}
+
+int
+nld_search_bar_get_search_timeout (NldSearchBar * search_bar)
+{
+	NldSearchBarPrivate *priv = nld_search_bar_get_instance_private (search_bar);
+
+	return priv->search_timeout;
+}
+
+void
+nld_search_bar_set_search_timeout (NldSearchBar * search_bar, int search_timeout)
+{
+	NldSearchBarPrivate *priv = nld_search_bar_get_instance_private (search_bar);
+
+	if (priv->search_timeout != -1 && search_timeout == -1)
+		g_signal_handlers_disconnect_by_func (priv->entry, entry_changed, search_bar);
+	else if (search_timeout != -1)
+	{
+		g_signal_connect (priv->entry, "changed", G_CALLBACK (entry_changed), search_bar);
+	}
+
+	priv->search_timeout = search_timeout;
+}
+
+const char *
+nld_search_bar_get_text (NldSearchBar * search_bar)
+{
+	NldSearchBarPrivate *priv = nld_search_bar_get_instance_private (search_bar);
+
+	return gtk_entry_get_text (priv->entry);
+}
+
+void
+nld_search_bar_set_text (NldSearchBar * search_bar, const char *text, gboolean activate)
+{
+	NldSearchBarPrivate *priv = nld_search_bar_get_instance_private (search_bar);
+
+	gtk_entry_set_text (priv->entry, text);
+	if (activate)
+		emit_search (search_bar);
+}
+
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/134.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/134.html new file mode 100644 index 00000000..57325804 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/134.html @@ -0,0 +1,403 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/*
+ * This file is part of libslab.
+ *
+ * Copyright (c) 2006 Novell, Inc.
+ *
+ * Libslab 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.
+ *
+ * Libslab 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 libslab; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "shell-window.h"
+
+#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.
+
+#include "app-resizer.h"
+
+G_DEFINE_TYPE (ShellWindow, shell_window, GTK_TYPE_FRAME);
+
+static void
+shell_window_class_init (ShellWindowClass * klass)
+{
+}
+
+static void
+shell_window_init (ShellWindow * window)
+{
+	window->_hbox = NULL;
+	window->_left_pane = NULL;
+	window->_right_pane = NULL;
+}
+
+GtkWidget *
+shell_window_new (AppShellData * app_data)
+{
+	ShellWindow *window = g_object_new (SHELL_WINDOW_TYPE, NULL);
+
+	gtk_widget_set_app_paintable (GTK_WIDGET (window), TRUE);
+	gtk_frame_set_shadow_type(GTK_FRAME(window), GTK_SHADOW_NONE);
+
+	window->_hbox = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
+	gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (window->_hbox));
+
+	return GTK_WIDGET (window);
+}
+
+void
+shell_window_clear_resize_handler (ShellWindow * win)
+{
+	if (win->resize_handler_id)
+	{
+		g_signal_handler_disconnect (win, win->resize_handler_id);
+		win->resize_handler_id = 0;
+	}
+}
+
+void
+shell_window_set_contents (ShellWindow * shell, GtkWidget * left_pane, GtkWidget * right_pane)
+{
+	shell->_left_pane = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+	gtk_widget_set_margin_top (GTK_WIDGET (shell->_left_pane), 15);
+	gtk_widget_set_margin_bottom (GTK_WIDGET (shell->_left_pane), 15);
+	gtk_widget_set_margin_start (GTK_WIDGET (shell->_left_pane), 15);
+	gtk_widget_set_margin_end (GTK_WIDGET (shell->_left_pane), 15);
+
+	shell->_right_pane = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+
+	gtk_box_pack_start (shell->_hbox, shell->_left_pane, FALSE, FALSE, 0);
+	gtk_box_pack_start (shell->_hbox, shell->_right_pane, TRUE, TRUE, 0);	/* this one takes any extra space */
+
+	gtk_container_add (GTK_CONTAINER (shell->_left_pane), left_pane);
+	gtk_container_add (GTK_CONTAINER (shell->_right_pane), right_pane);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/135.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/135.html new file mode 100644 index 00000000..91839082 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/135.html @@ -0,0 +1,569 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * This file is part of libslab.
+ *
+ * Copyright (c) 2006 Novell, Inc.
+ *
+ * Libslab 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.
+ *
+ * Libslab 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 libslab; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "slab-mate-util.h"
+#include "libslab-utils.h"
+
+#include <gio/gio.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.
+
+MateDesktopItem *
+load_desktop_item_from_unknown (const gchar *id)
+{
+	MateDesktopItem *item;
+	gchar            *basename;
+
+	GError *error = NULL;
+
+	item = mate_desktop_item_new_from_uri (id, 0, &error);
+
+	if (! error)
+		return item;
+	else {
+		g_error_free (error);
+		error = NULL;
+	}
+
+	item = mate_desktop_item_new_from_file (id, 0, &error);
+
+	if (! error)
+		return item;
+	else {
+		g_error_free (error);
+		error = NULL;
+	}
+
+	item = mate_desktop_item_new_from_basename (id, 0, &error);
+
+	if (! error)
+		return item;
+	else {
+		g_error_free (error);
+		error = NULL;
+	}
+
+	basename = g_strrstr (id, "/");
+
+	if (basename) {
+		basename++;
+
+		item = mate_desktop_item_new_from_basename (basename, 0, &error);
+
+		if (! error)
+			return item;
+		else {
+			g_error_free (error);
+			error = NULL;
+		}
+	}
+
+	return NULL;
+}
+
+gboolean
+open_desktop_item_exec (MateDesktopItem * desktop_item)
+{
+	GError *error = NULL;
+
+	if (!desktop_item)
+		return FALSE;
+
+	mate_desktop_item_launch (desktop_item, NULL, MATE_DESKTOP_ITEM_LAUNCH_ONLY_ONE | MATE_DESKTOP_ITEM_LAUNCH_DO_NOT_REAP_CHILD, &error);
+
+	if (error)
+	{
+		g_warning ("error launching %s [%s]\n",
+			mate_desktop_item_get_location (desktop_item), error->message);
+
+		g_error_free (error);
+		return FALSE;
+	}
+
+	return TRUE;
+}
+
+gboolean
+open_desktop_item_help (MateDesktopItem * desktop_item)
+{
+	const gchar *doc_path;
+	gchar *help_uri;
+
+	GError *error;
+
+	if (!desktop_item)
+		return FALSE;
+
+	doc_path = mate_desktop_item_get_string (desktop_item, "DocPath");
+
+	if (doc_path)
+	{
+		help_uri = g_strdup_printf ("help:%s", doc_path);
+
+		error = NULL;
+		if (!gtk_show_uri_on_window (NULL, help_uri, gtk_get_current_event_time (), &error))
+		{
+			g_warning ("error opening %s [%s]\n", help_uri, error->message);
+
+			g_free (help_uri);
+			g_error_free (error);
+			return FALSE;
+		}
+
+		g_free (help_uri);
+	}
+	else
+		return FALSE;
+
+	return TRUE;
+}
+
+void
+copy_file (const gchar * src_uri, const gchar * dst_uri)
+{
+	GFile *src;
+	GFile *dst;
+	GError *error = NULL;
+	gboolean res;
+
+	src = g_file_new_for_uri (src_uri);
+	dst = g_file_new_for_uri (dst_uri);
+
+	res = g_file_copy (src, dst,
+			   G_FILE_COPY_NONE,
+			   NULL, NULL, NULL, &error);
+
+	if (!res)
+	{
+		g_warning ("error copying [%s] to [%s]: %s.", src_uri, dst_uri, error->message);
+		g_error_free (error);
+	}
+
+	g_object_unref (src);
+	g_object_unref (dst);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/136.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/136.html new file mode 100644 index 00000000..ce974866 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/136.html @@ -0,0 +1,555 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * This file is part of libslab.
+ *
+ * Copyright (c) 2006 Novell, Inc.
+ *
+ * Libslab 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.
+ *
+ * Libslab 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 libslab; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "themed-icon.h"
+
+#include "mate-utils.h"
+
+static void themed_icon_finalize (GObject *);
+static void themed_icon_get_property (GObject *, guint, GValue *, GParamSpec *);
+static void themed_icon_set_property (GObject *, guint, const GValue *, GParamSpec *);
+
+static void themed_icon_show (GtkWidget *);
+static void themed_icon_style_updated (GtkWidget *);
+
+enum
+{
+	PROP_0,
+	PROP_ICON_ID,
+	PROP_ICON_SIZE
+};
+
+typedef struct
+{
+	gboolean icon_loaded;
+} ThemedIconPrivate;
+
+G_DEFINE_TYPE_WITH_PRIVATE (ThemedIcon, themed_icon, GTK_TYPE_IMAGE)<--- 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 themed_icon_class_init (ThemedIconClass * themed_icon_class)
+{
+	GObjectClass *g_obj_class = G_OBJECT_CLASS (themed_icon_class);
+	GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (themed_icon_class);
+
+	g_obj_class->get_property = themed_icon_get_property;
+	g_obj_class->set_property = themed_icon_set_property;
+	g_obj_class->finalize = themed_icon_finalize;
+
+	widget_class->show = themed_icon_show;
+	widget_class->style_updated = themed_icon_style_updated;
+
+	g_object_class_install_property (g_obj_class, PROP_ICON_ID, g_param_spec_string ("icon-id",
+			"icon-id", "the identifier of the icon", NULL,
+			G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+
+	g_object_class_install_property (g_obj_class, PROP_ICON_SIZE,
+		g_param_spec_enum ("icon-size", "icon-size", "the size of the icon",
+			GTK_TYPE_ICON_SIZE, GTK_ICON_SIZE_BUTTON,
+			G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+}
+
+static void
+themed_icon_init (ThemedIcon * icon)
+{
+	ThemedIconPrivate *priv = themed_icon_get_instance_private (icon);
+
+	priv->icon_loaded = FALSE;
+}
+
+GtkWidget *
+themed_icon_new (const gchar * id, GtkIconSize size)
+{
+	GtkWidget *icon = GTK_WIDGET (g_object_new (
+		THEMED_ICON_TYPE, "icon-id", id, "icon-size", size, NULL));
+
+	return icon;
+}
+
+static void
+themed_icon_finalize (GObject * object)
+{
+	ThemedIcon *icon = THEMED_ICON (object);
+	if (icon->id)
+		g_free (icon->id);
+	(*G_OBJECT_CLASS (themed_icon_parent_class)->finalize) (object);
+}
+
+static void
+themed_icon_get_property (GObject * g_obj, guint prop_id, GValue * value, GParamSpec * param_spec)
+{
+	ThemedIcon *icon = THEMED_ICON (g_obj);
+
+	switch (prop_id)
+	{
+	case PROP_ICON_ID:
+		g_value_set_string (value, icon->id);
+		break;
+
+	case PROP_ICON_SIZE:
+		g_value_set_enum (value, icon->size);
+		break;
+
+	default:
+		break;
+	}
+}
+
+static void
+themed_icon_set_property (GObject * g_obj, guint prop_id, const GValue * value,
+	GParamSpec * param_spec)
+{
+	ThemedIcon *icon = THEMED_ICON (g_obj);
+
+	switch (prop_id)
+	{
+	case PROP_ICON_ID:
+		icon->id = g_strdup (g_value_get_string (value));
+
+/*			gtk_image_load_by_id (GTK_IMAGE (icon), icon->size, icon->id); */
+
+		break;
+
+	case PROP_ICON_SIZE:
+		icon->size = g_value_get_enum (value);
+
+/*			gtk_image_load_by_id (GTK_IMAGE (icon), icon->size, icon->id); */
+
+		break;
+
+	default:
+		break;
+	}
+}
+
+static void
+themed_icon_show (GtkWidget * widget)
+{
+	ThemedIcon *icon = THEMED_ICON (widget);
+	ThemedIconPrivate *priv = themed_icon_get_instance_private (icon);
+
+	if (!priv->icon_loaded)
+		priv->icon_loaded = load_image_by_id (GTK_IMAGE (icon), icon->size, icon->id);
+
+	(*GTK_WIDGET_CLASS (themed_icon_parent_class)->show) (widget);
+}
+
+static void
+themed_icon_style_updated (GtkWidget * widget)
+{
+	ThemedIcon *icon = THEMED_ICON (widget);
+
+	load_image_by_id (GTK_IMAGE (icon), icon->size, icon->id);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/137.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/137.html new file mode 100644 index 00000000..0cef04da --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/137.html @@ -0,0 +1,455 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * This file is part of libtile.
+ *
+ * Copyright (c) 2006 Novell, Inc.
+ *
+ * Libtile 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.
+ *
+ * Libtile 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 libslab; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "tile.h"
+
+G_DEFINE_TYPE (TileAction, tile_action, G_TYPE_OBJECT)
+
+static void tile_action_finalize (GObject *);
+static void tile_action_menu_item_activate_cb (GtkMenuItem *, gpointer);
+
+static void tile_action_class_init (TileActionClass * this_class)
+{
+	GObjectClass *g_obj_class = G_OBJECT_CLASS (this_class);
+
+	g_obj_class->finalize = tile_action_finalize;
+}
+
+static void
+tile_action_init (TileAction * this)
+{
+	this->tile = NULL;
+	this->func = 0;
+	this->menu_item = NULL;
+	this->flags = 0;
+}
+
+static void
+tile_action_finalize (GObject * g_object)
+{
+	TileAction *action = TILE_ACTION (g_object);
+	if (action->menu_item)
+		gtk_widget_destroy (GTK_WIDGET (action->menu_item));
+
+	(*G_OBJECT_CLASS (tile_action_parent_class)->finalize) (g_object);
+}
+
+TileAction *
+tile_action_new (Tile * tile, TileActionFunc func, const gchar * menu_item_markup, guint32 flags)
+{
+	TileAction *this = g_object_new (TILE_ACTION_TYPE, NULL);
+
+	this->tile = tile;
+	this->func = func;
+
+	if (menu_item_markup)
+		tile_action_set_menu_item_label (this, menu_item_markup);
+	else
+		this->menu_item = NULL;
+
+	this->flags = flags;
+
+	return this;
+}
+
+void
+tile_action_set_menu_item_label (TileAction * this, const gchar * markup)
+{
+	GtkWidget *label;
+
+	if (this->menu_item)
+	{
+		label = gtk_bin_get_child (GTK_BIN (this->menu_item));
+		gtk_label_set_markup (GTK_LABEL (label), markup);
+	}
+	else
+	{
+		label = gtk_label_new (markup);
+		gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
+		gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+
+		this->menu_item = GTK_MENU_ITEM (gtk_menu_item_new ());
+		gtk_container_add (GTK_CONTAINER (this->menu_item), label);
+
+		g_signal_connect (this->menu_item, "activate",
+		                  G_CALLBACK (tile_action_menu_item_activate_cb),
+		                  this);
+	}
+}
+
+GtkMenuItem *
+tile_action_get_menu_item (TileAction * this)<--- Parameter 'this' can be declared as pointer to const
+{
+	return this->menu_item;
+}
+
+static void
+tile_action_menu_item_activate_cb (GtkMenuItem * menu_item, gpointer user_data)
+{
+	TileAction *this = TILE_ACTION (user_data);
+
+	tile_trigger_action (this->tile, this);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/138.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/138.html new file mode 100644 index 00000000..540e9a79 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/138.html @@ -0,0 +1,1295 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * This file is part of libtile.
+ *
+ * Copyright (c) 2006 Novell, Inc.
+ *
+ * Libtile 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.
+ *
+ * Libtile 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 libslab; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "tile.h"
+
+#include <gdk/gdkkeysyms.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 "double-click-detector.h"
+
+typedef struct
+{
+	DoubleClickDetector *double_click_detector;
+
+	gboolean is_dragging;
+} TilePrivate;
+
+G_DEFINE_TYPE_WITH_PRIVATE (Tile, tile, GTK_TYPE_BUTTON)<--- 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 tile_finalize (GObject *);
+static void tile_dispose (GObject *);
+static void tile_get_property (GObject *, guint, GValue *, GParamSpec *);
+static void tile_set_property (GObject *, guint, const GValue *, GParamSpec *);
+static GObject *tile_constructor (GType, guint, GObjectConstructParam *);
+
+static void tile_setup (Tile *);
+
+static void tile_enter (GtkButton * widget);
+static void tile_leave (GtkButton * widget);
+static void tile_clicked (GtkButton *widget);
+
+static gboolean tile_focus_in (GtkWidget *, GdkEventFocus *);
+static gboolean tile_focus_out (GtkWidget *, GdkEventFocus *);
+static gboolean tile_draw (GtkWidget *, cairo_t *);
+static gboolean tile_button_release (GtkWidget *, GdkEventButton *);
+static gboolean tile_key_release (GtkWidget *, GdkEventKey *);
+static gboolean tile_popup_menu (GtkWidget *);
+
+static void tile_drag_begin (GtkWidget *, GdkDragContext *);
+static void tile_drag_data_get (GtkWidget *, GdkDragContext *, GtkSelectionData *, guint,
+guint);
+
+static void tile_tile_action_triggered (Tile *, TileEvent *, TileAction *);
+static void tile_action_triggered_event_marshal (GClosure *, GValue *, guint, const GValue *,
+gpointer, gpointer);
+
+typedef void (*marshal_func_VOID__POINTER_POINTER) (gpointer, gpointer, gpointer, gpointer);
+
+enum
+{
+	TILE_ACTIVATED_SIGNAL,
+	TILE_ACTION_TRIGGERED_SIGNAL,
+	LAST_SIGNAL
+};
+
+static guint tile_signals[LAST_SIGNAL] = { 0 };
+
+enum
+{
+	PROP_0,
+	PROP_TILE_URI,
+	PROP_TILE_CONTEXT_MENU,
+	PROP_TILE_ACTIONS
+};
+
+static void
+tile_class_init (TileClass * this_class)
+{
+	GObjectClass *g_obj_class = G_OBJECT_CLASS (this_class);
+	GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (this_class);
+	GtkButtonClass *button_class = GTK_BUTTON_CLASS (this_class);
+
+	g_obj_class->constructor = tile_constructor;
+	g_obj_class->get_property = tile_get_property;
+	g_obj_class->set_property = tile_set_property;
+	g_obj_class->finalize = tile_finalize;
+	g_obj_class->dispose = tile_dispose;
+
+	widget_class->focus_in_event = tile_focus_in;
+	widget_class->focus_out_event = tile_focus_out;
+	widget_class->draw = tile_draw;
+	widget_class->button_release_event = tile_button_release;
+	widget_class->key_release_event = tile_key_release;
+	widget_class->drag_begin = tile_drag_begin;
+	widget_class->drag_data_get = tile_drag_data_get;
+	widget_class->popup_menu = tile_popup_menu;
+
+	button_class->enter = tile_enter;
+	button_class->leave = tile_leave;
+	button_class->clicked = tile_clicked;
+
+	this_class->tile_activated = NULL;
+	this_class->tile_action_triggered = tile_tile_action_triggered;
+
+	g_object_class_install_property (g_obj_class, PROP_TILE_URI,
+		g_param_spec_string ("tile-uri", "tile-uri", "the uri of the tile", NULL,
+			G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+
+	g_object_class_install_property (g_obj_class, PROP_TILE_CONTEXT_MENU,
+		g_param_spec_object ("context-menu", "context-menu",
+			"the context menu for the tile", GTK_TYPE_MENU, G_PARAM_READWRITE));
+
+	tile_signals[TILE_ACTIVATED_SIGNAL] = g_signal_new ("tile-activated",
+		G_TYPE_FROM_CLASS (this_class),
+		G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+		G_STRUCT_OFFSET (TileClass, tile_activated),
+		NULL, NULL, g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER);
+
+	tile_signals[TILE_ACTION_TRIGGERED_SIGNAL] = g_signal_new ("tile-action-triggered",
+		G_TYPE_FROM_CLASS (this_class),
+		G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+		G_STRUCT_OFFSET (TileClass, tile_action_triggered),
+		NULL, NULL, tile_action_triggered_event_marshal, G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_POINTER);
+}
+
+static GObject *
+tile_constructor (GType type, guint n_param, GObjectConstructParam * param)
+{
+	GObject *g_obj;
+	TilePrivate *priv;
+
+	g_obj = (*G_OBJECT_CLASS (tile_parent_class)->constructor) (type, n_param, param);
+
+	priv = tile_get_instance_private (TILE(g_obj));
+	priv->double_click_detector = double_click_detector_new ();
+
+	tile_setup (TILE (g_obj));
+
+	return g_obj;
+}
+
+static void
+tile_init (Tile * tile)
+{
+	TilePrivate *priv = tile_get_instance_private (tile);
+
+	tile->uri = NULL;
+	tile->context_menu = NULL;
+	tile->entered = FALSE;
+	tile->enabled = TRUE;
+
+	tile->actions = NULL;
+	tile->n_actions = 0;
+
+	tile->default_action = NULL;
+
+	priv->double_click_detector = NULL;
+	priv->is_dragging = FALSE;
+}
+
+static void
+tile_finalize (GObject * g_object)
+{
+	Tile *tile = TILE (g_object);
+	TilePrivate *priv = tile_get_instance_private (TILE(tile));
+
+	if (tile->n_actions)	/* this will also free "default_action" entry */
+	{
+		g_free (tile->actions);
+	}
+
+	if (tile->uri)
+		g_free (tile->uri);
+
+	g_object_unref (priv->double_click_detector);
+
+	(*G_OBJECT_CLASS (tile_parent_class)->finalize) (g_object);
+}
+
+static void
+tile_dispose (GObject * g_object)
+{
+	Tile *tile = TILE (g_object);
+
+	/* free the TileAction object */
+	if (tile->n_actions)
+	{
+		gint x;
+		for (x = 0; x < tile->n_actions; x++)
+		{
+			if (tile->actions[x] != NULL) {
+				g_object_unref (tile->actions[x]);
+				tile->actions[x] = NULL;
+			}
+		}
+	}
+
+	/* free the GtkMenu object */
+	if (tile->context_menu != NULL) {
+		gtk_widget_destroy (GTK_WIDGET (tile->context_menu));
+		tile->context_menu = NULL;
+	}
+
+	(*G_OBJECT_CLASS (tile_parent_class)->dispose) (g_object);
+}
+
+static void
+tile_get_property (GObject * g_obj, guint prop_id, GValue * value, GParamSpec * param_spec)
+{
+	if (!IS_TILE (g_obj))
+		return;
+
+	switch (prop_id)
+	{
+	case PROP_TILE_URI:
+		g_value_set_string (value, TILE (g_obj)->uri);
+		break;
+
+	case PROP_TILE_CONTEXT_MENU:
+		g_value_set_object (value, TILE (g_obj)->context_menu);
+		break;
+
+	default:
+		break;
+	}
+}
+
+static void
+tile_set_property (GObject * g_obj, guint prop_id, const GValue * value, GParamSpec * param_spec)
+{
+	Tile *tile;
+	GtkMenu *menu;
+
+	if (!IS_TILE (g_obj))
+		return;
+
+	tile = TILE (g_obj);
+
+	switch (prop_id)
+	{
+	case PROP_TILE_URI:
+		tile->uri = g_strdup (g_value_get_string (value));
+		break;
+
+	case PROP_TILE_CONTEXT_MENU:
+		menu = g_value_get_object (value);
+
+		if (menu == tile->context_menu)
+			break;
+
+		if (tile->context_menu)
+			gtk_menu_detach (tile->context_menu);
+
+		tile->context_menu = menu;
+
+		if (tile->context_menu)
+			gtk_menu_attach_to_widget (tile->context_menu, GTK_WIDGET (tile), NULL);
+
+		break;
+
+	default:
+		break;
+	}
+}
+
+static void
+tile_setup (Tile * tile)
+{
+	gtk_button_set_relief (GTK_BUTTON (tile), GTK_RELIEF_NONE);
+
+	if (tile->uri)
+	{
+		gtk_drag_source_set (GTK_WIDGET (tile), GDK_BUTTON1_MASK, NULL, 0,
+			GDK_ACTION_COPY | GDK_ACTION_MOVE);
+
+		gtk_drag_source_add_uri_targets (GTK_WIDGET (tile));
+	}
+}
+
+static void
+tile_enter (GtkButton * widget)
+{
+	gtk_widget_set_state_flags (GTK_WIDGET (widget), TILE_STATE_ENTERED, TRUE);
+
+	TILE (widget)->entered = TRUE;
+}
+
+static void
+tile_leave (GtkButton * widget)
+{
+	if (gtk_widget_has_focus (GTK_WIDGET (widget)))
+		gtk_widget_set_state_flags (GTK_WIDGET (widget), TILE_STATE_FOCUSED, TRUE);
+	else
+		gtk_widget_set_state_flags (GTK_WIDGET (widget), GTK_STATE_FLAG_NORMAL, TRUE);
+
+	TILE (widget)->entered = FALSE;
+}
+
+static void
+tile_clicked (GtkButton * widget)
+{
+	TileEvent *tile_event;
+	GdkEvent  *event;
+	gboolean   handled;
+
+	tile_event = g_new0 (TileEvent, 1);
+	tile_event->type = TILE_EVENT_ACTIVATED_DOUBLE_CLICK;
+	tile_event->time = gtk_get_current_event_time ();
+
+	g_signal_emit (widget, tile_signals[TILE_ACTIVATED_SIGNAL], 0, tile_event);
+	g_signal_emit_by_name (widget, "button-release-event", &event, &handled);
+
+	g_free (tile_event);
+}
+
+static gboolean
+tile_focus_in (GtkWidget * widget, GdkEventFocus * event)
+{
+	gtk_widget_set_state_flags (widget, TILE_STATE_FOCUSED, TRUE);
+
+	return FALSE;
+}
+
+static gboolean
+tile_focus_out (GtkWidget * widget, GdkEventFocus * event)
+{
+	if (TILE (widget)->entered)
+		gtk_widget_set_state_flags (widget, TILE_STATE_ENTERED, TRUE);
+	else
+		gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_NORMAL, TRUE);
+
+	return FALSE;
+}
+
+static gboolean
+tile_draw (GtkWidget * widget, cairo_t * cr)
+{
+	/* FIXME: there ought to be a better way to prevent the focus from being rendered. */
+
+	gboolean has_focus;
+	gboolean retval;
+
+	if ((has_focus = gtk_widget_has_focus (widget)))
+		gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_FOCUSED);
+
+	retval = (*GTK_WIDGET_CLASS (tile_parent_class)->draw) (widget, cr);
+
+	if (has_focus)
+		gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_FOCUSED, TRUE);
+
+	return retval;
+}
+
+static gboolean
+tile_button_release (GtkWidget * widget, GdkEventButton * event)
+{
+	Tile *tile = TILE (widget);
+	TilePrivate *priv = tile_get_instance_private (tile);
+
+	TileEvent *tile_event;
+	gboolean   handled;
+
+	if (priv->is_dragging)
+	{
+		priv->is_dragging = FALSE;
+
+		return TRUE;
+	}
+
+	switch (event->button)
+	{
+	case 1:
+		tile_event = g_new0 (TileEvent, 1);
+		tile_event->time = event->time;
+
+		if (double_click_detector_is_double_click (priv->double_click_detector, event->time,
+				TRUE))
+			tile_event->type = TILE_EVENT_ACTIVATED_DOUBLE_CLICK;
+		else
+			tile_event->type = TILE_EVENT_ACTIVATED_SINGLE_CLICK;
+
+		g_signal_emit (tile, tile_signals[TILE_ACTIVATED_SIGNAL], 0, tile_event);
+		g_signal_emit_by_name (GTK_BUTTON (widget), "button-release-event", &event, &handled);
+
+		g_free (tile_event);
+
+		break;
+
+	case 3:
+		if (GTK_IS_MENU (tile->context_menu))
+		    gtk_menu_popup_at_widget (GTK_MENU (tile->context_menu),
+		                              widget,
+		                              GDK_GRAVITY_SOUTH_WEST,
+		                              GDK_GRAVITY_NORTH_WEST,
+		                              (const GdkEvent*) event);
+
+		break;
+
+	default:
+		break;
+	}
+
+	return TRUE;
+}
+
+static gboolean
+tile_key_release (GtkWidget * widget, GdkEventKey * event)
+{
+	TileEvent *tile_event;
+
+	if (event->keyval == GDK_KEY_Return)
+	{
+		tile_event = g_new0 (TileEvent, 1);
+		tile_event->type = TILE_EVENT_ACTIVATED_KEYBOARD;
+		tile_event->time = event->time;
+
+		g_signal_emit (widget, tile_signals[TILE_ACTIVATED_SIGNAL], 0, tile_event);
+
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+static gboolean
+tile_popup_menu (GtkWidget * widget)
+{
+	Tile *tile = TILE (widget);
+
+	if (GTK_IS_MENU (tile->context_menu))
+	{
+		gtk_menu_popup_at_widget (GTK_MENU (tile->context_menu),
+		                          widget,
+		                          GDK_GRAVITY_SOUTH_WEST,
+		                          GDK_GRAVITY_NORTH_WEST,
+		                          NULL);
+
+		return TRUE;
+	}
+
+	else
+		return FALSE;
+}
+
+static void
+tile_drag_begin (GtkWidget * widget, GdkDragContext * context)
+{
+	TilePrivate *priv;
+
+	priv = tile_get_instance_private (TILE(widget));
+        priv->is_dragging = TRUE;
+}
+
+static void
+tile_drag_data_get (GtkWidget * widget, GdkDragContext * context, GtkSelectionData * data,
+	guint info, guint time)
+{
+	gchar *uris[2];
+
+	if (TILE (widget)->uri)
+	{
+		uris[0] = TILE (widget)->uri;
+		uris[1] = NULL;
+
+		gtk_selection_data_set_uris (data, uris);
+	}
+}
+
+static void
+tile_tile_action_triggered (Tile * tile, TileEvent * event, TileAction * action)
+{
+	if (action && action->func)
+		(*action->func) (tile, event, action);
+}
+
+void
+tile_trigger_action (Tile * tile, TileAction * action)
+{
+	tile_trigger_action_with_time (tile, action, GDK_CURRENT_TIME);
+}
+
+void
+tile_trigger_action_with_time (Tile * tile, TileAction * action, guint32 time)
+{
+	TileEvent *event = g_new0 (TileEvent, 1);
+
+	event->type = TILE_EVENT_ACTION_TRIGGERED;
+	event->time = time;
+
+	g_signal_emit (tile, tile_signals[TILE_ACTION_TRIGGERED_SIGNAL], 0, event, action);
+	g_free (event);
+}
+
+static void
+tile_action_triggered_event_marshal (GClosure * closure, GValue * retval, guint n_param,
+	const GValue * param, gpointer invocation_hint, gpointer marshal_data)
+{
+	marshal_func_VOID__POINTER_POINTER callback;
+	GCClosure *cc = (GCClosure *) closure;
+	gpointer data_0, data_1;
+
+	g_return_if_fail (n_param == 3);
+
+	if (G_CCLOSURE_SWAP_DATA (closure))
+	{
+		data_0 = closure->data;
+		data_1 = g_value_peek_pointer (param);
+	}
+	else
+	{
+		data_0 = g_value_peek_pointer (param);
+		data_1 = closure->data;
+	}
+
+	if (marshal_data)
+		callback = (marshal_func_VOID__POINTER_POINTER) marshal_data;
+	else
+		callback = (marshal_func_VOID__POINTER_POINTER) cc->callback;
+
+	callback (data_0, g_value_peek_pointer (param + 1), g_value_peek_pointer (param + 2),
+		data_1);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/139.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/139.html new file mode 100644 index 00000000..b09ba8d6 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/139.html @@ -0,0 +1,1455 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2002      CodeFactory AB
+ * Copyright (C) 2002-2003 Richard Hult <richard@imendio.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.
+ */
+
+#include <config.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.
+#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/gdkx.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/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#ifdef HAVE_CANBERRA_GTK
+#include <canberra-gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include "drwright.h"
+#include "drw-utils.h"
+#include "drw-break-window.h"
+#include "drw-timer.h"
+
+struct _DrwBreakWindowPrivate {
+	GtkWidget *clock_label;
+	GtkWidget *break_label;
+	GtkWidget *image;
+
+	GtkWidget *postpone_entry;
+	GtkWidget *postpone_button;
+
+	DrwTimer  *timer;
+
+	gint       break_time;
+	gchar     *break_text;
+	guint      clock_timeout_id;
+	guint      postpone_timeout_id;
+	guint      postpone_sensitize_id;
+};
+
+#define POSTPONE_CANCEL 30
+
+/* Signals */
+enum {
+	DONE,
+	POSTPONE,
+	LAST_SIGNAL
+};
+
+static void         drw_break_window_finalize      (GObject             *object);
+static void         drw_break_window_dispose       (GObject             *object);
+static gboolean     postpone_sensitize_cb          (DrwBreakWindow      *window);
+static gboolean     clock_timeout_cb               (DrwBreakWindow      *window);
+static void         postpone_clicked_cb            (GtkWidget           *button,
+						    GtkWidget           *window);
+static gboolean     label_draw_event_cb            (GtkLabel            *label,
+						    cairo_t             *cr,
+						    gpointer             user_data);
+static void         label_size_allocate_cb         (GtkLabel            *label,
+						    GdkRectangle        *allocation,
+						    gpointer             user_data);
+
+G_DEFINE_TYPE_WITH_PRIVATE (DrwBreakWindow, drw_break_window, GTK_TYPE_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 guint signals[LAST_SIGNAL] = { 0 };
+
+static void
+drw_break_window_class_init (DrwBreakWindowClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	object_class->finalize = drw_break_window_finalize;
+	object_class->dispose = drw_break_window_dispose;
+
+	signals[POSTPONE] =
+		g_signal_new ("postpone",
+			      G_TYPE_FROM_CLASS (klass),
+			      G_SIGNAL_RUN_LAST,
+			      0,
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE, 0);
+
+	signals[DONE] =
+		g_signal_new ("done",
+			      G_TYPE_FROM_CLASS (klass),
+			      G_SIGNAL_RUN_LAST,
+			      0,
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE, 0);
+}
+
+static void
+drw_break_window_init (DrwBreakWindow *window)
+{
+	DrwBreakWindowPrivate *priv;
+	GtkWidget             *vbox;
+	GtkWidget             *hbox;
+	gchar                 *str;
+	GtkWidget             *outer_vbox;
+	GtkWidget             *button_box;
+	gboolean               allow_postpone;
+
+	gint                   root_monitor = 0;
+	GdkScreen             *screen = NULL;
+	GdkDisplay            *display;
+	GdkRectangle           monitor;
+	gint                   right_padding;
+	gint                   bottom_padding;
+	gint                   scale;
+	GSettings             *settings;
+
+	priv = drw_break_window_get_instance_private (window);
+	window->priv = priv;
+
+	settings = g_settings_new (TYPING_BREAK_SCHEMA);
+
+	priv->break_time = 60 * g_settings_get_int (settings, "break-time");
+
+	allow_postpone = g_settings_get_boolean (settings, "allow-postpone");
+	g_object_unref (settings);
+
+	gtk_window_set_keep_above (GTK_WINDOW (window), TRUE);
+	gtk_window_fullscreen (GTK_WINDOW (window));
+	gtk_window_set_modal (GTK_WINDOW (window), TRUE);
+
+	screen = gdk_screen_get_default ();
+	display = gdk_screen_get_display (screen);
+	scale = gtk_widget_get_scale_factor (GTK_WIDGET (window));
+
+	gdk_monitor_get_geometry (gdk_display_get_monitor (display, root_monitor), &monitor);
+
+	gtk_window_set_default_size (GTK_WINDOW (window),
+				     WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale,
+				     HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale);
+
+	gtk_window_set_decorated (GTK_WINDOW (window), FALSE);
+	gtk_widget_set_app_paintable (GTK_WIDGET (window), TRUE);
+	drw_setup_background (GTK_WIDGET (window));
+
+	right_padding = WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale - monitor.width - monitor.x;
+	bottom_padding = HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale - monitor.height - monitor.y;
+
+	outer_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+	gtk_widget_set_hexpand (outer_vbox, TRUE);
+	gtk_widget_set_vexpand (outer_vbox, TRUE);
+	gtk_widget_set_margin_top (outer_vbox, monitor.y);
+	gtk_widget_set_margin_bottom (outer_vbox, bottom_padding);
+	gtk_widget_set_margin_start (outer_vbox, monitor.x);
+	gtk_widget_set_margin_end (outer_vbox, right_padding);
+	gtk_widget_show (outer_vbox);
+
+	gtk_container_add (GTK_CONTAINER (window), outer_vbox);
+
+	if (allow_postpone) {
+		button_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+		gtk_widget_show (button_box);
+
+		gtk_container_set_border_width (GTK_CONTAINER (button_box), 12);
+
+		priv->postpone_button = gtk_button_new_with_mnemonic (_("_Postpone Break"));
+		gtk_widget_show (priv->postpone_button);
+
+		gtk_widget_set_sensitive (priv->postpone_button, FALSE);
+
+		if (priv->postpone_sensitize_id) {
+			g_source_remove (priv->postpone_sensitize_id);
+		}
+
+		priv->postpone_sensitize_id = g_timeout_add_seconds (5,
+								     (GSourceFunc) postpone_sensitize_cb,
+								     window);
+
+		g_signal_connect (priv->postpone_button,
+				  "clicked",
+				  G_CALLBACK (postpone_clicked_cb),
+				  window);
+
+		gtk_box_pack_end (GTK_BOX (button_box), priv->postpone_button, FALSE, TRUE, 0);
+
+		priv->postpone_entry = gtk_entry_new ();
+		gtk_entry_set_has_frame (GTK_ENTRY (priv->postpone_entry), FALSE);
+
+		gtk_box_pack_end (GTK_BOX (button_box), priv->postpone_entry, FALSE, TRUE, 4);
+
+		gtk_box_pack_end (GTK_BOX (outer_vbox), button_box, FALSE, TRUE, 0);
+	}
+
+	vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+	gtk_widget_set_halign (vbox, GTK_ALIGN_CENTER);
+	gtk_widget_set_valign (vbox, GTK_ALIGN_CENTER);
+	gtk_widget_show (vbox);
+
+	gtk_box_pack_start (GTK_BOX (outer_vbox), vbox, TRUE, TRUE, 0);
+
+	hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+	gtk_widget_show (hbox);
+	gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, FALSE, 0);
+
+	priv->image = gtk_image_new_from_icon_name ("process-stop", GTK_ICON_SIZE_DIALOG);
+	gtk_widget_set_halign (priv->image, GTK_ALIGN_END);
+	gtk_widget_set_valign (priv->image, GTK_ALIGN_CENTER);
+	gtk_widget_show (priv->image);
+	gtk_box_pack_start (GTK_BOX (hbox), priv->image, TRUE, TRUE, 8);
+
+	priv->break_label = gtk_label_new (NULL);
+	gtk_widget_show (priv->break_label);
+
+	g_signal_connect (priv->break_label,
+			  "draw",
+			  G_CALLBACK (label_draw_event_cb),
+			  NULL);
+
+	g_signal_connect_after (priv->break_label,
+				"size-allocate",
+				G_CALLBACK (label_size_allocate_cb),
+				NULL);
+
+	str = g_strdup_printf ("<span size=\"xx-large\" foreground=\"white\"><b>%s</b></span>",
+			       _("Take a break!"));
+	gtk_label_set_markup (GTK_LABEL (priv->break_label), str);
+	g_free (str);
+
+	gtk_box_pack_start (GTK_BOX (hbox), priv->break_label, FALSE, FALSE, 12);
+
+	priv->clock_label = gtk_label_new (NULL);
+	gtk_widget_show (priv->clock_label);
+	gtk_box_pack_start (GTK_BOX (vbox), priv->clock_label, TRUE, TRUE, 8);
+
+	g_signal_connect (priv->clock_label,
+			  "draw",
+			  G_CALLBACK (label_draw_event_cb),
+			  NULL);
+
+	g_signal_connect_after (priv->clock_label,
+				"size-allocate",
+				G_CALLBACK (label_size_allocate_cb),
+				NULL);
+
+	gtk_window_stick (GTK_WINDOW (window));
+
+	priv->timer = drw_timer_new ();
+
+	/* Make sure we have a valid time label from the start. */
+	clock_timeout_cb (window);
+
+	priv->clock_timeout_id = g_timeout_add (1000,
+						(GSourceFunc) clock_timeout_cb,
+						window);
+#ifdef HAVE_CANBERRA_GTK
+	ca_context_play (ca_gtk_context_get (), 0, CA_PROP_EVENT_ID, "desktop-screen-lock", NULL);
+#endif
+}
+
+static void
+drw_break_window_finalize (GObject *object)
+{
+	DrwBreakWindow        *window = DRW_BREAK_WINDOW (object);
+	DrwBreakWindowPrivate *priv;
+
+	priv = window->priv;
+
+	if (priv->clock_timeout_id != 0) {
+		g_source_remove (priv->clock_timeout_id);
+	}
+
+	if (priv->postpone_timeout_id != 0) {
+		g_source_remove (priv->postpone_timeout_id);
+	}
+
+	if (priv->postpone_sensitize_id != 0) {
+		g_source_remove (priv->postpone_sensitize_id);
+	}
+
+	window->priv = NULL;
+
+	if (G_OBJECT_CLASS (drw_break_window_parent_class)->finalize) {
+		(* G_OBJECT_CLASS (drw_break_window_parent_class)->finalize) (object);
+	}
+}
+
+static void
+drw_break_window_dispose (GObject *object)
+{
+	DrwBreakWindow        *window = DRW_BREAK_WINDOW (object);
+	DrwBreakWindowPrivate *priv;
+
+	priv = window->priv;
+
+	if (priv->timer) {
+		drw_timer_destroy (priv->timer);
+		priv->timer = NULL;
+	}
+
+	if (priv->clock_timeout_id != 0) {
+		g_source_remove (priv->clock_timeout_id);
+		priv->clock_timeout_id = 0;
+	}
+
+	if (priv->postpone_timeout_id != 0) {
+		g_source_remove (priv->postpone_timeout_id);
+		priv->postpone_timeout_id = 0;
+	}
+
+	if (priv->postpone_sensitize_id != 0) {
+		g_source_remove (priv->postpone_sensitize_id);
+	}
+
+	if (G_OBJECT_CLASS (drw_break_window_parent_class)->dispose) {
+		(* G_OBJECT_CLASS (drw_break_window_parent_class)->dispose) (object);
+	}
+}
+
+GtkWidget *
+drw_break_window_new (void)
+{
+	GObject *object;
+
+	object = g_object_new (DRW_TYPE_BREAK_WINDOW,
+			       "type", GTK_WINDOW_POPUP,
+			       "skip-taskbar-hint", TRUE,
+			       "skip-pager-hint", TRUE,
+			       "focus-on-map", TRUE,
+			       NULL);
+
+	return GTK_WIDGET (object);
+}
+
+static gboolean
+postpone_sensitize_cb (DrwBreakWindow *window)
+{
+	DrwBreakWindowPrivate *priv;
+
+	priv = window->priv;
+
+	gtk_widget_set_sensitive (priv->postpone_button, TRUE);
+
+	priv->postpone_sensitize_id = 0;
+	return FALSE;
+}
+
+static gboolean
+clock_timeout_cb (DrwBreakWindow *window)
+{
+	DrwBreakWindowPrivate *priv;
+	gchar                 *txt;
+	gint                   minutes;
+	gint                   seconds;
+
+	g_return_val_if_fail (DRW_IS_BREAK_WINDOW (window), FALSE);
+
+	priv = window->priv;
+
+	seconds = 1 + priv->break_time - drw_timer_elapsed (priv->timer);
+	seconds = MAX (0, seconds);
+
+	if (seconds == 0) {
+		/* Zero this out so the finalizer doesn't try to remove the
+		 * source, which would be done in the timeout callback ==
+		 * no-no.
+		 */
+		priv->clock_timeout_id = 0;
+
+#ifdef HAVE_CANBERRA_GTK
+		ca_context_play (ca_gtk_context_get (), 0, CA_PROP_EVENT_ID, "alarm-clock-elapsed", NULL);
+#endif
+		g_signal_emit (window, signals[DONE], 0, NULL);
+
+		return FALSE;
+	}
+
+	minutes = seconds / 60;
+	seconds -= minutes * 60;
+
+	txt = g_strdup_printf ("<span size=\"25000\" foreground=\"white\"><b>%d:%02d</b></span>",
+			       minutes,
+			       seconds);
+	gtk_label_set_markup (GTK_LABEL (priv->clock_label), txt);
+	g_free (txt);
+
+	return TRUE;
+}
+
+static void
+postpone_entry_activate_cb (GtkWidget      *entry,
+			  DrwBreakWindow *window)
+{
+	const gchar *str;
+	gchar *phrase;
+	GSettings *settings = g_settings_new (TYPING_BREAK_SCHEMA);
+
+	str = gtk_entry_get_text (GTK_ENTRY (entry));
+
+	phrase = g_settings_get_string (settings, "unlock-phrase");
+	g_object_unref (settings);
+
+	if (!strcmp (str, phrase)) {
+		g_signal_emit (window, signals[POSTPONE], 0, NULL);
+		g_free (phrase);
+		return;
+	}
+
+	g_free (phrase);
+	gtk_entry_set_text (GTK_ENTRY (entry), "");
+}
+
+static gboolean
+grab_on_window (GdkWindow *window,
+		guint32    activate_time)
+{
+	GdkDisplay *display;
+	GdkSeat *seat;
+
+	display = gdk_window_get_display (window);
+	seat = gdk_display_get_default_seat (display);
+
+	return (gdk_seat_grab (seat,
+	                       window,
+	                       GDK_SEAT_CAPABILITY_ALL,
+	                       TRUE,
+	                       NULL,
+	                       NULL,
+	                       NULL,
+	                       NULL) == GDK_GRAB_SUCCESS);
+}
+
+static gboolean
+postpone_cancel_cb (DrwBreakWindow *window)
+{
+	DrwBreakWindowPrivate *priv;
+
+	priv = window->priv;
+
+	gtk_entry_set_text (GTK_ENTRY (priv->postpone_entry), "");
+	gtk_widget_hide (priv->postpone_entry);
+
+	priv->postpone_timeout_id = 0;
+
+	return FALSE;
+}
+
+static gboolean
+postpone_entry_key_press_event_cb (GtkEntry       *entry,
+				   GdkEventKey    *event,
+				   DrwBreakWindow *window)
+{
+	DrwBreakWindowPrivate *priv;
+
+	priv = window->priv;
+
+	if (event->keyval == GDK_KEY_Escape) {
+		if (priv->postpone_timeout_id) {
+			g_source_remove (priv->postpone_timeout_id);
+		}
+
+		postpone_cancel_cb (window);
+
+		return TRUE;
+	}
+
+	g_source_remove (priv->postpone_timeout_id);
+
+	priv->postpone_timeout_id = g_timeout_add_seconds (POSTPONE_CANCEL, (GSourceFunc) postpone_cancel_cb, window);
+
+	return FALSE;
+}
+
+static void
+postpone_clicked_cb (GtkWidget *button,
+		     GtkWidget *window)
+{
+	DrwBreakWindow        *bw = DRW_BREAK_WINDOW (window);
+	DrwBreakWindowPrivate *priv = bw->priv;
+	gchar                 *phrase;
+
+	/* Disable the phrase for now. */
+	phrase = NULL; /*g_settings_get_string (settings, "unlock-phrase");*/
+
+	if (!phrase || !phrase[0]) {
+		g_signal_emit (window, signals[POSTPONE], 0, NULL);
+		return;
+	}
+
+	if (gtk_widget_get_visible (priv->postpone_entry)) {
+		gtk_widget_activate (priv->postpone_entry);
+		return;
+	}
+
+	gtk_widget_show (priv->postpone_entry);
+
+	priv->postpone_timeout_id = g_timeout_add_seconds (POSTPONE_CANCEL, (GSourceFunc) postpone_cancel_cb, bw);
+
+	grab_on_window (gtk_widget_get_window (priv->postpone_entry),  gtk_get_current_event_time ());
+
+	gtk_widget_grab_focus (priv->postpone_entry);
+
+	g_signal_connect (priv->postpone_entry,
+			  "activate",
+			  G_CALLBACK (postpone_entry_activate_cb),
+			  bw);
+
+	g_signal_connect (priv->postpone_entry,
+			  "key_press_event",
+			  G_CALLBACK (postpone_entry_key_press_event_cb),
+			  bw);
+}
+
+static void
+get_layout_location (GtkLabel *label,
+                     gint     *xp,
+                     gint     *yp)
+{
+	GtkWidget      *widget;
+	GtkAllocation  widget_allocation;
+	GtkRequisition widget_requisition;
+	gfloat         xalign, yalign;
+	gint           x, y;
+	gint           xpad, ypad;
+	gint           margin_start, margin_end, margin_top, margin_bottom;
+	gint           scale;
+
+	widget = GTK_WIDGET (label);
+
+	scale = gtk_widget_get_scale_factor (widget);
+	xalign = gtk_label_get_xalign (GTK_LABEL (label));
+	yalign = gtk_label_get_yalign (GTK_LABEL (label));
+	margin_start = gtk_widget_get_margin_start (widget);
+	margin_end = gtk_widget_get_margin_end (widget);
+	margin_top = gtk_widget_get_margin_top (widget);
+	margin_bottom = gtk_widget_get_margin_bottom (widget);
+
+	xpad = margin_start + margin_end;
+	ypad = margin_top + margin_bottom;
+
+	gtk_widget_get_allocation (widget, &widget_allocation);
+	gtk_widget_get_preferred_size (widget, &widget_requisition, NULL);
+	widget_allocation.x /= scale;
+	widget_allocation.y /= scale;
+	widget_requisition.width /= scale;
+	widget_requisition.height /= scale;
+
+	if (gtk_widget_get_direction (widget) != GTK_TEXT_DIR_LTR)
+		xalign = 1.0 - xalign;
+
+	x = floor (widget_allocation.x + (int)xpad
+		   + ((widget_allocation.width - widget_requisition.width - 1) * xalign)
+		   + 0.5);
+
+	y = floor (widget_allocation.y + (int)ypad
+		   + ((widget_allocation.height - widget_requisition.height - 1) * yalign)
+		   + 0.5);
+
+	if (xp) {
+		*xp = x;
+	}
+
+	if (yp) {
+		*yp = y;
+	}
+}
+
+static gboolean
+label_draw_event_cb (GtkLabel *label,
+                     cairo_t  *cr,
+                     gpointer  user_data)
+{
+	gint       x, y;
+	GtkWidget *widget;
+
+	get_layout_location (label, &x, &y);
+
+	widget = GTK_WIDGET (label);
+
+	pango_cairo_show_layout (cr, gtk_label_get_layout (label));
+
+	gtk_render_layout (gtk_widget_get_style_context (widget),
+	                   cr,
+	                   (double)x, (double)y,
+	                   gtk_label_get_layout (label));
+
+	return TRUE;
+}
+
+static void
+label_size_allocate_cb (GtkLabel     *label,
+			GdkRectangle *allocation,
+			gpointer      user_data)
+{
+	allocation->width += 1;
+	allocation->height += 1;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/14.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/14.html new file mode 100644 index 00000000..a1b984d1 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/14.html @@ -0,0 +1,3039 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
   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
/*
+ * Copyright (C) 2007,2008 The GNOME Foundation
+ * Written by Rodney Dawes <dobey@ximian.com>
+ *            Denis Washington <denisw@svn.gnome.org>
+ *            Thomas Wood <thos@gnome.org>
+ * All Rights Reserved
+ *
+ * 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.
+ */
+
+#include "appearance.h"
+#include "mate-wp-info.h"
+#include "mate-wp-item.h"
+#include "mate-wp-xml.h"
+#include "appearance-desktop.h"
+
+#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 <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#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 <libmate-desktop/mate-bg.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+enum {
+	TARGET_URI_LIST,
+	TARGET_BGIMAGE
+};
+
+static const GtkTargetEntry drop_types[] = {
+	{"text/uri-list", 0, TARGET_URI_LIST},
+	{"property/bgimage", 0, TARGET_BGIMAGE}
+};
+
+static const GtkTargetEntry drag_types[] = {
+	{"text/uri-list", GTK_TARGET_OTHER_WIDGET, TARGET_URI_LIST}
+};
+
+static void wp_update_preview(GtkFileChooser* chooser, AppearanceData* data);
+
+static void select_item(AppearanceData* data, MateWPItem* item, gboolean scroll)
+{
+	GtkTreePath* path;
+
+	g_return_if_fail(data != NULL);
+
+	if (item == NULL)
+		return;
+
+	path = gtk_tree_row_reference_get_path(item->rowref);
+
+	gtk_icon_view_select_path(data->wp_view, path);
+
+	if (scroll)
+	{
+		gtk_icon_view_scroll_to_path(data->wp_view, path, FALSE, 0.5, 0.0);
+	}
+
+	gtk_tree_path_free(path);
+}
+
+static MateWPItem* get_selected_item(AppearanceData* data, GtkTreeIter* iter)
+{
+	MateWPItem* item = NULL;
+	GList* selected;
+
+	selected = gtk_icon_view_get_selected_items (data->wp_view);
+
+	if (selected != NULL)
+	{
+		GtkTreeIter sel_iter;
+
+		gtk_tree_model_get_iter(data->wp_model, &sel_iter, selected->data);
+
+		g_list_foreach(selected, (GFunc) gtk_tree_path_free, NULL);
+		g_list_free(selected);
+
+		if (iter)
+			*iter = sel_iter;
+
+		gtk_tree_model_get(data->wp_model, &sel_iter, 1, &item, -1);
+	}
+
+	return item;
+}
+
+static gboolean predicate (gpointer key, gpointer value, gpointer data)
+{
+  MateBG *bg = data;<--- Variable 'bg' can be declared as pointer to const
+  MateWPItem *item = value;<--- Variable 'item' can be declared as pointer to const
+
+  return item->bg == bg;
+}
+
+static void on_item_changed (MateBG *bg, AppearanceData *data) {
+  GtkTreeModel *model;
+  GtkTreeIter iter;
+  GtkTreePath *path;
+  MateWPItem *item;
+
+  item = g_hash_table_find (data->wp_hash, predicate, bg);
+
+  if (!item)
+    return;
+
+  model = gtk_tree_row_reference_get_model (item->rowref);
+  path = gtk_tree_row_reference_get_path (item->rowref);
+
+  if (gtk_tree_model_get_iter (model, &iter, path)) {
+    GdkPixbuf *pixbuf;
+
+    g_signal_handlers_block_by_func (bg, G_CALLBACK (on_item_changed), data);
+
+    pixbuf = mate_wp_item_get_thumbnail (item,
+                                          data->thumb_factory,
+                                          data->thumb_width,
+                                          data->thumb_height);
+    if (pixbuf) {
+      gtk_list_store_set (GTK_LIST_STORE (data->wp_model), &iter, 0, pixbuf, -1);
+      g_object_unref (pixbuf);
+    }
+
+    g_signal_handlers_unblock_by_func (bg, G_CALLBACK (on_item_changed), data);
+  }
+}
+
+static void
+wp_props_load_wallpaper (gchar *key,
+                         MateWPItem *item,
+                         AppearanceData *data)
+{
+  GtkTreeIter iter;
+  GtkTreePath *path;
+  GdkPixbuf *pixbuf;
+
+  if (item->deleted == TRUE)
+    return;
+
+  gtk_list_store_append (GTK_LIST_STORE (data->wp_model), &iter);
+
+  pixbuf = mate_wp_item_get_thumbnail (item, data->thumb_factory,
+                                        data->thumb_width,
+                                        data->thumb_height);
+  mate_wp_item_update_description (item);
+
+  gtk_list_store_set (GTK_LIST_STORE (data->wp_model), &iter,
+                      0, pixbuf,
+                      1, item,
+                      -1);
+
+  if (pixbuf != NULL)
+    g_object_unref (pixbuf);
+
+  path = gtk_tree_model_get_path (data->wp_model, &iter);
+  item->rowref = gtk_tree_row_reference_new (data->wp_model, path);
+  g_signal_connect (item->bg, "changed", G_CALLBACK (on_item_changed), data);
+  gtk_tree_path_free (path);
+}
+
+static MateWPItem *
+wp_add_image (AppearanceData *data,
+              const gchar *filename)
+{
+  MateWPItem *item;
+
+  if (!filename)
+    return NULL;
+
+  item = g_hash_table_lookup (data->wp_hash, filename);
+
+  if (item != NULL)
+  {
+    if (item->deleted)
+    {
+      item->deleted = FALSE;
+      wp_props_load_wallpaper (item->filename, item, data);
+    }
+  }
+  else
+  {
+    item = mate_wp_item_new (filename, data->wp_hash, data->thumb_factory);
+
+    if (item != NULL)
+    {
+      wp_props_load_wallpaper (item->filename, item, data);
+    }
+  }
+
+  return item;
+}
+
+static void
+wp_add_images (AppearanceData *data,
+               GSList *images)
+{
+  GdkWindow *window;
+  GtkWidget *w;
+  GdkCursor *cursor;
+  MateWPItem *item;
+
+  w = appearance_capplet_get_widget (data, "appearance_window");
+  window = gtk_widget_get_window (w);
+
+  item = NULL;
+  cursor = gdk_cursor_new_for_display (gdk_display_get_default (),
+                                       GDK_WATCH);
+  gdk_window_set_cursor (window, cursor);
+  g_object_unref (cursor);
+
+  while (images != NULL)
+  {
+    gchar *uri = images->data;
+
+    item = wp_add_image (data, uri);
+    images = g_slist_remove (images, uri);
+    g_free (uri);
+  }
+
+  gdk_window_set_cursor (window, NULL);
+
+  if (item != NULL)
+  {
+    select_item (data, item, TRUE);
+  }
+}
+
+static void
+wp_option_menu_set (AppearanceData *data,
+                    int value,
+                    gboolean shade_type)
+{
+  if (shade_type)
+  {
+    gtk_combo_box_set_active (GTK_COMBO_BOX (data->wp_color_menu),
+                              value);
+
+    if (value == MATE_BG_COLOR_SOLID)
+      gtk_widget_hide (data->wp_scpicker);
+    else
+      gtk_widget_show (data->wp_scpicker);
+  }
+  else
+  {
+    gtk_combo_box_set_active (GTK_COMBO_BOX (data->wp_style_menu),
+                              value);
+  }
+}
+
+static void
+wp_set_sensitivities (AppearanceData *data)
+{
+  MateWPItem *item;
+  gchar *filename = NULL;<--- Variable 'filename' can be declared as pointer to const
+
+  item = get_selected_item (data, NULL);
+
+  if (item != NULL)
+    filename = item->filename;
+
+  if (!g_settings_is_writable (data->wp_settings, WP_OPTIONS_KEY)
+      || (filename && !strcmp (filename, "(none)")))
+    gtk_widget_set_sensitive (data->wp_style_menu, FALSE);
+  else
+    gtk_widget_set_sensitive (data->wp_style_menu, TRUE);
+
+  if (!g_settings_is_writable (data->wp_settings, WP_SHADING_KEY))
+    gtk_widget_set_sensitive (data->wp_color_menu, FALSE);
+  else
+    gtk_widget_set_sensitive (data->wp_color_menu, TRUE);
+
+  if (!g_settings_is_writable (data->wp_settings, WP_PCOLOR_KEY))
+    gtk_widget_set_sensitive (data->wp_pcpicker, FALSE);
+  else
+    gtk_widget_set_sensitive (data->wp_pcpicker, TRUE);
+
+  if (!g_settings_is_writable (data->wp_settings, WP_SCOLOR_KEY))
+    gtk_widget_set_sensitive (data->wp_scpicker, FALSE);
+  else
+    gtk_widget_set_sensitive (data->wp_scpicker, TRUE);
+
+  if (!filename || !strcmp (filename, "(none)"))
+    gtk_widget_set_sensitive (data->wp_rem_button, FALSE);
+  else
+    gtk_widget_set_sensitive (data->wp_rem_button, TRUE);
+}
+
+static void
+wp_scale_type_changed (GtkComboBox *combobox,
+                       AppearanceData *data)
+{
+  MateWPItem *item;
+  GtkTreeIter iter;
+  GdkPixbuf *pixbuf;
+
+  item = get_selected_item (data, &iter);
+
+  if (item == NULL)
+    return;
+
+  item->options = gtk_combo_box_get_active (GTK_COMBO_BOX (data->wp_style_menu));
+
+  pixbuf = mate_wp_item_get_thumbnail (item, data->thumb_factory,
+                                        data->thumb_width,
+                                        data->thumb_height);
+  gtk_list_store_set (GTK_LIST_STORE (data->wp_model), &iter, 0, pixbuf, -1);
+  if (pixbuf != NULL)
+    g_object_unref (pixbuf);
+
+  if (g_settings_is_writable (data->wp_settings, WP_OPTIONS_KEY))
+  {
+    g_settings_delay (data->wp_settings);
+    g_settings_set_enum (data->wp_settings, WP_OPTIONS_KEY, item->options);
+    g_settings_apply (data->wp_settings);
+  }
+}
+
+static void
+wp_shade_type_changed (GtkWidget *combobox,
+                       AppearanceData *data)
+{
+  MateWPItem *item;
+  GtkTreeIter iter;
+  GdkPixbuf *pixbuf;
+
+  item = get_selected_item (data, &iter);
+
+  if (item == NULL)
+    return;
+
+  item->shade_type = gtk_combo_box_get_active (GTK_COMBO_BOX (data->wp_color_menu));
+
+  pixbuf = mate_wp_item_get_thumbnail (item, data->thumb_factory,
+                                        data->thumb_width,
+                                        data->thumb_height);
+  gtk_list_store_set (GTK_LIST_STORE (data->wp_model), &iter, 0, pixbuf, -1);
+  if (pixbuf != NULL)
+    g_object_unref (pixbuf);
+
+  if (g_settings_is_writable (data->wp_settings, WP_SHADING_KEY))
+  {
+    g_settings_delay (data->wp_settings);
+    g_settings_set_enum (data->wp_settings, WP_SHADING_KEY, item->shade_type);
+    g_settings_apply (data->wp_settings);
+  }
+}
+
+static void
+wp_color_changed (AppearanceData *data,
+                  gboolean update)
+{
+  MateWPItem *item;
+
+  item = get_selected_item (data, NULL);
+
+  if (item == NULL)
+    return;
+
+  gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (data->wp_pcpicker), item->pcolor);
+  gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (data->wp_scpicker), item->scolor);
+
+  if (update)
+  {
+    gchar *pcolor, *scolor;
+
+    pcolor = gdk_rgba_to_string (item->pcolor);
+    scolor = gdk_rgba_to_string (item->scolor);
+    g_settings_delay (data->wp_settings);
+    g_settings_set_string (data->wp_settings, WP_PCOLOR_KEY, pcolor);
+    g_settings_set_string (data->wp_settings, WP_SCOLOR_KEY, scolor);
+    g_settings_apply (data->wp_settings);
+    g_free (pcolor);
+    g_free (scolor);
+  }
+
+  wp_shade_type_changed (NULL, data);
+}
+
+static void
+wp_scolor_changed (GtkWidget *widget,
+                   AppearanceData *data)
+{
+  wp_color_changed (data, TRUE);
+}
+
+static void
+wp_remove_wallpaper (GtkWidget *widget,
+                     AppearanceData *data)
+{
+  MateWPItem *item;
+  GtkTreeIter iter;
+  GtkTreePath *path;
+
+  item = get_selected_item (data, &iter);
+
+  if (item)
+  {
+    item->deleted = TRUE;
+
+    if (gtk_list_store_remove (GTK_LIST_STORE (data->wp_model), &iter))
+      path = gtk_tree_model_get_path (data->wp_model, &iter);
+    else
+      path = gtk_tree_path_new_first ();
+
+    gtk_icon_view_select_path (data->wp_view, path);
+    gtk_icon_view_set_cursor (data->wp_view, path, NULL, FALSE);
+    gtk_tree_path_free (path);
+  }
+}
+
+static void
+wp_uri_changed (const gchar *uri,
+                AppearanceData *data)
+{
+  MateWPItem *item, *selected;<--- Variable 'selected' can be declared as pointer to const
+
+  item = g_hash_table_lookup (data->wp_hash, uri);
+  selected = get_selected_item (data, NULL);
+
+  if (selected != NULL && strcmp (selected->filename, uri) != 0)
+  {
+    if (item == NULL)
+      item = wp_add_image (data, uri);
+
+    if (item)
+      select_item (data, item, TRUE);
+  }
+}
+
+static void
+wp_file_changed (GSettings *settings,
+                 gchar *key,
+                 AppearanceData *data)
+{
+  gchar *uri;
+  gchar *wpfile;
+
+  uri = g_settings_get_string (settings, key);
+
+  if (g_utf8_validate (uri, -1, NULL) && g_file_test (uri, G_FILE_TEST_EXISTS))
+    wpfile = g_strdup (uri);
+  else
+    wpfile = g_filename_from_utf8 (uri, -1, NULL, NULL, NULL);
+
+  wp_uri_changed (wpfile, data);
+
+  g_free (wpfile);
+  g_free (uri);
+}
+
+static void
+wp_options_changed (GSettings *settings,
+                    gchar *key,
+                    AppearanceData *data)
+{
+  MateWPItem *item;
+
+  item = get_selected_item (data, NULL);
+
+  if (item != NULL)
+  {
+    item->options = g_settings_get_enum (settings, key);
+    wp_option_menu_set (data, item->options, FALSE);
+  }
+}
+
+static void
+wp_shading_changed (GSettings *settings,
+                    gchar *key,
+                    AppearanceData *data)
+{
+  MateWPItem *item;
+
+  wp_set_sensitivities (data);
+
+  item = get_selected_item (data, NULL);
+
+  if (item != NULL)
+  {
+    item->shade_type = g_settings_get_enum (settings, key);
+    wp_option_menu_set (data, item->shade_type, TRUE);
+  }
+}
+
+static void
+wp_color1_changed (GSettings *settings,
+                   gchar *key,
+                   AppearanceData *data)
+{
+  GdkRGBA color;
+  gchar *colorhex;
+
+  colorhex = g_settings_get_string (settings, key);
+
+  gdk_rgba_parse (&color, colorhex);
+
+  gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (data->wp_pcpicker), &color);
+
+  wp_color_changed (data, FALSE);
+
+  g_free (colorhex);
+}
+
+static void
+wp_color2_changed (GSettings *settings,
+                   gchar *key,
+                   AppearanceData *data)
+{
+  GdkRGBA color;
+  gchar *colorhex;
+
+  wp_set_sensitivities (data);
+
+  colorhex = g_settings_get_string (settings, key);
+
+  gdk_rgba_parse (&color, colorhex);
+
+  gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (data->wp_scpicker), &color);
+
+  wp_color_changed (data, FALSE);
+
+  g_free (colorhex);
+}
+
+static gboolean
+wp_props_wp_set (AppearanceData *data, MateWPItem *item)
+{
+  gchar *pcolor, *scolor;
+
+  g_settings_delay (data->wp_settings);
+
+  if (!strcmp (item->filename, "(none)"))
+  {
+    g_settings_set_enum (data->wp_settings, WP_OPTIONS_KEY, 0);
+    g_settings_set_string (data->wp_settings, WP_FILE_KEY, "");
+  }
+  else
+  {
+    gchar *uri;
+
+    if (g_utf8_validate (item->filename, -1, NULL))
+      uri = g_strdup (item->filename);
+    else
+      uri = g_filename_to_utf8 (item->filename, -1, NULL, NULL, NULL);
+
+    if (uri == NULL) {
+      g_warning ("Failed to convert filename to UTF-8: %s", item->filename);
+    } else {
+      g_settings_set_string (data->wp_settings, WP_FILE_KEY, uri);
+      g_free (uri);
+    }
+
+    g_settings_set_enum (data->wp_settings, WP_OPTIONS_KEY, item->options);
+  }
+
+  g_settings_set_enum (data->wp_settings, WP_SHADING_KEY, item->shade_type);
+
+  pcolor = gdk_rgba_to_string (item->pcolor);
+  scolor = gdk_rgba_to_string (item->scolor);
+  g_settings_set_string (data->wp_settings, WP_PCOLOR_KEY, pcolor);
+  g_settings_set_string (data->wp_settings, WP_SCOLOR_KEY, scolor);
+  g_free (pcolor);
+  g_free (scolor);
+
+  g_settings_apply (data->wp_settings);
+
+  return FALSE;
+}
+
+static void
+wp_props_wp_selected (GtkTreeSelection *selection,
+                      AppearanceData *data)
+{
+  MateWPItem *item;
+
+  item = get_selected_item (data, NULL);
+
+  if (item != NULL)
+  {
+    wp_set_sensitivities (data);
+
+    if (strcmp (item->filename, "(none)") != 0)
+      wp_option_menu_set (data, item->options, FALSE);
+
+    wp_option_menu_set (data, item->shade_type, TRUE);
+
+    gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (data->wp_pcpicker),
+                                item->pcolor);
+    gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (data->wp_scpicker),
+                                item->scolor);
+
+    wp_props_wp_set (data, item);
+  }
+  else
+  {
+    gtk_widget_set_sensitive (data->wp_rem_button, FALSE);
+  }
+}
+
+static void
+wp_create_filechooser (AppearanceData *data)
+{
+  const char *start_dir, *pictures = NULL;
+  GtkFileFilter *filter;
+
+  data->wp_filesel = GTK_FILE_CHOOSER (
+                     gtk_file_chooser_dialog_new (_("Add Wallpaper"),
+                     GET_WINDOW ("appearance_window"),
+                     GTK_FILE_CHOOSER_ACTION_OPEN,
+                     "gtk-cancel",
+                     GTK_RESPONSE_CANCEL,
+                     "gtk-open",
+                     GTK_RESPONSE_OK,
+                     NULL));
+
+  gtk_dialog_set_default_response (GTK_DIALOG (data->wp_filesel), GTK_RESPONSE_OK);
+  gtk_file_chooser_set_select_multiple (data->wp_filesel, TRUE);
+  gtk_file_chooser_set_use_preview_label (data->wp_filesel, FALSE);
+
+  start_dir = g_get_home_dir ();
+
+  if (g_file_test (BACKGROUND_DATADIR, G_FILE_TEST_IS_DIR)) {
+    gtk_file_chooser_add_shortcut_folder (data->wp_filesel,
+                                          BACKGROUND_DATADIR, NULL);
+    start_dir = BACKGROUND_DATADIR;
+  }
+
+  pictures = g_get_user_special_dir (G_USER_DIRECTORY_PICTURES);
+  if (pictures != NULL && g_file_test (pictures, G_FILE_TEST_IS_DIR)) {
+    gtk_file_chooser_add_shortcut_folder (data->wp_filesel, pictures, NULL);
+    start_dir = pictures;
+  }
+
+  gtk_file_chooser_set_current_folder (data->wp_filesel, start_dir);
+
+  filter = gtk_file_filter_new ();
+  gtk_file_filter_add_pixbuf_formats (filter);
+  gtk_file_filter_set_name (filter, _("Images"));
+  gtk_file_chooser_add_filter (data->wp_filesel, filter);
+
+  filter = gtk_file_filter_new ();
+  gtk_file_filter_set_name (filter, _("All files"));
+  gtk_file_filter_add_pattern (filter, "*");
+  gtk_file_chooser_add_filter (data->wp_filesel, filter);
+
+  data->wp_image = gtk_image_new ();
+  gtk_file_chooser_set_preview_widget (data->wp_filesel, data->wp_image);
+  gtk_widget_set_size_request (data->wp_image, 128, -1);
+
+  gtk_widget_show (data->wp_image);
+
+  g_signal_connect (data->wp_filesel, "update-preview",
+                    (GCallback) wp_update_preview, data);
+}
+
+static void
+wp_file_open_dialog (GtkWidget *widget,
+                     AppearanceData *data)
+{
+  GSList *files;
+
+  if (!data->wp_filesel)
+    wp_create_filechooser (data);
+
+  switch (gtk_dialog_run (GTK_DIALOG (data->wp_filesel)))
+  {
+  case GTK_RESPONSE_OK:
+    files = gtk_file_chooser_get_filenames (data->wp_filesel);
+    wp_add_images (data, files);
+  case GTK_RESPONSE_CANCEL:
+  default:
+    gtk_widget_hide (GTK_WIDGET (data->wp_filesel));
+    break;
+  }
+}
+
+static void
+wp_drag_received (GtkWidget *widget,
+                  GdkDragContext *context,
+                  gint x, gint y,
+                  GtkSelectionData *selection_data,
+                  guint info, guint time,
+                  AppearanceData *data)
+{
+  if (info == TARGET_URI_LIST || info == TARGET_BGIMAGE)
+  {
+    GSList *realuris = NULL;
+    gchar **uris;
+
+    uris = g_uri_list_extract_uris ((gchar *) gtk_selection_data_get_data (selection_data));
+    if (uris != NULL)
+    {
+      GtkWidget *w;
+      GdkWindow *window;
+      GdkCursor *cursor;
+      gchar **uri;
+
+      w = appearance_capplet_get_widget (data, "appearance_window");
+      window = gtk_widget_get_window (w);
+
+      cursor = gdk_cursor_new_for_display (gdk_display_get_default (),
+             GDK_WATCH);
+      gdk_window_set_cursor (window, cursor);
+      g_object_unref (cursor);
+
+      for (uri = uris; *uri; ++uri)
+      {
+        GFile *f;
+
+        f = g_file_new_for_uri (*uri);
+        realuris = g_slist_append (realuris, g_file_get_path (f));
+        g_object_unref (f);
+      }
+
+      wp_add_images (data, realuris);
+      gdk_window_set_cursor (window, NULL);
+
+      g_strfreev (uris);
+    }
+  }
+}
+
+static void
+wp_drag_get_data (GtkWidget *widget,
+		  GdkDragContext *context,
+		  GtkSelectionData *selection_data,
+		  guint type, guint time,
+		  AppearanceData *data)
+{
+  if (type == TARGET_URI_LIST) {
+    MateWPItem *item = get_selected_item (data, NULL);
+
+    if (item != NULL) {
+      char *uris[2];
+
+      uris[0] = g_filename_to_uri (item->filename, NULL, NULL);
+      uris[1] = NULL;
+
+      gtk_selection_data_set_uris (selection_data, uris);
+
+      g_free (uris[0]);
+    }
+  }
+}
+
+static gboolean
+wp_view_tooltip_cb (GtkWidget  *widget,
+                    gint x,
+                    gint y,
+                    gboolean keyboard_mode,
+                    GtkTooltip *tooltip,
+                    AppearanceData *data)
+{
+  GtkTreeIter iter;
+  MateWPItem *item;
+
+  if (gtk_icon_view_get_tooltip_context (data->wp_view,
+                                         &x, &y,
+                                         keyboard_mode,
+                                         NULL,
+                                         NULL,
+                                         &iter))
+    {
+      gtk_tree_model_get (data->wp_model, &iter, 1, &item, -1);
+      gtk_tooltip_set_markup (tooltip, item->description);
+
+      return TRUE;
+    }
+
+  return FALSE;
+}
+
+static gint
+wp_list_sort (GtkTreeModel *model,
+              GtkTreeIter *a, GtkTreeIter *b,
+              AppearanceData *data)
+{
+  MateWPItem *itema, *itemb;
+  gint retval;
+
+  gtk_tree_model_get (model, a, 1, &itema, -1);
+  gtk_tree_model_get (model, b, 1, &itemb, -1);
+
+  if (!strcmp (itema->filename, "(none)"))
+  {
+    retval =  -1;
+  }
+  else if (!strcmp (itemb->filename, "(none)"))
+  {
+    retval =  1;
+  }
+  else
+  {
+    retval = g_utf8_collate (itema->description, itemb->description);
+  }
+
+  return retval;
+}
+
+static void
+wp_update_preview (GtkFileChooser *chooser,
+                   AppearanceData *data)
+{
+  gchar *uri;
+
+  uri = gtk_file_chooser_get_preview_uri (chooser);
+
+  if (uri)
+  {
+    GdkPixbuf *pixbuf = NULL;
+    gchar *mime_type = NULL;
+    GFile *file;
+    GFileInfo *file_info;
+
+    file = g_file_new_for_uri (uri);
+    file_info = g_file_query_info (file,
+                                   G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+                                   G_FILE_QUERY_INFO_NONE,
+                                   NULL, NULL);
+    g_object_unref (file);
+
+    if (file_info != NULL)
+    {
+      const gchar *content_type;
+
+      if ((content_type = g_file_info_get_content_type (file_info)) != NULL)
+        mime_type = g_content_type_get_mime_type (content_type);
+      g_object_unref (file_info);
+    }
+
+    if (mime_type)
+    {
+      pixbuf = mate_desktop_thumbnail_factory_generate_thumbnail (data->thumb_factory,
+                                                                  uri,
+                                                                  mime_type);
+      g_free (mime_type);
+    }
+
+    if (pixbuf != NULL)
+    {
+      gtk_image_set_from_pixbuf (GTK_IMAGE (data->wp_image), pixbuf);
+      g_object_unref (pixbuf);
+    }
+    else
+    {
+      gtk_image_set_from_icon_name (GTK_IMAGE (data->wp_image),
+                                    "dialog-question",
+                                    GTK_ICON_SIZE_DIALOG);
+    }
+  }
+
+  gtk_file_chooser_set_preview_widget_active (chooser, TRUE);
+}
+
+static gboolean
+reload_item (GtkTreeModel *model,
+             GtkTreePath *path,
+             GtkTreeIter *iter,
+             AppearanceData *data)
+{
+  MateWPItem *item;
+  GdkPixbuf *pixbuf;
+
+  gtk_tree_model_get (model, iter, 1, &item, -1);
+
+  pixbuf = mate_wp_item_get_thumbnail (item,
+                                        data->thumb_factory,
+                                        data->thumb_width,
+                                        data->thumb_height);
+  if (pixbuf) {
+    gtk_list_store_set (GTK_LIST_STORE (data->wp_model), iter, 0, pixbuf, -1);
+    g_object_unref (pixbuf);
+  }
+
+  return FALSE;
+}
+
+static gdouble
+get_monitor_aspect_ratio_for_widget (GtkWidget *widget)
+{
+  gdouble aspect;
+  GdkMonitor *monitor;
+  GdkRectangle rect;
+
+  monitor = gdk_display_get_monitor_at_window (gtk_widget_get_display (widget), gtk_widget_get_window (widget));
+  gdk_monitor_get_geometry (monitor, &rect);
+
+  aspect = rect.height / (gdouble)rect.width;
+
+  return aspect;
+}
+
+#define LIST_IMAGE_SIZE 108
+
+static void
+compute_thumbnail_sizes (AppearanceData *data)
+{
+  gdouble aspect;
+
+  aspect = get_monitor_aspect_ratio_for_widget (GTK_WIDGET (data->wp_view));
+  if (aspect > 1) {
+    /* portrait */
+    data->thumb_width = LIST_IMAGE_SIZE / aspect;
+    data->thumb_height = LIST_IMAGE_SIZE;
+  } else {
+    data->thumb_width = LIST_IMAGE_SIZE;
+    data->thumb_height = LIST_IMAGE_SIZE * aspect;
+  }
+}
+
+static void
+reload_wallpapers (AppearanceData *data)
+{
+  compute_thumbnail_sizes (data);
+  gtk_tree_model_foreach (data->wp_model, (GtkTreeModelForeachFunc)reload_item, data);
+}
+
+static gboolean
+wp_load_stuffs (void *user_data)
+{
+  AppearanceData *data;
+  gchar *imagepath, *uri, *style;
+  MateWPItem *item;
+
+  data = (AppearanceData *) user_data;
+
+  compute_thumbnail_sizes (data);
+
+  mate_wp_xml_load_list (data);
+  g_hash_table_foreach (data->wp_hash, (GHFunc) wp_props_load_wallpaper,
+                        data);
+
+  style = g_settings_get_string (data->wp_settings,
+                                   WP_OPTIONS_KEY);
+  if (style == NULL)
+    style = g_strdup ("none");
+
+  uri = g_settings_get_string (data->wp_settings,
+                                 WP_FILE_KEY);
+
+  if (uri && *uri == '\0')
+  {
+    g_free (uri);
+    uri = NULL;
+  }
+
+  if (uri == NULL)
+    uri = g_strdup ("(none)");
+
+  if (g_utf8_validate (uri, -1, NULL) && g_file_test (uri, G_FILE_TEST_EXISTS))
+    imagepath = g_strdup (uri);
+  else
+    imagepath = g_filename_from_utf8 (uri, -1, NULL, NULL, NULL);
+
+  g_free (uri);
+
+  item = g_hash_table_lookup (data->wp_hash, imagepath);
+
+  if (item != NULL)
+  {
+    /* update with the current gsettings */
+    mate_wp_item_update (item);
+
+    if (strcmp (style, "none") != 0)
+    {
+      if (item->deleted == TRUE)
+      {
+        item->deleted = FALSE;
+        wp_props_load_wallpaper (item->filename, item, data);
+      }
+
+      select_item (data, item, FALSE);
+    }
+  }
+  else if (strcmp (style, "none") != 0)
+  {
+    item = wp_add_image (data, imagepath);
+    if (item)
+      select_item (data, item, FALSE);
+  }
+
+  item = g_hash_table_lookup (data->wp_hash, "(none)");
+  if (item == NULL)
+  {
+    item = mate_wp_item_new ("(none)", data->wp_hash, data->thumb_factory);
+    if (item != NULL)
+    {
+      wp_props_load_wallpaper (item->filename, item, data);
+    }
+  }
+  else
+  {
+    if (item->deleted == TRUE)
+    {
+      item->deleted = FALSE;
+      wp_props_load_wallpaper (item->filename, item, data);
+    }
+
+    if (!strcmp (style, "none"))
+    {
+      select_item (data, item, FALSE);
+      wp_option_menu_set (data, MATE_BG_PLACEMENT_SCALED, FALSE);
+    }
+  }
+  g_free (imagepath);
+  g_free (style);
+
+  if (data->wp_uris) {
+    wp_add_images (data, data->wp_uris);
+    data->wp_uris = NULL;
+  }
+
+  return FALSE;
+}
+
+static void
+wp_select_after_realize (GtkWidget *widget,
+                         AppearanceData *data)
+{
+  MateWPItem *item;
+
+  g_idle_add (wp_load_stuffs, data);
+
+  item = get_selected_item (data, NULL);
+  if (item == NULL)
+    item = g_hash_table_lookup (data->wp_hash, "(none)");
+
+  select_item (data, item, TRUE);
+}
+
+static GdkPixbuf *buttons[3];
+
+static void
+create_button_images (AppearanceData  *data)
+{
+  GtkIconTheme *theme;
+  GdkPixbuf    *pixbuf, *pb, *pb2;
+  gint          i, w, h;
+
+  theme = gtk_icon_theme_get_default ();
+  pb = gtk_icon_theme_load_icon (theme,
+                                 "media-playback-start",
+                                 GTK_ICON_SIZE_MENU,
+                                 GTK_ICON_LOOKUP_DIR_RTL,
+                                 NULL);
+
+  pb2 = gtk_icon_theme_load_icon (theme,
+                                  "media-playback-start",
+                                  GTK_ICON_SIZE_MENU,
+                                  GTK_ICON_LOOKUP_DIR_LTR,
+                                  NULL);
+  w = gdk_pixbuf_get_width (pb);
+  h = gdk_pixbuf_get_height (pb);
+
+  for (i = 0; i < 3; i++) {
+    pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, 2 * w, h);
+    gdk_pixbuf_fill (pixbuf, 0);
+    if (i > 0)
+      gdk_pixbuf_composite (pb, pixbuf, 0, 0, w, h, 0, 0, 1, 1, GDK_INTERP_NEAREST, 255);
+    if (i < 2)
+      gdk_pixbuf_composite (pb2, pixbuf, w, 0, w, h, w, 0, 1, 1, GDK_INTERP_NEAREST, 255);
+
+    buttons[i] = pixbuf;
+  }
+
+  g_object_unref (pb);
+  g_object_unref (pb2);
+}
+
+static void
+next_frame (AppearanceData  *data,
+            GtkCellRenderer *cr,
+            gint             direction)
+{
+  MateWPItem *item;
+  GtkTreeIter iter;
+  GdkPixbuf *pixbuf, *pb;
+  gint frame;
+
+  pixbuf = NULL;
+
+  frame = data->frame + direction;
+  item = get_selected_item (data, &iter);
+
+  if (frame >= 0)
+    pixbuf = mate_wp_item_get_frame_thumbnail (item,
+                                                data->thumb_factory,
+                                                data->thumb_width,
+                                                data->thumb_height,
+                                                frame);
+  if (pixbuf) {
+    gtk_list_store_set (GTK_LIST_STORE (data->wp_model), &iter, 0, pixbuf, -1);
+    g_object_unref (pixbuf);
+    data->frame = frame;
+  }
+
+  pb = buttons[1];
+  if (direction < 0) {
+    if (frame == 0)
+      pb = buttons[0];
+  }
+  else {
+    pixbuf = mate_wp_item_get_frame_thumbnail (item,
+                                                data->thumb_factory,
+                                                data->thumb_width,
+                                                data->thumb_height,
+                                                frame + 1);
+    if (pixbuf)
+      g_object_unref (pixbuf);
+    else
+      pb = buttons[2];
+  }
+  g_object_set (cr, "pixbuf", pb, NULL);
+}
+
+static gboolean
+wp_button_press_cb (GtkWidget      *widget,
+                    GdkEventButton *event,
+                    AppearanceData *data)
+{
+  GtkCellRenderer *cell;
+  GdkEventButton *button_event = (GdkEventButton *) event;
+
+  if (event->type != GDK_BUTTON_PRESS)
+    return FALSE;
+
+  if (gtk_icon_view_get_item_at_pos (GTK_ICON_VIEW (widget),
+                                     button_event->x, button_event->y,
+                                     NULL, &cell)) {
+    if (g_object_get_data (G_OBJECT (cell), "buttons")) {
+      gint w, h;
+      GtkCellRenderer *cell2 = NULL;
+      gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &w, &h);
+      if (gtk_icon_view_get_item_at_pos (GTK_ICON_VIEW (widget),
+                                         button_event->x + w, button_event->y,
+                                         NULL, &cell2) && cell == cell2)
+        next_frame (data, cell, -1);
+      else
+        next_frame (data, cell, 1);
+      return TRUE;
+    }
+  }
+
+  return FALSE;
+}
+
+static void
+wp_selected_changed_cb (GtkIconView    *view,
+                        AppearanceData *data)
+{
+  GtkCellRenderer *cr;
+  GList *cells, *l;
+
+  data->frame = -1;
+
+  cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (data->wp_view));
+  for (l = cells; l; l = l->next) {
+    cr = l->data;
+    if (g_object_get_data (G_OBJECT (cr), "buttons"))
+      g_object_set (cr, "pixbuf", buttons[0], NULL);
+  }
+  g_list_free (cells);
+}
+
+static void
+buttons_cell_data_func (GtkCellLayout   *layout,
+                        GtkCellRenderer *cell,
+                        GtkTreeModel    *model,
+                        GtkTreeIter     *iter,
+                        gpointer         user_data)
+{
+  AppearanceData *data = user_data;
+  GtkTreePath *path;
+  MateWPItem *item;
+  gboolean visible;
+
+  path = gtk_tree_model_get_path (model, iter);
+
+  if (gtk_icon_view_path_is_selected (GTK_ICON_VIEW (layout), path)) {
+    item = get_selected_item (data, NULL);
+    visible = mate_bg_changes_with_time (item->bg);
+  }
+  else
+    visible = FALSE;
+
+  g_object_set (G_OBJECT (cell), "visible", visible, NULL);
+
+  gtk_tree_path_free (path);
+}
+
+static void
+screen_monitors_changed (GdkScreen *screen,
+                         AppearanceData *data)
+{
+  reload_wallpapers (data);
+}
+
+void
+desktop_init (AppearanceData *data,
+	      const gchar **uris)
+{
+  GtkWidget *add_button, *w;
+  GtkCellRenderer *cr;
+  char *url;
+
+  data->wp_uris = NULL;
+  if (uris != NULL) {
+    while (*uris != NULL) {
+      data->wp_uris = g_slist_append (data->wp_uris, g_strdup (*uris));
+      uris++;
+    }
+  }
+
+  w = appearance_capplet_get_widget (data, "more_backgrounds_linkbutton");
+  url = g_settings_get_string (data->settings, MORE_BACKGROUNDS_URL_KEY);
+  if (url != NULL && url[0] != '\0') {
+    gtk_link_button_set_uri (GTK_LINK_BUTTON (w), url);
+    gtk_widget_show (w);
+  } else {
+    gtk_widget_hide (w);
+  }
+  g_free (url);
+
+  data->wp_hash = g_hash_table_new (g_str_hash, g_str_equal);
+
+  g_signal_connect (data->wp_settings,
+                           "changed::" WP_FILE_KEY,
+                           G_CALLBACK (wp_file_changed),
+                           data);
+  g_signal_connect (data->wp_settings,
+                           "changed::" WP_OPTIONS_KEY,
+                           G_CALLBACK (wp_options_changed),
+                           data);
+  g_signal_connect (data->wp_settings,
+                           "changed::" WP_SHADING_KEY,
+                           G_CALLBACK (wp_shading_changed),
+                           data);
+  g_signal_connect (data->wp_settings,
+                           "changed::" WP_PCOLOR_KEY,
+                           G_CALLBACK (wp_color1_changed),
+                           data);
+  g_signal_connect (data->wp_settings,
+                           "changed::" WP_SCOLOR_KEY,
+                           G_CALLBACK (wp_color2_changed),
+                           data);
+
+  data->wp_model = GTK_TREE_MODEL (gtk_list_store_new (2, GDK_TYPE_PIXBUF,
+                                                       G_TYPE_POINTER));
+
+  data->wp_view = GTK_ICON_VIEW (appearance_capplet_get_widget (data, "wp_view"));
+  gtk_icon_view_set_model (data->wp_view, GTK_TREE_MODEL (data->wp_model));
+
+  g_signal_connect_after (data->wp_view, "realize",
+                          (GCallback) wp_select_after_realize, data);
+
+  gtk_cell_layout_clear (GTK_CELL_LAYOUT (data->wp_view));
+
+  cr = gtk_cell_renderer_pixbuf_new ();
+  g_object_set (cr, "xpad", 5, "ypad", 5, NULL);
+
+  gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (data->wp_view), cr, TRUE);
+  gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (data->wp_view), cr,
+                                  "pixbuf", 0,
+                                  NULL);
+
+  cr = gtk_cell_renderer_pixbuf_new ();
+  create_button_images (data);
+  g_object_set (cr,
+                "mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE,
+                "pixbuf", buttons[0],
+                NULL);
+  g_object_set_data (G_OBJECT (cr), "buttons", GINT_TO_POINTER (TRUE));
+
+  gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (data->wp_view), cr, FALSE);
+  gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (data->wp_view), cr,
+                                      buttons_cell_data_func, data, NULL);
+  g_signal_connect (data->wp_view, "selection-changed",
+                    (GCallback) wp_selected_changed_cb, data);
+  g_signal_connect (data->wp_view, "button-press-event",
+                    G_CALLBACK (wp_button_press_cb), data);
+
+  data->frame = -1;
+
+  gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (data->wp_model), 1,
+                                   (GtkTreeIterCompareFunc) wp_list_sort,
+                                   data, NULL);
+
+  gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (data->wp_model),
+                                        1, GTK_SORT_ASCENDING);
+
+  gtk_drag_dest_set (GTK_WIDGET (data->wp_view), GTK_DEST_DEFAULT_ALL, drop_types,
+                     G_N_ELEMENTS (drop_types), GDK_ACTION_COPY | GDK_ACTION_MOVE);
+  g_signal_connect (data->wp_view, "drag_data_received",
+                    (GCallback) wp_drag_received, data);
+
+  gtk_drag_source_set (GTK_WIDGET (data->wp_view), GDK_BUTTON1_MASK,
+                       drag_types, G_N_ELEMENTS (drag_types), GDK_ACTION_COPY);
+  g_signal_connect (data->wp_view, "drag-data-get",
+		    (GCallback) wp_drag_get_data, data);
+
+  data->wp_style_menu = appearance_capplet_get_widget (data, "wp_style_menu");
+
+  g_signal_connect (data->wp_style_menu, "changed",
+                    (GCallback) wp_scale_type_changed, data);
+
+  data->wp_color_menu = appearance_capplet_get_widget (data, "wp_color_menu");
+
+  g_signal_connect (data->wp_color_menu, "changed",
+                    (GCallback) wp_shade_type_changed, data);
+
+  data->wp_scpicker = appearance_capplet_get_widget (data, "wp_scpicker");
+
+  g_signal_connect (data->wp_scpicker, "color-set",
+                    (GCallback) wp_scolor_changed, data);
+
+  data->wp_pcpicker = appearance_capplet_get_widget (data, "wp_pcpicker");
+
+  g_signal_connect (data->wp_pcpicker, "color-set",
+                    (GCallback) wp_scolor_changed, data);
+
+  add_button = appearance_capplet_get_widget (data, "wp_add_button");
+
+  g_signal_connect (add_button, "clicked",
+                    (GCallback) wp_file_open_dialog, data);
+
+  data->wp_rem_button = appearance_capplet_get_widget (data, "wp_rem_button");
+
+  g_signal_connect (data->wp_rem_button, "clicked",
+                    (GCallback) wp_remove_wallpaper, data);
+  data->screen_monitors_handler = g_signal_connect (gtk_widget_get_screen (GTK_WIDGET (data->wp_view)),
+                                                    "monitors-changed",
+                                                    G_CALLBACK (screen_monitors_changed),
+                                                    data);
+  data->screen_size_handler = g_signal_connect (gtk_widget_get_screen (GTK_WIDGET (data->wp_view)),
+                                                    "size-changed",
+                                                    G_CALLBACK (screen_monitors_changed),
+                                                    data);
+
+  g_signal_connect (data->wp_view, "selection-changed",
+                    (GCallback) wp_props_wp_selected, data);
+  g_signal_connect (data->wp_view, "query-tooltip",
+                    (GCallback) wp_view_tooltip_cb, data);
+  gtk_widget_set_has_tooltip (GTK_WIDGET (data->wp_view), TRUE);
+
+  wp_set_sensitivities (data);
+
+  /* create the file selector later to save time on startup */
+  data->wp_filesel = NULL;
+
+}
+
+void
+desktop_shutdown (AppearanceData *data)
+{
+  mate_wp_xml_save_list (data);
+
+  if (data->screen_monitors_handler > 0) {
+    g_signal_handler_disconnect (gtk_widget_get_screen (GTK_WIDGET (data->wp_view)),
+                                 data->screen_monitors_handler);
+    data->screen_monitors_handler = 0;
+  }
+  if (data->screen_size_handler > 0) {
+    g_signal_handler_disconnect (gtk_widget_get_screen (GTK_WIDGET (data->wp_view)),
+                                 data->screen_size_handler);
+    data->screen_size_handler = 0;
+  }
+
+  g_slist_free_full (data->wp_uris, g_free);
+  if (data->wp_filesel)
+  {
+    g_object_ref_sink (data->wp_filesel);
+    g_object_unref (data->wp_filesel);
+  }
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/140.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/140.html new file mode 100644 index 00000000..4a60c398 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/140.html @@ -0,0 +1,295 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2003 Richard Hult <richard@imendio.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 __DRW_UTILS_H__
+#define __DRW_UTILS_H__
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+void drw_setup_background (GtkWidget *window);
+
+
+#endif /* __DRW_UTILS_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/141.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/141.html new file mode 100644 index 00000000..6a76983f --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/141.html @@ -0,0 +1,349 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2002 CodeFactory AB
+ * Copyright (C) 2002 Richard Hult <richard@imendio.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 __DRW_BREAK_WINDOW_H__
+#define __DRW_BREAK_WINDOW_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.
+
+G_BEGIN_DECLS
+
+#define DRW_TYPE_BREAK_WINDOW         (drw_break_window_get_type ())
+#define DRW_BREAK_WINDOW(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), DRW_TYPE_BREAK_WINDOW, DrwBreakWindow))
+#define DRW_BREAK_WINDOW_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), DRW_TYPE_BREAK_WINDOW, DrwBreakWindowClass))
+#define DRW_IS_BREAK_WINDOW(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), DRW_TYPE_BREAK_WINDOW))
+#define DRW_IS_BREAK_WINDOW_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), DRW_TYPE_BREAK_WINDOW))
+#define DRW_BREAK_WINDOW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), DRW_TYPE_BREAK_WINDOW, DrwBreakWindowClass))
+
+typedef struct _DrwBreakWindow         DrwBreakWindow;
+typedef struct _DrwBreakWindowClass    DrwBreakWindowClass;
+typedef struct _DrwBreakWindowPrivate  DrwBreakWindowPrivate;
+
+struct _DrwBreakWindow {
+        GtkWindow              parent;
+
+        DrwBreakWindowPrivate *priv;
+};
+
+struct _DrwBreakWindowClass {
+        GtkWindowClass parent_class;
+};
+
+GType       drw_break_window_get_type (void) G_GNUC_CONST;
+GtkWidget * drw_break_window_new      (void);
+
+G_END_DECLS
+
+#endif /* __DRW_BREAK_WINDOW_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/142.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/142.html new file mode 100644 index 00000000..62614d39 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/142.html @@ -0,0 +1,633 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2002 CodeFactory AB
+ * Copyright (C) 2002 Richard Hult <richard@imendio.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.
+ */
+
+#include <config.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.
+#include <gdk/gdkx.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 <unistd.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/ioctl.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <fcntl.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 <time.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/stat.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <X11/Xlib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <X11/extensions/scrnsaver.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "drw-monitor.h"
+
+struct _DrwMonitorPriv {
+	XScreenSaverInfo *ss_info;
+	guint             timeout_id;
+	unsigned long     last_idle;
+
+	time_t            last_activity;
+};
+
+/* Signals */
+enum {
+	ACTIVITY,
+	LAST_SIGNAL
+};
+
+static void     drw_monitor_class_init    (DrwMonitorClass *klass);
+static void     drw_monitor_init          (DrwMonitor      *monitor);
+static void     drw_monitor_finalize      (GObject         *object);
+static gboolean drw_monitor_setup         (DrwMonitor      *monitor);
+
+static GObjectClass *parent_class;
+static guint signals[LAST_SIGNAL] = { 0 };
+
+GType
+drw_monitor_get_type (void)
+{
+	static GType object_type = 0;
+
+	if (!object_type) {
+		static const GTypeInfo object_info = {
+			sizeof (DrwMonitorClass),
+			NULL,		/* base_init */
+			NULL,		/* base_finalize */
+			(GClassInitFunc) drw_monitor_class_init,
+			NULL,		/* class_finalize */
+			NULL,		/* class_data */
+			sizeof (DrwMonitor),
+			0,              /* n_preallocs */
+			(GInstanceInitFunc) drw_monitor_init,
+			NULL
+		};
+
+		object_type = g_type_register_static (G_TYPE_OBJECT,
+                                                      "DrwMonitor",
+                                                      &object_info, 0);
+	}
+
+	return object_type;
+}
+
+static void
+drw_monitor_class_init (DrwMonitorClass *klass)
+{
+        GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+        parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass));
+
+        object_class->finalize = drw_monitor_finalize;
+
+	signals[ACTIVITY] =
+		g_signal_new ("activity",
+			      G_TYPE_FROM_CLASS (klass),
+			      G_SIGNAL_RUN_LAST,
+			      0,
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE, 0);
+}
+
+static void
+drw_monitor_init (DrwMonitor *monitor)
+{
+        DrwMonitorPriv *priv;
+
+        priv = g_new0 (DrwMonitorPriv, 1);
+        monitor->priv = priv;
+
+	drw_monitor_setup (monitor);
+}
+
+static void
+drw_monitor_finalize (GObject *object)
+{
+        DrwMonitor     *monitor = DRW_MONITOR (object);
+        DrwMonitorPriv *priv;
+
+        priv = monitor->priv;
+
+	g_source_remove (priv->timeout_id);
+	priv->timeout_id = 0;
+
+	if (priv->ss_info) {
+		XFree (priv->ss_info);
+	}
+
+	g_free (priv);
+	monitor->priv = NULL;
+
+        if (G_OBJECT_CLASS (parent_class)->finalize) {
+                (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+        }
+}
+
+static gboolean
+drw_monitor_timeout (DrwMonitor *monitor)
+{
+	DrwMonitorPriv *priv;
+ 	time_t          now;
+
+	priv = monitor->priv;
+
+	if (XScreenSaverQueryInfo (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), DefaultRootWindow (GDK_DISPLAY_XDISPLAY(gdk_display_get_default())), priv->ss_info) != 0) {
+		if (priv->ss_info->idle < priv->last_idle) {
+ 			now = time (NULL);
+
+ 			if (now - priv->last_activity < 25) {
+ 				g_signal_emit (monitor, signals[ACTIVITY], 0, NULL);
+ 			}
+
+ 			priv->last_activity = now;
+		}
+
+		priv->last_idle = priv->ss_info->idle;
+	}
+
+	return TRUE;
+}
+
+static gboolean
+drw_monitor_setup (DrwMonitor *monitor)
+{
+	DrwMonitorPriv *priv;
+	int             event_base;
+	int             error_base;
+
+	priv = monitor->priv;
+
+	if (!XScreenSaverQueryExtension (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), &event_base, &error_base)) {
+		return FALSE;
+	}
+
+	priv->ss_info = XScreenSaverAllocInfo ();
+
+	priv->last_activity = time (NULL);
+
+	priv->timeout_id = g_timeout_add_seconds (3, (GSourceFunc) drw_monitor_timeout, monitor);
+
+	return TRUE;
+}
+
+DrwMonitor *
+drw_monitor_new (void)
+{
+	return g_object_new (DRW_TYPE_MONITOR, NULL);
+}
+
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/143.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/143.html new file mode 100644 index 00000000..7f09ba83 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/143.html @@ -0,0 +1,339 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2002 CodeFactory AB
+ * Copyright (C) 2002 Richard Hult <richard@imendi.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 __DRW_MONITOR_H__
+#define __DRW_MONITOR_H__
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define DRW_TYPE_MONITOR         (drw_monitor_get_type ())
+#define DRW_MONITOR(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), DRW_TYPE_MONITOR, DrwMonitor))
+#define DRW_MONITOR_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), DRW_TYPE_MONITOR, DrwMonitorClass))
+#define DRW_IS_MONITOR(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), DRW_TYPE_MONITOR))
+#define DRW_IS_MONITOR_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), DRW_TYPE_MONITOR))
+#define DRW_MONITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), DRW_TYPE_MONITOR, DrwMonitorClass))
+
+typedef struct _DrwMonitor      DrwMonitor;
+typedef struct _DrwMonitorClass DrwMonitorClass;
+typedef struct _DrwMonitorPriv  DrwMonitorPriv;
+
+struct _DrwMonitor {
+        GObject        parent;
+
+        DrwMonitorPriv *priv;
+};
+
+struct _DrwMonitorClass {
+        GObjectClass parent_class;
+};
+
+GType        drw_monitor_get_type         (void) G_GNUC_CONST;
+DrwMonitor  *drw_monitor_new              (void);
+
+#endif /* __DRW_MONITOR_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/144.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/144.html new file mode 100644 index 00000000..7849082d --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/144.html @@ -0,0 +1,635 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* Copyright © 2002 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Red Hat not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  Red Hat makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author:  Owen Taylor, Red Hat, Inc.
+ */
+
+#include <config.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.
+
+#include "drw-selection.h"
+
+struct _DrwSelection
+{
+	GdkWindow *owner_window;
+	GtkWidget *invisible;
+};
+
+#define SELECTION_NAME "_CODEFACTORY_DRWRIGHT"
+
+static GdkFilterReturn drw_selection_filter     (GdkXEvent   *xevent,
+						 GdkEvent    *event,
+						 gpointer     data);
+static void            drw_selection_negotiate  (DrwSelection *drw_selection);
+
+static void
+drw_selection_reset (DrwSelection *drw_selection)
+{
+	if (drw_selection->owner_window) {
+		gdk_window_remove_filter (drw_selection->owner_window,
+					  drw_selection_filter, drw_selection);
+		g_object_unref (drw_selection->owner_window);
+		drw_selection->owner_window = NULL;
+	}
+
+	if (drw_selection->invisible) {
+		gtk_widget_destroy (drw_selection->invisible);
+		drw_selection->invisible = NULL;
+	}
+}
+
+static void
+drw_selection_clear (GtkWidget         *widget,
+		    GdkEventSelection *event,
+		    gpointer           user_data)
+{
+	DrwSelection *drw_selection = user_data;
+
+	drw_selection_reset (drw_selection);
+	drw_selection_negotiate (drw_selection);
+}
+
+static gboolean
+drw_selection_find_existing (DrwSelection *drw_selection)
+{
+	GdkDisplay *display;
+	Window old;
+	Display *xdisplay;
+
+	display = gdk_display_get_default ();
+	xdisplay = GDK_DISPLAY_XDISPLAY(display);
+
+	gdk_x11_display_error_trap_push (display);
+	old = XGetSelectionOwner (xdisplay,
+				  gdk_x11_get_xatom_by_name (SELECTION_NAME));
+	if (old) {
+		XSelectInput (xdisplay, old, StructureNotifyMask);
+		drw_selection->owner_window = gdk_x11_window_foreign_new_for_display (gdk_display_get_default (), old);
+	}
+	XSync (xdisplay, False);
+
+	if (gdk_x11_display_error_trap_pop (display) == 0 && drw_selection->owner_window) {
+		gdk_window_add_filter (drw_selection->owner_window,
+				       drw_selection_filter, drw_selection);
+
+		XUngrabServer (xdisplay);
+
+		return TRUE;
+	} else {
+		if (drw_selection->owner_window) {
+			g_object_unref (drw_selection->owner_window);
+			drw_selection->owner_window = NULL;
+		}
+
+		return FALSE;
+	}
+}
+
+static gboolean
+drw_selection_claim (DrwSelection *drw_selection)
+{
+	drw_selection->invisible = gtk_invisible_new ();
+	g_signal_connect (drw_selection->invisible, "selection-clear-event",
+			  G_CALLBACK (drw_selection_clear), drw_selection);
+
+	if (gtk_selection_owner_set (drw_selection->invisible,
+				     gdk_atom_intern (SELECTION_NAME, FALSE),
+				     GDK_CURRENT_TIME)) {
+		return TRUE;
+	} else {
+		drw_selection_reset (drw_selection);
+		return FALSE;
+	}
+}
+
+static void
+drw_selection_negotiate (DrwSelection *drw_selection)
+{
+	Display *xdisplay = GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
+	gboolean found = FALSE;
+
+	/* We don't need both the XGrabServer() and the loop here;
+	 * the XGrabServer() should make sure that we only go through
+	 * the loop once. It also works if you remove the XGrabServer()
+	 * and just have the loop, but then the selection ownership
+	 * can get transfered a bunch of times before things
+	 * settle down.
+	 */
+	while (!found)
+	{
+		XGrabServer (xdisplay);
+
+		if (drw_selection_find_existing (drw_selection))
+			found = TRUE;
+		else if (drw_selection_claim (drw_selection))
+			found = TRUE;
+
+		XUngrabServer (xdisplay);
+	}
+}
+
+static GdkFilterReturn
+drw_selection_filter (GdkXEvent *xevent,
+		     GdkEvent  *event,
+		     gpointer   data)
+{
+	DrwSelection *drw_selection = data;
+	XEvent *xev = (XEvent *)xevent;<--- Variable 'xev' can be declared as pointer to const
+
+	if (xev->xany.type == DestroyNotify &&
+	    xev->xdestroywindow.window == xev->xdestroywindow.event)
+	{
+		drw_selection_reset (drw_selection);
+		drw_selection_negotiate (drw_selection);
+
+		return GDK_FILTER_REMOVE;
+	}
+
+	return GDK_FILTER_CONTINUE;
+}
+
+DrwSelection *
+drw_selection_start (void)
+{
+	DrwSelection *drw_selection = g_new (DrwSelection, 1);
+
+	drw_selection->owner_window = NULL;
+	drw_selection->invisible = NULL;
+
+	drw_selection_negotiate (drw_selection);
+
+	return drw_selection;
+}
+
+void
+drw_selection_stop (DrwSelection *drw_selection)
+{
+	drw_selection_reset (drw_selection);
+	g_free (drw_selection);
+}
+
+gboolean
+drw_selection_is_master (DrwSelection *drw_selection)<--- Parameter 'drw_selection' can be declared as pointer to const
+{
+	return drw_selection->invisible != NULL;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/145.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/145.html new file mode 100644 index 00000000..d2f25671 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/145.html @@ -0,0 +1,337 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2009 Nathaniel Smith <njs@pobox.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.
+ */
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "drw-timer.h"
+
+struct _DrwTimer
+{
+	gint64 start_time;
+};
+
+DrwTimer * drw_timer_new (void)
+{
+	DrwTimer * timer = g_new0 (DrwTimer, 1);
+	drw_timer_start (timer);
+	return timer;
+}
+
+void drw_timer_start (DrwTimer *timer)
+{
+	timer->start_time = g_get_real_time ();
+}
+
+gint drw_timer_elapsed (DrwTimer *timer)<--- Parameter 'timer' can be declared as pointer to const
+{
+	return (g_get_real_time () - timer->start_time) / G_USEC_PER_SEC;
+}
+
+void drw_timer_destroy (DrwTimer *timer)
+{
+	g_free (timer);
+}
+
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/146.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/146.html new file mode 100644 index 00000000..9738a05c --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/146.html @@ -0,0 +1,635 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2003 Richard Hult <richard@imendio.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.
+ */
+
+#include <config.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.
+#include <gdk/gdkx.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 "drw-utils.h"
+
+static GdkPixbuf *
+create_tile_pixbuf (GdkPixbuf    *dest_pixbuf,
+		    GdkPixbuf    *src_pixbuf,
+		    GdkRectangle *field_geom,
+		    guint         alpha,
+		    GdkColor     *bg_color)<--- Parameter 'bg_color' can be declared as pointer to const
+{
+	gboolean need_composite;
+	gboolean use_simple;
+	gdouble  cx, cy;
+	gdouble  colorv;
+	gint     pwidth, pheight;
+
+	need_composite = (alpha < 255 || gdk_pixbuf_get_has_alpha (src_pixbuf));
+	use_simple = (dest_pixbuf == NULL);
+
+	if (dest_pixbuf == NULL)
+		dest_pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
+					      FALSE, 8,
+					      field_geom->width, field_geom->height);
+
+	if (need_composite && use_simple)
+		colorv = ((bg_color->red & 0xff00) << 8) |
+			(bg_color->green & 0xff00) |
+			((bg_color->blue & 0xff00) >> 8);
+	else
+		colorv = 0;
+
+	pwidth = gdk_pixbuf_get_width (src_pixbuf);
+	pheight = gdk_pixbuf_get_height (src_pixbuf);
+
+	for (cy = 0; cy < field_geom->height; cy += pheight) {
+		for (cx = 0; cx < field_geom->width; cx += pwidth) {
+			if (need_composite && !use_simple)
+				gdk_pixbuf_composite (src_pixbuf, dest_pixbuf,
+						      cx, cy,
+						      MIN (pwidth, field_geom->width - cx),
+						      MIN (pheight, field_geom->height - cy),
+						      cx, cy,
+						      1.0, 1.0,
+						      GDK_INTERP_BILINEAR,
+						      alpha);
+			else if (need_composite && use_simple)
+				gdk_pixbuf_composite_color (src_pixbuf, dest_pixbuf,
+							    cx, cy,
+							    MIN (pwidth, field_geom->width - cx),
+							    MIN (pheight, field_geom->height - cy),
+							    cx, cy,
+							    1.0, 1.0,
+							    GDK_INTERP_BILINEAR,
+							    alpha,
+							    65536, 65536, 65536,
+							    colorv, colorv);
+			else
+				gdk_pixbuf_copy_area (src_pixbuf,
+						      0, 0,
+						      MIN (pwidth, field_geom->width - cx),
+						      MIN (pheight, field_geom->height - cy),
+						      dest_pixbuf,
+						      cx, cy);
+		}
+	}
+
+	return dest_pixbuf;
+}
+
+static gboolean
+window_draw_event   (GtkWidget      *widget,
+		     cairo_t        *cr,
+		     gpointer        data)
+{
+	int              width;
+	int              height;
+
+	gtk_window_get_size (GTK_WINDOW (widget), &width, &height);
+
+	cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.0);
+	cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
+	cairo_paint (cr);
+
+	/* draw a box */
+	cairo_rectangle (cr, 0, 0, width, height);
+	cairo_set_source_rgba (cr, 0.2, 0.2, 0.2, 0.5);
+	cairo_fill (cr);
+
+	return FALSE;
+}
+
+static void
+set_pixmap_background (GtkWidget *window)
+{
+	GdkScreen         *screen;
+	GdkPixbuf         *tmp_pixbuf, *pixbuf, *tile_pixbuf;
+	GdkRectangle       rect;
+	GdkColor           color;
+	gint               width, height, scale;
+	cairo_t           *cr;
+	cairo_region_t    *cairo_region;
+	GdkDrawingContext *gdc;
+
+	gtk_widget_realize (window);
+
+	screen = gtk_widget_get_screen (window);
+	scale = gtk_widget_get_scale_factor (window);
+	width = WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale;
+	height = HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale;
+
+	tmp_pixbuf = gdk_pixbuf_get_from_window (gdk_screen_get_root_window (screen),
+						 0,
+						 0,
+						 width, height);
+
+	pixbuf = gdk_pixbuf_new_from_file (IMAGEDIR "/ocean-stripes.png", NULL);
+
+	rect.x = 0;
+	rect.y = 0;
+	rect.width = width;
+	rect.height = height;
+
+	color.red = 0;
+	color.blue = 0;
+	color.green = 0;
+
+	tile_pixbuf = create_tile_pixbuf (NULL,
+					  pixbuf,
+					  &rect,
+					  155,
+					  &color);
+
+	g_object_unref (pixbuf);
+
+	gdk_pixbuf_composite (tile_pixbuf,
+			      tmp_pixbuf,
+			      0,
+			      0,
+			      width,
+			      height,
+			      0,
+			      0,
+			      scale,
+			      scale,
+			      GDK_INTERP_NEAREST,
+			      225);
+
+	g_object_unref (tile_pixbuf);
+
+	cairo_region = cairo_region_create ();
+	gdc = gdk_window_begin_draw_frame (gtk_widget_get_window (window), cairo_region);
+	cr = gdk_drawing_context_get_cairo_context (gdc);
+	gdk_cairo_set_source_pixbuf (cr, tmp_pixbuf, 0, 0);
+	cairo_paint (cr);
+
+	g_object_unref (tmp_pixbuf);
+	gdk_window_end_draw_frame (gtk_widget_get_window (window), gdc);
+	cairo_region_destroy (cairo_region);
+}
+
+void
+drw_setup_background (GtkWidget *window)
+{
+	GdkScreen    *screen;
+	gboolean      is_composited;
+
+	screen = gtk_widget_get_screen (window);
+	is_composited = gdk_screen_is_composited (screen);
+
+	if (is_composited) {
+		g_signal_connect (window, "draw", G_CALLBACK (window_draw_event), window);
+	} else {
+		set_pixmap_background (window);
+	}
+}
+
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/147.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/147.html new file mode 100644 index 00000000..fd8a726c --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/147.html @@ -0,0 +1,1607 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2003-2005 Imendio HB
+ * Copyright (C) 2002-2003 Richard Hult <richard@imendio.com>
+ * Copyright (C) 2002 CodeFactory AB
+ *
+ * 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 <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.
+#include <glib/gi18n.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.
+#include <gdk/gdkx.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 <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.
+
+#ifdef HAVE_UBUNTU_APPINDICATOR
+#include <libappindicator/app-indicator.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#else
+#include <libayatana-appindicator/app-indicator.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.
+
+#include "drwright.h"
+#include "drw-break-window.h"
+#include "drw-monitor.h"
+#include "drw-utils.h"
+#include "drw-timer.h"
+
+typedef enum {
+	STATE_START,
+	STATE_RUNNING,
+	STATE_WARN,
+	STATE_BREAK_SETUP,
+	STATE_BREAK,
+	STATE_BREAK_DONE_SETUP,
+	STATE_BREAK_DONE
+} DrwState;
+
+#define TYPING_MONITOR_ACTIVE_ICON "bar-green"
+#define TYPING_MONITOR_ATTENTION_ICON "bar-red"
+
+struct _DrWright {
+	/* Widgets. */
+	GtkWidget       *break_window;
+	GList           *secondary_break_windows;
+
+	DrwMonitor      *monitor;
+
+	GtkWidget       *menu;
+	GtkWidget       *break_item;
+
+	DrwState         state;
+	DrwTimer        *timer;
+	DrwTimer        *idle_timer;
+
+	gint             last_elapsed_time;
+	gint             save_last_time;
+
+	/* Time settings. */
+	gint             type_time;
+	gint             break_time;
+	gint             warn_time;
+
+	gboolean         enabled;
+
+	guint            clock_timeout_id;
+	AppIndicator    *indicator;
+	GtkWidget      *warn_dialog;<--- struct member '_DrWright::warn_dialog' is never used.
+};
+
+static void     activity_detected_cb           (DrwMonitor     *monitor,
+						DrWright       *drwright);
+static gboolean maybe_change_state             (DrWright       *drwright);
+static gint     get_time_left                  (DrWright       *drwright);
+static gboolean update_status                  (DrWright       *drwright);
+static void     break_window_done_cb           (GtkWidget      *window,
+						DrWright       *dr);
+static void     break_window_postpone_cb       (GtkWidget      *window,
+						DrWright       *dr);
+static void     break_window_destroy_cb        (GtkWidget      *window,
+						DrWright       *dr);
+static void     popup_break_cb                 (GSimpleAction  *action,
+                                                GVariant       *parameter,
+                                                gpointer        data);
+
+static void     popup_preferences_cb           (GSimpleAction  *action,
+                                                GVariant       *parameter,
+                                                gpointer        data);
+
+static void     popup_about_cb                 (GSimpleAction  *action,
+                                                GVariant       *parameter,
+                                                gpointer        data);
+static void     init_app_indicator             (DrWright       *dr);
+static GList *  create_secondary_break_windows (void);
+
+static const GActionEntry action_entries[] = {
+  {"Preferences", popup_preferences_cb, NULL, NULL, NULL, { 0 } },
+  {"About", popup_about_cb, NULL, NULL, NULL, { 0 } },
+  {"TakeABreak", popup_break_cb, NULL, NULL, NULL, { 0 } }
+};
+
+extern gboolean debug;
+
+static void
+setup_debug_values (DrWright *dr)
+{
+	dr->type_time = 5;
+	dr->warn_time = 4;
+	dr->break_time = 10;
+}
+
+static void
+update_app_indicator (DrWright *dr)
+{
+	AppIndicatorStatus new_status;
+
+	if (!dr->enabled) {
+		app_indicator_set_status (dr->indicator,
+					  APP_INDICATOR_STATUS_PASSIVE);
+		return;
+	}
+
+	switch (dr->state) {
+	case STATE_WARN:
+	case STATE_BREAK_SETUP:
+	case STATE_BREAK:
+		new_status = APP_INDICATOR_STATUS_ATTENTION;
+		break;
+	default:
+		new_status = APP_INDICATOR_STATUS_ACTIVE;
+	}
+
+	app_indicator_set_status (dr->indicator, new_status);
+}
+
+static gboolean
+grab_keyboard_on_window (GdkWindow *window,
+			 guint32    activate_time)
+{
+	GdkDisplay *display;
+	GdkSeat *seat;
+	GdkGrabStatus status;
+
+	display = gdk_window_get_display (window);
+	seat = gdk_display_get_default_seat (display);
+
+	status = gdk_seat_grab (seat,
+	                        window,
+	                        GDK_SEAT_CAPABILITY_KEYBOARD,
+	                        TRUE,
+	                        NULL,
+	                        NULL,
+	                        NULL,
+	                        NULL);
+
+	if (status == GDK_GRAB_SUCCESS) {
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+static gboolean
+break_window_map_event_cb (GtkWidget *widget,
+			   GdkEvent  *event,
+			   DrWright  *dr)
+{
+	grab_keyboard_on_window (gtk_widget_get_window (dr->break_window), gtk_get_current_event_time ());
+
+        return FALSE;
+}
+
+static gboolean
+maybe_change_state (DrWright *dr)
+{
+	gint elapsed_time;
+	gint elapsed_idle_time;
+
+	if (debug) {
+		drw_timer_start (dr->idle_timer);
+	}
+
+	elapsed_time = drw_timer_elapsed (dr->timer) + dr->save_last_time;
+	elapsed_idle_time = drw_timer_elapsed (dr->idle_timer);
+
+	if (elapsed_time > dr->last_elapsed_time + dr->warn_time) {
+		/* If the timeout is delayed by the amount of warning time, then
+		 * we must have been suspended or stopped, so we just start
+		 * over.
+		 */
+		dr->state = STATE_START;
+	}
+
+	switch (dr->state) {
+	case STATE_START:
+		if (dr->break_window) {
+			gtk_widget_destroy (dr->break_window);
+			dr->break_window = NULL;
+		}
+
+		dr->save_last_time = 0;
+
+		drw_timer_start (dr->timer);
+		drw_timer_start (dr->idle_timer);
+
+		if (dr->enabled) {
+			dr->state = STATE_RUNNING;
+		}
+
+		update_status (dr);
+		break;
+
+	case STATE_RUNNING:
+	case STATE_WARN:
+		if (elapsed_idle_time >= dr->break_time) {
+			dr->state = STATE_BREAK_DONE_SETUP;
+ 		} else if (elapsed_time >= dr->type_time) {
+			dr->state = STATE_BREAK_SETUP;
+		} else if (dr->state != STATE_WARN
+			   && elapsed_time >= dr->type_time - dr->warn_time) {
+			dr->state = STATE_WARN;
+		}
+		break;
+
+	case STATE_BREAK_SETUP:
+		/* Don't allow more than one break window to coexist, can happen
+		 * if a break is manually enforced.
+		 */
+		if (dr->break_window) {
+			dr->state = STATE_BREAK;
+			break;
+		}
+
+		drw_timer_start (dr->timer);
+
+		dr->break_window = drw_break_window_new ();
+
+		g_signal_connect (dr->break_window, "map_event",
+				  G_CALLBACK (break_window_map_event_cb),
+				  dr);
+
+		g_signal_connect (dr->break_window,
+				  "done",
+				  G_CALLBACK (break_window_done_cb),
+				  dr);
+
+		g_signal_connect (dr->break_window,
+				  "postpone",
+				  G_CALLBACK (break_window_postpone_cb),
+				  dr);
+
+		g_signal_connect (dr->break_window,
+				  "destroy",
+				  G_CALLBACK (break_window_destroy_cb),
+				  dr);
+
+		dr->secondary_break_windows = create_secondary_break_windows ();
+
+		gtk_widget_show (dr->break_window);
+
+		dr->save_last_time = elapsed_time;
+		dr->state = STATE_BREAK;
+		break;
+
+	case STATE_BREAK:
+		if (elapsed_time - dr->save_last_time >= dr->break_time) {
+			dr->state = STATE_BREAK_DONE_SETUP;
+		}
+		break;
+
+	case STATE_BREAK_DONE_SETUP:
+
+		dr->state = STATE_BREAK_DONE;
+		break;
+
+	case STATE_BREAK_DONE:
+		dr->state = STATE_START;
+		if (dr->break_window) {
+			gtk_widget_destroy (dr->break_window);
+			dr->break_window = NULL;
+		}
+		break;
+	}
+
+	dr->last_elapsed_time = elapsed_time;
+
+	update_app_indicator (dr);
+
+	return TRUE;
+}
+
+static gboolean
+update_status (DrWright *dr)
+{
+	gint       min;
+	gchar     *str;
+
+	if (!dr->enabled) {
+		app_indicator_set_status (dr->indicator,
+					  APP_INDICATOR_STATUS_PASSIVE);
+		return TRUE;
+	}
+
+	min = get_time_left (dr);
+
+	if (min >= 1) {
+		str = g_strdup_printf (_("Take a break now (next in %dm)"), min);
+	} else {
+		str = g_strdup_printf (_("Take a break now (next in less than one minute)"));
+	}
+
+	gtk_menu_item_set_label (GTK_MENU_ITEM (dr->break_item), str);
+
+	g_free (str);
+
+	return TRUE;
+}
+
+static gint
+get_time_left (DrWright *dr)
+{
+	gint elapsed_time;
+
+	elapsed_time = drw_timer_elapsed (dr->timer);
+
+	return floor (0.5 + (dr->type_time - elapsed_time - dr->save_last_time) / 60.0);
+}
+
+static void
+activity_detected_cb (DrwMonitor *monitor,
+		      DrWright   *dr)
+{
+	drw_timer_start (dr->idle_timer);
+}
+
+static void
+gsettings_notify_cb (GSettings *settings,
+		 gchar       *key,
+		 gpointer     user_data)
+{
+	DrWright  *dr = user_data;
+
+	if (!strcmp (key, "type-time")) {
+		dr->type_time = 60 * g_settings_get_int (settings, key);
+		dr->warn_time = MIN (dr->type_time / 10, 5*60);
+
+		dr->state = STATE_START;
+	}
+	else if (!strcmp (key, "break-time")) {
+		dr->break_time = 60 * g_settings_get_int (settings, key);
+		dr->state = STATE_START;
+	}
+	else if (!strcmp (key, "enabled")) {
+		dr->enabled = g_settings_get_boolean (settings, key);
+		dr->state = STATE_START;
+
+		gtk_widget_set_sensitive (dr->break_item, dr->enabled);
+
+		update_status (dr);
+	}
+
+	maybe_change_state (dr);
+}
+
+static void
+popup_break_cb (GSimpleAction *action,
+                GVariant      *parameter,
+                gpointer       data)
+{
+	DrWright *dr = data;
+	if (dr->enabled) {
+		dr->state = STATE_BREAK_SETUP;
+		maybe_change_state (dr);
+	}
+}
+
+static void
+popup_preferences_cb (GSimpleAction *action,
+                      GVariant      *parameter,
+                      gpointer       data)
+{
+	DrWright *dr = data;
+	GdkScreen *screen;
+	GError    *error = NULL;
+
+	screen = gtk_widget_get_screen (dr->menu);
+
+	if (!mate_gdk_spawn_command_line_on_screen (screen, "mate-keyboard-properties --typing-break", &error)) {
+		GtkWidget *error_dialog;
+
+		error_dialog = gtk_message_dialog_new (NULL, 0,
+						       GTK_MESSAGE_ERROR,
+						       GTK_BUTTONS_CLOSE,
+						       _("Unable to bring up the typing break properties dialog with the following error: %s"),
+						       error->message);
+		g_signal_connect (error_dialog,
+				  "response",
+				  G_CALLBACK (gtk_widget_destroy), NULL);
+		gtk_window_set_resizable (GTK_WINDOW (error_dialog), FALSE);
+		gtk_widget_show (error_dialog);
+
+		g_error_free (error);
+	}
+}
+
+static void
+popup_about_cb (GSimpleAction *action,
+                GVariant      *parameter,
+                gpointer       data)
+{
+	gint   i;
+	gchar *authors[] = {
+		N_("Written by Richard Hult <richard@imendio.com>"),
+		N_("Eye candy added by Anders Carlsson"),
+		NULL
+	};
+
+	for (i = 0; authors [i]; i++)
+		authors [i] = _(authors [i]);
+
+	gtk_show_about_dialog (NULL,
+			       "authors", authors,
+			       "comments",  _("A computer break reminder."),
+			       "logo-icon-name", "mate-typing-monitor",
+			       "translator-credits", _("translator-credits"),
+			       "version", VERSION,
+			       NULL);
+}
+
+static void
+break_window_done_cb (GtkWidget *window,
+		      DrWright  *dr)
+{
+	gtk_widget_destroy (dr->break_window);
+
+	dr->state = STATE_BREAK_DONE_SETUP;
+	dr->break_window = NULL;
+
+	update_status (dr);
+	maybe_change_state (dr);
+}
+
+static void
+break_window_postpone_cb (GtkWidget *window,
+			  DrWright  *dr)
+{
+	gint elapsed_time;
+
+	gtk_widget_destroy (dr->break_window);
+
+	dr->state = STATE_RUNNING;
+	dr->break_window = NULL;
+
+	elapsed_time = drw_timer_elapsed (dr->timer);
+
+	if (elapsed_time + dr->save_last_time >= dr->type_time) {
+		/* Typing time has expired, but break was postponed.
+		 * We'll warn again in (elapsed * sqrt (typing_time))^2 */
+		gfloat postpone_time = (((float) elapsed_time) / dr->break_time)
+					* sqrt (dr->type_time);
+		postpone_time *= postpone_time;
+		dr->save_last_time = dr->type_time - MAX (dr->warn_time, (gint) postpone_time);
+	}
+
+	drw_timer_start (dr->timer);
+	maybe_change_state (dr);
+	update_status (dr);
+	update_app_indicator (dr);
+}
+
+static void
+break_window_destroy_cb (GtkWidget *window,
+			 DrWright  *dr)
+{
+	GList *l;
+
+	for (l = dr->secondary_break_windows; l; l = l->next) {
+		gtk_widget_destroy (l->data);
+	}
+
+	g_list_free (dr->secondary_break_windows);
+	dr->secondary_break_windows = NULL;
+}
+
+static void
+init_app_indicator (DrWright *dr)
+{
+	dr->indicator =
+		app_indicator_new_with_path ("typing-break-indicator",
+					     TYPING_MONITOR_ACTIVE_ICON,
+					     APP_INDICATOR_CATEGORY_APPLICATION_STATUS,
+					     IMAGEDIR);
+	if (dr->enabled) {
+		app_indicator_set_status (dr->indicator,
+					  APP_INDICATOR_STATUS_ACTIVE);
+	} else {
+		app_indicator_set_status (dr->indicator,
+					  APP_INDICATOR_STATUS_PASSIVE);
+	}
+
+	app_indicator_set_menu (dr->indicator, GTK_MENU (dr->menu));
+	app_indicator_set_attention_icon (dr->indicator, TYPING_MONITOR_ATTENTION_ICON);
+
+	update_status (dr);
+	update_app_indicator (dr);
+}
+
+static GList *
+create_secondary_break_windows (void)
+{
+	GdkDisplay *display;
+	GdkScreen  *screen;
+	GtkWidget  *window;
+	GList      *windows = NULL;
+	gint        scale;
+
+	display = gdk_display_get_default ();
+
+	screen = gdk_display_get_default_screen (display);
+
+	if (screen != gdk_screen_get_default ()) {
+		/* Handled by DrwBreakWindow. */
+
+		window = gtk_window_new (GTK_WINDOW_POPUP);
+
+		windows = g_list_prepend (windows, window);
+		scale = gtk_widget_get_scale_factor (GTK_WIDGET (window));
+
+		gtk_window_set_screen (GTK_WINDOW (window), screen);
+
+		gtk_window_set_default_size (GTK_WINDOW (window),
+					     WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale,
+					     HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale);
+
+		gtk_widget_set_app_paintable (GTK_WIDGET (window), TRUE);
+		drw_setup_background (GTK_WIDGET (window));
+		gtk_window_stick (GTK_WINDOW (window));
+		gtk_widget_show (window);
+	}
+
+	return windows;
+}
+
+DrWright *
+drwright_new (void)
+{
+	DrWright           *dr;
+	GtkBuilder         *ui_builder;
+	GSettings          *settings;
+	GSimpleActionGroup *action_group;
+
+	static const gchar *ui_description =
+	  "<interface>"
+	    "<object class=\"GtkImage\" id=\"menu_icon_pre\">"
+	      "<property name=\"visible\">True</property>"
+	      "<property name=\"can_focus\">False</property>"
+	      "<property name=\"icon-name\">preferences-desktop</property>"
+	    "</object>"
+	    "<object class=\"GtkImage\" id=\"menu_icon_about\">"
+	      "<property name=\"visible\">True</property>"
+	      "<property name=\"can_focus\">False</property>"
+	      "<property name=\"icon-name\">help-about</property>"
+	    "</object>"
+	    "<object class=\"GtkMenu\" id=\"pop_menu\">"
+	        "<property name=\"visible\">1</property>"
+	    "<child>"
+	      "<object class=\"GtkImageMenuItem\" id=\"preferences_item\">"
+	        "<property name=\"visible\">1</property>"
+	        "<property name=\"label\" translatable=\"yes\">_Preferences</property>"
+	        "<property name=\"use-underline\">1</property>"
+	        "<property name=\"image\">menu_icon_pre</property>"
+	        "<property name=\"action-name\">win.Preferences</property>"
+	      "</object>"
+	    "</child>"
+	    "<child>"
+	      "<object class=\"GtkImageMenuItem\" id=\"about_item\">"
+	        "<property name=\"visible\">1</property>"
+	        "<property name=\"label\" translatable=\"yes\">_About</property>"
+	        "<property name=\"use-underline\">1</property>"
+	        "<property name=\"image\">menu_icon_about</property>"
+	        "<property name=\"action-name\">win.About</property>"
+	      "</object>"
+	    "</child>"
+	    "<child>"
+	      "<object class=\"GtkSeparatorMenuItem\">"
+	        "<property name=\"visible\">1</property>"
+	      "</object>"
+	    "</child>"
+	    "<child>"
+	      "<object class=\"GtkMenuItem\" id=\"take_break_item\">"
+	        "<property name=\"visible\">1</property>"
+	        "<property name=\"label\" translatable=\"yes\">_Take a Break</property>"
+	        "<property name=\"use-underline\">1</property>"
+	        "<property name=\"action-name\">win.TakeABreak</property>"
+	      "</object>"
+	    "</child>"
+	 "</interface>";
+
+	dr = g_new0 (DrWright, 1);
+
+	settings = g_settings_new (TYPING_BREAK_SCHEMA);
+
+	g_signal_connect (settings, "changed", G_CALLBACK (gsettings_notify_cb), dr);
+
+	dr->type_time = 60 * g_settings_get_int (settings, "type-time");
+
+	dr->warn_time = MIN (dr->type_time / 12, 60*3);
+
+	dr->break_time = 60 * g_settings_get_int (settings, "break-time");
+
+	dr->enabled = g_settings_get_boolean (settings, "enabled");
+
+	if (debug) {
+		setup_debug_values (dr);
+	}
+
+	ui_builder = gtk_builder_new ();
+#ifdef ENABLE_NLS
+	gtk_builder_set_translation_domain (ui_builder, GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
+	gtk_builder_add_from_string (ui_builder, ui_description, -1, NULL);
+	dr->menu = (GtkWidget*) g_object_ref (gtk_builder_get_object (ui_builder, "pop_menu"));
+	dr->break_item = (GtkWidget *)gtk_builder_get_object (ui_builder, "take_break_item");
+	gtk_widget_set_sensitive (dr->break_item, dr->enabled);
+
+	action_group = g_simple_action_group_new ();
+	g_action_map_add_action_entries (G_ACTION_MAP (action_group),
+	                                 action_entries,
+	                                 G_N_ELEMENTS (action_entries),
+	                                 dr);
+
+	gtk_widget_insert_action_group (dr->menu, "win", G_ACTION_GROUP (action_group));
+
+	dr->timer = drw_timer_new ();
+	dr->idle_timer = drw_timer_new ();
+
+	dr->state = STATE_START;
+
+	dr->monitor = drw_monitor_new ();
+
+	g_signal_connect (dr->monitor,
+			  "activity",
+			  G_CALLBACK (activity_detected_cb),
+			  dr);
+
+	init_app_indicator (dr);
+
+	g_timeout_add_seconds (12,
+			       (GSourceFunc) update_status,
+			       dr);
+
+	g_timeout_add_seconds (1,
+			       (GSourceFunc) maybe_change_state,
+			       dr);
+
+	g_object_unref (action_group);
+	g_object_unref (ui_builder);
+
+	return dr;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/148.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/148.html new file mode 100644 index 00000000..10179c8b --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/148.html @@ -0,0 +1,509 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2002 CodeFactory AB
+ * Copyright (C) 2002-2003 Richard Hult <richard@imendio.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.
+ */
+
+#include <config.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 <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.
+#include <gdk/gdkx.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 "drw-selection.h"
+#include "drwright.h"
+
+#define NOTIFIERAREA_NAME          "org.kde.StatusNotifierWatcher"
+#define NOTIFIERAREA_PATH          "/StatusNotifierWatcher"
+#define NOTIFIERAREA_INTERFACE     "org.kde.StatusNotifierWatcher"
+#define NOTIFIERAREA_PROPERTY      "IsStatusNotifierHostRegistered"
+
+gboolean debug = FALSE;
+
+static gboolean
+is_status_notifier_host_available (void)
+{
+	g_autoptr (GDBusProxy) proxy = NULL;
+	g_autoptr (GError) error = 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_AUTO_START,
+	                                       NULL,
+	                                       NOTIFIERAREA_NAME,
+	                                       NOTIFIERAREA_PATH,
+	                                       NOTIFIERAREA_INTERFACE,
+	                                       NULL, &error);
+
+	if (proxy == NULL || error)
+	{
+		return FALSE;
+	}
+	g_autoptr (GVariant) variant = g_dbus_proxy_get_cached_property (proxy, NOTIFIERAREA_PROPERTY);
+	if (! variant)
+	{
+		return FALSE;
+	}
+
+	return g_variant_get_boolean (variant);
+}
+
+int
+main (int argc, char *argv[])
+{
+	DrwSelection *selection;
+	gboolean      no_check = FALSE;
+        const GOptionEntry options[] = {
+          { "debug", 'd', 0, G_OPTION_ARG_NONE, &debug,
+            N_("Enable debugging code"), NULL },
+          { "no-check", 'n', 0, G_OPTION_ARG_NONE, &no_check,
+            N_("Don't check whether the notification area exists"), NULL },
+	  { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
+        };
+        GOptionContext *option_context;
+        GError *error = NULL;
+        gboolean retval;
+
+#ifdef ENABLE_NLS
+	bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
+	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+	textdomain (GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
+
+        option_context = g_option_context_new (NULL);
+#ifdef ENABLE_NLS
+        g_option_context_set_translation_domain (option_context, GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
+        g_option_context_add_main_entries (option_context, options, GETTEXT_PACKAGE);
+        g_option_context_add_group (option_context, gtk_get_option_group (TRUE));
+
+        retval = g_option_context_parse (option_context, &argc, &argv, &error);
+        g_option_context_free (option_context);
+        if (!retval) {
+                g_print ("%s\n", error->message);
+                g_error_free (error);
+                exit (1);
+        }
+
+	g_set_application_name (_("Typing Monitor"));
+	gtk_window_set_default_icon_name ("mate-typing-monitor");
+
+	selection = drw_selection_start ();
+	if (!drw_selection_is_master (selection)) {
+		g_message ("The typing monitor is already running, exiting.");
+		return 0;
+	}
+
+	if (!no_check && !is_status_notifier_host_available ()) {
+		GtkWidget *dialog;
+
+		dialog = gtk_message_dialog_new (
+			NULL, 0,
+			GTK_MESSAGE_INFO,
+			GTK_BUTTONS_CLOSE,
+			_("The typing monitor uses the notification area to display "
+			  "information. You don't seem to have a notification area "
+			  "on your panel. You can add it by right-clicking on your "
+			  "panel and choosing 'Add to panel', selecting 'Notification "
+			  "area' and clicking 'Add'."));
+
+		gtk_dialog_run (GTK_DIALOG (dialog));
+
+		gtk_widget_destroy (dialog);
+	}
+
+	drwright_new ();
+
+	gtk_main ();
+
+	return 0;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/15.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/15.html new file mode 100644 index 00000000..9bc4435e --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/15.html @@ -0,0 +1,1959 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * Copyright (C) 2007 The GNOME Foundation
+ * Written by Jonathan Blandford <jrb@gnome.org>
+ *            Jens Granseuer <jensgr@gmx.net>
+ * All Rights Reserved
+ *
+ * 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.
+ */
+
+#include "appearance.h"
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <stdarg.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 <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/gdkx.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 "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+#include "appearance-font.h"
+
+/* X servers sometimes lie about the screen's physical dimensions, so we cannot
+ * compute an accurate DPI value.  When this happens, the user gets fonts that
+ * are too huge or too tiny.  So, we see what the server returns:  if it reports
+ * something outside of the range [DPI_LOW_REASONABLE_VALUE,
+ * DPI_HIGH_REASONABLE_VALUE], then we assume that it is lying and we use
+ * DPI_FALLBACK instead.
+ *
+ * See get_dpi_from_mate_conf_or_server() below, and also
+ * https://bugzilla.novell.com/show_bug.cgi?id=217790
+ */
+#define DPI_FALLBACK 96
+#define DPI_LOW_REASONABLE_VALUE 50
+#define DPI_HIGH_REASONABLE_VALUE 500
+
+static gboolean in_change = FALSE;
+
+static void sample_draw(GtkWidget* darea, cairo_t* cr)
+{
+	cairo_surface_t* surface = g_object_get_data(G_OBJECT(darea), "sample-surface");
+	GtkAllocation allocation;
+	int x, y, w, h;
+
+	gtk_widget_get_allocation (darea, &allocation);
+	x = allocation.width;
+	y = allocation.height;
+	w = cairo_image_surface_get_width (surface);
+	h = cairo_image_surface_get_height (surface);
+
+	cairo_set_line_width (cr, 1);
+	cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
+
+	cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
+	cairo_rectangle (cr, 0, 0, x, y);
+	cairo_fill_preserve (cr);
+	cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
+	cairo_stroke (cr);
+
+	cairo_set_source_surface (cr, surface, (x - w) / 2, (y - h) / 2);
+
+	cairo_paint(cr);
+}
+
+typedef enum {
+	ANTIALIAS_NONE,
+	ANTIALIAS_GRAYSCALE,
+	ANTIALIAS_RGBA
+} Antialiasing;
+
+typedef enum {
+	HINT_NONE,
+	HINT_SLIGHT,
+	HINT_MEDIUM,
+	HINT_FULL
+} Hinting;
+
+typedef enum {
+	RGBA_RGB,
+	RGBA_BGR,
+	RGBA_VRGB,
+	RGBA_VBGR
+} RgbaOrder;
+
+static void set_fontoptions(PangoContext *context, Antialiasing antialiasing, Hinting hinting)
+{
+	cairo_font_options_t *opt;
+	cairo_antialias_t aa;
+	cairo_hint_style_t hs;
+
+	switch (antialiasing) {
+	case ANTIALIAS_NONE:
+		aa = CAIRO_ANTIALIAS_NONE;
+		break;
+	case ANTIALIAS_GRAYSCALE:
+		aa = CAIRO_ANTIALIAS_GRAY;
+		break;
+	case ANTIALIAS_RGBA:
+		aa = CAIRO_ANTIALIAS_SUBPIXEL;
+		break;
+	default:
+		aa = CAIRO_ANTIALIAS_DEFAULT;
+		break;
+	}
+
+	switch (hinting) {
+	case HINT_NONE:
+		hs = CAIRO_HINT_STYLE_NONE;
+		break;
+	case HINT_SLIGHT:
+		hs = CAIRO_HINT_STYLE_SLIGHT;
+		break;
+	case HINT_MEDIUM:
+		hs = CAIRO_HINT_STYLE_MEDIUM;
+		break;
+	case HINT_FULL:
+		hs = CAIRO_HINT_STYLE_FULL;
+		break;
+	default:
+		hs = CAIRO_HINT_STYLE_DEFAULT;
+		break;
+	}
+
+	opt = cairo_font_options_create ();
+	cairo_font_options_set_antialias (opt, aa);
+	cairo_font_options_set_hint_style (opt, hs);
+	pango_cairo_context_set_font_options (context, opt);
+	cairo_font_options_destroy (opt);
+}
+
+static void setup_font_sample(GtkWidget* darea, Antialiasing antialiasing, Hinting hinting)
+{
+	const char *str = "<span font=\"18\" style=\"normal\">abcfgop AO </span>"
+					  "<span font=\"20\" style=\"italic\">abcfgop</span>";
+
+	PangoContext *context;
+	PangoLayout *layout;
+	PangoFontDescription *fd;
+	PangoRectangle extents;
+	cairo_surface_t *surface;
+	cairo_t *cr;
+	int width, height;
+
+	context = gtk_widget_get_pango_context (darea);
+	set_fontoptions (context, antialiasing, hinting);
+	layout = pango_layout_new (context);
+
+	fd = pango_font_description_from_string ("Serif");
+	pango_layout_set_font_description (layout, fd);
+	pango_font_description_free (fd);
+
+	pango_layout_set_markup (layout, str, -1);
+
+	pango_layout_get_extents (layout, NULL, &extents);
+	width = PANGO_PIXELS(extents.width) + 4;
+	height = PANGO_PIXELS(extents.height) + 2;
+
+	surface = cairo_image_surface_create (CAIRO_FORMAT_A8, width, height);
+	cr = cairo_create (surface);
+
+	cairo_move_to (cr, 2, 1);
+	pango_cairo_show_layout (cr, layout);
+	g_object_unref (layout);
+	cairo_destroy (cr);
+
+	g_object_set_data_full(G_OBJECT(darea), "sample-surface", surface, (GDestroyNotify) cairo_surface_destroy);
+
+	gtk_widget_set_size_request (GTK_WIDGET(darea), width + 2, height + 2);
+	g_signal_connect(darea, "draw", G_CALLBACK(sample_draw), NULL);
+}
+
+/*
+ * Code implementing a group of radio buttons with different cairo option combinations.
+ * If one of the buttons is matched by the GSettings key, we pick it. Otherwise we
+ * show the group as inconsistent.
+ */
+
+typedef struct {
+  Antialiasing antialiasing;
+  Hinting hinting;
+  GtkToggleButton *radio;
+} FontPair;
+
+static GSList *font_pairs = NULL;
+
+static void
+font_render_load (GSettings *settings)
+{
+  Antialiasing antialiasing;
+  Hinting hinting;
+  gboolean inconsistent = TRUE;
+  GSList *tmp_list;
+
+  antialiasing = g_settings_get_enum (settings, FONT_ANTIALIASING_KEY);
+  hinting = g_settings_get_enum (settings, FONT_HINTING_KEY);
+
+  in_change = TRUE;
+
+  for (tmp_list = font_pairs; tmp_list; tmp_list = tmp_list->next) {
+    FontPair *pair = tmp_list->data;
+
+    if (antialiasing == pair->antialiasing && hinting == pair->hinting) {
+      gtk_toggle_button_set_active (pair->radio, TRUE);
+      inconsistent = FALSE;
+      break;
+    }
+  }
+
+  for (tmp_list = font_pairs; tmp_list; tmp_list = tmp_list->next) {
+    FontPair *pair = tmp_list->data;
+
+    gtk_toggle_button_set_inconsistent (pair->radio, inconsistent);
+  }
+
+  in_change = FALSE;
+}
+
+static void
+font_render_changed (GSettings *settings,
+                     gchar     *key,
+                     gpointer   user_data)
+{
+  font_render_load (settings);
+}
+
+static void
+font_radio_toggled (GtkToggleButton *toggle_button,
+		    FontPair        *pair)
+{
+  if (!in_change) {
+    GSettings *settings = g_settings_new (FONT_RENDER_SCHEMA);
+
+    g_settings_set_enum (settings, FONT_ANTIALIASING_KEY, pair->antialiasing);
+    g_settings_set_enum (settings, FONT_HINTING_KEY, pair->hinting);
+
+    /* Restore back to the previous state until we get notification */
+    font_render_load (settings);
+    g_object_unref (settings);
+  }
+}
+
+static void
+setup_font_pair (GtkWidget    *radio,
+		 GtkWidget    *darea,
+		 Antialiasing  antialiasing,
+		 Hinting       hinting)
+{
+  FontPair *pair = g_new (FontPair, 1);
+
+  pair->antialiasing = antialiasing;
+  pair->hinting = hinting;
+  pair->radio = GTK_TOGGLE_BUTTON (radio);
+
+  setup_font_sample (darea, antialiasing, hinting);
+  font_pairs = g_slist_prepend (font_pairs, pair);
+
+  g_signal_connect (radio, "toggled",
+		    G_CALLBACK (font_radio_toggled), pair);
+}
+
+static void
+marco_titlebar_load_sensitivity (AppearanceData *data)
+{
+  gtk_widget_set_sensitive (appearance_capplet_get_widget (data, "window_title_font"),
+			    !g_settings_get_boolean (data->marco_settings,
+						    WINDOW_TITLE_USES_SYSTEM_KEY));
+}
+
+static void
+marco_changed (GSettings *settings,
+	       gchar     *entry,
+	       gpointer   user_data)
+{
+  marco_titlebar_load_sensitivity (user_data);
+}
+
+/*
+ * EnumGroup - a group of radio buttons for a gsettings enum
+ */
+typedef struct
+{
+  GSettings *settings;
+  GSList *items;
+  gchar *settings_key;
+  gulong settings_signal_id;
+} EnumGroup;
+
+typedef struct
+{
+  EnumGroup *group;
+  GtkToggleButton *widget;
+  int value;
+} EnumItem;
+
+static void
+enum_group_load (EnumGroup *group)
+{
+  gint val = g_settings_get_enum (group->settings, group->settings_key);
+  GSList *tmp_list;
+
+  in_change = TRUE;
+
+  for (tmp_list = group->items; tmp_list; tmp_list = tmp_list->next) {
+    EnumItem *item = tmp_list->data;
+
+    if (val == item->value)
+      gtk_toggle_button_set_active (item->widget, TRUE);
+  }
+
+  in_change = FALSE;
+}
+
+static void
+enum_group_changed (GSettings *settings,
+		    gchar     *key,
+		    gpointer  user_data)
+{
+  enum_group_load (user_data);
+}
+
+static void
+enum_item_toggled (GtkToggleButton *toggle_button,
+		   EnumItem        *item)
+{
+  EnumGroup *group = item->group;
+
+  if (!in_change) {
+    g_settings_set_enum (group->settings, group->settings_key, item->value);
+  }
+
+  /* Restore back to the previous state until we get notification */
+  enum_group_load (group);
+}
+
+static EnumGroup *
+enum_group_create (GSettings           *settings,
+		   const gchar         *settings_key,
+		   GtkWidget           *first_widget,
+		   ...)
+{
+  EnumGroup *group;
+  GtkWidget *widget;
+  va_list args;
+
+  group = g_new (EnumGroup, 1);
+
+  group->settings = g_object_ref (settings);
+  group->settings_key = g_strdup (settings_key);
+  group->items = NULL;
+
+  va_start (args, first_widget);
+
+  widget = first_widget;
+  while (widget) {
+    EnumItem *item;
+
+    item = g_new (EnumItem, 1);
+    item->group = group;
+    item->widget = GTK_TOGGLE_BUTTON (widget);
+    item->value = va_arg (args, int);
+
+    g_signal_connect (item->widget, "toggled",
+		      G_CALLBACK (enum_item_toggled), item);
+
+    group->items = g_slist_prepend (group->items, item);
+
+    widget = va_arg (args, GtkWidget *);
+  }
+
+  va_end (args);
+
+  enum_group_load (group);
+
+  gchar *signal_name = g_strdup_printf("changed::%s", settings_key);
+  group->settings_signal_id = g_signal_connect (settings, signal_name,
+                                                G_CALLBACK (enum_group_changed), group);
+  g_free (signal_name);
+
+  return group;
+}
+
+static void
+enum_group_destroy (gpointer data)
+{
+  EnumGroup *group = data;
+
+  g_signal_handler_disconnect (group->settings, group->settings_signal_id);
+  g_clear_object (&group->settings);
+  group->settings_signal_id = 0;
+  g_free (group->settings_key);
+
+  g_slist_free_full (group->items, g_free);
+
+  g_free (group);
+}
+
+static double
+dpi_from_pixels_and_mm (int pixels, int mm)
+{
+  double dpi;
+
+  if (mm >= 1)
+    dpi = pixels / (mm / 25.4);
+  else
+    dpi = 0;
+
+  return dpi;
+}
+
+static double
+get_dpi_from_x_server (void)
+{
+  GdkScreen  *screen;
+  double dpi;
+
+  screen = gdk_screen_get_default ();
+
+  if (screen) {
+    double width_dpi, height_dpi;
+
+    Screen *xscreen = gdk_x11_screen_get_xscreen (screen);
+
+    width_dpi = dpi_from_pixels_and_mm (WidthOfScreen (xscreen), WidthMMOfScreen (xscreen));
+    height_dpi = dpi_from_pixels_and_mm (HeightOfScreen (xscreen), HeightMMOfScreen (xscreen));
+
+    if (width_dpi < DPI_LOW_REASONABLE_VALUE || width_dpi > DPI_HIGH_REASONABLE_VALUE ||
+        height_dpi < DPI_LOW_REASONABLE_VALUE || height_dpi > DPI_HIGH_REASONABLE_VALUE)
+      dpi = DPI_FALLBACK;
+    else
+      dpi = (width_dpi + height_dpi) / 2.0;
+  } else {
+    /* Huh!?  No screen? */
+    dpi = DPI_FALLBACK;
+  }
+
+  return dpi;
+}
+
+/*
+ * The font rendering details dialog
+ */
+static void
+dpi_load (GSettings     *settings,
+	  GtkSpinButton *spinner)
+{
+  GdkScreen *screen;
+  gint scale;
+  gdouble dpi;
+
+  screen = gdk_screen_get_default ();
+  scale = gdk_window_get_scale_factor (gdk_screen_get_root_window (screen));
+  dpi = g_settings_get_double (settings, FONT_DPI_KEY);
+
+  if (dpi == 0)
+    dpi = get_dpi_from_x_server ();
+
+  dpi *= (double)scale;
+  dpi = CLAMP(dpi, DPI_LOW_REASONABLE_VALUE, DPI_HIGH_REASONABLE_VALUE);
+
+  in_change = TRUE;
+  gtk_spin_button_set_value (spinner, dpi);
+  in_change = FALSE;
+}
+
+static void
+dpi_changed (GSettings      *settings,
+	     gchar          *key,
+	     AppearanceData *data)
+{
+  GtkWidget *spinner;
+  GtkWidget *toggle;
+  gdouble dpi;
+
+  dpi = g_settings_get_double (data->font_settings, FONT_DPI_KEY);
+  spinner = appearance_capplet_get_widget (data, "dpi_spinner");
+  toggle = appearance_capplet_get_widget (data, "dpi_reset_switch");
+
+  dpi_load (settings, GTK_SPIN_BUTTON (spinner));
+
+  gtk_switch_set_state (GTK_SWITCH (toggle), dpi == 0);
+  gtk_widget_set_sensitive (spinner, dpi != 0);
+}
+
+static void
+monitors_changed (GdkScreen      *screen,
+		  AppearanceData *data)
+{
+  GtkWidget *widget;
+  widget = appearance_capplet_get_widget (data, "dpi_spinner");
+  dpi_load (data->font_settings, GTK_SPIN_BUTTON (widget));
+}
+
+static void
+dpi_value_changed (GtkSpinButton  *spinner,
+		   AppearanceData *data)
+{
+  /* Like any time when using a spin button with GSettings, there is
+   * a race condition here. When we change, we send the new
+   * value to GSettings, then restore to the old value until
+   * we get a response to emulate the proper model/view behavior.
+   *
+   * If the user changes the value faster than responses are
+   * received from GSettings, this may cause mildly strange effects.
+   */
+  if (!in_change) {
+    GdkScreen *screen;
+    GtkWidget *toggle;
+    gint scale;
+    gdouble new_dpi;
+
+    screen = gdk_screen_get_default ();
+    scale = gdk_window_get_scale_factor (gdk_screen_get_root_window (screen));
+    new_dpi = gtk_spin_button_get_value (spinner) / (double)scale;
+
+    g_settings_set_double (data->font_settings, FONT_DPI_KEY, new_dpi);
+
+    dpi_load (data->font_settings, spinner);
+
+    toggle = appearance_capplet_get_widget (data, "dpi_reset_switch");
+    gtk_switch_set_active (GTK_SWITCH (toggle), FALSE);
+  }
+}
+
+static gboolean
+dpi_value_reset (GtkSwitch      *toggle,
+		 gboolean        state,
+		 AppearanceData *data)
+{
+  GtkWidget *spinner;
+  spinner = appearance_capplet_get_widget (data, "dpi_spinner");
+
+  if (state)
+    g_settings_set_double (data->font_settings, FONT_DPI_KEY, 0);
+  else
+    dpi_value_changed (GTK_SPIN_BUTTON (spinner), data);
+
+  gtk_switch_set_state(toggle, state);
+  gtk_widget_set_sensitive (spinner, !state);
+
+  return TRUE;
+}
+
+static void
+cb_details_response (GtkDialog *dialog, gint response_id)
+{
+  if (response_id == GTK_RESPONSE_HELP) {
+    capplet_help (GTK_WINDOW (dialog),
+		  "goscustdesk-38");
+  } else
+    gtk_widget_hide (GTK_WIDGET (dialog));
+}
+
+static void install_new_font (const gchar *filepath)
+{
+    GFile *src, *dst;
+    gchar *fontdir, *fontpath;
+    char *basename;
+    GError *error = NULL;
+
+    fontdir = g_build_filename (g_get_home_dir(), ".fonts", NULL);
+    if (!g_file_test (fontdir, G_FILE_TEST_IS_DIR))
+    {
+        if(g_mkdir (fontdir, 0755) != 0) {
+            g_free (fontdir);
+            return;
+        }
+    }
+    g_free (fontdir);
+
+    basename = g_path_get_basename (filepath);
+    fontpath = g_build_filename (g_get_home_dir(), ".fonts", basename, NULL);
+    g_free (basename);
+    src = g_file_new_for_path (filepath);
+    dst = g_file_new_for_path (fontpath);
+    g_free (fontpath);
+
+    if (!g_file_copy (src,
+                      dst,
+                      G_FILE_COPY_NONE,
+                      NULL,
+                      NULL,
+                      NULL,
+                      &error)) {
+        g_warning ("install new font failed: %s\n", error->message);
+        g_error_free (error);
+    }
+    g_object_unref (src);
+    g_object_unref (dst);
+}
+
+static void
+cb_add_new_font (GtkWidget *button,
+                 AppearanceData *data)
+{
+    GtkWidget *dialog;
+    GtkFileFilter *filter;
+    GtkFileChooser *chooser;
+    GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN;
+    gint res;
+
+    dialog = gtk_file_chooser_dialog_new (_("Select Font"),
+            GET_WINDOW ("appearance_window"),
+            action,
+            _("_Cancel"),
+            GTK_RESPONSE_CANCEL,
+            _("_Open"),
+            GTK_RESPONSE_ACCEPT,
+            NULL);
+    chooser = GTK_FILE_CHOOSER (dialog);
+    filter = gtk_file_filter_new ();
+    gtk_file_filter_set_name (filter, _("Fonts"));
+    gtk_file_filter_add_mime_type (filter, "font/ttf");
+    gtk_file_chooser_add_filter (chooser, filter);
+
+    res = gtk_dialog_run (GTK_DIALOG (dialog));
+    if (res == GTK_RESPONSE_ACCEPT)
+    {
+        char *filename;
+        filename = gtk_file_chooser_get_filename (chooser);
+        install_new_font (filename);
+        g_free (filename);
+    }
+    gtk_widget_destroy (dialog);
+}
+
+static void
+cb_show_details (GtkWidget *button,
+		 AppearanceData *data)
+{
+  if (!data->font_details) {
+    GtkAdjustment *adjustment;
+    GtkWidget *spinner;
+    GtkWidget *toggle;
+    EnumGroup *group;
+    gdouble dpi;
+
+    data->font_details = appearance_capplet_get_widget (data, "render_details");
+
+    gtk_window_set_transient_for (GTK_WINDOW (data->font_details),
+                                  GET_WINDOW ("appearance_window"));
+
+    spinner = appearance_capplet_get_widget (data, "dpi_spinner");
+    toggle = appearance_capplet_get_widget (data, "dpi_reset_switch");
+
+    /* Set initial state for widgets */
+    dpi = g_settings_get_double (data->font_settings, FONT_DPI_KEY);
+    gtk_switch_set_active (GTK_SWITCH (toggle), dpi == 0);
+    gtk_widget_set_sensitive (GTK_WIDGET (spinner), dpi != 0);
+
+    /* pick a sensible maximum dpi */
+    adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spinner));
+    gtk_adjustment_set_lower (adjustment, DPI_LOW_REASONABLE_VALUE);
+    gtk_adjustment_set_upper (adjustment, DPI_HIGH_REASONABLE_VALUE);
+    gtk_adjustment_set_step_increment (adjustment, 1);
+
+    dpi_load (data->font_settings, GTK_SPIN_BUTTON (spinner));
+    g_signal_connect (spinner, "value-changed",
+		      G_CALLBACK (dpi_value_changed), data);
+    g_signal_connect (toggle, "state-set",
+		      G_CALLBACK (dpi_value_reset), data);
+
+    g_signal_connect (data->font_settings, "changed::" FONT_DPI_KEY, G_CALLBACK (dpi_changed), data);
+
+    /* Update font DPI when window scaling factor is changed */
+    g_signal_connect (gdk_screen_get_default (), "monitors-changed", G_CALLBACK (monitors_changed), data);
+
+    setup_font_sample (appearance_capplet_get_widget (data, "antialias_none_sample"),      ANTIALIAS_NONE,      HINT_SLIGHT);
+    setup_font_sample (appearance_capplet_get_widget (data, "antialias_grayscale_sample"), ANTIALIAS_GRAYSCALE, HINT_SLIGHT);
+    setup_font_sample (appearance_capplet_get_widget (data, "antialias_subpixel_sample"),  ANTIALIAS_RGBA,      HINT_SLIGHT);
+
+    group = enum_group_create (
+    	data->font_settings, FONT_ANTIALIASING_KEY,
+	appearance_capplet_get_widget (data, "antialias_none_radio"),      ANTIALIAS_NONE,
+	appearance_capplet_get_widget (data, "antialias_grayscale_radio"), ANTIALIAS_GRAYSCALE,
+	appearance_capplet_get_widget (data, "antialias_subpixel_radio"),  ANTIALIAS_RGBA,
+	NULL);
+    data->font_groups = g_slist_prepend (data->font_groups, group);
+
+    setup_font_sample (appearance_capplet_get_widget (data, "hint_none_sample"),   ANTIALIAS_RGBA, HINT_NONE);
+    setup_font_sample (appearance_capplet_get_widget (data, "hint_slight_sample"), ANTIALIAS_RGBA, HINT_SLIGHT);
+    setup_font_sample (appearance_capplet_get_widget (data, "hint_medium_sample"), ANTIALIAS_RGBA, HINT_MEDIUM);
+    setup_font_sample (appearance_capplet_get_widget (data, "hint_full_sample"),   ANTIALIAS_RGBA, HINT_FULL);
+
+    group = enum_group_create (data->font_settings, FONT_HINTING_KEY,
+                               appearance_capplet_get_widget (data, "hint_none_radio"),   HINT_NONE,
+                               appearance_capplet_get_widget (data, "hint_slight_radio"), HINT_SLIGHT,
+                               appearance_capplet_get_widget (data, "hint_medium_radio"), HINT_MEDIUM,
+                               appearance_capplet_get_widget (data, "hint_full_radio"),   HINT_FULL,
+                               NULL);
+    data->font_groups = g_slist_prepend (data->font_groups, group);
+
+    gtk_image_set_from_file (GTK_IMAGE (appearance_capplet_get_widget (data, "subpixel_rgb_image")),
+                             MATECC_PIXMAP_DIR "/subpixel-rgb.png");
+    gtk_image_set_from_file (GTK_IMAGE (appearance_capplet_get_widget (data, "subpixel_bgr_image")),
+                             MATECC_PIXMAP_DIR "/subpixel-bgr.png");
+    gtk_image_set_from_file (GTK_IMAGE (appearance_capplet_get_widget (data, "subpixel_vrgb_image")),
+                             MATECC_PIXMAP_DIR "/subpixel-vrgb.png");
+    gtk_image_set_from_file (GTK_IMAGE (appearance_capplet_get_widget (data, "subpixel_vbgr_image")),
+                             MATECC_PIXMAP_DIR "/subpixel-vbgr.png");
+
+    group = enum_group_create (data->font_settings, FONT_RGBA_ORDER_KEY,
+                               appearance_capplet_get_widget (data, "subpixel_rgb_radio"),  RGBA_RGB,
+                               appearance_capplet_get_widget (data, "subpixel_bgr_radio"),  RGBA_BGR,
+                               appearance_capplet_get_widget (data, "subpixel_vrgb_radio"), RGBA_VRGB,
+                               appearance_capplet_get_widget (data, "subpixel_vbgr_radio"), RGBA_VBGR,
+                               NULL);
+    data->font_groups = g_slist_prepend (data->font_groups, group);
+
+    g_signal_connect (data->font_details, "response",
+                      G_CALLBACK (cb_details_response),
+                      NULL);
+    g_signal_connect (data->font_details, "delete_event",
+                      G_CALLBACK (gtk_true),
+                      NULL);
+  }
+
+  gtk_window_present (GTK_WINDOW (data->font_details));
+}
+
+void font_init(AppearanceData* data)
+{
+	GtkWidget* widget;
+
+	data->font_details = NULL;
+	data->font_groups = NULL;
+
+	widget = appearance_capplet_get_widget(data, "application_font");
+	g_settings_bind (data->interface_settings,
+			 GTK_FONT_KEY,
+			 G_OBJECT (widget),
+			 "font-name",
+			 G_SETTINGS_BIND_DEFAULT);
+
+	widget = appearance_capplet_get_widget (data, "document_font");
+	g_settings_bind (data->interface_settings,
+			 DOCUMENT_FONT_KEY,
+			 G_OBJECT (widget),
+			 "font-name",
+			 G_SETTINGS_BIND_DEFAULT);
+
+	widget = appearance_capplet_get_widget (data, "desktop_font");
+
+	if (data->caja_settings)
+		g_settings_bind (data->caja_settings,
+				 DESKTOP_FONT_KEY,
+				 G_OBJECT (widget),
+				 "font-name",
+				 G_SETTINGS_BIND_DEFAULT);
+	else
+		gtk_widget_set_sensitive (widget, FALSE);
+
+	widget = appearance_capplet_get_widget (data, "window_title_font");
+	g_settings_bind (data->marco_settings,
+			 WINDOW_TITLE_FONT_KEY,
+			 G_OBJECT (widget),
+			 "font-name",
+			 G_SETTINGS_BIND_DEFAULT);
+
+	widget = appearance_capplet_get_widget (data, "monospace_font");
+	g_settings_bind (data->interface_settings,
+			 MONOSPACE_FONT_KEY,
+			 G_OBJECT (widget),
+			 "font-name",
+			 G_SETTINGS_BIND_DEFAULT);
+
+	g_signal_connect (data->marco_settings,
+			  "changed::" WINDOW_TITLE_USES_SYSTEM_KEY,
+			  G_CALLBACK (marco_changed),
+			  data);
+
+	g_signal_connect (appearance_capplet_get_widget (data, "add_new_font"), "clicked", G_CALLBACK (cb_add_new_font), data);
+
+	marco_titlebar_load_sensitivity(data);
+
+	setup_font_pair(appearance_capplet_get_widget(data, "monochrome_radio"), appearance_capplet_get_widget (data, "monochrome_sample"), ANTIALIAS_NONE, HINT_FULL);
+	setup_font_pair(appearance_capplet_get_widget(data, "best_shapes_radio"), appearance_capplet_get_widget (data, "best_shapes_sample"), ANTIALIAS_GRAYSCALE, HINT_MEDIUM);
+	setup_font_pair(appearance_capplet_get_widget(data, "best_contrast_radio"), appearance_capplet_get_widget (data, "best_contrast_sample"), ANTIALIAS_GRAYSCALE, HINT_FULL);
+	setup_font_pair(appearance_capplet_get_widget(data, "subpixel_radio"), appearance_capplet_get_widget (data, "subpixel_sample"), ANTIALIAS_RGBA, HINT_SLIGHT);
+
+	font_render_load (data->font_settings);
+
+	g_signal_connect (data->font_settings, "changed", G_CALLBACK (font_render_changed), NULL);
+
+	g_signal_connect (appearance_capplet_get_widget (data, "details_button"), "clicked", G_CALLBACK (cb_show_details), data);
+}
+
+void font_shutdown (AppearanceData *data)
+{
+	g_slist_free_full (data->font_groups, enum_group_destroy);
+	g_slist_free_full (font_pairs, g_free);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/16.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/16.html new file mode 100644 index 00000000..d5df6470 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/16.html @@ -0,0 +1,743 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * Copyright (C) 2007 The GNOME Foundation
+ * Written by Thomas Wood <thos@gnome.org>
+ * All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libmate-desktop/mate-gsettings.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "appearance.h"
+#include "appearance-desktop.h"
+#include "appearance-font.h"
+#include "appearance-themes.h"
+#include "appearance-style.h"
+#include "appearance-ui.h"
+#include "appearance-support.h"
+#include "theme-installer.h"
+#include "theme-thumbnail.h"<--- Include file: "theme-thumbnail.h" not found.
+#include "activate-settings-daemon.h"<--- Include file: "activate-settings-daemon.h" not found.
+#include "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+
+static AppearanceData *
+init_appearance_data (int *argc, char ***argv, GOptionContext *context)
+{
+  AppearanceData *data = NULL;
+  GtkBuilder *ui;
+
+  theme_thumbnail_factory_init (*argc, *argv);
+  capplet_init (context, argc, argv);
+  activate_settings_daemon ();
+
+  /* set up the data */
+  ui = gtk_builder_new_from_resource ("/org/mate/mcc/appearance/data/appearance.ui");
+
+  data = g_new (AppearanceData, 1);
+  data->settings = g_settings_new (APPEARANCE_SCHEMA);
+  data->wp_settings = g_settings_new (WP_SCHEMA);
+
+  if (mate_gsettings_schema_exists (CAJA_SCHEMA))
+    data->caja_settings = g_settings_new (CAJA_SCHEMA);
+  else
+    data->caja_settings = NULL;
+
+  data->filechooser_settings = g_settings_new (FILECHOOSER_SCHEMA);
+  data->interface_settings = g_settings_new (INTERFACE_SCHEMA);
+  data->marco_settings = g_settings_new (MARCO_SCHEMA);
+  data->mouse_settings = g_settings_new (MOUSE_SCHEMA);
+  data->font_settings = g_settings_new (FONT_RENDER_SCHEMA);
+  data->ui = ui;
+  data->thumb_factory = mate_desktop_thumbnail_factory_new (MATE_DESKTOP_THUMBNAIL_SIZE_NORMAL);
+
+  return data;
+}
+
+static void
+main_window_response (GtkWidget *widget,
+                      gint response_id,
+                      AppearanceData *data)
+{
+  if (response_id == GTK_RESPONSE_CLOSE ||
+      response_id == GTK_RESPONSE_DELETE_EVENT)
+  {
+    gtk_main_quit ();
+
+    themes_shutdown (data);
+    style_shutdown (data);
+    desktop_shutdown (data);
+    font_shutdown (data);
+    support_shutdown (data);
+
+    g_object_unref (data->thumb_factory);
+    g_object_unref (data->settings);
+    g_object_unref (data->wp_settings);
+
+    if (data->caja_settings)
+      g_object_unref (data->caja_settings);
+
+    g_object_unref (data->filechooser_settings);
+    g_object_unref (data->interface_settings);
+    g_object_unref (data->marco_settings);
+    g_object_unref (data->mouse_settings);
+    g_object_unref (data->font_settings);
+    g_object_unref (data->ui);
+  }
+  else if (response_id == GTK_RESPONSE_HELP)
+  {
+      GtkNotebook *nb;
+      gint pindex;
+
+      nb = GTK_NOTEBOOK (appearance_capplet_get_widget (data, "main_notebook"));
+      pindex = gtk_notebook_get_current_page (nb);
+
+      switch (pindex)
+      {
+        case 0: /* theme */
+          capplet_help (GTK_WINDOW (widget), "goscustdesk-12");
+          break;
+        case 1: /* background */
+          capplet_help (GTK_WINDOW (widget), "goscustdesk-7");
+          break;
+        case 2: /* fonts */
+          capplet_help (GTK_WINDOW (widget), "goscustdesk-38");
+          break;
+        case 3: /* interface */
+          capplet_help (GTK_WINDOW (widget), "goscustuserinter-2");
+          break;
+        default:
+          capplet_help (GTK_WINDOW (widget), "prefs-look-and-feel");
+          break;
+       }
+  }
+}
+
+int
+main (int argc, char **argv)
+{
+  AppearanceData *data;
+  GtkWidget *w;
+  GtkWidget *nb;
+  GtkWidget *nb_custom_theme;
+  GtkStyleContext *context;
+
+  gchar *install_filename = NULL;
+  gchar *start_page = NULL;
+  gchar **wallpaper_files = NULL;
+  GOptionContext *option_context;
+  GOptionEntry option_entries[] = {
+      { "install-theme",
+        'i',
+        G_OPTION_FLAG_IN_MAIN,
+        G_OPTION_ARG_FILENAME,
+        &install_filename,
+        N_("Specify the filename of a theme to install"),
+        N_("filename") },
+      { "show-page",
+        'p',
+        G_OPTION_FLAG_IN_MAIN,
+        G_OPTION_ARG_STRING,
+        &start_page,
+        /* TRANSLATORS: don't translate the terms in brackets */
+        N_("Specify the name of the page to show (theme|background|fonts|interface)"),
+        N_("page") },
+      { G_OPTION_REMAINING,
+      	0,
+      	G_OPTION_FLAG_IN_MAIN,
+      	G_OPTION_ARG_FILENAME_ARRAY,
+      	&wallpaper_files,
+      	NULL,
+      	N_("[WALLPAPER...]") },
+      { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
+    };
+
+  option_context = g_option_context_new (NULL);
+  g_option_context_add_main_entries (option_context, option_entries, GETTEXT_PACKAGE);
+
+  /* init */
+  data = init_appearance_data (&argc, &argv, option_context);
+  if (!data)
+    return 1;
+
+  /* init tabs */
+  themes_init (data);
+  style_init (data);
+  desktop_init (data, (const gchar **) wallpaper_files);
+  g_strfreev (wallpaper_files);
+  font_init (data);
+  ui_init (data);
+
+  /* init support for other window managers */
+  support_init (data);
+
+  /* prepare the main window */
+  w = appearance_capplet_get_widget (data, "appearance_window");
+  context = gtk_widget_get_style_context (w);
+  gtk_style_context_add_class (context, "appearance-window");
+
+  capplet_set_icon (w, "preferences-desktop-theme");
+  gtk_widget_show_all (w);
+
+#if !GTK_CHECK_VERSION(3, 24, 12)
+  gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (data->ui, "filechooser_type_column_toggle")));
+#endif /* !GTK_CHECK_VERSION(3, 24, 12) */
+
+  g_signal_connect_after (w, "response",
+                          (GCallback) main_window_response, data);
+
+  /* default to background page if files were given on the command line */
+  if (wallpaper_files && !install_filename && !start_page)
+    start_page = g_strdup ("background");
+
+  nb = appearance_capplet_get_widget (data, "main_notebook");
+  gtk_widget_add_events (nb, GDK_SCROLL_MASK);
+  g_signal_connect (nb,
+                    "scroll-event",
+                    G_CALLBACK (capplet_notebook_scroll_event_cb),
+                    NULL);
+
+  if (start_page != NULL) {
+    gchar *page_name;
+
+    page_name = g_strconcat (start_page, "_vbox", NULL);
+    g_free (start_page);
+
+    w = appearance_capplet_get_widget (data, page_name);
+    if (w != NULL) {
+      gint pindex;
+      GtkNotebook *notebook;
+
+      notebook = GTK_NOTEBOOK (nb);
+      pindex = gtk_notebook_page_num (notebook, w);
+      if (pindex != -1)
+        gtk_notebook_set_current_page (notebook, pindex);
+    }
+    g_free (page_name);
+  }
+
+  if (install_filename != NULL) {
+    GFile *inst = g_file_new_for_commandline_arg (install_filename);
+    g_free (install_filename);
+    mate_theme_install (inst, GTK_WINDOW (w));
+    g_object_unref (inst);
+  }
+
+  g_option_context_free (option_context);
+
+  nb_custom_theme = appearance_capplet_get_widget (data, "notebook2");
+  gtk_widget_add_events (nb_custom_theme, GDK_SCROLL_MASK);
+  g_signal_connect (nb_custom_theme,
+                    "scroll-event",
+                    G_CALLBACK (capplet_notebook_scroll_event_cb),
+                    NULL);
+
+  /* start the mainloop */
+  gtk_main ();
+
+  /* free stuff */
+  g_free (data);
+
+  return 0;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/17.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/17.html new file mode 100644 index 00000000..9014320e --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/17.html @@ -0,0 +1,2407 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
   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
/*
+ * Copyright (C) 2007, 2010 The GNOME Foundation
+ * Written by Thomas Wood <thos@gnome.org>
+ * All Rights Reserved
+ *
+ * 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.
+ */
+
+#include "appearance.h"
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <pango/pango.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 "theme-util.h"
+#include "gtkrc-utils.h"<--- Include file: "gtkrc-utils.h" not found.
+#include "theme-thumbnail.h"<--- Include file: "theme-thumbnail.h" not found.
+#include "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+#include "appearance-style.h"
+
+#define GSETTINGS_SETTINGS "GSETTINGS_SETTINGS"
+#define GSETTINGS_KEY      "GSETTINGS_KEY"
+#define THEME_DATA         "THEME_DATA"
+
+typedef void (* ThumbnailGenFunc) (void               *type,
+				   ThemeThumbnailFunc  theme,
+				   AppearanceData     *data,
+				   GDestroyNotify     *destroy);
+
+typedef struct {
+  AppearanceData *data;
+  GdkPixbuf *thumbnail;
+} ThemeConvData;
+
+static void update_message_area (AppearanceData *data);
+static void create_thumbnail (const gchar *name, GdkPixbuf *default_thumb, AppearanceData *data);
+
+static const gchar *symbolic_names[NUM_SYMBOLIC_COLORS] = {
+  "fg_color", "bg_color",
+  "text_color", "base_color",
+  "selected_fg_color", "selected_bg_color",
+  "tooltip_fg_color", "tooltip_bg_color"
+};
+
+static gchar *
+find_string_in_model (GtkTreeModel *model, const gchar *value, gint column)
+{
+  GtkTreeIter iter;
+  gboolean valid;
+  gchar *path = NULL, *test;
+
+  if (!value)
+    return NULL;
+
+  for (valid = gtk_tree_model_get_iter_first (model, &iter); valid;
+       valid = gtk_tree_model_iter_next (model, &iter))
+  {
+    gtk_tree_model_get (model, &iter, column, &test, -1);
+
+    if (test)
+    {
+      gint cmp = strcmp (test, value);
+      g_free (test);
+
+      if (!cmp)
+      {
+        path = gtk_tree_model_get_string_from_iter (model, &iter);
+        break;
+      }
+    }
+  }
+
+  return path;
+}
+
+static void
+treeview_gsettings_changed_callback (GSettings *settings, gchar *key, GtkTreeView *list)
+{
+  GtkTreeModel *store;
+  gchar *curr_value;
+  gchar *path;
+
+  /* find value in model */
+  curr_value = g_settings_get_string (settings, key);
+  store = gtk_tree_view_get_model (list);
+
+  path = find_string_in_model (store, curr_value, COL_NAME);
+
+  /* Add a temporary item if we can't find a match
+   * TODO: delete this item if it is no longer selected?
+   */
+  if (!path)
+  {
+    GtkListStore *list_store;
+    GtkTreeIter iter, sort_iter;
+    ThemeConvData *conv;
+
+    list_store = GTK_LIST_STORE (gtk_tree_model_sort_get_model (GTK_TREE_MODEL_SORT (store)));
+
+    conv = g_object_get_data (G_OBJECT(list), THEME_DATA);
+    gtk_list_store_insert_with_values (list_store, &iter, 0,
+                                       COL_LABEL, curr_value,
+                                       COL_NAME, curr_value,
+                                       COL_THUMBNAIL, conv->thumbnail,
+                                       -1);
+    /* convert the tree store iter for use with the sort model */
+    gtk_tree_model_sort_convert_child_iter_to_iter (GTK_TREE_MODEL_SORT (store),
+                                                    &sort_iter, &iter);
+    path = gtk_tree_model_get_string_from_iter (store, &sort_iter);
+
+    create_thumbnail (curr_value, conv->thumbnail, conv->data);
+  }
+  /* select the new gsettings theme in treeview */
+  GtkTreeSelection *selection = gtk_tree_view_get_selection (list);
+  GtkTreePath *treepath = gtk_tree_path_new_from_string (path);
+  gtk_tree_selection_select_path (selection, treepath);
+  gtk_tree_view_scroll_to_cell (list, treepath, NULL, FALSE, 0, 0);
+  gtk_tree_path_free (treepath);
+}
+
+static void
+treeview_selection_changed_callback (GtkTreeSelection *selection, guint data)
+{
+  GSettings *settings;
+  gchar *key;
+  GtkTreeIter iter;
+  GtkTreeModel *model;
+  GtkTreeView *list;
+
+  list = gtk_tree_selection_get_tree_view (selection);
+
+  settings = g_object_get_data (G_OBJECT (list), GSETTINGS_SETTINGS);
+  key = g_object_get_data (G_OBJECT (list), GSETTINGS_KEY);
+
+  if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
+    gchar *list_value;
+
+    gtk_tree_model_get (model, &iter, COL_NAME, &list_value, -1);
+
+    if (list_value) {
+      g_settings_set_string (settings, key, list_value);
+    }
+  }
+}
+
+static gint
+cursor_theme_sort_func (GtkTreeModel *model,
+                        GtkTreeIter *a,
+                        GtkTreeIter *b,
+                        gpointer user_data)
+{
+  gchar *a_label = NULL;
+  gchar *b_label = NULL;
+  const gchar *default_label;
+  gint result;
+
+  gtk_tree_model_get (model, a, COL_LABEL, &a_label, -1);
+  gtk_tree_model_get (model, b, COL_LABEL, &b_label, -1);
+
+  default_label = _("Default Pointer");
+
+  if (!strcmp (a_label, default_label))
+    result = -1;
+  else if (!strcmp (b_label, default_label))
+    result = 1;
+  else
+    result = strcmp (a_label, b_label);
+
+  g_free (a_label);
+  g_free (b_label);
+
+  return result;
+}
+
+static void
+style_message_area_response_cb (GtkWidget *w,
+                                gint response_id,
+                                AppearanceData *data)
+{
+  GtkSettings *settings = gtk_settings_get_default ();
+  gchar *theme;
+  gchar *engine_path;
+
+  g_object_get (settings, "gtk-theme-name", &theme, NULL);
+  engine_path = gtk_theme_info_missing_engine (theme, FALSE);
+  g_free (theme);
+
+  if (engine_path != NULL) {
+    theme_install_file (GTK_WINDOW (gtk_widget_get_toplevel (data->style_message_area)),
+                        engine_path);
+    g_free (engine_path);
+  }
+  update_message_area (data);
+}
+
+static void update_message_area(AppearanceData* data)
+{
+	GtkSettings* settings = gtk_settings_get_default();
+	gchar* theme = NULL;
+	gchar* engine;
+
+	g_object_get(settings, "gtk-theme-name", &theme, NULL);
+	engine = gtk_theme_info_missing_engine(theme, TRUE);
+	g_free(theme);
+
+	if (data->style_message_area == NULL)
+	{
+		GtkWidget* hbox;
+		GtkWidget* parent;
+		GtkWidget* icon;
+		GtkWidget* content;
+
+		if (engine == NULL)
+		{
+			return;
+		}
+
+		data->style_message_area = gtk_info_bar_new ();
+
+		g_signal_connect (data->style_message_area, "response", (GCallback) style_message_area_response_cb, data);
+
+		data->style_install_button = gtk_info_bar_add_button(GTK_INFO_BAR (data->style_message_area), _("Install"), GTK_RESPONSE_APPLY);
+
+		data->style_message_label = gtk_label_new (NULL);
+		gtk_label_set_line_wrap (GTK_LABEL (data->style_message_label), TRUE);
+		gtk_label_set_xalign (GTK_LABEL (data->style_message_label), 0.0);
+
+		hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 9);
+		icon = gtk_image_new_from_icon_name ("dialog-warning", GTK_ICON_SIZE_DIALOG);
+		gtk_widget_set_halign (icon, GTK_ALIGN_CENTER);
+		gtk_widget_set_valign (icon, GTK_ALIGN_START);
+		gtk_box_pack_start (GTK_BOX (hbox), icon, FALSE, FALSE, 0);
+		gtk_box_pack_start (GTK_BOX (hbox), data->style_message_label, TRUE, TRUE, 0);
+		content = gtk_info_bar_get_content_area (GTK_INFO_BAR (data->style_message_area));
+		gtk_container_add (GTK_CONTAINER (content), hbox);
+		gtk_widget_show_all (data->style_message_area);
+		gtk_widget_set_no_show_all (data->style_message_area, TRUE);
+
+		parent = appearance_capplet_get_widget (data, "gtk_themes_vbox");
+		gtk_box_pack_start (GTK_BOX (parent), data->style_message_area, FALSE, FALSE, 0);
+	}
+
+  g_free (engine);
+  gtk_widget_hide(data->style_message_area);
+}
+
+static void
+update_color_buttons_from_string (const gchar *color_scheme, AppearanceData *data)
+{
+  GdkRGBA colors[NUM_SYMBOLIC_COLORS];
+  GtkWidget *widget;
+  gint i;
+
+  if (!mate_theme_color_scheme_parse (color_scheme, colors))
+    return;
+
+  /* now set all the buttons to the correct settings */
+  for (i = 0; i < NUM_SYMBOLIC_COLORS; ++i) {
+    widget = appearance_capplet_get_widget (data, symbolic_names[i]);
+    gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (widget), &colors[i]);
+  }
+}
+
+static void
+update_color_buttons_from_settings (GtkSettings *settings,
+                                    AppearanceData *data)
+{
+  gchar *scheme, *setting;
+
+  scheme = g_settings_get_string (data->interface_settings, COLOR_SCHEME_KEY);
+  g_object_get (settings, "gtk-color-scheme", &setting, NULL);
+
+  if (scheme == NULL || strcmp (scheme, "") == 0)
+    gtk_widget_set_sensitive (appearance_capplet_get_widget (data, "color_scheme_defaults_button"), FALSE);
+
+  g_free (scheme);
+  update_color_buttons_from_string (setting, data);
+  g_free (setting);
+}
+
+static void
+color_scheme_changed (GObject    *settings,
+                      GParamSpec *pspec,
+                      AppearanceData  *data)
+{
+  update_color_buttons_from_settings (GTK_SETTINGS (settings), data);
+}
+
+static void
+check_color_schemes_enabled (GtkSettings *settings,
+                             AppearanceData *data)
+{
+  gchar *theme = NULL;
+  gchar *filename;
+  GSList *symbolic_colors = NULL;
+  gboolean enable_colors = FALSE;
+  gint i;
+
+  g_object_get (settings, "gtk-theme-name", &theme, NULL);
+  filename = gtkrc_find_named (theme);
+  g_free (theme);
+
+  gtkrc_get_details (filename, NULL, &symbolic_colors);
+  g_free (filename);
+
+  for (i = 0; i < NUM_SYMBOLIC_COLORS; ++i) {
+    gboolean found;
+
+    found = (g_slist_find_custom (symbolic_colors, symbolic_names[i], (GCompareFunc) strcmp) != NULL);
+    gtk_widget_set_sensitive (appearance_capplet_get_widget (data, symbolic_names[i]), found);
+
+    enable_colors |= found;
+  }
+
+  g_slist_free_full (symbolic_colors, g_free);
+
+  gtk_widget_set_sensitive (appearance_capplet_get_widget (data, "color_scheme_table"), enable_colors);
+  gtk_widget_set_sensitive (appearance_capplet_get_widget (data, "color_scheme_defaults_button"), enable_colors);
+
+  if (enable_colors)
+    gtk_widget_hide (appearance_capplet_get_widget (data, "color_scheme_message_hbox"));
+  else
+    gtk_widget_show (appearance_capplet_get_widget (data, "color_scheme_message_hbox"));
+}
+
+static void
+color_button_clicked_cb (GtkWidget *colorbutton, AppearanceData *data)
+{
+  GtkWidget *widget;
+  GdkRGBA color;
+  GString *scheme = g_string_new (NULL);
+  gchar *colstr;
+  gchar *old_scheme = NULL;
+  gint i;
+
+  for (i = 0; i < NUM_SYMBOLIC_COLORS; ++i) {
+    widget = appearance_capplet_get_widget (data, symbolic_names[i]);
+    gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (widget), &color);
+
+    colstr = gdk_rgba_to_string (&color);
+    g_string_append_printf (scheme, "%s:%s\n", symbolic_names[i], colstr);
+    g_free (colstr);
+  }
+  /* remove the last newline */
+  g_string_truncate (scheme, scheme->len - 1);
+
+  /* verify that the scheme really has changed */
+  g_object_get (gtk_settings_get_default (), "gtk-color-scheme", &old_scheme, NULL);
+
+  if (!mate_theme_color_scheme_equal (old_scheme, scheme->str)) {
+    g_settings_set_string (data->interface_settings, COLOR_SCHEME_KEY, scheme->str);
+
+    gtk_widget_set_sensitive (appearance_capplet_get_widget (data, "color_scheme_defaults_button"), TRUE);
+  }
+  g_free (old_scheme);
+  g_string_free (scheme, TRUE);
+}
+
+static void
+color_scheme_defaults_button_clicked_cb (GtkWidget *button, AppearanceData *data)
+{
+  g_settings_reset (data->interface_settings, COLOR_SCHEME_KEY);
+  gtk_widget_set_sensitive (appearance_capplet_get_widget (data, "color_scheme_defaults_button"), FALSE);
+}
+
+static void
+style_response_cb (GtkDialog *dialog, gint response_id)
+{
+  if (response_id == GTK_RESPONSE_HELP) {
+    capplet_help (GTK_WINDOW (dialog), "goscustdesk-61");
+  } else {
+    gtk_widget_hide (GTK_WIDGET (dialog));
+  }
+}
+
+static void
+gtk_theme_changed (GSettings *settings, gchar *key, AppearanceData *data)
+{
+  MateThemeInfo *theme = NULL;
+  gchar *name;
+  GtkSettings *gtksettings = gtk_settings_get_default ();
+
+  name = g_settings_get_string (settings, key);
+  if (name) {
+    gchar *current;
+
+    theme = mate_theme_info_find (name);
+
+    /* Manually update GtkSettings to new gtk+ theme.
+     * This will eventually happen anyway, but we need the
+     * info for the color scheme updates already. */
+    g_object_get (gtksettings, "gtk-theme-name", &current, NULL);
+
+    if (strcmp (current, name) != 0) {
+      g_object_set (gtksettings, "gtk-theme-name", name, NULL);
+      update_message_area (data);
+    }
+
+    g_free (current);
+
+    check_color_schemes_enabled (gtksettings, data);
+    update_color_buttons_from_settings (gtksettings, data);
+    g_free (name);
+  }
+
+  gtk_widget_set_sensitive (appearance_capplet_get_widget (data, "gtk_themes_delete"),
+			    theme_is_writable (theme));
+}
+
+static void
+window_theme_changed (GSettings *settings, gchar *key, AppearanceData *data)
+{
+  MateThemeInfo *theme = NULL;
+  gchar *name;
+
+  name = g_settings_get_string (settings, key);
+  if (name)
+  {
+    theme = mate_theme_info_find (name);
+    g_free (name);
+  }
+
+  gtk_widget_set_sensitive (appearance_capplet_get_widget (data, "window_themes_delete"),
+			    theme_is_writable (theme));
+}
+
+static void
+icon_theme_changed (GSettings *settings, gchar *key, AppearanceData *data)
+{
+  MateThemeIconInfo *theme = NULL;
+  gchar *name;
+
+  name = g_settings_get_string (settings, key);
+  if (name) {
+    theme = mate_theme_icon_info_find (name);
+    g_free (name);
+}
+
+  gtk_widget_set_sensitive (appearance_capplet_get_widget (data, "icon_themes_delete"),
+			    theme_is_writable (theme));
+}
+
+static void
+cursor_size_changed_cb (int size, AppearanceData *data)
+{
+  g_settings_set_int (data->mouse_settings, CURSOR_SIZE_KEY, size);
+}
+
+static void
+cursor_size_scale_value_changed_cb (GtkRange *range, AppearanceData *data)
+{
+  MateThemeCursorInfo *theme;
+  gchar *name;
+
+  name = g_settings_get_string (data->mouse_settings, CURSOR_THEME_KEY);
+  if (name == NULL)
+    return;
+
+  theme = mate_theme_cursor_info_find (name);
+  g_free (name);
+
+  if (theme) {
+    gdouble value;
+    gint size;
+
+    value = gtk_range_get_value (range);
+    size = g_array_index (theme->sizes, gint, (int) value);
+    cursor_size_changed_cb (size, data);
+  }
+}
+
+static void
+update_cursor_size_scale (MateThemeCursorInfo *theme,
+                          AppearanceData *data)
+{
+  GtkWidget *cursor_size_scale;
+  GtkWidget *cursor_size_label;
+  GtkWidget *cursor_size_small_label;
+  GtkWidget *cursor_size_large_label;
+  gboolean sensitive;
+  gint size, gsettings_size;
+
+  cursor_size_scale = appearance_capplet_get_widget (data, "cursor_size_scale");
+  cursor_size_label = appearance_capplet_get_widget (data, "cursor_size_label");
+  cursor_size_small_label = appearance_capplet_get_widget (data, "cursor_size_small_label");
+  cursor_size_large_label = appearance_capplet_get_widget (data, "cursor_size_large_label");
+
+  sensitive = theme && theme->sizes->len > 1;
+  gtk_widget_set_sensitive (cursor_size_scale, sensitive);
+  gtk_widget_set_sensitive (cursor_size_label, sensitive);
+  gtk_widget_set_sensitive (cursor_size_small_label, sensitive);
+  gtk_widget_set_sensitive (cursor_size_large_label, sensitive);
+
+  gsettings_size = g_settings_get_int (data->mouse_settings, CURSOR_SIZE_KEY);
+
+  if (sensitive) {
+    GtkAdjustment *adjustment;
+    gint i, index;
+    GtkRange *range = GTK_RANGE (cursor_size_scale);
+
+    adjustment = gtk_range_get_adjustment (range);
+    g_object_set (adjustment, "upper", (gdouble) theme->sizes->len - 1, NULL);
+
+    /* fallback if the gsettings value is bigger than all available sizes;
+       use the largest we have */
+    index = theme->sizes->len - 1;
+
+    /* set the slider to the cursor size which matches the gsettings setting best  */
+    for (i = 0; i < theme->sizes->len; i++) {
+      size = g_array_index (theme->sizes, gint, i);
+
+      if (size == gsettings_size) {
+      	index = i;
+        break;
+      } else if (size > gsettings_size) {
+        if (i == 0) {
+          index = 0;
+        } else {
+          gint diff, diff_to_last;
+
+          diff = size - gsettings_size;
+          diff_to_last = gsettings_size - g_array_index (theme->sizes, gint, i - 1);
+
+          index = (diff < diff_to_last) ? i : i - 1;
+        }
+        break;
+      }
+    }
+
+    gtk_range_set_value (range, (gdouble) index);
+
+    size = g_array_index (theme->sizes, gint, index);
+  } else {
+    if (theme && theme->sizes->len > 0)
+      size = g_array_index (theme->sizes, gint, 0);
+    else
+      size = 24;
+  }
+
+  if (size != gsettings_size)
+    cursor_size_changed_cb (size, data);
+}
+
+static void
+cursor_theme_changed (GSettings *settings, gchar *key, AppearanceData *data)
+{
+  MateThemeCursorInfo *theme = NULL;
+  gchar *name;
+
+  name = g_settings_get_string (settings, key);
+  if (name) {
+    theme = mate_theme_cursor_info_find (name);
+    g_free (name);
+  }
+
+  update_cursor_size_scale (theme, data);
+
+  gtk_widget_set_sensitive (appearance_capplet_get_widget (data, "cursor_themes_delete"),
+			    theme_is_writable (theme));
+
+}
+
+static void
+generic_theme_delete (const gchar *tv_name, ThemeType type, AppearanceData *data)
+{
+  GtkTreeView *treeview = GTK_TREE_VIEW (appearance_capplet_get_widget (data, tv_name));
+  GtkTreeSelection *selection = gtk_tree_view_get_selection (treeview);
+  GtkTreeModel *model;
+  GtkTreeIter iter;
+
+  if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
+    gchar *name;
+
+    gtk_tree_model_get (model, &iter, COL_NAME, &name, -1);
+
+    if (name != NULL && theme_delete (name, type)) {
+      /* remove theme from the model, too */
+      GtkTreeIter child;
+      GtkTreePath *path;
+
+      path = gtk_tree_model_get_path (model, &iter);
+      gtk_tree_model_sort_convert_iter_to_child_iter (
+          GTK_TREE_MODEL_SORT (model), &child, &iter);
+      gtk_list_store_remove (GTK_LIST_STORE (
+          gtk_tree_model_sort_get_model (GTK_TREE_MODEL_SORT (model))), &child);
+
+      if (gtk_tree_model_get_iter (model, &iter, path) ||
+          theme_model_iter_last (model, &iter)) {
+        gtk_tree_path_free (path);
+        path = gtk_tree_model_get_path (model, &iter);
+	gtk_tree_selection_select_path (selection, path);
+	gtk_tree_view_scroll_to_cell (treeview, path, NULL, FALSE, 0, 0);
+      }
+      gtk_tree_path_free (path);
+    }
+    g_free (name);
+  }
+}
+
+static void
+gtk_theme_delete_cb (GtkWidget *button, AppearanceData *data)
+{
+  generic_theme_delete ("gtk_themes_list", THEME_TYPE_GTK, data);
+}
+
+static void
+window_theme_delete_cb (GtkWidget *button, AppearanceData *data)
+{
+  generic_theme_delete ("window_themes_list", THEME_TYPE_WINDOW, data);
+}
+
+static void
+icon_theme_delete_cb (GtkWidget *button, AppearanceData *data)
+{
+  generic_theme_delete ("icon_themes_list", THEME_TYPE_ICON, data);
+}
+
+static void
+cursor_theme_delete_cb (GtkWidget *button, AppearanceData *data)
+{
+  generic_theme_delete ("cursor_themes_list", THEME_TYPE_CURSOR, data);
+}
+
+static void
+add_to_treeview (const gchar *tv_name,
+		 const gchar *theme_name,
+		 const gchar *theme_label,
+		 GdkPixbuf *theme_thumbnail,
+		 AppearanceData *data)
+{
+  GtkTreeView *treeview;
+  GtkListStore *model;
+
+  treeview = GTK_TREE_VIEW (appearance_capplet_get_widget (data, tv_name));
+  model = GTK_LIST_STORE (
+          gtk_tree_model_sort_get_model (
+          GTK_TREE_MODEL_SORT (gtk_tree_view_get_model (treeview))));
+
+  gtk_list_store_insert_with_values (model, NULL, 0,
+          COL_LABEL, theme_label,
+          COL_NAME, theme_name,
+          COL_THUMBNAIL, theme_thumbnail,
+          -1);
+}
+
+static void
+remove_from_treeview (const gchar *tv_name,
+		      const gchar *theme_name,
+		      AppearanceData *data)
+{
+  GtkTreeView *treeview;
+  GtkListStore *model;
+  GtkTreeIter iter;
+
+  treeview = GTK_TREE_VIEW (appearance_capplet_get_widget (data, tv_name));
+  model = GTK_LIST_STORE (
+          gtk_tree_model_sort_get_model (
+          GTK_TREE_MODEL_SORT (gtk_tree_view_get_model (treeview))));
+
+  if (theme_find_in_model (GTK_TREE_MODEL (model), theme_name, &iter))
+    gtk_list_store_remove (model, &iter);
+}
+
+static void
+update_in_treeview (const gchar *tv_name,
+		    const gchar *theme_name,
+		    const gchar *theme_label,
+		    AppearanceData *data)
+{
+  GtkTreeView *treeview;
+  GtkListStore *model;
+  GtkTreeIter iter;
+
+  treeview = GTK_TREE_VIEW (appearance_capplet_get_widget (data, tv_name));
+  model = GTK_LIST_STORE (
+          gtk_tree_model_sort_get_model (
+          GTK_TREE_MODEL_SORT (gtk_tree_view_get_model (treeview))));
+
+  if (theme_find_in_model (GTK_TREE_MODEL (model), theme_name, &iter)) {
+    gtk_list_store_set (model, &iter,
+          COL_LABEL, theme_label,
+          COL_NAME, theme_name,
+          -1);
+  }
+}
+
+static void
+update_thumbnail_in_treeview (const gchar *tv_name,
+		    const gchar *theme_name,
+		    GdkPixbuf *theme_thumbnail,
+		    AppearanceData *data)
+{
+  GtkTreeView *treeview;
+  GtkListStore *model;
+  GtkTreeIter iter;
+
+  if (theme_thumbnail == NULL)
+    return;
+
+  treeview = GTK_TREE_VIEW (appearance_capplet_get_widget (data, tv_name));
+  model = GTK_LIST_STORE (
+          gtk_tree_model_sort_get_model (
+          GTK_TREE_MODEL_SORT (gtk_tree_view_get_model (treeview))));
+
+  if (theme_find_in_model (GTK_TREE_MODEL (model), theme_name, &iter)) {
+    gtk_list_store_set (model, &iter,
+          COL_THUMBNAIL, theme_thumbnail,
+          -1);
+  }
+}
+
+static void
+gtk_theme_thumbnail_cb (GdkPixbuf *pixbuf,
+                        gchar *theme_name,<--- Parameter 'theme_name' can be declared as pointer to const
+                        AppearanceData *data)
+{
+  update_thumbnail_in_treeview ("gtk_themes_list", theme_name, pixbuf, data);
+}
+
+static void
+marco_theme_thumbnail_cb (GdkPixbuf *pixbuf,
+                             gchar *theme_name,<--- Parameter 'theme_name' can be declared as pointer to const
+                             AppearanceData *data)
+{
+  update_thumbnail_in_treeview ("window_themes_list", theme_name, pixbuf, data);
+}
+
+static void
+icon_theme_thumbnail_cb (GdkPixbuf *pixbuf,
+                         gchar *theme_name,<--- Parameter 'theme_name' can be declared as pointer to const
+                         AppearanceData *data)
+{
+  update_thumbnail_in_treeview ("icon_themes_list", theme_name, pixbuf, data);
+}
+
+static void
+create_thumbnail (const gchar *name, GdkPixbuf *default_thumb, AppearanceData *data)<--- Parameter 'default_thumb' can be declared as pointer to const
+{
+  if (default_thumb == data->icon_theme_icon) {
+    MateThemeIconInfo *info;
+    info = mate_theme_icon_info_find (name);
+    if (info != NULL) {
+      generate_icon_theme_thumbnail_async (info,
+          (ThemeThumbnailFunc) icon_theme_thumbnail_cb, data, NULL);
+    }
+  } else if (default_thumb == data->gtk_theme_icon) {
+    MateThemeInfo *info;
+    info = mate_theme_info_find (name);
+    if (info != NULL && info->has_gtk) {
+      generate_gtk_theme_thumbnail_async (info,
+          (ThemeThumbnailFunc) gtk_theme_thumbnail_cb, data, NULL);
+    }
+  } else if (default_thumb == data->window_theme_icon) {
+    MateThemeInfo *info;
+    info = mate_theme_info_find (name);
+    if (info != NULL && info->has_marco) {
+      generate_marco_theme_thumbnail_async (info,
+          (ThemeThumbnailFunc) marco_theme_thumbnail_cb, data, NULL);
+    }
+  }
+}
+
+static void
+changed_on_disk_cb (MateThemeCommonInfo *theme,
+		    MateThemeChangeType  change_type,
+                    MateThemeElement     element_type,
+		    AppearanceData       *data)
+{
+  if (theme->type == MATE_THEME_TYPE_REGULAR) {
+    MateThemeInfo *info = (MateThemeInfo *) theme;
+
+    if (change_type == MATE_THEME_CHANGE_DELETED) {
+      if (element_type & MATE_THEME_GTK_2)
+        remove_from_treeview ("gtk_themes_list", info->name, data);
+      if (element_type & MATE_THEME_MARCO)
+        remove_from_treeview ("window_themes_list", info->name, data);
+
+    } else {
+      if (element_type & MATE_THEME_GTK_2) {
+        if (change_type == MATE_THEME_CHANGE_CREATED)
+          add_to_treeview ("gtk_themes_list", info->name, info->name, data->gtk_theme_icon, data);
+        else if (change_type == MATE_THEME_CHANGE_CHANGED)
+          update_in_treeview ("gtk_themes_list", info->name, info->name, data);
+
+        generate_gtk_theme_thumbnail_async (info,
+            (ThemeThumbnailFunc) gtk_theme_thumbnail_cb, data, NULL);
+      }
+
+      if (element_type & MATE_THEME_MARCO) {
+        if (change_type == MATE_THEME_CHANGE_CREATED)
+          add_to_treeview ("window_themes_list", info->name, info->name, data->window_theme_icon, data);
+        else if (change_type == MATE_THEME_CHANGE_CHANGED)
+          update_in_treeview ("window_themes_list", info->name, info->name, data);
+
+        generate_marco_theme_thumbnail_async (info,
+            (ThemeThumbnailFunc) marco_theme_thumbnail_cb, data, NULL);
+      }
+    }
+
+  } else if (theme->type == MATE_THEME_TYPE_ICON) {
+    MateThemeIconInfo *info = (MateThemeIconInfo *) theme;
+
+    if (change_type == MATE_THEME_CHANGE_DELETED) {
+      remove_from_treeview ("icon_themes_list", info->name, data);
+    } else {
+      if (change_type == MATE_THEME_CHANGE_CREATED)
+        add_to_treeview ("icon_themes_list", info->name, info->readable_name, data->icon_theme_icon, data);
+      else if (change_type == MATE_THEME_CHANGE_CHANGED)
+        update_in_treeview ("icon_themes_list", info->name, info->readable_name, data);
+
+      generate_icon_theme_thumbnail_async (info,
+          (ThemeThumbnailFunc) icon_theme_thumbnail_cb, data, NULL);
+    }
+
+  } else if (theme->type == MATE_THEME_TYPE_CURSOR) {
+    MateThemeCursorInfo *info = (MateThemeCursorInfo *) theme;
+
+    if (change_type == MATE_THEME_CHANGE_DELETED) {
+      remove_from_treeview ("cursor_themes_list", info->name, data);
+    } else {
+      if (change_type == MATE_THEME_CHANGE_CREATED)
+        add_to_treeview ("cursor_themes_list", info->name, info->readable_name, info->thumbnail, data);
+      else if (change_type == MATE_THEME_CHANGE_CHANGED)
+        update_in_treeview ("cursor_themes_list", info->name, info->readable_name, data);
+    }
+  }
+}
+
+static void
+prepare_list (AppearanceData *data, GtkWidget *list, ThemeType type, GCallback callback)
+{
+  GtkListStore *store;
+  GList *l, *themes = NULL;
+  GtkCellRenderer *renderer;
+  GtkTreeViewColumn *column;
+  GtkTreeModel *sort_model;
+  GdkPixbuf *thumbnail;
+  const gchar *key;
+  ThumbnailGenFunc generator;
+  ThemeThumbnailFunc thumb_cb;
+  ThemeConvData *conv_data;
+  GSettings *settings;
+
+  switch (type)
+  {
+    case THEME_TYPE_GTK:
+      themes = mate_theme_info_find_by_type (MATE_THEME_GTK_2);
+      thumbnail = data->gtk_theme_icon;
+      settings = data->interface_settings;
+      key = GTK_THEME_KEY;
+      generator = (ThumbnailGenFunc) generate_gtk_theme_thumbnail_async;
+      thumb_cb = (ThemeThumbnailFunc) gtk_theme_thumbnail_cb;<--- You might need to cast the function pointer here
+      break;
+
+    case THEME_TYPE_WINDOW:
+      themes = mate_theme_info_find_by_type (MATE_THEME_MARCO);
+      thumbnail = data->window_theme_icon;
+      settings = data->marco_settings;
+      key = MARCO_THEME_KEY;
+      generator = (ThumbnailGenFunc) generate_marco_theme_thumbnail_async;
+      thumb_cb = (ThemeThumbnailFunc) marco_theme_thumbnail_cb;<--- You might need to cast the function pointer here
+      break;
+
+    case THEME_TYPE_ICON:
+      themes = mate_theme_icon_info_find_all ();
+      thumbnail = data->icon_theme_icon;
+      settings = data->interface_settings;
+      key = ICON_THEME_KEY;
+      generator = (ThumbnailGenFunc) generate_icon_theme_thumbnail_async;
+      thumb_cb = (ThemeThumbnailFunc) icon_theme_thumbnail_cb;<--- You might need to cast the function pointer here
+      break;
+
+    case THEME_TYPE_CURSOR:
+      themes = mate_theme_cursor_info_find_all ();
+      thumbnail = NULL;
+      settings = data->mouse_settings;
+      key = CURSOR_THEME_KEY;
+      generator = NULL;
+      thumb_cb = NULL;
+      break;
+
+    default:
+      /* we don't deal with any other type of themes here */
+      return;
+  }
+
+  store = gtk_list_store_new (NUM_COLS, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING);
+
+  for (l = themes; l; l = g_list_next (l))
+  {
+    MateThemeCommonInfo *theme = (MateThemeCommonInfo *) l->data;
+    GtkTreeIter i;
+
+    if (type == THEME_TYPE_CURSOR) {
+      thumbnail = ((MateThemeCursorInfo *) theme)->thumbnail;
+    } else {
+      generator (theme, thumb_cb, data, NULL);
+    }
+
+    gtk_list_store_insert_with_values (store, &i, 0,
+                                       COL_LABEL, theme->readable_name,
+                                       COL_NAME, theme->name,
+                                       COL_THUMBNAIL, thumbnail,
+                                       -1);
+
+    if (type == THEME_TYPE_CURSOR && thumbnail) {
+      g_object_unref (thumbnail);
+      thumbnail = NULL;
+    }
+  }
+  g_list_free (themes);
+
+  sort_model = gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL (store));
+  gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (sort_model),
+                                        COL_LABEL, GTK_SORT_ASCENDING);
+
+  if (type == THEME_TYPE_CURSOR)
+    gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (sort_model), COL_LABEL,
+                                     (GtkTreeIterCompareFunc) cursor_theme_sort_func,
+                                     NULL, NULL);
+
+  gtk_tree_view_set_model (GTK_TREE_VIEW (list), GTK_TREE_MODEL (sort_model));
+
+  renderer = gtk_cell_renderer_pixbuf_new ();
+  g_object_set (renderer, "xpad", 3, "ypad", 3, NULL);
+
+  column = gtk_tree_view_column_new ();
+  gtk_tree_view_column_pack_start (column, renderer, FALSE);
+  gtk_tree_view_column_add_attribute (column, renderer, "pixbuf", COL_THUMBNAIL);
+  gtk_tree_view_append_column (GTK_TREE_VIEW (list), column);
+
+  renderer = gtk_cell_renderer_text_new ();
+
+  column = gtk_tree_view_column_new ();
+  gtk_tree_view_column_pack_start (column, renderer, FALSE);
+  gtk_tree_view_column_add_attribute (column, renderer, "text", COL_LABEL);
+  gtk_tree_view_append_column (GTK_TREE_VIEW (list), column);
+
+  conv_data = g_new (ThemeConvData, 1);
+  conv_data->data = data;
+  conv_data->thumbnail = thumbnail;
+
+  /* set useful data for callbacks */
+  g_object_set_data_full (G_OBJECT (list), THEME_DATA, conv_data, g_free);
+  g_object_set_data (G_OBJECT (list), GSETTINGS_SETTINGS, settings);
+  g_object_set_data_full (G_OBJECT (list), GSETTINGS_KEY, g_strdup(key), g_free);
+
+  /* select in treeview the theme set in gsettings */
+  GtkTreeModel *treemodel;
+  treemodel = gtk_tree_view_get_model (GTK_TREE_VIEW (list));
+  gchar *theme = g_settings_get_string (settings, key);
+  gchar *path = find_string_in_model (treemodel, theme, COL_NAME);
+  if (path)
+  {
+    GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (list));
+    GtkTreePath *treepath = gtk_tree_path_new_from_string (path);
+    gtk_tree_selection_select_path (selection, treepath);
+    gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (list), treepath, NULL, FALSE, 0, 0);
+    gtk_tree_path_free (treepath);
+    g_free (path);
+  }
+  if (theme)
+    g_free (theme);
+
+  /* connect to gsettings change event */
+  gchar *signal_name = g_strdup_printf("changed::%s", key);
+  g_signal_connect (settings, signal_name,
+      G_CALLBACK (treeview_gsettings_changed_callback), list);
+  g_signal_connect (settings, signal_name, callback, data);
+  g_free (signal_name);
+
+  /* connect to treeview change event */
+  g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (list)),
+      "changed", G_CALLBACK (treeview_selection_changed_callback), list);
+}
+
+void
+style_init (AppearanceData *data)
+{
+  GtkSettings *settings;
+  GtkWidget *w;
+  gchar *label;
+  gint i;
+
+  data->gtk_theme_icon = gdk_pixbuf_new_from_file (MATECC_PIXMAP_DIR "/gtk-theme-thumbnailing.png", NULL);
+  data->window_theme_icon = gdk_pixbuf_new_from_file (MATECC_PIXMAP_DIR "/window-theme-thumbnailing.png", NULL);
+  data->icon_theme_icon = gdk_pixbuf_new_from_file (MATECC_PIXMAP_DIR "/icon-theme-thumbnailing.png", NULL);
+  data->style_message_area = NULL;
+  data->style_message_label = NULL;
+  data->style_install_button = NULL;
+
+  w = appearance_capplet_get_widget (data, "theme_details");
+  g_signal_connect (w, "response", (GCallback) style_response_cb, NULL);
+  g_signal_connect (w, "delete_event", (GCallback) gtk_true, NULL);
+
+  prepare_list (data, appearance_capplet_get_widget (data, "window_themes_list"), THEME_TYPE_WINDOW, (GCallback) window_theme_changed);
+  prepare_list (data, appearance_capplet_get_widget (data, "gtk_themes_list"), THEME_TYPE_GTK, (GCallback) gtk_theme_changed);
+  prepare_list (data, appearance_capplet_get_widget (data, "icon_themes_list"), THEME_TYPE_ICON, (GCallback) icon_theme_changed);
+  prepare_list (data, appearance_capplet_get_widget (data, "cursor_themes_list"), THEME_TYPE_CURSOR, (GCallback) cursor_theme_changed);
+
+  window_theme_changed (data->marco_settings, MARCO_THEME_KEY, data);
+  gtk_theme_changed (data->interface_settings, GTK_THEME_KEY, data);
+  icon_theme_changed (data->interface_settings, ICON_THEME_KEY, data);
+  cursor_theme_changed (data->mouse_settings, CURSOR_THEME_KEY, data);
+
+  GtkNotebook *style_nb = GTK_NOTEBOOK (appearance_capplet_get_widget (data, "notebook2"));
+  gtk_notebook_remove_page (style_nb, 1);
+
+  w = appearance_capplet_get_widget (data, "color_scheme_message_hbox");
+  gtk_widget_set_no_show_all (w, TRUE);
+
+  settings = gtk_settings_get_default ();
+  g_signal_connect (settings, "notify::gtk-color-scheme", (GCallback) color_scheme_changed, data);
+
+  w = appearance_capplet_get_widget (data, "cursor_size_scale");
+  g_signal_connect (w, "value-changed", (GCallback) cursor_size_scale_value_changed_cb, data);
+
+  w = appearance_capplet_get_widget (data, "cursor_size_small_label");
+  label = g_strdup_printf ("<small><i>%s</i></small>", gtk_label_get_text (GTK_LABEL (w)));
+  gtk_label_set_markup (GTK_LABEL (w), label);
+  g_free (label);
+
+  w = appearance_capplet_get_widget (data, "cursor_size_large_label");
+  label = g_strdup_printf ("<small><i>%s</i></small>", gtk_label_get_text (GTK_LABEL (w)));
+  gtk_label_set_markup (GTK_LABEL (w), label);
+  g_free (label);
+
+  /* connect signals */
+  /* color buttons */
+  for (i = 0; i < NUM_SYMBOLIC_COLORS; ++i)
+    g_signal_connect (appearance_capplet_get_widget (data, symbolic_names[i]), "color-set", (GCallback) color_button_clicked_cb, data);
+
+  /* revert button */
+  g_signal_connect (appearance_capplet_get_widget (data, "color_scheme_defaults_button"), "clicked", (GCallback) color_scheme_defaults_button_clicked_cb, data);
+  /* delete buttons */
+  g_signal_connect (appearance_capplet_get_widget (data, "gtk_themes_delete"), "clicked", (GCallback) gtk_theme_delete_cb, data);
+  g_signal_connect (appearance_capplet_get_widget (data, "window_themes_delete"), "clicked", (GCallback) window_theme_delete_cb, data);
+  g_signal_connect (appearance_capplet_get_widget (data, "icon_themes_delete"), "clicked", (GCallback) icon_theme_delete_cb, data);
+  g_signal_connect (appearance_capplet_get_widget (data, "cursor_themes_delete"), "clicked", (GCallback) cursor_theme_delete_cb, data);
+
+  update_message_area (data);
+  mate_theme_info_register_theme_change ((ThemeChangedCallback) changed_on_disk_cb, data);
+}
+
+void
+style_shutdown (AppearanceData *data)
+{
+  if (data->gtk_theme_icon)
+    g_object_unref (data->gtk_theme_icon);
+  if (data->window_theme_icon)
+    g_object_unref (data->window_theme_icon);
+  if (data->icon_theme_icon)
+    g_object_unref (data->icon_theme_icon);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/18.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/18.html new file mode 100644 index 00000000..1a4f16cb --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/18.html @@ -0,0 +1,511 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * Copyright (C) 2012 Stefano Karapetsas
+ * Copyright (C) 2012-2021 MATE Developers
+ * Authors: Stefano Karapetsas <stefano@karapetsas.com>
+ * All Rights Reserved
+ *
+ * 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.
+ */
+
+#include "appearance.h"
+#include "wm-common.h"<--- Include file: "wm-common.h" not found.
+#include "appearance-support.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.
+
+static gboolean
+is_program_in_path (const char *program)
+{
+    char *tmp = g_find_program_in_path (program);
+    if (tmp != NULL)
+    {
+        g_free (tmp);
+        return TRUE;
+    }
+    else
+    {
+        return FALSE;
+    }
+}
+
+static gboolean
+metacity_is_running(void)
+{
+    gboolean is_running = FALSE;
+    gchar *current_wm = NULL;
+
+    current_wm = wm_common_get_current_window_manager ();
+
+    is_running = (g_strcmp0(current_wm, WM_COMMON_METACITY) == 0) ||
+                 (g_strcmp0(current_wm, WM_COMMON_COMPIZ_OLD) == 0) ||
+                 (g_strcmp0(current_wm, WM_COMMON_COMPIZ) == 0);
+
+    g_free (current_wm);
+
+    return is_running;
+}
+
+static void
+metacity_theme_apply(const gchar *theme, const gchar *font)
+{
+    /* set theme, we use gconf and gsettings binaries to avoid schemas and versions issues */
+    if (is_program_in_path ("gconftool-2"))
+    {
+        gchar *gconf_cmd = NULL;
+
+        gconf_cmd = g_strdup_printf("gconftool-2 --set --type string /apps/metacity/general/theme '%s'", theme);
+        g_spawn_command_line_async (gconf_cmd, NULL);
+        g_free (gconf_cmd);
+
+        gconf_cmd = g_strdup_printf("gconftool-2 --set --type string /apps/metacity/general/titlebar_font '%s'", font);
+        g_spawn_command_line_async (gconf_cmd, NULL);
+        g_free (gconf_cmd);
+    }
+
+    if (is_program_in_path ("gsettings"))
+    {
+        gchar *gsettings_cmd = NULL;
+
+        /* for GNOME3 */
+        gsettings_cmd = g_strdup_printf("gsettings set org.gnome.desktop.wm.preferences theme '%s'", theme);
+        g_spawn_command_line_async (gsettings_cmd, NULL);
+        g_free (gsettings_cmd);
+
+        gsettings_cmd = g_strdup_printf("gsettings set org.gnome.desktop.wm.preferences titlebar-font '%s'", font);
+        g_spawn_command_line_async (gsettings_cmd, NULL);
+        g_free (gsettings_cmd);
+
+        /* for metacity >= 3.16 */
+        gsettings_cmd = g_strdup_printf("gsettings set org.gnome.metacity theme '%s'", theme);
+        g_spawn_command_line_async (gsettings_cmd, NULL);
+        g_free (gsettings_cmd);
+
+        /* for metacity >= 3.20 */
+        gsettings_cmd = g_strdup_printf("gsettings set org.gnome.metacity.theme name '%s'", theme);
+        g_spawn_command_line_async (gsettings_cmd, NULL);
+        g_free (gsettings_cmd);
+    }
+}
+
+static void
+marco_theme_changed(GSettings *settings, gchar *key, AppearanceData* data)
+{
+    gchar *theme = NULL;
+    gchar *font = NULL;
+    if (metacity_is_running ())
+    {
+        theme = g_settings_get_string (settings, MARCO_THEME_KEY);
+        font = g_settings_get_string (settings, WINDOW_TITLE_FONT_KEY);
+        metacity_theme_apply (theme, font);
+        g_free (theme);
+        g_free (font);
+    }
+}
+
+void
+support_init(AppearanceData* data)
+{
+    /* needed for wm_common_get_current_window_manager() */
+    wm_common_update_window ();
+    /* GSettings signals */
+    g_signal_connect (data->marco_settings, "changed::" MARCO_THEME_KEY,
+                      G_CALLBACK (marco_theme_changed), data);
+    g_signal_connect (data->marco_settings, "changed::" WINDOW_TITLE_FONT_KEY,
+                      G_CALLBACK (marco_theme_changed), data);
+    /* apply theme at start */
+    if (metacity_is_running ())
+        marco_theme_changed (data->marco_settings, NULL, data);
+}
+
+void
+support_shutdown(AppearanceData* data)
+{
+    /* nothing to do */
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/19.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/19.html new file mode 100644 index 00000000..207f4ab1 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/19.html @@ -0,0 +1,2545 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
   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
/*
+ * Copyright (C) 2007, 2010 The GNOME Foundation
+ * Written by Thomas Wood <thos@gnome.org>
+ *            Jens Granseuer <jensgr@gmx.net>
+ * All Rights Reserved
+ *
+ * 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.
+ */
+
+#include "appearance.h"
+#include "theme-thumbnail.h"<--- Include file: "theme-thumbnail.h" not found.
+#include "mate-theme-apply.h"<--- Include file: "mate-theme-apply.h" not found.
+#include "theme-installer.h"
+#include "theme-save.h"
+#include "theme-util.h"
+#include "gtkrc-utils.h"<--- Include file: "gtkrc-utils.h" not found.
+#include "appearance-themes.h"
+
+#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.
+#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 <libmate-desktop/mate-gsettings.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define CUSTOM_THEME_NAME "__custom__"
+
+enum {
+	RESPONSE_APPLY_BG,
+	RESPONSE_REVERT_FONT,
+	RESPONSE_APPLY_FONT,
+	RESPONSE_INSTALL_ENGINE
+};
+
+enum {
+	TARGET_URI_LIST,
+	TARGET_NS_URL
+};
+
+static const GtkTargetEntry drop_types[] =
+{
+	{"text/uri-list", 0, TARGET_URI_LIST},
+	{"_NETSCAPE_URL", 0, TARGET_NS_URL}
+};
+
+static void theme_message_area_update(AppearanceData* data);
+
+static time_t theme_get_mtime(const char* name)
+{
+	MateThemeMetaInfo* theme;
+	time_t mtime = -1;
+
+	theme = mate_theme_meta_info_find(name);
+	if (theme != NULL)
+	{
+		GFile* file;
+		GFileInfo* file_info;
+
+		file = g_file_new_for_path(theme->path);
+		file_info = g_file_query_info(file, G_FILE_ATTRIBUTE_TIME_MODIFIED, G_FILE_QUERY_INFO_NONE, NULL, NULL);
+		g_object_unref(file);
+
+		if (file_info != NULL)
+		{
+			mtime = g_file_info_get_attribute_uint64(file_info, G_FILE_ATTRIBUTE_TIME_MODIFIED);
+			g_object_unref(file_info);
+		}
+	}
+
+	return mtime;
+}
+
+static void theme_thumbnail_update(GdkPixbuf* pixbuf, gchar* theme_name, AppearanceData* data, gboolean cache)
+{
+	GtkTreeIter iter;
+	GtkTreeModel* model = GTK_TREE_MODEL(data->theme_store);
+
+	/* find item in model and update thumbnail */
+	if (!pixbuf)
+		return;
+
+	if (theme_find_in_model(model, theme_name, &iter))
+	{
+		time_t mtime;
+
+		gtk_list_store_set(data->theme_store, &iter, COL_THUMBNAIL, pixbuf, -1);
+
+		/* cache thumbnail */
+		if (cache && (mtime = theme_get_mtime(theme_name)) != -1)
+		{
+			gchar* path;
+
+			/* try to share thumbs with caja, use themes:/// */
+			path = g_strconcat("themes:///", theme_name, NULL);
+
+			mate_desktop_thumbnail_factory_save_thumbnail(data->thumb_factory, pixbuf, path, mtime);
+
+			g_free(path);
+		}
+	}
+}
+
+static GdkPixbuf* theme_get_thumbnail_from_cache(MateThemeMetaInfo* info, AppearanceData* data)
+{
+	GdkPixbuf* thumb = NULL;
+	gchar* path, *thumb_filename;
+	time_t mtime;
+
+	if (info == data->theme_custom)
+		return NULL;
+
+	mtime = theme_get_mtime(info->name);
+
+	if (mtime == -1)
+		return NULL;
+
+	/* try to share thumbs with caja, use themes:/// */
+	path = g_strconcat ("themes:///", info->name, NULL);
+	thumb_filename = mate_desktop_thumbnail_factory_lookup(data->thumb_factory, path, mtime);
+	g_free(path);
+
+	if (thumb_filename != NULL)
+	{
+		thumb = gdk_pixbuf_new_from_file(thumb_filename, NULL);
+		g_free(thumb_filename);
+	}
+
+	return thumb;
+}
+
+static void
+theme_thumbnail_done_cb (GdkPixbuf *pixbuf, gchar *theme_name, AppearanceData *data)
+{
+  theme_thumbnail_update (pixbuf, theme_name, data, TRUE);
+}
+
+static void theme_thumbnail_generate(MateThemeMetaInfo* info, AppearanceData* data)
+{
+	GdkPixbuf* thumb = theme_get_thumbnail_from_cache(info, data);
+
+	if (thumb != NULL)
+	{
+		theme_thumbnail_update(thumb, info->name, data, FALSE);
+		g_object_unref(thumb);
+	}
+	else
+	{
+		generate_meta_theme_thumbnail_async(info, (ThemeThumbnailFunc) theme_thumbnail_done_cb, data, NULL);
+	}
+}
+
+static void theme_changed_on_disk_cb(MateThemeCommonInfo* theme, MateThemeChangeType change_type, MateThemeElement element_type, AppearanceData* data)
+{
+	if (theme->type == MATE_THEME_TYPE_METATHEME)
+	{
+		MateThemeMetaInfo* meta = (MateThemeMetaInfo*) theme;
+
+		if (change_type == MATE_THEME_CHANGE_CREATED)
+		{
+			gtk_list_store_insert_with_values (data->theme_store, NULL, 0, COL_LABEL, meta->readable_name, COL_NAME, meta->name, COL_THUMBNAIL, data->theme_icon, -1);
+			theme_thumbnail_generate(meta, data);
+		}
+		else if (change_type == MATE_THEME_CHANGE_DELETED)
+		{
+			GtkTreeIter iter;
+
+			if (theme_find_in_model(GTK_TREE_MODEL(data->theme_store), meta->name, &iter))
+			{
+				gtk_list_store_remove(data->theme_store, &iter);
+			}
+		}
+		else if (change_type == MATE_THEME_CHANGE_CHANGED)
+		{
+			theme_thumbnail_generate(meta, data);
+		}
+	}
+}
+
+/* Find out if the lockdown key has been set. */
+static gboolean is_locked_down(void)
+{
+  gboolean is_locked;
+  GSettings *settings;
+  settings = g_settings_new (LOCKDOWN_SCHEMA);
+  is_locked = g_settings_get_boolean (settings, DISABLE_THEMES_SETTINGS_KEY);
+  g_object_unref (settings);
+  return is_locked;
+}
+
+static MateThemeMetaInfo *
+theme_load_from_gsettings (AppearanceData *data)
+{
+  MateThemeMetaInfo *theme;
+  gchar *scheme;
+
+  theme = mate_theme_meta_info_new ();
+
+  theme->gtk_theme_name = g_settings_get_string (data->interface_settings, GTK_THEME_KEY);
+  if (theme->gtk_theme_name == NULL)
+    theme->gtk_theme_name = g_strdup ("Menta");
+
+  scheme = g_settings_get_string (data->interface_settings, COLOR_SCHEME_KEY);
+  if (scheme == NULL || !strcmp (scheme, "")) {
+    g_free (scheme);
+    scheme = gtkrc_get_color_scheme_for_theme (theme->gtk_theme_name);
+  }
+  theme->gtk_color_scheme = scheme;
+
+  theme->marco_theme_name = g_settings_get_string (data->marco_settings, MARCO_THEME_KEY);
+  if (theme->marco_theme_name == NULL)
+    theme->marco_theme_name = g_strdup ("Menta");
+
+  theme->icon_theme_name = g_settings_get_string (data->interface_settings, ICON_THEME_KEY);
+  if (theme->icon_theme_name == NULL)
+    theme->icon_theme_name = g_strdup ("menta");
+
+  if (mate_gsettings_schema_exists (NOTIFICATION_SCHEMA)) {
+    GSettings *notification_settings;
+    notification_settings = g_settings_new (NOTIFICATION_SCHEMA);
+    theme->notification_theme_name = g_settings_get_string (notification_settings, NOTIFICATION_THEME_KEY);
+    g_object_unref (notification_settings);
+  }
+  else
+    theme->notification_theme_name = NULL;
+
+  theme->cursor_theme_name = g_settings_get_string (data->mouse_settings, CURSOR_THEME_KEY);
+  theme->cursor_size = g_settings_get_int (data->mouse_settings, CURSOR_SIZE_KEY);
+
+  if (theme->cursor_theme_name == NULL)
+    theme->cursor_theme_name = g_strdup ("default");
+
+  theme->application_font = g_settings_get_string (data->interface_settings, GTK_FONT_KEY);
+
+  return theme;
+}
+
+static gchar *
+theme_get_selected_name (GtkIconView *icon_view, AppearanceData *data)
+{
+  gchar *name = NULL;
+  GList *selected = gtk_icon_view_get_selected_items (icon_view);
+
+  if (selected) {
+    GtkTreePath *path = selected->data;
+    GtkTreeModel *model = gtk_icon_view_get_model (icon_view);
+    GtkTreeIter iter;
+
+    if (gtk_tree_model_get_iter (model, &iter, path))
+      gtk_tree_model_get (model, &iter, COL_NAME, &name, -1);
+
+    g_list_foreach (selected, (GFunc) gtk_tree_path_free, NULL);
+    g_list_free (selected);
+  }
+
+  return name;
+}
+
+static const MateThemeMetaInfo *
+theme_get_selected (GtkIconView *icon_view, AppearanceData *data)
+{
+  MateThemeMetaInfo *theme = NULL;
+  gchar *name = theme_get_selected_name (icon_view, data);
+
+  if (name != NULL) {
+    if (!strcmp (name, data->theme_custom->name)) {
+      theme = data->theme_custom;
+    } else {
+      theme = mate_theme_meta_info_find (name);
+    }
+
+    g_free (name);
+  }
+
+  return theme;
+}
+
+static void
+theme_select_iter (GtkIconView *icon_view, GtkTreeIter *iter)
+{
+  GtkTreePath *path;
+
+  path = gtk_tree_model_get_path (gtk_icon_view_get_model (icon_view), iter);
+  gtk_icon_view_select_path (icon_view, path);
+  gtk_icon_view_scroll_to_path (icon_view, path, FALSE, 0.5, 0.0);
+  gtk_tree_path_free (path);
+}
+
+static void
+theme_select_name (GtkIconView *icon_view, const gchar *theme)
+{
+  GtkTreeIter iter;
+  GtkTreeModel *model = gtk_icon_view_get_model (icon_view);
+
+  if (theme_find_in_model (model, theme, &iter))
+    theme_select_iter (icon_view, &iter);
+}
+
+static gboolean
+theme_is_equal (const MateThemeMetaInfo *a, const MateThemeMetaInfo *b)
+{
+  gboolean a_set, b_set;
+
+  if (!(a->gtk_theme_name && b->gtk_theme_name) ||
+      strcmp (a->gtk_theme_name, b->gtk_theme_name))
+    return FALSE;
+
+  if (!(a->icon_theme_name && b->icon_theme_name) ||
+      strcmp (a->icon_theme_name, b->icon_theme_name))
+    return FALSE;
+
+  if (!(a->marco_theme_name && b->marco_theme_name) ||
+      strcmp (a->marco_theme_name, b->marco_theme_name))
+    return FALSE;
+
+  if (!(a->cursor_theme_name && b->cursor_theme_name) ||
+      strcmp (a->cursor_theme_name, b->cursor_theme_name))
+    return FALSE;
+
+  if (a->cursor_size != b->cursor_size)
+    return FALSE;
+
+  a_set = a->gtk_color_scheme && strcmp (a->gtk_color_scheme, "");
+  b_set = b->gtk_color_scheme && strcmp (b->gtk_color_scheme, "");
+  if ((a_set != b_set) ||
+      (a_set && !mate_theme_color_scheme_equal (a->gtk_color_scheme, b->gtk_color_scheme)))
+    return FALSE;
+
+  return TRUE;
+}
+
+static void
+theme_set_custom_from_theme (const MateThemeMetaInfo *info, AppearanceData *data)
+{
+  MateThemeMetaInfo *custom = data->theme_custom;
+  GtkIconView *icon_view = GTK_ICON_VIEW (appearance_capplet_get_widget (data, "theme_list"));
+  GtkTreeModel *model;
+  GtkTreeIter iter;
+  GtkTreePath *path;
+
+  if (info == custom)
+    return;
+
+  /* if info is not NULL, we'll copy those theme settings over */
+  if (info != NULL) {
+    g_free (custom->gtk_theme_name);
+    g_free (custom->icon_theme_name);
+    g_free (custom->marco_theme_name);
+    g_free (custom->gtk_color_scheme);
+    g_free (custom->cursor_theme_name);
+    g_free (custom->application_font);
+    custom->gtk_color_scheme = NULL;
+    custom->application_font = NULL;
+
+    /* these settings are guaranteed to be non-NULL */
+    custom->gtk_theme_name = g_strdup (info->gtk_theme_name);
+    custom->icon_theme_name = g_strdup (info->icon_theme_name);
+    custom->marco_theme_name = g_strdup (info->marco_theme_name);
+    custom->cursor_theme_name = g_strdup (info->cursor_theme_name);
+    custom->cursor_size = info->cursor_size;
+
+    /* these can be NULL */
+    if (info->gtk_color_scheme)
+      custom->gtk_color_scheme = g_strdup (info->gtk_color_scheme);
+    else
+      custom->gtk_color_scheme = g_strdup ("");
+
+    if (info->application_font)
+      custom->application_font = g_strdup (info->application_font);
+    else
+      custom->application_font = g_strdup (GTK_FONT_DEFAULT_VALUE);
+  }
+
+  /* select the custom theme */
+  model = gtk_icon_view_get_model (icon_view);
+  if (!theme_find_in_model (model, custom->name, &iter)) {
+    GtkTreeIter child;
+
+    gtk_list_store_insert_with_values (data->theme_store, &child, 0,
+        COL_LABEL, custom->readable_name,
+        COL_NAME, custom->name,
+        COL_THUMBNAIL, data->theme_icon,
+        -1);
+    gtk_tree_model_sort_convert_child_iter_to_iter (
+        GTK_TREE_MODEL_SORT (model), &iter, &child);
+  }
+
+  path = gtk_tree_model_get_path (model, &iter);
+  gtk_icon_view_select_path (icon_view, path);
+  gtk_icon_view_scroll_to_path (icon_view, path, FALSE, 0.5, 0.0);
+  gtk_tree_path_free (path);
+
+  /* update the theme thumbnail */
+  theme_thumbnail_generate (custom, data);
+}
+
+/** GUI Callbacks **/
+
+static void custom_font_cb(GtkWidget* button, AppearanceData* data)
+{
+  g_free(data->revert_application_font);
+  g_free(data->revert_documents_font);
+  g_free(data->revert_desktop_font);
+  g_free(data->revert_windowtitle_font);
+  g_free(data->revert_monospace_font);
+  data->revert_application_font = NULL;
+  data->revert_documents_font = NULL;
+  data->revert_desktop_font = NULL;
+  data->revert_windowtitle_font = NULL;
+  data->revert_monospace_font = NULL;
+}
+
+static void
+theme_message_area_response_cb (GtkWidget *w,
+                                gint response_id,
+                                AppearanceData *data)
+{
+  const MateThemeMetaInfo *theme;
+  gchar *tmpfont;
+  gchar *engine_path;
+
+  theme = theme_get_selected (GTK_ICON_VIEW (appearance_capplet_get_widget (data, "theme_list")), data);
+  if (!theme)
+    return;
+
+  switch (response_id)
+  {
+    case RESPONSE_APPLY_BG:
+      g_settings_set_string (data->wp_settings, WP_FILE_KEY, theme->background_image);
+      break;
+
+    case RESPONSE_REVERT_FONT:
+      if (data->revert_application_font != NULL) {
+        g_settings_set_string (data->interface_settings, GTK_FONT_KEY, data->revert_application_font);
+        g_free (data->revert_application_font);
+        data->revert_application_font = NULL;
+      }
+
+      if (data->revert_documents_font != NULL) {
+        g_settings_set_string (data->interface_settings, DOCUMENT_FONT_KEY, data->revert_documents_font);
+        g_free (data->revert_documents_font);
+        data->revert_documents_font = NULL;
+      }
+
+      if (data->caja_settings && data->revert_desktop_font != NULL) {
+        g_settings_set_string (data->caja_settings, DESKTOP_FONT_KEY, data->revert_desktop_font);
+        g_free (data->revert_desktop_font);
+        data->revert_desktop_font = NULL;
+      }
+
+      if (data->revert_windowtitle_font != NULL) {
+        g_settings_set_string (data->marco_settings, WINDOW_TITLE_FONT_KEY, data->revert_windowtitle_font);
+        g_free (data->revert_windowtitle_font);
+        data->revert_windowtitle_font = NULL;
+      }
+
+      if (data->revert_monospace_font != NULL) {
+        g_settings_set_string (data->interface_settings, MONOSPACE_FONT_KEY, data->revert_monospace_font);
+        g_free (data->revert_monospace_font);
+        data->revert_monospace_font = NULL;
+      }
+      break;
+
+    case RESPONSE_APPLY_FONT:
+      if (theme->application_font) {
+        tmpfont = g_settings_get_string (data->interface_settings, GTK_FONT_KEY);
+        if (tmpfont != NULL) {
+          g_free (data->revert_application_font);
+
+          if (strcmp (theme->application_font, tmpfont) == 0) {
+            g_free (tmpfont);
+            data->revert_application_font = NULL;
+          } else
+            data->revert_application_font = tmpfont;
+        }
+        g_settings_set_string (data->interface_settings, GTK_FONT_KEY, theme->application_font);
+      }
+
+      if (theme->documents_font) {
+        tmpfont = g_settings_get_string (data->interface_settings, DOCUMENT_FONT_KEY);
+        if (tmpfont != NULL) {
+          g_free (data->revert_documents_font);
+
+          if (strcmp (theme->documents_font, tmpfont) == 0) {
+            g_free (tmpfont);
+            data->revert_documents_font = NULL;
+          } else
+            data->revert_documents_font = tmpfont;
+        }
+        g_settings_set_string (data->interface_settings, DOCUMENT_FONT_KEY, theme->documents_font);
+      }
+
+      if (data->caja_settings && theme->desktop_font) {
+        tmpfont = g_settings_get_string (data->caja_settings, DESKTOP_FONT_KEY);
+        if (tmpfont != NULL) {
+          g_free (data->revert_desktop_font);
+
+          if (strcmp (theme->desktop_font, tmpfont) == 0) {
+            g_free (tmpfont);
+            data->revert_desktop_font = NULL;
+          } else
+            data->revert_desktop_font = tmpfont;
+        }
+        g_settings_set_string (data->caja_settings, DESKTOP_FONT_KEY, theme->desktop_font);
+      }
+
+      if (theme->windowtitle_font) {
+        tmpfont = g_settings_get_string (data->marco_settings, WINDOW_TITLE_FONT_KEY);
+        if (tmpfont != NULL) {
+          g_free (data->revert_windowtitle_font);
+
+          if (strcmp (theme->windowtitle_font, tmpfont) == 0) {
+            g_free (tmpfont);
+            data->revert_windowtitle_font = NULL;
+          } else
+            data->revert_windowtitle_font = tmpfont;
+        }
+        g_settings_set_string (data->marco_settings, WINDOW_TITLE_FONT_KEY, theme->windowtitle_font);
+      }
+
+      if (theme->monospace_font) {
+        tmpfont = g_settings_get_string (data->interface_settings, MONOSPACE_FONT_KEY);
+        if (tmpfont != NULL) {
+          g_free (data->revert_monospace_font);
+
+          if (strcmp (theme->monospace_font, tmpfont) == 0) {
+            g_free (tmpfont);
+            data->revert_monospace_font = NULL;
+          } else
+            data->revert_monospace_font = tmpfont;
+        }
+        g_settings_set_string (data->interface_settings, MONOSPACE_FONT_KEY, theme->monospace_font);
+      }
+      break;
+
+    case RESPONSE_INSTALL_ENGINE:
+      engine_path = gtk_theme_info_missing_engine(theme->gtk_theme_name, FALSE);
+
+      if (engine_path != NULL) {
+        theme_install_file(GTK_WINDOW(gtk_widget_get_toplevel(data->install_button)), engine_path);
+        g_free (engine_path);
+      }
+
+      theme_message_area_update(data);
+      break;
+  }
+}
+
+static void
+theme_message_area_update (AppearanceData *data)
+{
+  const MateThemeMetaInfo *theme;
+  gboolean show_apply_background = FALSE;
+  gboolean show_apply_font = FALSE;
+  gboolean show_revert_font = FALSE;
+  gboolean show_error;
+  const gchar *message;
+  gchar *font;
+  GError *error = NULL;
+
+  theme = theme_get_selected (GTK_ICON_VIEW (appearance_capplet_get_widget (data, "theme_list")), data);
+
+  if (!theme) {
+    if (data->theme_message_area != NULL)
+      gtk_widget_hide (data->theme_message_area);
+    return;
+  }
+
+  show_error = !mate_theme_meta_info_validate (theme, &error);
+
+  if (!show_error) {
+    if (theme->background_image != NULL) {
+      gchar *background;
+
+      background = g_settings_get_string (data->wp_settings, WP_FILE_KEY);
+      show_apply_background =
+          (!background || strcmp (theme->background_image, background) != 0);
+      g_free (background);
+    }
+
+    if (theme->application_font) {
+      font = g_settings_get_string (data->interface_settings, GTK_FONT_KEY);
+      show_apply_font =
+          (!font || strcmp (theme->application_font, font) != 0);
+      g_free (font);
+    }
+
+    if (!show_apply_font && theme->documents_font) {
+      font = g_settings_get_string (data->interface_settings, DOCUMENT_FONT_KEY);
+      show_apply_font =
+          (!font || strcmp (theme->application_font, font) != 0);
+      g_free (font);
+    }
+
+    if (data->caja_settings && !show_apply_font && theme->desktop_font) {
+      font = g_settings_get_string (data->caja_settings, DESKTOP_FONT_KEY);
+      show_apply_font =
+          (!font || strcmp (theme->application_font, font) != 0);
+      g_free (font);
+    }
+
+    if (!show_apply_font && theme->windowtitle_font) {
+      font = g_settings_get_string (data->marco_settings, WINDOW_TITLE_FONT_KEY);
+      show_apply_font =
+          (!font || strcmp (theme->application_font, font) != 0);
+      g_free (font);
+    }
+
+    if (!show_apply_font && theme->monospace_font) {
+      font = g_settings_get_string (data->interface_settings, MONOSPACE_FONT_KEY);
+      show_apply_font =
+          (!font || strcmp (theme->application_font, font) != 0);
+      g_free (font);
+    }
+
+    show_revert_font = (data->revert_application_font != NULL ||
+      data->revert_documents_font != NULL || data->revert_desktop_font != NULL ||
+      data->revert_windowtitle_font != NULL || data->revert_monospace_font != NULL);
+  }
+
+  if (data->theme_message_area == NULL) {
+    GtkWidget *hbox;
+    GtkWidget *parent;
+    GtkWidget *content;
+
+    if (!show_apply_background && !show_revert_font && !show_apply_font && !show_error)
+      return;
+
+    data->theme_message_area = gtk_info_bar_new ();
+    gtk_widget_set_no_show_all (data->theme_message_area, TRUE);
+
+    g_signal_connect (data->theme_message_area, "response",
+                      (GCallback) theme_message_area_response_cb, data);
+
+    data->apply_background_button = gtk_info_bar_add_button (
+        GTK_INFO_BAR (data->theme_message_area),
+        _("Apply Background"),
+        RESPONSE_APPLY_BG);
+    data->apply_font_button = gtk_info_bar_add_button (
+        GTK_INFO_BAR (data->theme_message_area),
+        _("Apply Font"),
+        RESPONSE_APPLY_FONT);
+    data->revert_font_button = gtk_info_bar_add_button (
+        GTK_INFO_BAR (data->theme_message_area),
+        _("Revert Font"),
+        RESPONSE_REVERT_FONT);
+    data->install_button = gtk_info_bar_add_button (
+        GTK_INFO_BAR (data->theme_message_area),
+        _("Install"),
+        RESPONSE_INSTALL_ENGINE);
+
+    data->theme_message_label = gtk_label_new (NULL);
+    gtk_widget_show (data->theme_message_label);
+    gtk_label_set_line_wrap (GTK_LABEL (data->theme_message_label), TRUE);
+    gtk_label_set_xalign (GTK_LABEL (data->theme_message_label), 0.0);
+
+    hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 9);
+    gtk_widget_show (hbox);
+    data->theme_info_icon = gtk_image_new_from_icon_name ("dialog-information", GTK_ICON_SIZE_DIALOG);
+    data->theme_error_icon = gtk_image_new_from_icon_name ("dialog-warning", GTK_ICON_SIZE_DIALOG);
+    gtk_widget_set_halign (data->theme_info_icon, GTK_ALIGN_CENTER);
+    gtk_widget_set_valign (data->theme_info_icon, GTK_ALIGN_START);
+    gtk_widget_set_halign (data->theme_error_icon, GTK_ALIGN_CENTER);
+    gtk_widget_set_valign (data->theme_error_icon, GTK_ALIGN_START);
+    gtk_box_pack_start (GTK_BOX (hbox), data->theme_info_icon, FALSE, FALSE, 0);
+    gtk_box_pack_start (GTK_BOX (hbox), data->theme_error_icon, FALSE, FALSE, 0);
+    gtk_box_pack_start (GTK_BOX (hbox), data->theme_message_label, TRUE, TRUE, 0);
+    content = gtk_info_bar_get_content_area (GTK_INFO_BAR (data->theme_message_area));
+    gtk_container_add (GTK_CONTAINER (content), hbox);
+
+    parent = appearance_capplet_get_widget (data, "theme_list_vbox");
+    gtk_box_pack_start (GTK_BOX (parent), data->theme_message_area, FALSE, FALSE, 0);
+  }
+
+  if (show_error)
+    message = error->message;
+  else if (show_apply_background && show_apply_font && show_revert_font)
+    message = _("The current theme suggests a background and a font. Also, the last applied font suggestion can be reverted.");
+  else if (show_apply_background && show_revert_font)
+    message = _("The current theme suggests a background. Also, the last applied font suggestion can be reverted.");
+  else if (show_apply_background && show_apply_font)
+    message = _("The current theme suggests a background and a font.");
+  else if (show_apply_font && show_revert_font)
+    message = _("The current theme suggests a font. Also, the last applied font suggestion can be reverted.");
+  else if (show_apply_background)
+    message = _("The current theme suggests a background.");
+  else if (show_revert_font)
+    message = _("The last applied font suggestion can be reverted.");
+  else if (show_apply_font)
+    message = _("The current theme suggests a font.");
+  else
+    message = NULL;
+
+  if (show_apply_background)
+    gtk_widget_show (data->apply_background_button);
+  else
+    gtk_widget_hide (data->apply_background_button);
+
+  if (show_apply_font)
+    gtk_widget_show (data->apply_font_button);
+  else
+    gtk_widget_hide (data->apply_font_button);
+
+  if (show_revert_font)
+    gtk_widget_show (data->revert_font_button);
+  else
+    gtk_widget_hide (data->revert_font_button);
+
+  if (show_error
+      && g_error_matches (error, MATE_THEME_ERROR, MATE_THEME_ERROR_GTK_ENGINE_NOT_AVAILABLE)
+      && packagekit_available ())
+    gtk_widget_show (data->install_button);
+  else
+    gtk_widget_hide (data->install_button);
+
+  if (show_error || show_apply_background || show_apply_font || show_revert_font) {
+    gtk_widget_show (data->theme_message_area);
+    gtk_widget_queue_draw (data->theme_message_area);
+
+    if (show_error) {
+      gtk_widget_show (data->theme_error_icon);
+      gtk_widget_hide (data->theme_info_icon);
+    } else {
+      gtk_widget_show (data->theme_info_icon);
+      gtk_widget_hide (data->theme_error_icon);
+    }
+  } else {
+    gtk_widget_hide (data->theme_message_area);
+  }
+
+  gtk_label_set_text (GTK_LABEL (data->theme_message_label), message);
+  g_clear_error (&error);
+}
+
+static void
+theme_selection_changed_cb (GtkWidget *icon_view, AppearanceData *data)
+{
+  GList *selection;
+  MateThemeMetaInfo *theme = NULL;
+  gboolean is_custom = FALSE;<--- Variable 'is_custom' is assigned a value that is never used.
+
+  selection = gtk_icon_view_get_selected_items (GTK_ICON_VIEW (icon_view));
+
+  if (selection) {
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    gchar *name;
+
+    model = gtk_icon_view_get_model (GTK_ICON_VIEW (icon_view));
+    gtk_tree_model_get_iter (model, &iter, selection->data);
+    gtk_tree_model_get (model, &iter, COL_NAME, &name, -1);
+
+    is_custom = !strcmp (name, CUSTOM_THEME_NAME);
+
+    if (is_custom)
+      theme = data->theme_custom;
+    else
+      theme = mate_theme_meta_info_find (name);
+
+    if (theme) {
+      mate_meta_theme_set (theme);
+      theme_message_area_update (data);
+    }
+
+    g_free (name);
+    g_list_foreach (selection, (GFunc) gtk_tree_path_free, NULL);
+    g_list_free (selection);
+
+    gtk_widget_set_sensitive (appearance_capplet_get_widget (data, "theme_delete"),
+			    theme_is_writable (theme));
+    gtk_widget_set_sensitive (appearance_capplet_get_widget (data, "theme_save"), is_custom);
+  }
+}
+
+static void
+theme_custom_cb (GtkWidget *button, AppearanceData *data)
+{
+  GtkWidget *w;
+
+  w = appearance_capplet_get_widget (data, "theme_details");
+  gtk_window_set_transient_for (GTK_WINDOW (w), GET_WINDOW ("appearance_window"));
+  gtk_widget_show_all (w);
+}
+
+static void
+theme_save_cb (GtkWidget *button, AppearanceData *data)
+{
+  theme_save_dialog_run (data->theme_custom, data);
+}
+
+static void
+theme_install_cb (GtkWidget *button, AppearanceData *data)
+{
+  mate_theme_installer_run (GET_WINDOW ("appearance_window"));
+}
+
+static void
+theme_delete_cb (GtkWidget *button, AppearanceData *data)
+{
+  GtkIconView *icon_view = GTK_ICON_VIEW (appearance_capplet_get_widget (data, "theme_list"));
+  GList *selected = gtk_icon_view_get_selected_items (icon_view);
+
+  if (selected) {
+    GtkTreePath *path = selected->data;
+    GtkTreeModel *model = gtk_icon_view_get_model (icon_view);
+    GtkTreeIter iter;
+    gchar *name = NULL;
+
+    if (gtk_tree_model_get_iter (model, &iter, path))
+      gtk_tree_model_get (model, &iter, COL_NAME, &name, -1);
+
+    if (name != NULL &&
+        strcmp (name, data->theme_custom->name) &&
+        theme_delete (name, THEME_TYPE_META)) {
+      /* remove theme from the model, too */
+      GtkTreeIter child;
+
+      if (gtk_tree_model_iter_next (model, &iter) ||
+          theme_model_iter_last (model, &iter))
+        theme_select_iter (icon_view, &iter);
+
+      gtk_tree_model_get_iter (model, &iter, path);
+      gtk_tree_model_sort_convert_iter_to_child_iter (
+          GTK_TREE_MODEL_SORT (model), &child, &iter);
+      gtk_list_store_remove (data->theme_store, &child);
+    }
+
+    g_list_foreach (selected, (GFunc) gtk_tree_path_free, NULL);
+    g_list_free (selected);
+    g_free (name);
+  }
+}
+
+static void
+theme_details_changed_cb (AppearanceData *data)
+{
+  MateThemeMetaInfo *gsettings_theme;
+  const MateThemeMetaInfo *selected;
+  GtkIconView *icon_view;
+  gboolean done = FALSE;
+
+  /* load new state from gsettings */
+  gsettings_theme = theme_load_from_gsettings (data);
+
+  /* check if it's our currently selected theme */
+  icon_view = GTK_ICON_VIEW (appearance_capplet_get_widget (data, "theme_list"));
+  selected = theme_get_selected (icon_view, data);
+
+  if (!selected || !(done = theme_is_equal (selected, gsettings_theme))) {
+    /* look for a matching metatheme */
+    GList *theme_list, *l;
+
+    theme_list = mate_theme_meta_info_find_all ();
+
+    for (l = theme_list; l; l = l->next) {
+      MateThemeMetaInfo *info = l->data;<--- Variable 'info' can be declared as pointer to const
+
+      if (theme_is_equal (gsettings_theme, info)) {
+        theme_select_name (icon_view, info->name);
+        done = TRUE;
+        break;
+      }
+    }
+    g_list_free (theme_list);
+  }
+
+  if (!done)
+    /* didn't find a match, set or update custom */
+    theme_set_custom_from_theme (gsettings_theme, data);
+
+  mate_theme_meta_info_free (gsettings_theme);
+}
+
+static void
+theme_setting_changed_cb (GObject *settings,
+                          GParamSpec *pspec,
+                          AppearanceData *data)
+{
+  theme_details_changed_cb (data);
+}
+
+static void
+theme_gsettings_changed (GSettings *settings,
+                         gchar *key,
+                         AppearanceData *data)
+{
+  theme_details_changed_cb (data);
+}
+
+static gint
+theme_list_sort_func (MateThemeMetaInfo *a,<--- Parameter 'a' can be declared as pointer to const
+                      MateThemeMetaInfo *b)<--- Parameter 'b' can be declared as pointer to const
+{
+  return strcmp (a->readable_name, b->readable_name);
+}
+
+static gint
+theme_store_sort_func (GtkTreeModel *model,
+                      GtkTreeIter *a,
+                      GtkTreeIter *b,
+                      gpointer user_data)
+{
+  gchar *a_name, *a_label;
+  gint rc;
+
+  gtk_tree_model_get (model, a, COL_NAME, &a_name, COL_LABEL, &a_label, -1);
+
+  if (!strcmp (a_name, CUSTOM_THEME_NAME)) {
+    rc = -1;
+  } else {
+    gchar *b_name, *b_label;
+
+    gtk_tree_model_get (model, b, COL_NAME, &b_name, COL_LABEL, &b_label, -1);
+
+    if (!strcmp (b_name, CUSTOM_THEME_NAME)) {
+      rc = 1;
+    } else {
+      gchar *a_case, *b_case;
+
+      a_case = g_utf8_casefold (a_label, -1);
+      b_case = g_utf8_casefold (b_label, -1);
+      rc = g_utf8_collate (a_case, b_case);
+      g_free (a_case);
+      g_free (b_case);
+    }
+
+    g_free (b_name);
+    g_free (b_label);
+  }
+
+  g_free (a_name);
+  g_free (a_label);
+
+  return rc;
+}
+
+static void
+theme_drag_data_received_cb (GtkWidget *widget,
+                             GdkDragContext *context,
+                             gint x, gint y,
+                             GtkSelectionData *selection_data,
+                             guint info, guint time,
+                             AppearanceData *data)
+{
+  gchar **uris;
+
+  if (!(info == TARGET_URI_LIST || info == TARGET_NS_URL))
+    return;
+
+  uris = g_uri_list_extract_uris ((gchar *) gtk_selection_data_get_data (selection_data));
+
+  if (uris != NULL && uris[0] != NULL) {
+    GFile *f = g_file_new_for_uri (uris[0]);
+
+    mate_theme_install (f, GET_WINDOW ("appearance_window"));
+    g_object_unref (f);
+  }
+
+  g_strfreev (uris);
+}
+
+static void background_or_font_changed(GSettings *settings, gchar *key, AppearanceData* data)
+{
+	theme_message_area_update(data);
+}
+
+void themes_init(AppearanceData* data)
+{
+  GtkWidget *w, *del_button;
+  GList *theme_list, *l;
+  GtkListStore *theme_store;
+  GtkTreeModel *sort_model;
+  MateThemeMetaInfo *meta_theme = NULL;
+  GtkIconView *icon_view;
+  GtkCellRenderer *renderer;
+  GtkSettings *settings;
+  char *url;
+
+  /* initialise some stuff */
+  mate_theme_init ();
+
+  data->revert_application_font = NULL;
+  data->revert_documents_font = NULL;
+  data->revert_desktop_font = NULL;
+  data->revert_windowtitle_font = NULL;
+  data->revert_monospace_font = NULL;
+  data->theme_save_dialog = NULL;
+  data->theme_message_area = NULL;
+  data->theme_info_icon = NULL;
+  data->theme_error_icon = NULL;
+  data->theme_icon = gdk_pixbuf_new_from_file (MATECC_PIXMAP_DIR "/theme-thumbnailing.png", NULL);
+  data->theme_store = theme_store =
+      gtk_list_store_new (NUM_COLS, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING);
+
+  /* set up theme list */
+  theme_list = mate_theme_meta_info_find_all ();
+  mate_theme_info_register_theme_change ((ThemeChangedCallback) theme_changed_on_disk_cb, data);
+
+  data->theme_custom = theme_load_from_gsettings (data);
+  data->theme_custom->name = g_strdup (CUSTOM_THEME_NAME);
+  data->theme_custom->readable_name = g_strdup_printf ("<i>%s</i>", _("Custom"));
+
+  for (l = theme_list; l; l = l->next) {
+    MateThemeMetaInfo *info = l->data;
+
+    gtk_list_store_insert_with_values (theme_store, NULL, 0,
+        COL_LABEL, info->readable_name,
+        COL_NAME, info->name,
+        COL_THUMBNAIL, data->theme_icon,
+        -1);
+
+    if (!meta_theme && theme_is_equal (data->theme_custom, info))
+      meta_theme = info;
+  }
+
+  if (!meta_theme) {
+    /* add custom theme */
+    meta_theme = data->theme_custom;
+
+    gtk_list_store_insert_with_values (theme_store, NULL, 0,
+        COL_LABEL, meta_theme->readable_name,
+        COL_NAME, meta_theme->name,
+        COL_THUMBNAIL, data->theme_icon,
+        -1);
+
+    theme_thumbnail_generate (meta_theme, data);
+  }
+
+  theme_list = g_list_sort (theme_list, (GCompareFunc) theme_list_sort_func);<--- You might need to cast the function pointer here<--- You might need to cast the function pointer here
+
+  g_list_foreach (theme_list, (GFunc) theme_thumbnail_generate, data);
+  g_list_free (theme_list);
+
+  icon_view = GTK_ICON_VIEW (appearance_capplet_get_widget (data, "theme_list"));
+
+  renderer = gtk_cell_renderer_pixbuf_new ();
+  g_object_set (renderer, "xpad", 5, "ypad", 5,
+                          "xalign", 0.5, "yalign", 1.0, NULL);
+  gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (icon_view), renderer, FALSE);
+  gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (icon_view), renderer,
+                                  "pixbuf", COL_THUMBNAIL, NULL);
+
+  renderer = gtk_cell_renderer_text_new ();
+  g_object_set (renderer, "alignment", PANGO_ALIGN_CENTER,
+                          "wrap-mode", PANGO_WRAP_WORD_CHAR,
+                          "wrap-width", gtk_icon_view_get_item_width (icon_view),
+                          "width", gtk_icon_view_get_item_width (icon_view),
+                          "xalign", 0.5, "yalign", 0.0, NULL);
+
+  gtk_cell_layout_pack_end (GTK_CELL_LAYOUT (icon_view), renderer, FALSE);
+  gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (icon_view), renderer,
+                                  "markup", COL_LABEL, NULL);
+
+  sort_model = gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL (theme_store));
+  gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (sort_model), COL_LABEL, theme_store_sort_func, NULL, NULL);
+  gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (sort_model), COL_LABEL, GTK_SORT_ASCENDING);
+  gtk_icon_view_set_model (icon_view, GTK_TREE_MODEL (sort_model));
+
+  g_signal_connect (icon_view, "selection-changed", (GCallback) theme_selection_changed_cb, data);
+  g_signal_connect_after (icon_view, "realize", (GCallback) theme_select_name, meta_theme->name);
+
+  w = appearance_capplet_get_widget (data, "theme_install");
+  g_signal_connect (w, "clicked", (GCallback) theme_install_cb, data);
+
+  w = appearance_capplet_get_widget (data, "theme_save");
+  g_signal_connect (w, "clicked", (GCallback) theme_save_cb, data);
+
+  w = appearance_capplet_get_widget (data, "theme_custom");
+  g_signal_connect (w, "clicked", (GCallback) theme_custom_cb, data);
+
+  del_button = appearance_capplet_get_widget (data, "theme_delete");
+  g_signal_connect (del_button, "clicked", (GCallback) theme_delete_cb, data);
+
+  w = appearance_capplet_get_widget (data, "theme_vbox");
+  gtk_drag_dest_set (w, GTK_DEST_DEFAULT_ALL,
+		     drop_types, G_N_ELEMENTS (drop_types),
+		     GDK_ACTION_COPY | GDK_ACTION_LINK | GDK_ACTION_MOVE);
+  g_signal_connect (w, "drag-data-received", (GCallback) theme_drag_data_received_cb, data);
+  if (is_locked_down ())
+    gtk_widget_set_sensitive (w, FALSE);
+
+  w = appearance_capplet_get_widget (data, "more_themes_linkbutton");
+  url = g_settings_get_string (data->settings, MORE_THEMES_URL_KEY);
+  if (url != NULL && url[0] != '\0') {
+    gtk_link_button_set_uri (GTK_LINK_BUTTON (w), url);
+    gtk_widget_show (w);
+  } else {
+    gtk_widget_hide (w);
+  }
+  g_free (url);
+
+  /* listen to gsettings changes, too */
+  g_signal_connect (data->marco_settings, "changed::" MARCO_THEME_KEY, G_CALLBACK (theme_gsettings_changed), data);
+  g_signal_connect (data->mouse_settings, "changed::" CURSOR_THEME_KEY, G_CALLBACK (theme_gsettings_changed), data);
+  g_signal_connect (data->mouse_settings, "changed::" CURSOR_SIZE_KEY, G_CALLBACK (theme_gsettings_changed), data);
+  g_signal_connect (data->wp_settings, "changed::" WP_FILE_KEY, G_CALLBACK (background_or_font_changed), data);
+  g_signal_connect (data->interface_settings, "changed::" GTK_FONT_KEY, G_CALLBACK (background_or_font_changed), data);
+  g_signal_connect (data->interface_settings, "changed::" DOCUMENT_FONT_KEY, G_CALLBACK (background_or_font_changed), data);
+
+  if (data->caja_settings)
+    g_signal_connect (data->caja_settings, "changed::" DESKTOP_FONT_KEY, G_CALLBACK (background_or_font_changed), data);
+
+  g_signal_connect (data->marco_settings, "changed::" WINDOW_TITLE_FONT_KEY, G_CALLBACK (background_or_font_changed), data);
+  g_signal_connect (data->interface_settings, "changed::" MONOSPACE_FONT_KEY, G_CALLBACK (background_or_font_changed), data);
+
+  settings = gtk_settings_get_default ();
+  g_signal_connect (settings, "notify::gtk-color-scheme", (GCallback) theme_setting_changed_cb, data);
+  g_signal_connect (settings, "notify::gtk-theme-name", (GCallback) theme_setting_changed_cb, data);
+  g_signal_connect (settings, "notify::gtk-icon-theme-name", (GCallback) theme_setting_changed_cb, data);
+
+  /* monitor individual font choice buttons, so
+     "revert font" option (if any) can be cleared */
+  w = appearance_capplet_get_widget (data, "application_font");
+  g_signal_connect (w, "font_set", (GCallback) custom_font_cb, data);
+  w = appearance_capplet_get_widget (data, "document_font");
+  g_signal_connect (w, "font_set", (GCallback) custom_font_cb, data);
+  w = appearance_capplet_get_widget (data, "desktop_font");
+  g_signal_connect (w, "font_set", (GCallback) custom_font_cb, data);
+  w = appearance_capplet_get_widget (data, "window_title_font");
+  g_signal_connect (w, "font_set", (GCallback) custom_font_cb, data);
+  w = appearance_capplet_get_widget (data, "monospace_font");
+  g_signal_connect (w, "font_set", (GCallback) custom_font_cb, data);
+}
+
+void
+themes_shutdown (AppearanceData *data)
+{
+  mate_theme_meta_info_free (data->theme_custom);
+
+  if (data->theme_icon)
+    g_object_unref (data->theme_icon);
+  if (data->theme_save_dialog)
+    gtk_widget_destroy (data->theme_save_dialog);
+  g_free (data->revert_application_font);
+  g_free (data->revert_documents_font);
+  g_free (data->revert_desktop_font);
+  g_free (data->revert_windowtitle_font);
+  g_free (data->revert_monospace_font);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/2.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/2.html new file mode 100644 index 00000000..7f9e353d --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/2.html @@ -0,0 +1,1911 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* mate-about-me-fingerprint.h
+ * Copyright (C) 2008 Bastien Nocera <hadess@hadess.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, 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 <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 "fingerprint-strings.h"
+#include "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+
+/* This must match the number of images on the 2nd page in the UI file */
+#define MAX_ENROLL_STAGES 5
+
+/* Translate fprintd strings */
+#define TR(s) dgettext("fprintd", s)
+
+static GDBusProxy *manager = NULL;
+static gboolean is_disable = FALSE;
+
+enum {
+	STATE_NONE,
+	STATE_CLAIMED,
+	STATE_ENROLLING
+};
+
+typedef struct {
+	GtkWidget *enable;
+	GtkWidget *disable;
+
+	GtkWidget *ass;
+	GtkBuilder *dialog;
+
+	GDBusProxy *device;
+	gboolean is_swipe;
+	int num_enroll_stages;
+	int num_stages_done;
+	char *name;
+	const char *finger;
+	gint state;
+} EnrollData;
+
+void set_fingerprint_label (GtkWidget *enable, GtkWidget *disable);
+void fingerprint_button_clicked (GtkBuilder *dialog, GtkWidget *enable, GtkWidget *disable);
+
+static void create_manager (void)
+{
+	GError *error = NULL;
+
+	manager = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
+						 G_DBUS_PROXY_FLAGS_NONE,
+						 NULL,
+						 "net.reactivated.Fprint",
+						 "/net/reactivated/Fprint/Manager",
+						 "net.reactivated.Fprint.Manager",
+						 NULL,
+						 &error);
+	if (manager == NULL) {
+		g_warning ("Unable to contact Fprint Manager daemon: %s\n", error->message);
+		g_error_free (error);
+	}
+}
+
+static GDBusProxy*
+get_first_device (void)
+{
+	GDBusProxy *device = NULL;
+	GVariant *ret;
+	char *device_str;
+	GError *error = NULL;
+
+	ret = g_dbus_proxy_call_sync (manager,
+				      "GetDefaultDevice",
+				      g_variant_new ("()"),
+				      G_DBUS_CALL_FLAGS_NONE,
+				      -1,
+				      NULL,
+				      &error);
+	if (ret == NULL) {
+		g_warning ("Could not get default fprint device: %s", error->message);
+		g_error_free (error);
+		return NULL;
+	}
+
+	g_variant_get (ret, "(o)", &device_str);
+	g_variant_unref (ret);
+
+	device = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
+						G_DBUS_PROXY_FLAGS_NONE,
+						NULL,
+						"net.reactivated.Fprint",
+						device_str,
+						"net.reactivated.Fprint.Device",
+						NULL,
+						&error);
+	if (device == NULL) {
+		g_warning ("Unable to contact Fprint Manager daemon: %s\n", error->message);
+		g_error_free (error);
+	}
+
+	g_free (device_str);
+	return device;
+}
+
+static const char *
+get_reason_for_error (const char *dbus_error)
+{
+	if (g_str_equal (dbus_error, "net.reactivated.Fprint.Error.PermissionDenied"))
+		return N_("You are not allowed to access the device. Contact your system administrator.");
+	if (g_str_equal (dbus_error, "net.reactivated.Fprint.Error.AlreadyInUse"))
+		return N_("The device is already in use.");
+	if (g_str_equal (dbus_error, "net.reactivated.Fprint.Error.Internal"))
+		return N_("An internal error occurred");
+
+	return NULL;
+}
+
+static GtkWidget *
+get_error_dialog (const char *title,
+		  const char *dbus_error,
+		  GtkWindow *parent)
+{
+	GtkWidget *error_dialog;
+	const char *reason;
+
+	if (dbus_error == NULL)
+		g_warning ("get_error_dialog called with reason == NULL");
+
+	error_dialog =
+		gtk_message_dialog_new (parent,
+				GTK_DIALOG_MODAL,
+				GTK_MESSAGE_ERROR,
+				GTK_BUTTONS_OK,
+				"%s", title);
+	reason = get_reason_for_error (dbus_error);
+	gtk_message_dialog_format_secondary_text
+		(GTK_MESSAGE_DIALOG (error_dialog), "%s", reason ? _(reason) : _(dbus_error));
+
+	gtk_window_set_title (GTK_WINDOW (error_dialog), ""); /* as per HIG */
+	gtk_container_set_border_width (GTK_CONTAINER (error_dialog), 5);
+	gtk_dialog_set_default_response (GTK_DIALOG (error_dialog),
+					 GTK_RESPONSE_OK);
+	gtk_window_set_modal (GTK_WINDOW (error_dialog), TRUE);
+	gtk_window_set_position (GTK_WINDOW (error_dialog), GTK_WIN_POS_CENTER_ON_PARENT);
+
+	return error_dialog;
+}
+
+void
+set_fingerprint_label (GtkWidget *enable, GtkWidget *disable)
+{
+	gchar **enrolled_fingers;
+	GDBusProxy *device;
+	GError *error = NULL;
+	GVariant *ret;
+
+	gtk_widget_set_no_show_all (enable, TRUE);
+	gtk_widget_set_no_show_all (disable, TRUE);
+
+	if (manager == NULL) {
+		create_manager ();
+		if (manager == NULL) {
+			gtk_widget_hide (enable);
+			gtk_widget_hide (disable);
+			return;
+		}
+	}
+
+	device = get_first_device ();
+	if (device == NULL) {
+		gtk_widget_hide (enable);
+		gtk_widget_hide (disable);
+		return;
+	}
+
+	ret = g_dbus_proxy_call_sync (device,
+				      "ListEnrolledFingers",
+				      g_variant_new ("(s)", ""),
+				      G_DBUS_CALL_FLAGS_NONE,
+				      -1,
+				      NULL,
+				      &error);
+	if (ret == NULL) {
+		gchar *error_name = g_dbus_error_get_remote_error (error);
+		if (!g_str_equal (error_name, "net.reactivated.Fprint.Error.NoEnrolledPrints")) {
+			gtk_widget_hide (enable);
+			gtk_widget_hide (disable);
+			g_object_unref (device);
+			g_free(error_name);
+			return;
+		}
+		g_free(error_name);
+		enrolled_fingers = NULL;
+	} else {
+		g_variant_get (ret, "(^as)", &enrolled_fingers);
+		g_variant_unref (ret);
+	}
+
+	if (enrolled_fingers == NULL || g_strv_length (enrolled_fingers) == 0) {
+		gtk_widget_hide (disable);
+		gtk_widget_show (enable);
+		is_disable = FALSE;
+	} else {
+		gtk_widget_hide (enable);
+		gtk_widget_show (disable);
+		is_disable = TRUE;
+	}
+	g_strfreev (enrolled_fingers);
+	g_object_unref (device);
+}
+
+static void
+delete_fingerprints (void)
+{
+	GVariant *ret;
+	GDBusProxy *device;
+	GError *error = NULL;
+
+	if (manager == NULL) {
+		create_manager ();
+		if (manager == NULL)
+			return;
+	}
+
+	device = get_first_device ();
+	if (device == NULL)
+		return;
+
+	ret = g_dbus_proxy_call_sync (device,
+				      "DeleteEnrolledFingers",
+				      g_variant_new ("(s)", ""),
+				      G_DBUS_CALL_FLAGS_NONE,
+				      -1,
+				      NULL,
+				      &error);
+	if (ret == NULL) {
+		g_warning ("Could not delete enrolled fingers: %s", error->message);
+		g_error_free (error);
+	} else {
+		g_variant_unref (ret);
+	}
+
+	g_object_unref (device);
+}
+
+static void
+delete_fingerprints_question (GtkBuilder *dialog, GtkWidget *enable, GtkWidget *disable)
+{
+	GtkWidget *question;
+	GtkWidget *button;
+
+	question = gtk_message_dialog_new (GTK_WINDOW (gtk_builder_get_object (dialog, "about-me-dialog")),
+	                                   GTK_DIALOG_MODAL,
+	                                   GTK_MESSAGE_QUESTION,
+	                                   GTK_BUTTONS_NONE,
+	                                   _("Delete registered fingerprints?"));
+	gtk_dialog_add_button (GTK_DIALOG (question), "gtk-cancel", GTK_RESPONSE_CANCEL);
+
+	button = gtk_button_new_with_mnemonic (_("_Delete Fingerprints"));
+	gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_icon_name ("edit-delete", GTK_ICON_SIZE_BUTTON));
+	gtk_widget_set_can_default (button, TRUE);
+	gtk_widget_show (button);
+	gtk_dialog_add_action_widget (GTK_DIALOG (question), button, GTK_RESPONSE_OK);
+
+	gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (question),
+						  _("Do you want to delete your registered fingerprints so fingerprint login is disabled?"));
+	gtk_container_set_border_width (GTK_CONTAINER (question), 5);
+	gtk_dialog_set_default_response (GTK_DIALOG (question), GTK_RESPONSE_OK);
+	gtk_window_set_position (GTK_WINDOW (question), GTK_WIN_POS_CENTER_ON_PARENT);
+	gtk_window_set_modal (GTK_WINDOW (question), TRUE);
+
+	if (gtk_dialog_run (GTK_DIALOG (question)) == GTK_RESPONSE_OK) {
+		delete_fingerprints ();
+		set_fingerprint_label (enable, disable);
+	}
+
+	gtk_widget_destroy (question);
+}
+
+static void
+enroll_data_destroy (EnrollData *data)
+{
+	GVariant *ret;
+	switch (data->state) {
+	case STATE_ENROLLING:
+		ret = g_dbus_proxy_call_sync (data->device,
+					      "EnrollStop",
+					      g_variant_new ("()"),
+					      G_DBUS_CALL_FLAGS_NONE,
+					      -1,
+					      NULL,
+					      NULL);
+		if (ret != NULL) {
+			g_variant_unref (ret);
+		}
+		/* fall-through */
+	case STATE_CLAIMED:
+		ret = g_dbus_proxy_call_sync (data->device,
+					      "Release",
+					      g_variant_new ("()"),
+					      G_DBUS_CALL_FLAGS_NONE,
+					      -1,
+					      NULL,
+					      NULL);
+		if (ret != NULL) {
+			g_variant_unref (ret);
+		}
+		/* fall-through */
+	case STATE_NONE:
+		g_free (data->name);
+		g_object_unref (data->device);
+		g_object_unref (data->dialog);
+		gtk_widget_destroy (data->ass);
+
+		g_free (data);
+	}
+}
+
+static const char *
+selected_finger (GtkBuilder *dialog)
+{
+	GtkWidget *finger_combobox;
+	int index;
+
+	finger_combobox = WID ("finger_combobox");
+
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (dialog, "radiobutton1")))) {
+		gtk_widget_set_sensitive (finger_combobox, FALSE);
+		return "right-index-finger";
+	}
+
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (dialog, "radiobutton2")))) {
+		gtk_widget_set_sensitive (finger_combobox, FALSE);
+		return "left-index-finger";
+	}
+
+	gtk_widget_set_sensitive (finger_combobox, TRUE);
+
+	index = gtk_combo_box_get_active (GTK_COMBO_BOX (finger_combobox));
+	switch (index) {
+	case 0:
+		return "left-thumb";
+	case 1:
+		return "left-middle-finger";
+	case 2:
+		return "left-ring-finger";
+	case 3:
+		return "left-little-finger";
+	case 4:
+		return "right-thumb";
+	case 5:
+		return "right-middle-finger";
+	case 6:
+		return "right-ring-finger";
+	case 7:
+		return "right-little-finger";
+	default:
+		g_assert_not_reached ();
+	}
+
+	return NULL;
+}
+
+static void
+finger_radio_button_toggled (GtkToggleButton *button, EnrollData *data)
+{
+	char *msg;
+
+	data->finger = selected_finger (data->dialog);
+
+	msg = g_strdup_printf (TR(finger_str_to_msg (data->finger, data->is_swipe)), data->name);
+	gtk_label_set_text (GTK_LABEL (gtk_builder_get_object (data->dialog, "enroll-label")), msg);
+	g_free (msg);
+}
+
+static void
+finger_combobox_changed (GtkComboBox *combobox, EnrollData *data)
+{
+	GtkBuilder *dialog = data->dialog;<--- Variable 'dialog' can be declared as pointer to const<--- Variable 'dialog' is assigned a value that is never used.
+	char *msg;
+
+	data->finger = selected_finger (data->dialog);
+
+	msg = g_strdup_printf (TR(finger_str_to_msg (data->finger, data->is_swipe)), data->name);
+	gtk_label_set_text (GTK_LABEL (WID("enroll-label")), msg);
+	g_free (msg);
+}
+
+static void
+assistant_cancelled (GtkAssistant *ass, EnrollData *data)
+{
+	GtkWidget *enable, *disable;
+
+	enable = data->enable;
+	disable = data->disable;
+
+	enroll_data_destroy (data);
+	set_fingerprint_label (enable, disable);
+}
+
+static void
+on_signal (GDBusProxy *proxy G_GNUC_UNUSED,
+	   gchar      *sender_name G_GNUC_UNUSED,
+	   gchar      *signal_name,
+	   GVariant   *parameters,
+	   EnrollData *data)
+{
+	char *msg;
+	gchar *result;
+	gboolean done;
+
+	if (!g_str_equal (signal_name, "EnrollStatus")) {
+		return;
+	}
+
+	GtkBuilder *dialog = data->dialog;
+
+	g_variant_get (parameters, "(sb)", &result, &done);
+
+	if (g_str_equal (result, "enroll-completed") || g_str_equal (result, "enroll-stage-passed")) {
+		char *name, *path;
+
+		data->num_stages_done++;
+		name = g_strdup_printf ("image%d", data->num_stages_done);
+		path = g_build_filename (MATECC_PIXMAP_DIR, "print_ok.png", NULL);
+		gtk_image_set_from_file (GTK_IMAGE (gtk_builder_get_object (dialog, name)), path);
+		g_free (name);
+		g_free (path);
+	}
+	if (g_str_equal (result, "enroll-completed")) {
+		gtk_label_set_text (GTK_LABEL (gtk_builder_get_object (dialog, "status-label")), _("Done!"));
+		gtk_assistant_set_page_complete (GTK_ASSISTANT (data->ass), WID ("page2"), TRUE);
+	}
+
+	if (done) {
+		GVariant *ret;
+		ret = g_dbus_proxy_call_sync (data->device,
+					      "EnrollStop",
+					      g_variant_new ("()"),
+					      G_DBUS_CALL_FLAGS_NONE,
+					      -1,
+					      NULL,
+					      NULL);
+		if (ret != NULL) {
+			g_variant_unref (ret);
+		}
+		data->state = STATE_CLAIMED;
+		if (g_str_equal (result, "enroll-completed") == FALSE) {
+			/* The enrollment failed, restart it */
+			ret = g_dbus_proxy_call_sync (data->device,
+						      "EnrollStart",
+						      g_variant_new ("(s)", data->finger),
+						      G_DBUS_CALL_FLAGS_NONE,
+						      -1,
+						      NULL,
+						      NULL);
+			if (ret != NULL) {
+				g_variant_unref (ret);
+			}
+			data->state = STATE_ENROLLING;
+			g_free (result);
+			result = g_strdup ("enroll-retry-scan");
+		} else {
+			g_free (result);
+			return;
+		}
+	}
+
+	msg = g_strdup_printf (TR(enroll_result_str_to_msg (result, data->is_swipe)), data->name);
+	gtk_label_set_text (GTK_LABEL (gtk_builder_get_object (dialog, "status-label")), msg);
+	g_free (msg);
+	g_free (result);
+}
+
+static void
+assistant_prepare (GtkAssistant *ass, GtkWidget *page, EnrollData *data)
+{
+	const char *name;
+
+	name = g_object_get_data (G_OBJECT (page), "name");
+	if (name == NULL)
+		return;
+
+	if (g_str_equal (name, "enroll")) {
+		GError *error = NULL;
+		GtkBuilder *dialog = data->dialog;
+		char *path;
+		guint i;
+		GVariant *ret;
+		GtkWidget *d;
+		char *msg;
+		gchar *error_name;
+		GDBusProxy *p;
+
+		ret = g_dbus_proxy_call_sync (data->device,
+					      "Claim",
+					      g_variant_new ("(s)", ""),
+					      G_DBUS_CALL_FLAGS_NONE,
+					      -1,
+					      NULL,
+					      &error);
+		if (error != NULL) {
+			/* translators:
+			 * The variable is the name of the device, for example:
+			 * "Could you not access "Digital Persona U.are.U 4000/4000B" device */
+			msg = g_strdup_printf (_("Could not access '%s' device"), data->name);
+			error_name = g_dbus_error_get_remote_error (error);
+			d = get_error_dialog (msg, error_name, GTK_WINDOW (data->ass));
+			g_error_free (error);
+			gtk_dialog_run (GTK_DIALOG (d));
+			gtk_widget_destroy (d);
+			g_free (msg);
+			g_free (error_name);
+
+			enroll_data_destroy (data);
+
+			return;
+		} else {
+			g_variant_unref (ret);
+		}
+		data->state = STATE_CLAIMED;
+
+		p = g_dbus_proxy_new_sync (g_dbus_proxy_get_connection (data->device),
+					   G_DBUS_PROXY_FLAGS_NONE,
+					   NULL,
+					   g_dbus_proxy_get_name (data->device),
+					   g_dbus_proxy_get_object_path (data->device),
+					   "org.freedesktop.DBus.Properties",
+					   NULL,
+					   &error);
+		if (p == NULL) {
+			g_warning ("Unable to contact Fprint Device daemon: %s\n", error->message);
+			g_error_free (error);
+			return;
+		}
+		ret = g_dbus_proxy_call_sync (p,
+					      "Get",
+					      g_variant_new ("(ss)",
+							     "net.reactivated.Fprint.Device",
+							     "num-enroll-stages"),
+					      G_DBUS_CALL_FLAGS_NONE,
+					      -1,
+					      NULL,
+					      &error);
+		g_object_unref (p);
+		if (ret == NULL) {
+out:
+			/* translators:
+			 * The variable is the name of the device, for example:
+			 * "Could you not access "Digital Persona U.are.U 4000/4000B" device */
+			msg = g_strdup_printf (_("Could not access '%s' device"), data->name);
+			d = get_error_dialog (msg, "net.reactivated.Fprint.Error.Internal", GTK_WINDOW (data->ass));
+			gtk_dialog_run (GTK_DIALOG (d));
+			gtk_widget_destroy (d);
+			g_free (msg);
+
+			enroll_data_destroy (data);
+
+			g_error_free (error);
+			return;
+		} else {
+			GVariant *value;
+			g_variant_get (ret, "(v)", &value);
+			g_variant_get (value, "i", &data->num_enroll_stages);
+			g_variant_unref (value);
+			g_variant_unref (ret);
+		}
+
+		if (data->num_enroll_stages < 1) {
+			goto out;
+		}
+
+		/* Hide the extra "bulbs" if not needed */
+		for (i = MAX_ENROLL_STAGES; i > data->num_enroll_stages; i--) {
+			char *image_name;
+
+			image_name = g_strdup_printf ("image%d", i);
+			gtk_widget_hide (WID (image_name));
+			g_free (image_name);
+		}
+		/* And set the right image */
+		{
+			char *filename;
+
+			filename = g_strdup_printf ("%s.png", data->finger);
+			path = g_build_filename (MATECC_PIXMAP_DIR, filename, NULL);
+			g_free (filename);
+		}
+		for (i = 1; i <= data->num_enroll_stages; i++) {
+			char *image_name;
+			image_name = g_strdup_printf ("image%d", i);
+			gtk_image_set_from_file (GTK_IMAGE (gtk_builder_get_object (dialog, image_name)), path);
+			g_free (image_name);
+		}
+		g_free (path);
+
+		g_signal_connect (data->device,
+				  "g-signal",
+				  G_CALLBACK (on_signal),
+				  data);
+		ret = g_dbus_proxy_call_sync (data->device,
+					      "EnrollStart",
+					      g_variant_new ("(s)", data->finger),
+					      G_DBUS_CALL_FLAGS_NONE,
+					      -1,
+					      NULL,
+					      &error);
+		if (ret == NULL) {
+			/* translators:
+			 * The variable is the name of the device, for example:
+			 * "Could you not access "Digital Persona U.are.U 4000/4000B" device */
+			msg = g_strdup_printf (_("Could not start finger capture on '%s' device"), data->name);
+			error_name = g_dbus_error_get_remote_error (error);
+			d = get_error_dialog (msg, error_name, GTK_WINDOW (data->ass));
+			g_error_free (error);
+			gtk_dialog_run (GTK_DIALOG (d));
+			gtk_widget_destroy (d);
+			g_free (msg);
+			g_free (error_name);
+
+			enroll_data_destroy (data);
+
+			return;
+		}
+		data->state = STATE_ENROLLING;;
+		g_variant_unref (ret);
+	} else {
+		GVariant *value;
+		if (data->state == STATE_ENROLLING) {
+			value = g_dbus_proxy_call_sync (data->device,
+							"EnrollStop",
+							g_variant_new ("()"),
+							G_DBUS_CALL_FLAGS_NONE,
+							-1,
+							NULL,
+							NULL);
+			if (value != NULL) {
+				g_variant_unref (value);
+			}
+			data->state = STATE_CLAIMED;
+		}
+		if (data->state == STATE_CLAIMED) {
+			value = g_dbus_proxy_call_sync (data->device,
+							"Release",
+							g_variant_new ("()"),
+							G_DBUS_CALL_FLAGS_NONE,
+							-1,
+							NULL,
+							NULL);
+			if (value != NULL) {
+				g_variant_unref (value);
+			}
+			data->state = STATE_NONE;
+		}
+	}
+}
+
+static void
+enroll_fingerprints (GtkWindow *parent, GtkWidget *enable, GtkWidget *disable)
+{
+	GDBusProxy *device;
+	GtkBuilder *dialog;
+	EnrollData *data;
+	GtkWidget *ass;
+	char *msg;
+	GError *error = NULL;
+	GVariant *ret;
+
+	device = NULL;
+
+	if (manager == NULL) {
+		create_manager ();
+		if (manager != NULL)
+			device = get_first_device ();
+	} else {
+		device = get_first_device ();
+	}
+
+	if (manager == NULL || device == NULL) {
+		GtkWidget *d;
+
+		d = get_error_dialog (_("Could not access any fingerprint readers"),
+				      _("Please contact your system administrator for help."),
+				      parent);
+		gtk_dialog_run (GTK_DIALOG (d));
+		gtk_widget_destroy (d);
+		return;
+	}
+
+	GDBusProxy *p;
+	p = g_dbus_proxy_new_sync (g_dbus_proxy_get_connection (device),
+				   G_DBUS_PROXY_FLAGS_NONE,
+				   NULL,
+				   g_dbus_proxy_get_name (device),
+				   g_dbus_proxy_get_object_path (device),
+				   "org.freedesktop.DBus.Properties",
+				   NULL,
+				   &error);
+	if (p == NULL) {
+		g_warning ("Unable to contact Fprint Device daemon: %s\n", error->message);
+		g_error_free (error);
+		return;
+	}
+
+	data = g_new0 (EnrollData, 1);
+	data->device = device;
+	data->enable = enable;
+	data->disable = disable;
+
+	/* Get some details about the device */
+	ret = g_dbus_proxy_call_sync (p,
+				      "GetAll",
+				      g_variant_new ("(s)", "net.reactivated.Fprint.Device"),
+				      G_DBUS_CALL_FLAGS_NONE,
+				      -1,
+				      NULL,
+				      NULL);
+	if (ret != NULL) {
+		GVariantIter *iter;
+		const gchar *key;
+		GVariant *value;
+
+		g_variant_get (ret, "(a{sv})", &iter);
+		while (g_variant_iter_loop (iter, "{sv}", &key, &value))
+		{
+			if (g_str_equal (key, "name") && g_variant_is_of_type (value, G_VARIANT_TYPE ("(s)"))) {
+				data->name = g_strdup (g_variant_get_string (value, NULL));
+			} else if (g_str_equal (key, "scan-type") && g_variant_is_of_type (value, G_VARIANT_TYPE ("(s)"))) {
+				if (g_str_equal (g_variant_get_string (value, NULL), "swipe"))
+					data->is_swipe = TRUE;
+			}
+		}
+		g_variant_iter_free (iter);
+		g_variant_unref (ret);
+	}
+	g_object_unref (p);
+
+	dialog = gtk_builder_new ();
+	if (gtk_builder_add_from_resource (dialog, "/org/mate/mcc/am/mate-about-me-fingerprint.ui", &error) == 0)
+	{
+		g_warning ("Could not parse UI definition: %s", error->message);
+		g_error_free (error);
+	}
+	data->dialog = dialog;
+
+	ass = WID ("assistant");
+	gtk_window_set_title (GTK_WINDOW (ass), _("Enable Fingerprint Login"));
+	gtk_window_set_transient_for (GTK_WINDOW (ass), parent);
+	gtk_window_set_position (GTK_WINDOW (ass), GTK_WIN_POS_CENTER_ON_PARENT);
+	g_signal_connect (ass, "cancel",
+	                  G_CALLBACK (assistant_cancelled),
+	                  data);
+	g_signal_connect (ass, "close",
+	                  G_CALLBACK (assistant_cancelled),
+	                  data);
+	g_signal_connect (ass, "prepare",
+	                  G_CALLBACK (assistant_prepare),
+	                  data);
+
+	/* Page 1 */
+	gtk_combo_box_set_active (GTK_COMBO_BOX (gtk_builder_get_object (dialog, "finger_combobox")), 0);
+
+	g_signal_connect (gtk_builder_get_object (dialog, "radiobutton1"), "toggled",
+	                  G_CALLBACK (finger_radio_button_toggled),
+	                  data);
+	g_signal_connect (gtk_builder_get_object (dialog, "radiobutton2"), "toggled",
+	                  G_CALLBACK (finger_radio_button_toggled),
+	                  data);
+	g_signal_connect (gtk_builder_get_object (dialog, "radiobutton3"), "toggled",
+	                  G_CALLBACK (finger_radio_button_toggled),
+	                  data);
+	g_signal_connect (gtk_builder_get_object (dialog, "finger_combobox"), "changed",
+	                  G_CALLBACK (finger_combobox_changed),
+	                  data);
+
+	data->finger = selected_finger (dialog);
+
+	g_object_set_data (gtk_builder_get_object (dialog, "page1"), "name", "intro");
+
+	/* translators:
+	 * The variable is the name of the device, for example:
+	 * "To enable fingerprint login, you need to save one of your fingerprints, using the
+	 * 'Digital Persona U.are.U 4000/4000B' device." */
+	msg = g_strdup_printf (_("To enable fingerprint login, you need to save one of your fingerprints, using the '%s' device."),
+			       data->name);
+	gtk_label_set_text (GTK_LABEL (gtk_builder_get_object (dialog, "intro-label")), msg);
+	g_free (msg);
+
+	gtk_assistant_set_page_complete (GTK_ASSISTANT (ass), WID("page1"), TRUE);
+
+	/* Page 2 */
+	if (data->is_swipe != FALSE)
+		gtk_assistant_set_page_title (GTK_ASSISTANT (ass), WID("page2"), _("Swipe finger on reader"));
+	else
+		gtk_assistant_set_page_title (GTK_ASSISTANT (ass), WID("page2"), _("Place finger on reader"));
+
+	g_object_set_data (G_OBJECT (WID("page2")), "name", "enroll");
+
+	msg = g_strdup_printf (TR(finger_str_to_msg (data->finger, data->is_swipe)), data->name);
+	gtk_label_set_text (GTK_LABEL (WID("enroll-label")), msg);
+	g_free (msg);
+
+	/* Page 3 */
+	g_object_set_data (G_OBJECT (WID("page3")), "name", "summary");
+
+	data->ass = ass;
+	gtk_widget_show_all (ass);
+}
+
+void
+fingerprint_button_clicked (GtkBuilder *dialog,
+			    GtkWidget *enable,
+			    GtkWidget *disable)
+{
+	bindtextdomain ("fprintd", MATELOCALEDIR);
+	bind_textdomain_codeset ("fprintd", "UTF-8");
+
+	if (is_disable != FALSE) {
+		delete_fingerprints_question (dialog, enable, disable);
+	} else {
+		enroll_fingerprints (GTK_WINDOW (gtk_builder_get_object (dialog, "about-me-dialog")), enable, disable);
+	}
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/20.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/20.html new file mode 100644 index 00000000..6580a88a --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/20.html @@ -0,0 +1,497 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * Copyright (C) 2007 The GNOME Foundation
+ * Written by Jonathan Blandford <jrb@gnome.org>
+ *            Jens Granseuer <jensgr@gmx.net>
+ * All Rights Reserved
+ *
+ * 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.
+ */
+
+#include "appearance.h"
+#include "appearance-ui.h"
+
+#include <stdio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+static void
+set_have_icons (AppearanceData *data, gboolean value)
+{
+    static const char *menu_item_names[] = {
+        "menu_item_1",
+        "menu_item_2",
+        "menu_item_3",
+        "menu_item_4",
+        "menu_item_5",
+        "cut",
+        "copy",
+        "paste",
+        NULL
+    };
+
+    const char **name;
+
+    for (name = menu_item_names; *name != NULL; name++) {
+        MateImageMenuItem *item = MATE_IMAGE_MENU_ITEM (appearance_capplet_get_widget (data, *name));
+        GtkWidget *image;
+
+        if (value) {
+            image = g_object_get_data (G_OBJECT (item), "image");
+            if (image) {
+                mate_image_menu_item_set_image (item, image);
+                g_object_unref (image);
+            }
+        }
+        else
+        {
+            image = mate_image_menu_item_get_image (item);
+            g_object_set_data (G_OBJECT (item), "image", image);
+            g_object_ref (image);
+            mate_image_menu_item_set_image (item, NULL);
+        }
+    }
+}
+
+static void
+menus_have_icons_cb (GSettings *settings,
+                     gchar *key,
+                     AppearanceData      *data)
+{
+    set_have_icons (data, g_settings_get_boolean (settings, key));
+}
+
+/** Public Functions **/
+
+void
+ui_init (AppearanceData *data)
+{
+    /* FIXME maybe just remove that stuff from .ui file */
+    GtkWidget* container = appearance_capplet_get_widget(data, "vbox24");
+
+    /* Remove menu accels and toolbar style toggles for new GTK versions */
+    gtk_container_remove((GtkContainer *) container,
+                         appearance_capplet_get_widget(data, "menu_accel_toggle"));
+    gtk_container_remove((GtkContainer *) container,
+                         appearance_capplet_get_widget(data, "hbox11"));
+
+    g_settings_bind (data->interface_settings,
+                     MENU_ICONS_KEY,
+                     gtk_builder_get_object (data->ui, "menu_icons_toggle"),
+                     "active",
+                     G_SETTINGS_BIND_DEFAULT);
+    g_signal_connect (data->interface_settings, "changed::" MENU_ICONS_KEY,
+                      G_CALLBACK (menus_have_icons_cb), data);
+
+    set_have_icons (data,
+                    g_settings_get_boolean (data->interface_settings,
+                                            MENU_ICONS_KEY));
+
+    g_settings_bind (data->interface_settings,
+                     BUTTON_ICONS_KEY,
+                     gtk_builder_get_object (data->ui, "button_icons_toggle"),
+                     "active",
+                     G_SETTINGS_BIND_DEFAULT);
+
+    g_settings_bind (data->filechooser_settings,
+                     FILECHOOSER_HIDDEN_ITEMS_KEY,
+                     gtk_builder_get_object (data->ui, "filechooser_hidden_items_toggle"),
+                     "active",
+                     G_SETTINGS_BIND_DEFAULT);
+
+    g_settings_bind (data->filechooser_settings,
+                     FILECHOOSER_SIZE_COL_KEY,
+                     gtk_builder_get_object (data->ui, "filechooser_size_column_toggle"),
+                     "active",
+                     G_SETTINGS_BIND_DEFAULT);
+
+#if GTK_CHECK_VERSION(3, 24, 12)
+    g_settings_bind (data->filechooser_settings,
+                     FILECHOOSER_TYPE_COL_KEY,
+                     gtk_builder_get_object (data->ui, "filechooser_type_column_toggle"),
+                     "active",
+                     G_SETTINGS_BIND_DEFAULT);
+#endif /* GTK_CHECK_VERSION(3, 24, 12) */
+
+    g_settings_bind (data->filechooser_settings,
+                     FILECHOOSER_DIR_FIRST_KEY,
+                     gtk_builder_get_object (data->ui, "filechooser_sort_directories_first_toggle"),
+                     "active",
+                     G_SETTINGS_BIND_DEFAULT);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/21.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/21.html new file mode 100644 index 00000000..c36931d3 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/21.html @@ -0,0 +1,1913 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
#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.appearance"), aligned (8)))
+#else
+# define SECTION
+#endif
+
+static const SECTION union { const guint8 data[10097]; const double alignment; void * const ptr;}  appearance_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, 0344, 0000, 0000, 0000, 0000, 0000, 0000, 0050, 0007, 0000, 0000, 0000, 
+  0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0001, 0000, 0000, 0000, 0005, 0000, 0000, 0000, 
+  0005, 0000, 0000, 0000, 0006, 0000, 0000, 0000, 0006, 0000, 0000, 0000, 0113, 0120, 0220, 0013, 
+  0002, 0000, 0000, 0000, 0344, 0000, 0000, 0000, 0004, 0000, 0114, 0000, 0350, 0000, 0000, 0000, 
+  0354, 0000, 0000, 0000, 0202, 0240, 0204, 0022, 0006, 0000, 0000, 0000, 0354, 0000, 0000, 0000, 
+  0013, 0000, 0114, 0000, 0370, 0000, 0000, 0000, 0374, 0000, 0000, 0000, 0324, 0265, 0002, 0000, 
+  0377, 0377, 0377, 0377, 0374, 0000, 0000, 0000, 0001, 0000, 0114, 0000, 0000, 0001, 0000, 0000, 
+  0004, 0001, 0000, 0000, 0347, 0242, 0306, 0177, 0004, 0000, 0000, 0000, 0004, 0001, 0000, 0000, 
+  0015, 0000, 0166, 0000, 0030, 0001, 0000, 0000, 0121, 0047, 0000, 0000, 0013, 0377, 0357, 0264, 
+  0001, 0000, 0000, 0000, 0121, 0047, 0000, 0000, 0005, 0000, 0114, 0000, 0130, 0047, 0000, 0000, 
+  0134, 0047, 0000, 0000, 0201, 0321, 0040, 0031, 0000, 0000, 0000, 0000, 0134, 0047, 0000, 0000, 
+  0005, 0000, 0114, 0000, 0144, 0047, 0000, 0000, 0150, 0047, 0000, 0000, 0143, 0041, 0175, 0170, 
+  0005, 0000, 0000, 0000, 0150, 0047, 0000, 0000, 0004, 0000, 0114, 0000, 0154, 0047, 0000, 0000, 
+  0160, 0047, 0000, 0000, 0157, 0162, 0147, 0057, 0005, 0000, 0000, 0000, 0141, 0160, 0160, 0145, 
+  0141, 0162, 0141, 0156, 0143, 0145, 0057, 0000, 0004, 0000, 0000, 0000, 0057, 0000, 0000, 0000, 
+  0000, 0000, 0000, 0000, 0141, 0160, 0160, 0145, 0141, 0162, 0141, 0156, 0143, 0145, 0056, 0165, 
+  0151, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0035, 0056, 0003, 0000, 0001, 0000, 0000, 0000, 
+  0170, 0332, 0355, 0135, 0133, 0167, 0243, 0270, 0262, 0176, 0317, 0257, 0320, 0366, 0323, 0314, 
+  0072, 0115, 0022, 0333, 0111, 0337, 0046, 0235, 0263, 0322, 0351, 0133, 0326, 0364, 0355, 0304, 
+  0351, 0231, 0063, 0347, 0205, 0205, 0101, 0261, 0231, 0140, 0304, 0106, 0162, 0322, 0231, 0265, 
+  0177, 0374, 0221, 0200, 0330, 0330, 0306, 0006, 0011, 0141, 0003, 0256, 0247, 0070, 0066, 0052, 
+  0244, 0122, 0251, 0364, 0125, 0251, 0252, 0164, 0366, 0337, 0077, 0047, 0036, 0272, 0307, 0041, 
+  0165, 0211, 0377, 0246, 0323, 0075, 0074, 0356, 0040, 0354, 0333, 0304, 0161, 0375, 0321, 0233, 
+  0316, 0217, 0233, 0017, 0306, 0313, 0316, 0177, 0237, 0037, 0234, 0375, 0313, 0060, 0320, 0107, 
+  0354, 0343, 0320, 0142, 0330, 0101, 0017, 0056, 0033, 0243, 0221, 0147, 0071, 0030, 0365, 0017, 
+  0373, 0057, 0017, 0273, 0350, 0340, 0140, 0302, 0177, 0061, 0254, 0040, 0300, 0126, 0150, 0371, 
+  0066, 0066, 0202, 0220, 0004, 0070, 0144, 0056, 0246, 0310, 0100, 0363, 0357, 0121, 0352, 0173, 
+  0307, 0265, 0074, 0062, 0342, 0324, 0174, 0207, 0074, 0034, 0134, 0222, 0340, 0061, 0164, 0107, 
+  0143, 0206, 0176, 0271, 0374, 0025, 0175, 0271, 0270, 0171, 0217, 0336, 0341, 0173, 0354, 0211, 
+  0307, 0351, 0301, 0301, 0315, 0330, 0245, 0242, 0361, 0050, 0264, 0046, 0210, 0177, 0274, 0015, 
+  0061, 0106, 0224, 0334, 0262, 0007, 0053, 0304, 0277, 0241, 0107, 0062, 0105, 0266, 0345, 0243, 
+  0020, 0073, 0056, 0145, 0241, 0073, 0234, 0062, 0214, 0134, 0206, 0054, 0337, 0071, 0042, 0341, 
+  0301, 0204, 0217, 0350, 0366, 0121, 0174, 0061, 0365, 0035, 0034, 0042, 0066, 0306, 0210, 0341, 
+  0160, 0102, 0021, 0271, 0215, 0376, 0371, 0370, 0365, 0107, 0062, 0100, 0017, 0175, 0237, 0016, 
+  0075, 0327, 0106, 0237, 0135, 0033, 0373, 0024, 0037, 0130, 0374, 0275, 0342, 0033, 0072, 0346, 
+  0103, 0037, 0076, 0106, 0217, 0177, 0020, 0157, 0037, 0044, 0157, 0107, 0037, 0010, 0247, 0152, 
+  0061, 0316, 0302, 0337, 0020, 0346, 0274, 0341, 0057, 0110, 0130, 0212, 0172, 0007, 0311, 0013, 
+  0022, 0152, 0317, 0020, 0011, 0321, 0057, 0026, 0023, 0035, 0016, 0021, 0011, 0104, 0243, 0137, 
+  0171, 0057, 0037, 0221, 0307, 0031, 0070, 0153, 0167, 0270, 0072, 0340, 0371, 0270, 0034, 0344, 
+  0372, 0021, 0315, 0061, 0347, 0015, 0377, 0300, 0251, 0361, 0201, 0075, 0270, 0236, 0207, 0206, 
+  0030, 0115, 0051, 0276, 0235, 0172, 0317, 0016, 0370, 0223, 0350, 0317, 0253, 0233, 0117, 0337, 
+  0176, 0334, 0240, 0213, 0257, 0177, 0241, 0077, 0057, 0256, 0257, 0057, 0276, 0336, 0374, 0365, 
+  0133, 0064, 0175, 0204, 0377, 0312, 0271, 0033, 0323, 0161, 0047, 0201, 0347, 0212, 0171, 0265, 
+  0102, 0076, 0111, 0354, 0221, 0063, 0345, 0340, 0313, 0373, 0353, 0313, 0117, 0374, 0371, 0213, 
+  0267, 0127, 0237, 0257, 0156, 0376, 0022, 0335, 0376, 0160, 0165, 0363, 0365, 0375, 0140, 0200, 
+  0076, 0174, 0273, 0106, 0027, 0350, 0373, 0305, 0365, 0315, 0325, 0345, 0217, 0317, 0027, 0327, 
+  0350, 0373, 0217, 0353, 0357, 0337, 0006, 0357, 0017, 0021, 0032, 0140, 0321, 0041, 0174, 0260, 
+  0236, 0235, 0350, 0226, 0123, 0232, 0020, 0316, 0065, 0007, 0063, 0313, 0365, 0050, 0037, 0352, 
+  0137, 0174, 0362, 0050, 0357, 0222, 0347, 0240, 0261, 0165, 0217, 0371, 0044, 0332, 0330, 0275, 
+  0347, 0035, 0262, 0220, 0315, 0245, 0242, 0310, 0034, 0171, 0304, 0037, 0305, 0162, 0311, 0122, 
+  0174, 0373, 0015, 0271, 0267, 0310, 0047, 0354, 0031, 0172, 0010, 0135, 0056, 0020, 0214, 0254, 
+  0316, 0336, 0301, 0174, 0366, 0236, 0241, 0053, 0337, 0076, 0174, 0206, 0116, 0273, 0374, 0021, 
+  0313, 0277, 0363, 0070, 0237, 0007, 0214, 0077, 0314, 0011, 0174, 0160, 0157, 0071, 0361, 0017, 
+  0036, 0041, 0341, 0063, 0364, 0226, 0120, 0046, 0036, 0377, 0162, 0201, 0320, 0161, 0257, 0333, 
+  0075, 0066, 0272, 0375, 0343, 0356, 0063, 0364, 0143, 0160, 0301, 0207, 0163, 0061, 0345, 0374, 
+  0015, 0137, 0243, 0077, 0211, 0167, 0073, 0262, 0170, 0277, 0176, 0170, 0303, 0320, 0265, 0307, 
+  0007, 0007, 0206, 0301, 0327, 0222, 0353, 0363, 0211, 0276, 0265, 0154, 0174, 0176, 0200, 0320, 
+  0131, 0210, 0377, 0075, 0165, 0103, 0276, 0032, 0074, 0167, 0370, 0246, 0063, 0142, 0167, 0377, 
+  0325, 0231, 0257, 0307, 0376, 0141, 0257, 0327, 0071, 0212, 0236, 0023, 0053, 0160, 0326, 0322, 
+  0360, 0342, 0161, 0033, 0354, 0221, 0113, 0300, 0050, 0360, 0356, 0173, 0110, 0320, 0136, 0171, 
+  0316, 0267, 0046, 0030, 0155, 0132, 0232, 0131, 0215, 0034, 0114, 0355, 0320, 0215, 0104, 0263, 
+  0310, 0312, 0315, 0046, 0142, 0317, 0226, 0363, 0322, 0122, 0316, 0176, 0334, 0212, 0170, 0106, 
+  0127, 0170, 0366, 0364, 0064, 0031, 0376, 0215, 0155, 0206, 0154, 0317, 0242, 0364, 0115, 0347, 
+  0043, 0273, 0273, 0232, 0130, 0043, 0334, 0101, 0256, 0363, 0246, 0063, 0301, 0376, 0324, 0344, 
+  0234, 0063, 0003, 0213, 0062, 0334, 0021, 0317, 0363, 0026, 0111, 0167, 0037, 0221, 0340, 0301, 
+  0233, 0316, 0275, 0113, 0335, 0241, 0307, 0177, 0275, 0011, 0247, 0370, 0354, 0350, 0351, 0327, 
+  0354, 0207, 0271, 0046, 0061, 0157, 0211, 0075, 0245, 0235, 0363, 0017, 0226, 0107, 0163, 0237, 
+  0167, 0155, 0342, 0107, 0274, 0356, 0234, 0363, 0176, 0030, 0121, 0077, 0026, 0333, 0234, 0035, 
+  0305, 0043, 0050, 0076, 0030, 0037, 0077, 0324, 0140, 0050, 0274, 0027, 0145, 0007, 0302, 0333, 
+  0372, 0065, 0030, 0211, 0350, 0106, 0331, 0241, 0120, 0256, 0235, 0152, 0060, 0024, 0321, 0215, 
+  0262, 0103, 0011, 0102, 0276, 0370, 0352, 0260, 0126, 0104, 0077, 0312, 0016, 0206, 0253, 0320, 
+  0072, 0214, 0105, 0164, 0243, 0354, 0120, 0354, 0151, 0035, 0106, 0302, 0173, 0121, 0172, 0040, 
+  0174, 0003, 0250, 0303, 0110, 0170, 0067, 0144, 0206, 0162, 0341, 0374, 0075, 0245, 0214, 0217, 
+  0202, 0305, 0343, 0261, 0146, 0377, 0167, 0327, 0214, 0146, 0312, 0267, 0310, 0260, 0163, 0336, 
+  0075, 0076, 0316, 0353, 0032, 0337, 0025, 0002, 0303, 0365, 0355, 0020, 0107, 0364, 0317, 0273, 
+  0171, 0015, 0002, 0316, 0326, 0205, 0006, 0307, 0212, 0263, 0302, 0301, 0040, 0007, 0054, 0175, 
+  0323, 0235, 0214, 0064, 0315, 0211, 0241, 0070, 0047, 0061, 0146, 0060, 0154, 0217, 0120, 0051, 
+  0035, 0366, 0056, 0202, 0034, 0361, 0150, 0102, 0054, 0100, 0274, 0231, 0000, 0310, 0065, 0003, 
+  0212, 0137, 0027, 0077, 0152, 0044, 0217, 0352, 0036, 0327, 0220, 0204, 0202, 0372, 0203, 0353, 
+  0260, 0161, 0347, 0374, 0064, 0357, 0161, 0346, 0062, 0316, 0141, 0304, 0070, 0236, 0242, 0034, 
+  0356, 0133, 0234, 0337, 0157, 0072, 0217, 0130, 0274, 0215, 0370, 0014, 0135, 0107, 0175, 0345, 
+  0226, 0027, 0107, 0113, 0205, 0272, 0313, 0141, 0243, 0373, 0217, 0025, 0315, 0132, 0241, 0356, 
+  0012, 0264, 0150, 0214, 0043, 0275, 0037, 0043, 0270, 0225, 0006, 0366, 0330, 0365, 0234, 0030, 
+  0226, 0371, 0226, 0147, 0104, 0377, 0162, 0331, 0030, 0222, 0237, 0011, 0227, 0263, 0246, 0346, 
+  0055, 0377, 0065, 0232, 0227, 0230, 0250, 0041, 0036, 0357, 0316, 0236, 0227, 0024, 0065, 0225, 
+  0151, 0311, 0152, 0103, 0102, 0227, 0057, 0231, 0010, 0326, 0167, 0316, 0357, 0005, 0156, 0265, 
+  0055, 0257, 0110, 0103, 0032, 0130, 0066, 0237, 0203, 0316, 0171, 0057, 0363, 0351, 0154, 0016, 
+  0131, 0266, 0170, 0221, 0311, 0315, 0011, 0053, 0065, 0360, 0114, 0146, 0105, 0053, 0161, 0231, 
+  0145, 0251, 0366, 0335, 0005, 0002, 0012, 0334, 0123, 0345, 0140, 0126, 0073, 0317, 0342, 0166, 
+  0052, 0063, 0050, 0173, 0024, 0157, 0344, 0362, 0271, 0266, 0141, 0304, 0210, 0305, 0357, 0326, 
+  0017, 0177, 0101, 0051, 0165, 0226, 0133, 0145, 0165, 0143, 0210, 0275, 0314, 0205, 0143, 0136, 
+  0256, 0052, 0222, 0315, 0264, 0012, 0361, 0057, 0207, 0207, 0052, 0115, 0035, 0174, 0153, 0115, 
+  0075, 0046, 0337, 0070, 0261, 0206, 0351, 0234, 0302, 0306, 0051, 0314, 0324, 0277, 0321, 0116, 
+  0160, 0236, 0332, 0005, 0144, 0132, 0117, 0271, 0241, 0031, 0271, 0115, 0270, 0075, 0254, 0300, 
+  0067, 0313, 0173, 0260, 0036, 0251, 0301, 0015, 0374, 0007, 0043, 0351, 0310, 0146, 0022, 0351, 
+  0215, 0140, 0221, 0260, 0145, 0337, 0361, 0245, 0231, 0377, 0112, 0374, 0063, 0260, 0174, 0107, 
+  0201, 0121, 0267, 0256, 0347, 0051, 0064, 0013, 0010, 0165, 0143, 0115, 0323, 0335, 0064, 0254, 
+  0314, 0376, 0237, 0035, 0255, 0054, 0235, 0054, 0006, 0144, 0017, 0136, 0151, 0340, 0012, 0203, 
+  0136, 0005, 0046, 0366, 0135, 0344, 0174, 0330, 0254, 0024, 0326, 0262, 0351, 0070, 0273, 0111, 
+  0006, 0213, 0126, 0330, 0263, 0252, 0151, 0066, 0354, 0110, 0142, 0053, 0172, 0121, 0047, 0205, 
+  0232, 0203, 0030, 0112, 0357, 0146, 0033, 0167, 0264, 0356, 0313, 0322, 0352, 0073, 0315, 0130, 
+  0223, 0343, 0017, 0342, 0115, 0343, 0116, 0155, 0105, 0357, 0112, 0057, 0114, 0051, 0276, 0155, 
+  0344, 0335, 0313, 0215, 0255, 0062, 0331, 0227, 0315, 0302, 0317, 0361, 0136, 0046, 0230, 0030, 
+  0155, 0153, 0335, 0156, 0047, 0253, 0141, 0011, 0006, 0226, 0145, 0142, 0126, 0373, 0261, 0345, 
+  0271, 0043, 0316, 0103, 0312, 0254, 0220, 0311, 0066, 0136, 0277, 0175, 0137, 0233, 0063, 0021, 
+  0222, 0045, 0052, 0271, 0053, 0145, 0221, 0230, 0370, 0170, 0102, 0174, 0327, 0026, 0313, 0161, 
+  0204, 0005, 0052, 0016, 0134, 0223, 0006, 0256, 0357, 0343, 0060, 0227, 0226, 0305, 0022, 0167, 
+  0074, 0315, 0176, 0040, 0375, 0110, 0362, 0276, 0007, 0054, 0034, 0242, 0035, 0164, 0157, 0171, 
+  0323, 0110, 0027, 0170, 0116, 0354, 0335, 0315, 0150, 0173, 0264, 0231, 0376, 0272, 0075, 0162, 
+  0363, 0076, 0131, 0152, 0257, 0054, 0261, 0137, 0052, 0155, 0006, 0071, 0373, 0346, 0232, 0275, 
+  0123, 0176, 0101, 0316, 0164, 0332, 0230, 0353, 0264, 0336, 0161, 0023, 0126, 0343, 0175, 0262, 
+  0032, 0155, 0054, 0354, 0020, 0331, 0326, 0305, 0164, 0332, 0146, 0066, 0026, 0324, 0155, 0317, 
+  0073, 0353, 0032, 0227, 0344, 0250, 0016, 0256, 0312, 0251, 0252, 0167, 0204, 0121, 0304, 0037, 
+  0345, 0266, 0237, 0075, 0106, 0277, 0274, 0373, 0176, 0365, 0353, 0353, 0374, 0067, 0154, 0132, 
+  0247, 0371, 0153, 0265, 0364, 0172, 0055, 0271, 0146, 0113, 0255, 0333, 0234, 0265, 0273, 0161, 
+  0375, 0252, 0010, 0337, 0200, 0053, 0356, 0264, 0171, 0231, 0122, 0346, 0073, 0222, 0102, 0145, 
+  0022, 0236, 0073, 0031, 0032, 0342, 0254, 0175, 0243, 0101, 0261, 0017, 0062, 0326, 0255, 0122, 
+  0306, 0332, 0264, 0211, 0166, 0353, 0264, 0211, 0066, 0002, 0322, 0156, 0157, 0033, 0074, 0355, 
+  0066, 0155, 0033, 0144, 0204, 0170, 0314, 0015, 0014, 0206, 0177, 0262, 0314, 0335, 0060, 0212, 
+  0116, 0341, 0366, 0037, 0346, 0233, 0242, 0010, 0251, 0270, 0025, 0016, 0154, 0276, 0047, 0076, 
+  0205, 0130, 0130, 0123, 0106, 0204, 0327, 0235, 0063, 0006, 0073, 0061, 0340, 0105, 0267, 0041, 
+  0231, 0240, 0377, 0245, 0070, 0344, 0206, 0330, 0241, 0336, 0315, 0371, 0202, 0277, 0156, 0302, 
+  0315, 0074, 0033, 0305, 0357, 0344, 0113, 0242, 0311, 0233, 0263, 0352, 0324, 0327, 0167, 0157, 
+  0176, 0160, 0231, 0075, 0236, 0357, 0313, 0221, 0344, 0230, 0064, 0376, 0266, 0131, 0233, 0263, 
+  0160, 0325, 0337, 0027, 0356, 0102, 0213, 0105, 0014, 0266, 0346, 0202, 0214, 0352, 0351, 0336, 
+  0232, 0167, 0356, 0040, 0227, 0165, 0341, 0025, 0322, 0113, 0305, 0375, 0343, 0212, 0376, 0312, 
+  0227, 0355, 0361, 0122, 0226, 0360, 0067, 0276, 0334, 0143, 0167, 0343, 0140, 0102, 0010, 0033, 
+  0163, 0021, 0003, 0357, 0336, 0276, 0170, 0367, 0056, 0204, 0040, 0245, 0302, 0171, 0236, 0376, 
+  0155, 0206, 0243, 0217, 0221, 0300, 0010, 0054, 0307, 0211, 0354, 0224, 0347, 0322, 0013, 0001, 
+  0337, 0262, 0171, 0363, 0156, 0257, 0244, 0235, 0043, 0042, 0166, 0175, 0303, 0046, 0336, 0164, 
+  0342, 0323, 0067, 0175, 0376, 0071, 0044, 0017, 0342, 0103, 0034, 0243, 0133, 0014, 0011, 0176, 
+  0014, 0135, 0047, 0236, 0212, 0150, 0141, 0236, 0066, 0315, 0062, 0342, 0103, 0066, 0146, 0226, 
+  0343, 0163, 0245, 0136, 0104, 0014, 0234, 0023, 0311, 0237, 0227, 0015, 0124, 0306, 0144, 0102, 
+  0106, 0330, 0307, 0104, 0012, 0322, 0156, 0234, 0347, 0002, 0073, 0151, 0267, 0337, 0331, 0324, 
+  0132, 0303, 0324, 0351, 0232, 0276, 0322, 0233, 0213, 0266, 0075, 0273, 0220, 0053, 0242, 0137, 
+  0230, 0102, 0356, 0024, 0146, 0117, 0343, 0265, 0345, 0270, 0044, 0355, 0045, 0265, 0174, 0346, 
+  0162, 0176, 0130, 0324, 0034, 0205, 0326, 0043, 0345, 0203, 0300, 0146, 0050, 0036, 0352, 0344, 
+  0021, 0227, 0331, 0170, 0077, 0206, 0226, 0031, 0023, 0057, 0072, 0100, 0155, 0122, 0244, 0311, 
+  0014, 0324, 0030, 0235, 0123, 0301, 0311, 0346, 0046, 0162, 0116, 0150, 0075, 0030, 0256, 0357, 
+  0160, 0001, 0145, 0044, 0054, 0117, 0157, 0024, 0222, 0151, 0320, 0071, 0237, 0013, 0216, 0117, 
+  0374, 0104, 0146, 0212, 0223, 0315, 0263, 0213, 0213, 0333, 0307, 0332, 0354, 0144, 0115, 0276, 
+  0154, 0055, 0276, 0231, 0202, 0006, 0164, 0041, 0137, 0115, 0131, 0225, 0261, 0016, 0101, 0275, 
+  0350, 0324, 0143, 0005, 0313, 0317, 0114, 0041, 0106, 0144, 0063, 0343, 0035, 0137, 0114, 0174, 
+  0072, 0056, 0104, 0240, 0347, 0132, 0375, 0111, 0255, 0111, 0340, 0341, 0116, 0221, 0067, 0150, 
+  0144, 0221, 0156, 0066, 0025, 0137, 0244, 0005, 0005, 0260, 0201, 0253, 0276, 0254, 0230, 0112, 
+  0171, 0313, 0364, 0057, 0372, 0042, 0374, 0056, 0306, 0353, 0114, 0323, 0202, 0033, 0261, 0226, 
+  0360, 0337, 0166, 0125, 0161, 0217, 0060, 0157, 0236, 0210, 0024, 0324, 0212, 0005, 0230, 0223, 
+  0313, 0230, 0362, 0370, 0367, 0004, 0360, 0157, 0353, 0360, 0057, 0235, 0016, 0003, 0367, 0047, 
+  0366, 0052, 0200, 0277, 0203, 0351, 0320, 0214, 0150, 0243, 0137, 0076, 0137, 0276, 0243, 0277, 
+  0002, 0010, 0006, 0020, 0014, 0040, 0270, 0015, 0040, 0370, 0045, 0200, 0340, 0154, 0045, 0012, 
+  0030, 0030, 0060, 0360, 0076, 0141, 0340, 0143, 0035, 0030, 0270, 0333, 0044, 0014, 0334, 0003, 
+  0014, 0334, 0072, 0014, 0074, 0107, 0061, 0132, 0361, 0257, 0371, 0225, 0323, 0005, 0320, 0333, 
+  0054, 0320, 0013, 0350, 0264, 0361, 0350, 0364, 0071, 0240, 0323, 0125, 0365, 0006, 0310, 0024, 
+  0220, 0051, 0040, 0323, 0106, 0173, 0147, 0003, 0317, 0262, 0361, 0230, 0170, 0174, 0247, 0074, 
+  0202, 0067, 0301, 0233, 0064, 0275, 0151, 0363, 0202, 0154, 0112, 0264, 0262, 0112, 0234, 0132, 
+  0205, 0171, 0104, 0015, 0016, 0126, 0356, 0356, 0060, 0130, 0371, 0025, 0004, 0053, 0363, 0217, 
+  0257, 0366, 0067, 0130, 0031, 0331, 0144, 0042, 0060, 0074, 0147, 0114, 0224, 0134, 0045, 0352, 
+  0166, 0105, 0376, 0201, 0117, 0361, 0007, 0010, 0141, 0326, 0154, 0031, 0066, 0057, 0204, 0271, 
+  0013, 0041, 0314, 0162, 0120, 0241, 0222, 0020, 0346, 0347, 0020, 0302, 0334, 0304, 0020, 0346, 
+  0323, 0046, 0273, 0257, 0333, 0342, 0171, 0026, 0233, 0132, 0125, 0116, 0347, 0257, 0046, 0070, 
+  0235, 0053, 0073, 0012, 0001, 0357, 0065, 0170, 0257, 0253, 0366, 0136, 0277, 0002, 0357, 0365, 
+  0202, 0212, 0004, 0307, 0065, 0070, 0256, 0301, 0161, 0335, 0150, 0307, 0165, 0016, 0046, 0175, 
+  0016, 0230, 0264, 0046, 0230, 0224, 0172, 0302, 0023, 0122, 0105, 0050, 0304, 0040, 0242, 0014, 
+  0270, 0164, 0117, 0161, 0351, 0332, 0120, 0342, 0045, 0123, 0010, 0220, 0356, 0036, 0041, 0335, 
+  0356, 0061, 0100, 0335, 0045, 0315, 0013, 0140, 0027, 0300, 0056, 0344, 0320, 0265, 0031, 0354, 
+  0276, 0004, 0260, 0133, 0023, 0260, 0173, 0073, 0365, 0252, 0310, 0172, 0063, 0077, 0160, 0272, 
+  0000, 0164, 0001, 0350, 0002, 0320, 0005, 0240, 0233, 0000, 0335, 0036, 0000, 0335, 0005, 0255, 
+  0013, 0060, 0027, 0140, 0056, 0300, 0134, 0111, 0230, 0333, 0250, 0064, 0271, 0027, 0000, 0163, 
+  0153, 0002, 0163, 0047, 0330, 0161, 0247, 0223, 0052, 0200, 0356, 0227, 0210, 0062, 0100, 0135, 
+  0200, 0272, 0000, 0165, 0001, 0352, 0046, 0120, 0267, 0013, 0120, 0167, 0111, 0363, 0002, 0330, 
+  0005, 0260, 0013, 0001, 0014, 0215, 0006, 0273, 0220, 0073, 0006, 0371, 0160, 0371, 0215, 0041, 
+  0037, 0016, 0265, 0061, 0037, 0256, 0267, 0303, 0174, 0270, 0314, 0043, 0362, 0375, 0113, 0210, 
+  0353, 0036, 0357, 0363, 0365, 0035, 0111, 0161, 0061, 0364, 0115, 0134, 0242, 0015, 0011, 0160, 
+  0232, 0315, 0263, 0346, 0045, 0300, 0365, 0040, 0001, 0116, 0016, 0033, 0124, 0222, 0000, 0367, 
+  0002, 0022, 0340, 0032, 0226, 0000, 0027, 0135, 0322, 0331, 0050, 0277, 0264, 0056, 0107, 0360, 
+  0274, 0310, 0357, 0150, 0250, 0337, 0023, 0234, 0312, 0331, 0216, 0067, 0052, 0042, 0066, 0052, 
+  0024, 0142, 0347, 0031, 0032, 0205, 0030, 0373, 0317, 0320, 0220, 0157, 0054, 0235, 0163, 0363, 
+  0372, 0343, 0133, 0160, 0027, 0357, 0251, 0273, 0170, 0217, 0275, 0075, 0015, 0363, 0355, 0136, 
+  0115, 0254, 0021, 0316, 0120, 0034, 0156, 0364, 0175, 0123, 0335, 0273, 0313, 0307, 0162, 0214, 
+  0330, 0167, 0235, 0363, 0021, 0273, 0063, 0046, 0056, 0245, 0234, 0343, 0106, 0064, 0076, 0070, 
+  0255, 0330, 0040, 0321, 0174, 0040, 0006, 0173, 0014, 0370, 0124, 0142, 0337, 0001, 0117, 0050, 
+  0202, 0124, 0256, 0105, 0164, 0145, 0016, 0107, 0341, 0176, 0003, 0054, 0316, 0200, 0255, 0001, 
+  0054, 0001, 0252, 0146, 0010, 0213, 0243, 0055, 0016, 0260, 0336, 0176, 0274, 0006, 0200, 0005, 
+  0347, 0361, 0213, 0347, 0361, 0253, 0350, 0037, 0120, 0333, 0176, 0240, 0066, 0241, 0215, 0000, 
+  0265, 0001, 0152, 0003, 0324, 0046, 0201, 0332, 0272, 0373, 0206, 0332, 0116, 0367, 0033, 0262, 
+  0335, 0127, 0215, 0331, 0236, 0116, 0307, 0236, 0212, 0031, 0076, 0103, 0233, 0121, 0334, 0037, 
+  0157, 0115, 0200, 0161, 0000, 0343, 0000, 0306, 0001, 0214, 0113, 0151, 0050, 0300, 0161, 0200, 
+  0343, 0000, 0307, 0155, 0033, 0307, 0165, 0233, 0344, 0175, 0343, 0033, 0303, 0236, 0103, 0271, 
+  0252, 0317, 0067, 0067, 0103, 0271, 0214, 0023, 0317, 0077, 0340, 0310, 0023, 0240, 0034, 0100, 
+  0071, 0200, 0162, 0151, 0015, 0005, 0120, 0016, 0240, 0034, 0100, 0271, 0155, 0037, 0244, 0102, 
+  0112, 0011, 0274, 0151, 0107, 0157, 0202, 0224, 0022, 0110, 0051, 0111, 0363, 0242, 0137, 0151, 
+  0112, 0311, 0172, 0221, 0315, 0240, 0222, 0305, 0305, 0154, 0016, 0052, 0161, 0117, 0236, 0163, 
+  0322, 0022, 0224, 0301, 0261, 0245, 0161, 0056, 0216, 0161, 0341, 0307, 0063, 0313, 0026, 0304, 
+  0215, 0007, 0327, 0031, 0141, 0066, 0113, 0151, 0130, 0374, 0232, 0033, 0166, 0064, 0040, 0076, 
+  0345, 0275, 0061, 0136, 0164, 0316, 0207, 0221, 0351, 0311, 0347, 0160, 0341, 0241, 0047, 0342, 
+  0253, 0004, 0323, 0257, 0337, 0210, 0022, 0155, 0217, 0120, 0154, 0306, 0344, 0071, 0110, 0034, 
+  0045, 0020, 0121, 0012, 0006, 0312, 0102, 0275, 0345, 0347, 0135, 0233, 0167, 0136, 0174, 0354, 
+  0234, 0077, 0160, 0303, 0207, 0074, 0030, 0121, 0257, 0026, 0233, 0025, 0037, 0021, 0361, 0110, 
+  0150, 0122, 0173, 0214, 0047, 0330, 0114, 0314, 0105, 0132, 0237, 0021, 0072, 0274, 0231, 0260, 
+  0354, 0215, 0020, 0013, 0313, 0136, 0165, 0220, 0323, 0220, 0362, 0121, 0062, 0061, 0110, 0312, 
+  0107, 0351, 0141, 0206, 0153, 0060, 0070, 0354, 0270, 0314, 0210, 0173, 0243, 0070, 0060, 0216, 
+  0351, 0133, 0070, 0252, 0061, 0366, 0202, 0372, 0210, 0240, 0350, 0215, 0061, 0024, 0351, 0050, 
+  0313, 0271, 0135, 0205, 0007, 0044, 0250, 0265, 0160, 0236, 0250, 0165, 0317, 0165, 0206, 0153, 
+  0171, 0144, 0144, 0362, 0216, 0330, 0042, 0236, 0245, 0056, 0263, 0306, 0177, 0261, 0061, 0245, 
+  0006, 0067, 0176, 0003, 0015, 0303, 0213, 0076, 0327, 0117, 0053, 0212, 0156, 0311, 0214, 0356, 
+  0135, 0064, 0232, 0044, 0107, 0052, 0122, 0371, 0251, 0101, 0166, 0364, 0364, 0163, 0030, 0271, 
+  0132, 0305, 0366, 0312, 0306, 0031, 0151, 0114, 0053, 0006, 0240, 0313, 0070, 0307, 0062, 0323, 
+  0052, 0171, 0327, 0320, 0215, 0350, 0045, 0272, 0240, 0207, 0207, 0207, 0171, 0224, 0046, 0304, 
+  0261, 0274, 0142, 0274, 0027, 0226, 0275, 0041, 0074, 0304, 0234, 0227, 0321, 0330, 0127, 0032, 
+  0104, 0010, 0004, 0361, 0047, 0160, 0350, 0133, 0236, 0021, 0375, 0033, 0147, 0374, 0316, 0334, 
+  0102, 0033, 0234, 0375, 0061, 0121, 0103, 0074, 0336, 0117, 0271, 0221, 0244, 0335, 0105, 0052, 
+  0156, 0041, 0345, 0074, 0340, 0265, 0165, 0261, 0062, 0223, 0310, 0326, 0160, 0050, 0006, 0127, 
+  0246, 0045, 0012, 0255, 0054, 0140, 0300, 0125, 0146, 0105, 0253, 0151, 0231, 0145, 0251, 0366, 
+  0375, 0316, 0146, 0334, 0131, 0310, 0331, 0246, 0352, 0130, 0133, 0075, 0173, 0170, 0044, 0123, 
+  0276, 0340, 0330, 0243, 0267, 0331, 0047, 0124, 0070, 0213, 0074, 0175, 0074, 0262, 0116, 0221, 
+  0026, 0310, 0055, 0337, 0120, 0376, 0353, 0062, 0042, 0045, 0143, 0000, 0351, 0110, 0124, 0127, 
+  0151, 0072, 0073, 0247, 0220, 0155, 0254, 0160, 0322, 0261, 0242, 0127, 0143, 0137, 0357, 0306, 
+  0315, 0114, 0206, 0236, 0344, 0001, 0307, 0162, 0163, 0313, 0173, 0260, 0036, 0371, 0276, 0065, 
+  0346, 0300, 0076, 0351, 0332, 0146, 0022, 0073, 0267, 0262, 0245, 0233, 0025, 0072, 0057, 0250, 
+  0244, 0162, 0303, 0232, 0065, 0227, 0332, 0335, 0313, 0255, 0270, 0301, 0312, 0176, 0334, 0262, 
+  0365, 0066, 0266, 0150, 0335, 0026, 0353, 0022, 0064, 0203, 0245, 0132, 0315, 0122, 0325, 0162, 
+  0351, 0370, 0116, 0174, 0131, 0122, 0115, 0212, 0035, 0374, 0110, 0153, 0264, 0174, 0027, 0130, 
+  0226, 0026, 0133, 0127, 0026, 0341, 0144, 0251, 0054, 0102, 0156, 0051, 0204, 0132, 0101, 0251, 
+  0034, 0003, 0141, 0255, 0366, 0050, 0124, 0035, 0101, 0275, 0042, 0102, 0321, 0115, 0344, 0275, 
+  0317, 0302, 0307, 0325, 0075, 0004, 0107, 0137, 0327, 0123, 0345, 0013, 0120, 0175, 0157, 0061, 
+  0134, 0130, 0167, 0227, 0127, 0124, 0305, 0003, 0275, 0024, 0203, 0364, 0253, 0300, 0007, 0003, 
+  0073, 0044, 0236, 0207, 0235, 0077, 0043, 0277, 0152, 0062, 0307, 0311, 0167, 0261, 0257, 0365, 
+  0244, 0246, 0063, 0074, 0216, 0273, 0071, 0264, 0102, 0043, 0040, 0236, 0153, 0163, 0111, 0364, 
+  0205, 0307, 0124, 0206, 0006, 0035, 0133, 0302, 0233, 0034, 0053, 0077, 0327, 0327, 0125, 0052, 
+  0352, 0006, 0377, 0144, 0177, 0270, 0370, 0141, 0165, 0311, 0060, 0376, 0313, 0275, 0370, 0145, 
+  0273, 0325, 0162, 0124, 0232, 0077, 0204, 0126, 0140, 0114, 0210, 0043, 0234, 0356, 0134, 0175, 
+  0311, 0066, 0267, 0154, 0033, 0007, 0214, 0032, 0134, 0031, 0027, 0072, 0340, 0133, 0177, 0252, 
+  0130, 0331, 0121, 0233, 0236, 0005, 0333, 0335, 0356, 0202, 0275, 0034, 0143, 0173, 0025, 0325, 
+  0017, 0371, 0173, 0104, 0034, 0227, 0357, 0230, 0266, 0170, 0100, 0003, 0262, 0217, 0174, 0121, 
+  0051, 0302, 0050, 0067, 0202, 0246, 0016, 0132, 0101, 0003, 0340, 0056, 0011, 0221, 0345, 0302, 
+  0363, 0352, 0042, 0305, 0275, 0072, 0110, 0261, 0117, 0230, 0173, 0053, 0370, 0046, 0374, 0141, 
+  0172, 0345, 0070, 0115, 0032, 0105, 0176, 0140, 0220, 0344, 0166, 0112, 0162, 0177, 0273, 0222, 
+  0274, 0134, 0026, 0362, 0344, 0125, 0135, 0253, 0143, 0026, 0216, 0147, 0226, 0360, 0376, 0174, 
+  0345, 0017, 0274, 0336, 0242, 0110, 0116, 0174, 0074, 0041, 0276, 0153, 0047, 0241, 0014, 0213, 
+  0156, 0221, 0310, 0036, 0331, 0232, 0200, 0036, 0067, 0004, 0341, 0057, 0013, 0350, 0351, 0161, 
+  0353, 0004, 0364, 0276, 0002, 0311, 0176, 0207, 0271, 0175, 0341, 0006, 0142, 0277, 0250, 0215, 
+  0200, 0077, 0131, 0017, 0365, 0227, 0361, 0156, 0175, 0202, 0311, 0200, 0012, 0204, 0352, 0325, 
+  0047, 0124, 0357, 0371, 0206, 0143, 0267, 0314, 0340, 0275, 0115, 0304, 0116, 0327, 0036, 0013, 
+  0350, 0217, 0003, 0214, 0143, 0047, 0332, 0027, 0015, 0230, 0214, 0153, 0112, 0031, 0231, 0324, 
+  0140, 0104, 0302, 0155, 0102, 0251, 0010, 0140, 0240, 0206, 0120, 0367, 0206, 0210, 0131, 0042, 
+  0141, 0251, 0301, 0265, 0050, 0376, 0052, 0036, 0120, 0353, 0242, 0345, 0342, 0141, 0271, 0076, 
+  0007, 0060, 0236, 0127, 0247, 0150, 0053, 0376, 0200, 0137, 0152, 0114, 0221, 0116, 0252, 0131, 
+  0370, 0230, 0141, 0121, 0231, 0061, 0175, 0166, 0051, 0033, 0360, 0065, 0370, 0064, 0056, 0102, 
+  0204, 0323, 0331, 0214, 0342, 0142, 0114, 0217, 0377, 0110, 0243, 0037, 0237, 0242, 0250, 0342, 
+  0223, 0253, 0231, 0362, 0026, 0347, 0131, 0311, 0211, 0214, 0350, 0012, 0032, 0331, 0143, 0053, 
+  0264, 0302, 0320, 0172, 0354, 0246, 0216, 0264, 0222, 0146, 0110, 0170, 0242, 0337, 0164, 0346, 
+  0317, 0074, 0225, 0274, 0347, 0233, 0116, 0232, 0356, 0231, 0303, 0301, 0352, 0254, 0055, 0027, 
+  0275, 0364, 0221, 0032, 0361, 0242, 0176, 0036, 0147, 0342, 0132, 0341, 0232, 0106, 0034, 0364, 
+  0222, 0007, 0344, 0062, 0074, 0241, 0021, 0341, 0371, 0106, 0227, 0042, 0245, 0102, 0226, 0272, 
+  0016, 0326, 0112, 0367, 0212, 0117, 0041, 0105, 0304, 0367, 0036, 0165, 0166, 0164, 0023, 0275, 
+  0263, 0243, 0047, 0336, 0026, 0226, 0364, 0170, 0027, 0152, 0113, 0264, 0353, 0152, 0300, 0244, 
+  0203, 0231, 0345, 0172, 0124, 0123, 0260, 0044, 0276, 0027, 0151, 0353, 0235, 0363, 0217, 0357, 
+  0176, 0067, 0277, 0177, 0273, 0372, 0172, 0363, 0376, 0332, 0374, 0362, 0355, 0346, 0352, 0333, 
+  0127, 0363, 0313, 0305, 0340, 0167, 0364, 0037, 0224, 0361, 0313, 0047, 0376, 0137, 0372, 0347, 
+  0267, 0077, 0156, 0156, 0370, 0327, 0337, 0257, 0337, 0017, 0006, 0031, 0337, 0137, 0277, 0377, 
+  0374, 0376, 0142, 0360, 0076, 0372, 0105, 0056, 0170, 0363, 0124, 0075, 0170, 0363, 0062, 0302, 
+  0020, 0356, 0077, 0111, 0004, 0147, 0036, 0241, 0004, 0273, 0314, 0361, 0251, 0215, 0105, 0140, 
+  0241, 0301, 0347, 0057, 0260, 0102, 0376, 0071, 0217, 0100, 0342, 0027, 0064, 0306, 0361, 0115, 
+  0031, 0347, 0047, 0247, 0307, 0065, 0012, 0002, 0075, 0331, 0165, 0020, 0350, 0256, 0345, 0254, 
+  0125, 0201, 0251, 0047, 0165, 0212, 0246, 0250, 0303, 0314, 0156, 0075, 0140, 0166, 0005, 0371, 
+  0226, 0013, 0333, 0373, 0304, 0011, 0355, 0301, 0011, 0110, 0135, 0104, 0145, 0103, 0140, 0137, 
+  0246, 0111, 0003, 0041, 0175, 0255, 0213, 0276, 0135, 0165, 0240, 0224, 0014, 0165, 0137, 0165, 
+  0172, 0064, 0141, 0011, 0313, 0122, 0150, 0314, 0012, 0136, 0166, 0215, 0301, 0022, 0206, 0250, 
+  0334, 0326, 0104, 0345, 0256, 0150, 0266, 0257, 0204, 0341, 0041, 0041, 0167, 0261, 0156, 0363, 
+  0223, 0377, 0172, 0025, 0303, 0104, 0231, 0146, 0165, 0105, 0211, 0071, 0366, 0246, 0364, 0026, 
+  0223, 0276, 0232, 0263, 0367, 0242, 0256, 0147, 0273, 0165, 0126, 0343, 0213, 0063, 0262, 0371, 
+  0002, 0271, 0362, 0127, 0216, 0256, 0263, 0354, 0236, 0353, 0212, 0076, 0235, 0111, 0104, 0052, 
+  0125, 0176, 0301, 0200, 0337, 0116, 0314, 0251, 0122, 0121, 0227, 0072, 0211, 0211, 0226, 0351, 
+  0126, 0237, 0362, 0374, 0132, 0100, 0052, 0321, 0334, 0175, 0211, 0033, 0042, 0143, 0307, 0222, 
+  0021, 0342, 0177, 0117, 0061, 0345, 0320, 0255, 0167, 0174, 0254, 0162, 0267, 0242, 0316, 0213, 
+  0046, 0125, 0111, 0324, 0115, 0256, 0164, 0005, 0264, 0153, 0010, 0154, 0227, 0250, 0073, 0265, 
+  0032, 0350, 0036, 0142, 0074, 0017, 0164, 0117, 0351, 0033, 0161, 0054, 0262, 0343, 0262, 0257, 
+  0145, 0310, 0324, 0121, 0134, 0262, 0127, 0250, 0305, 0167, 0056, 0152, 0314, 0170, 0247, 0120, 
+  0353, 0166, 0305, 0155, 0110, 0261, 0207, 0355, 0130, 0303, 0111, 0227, 0227, 0024, 0002, 0061, 
+  0230, 0265, 0077, 0332, 0102, 0055, 0277, 0122, 0125, 0316, 0212, 0024, 0002, 0134, 0147, 0000, 
+  0250, 0252, 0042, 0271, 0002, 0244, 0245, 0012, 0217, 0346, 0224, 0015, 0334, 0152, 0215, 0067, 
+  0025, 0064, 0241, 0243, 0304, 0333, 0216, 0057, 0314, 0136, 0362, 0254, 0217, 0143, 0377, 0300, 
+  0122, 0221, 0014, 0200, 0143, 0212, 0160, 0114, 0002, 0111, 0251, 0372, 0352, 0125, 0241, 0130, 
+  0332, 0365, 0267, 0122, 0263, 0112, 0002, 0204, 0155, 0014, 0121, 0135, 0075, 0333, 0335, 0022, 
+  0044, 0243, 0330, 0027, 0013, 0354, 0036, 0227, 0270, 0373, 0133, 0003, 0254, 0223, 0167, 0057, 
+  0066, 0031, 0040, 0046, 0256, 0275, 0314, 0012, 0150, 0052, 0364, 0024, 0353, 0222, 0227, 0366, 
+  0076, 0126, 0277, 0067, 0053, 0313, 0244, 0144, 0055, 0345, 0326, 0354, 0316, 0155, 0257, 0300, 
+  0272, 0341, 0024, 0047, 0211, 0271, 0212, 0362, 0124, 0345, 0263, 0175, 0272, 0340, 0160, 0223, 
+  0167, 0270, 0255, 0337, 0323, 0056, 0211, 0317, 0270, 0021, 0114, 0253, 0074, 0272, 0340, 0357, 
+  0063, 0012, 0255, 0363, 0112, 0116, 0004, 0027, 0334, 0265, 0040, 0074, 0115, 0365, 0326, 0166, 
+  0137, 0152, 0167, 0327, 0056, 0324, 0245, 0345, 0273, 0073, 0345, 0133, 0251, 0071, 0056, 0356, 
+  0270, 0005, 0260, 0257, 0212, 0325, 0323, 0165, 0113, 0305, 0307, 0136, 0147, 0067, 0336, 0115, 
+  0145, 0334, 0221, 0272, 0357, 0042, 0211, 0335, 0162, 0375, 0133, 0242, 0204, 0061, 0105, 0335, 
+  0126, 0352, 0376, 0203, 0067, 0034, 0115, 0065, 0000, 0301, 0325, 0334, 0275, 0042, 0057, 0242, 
+  0313, 0300, 0303, 0174, 0260, 0102, 0237, 0277, 0332, 0114, 0153, 0015, 0052, 0041, 0267, 0221, 
+  0376, 0114, 0371, 0366, 0137, 0356, 0334, 0267, 0257, 0074, 0345, 0353, 0341, 0304, 0315, 0030, 
+  0043, 0173, 0032, 0212, 0150, 0132, 0144, 0047, 0320, 0042, 0316, 0376, 0107, 0016, 0301, 0024, 
+  0371, 0204, 0041, 0072, 0015, 0002, 0022, 0212, 0337, 0071, 0043, 0121, 0302, 0310, 0103, 0225, 
+  0176, 0210, 0212, 0051, 0140, 0373, 0024, 0272, 0324, 0244, 0045, 0266, 0217, 0122, 0323, 0135, 
+  0371, 0046, 0327, 0124, 0126, 0073, 0135, 0252, 0254, 0266, 0136, 0007, 0315, 0053, 0254, 0055, 
+  0100, 0225, 0150, 0301, 0201, 0067, 0263, 0074, 0300, 0131, 0050, 0367, 0266, 0031, 0330, 0146, 
+  0262, 0247, 0160, 0335, 0067, 0325, 0115, 0350, 0122, 0114, 0373, 0102, 0114, 0043, 0041, 0036, 
+  0163, 0003, 0363, 0066, 0331, 0207, 0072, 0315, 0072, 0025, 0056, 0161, 0151, 0140, 0225, 0262, 
+  0265, 0332, 0256, 0352, 0223, 0347, 0244, 0176, 0102, 0234, 0201, 0262, 0213, 0315, 0153, 0241, 
+  0352, 0100, 0117, 0145, 0014, 0351, 0352, 0003, 0047, 0365, 0302, 0156, 0153, 0227, 0315, 0020, 
+  0226, 0015, 0054, 0033, 0155, 0313, 0246, 0333, 0262, 0145, 0263, 0154, 0362, 0164, 0033, 0147, 
+  0226, 0067, 0042, 0352, 0110, 0366, 0226, 0133, 0211, 0003, 0312, 0233, 0130, 0317, 0321, 0327, 
+  0073, 0074, 0235, 0132, 0051, 0250, 0263, 0254, 0174, 0167, 0276, 0156, 0217, 0333, 0276, 0335, 
+  0305, 0001, 0105, 0330, 0001, 0230, 0330, 0072, 0244, 0325, 0257, 0073, 0322, 0302, 0077, 0031, 
+  0310, 0134, 0273, 0144, 0256, 0127, 0163, 0231, 0003, 0055, 0327, 0066, 0211, 0353, 0066, 0145, 
+  0203, 0005, 0203, 0262, 0155, 0066, 0131, 0335, 0067, 0330, 0241, 0105, 0061, 0310, 0134, 0273, 
+  0144, 0256, 0356, 0033, 0054, 0150, 0271, 0266, 0111, 0134, 0267, 0336, 0236, 0247, 0027, 0340, 
+  0170, 0322, 0357, 0170, 0332, 0160, 0152, 0317, 0215, 0266, 0346, 0203, 0306, 0232, 0007, 0220, 
+  0074, 0007, 0231, 0336, 0246, 0114, 0277, 0235, 0335, 0243, 0322, 0174, 0155, 0135, 0163, 0311, 
+  0076, 0151, 0232, 0144, 0127, 0351, 0202, 0037, 0044, 0246, 0141, 0134, 0225, 0263, 0126, 0216, 
+  0370, 0025, 0253, 0265, 0371, 0236, 0370, 0176, 0315, 0117, 0320, 0372, 0260, 0064, 0346, 0113, 
+  0343, 0312, 0017, 0246, 0014, 0015, 0311, 0117, 0134, 0257, 0165, 0061, 0067, 0251, 0233, 0277, 
+  0040, 0172, 0365, 0136, 0020, 0260, 0036, 0122, 0353, 0041, 0056, 0032, 0122, 0263, 0265, 0320, 
+  0232, 0255, 0141, 0267, 0046, 0356, 0372, 0073, 0075, 0232, 0026, 0162, 0133, 0263, 0164, 0103, 
+  0115, 0325, 0000, 0116, 0040, 0176, 0266, 0174, 0374, 0354, 0126, 0163, 0372, 0027, 0102, 0240, 
+  0023, 0217, 0036, 0135, 0137, 0330, 0123, 0101, 0037, 0137, 0143, 0212, 0031, 0142, 0004, 0275, 
+  0113, 0250, 0067, 0265, 0370, 0322, 0136, 0146, 0351, 0157, 0222, 0017, 0110, 0330, 0207, 0204, 
+  0375, 0246, 0356, 0240, 0275, 0355, 0044, 0354, 0313, 0044, 0164, 0153, 0256, 0015, 0253, 0245, 
+  0060, 0100, 0367, 0045, 0344, 0166, 0353, 0055, 0014, 0300, 0325, 0151, 0245, 0145, 0001, 0012, 
+  0202, 0304, 0032, 0127, 0023, 0170, 0005, 0042, 0267, 0367, 0305, 0137, 0363, 0053, 0200, 0236, 
+  0026, 0064, 0065, 0024, 0252, 0177, 0126, 0145, 0255, 0250, 0064, 0257, 0273, 0261, 0242, 0132, 
+  0355, 0263, 0144, 0245, 0117, 0131, 0223, 0147, 0261, 0302, 0347, 0342, 0115, 0127, 0071, 0105, 
+  0076, 0241, 0016, 0254, 0142, 0106, 0206, 0162, 0121, 0317, 0122, 0005, 0075, 0113, 0024, 0363, 
+  0054, 0125, 0203, 0023, 0252, 0120, 0356, 0320, 0357, 0364, 0034, 0374, 0116, 0173, 0123, 0205, 
+  0062, 0353, 0232, 0102, 0050, 0104, 0011, 0056, 0056, 0145, 0027, 0327, 0272, 0173, 0057, 0301, 
+  0265, 0005, 0256, 0055, 0070, 0034, 0322, 0354, 0224, 0350, 0325, 0306, 0265, 0165, 0002, 0145, 
+  0013, 0265, 0272, 0266, 0142, 0123, 0035, 0275, 0215, 0034, 0021, 0333, 0361, 0160, 0365, 0232, 
+  0351, 0341, 0352, 0037, 0203, 0344, 0201, 0207, 0053, 0327, 0303, 0365, 0034, 0074, 0134, 0340, 
+  0341, 0122, 0364, 0160, 0105, 0365, 0057, 0301, 0277, 0005, 0376, 0055, 0360, 0157, 0265, 0301, 
+  0277, 0365, 0002, 0374, 0133, 0173, 0343, 0337, 0112, 0253, 0156, 0360, 0156, 0201, 0167, 0253, 
+  0244, 0167, 0153, 0125, 0234, 0300, 0267, 0005, 0276, 0055, 0360, 0155, 0125, 0340, 0216, 0350, 
+  0327, 0307, 0267, 0325, 0007, 0017, 0203, 0116, 0337, 0326, 0025, 0127, 0242, 0133, 0212, 0332, 
+  0352, 0067, 0317, 0247, 0145, 0117, 0103, 0112, 0302, 0165, 0227, 0063, 0203, 0330, 0201, 0143, 
+  0153, 0321, 0261, 0365, 0022, 0034, 0133, 0340, 0330, 0122, 0164, 0154, 0045, 0272, 0006, 0134, 
+  0133, 0340, 0332, 0002, 0327, 0326, 0116, 0221, 0263, 0352, 0365, 0140, 0361, 0002, 0026, 0167, 
+  0063, 0311, 0334, 0012, 0006, 0236, 0255, 0042, 0233, 0270, 0376, 0273, 0062, 0122, 0226, 0105, 
+  0172, 0346, 0142, 0250, 0134, 0227, 0373, 0221, 0314, 0001, 0357, 0123, 0255, 0022, 0276, 0323, 
+  0274, 0242, 0034, 0222, 0141, 0270, 0204, 0254, 0076, 0345, 0023, 0122, 0016, 0166, 0362, 0263, 
+  0171, 0305, 0104, 0232, 0200, 0040, 0212, 0373, 0332, 0363, 0047, 0120, 0112, 0061, 0321, 0211, 
+  0345, 0171, 0271, 0352, 0111, 0313, 0334, 0352, 0232, 0337, 0246, 0314, 0261, 0234, 0116, 0036, 
+  0210, 0211, 0120, 0045, 0053, 0324, 0362, 0304, 0012, 0357, 0246, 0201, 0314, 0164, 0344, 0151, 
+  0320, 0142, 0132, 0124, 0213, 0046, 0055, 0257, 0115, 0113, 0153, 0324, 0002, 0132, 0265, 0000, 
+  0162, 0126, 0133, 0234, 0003, 0261, 0345, 0145, 0054, 0316, 0350, 0153, 0271, 0061, 0057, 0135, 
+  0360, 0330, 0075, 0076, 0126, 0345, 0236, 0356, 0005, 0136, 0206, 0114, 0123, 0326, 0267, 0345, 
+  0374, 0075, 0245, 0154, 0302, 0073, 0333, 0071, 0237, 0177, 0356, 0252, 0222, 0163, 0334, 0221, 
+  0053, 0206, 0255, 0074, 0207, 0116, 0150, 0075, 0030, 0367, 0226, 0067, 0305, 0122, 0213, 0261, 
+  0172, 0315, 0120, 0106, 0030, 0164, 0052, 0206, 0156, 0275, 0025, 0303, 0132, 0163, 0042, 0034, 
+  0141, 0330, 0265, 0167, 0277, 0153, 0177, 0026, 0023, 0001, 0273, 0166, 0105, 0213, 0263, 0267, 
+  0255, 0305, 0131, 0235, 0055, 0251, 0152, 0370, 0350, 0062, 0045, 0153, 0126, 0142, 0173, 0155, 
+  0304, 0326, 0053, 0260, 0052, 0167, 0156, 0125, 0226, 0215, 0342, 0122, 0335, 0344, 0026, 0352, 
+  0153, 0055, 0234, 0127, 0344, 0306, 0163, 0125, 0026, 0323, 0125, 0331, 0336, 0251, 0022, 0333, 
+  0125, 0041, 0260, 0126, 0217, 0361, 0152, 0362, 0206, 0376, 0124, 0254, 0053, 0103, 0330, 0212, 
+  0106, 0173, 0151, 0364, 0216, 0152, 0215, 0372, 0152, 0014, 0104, 0050, 0105, 0142, 0007, 0226, 
+  0175, 0373, 0374, 0315, 0274, 0277, 0311, 0051, 0164, 0121, 0345, 0136, 0006, 0251, 0101, 0074, 
+  0136, 0335, 0313, 0250, 0235, 0324, 0047, 0036, 0357, 0004, 0002, 0243, 0164, 0306, 0343, 0175, 
+  0047, 0356, 0346, 0033, 0203, 0266, 0044, 0106, 0133, 0211, 0310, 0313, 0032, 0113, 0366, 0070, 
+  0124, 0214, 0066, 0171, 0255, 0040, 0155, 0234, 0145, 0014, 0165, 0151, 0230, 0213, 0103, 0134, 
+  0370, 0361, 0314, 0212, 0202, 0077, 0222, 0223, 0125, 0072, 0153, 0261, 0360, 0065, 0012, 0061, 
+  0015, 0210, 0117, 0171, 0157, 0214, 0156, 0267, 0163, 0036, 0041, 0040, 0163, 0214, 0275, 0040, 
+  0051, 0125, 0172, 0166, 0264, 0360, 0174, 0076, 0225, 0027, 0117, 0104, 0154, 0217, 0120, 0274, 
+  0211, 0312, 0322, 0227, 0121, 0017, 0323, 0343, 0131, 0325, 0016, 0127, 0021, 0376, 0211, 0213, 
+  0231, 0004, 0246, 0345, 0070, 0251, 0172, 0252, 0211, 0236, 0220, 0322, 0015, 0262, 0372, 0140, 
+  0005, 0075, 0332, 0274, 0367, 0342, 0143, 0347, 0134, 0004, 0124, 0031, 0274, 0107, 0213, 0115, 
+  0066, 0017, 0347, 0063, 0157, 0063, 0140, 0044, 0234, 0017, 0051, 0056, 0032, 0053, 0150, 0321, 
+  0350, 0373, 0344, 0265, 0374, 0353, 0351, 0304, 0237, 0117, 0341, 0277, 0014, 0003, 0305, 0337, 
+  0105, 0157, 0107, 0043, 0173, 0154, 0205, 0126, 0030, 0132, 0217, 0135, 0144, 0030, 0263, 0307, 
+  0342, 0107, 0022, 0375, 0073, 0177, 0346, 0051, 0034, 0210, 0113, 0113, 0232, 0356, 0231, 0303, 
+  0065, 0305, 0254, 0155, 0110, 0036, 0122, 0102, 0307, 0037, 0214, 0272, 0170, 0234, 0175, 0142, 
+  0105, 0074, 0327, 0101, 0111, 0235, 0166, 0376, 0147, 0056, 0234, 0051, 0052, 0122, 0024, 0077, 
+  0221, 0320, 0375, 0207, 0370, 0314, 0362, 0320, 0050, 0264, 0034, 0021, 0252, 0251, 0211, 0362, 
+  0037, 0111, 0250, 0147, 0056, 0335, 0263, 0243, 0047, 0176, 0310, 0310, 0144, 0210, 0047, 0065, 
+  0223, 0111, 0336, 0043, 0162, 0217, 0313, 0211, 0145, 0144, 0371, 0313, 0213, 0145, 0374, 0171, 
+  0047, 0042, 0171, 0343, 0212, 0310, 0021, 0055, 0022, 0363, 0177, 0204, 0114, 0064, 0221, 0272, 
+  0114, 0256, 0353, 0323, 0102, 0154, 0020, 0107, 0307, 0350, 0241, 0305, 0102, 0314, 0354, 0261, 
+  0056, 0152, 0174, 0363, 0054, 0273, 0254, 0336, 0271, 0226, 0107, 0106, 0261, 0004, 0132, 0101, 
+  0200, 0271, 0240, 0370, 0066, 0066, 0343, 0070, 0350, 0216, 0236, 0245, 0262, 0153, 0010, 0267, 
+  0071, 0236, 0375, 0064, 0357, 0161, 0346, 0062, 0161, 0126, 0234, 0061, 0001, 0027, 0063, 0206, 
+  0241, 0357, 0041, 0276, 0305, 0041, 0346, 0037, 0151, 0036, 0275, 0304, 0361, 0363, 0364, 0376, 
+  0027, 0257, 0216, 0213, 0266, 0210, 0343, 0315, 0171, 0227, 0237, 0347, 0066, 0021, 0053, 0337, 
+  0030, 0273, 0342, 0130, 0324, 0047, 0341, 0144, 0065, 0346, 0176, 0115, 0040, 0354, 0102, 0216, 
+  0304, 0206, 0310, 0044, 0047, 0222, 0033, 0043, 0252, 0207, 0233, 0062, 0035, 0244, 0115, 0006, 
+  0025, 0123, 0241, 0216, 0046, 0202, 0162, 0336, 0303, 0132, 0027, 0162, 0246, 0345, 0272, 0146, 
+  0326, 0142, 0200, 0147, 0132, 0041, 0266, 0026, 0354, 0270, 0334, 0363, 0200, 0144, 0032, 0123, 
+  0355, 0227, 0213, 0016, 0051, 0031, 0201, 0252, 0006, 0140, 0135, 0215, 0077, 0145, 0117, 0175, 
+  0341, 0124, 0245, 0224, 0107, 0076, 0145, 0025, 0164, 0312, 0330, 0240, 0346, 0047, 0116, 0110, 
+  0306, 0064, 0324, 0141, 0337, 0313, 0066, 0125, 0270, 0254, 0267, 0111, 0036, 0202, 0304, 0223, 
+  0234, 0232, 0322, 0074, 0167, 0167, 0111, 0027, 0167, 0151, 0267, 0166, 0171, 0307, 0104, 0141, 
+  0237, 0237, 0242, 0233, 0132, 0321, 0065, 0275, 0172, 0056, 0304, 0021, 0274, 0143, 0205, 0217, 
+  0371, 0034, 0251, 0040, 0065, 0061, 0175, 0002, 0227, 0062, 0340, 0313, 0055, 0370, 0113, 0101, 
+  0251, 0171, 0053, 0136, 0226, 0102, 0003, 0026, 0174, 0172, 0116, 0141, 0305, 0127, 0267, 0342, 
+  0273, 0365, 0360, 0137, 0112, 0201, 0232, 0002, 0203, 0126, 0073, 0071, 0222, 0126, 0214, 0371, 
+  0176, 0317, 0054, 0215, 0266, 0252, 0315, 0276, 0022, 0206, 0207, 0204, 0334, 0305, 0372, 0154, 
+  0142, 0271, 0276, 0351, 0077, 0175, 0125, 0055, 0232, 0224, 0151, 0126, 0127, 0060, 0231, 0143, 
+  0216, 0112, 0157, 0055, 0117, 0330, 0076, 0166, 0017, 0103, 0322, 0073, 0044, 0275, 0257, 0112, 
+  0205, 0360, 0061, 0256, 0023, 0015, 0310, 0156, 0224, 0354, 0237, 0364, 0164, 0227, 0013, 0035, 
+  0223, 0015, 0001, 0314, 0257, 0167, 0320, 0205, 0024, 0165, 0375, 0051, 0352, 0212, 0305, 0013, 
+  0062, 0145, 0103, 0256, 0200, 0201, 0152, 0130, 0240, 0050, 0042, 0063, 0057, 0144, 0060, 0127, 
+  0024, 0045, 0023, 0142, 0040, 0035, 0146, 0173, 0161, 0166, 0023, 0053, 0034, 0271, 0002, 0027, 
+  0277, 0124, 0017, 0227, 0114, 0252, 0031, 0030, 0023, 0342, 0160, 0346, 0017, 0103, 0362, 0240, 
+  0036, 0066, 0346, 0062, 0074, 0231, 0355, 0241, 0175, 0365, 0116, 0075, 0051, 0307, 0276, 0162, 
+  0330, 0045, 0137, 0077, 0363, 0054, 0164, 0345, 0216, 0044, 0307, 0156, 0322, 0224, 0362, 0003, 
+  0004, 0367, 0066, 0140, 0276, 0141, 0225, 0345, 0240, 0362, 0353, 0142, 0036, 0101, 0027, 0020, 
+  0344, 0336, 0124, 0176, 0145, 0311, 0045, 0313, 0120, 0363, 0265, 0312, 0232, 0257, 0255, 0316, 
+  0220, 0111, 0074, 0222, 0151, 0111, 0202, 0162, 0257, 0173, 0126, 0356, 0125, 0207, 0022, 0242, 
+  0326, 0275, 0036, 0025, 0064, 0340, 0204, 0220, 0171, 0101, 0017, 0017, 0017, 0101, 0015, 0355, 
+  0247, 0032, 0022, 0262, 0004, 0112, 0250, 0176, 0112, 0250, 0133, 0167, 0045, 0304, 0127, 0034, 
+  0043, 0023, 0055, 0152, 0350, 0322, 0214, 0150, 0271, 0377, 0340, 0135, 0051, 0042, 0120, 0042, 
+  0245, 0224, 0110, 0054, 0013, 0240, 0106, 0352, 0247, 0106, 0172, 0165, 0127, 0043, 0256, 0117, 
+  0231, 0345, 0171, 0172, 0054, 0252, 0253, 0230, 0030, 0150, 0221, 0106, 0152, 0221, 0104, 0024, 
+  0100, 0215, 0324, 0117, 0215, 0364, 0041, 0343, 0126, 0007, 0152, 0333, 0132, 0035, 0137, 0121, 
+  0073, 0323, 0234, 0220, 0020, 0047, 0345, 0006, 0152, 0351, 0247, 0224, 0055, 0166, 0353, 0372, 
+  0013, 0373, 0107, 0152, 0170, 0046, 0137, 0362, 0167, 0153, 0203, 0010, 0345, 0067, 0222, 0217, 
+  0230, 0041, 0101, 0036, 0305, 0344, 0021, 0361, 0205, 0116, 0151, 0317, 0236, 0242, 0112, 0311, 
+  0047, 0261, 0136, 0264, 0312, 0234, 0176, 0214, 0055, 0152, 0060, 0102, 0074, 0346, 0006, 0145, 
+  0306, 0344, 0271, 0370, 0126, 0344, 0167, 0250, 0315, 0313, 0064, 0164, 0073, 0347, 0143, 0306, 
+  0202, 0327, 0107, 0107, 0043, 0237, 0114, 0260, 0341, 0021, 0162, 0167, 0110, 0302, 0321, 0021, 
+  0070, 0277, 0366, 0103, 0323, 0053, 0065, 0225, 0053, 0143, 0261, 0363, 0322, 0014, 0125, 0225, 
+  0114, 0350, 0102, 0124, 0235, 0316, 0212, 0011, 0067, 0142, 0233, 0251, 0062, 0110, 0271, 0036, 
+  0127, 0021, 0015, 0071, 0351, 0121, 0110, 0070, 0110, 0257, 0165, 0144, 0146, 0133, 0243, 0037, 
+  0005, 0317, 0117, 0232, 0160, 0142, 0135, 0363, 0230, 0302, 0031, 0103, 0037, 0202, 0115, 0227, 
+  0144, 0124, 0015, 0007, 0225, 0067, 0373, 0352, 0313, 0277, 0347, 0107, 0135, 0366, 0072, 0315, 
+  0215, 0207, 0053, 0023, 0335, 0250, 0051, 0302, 0261, 0330, 0304, 0024, 0211, 0164, 0344, 0062, 
+  0174, 0057, 0376, 0311, 0243, 0243, 0057, 0324, 0121, 0333, 0364, 0152, 0234, 0342, 0046, 0205, 
+  0075, 0156, 0012, 0175, 0074, 0056, 0103, 0244, 0134, 0364, 0143, 0156, 0340, 0141, 0277, 0324, 
+  0274, 0056, 0305, 0036, 0112, 0020, 0053, 0122, 0237, 0260, 0100, 0101, 0355, 0175, 0252, 0123, 
+  0176, 0014, 0245, 0220, 0333, 0174, 0253, 0316, 0313, 0306, 0042, 0226, 0336, 0111, 0145, 0145, 
+  0201, 0027, 0134, 0247, 0111, 0110, 0141, 0163, 0213, 0335, 0113, 0134, 0072, 0126, 0026, 0117, 
+  0054, 0373, 0006, 0172, 0275, 0116, 0075, 0000, 0200, 0024, 0003, 0045, 0117, 0032, 0007, 0102, 
+  0100, 0136, 0227, 0041, 0136, 0242, 0174, 0157, 0046, 0002, 0130, 0276, 0344, 0154, 0126, 0122, 
+  0153, 0202, 0375, 0251, 0356, 0335, 0262, 0350, 0106, 0247, 0305, 0327, 0251, 0311, 0347, 0251, 
+  0155, 0333, 0053, 0270, 0365, 0025, 0104, 0025, 0352, 0013, 0357, 0222, 0114, 0206, 0044, 0155, 
+  0214, 0316, 0347, 0273, 0055, 0053, 0120, 0000, 0121, 0057, 0045, 0313, 0263, 0362, 0160, 0122, 
+  0104, 0013, 0361, 0167, 0015, 0217, 0261, 0347, 0135, 0143, 0261, 0114, 0161, 0170, 0203, 0177, 
+  0262, 0244, 0152, 0005, 0377, 0066, 0114, 0276, 0145, 0374, 0333, 0356, 0246, 0333, 0117, 0123, 
+  0344, 0055, 0306, 0102, 0167, 0070, 0145, 0230, 0026, 0171, 0074, 0335, 0340, 0311, 0217, 0047, 
+  0272, 0040, 0344, 0164, 0366, 0103, 0241, 0367, 0036, 0311, 0274, 0270, 0220, 0314, 0356, 0267, 
+  0242, 0350, 0356, 0102, 0121, 0100, 0235, 0365, 0012, 0014, 0220, 0222, 0140, 0361, 0251, 0234, 
+  0052, 0065, 0067, 0373, 0001, 0001, 0057, 0156, 0300, 0213, 0247, 0355, 0307, 0213, 0227, 0146, 
+  0044, 0045, 0165, 0007, 0214, 0161, 0151, 0140, 0000, 0214, 0055, 0005, 0214, 0213, 0066, 0356, 
+  0174, 0262, 0333, 0262, 0376, 0344, 0016, 0066, 0264, 0300, 0303, 0145, 0010, 0056, 0305, 0124, 
+  0255, 0214, 0325, 0315, 0334, 0315, 0160, 0174, 0251, 0210, 0270, 0064, 0341, 0302, 0074, 0057, 
+  0003, 0313, 0173, 0305, 0140, 0271, 0022, 0064, 0327, 0010, 0317, 0345, 0041, 0272, 0004, 0114, 
+  0227, 0121, 0321, 0162, 0152, 0132, 0253, 0252, 0326, 0250, 0256, 0265, 0251, 0154, 0011, 0265, 
+  0055, 0065, 0041, 0345, 0024, 0016, 0137, 0167, 0351, 0050, 0110, 0276, 0026, 0003, 0073, 0160, 
+  0355, 0073, 0034, 0326, 0114, 0343, 0350, 0040, 0127, 0356, 0302, 0260, 0245, 0200, 0247, 0325, 
+  0302, 0301, 0066, 0246, 0311, 0330, 0325, 0064, 0321, 0005, 0273, 0373, 0026, 0175, 0261, 0062, 
+  0027, 0206, 0305, 0356, 0342, 0147, 0073, 0022, 0372, 0144, 0151, 0364, 0063, 0362, 0257, 0137, 
+  0317, 0373, 0312, 0131, 0101, 0355, 0320, 0015, 0042, 0161, 0316, 0302, 0232, 0337, 0002, 0354, 
+  0043, 0013, 0305, 0325, 0215, 0021, 0043, 0210, 0006, 0330, 0166, 0157, 0037, 0105, 0060, 0353, 
+  0323, 0005, 0012, 0162, 0374, 0223, 0323, 0040, 0240, 0232, 0252, 0367, 0052, 0064, 0105, 0065, 
+  0321, 0162, 0252, 0151, 0337, 0265, 0011, 0005, 0155, 0002, 0332, 0104, 0121, 0233, 0364, 0166, 
+  0255, 0115, 0032, 0347, 0030, 0050, 0153, 0312, 0202, 0177, 0170, 0153, 0376, 0341, 0356, 0336, 
+  0337, 0303, 0131, 0367, 0022, 0003, 0120, 0174, 0114, 0123, 0116, 0337, 0212, 0273, 0274, 0176, 
+  0021, 0334, 0055, 0110, 0353, 0251, 0147, 0006, 0347, 0010, 0263, 0050, 0213, 0263, 0265, 0351, 
+  0233, 0363, 0214, 0220, 0352, 0162, 0070, 0123, 0357, 0200, 0104, 0116, 0235, 0211, 0234, 0220, 
+  0203, 0271, 0117, 0005, 0310, 0062, 0312, 0137, 0212, 0333, 0121, 0133, 0236, 0374, 0262, 0234, 
+  0372, 0101, 0046, 0144, 0204, 0175, 0114, 0312, 0054, 0143, 0351, 0262, 0225, 0312, 0141, 0012, 
+  0213, 0316, 0230, 0371, 0275, 0241, 0222, 0221, 0012, 0261, 0222, 0075, 0067, 0257, 0063, 0256, 
+  0371, 0334, 0135, 0274, 0103, 0031, 0062, 0345, 0074, 0101, 0153, 0252, 0230, 0254, 0134, 0315, 
+  0252, 0112, 0257, 0304, 0111, 0277, 0266, 0152, 0046, 0173, 0142, 0121, 0112, 0245, 0163, 0153, 
+  0073, 0135, 0332, 0131, 0334, 0322, 0242, 0102, 0230, 0137, 0156, 0255, 0244, 0020, 0062, 0003, 
+  0243, 0057, 0034, 0247, 0140, 0371, 0245, 0175, 0325, 0021, 0213, 0127, 0212, 0203, 0216, 0330, 
+  0067, 0035, 0001, 0276, 0053, 0165, 0210, 0054, 0075, 0025, 0255, 0361, 0176, 0355, 0316, 0043, 
+  0262, 0245, 0122, 0045, 0062, 0345, 0054, 0064, 0337, 0201, 0247, 0245, 0044, 0112, 0357, 0005, 
+  0324, 0104, 0321, 0131, 0023, 0345, 0355, 0314, 0155, 0123, 0145, 0141, 0224, 0202, 0372, 0240, 
+  0236, 0365, 0124, 0156, 0011, 0237, 0127, 0050, 0245, 0222, 0153, 0352, 0157, 0276, 0250, 0146, 
+  0203, 0173, 0366, 0137, 0206, 0201, 0174, 0043, 0316, 0075, 0247, 0157, 0372, 0374, 0263, 0110, 
+  0211, 0177, 0163, 0212, 0014, 0243, 0230, 0073, 0367, 0143, 0350, 0072, 0111, 0265, 0123, 0041, 
+  0332, 0275, 0046, 0124, 0137, 0131, 0110, 0332, 0227, 0276, 0223, 0143, 0345, 0222, 0240, 0236, 
+  0156, 0107, 0362, 0007, 0056, 0365, 0151, 0103, 0306, 0341, 0143, 0235, 0160, 0111, 0061, 0305, 
+  0162, 0350, 0354, 0155, 0271, 0327, 0161, 0351, 0314, 0367, 0210, 0175, 0003, 0256, 0210, 0121, 
+  0261, 0044, 0220, 0054, 0223, 0044, 0046, 0262, 0253, 0202, 0251, 0036, 0276, 0145, 0206, 0305, 
+  0230, 0145, 0217, 0013, 0342, 0354, 0025, 0305, 0116, 0002, 0031, 0002, 0333, 0164, 0303, 0256, 
+  0310, 0075, 0246, 0167, 0274, 0273, 0040, 0366, 0040, 0366, 0132, 0305, 0276, 0127, 0157, 0261, 
+  0217, 0353, 0107, 0231, 0314, 0145, 0036, 0006, 0331, 0007, 0331, 0327, 0052, 0373, 0375, 0172, 
+  0313, 0376, 0204, 0370, 0104, 0040, 0053, 0020, 0174, 0020, 0174, 0275, 0202, 0177, 0122, 0157, 
+  0301, 0267, 0202, 0300, 0343, 0346, 0237, 0260, 0005, 0101, 0364, 0101, 0364, 0265, 0212, 0176, 
+  0315, 0242, 0055, 0126, 0374, 0212, 0215, 0253, 0326, 0065, 0266, 0074, 0167, 0344, 0167, 0316, 
+  0051, 0263, 0102, 0246, 0026, 0040, 0261, 0376, 0170, 0161, 0256, 0010, 0220, 0020, 0302, 0327, 
+  0073, 0274, 0051, 0344, 0357, 0051, 0145, 0356, 0355, 0143, 0347, 0074, 0164, 0107, 0143, 0245, 
+  0201, 0256, 0344, 0340, 0057, 0353, 0271, 0235, 0257, 0256, 0343, 0226, 0257, 0256, 0176, 0017, 
+  0126, 0127, 0352, 0106, 0332, 0304, 0225, 0266, 0363, 0245, 0265, 0262, 0060, 0026, 0234, 0174, 
+  0315, 0137, 0025, 0335, 0232, 0257, 0212, 0056, 0254, 0212, 0331, 0252, 0170, 0207, 0251, 0051, 
+  0034, 0155, 0155, 0334, 0157, 0322, 0076, 0304, 0346, 0257, 0252, 0136, 0315, 0127, 0325, 0061, 
+  0254, 0252, 0371, 0136, 0023, 0327, 0206, 0107, 0221, 0037, 0257, 0215, 0113, 0153, 0305, 0117, 
+  0331, 0374, 0365, 0325, 0257, 0271, 0245, 0364, 0012, 0326, 0327, 0174, 0175, 0175, 0160, 0177, 
+  0142, 0007, 0105, 0047, 0357, 0155, 0134, 0136, 0213, 0256, 0320, 0346, 0257, 0255, 0335, 0072, 
+  0340, 0002, 0217, 0163, 0162, 0114, 0074, 0076, 0323, 0107, 0100, 0275, 0041, 0324, 0133, 0164, 
+  0157, 0346, 0216, 0163, 0154, 0327, 0146, 0070, 0235, 0066, 0041, 0140, 0247, 0156, 0027, 0225, 
+  0224, 0316, 0167, 0052, 0163, 0253, 0264, 0210, 0256, 0367, 0361, 0203, 0354, 0051, 0301, 0372, 
+  0215, 0364, 0302, 0161, 0020, 0047, 0210, 0156, 0115, 0116, 0021, 0156, 0226, 0156, 0312, 0315, 
+  0322, 0112, 0310, 0005, 0222, 0112, 0341, 0012, 0347, 0272, 0024, 0000, 0020, 0141, 0275, 0317, 
+  0341, 0266, 0076, 0375, 0136, 0230, 0076, 0130, 0211, 0263, 0315, 0055, 0256, 0241, 0312, 0031, 
+  0137, 0210, 0154, 0261, 0022, 0245, 0053, 0125, 0121, 0037, 0260, 0260, 0372, 0072, 0350, 0336, 
+  0362, 0246, 0121, 0114, 0270, 0347, 0154, 0052, 0314, 0132, 0244, 0024, 0052, 0050, 0352, 0255, 
+  0171, 0131, 0056, 0204, 0360, 0211, 0243, 0227, 0004, 0137, 0075, 0375, 0333, 0270, 0043, 0202, 
+  0310, 0136, 0017, 0070, 0076, 0224, 0250, 0163, 0137, 0040, 0311, 0166, 0115, 0216, 0100, 0177, 
+  0115, 0216, 0300, 0172, 0106, 0317, 0163, 0005, 0004, 0166, 0065, 0343, 0102, 0306, 0346, 0155, 
+  0310, 0073, 0337, 0344, 0233, 0005, 0344, 0322, 0011, 0326, 0366, 0106, 0072, 0255, 0040, 0207, 
+  0222, 0122, 0045, 0207, 0142, 0042, 0121, 0140, 0143, 0357, 0165, 0333, 0122, 0163, 0135, 0151, 
+  0367, 0327, 0203, 0004, 0344, 0147, 0045, 0173, 0146, 0256, 0055, 0307, 0045, 0151, 0033, 0222, 
+  0116, 0207, 0201, 0373, 0023, 0173, 0146, 0050, 0176, 0121, 0254, 0135, 0272, 0176, 0323, 0035, 
+  0114, 0207, 0146, 0104, 0037, 0321, 0011, 0041, 0154, 0314, 0107, 0213, 0176, 0371, 0174, 0371, 
+  0216, 0376, 0132, 0266, 0372, 0143, 0263, 0112, 0071, 0153, 0051, 0170, 0051, 0015, 0216, 0052, 
+  0160, 0167, 0157, 0042, 0351, 0204, 0326, 0203, 0341, 0372, 0216, 0210, 0352, 0041, 0241, 0036, 
+  0232, 0042, 0055, 0062, 0210, 0135, 0340, 0366, 0070, 0044, 0023, 0034, 0013, 0252, 0154, 0301, 
+  0117, 0250, 0225, 0332, 0222, 0242, 0360, 0153, 0041, 0132, 0277, 0025, 0227, 0120, 0224, 0274, 
+  0053, 0342, 0035, 0137, 0201, 0174, 0256, 0056, 0102, 0154, 0055, 0251, 0167, 0152, 0115, 0002, 
+  0211, 0162, 0315, 0232, 0371, 0124, 0005, 0257, 0240, 0266, 0262, 0236, 0322, 0276, 0245, 0134, 
+  0104, 0325, 0253, 0213, 0352, 0113, 0053, 0313, 0207, 0130, 0153, 0012, 0173, 0223, 0144, 0332, 
+  0166, 0356, 0113, 0022, 0220, 0275, 0373, 0012, 0040, 0173, 0175, 0041, 0373, 0020, 0123, 0146, 
+  0322, 0261, 0025, 0140, 0132, 0021, 0152, 0177, 0313, 0337, 0200, 0222, 0127, 0000, 0116, 0007, 
+  0234, 0016, 0070, 0035, 0160, 0272, 0046, 0234, 0016, 0060, 0075, 0013, 0246, 0247, 0125, 0072, 
+  0040, 0165, 0100, 0352, 0200, 0324, 0267, 0210, 0324, 0217, 0233, 0214, 0324, 0301, 0271, 0136, 
+  0143, 0244, 0276, 0214, 0206, 0264, 0003, 0165, 0363, 0313, 0354, 0015, 0200, 0323, 0001, 0247, 
+  0003, 0240, 0336, 0077, 0100, 0335, 0003, 0100, 0235, 0001, 0250, 0123, 0232, 0027, 0360, 0064, 
+  0340, 0151, 0300, 0323, 0371, 0170, 0372, 0030, 0360, 0064, 0371, 0331, 0073, 0006, 0074, 0135, 
+  0163, 0317, 0267, 0115, 0174, 0216, 0204, 0371, 0207, 0012, 0175, 0337, 0066, 0061, 0343, 0227, 
+  0000, 0252, 0006, 0124, 0015, 0336, 0157, 0000, 0353, 0232, 0300, 0372, 0011, 0200, 0365, 0165, 
+  0336, 0357, 0231, 0132, 0007, 0274, 0016, 0170, 0035, 0360, 0372, 0026, 0361, 0172, 0275, 0043, 
+  0125, 0362, 0323, 0306, 0341, 0255, 0173, 0377, 0326, 0374, 0245, 0327, 0324, 0373, 0243, 0124, 
+  0263, 0210, 0366, 0361, 0362, 0247, 0162, 0311, 0260, 0275, 0232, 0326, 0145, 0350, 0101, 0135, 
+  0206, 0206, 0325, 0145, 0160, 0060, 0263, 0134, 0217, 0232, 0032, 0157, 0370, 0176, 0147, 0306, 
+  0064, 0241, 0050, 0003, 0024, 0145, 0200, 0134, 0337, 0126, 0357, 0103, 0375, 0072, 0337, 0101, 
+  0330, 0253, 0315, 0035, 0204, 0375, 0023, 0270, 0203, 0120, 0347, 0035, 0204, 0342, 0032, 0002, 
+  0272, 0235, 0353, 0007, 0173, 0315, 0273, 0176, 0320, 0365, 0031, 0016, 0157, 0105, 0011, 0076, 
+  0270, 0202, 0060, 0357, 0174, 0110, 0371, 0012, 0302, 0234, 0243, 0271, 0076, 0124, 0210, 0051, 
+  0015, 0123, 0127, 0264, 0350, 0051, 0124, 0210, 0231, 0251, 0300, 0057, 0330, 0237, 0122, 0304, 
+  0167, 0177, 0164, 0103, 0210, 0067, 0264, 0102, 0012, 0245, 0142, 0240, 0124, 0114, 0216, 0152, 
+  0032, 0213, 0050, 0334, 0372, 0127, 0273, 0316, 0167, 0241, 0345, 0353, 0212, 0347, 0115, 0256, 
+  0315, 0022, 0057, 0373, 0363, 0104, 0116, 0012, 0135, 0112, 0237, 0357, 0316, 0057, 0346, 0312, 
+  0327, 0162, 0224, 0242, 0341, 0330, 0265, 0364, 0161, 0153, 0001, 0367, 0177, 0256, 0263, 0126, 
+  0105, 0022, 0027, 0161, 0300, 0111, 0223, 0305, 0260, 0124, 0130, 0116, 0371, 0220, 0034, 0325, 
+  0040, 0251, 0313, 0061, 0266, 0027, 0174, 0134, 0023, 0276, 0127, 0232, 0256, 0115, 0174, 0152, 
+  0062, 0062, 0032, 0025, 0072, 0260, 0225, 0050, 0033, 0063, 0046, 0017, 0050, 0046, 0217, 0134, 
+  0037, 0211, 0227, 0321, 0062, 0307, 0135, 0125, 0104, 0150, 0225, 0045, 0245, 0041, 0374, 0106, 
+  0133, 0350, 0215, 0346, 0260, 0233, 0145, 0162, 0226, 0315, 0370, 0110, 0313, 0323, 0051, 0027, 
+  0272, 0123, 0375, 0371, 0254, 0362, 0031, 0271, 0246, 0230, 0032, 0055, 0361, 0064, 0165, 0210, 
+  0311, 0314, 0126, 0067, 0226, 0155, 0143, 0257, 0012, 0165, 0143, 0276, 0167, 0334, 0350, 0377, 
+  0110, 0323, 0040, 0072, 0046, 0041, 0263, 0247, 0014, 0335, 0341, 0107, 0120, 0073, 0315, 0125, 
+  0073, 0240, 0056, 0124, 0325, 0105, 0257, 0241, 0041, 0334, 0343, 0126, 0245, 0104, 0052, 0124, 
+  0200, 0054, 0316, 0305, 0202, 0066, 0337, 0213, 0126, 0104, 0054, 0026, 0336, 0011, 0022, 0307, 
+  0017, 0112, 0316, 0156, 0121, 0364, 0044, 0175, 0135, 0303, 0060, 0346, 0331, 0075, 0063, 0066, 
+  0026, 0276, 0351, 0262, 0344, 0126, 0056, 0235, 0141, 0061, 0047, 0314, 0350, 0310, 0334, 0244, 
+  0330, 0343, 0202, 0002, 0361, 0314, 0133, 0300, 0137, 0022, 0112, 0265, 0260, 0142, 0055, 0253, 
+  0026, 0056, 0311, 0144, 0110, 0146, 0132, 0066, 0113, 0064, 0332, 0250, 0046, 0046, 0304, 0021, 
+  0056, 0243, 0305, 0341, 0172, 0056, 0145, 0224, 0303, 0211, 0255, 0207, 0115, 0137, 0142, 0317, 
+  0213, 0153, 0230, 0343, 0360, 0006, 0377, 0114, 0102, 0313, 0071, 0042, 0366, 0302, 0344, 0133, 
+  0306, 0277, 0355, 0167, 0216, 0012, 0277, 0242, 0230, 0343, 0072, 0307, 0215, 0055, 0136, 0032, 
+  0311, 0367, 0354, 0207, 0342, 0101, 0321, 0262, 0035, 0330, 0227, 0300, 0150, 0315, 0312, 0147, 
+  0017, 0042, 0243, 0353, 0013, 0245, 0117, 0166, 0001, 0245, 0367, 0311, 0167, 0335, 0335, 0226, 
+  0357, 0272, 0315, 0247, 0153, 0020, 0044, 0254, 0005, 0307, 0155, 0365, 0306, 0234, 0336, 0113, 
+  0010, 0210, 0320, 0036, 0020, 0161, 0332, 0203, 0200, 0210, 0171, 0056, 0164, 0144, 0004, 0103, 
+  0024, 0004, 0104, 0101, 0024, 0162, 0274, 0235, 0354, 0103, 0024, 0304, 0151, 0037, 0242, 0040, 
+  0040, 0012, 0142, 0027, 0121, 0020, 0053, 0207, 0142, 0261, 0217, 0122, 0346, 0024, 0136, 0362, 
+  0004, 0076, 0076, 0200, 0047, 0076, 0032, 0026, 0337, 0010, 0266, 0261, 0004, 0312, 0220, 0051, 
+  0171, 0376, 0265, 0232, 0110, 0113, 0074, 0346, 0006, 0106, 0344, 0006, 0311, 0142, 0344, 0237, 
+  0143, 0314, 0306, 0070, 0174, 0142, 0041, 0232, 0130, 0217, 0310, 0161, 0151, 0340, 0361, 0277, 
+  0226, 0037, 0261, 0130, 0204, 0070, 0210, 0273, 0272, 0204, 0024, 0042, 0106, 0020, 0177, 0076, 
+  0171, 0034, 0011, 0262, 0252, 0135, 0123, 0072, 0226, 0323, 0350, 0271, 0326, 0021, 0005, 0240, 
+  0357, 0110, 0017, 0114, 0342, 0175, 0062, 0211, 0041, 0155, 0166, 0133, 0026, 0161, 0235, 0356, 
+  0220, 0355, 0202, 0101, 0254, 0337, 0040, 0006, 0173, 0170, 0236, 0043, 0345, 0172, 0030, 0135, 
+  0216, 0011, 0241, 0305, 0016, 0134, 0301, 0050, 0006, 0243, 0170, 0037, 0154, 0342, 0356, 0011, 
+  0330, 0304, 0140, 0023, 0357, 0074, 0063, 0240, 0017, 0211, 0001, 0273, 0117, 0014, 0340, 0322, 
+  0207, 0355, 0170, 0213, 0064, 0307, 0256, 0343, 0140, 0337, 0164, 0031, 0236, 0124, 0227, 0046, 
+  0020, 0277, 0004, 0105, 0057, 0201, 0140, 0335, 0152, 0274, 0002, 0232, 0075, 0003, 0272, 0274, 
+  0003, 0172, 0075, 0004, 0373, 0036, 0251, 0320, 0364, 0034, 0201, 0264, 0346, 0241, 0356, 0077, 
+  0330, 0214, 0257, 0077, 0257, 0114, 0361, 0210, 0167, 0240, 0370, 0035, 0240, 0167, 0032, 0253, 
+  0167, 0100, 0137, 0250, 0352, 0213, 0156, 0213, 0364, 0205, 0250, 0104, 0123, 0265, 0276, 0020, 
+  0357, 0000, 0175, 0001, 0372, 0002, 0222, 0212, 0132, 0200, 0057, 0110, 0310, 0114, 0307, 0345, 
+  0162, 0317, 0204, 0341, 0106, 0315, 0133, 0067, 0244, 0254, 0022, 0325, 0301, 0337, 0204, 0122, 
+  0157, 0102, 0321, 0233, 0100, 0201, 0200, 0002, 0331, 0073, 0005, 0322, 0207, 0120, 0152, 0070, 
+  0067, 0256, 0375, 0151, 0004, 0034, 0034, 0153, 0201, 0003, 0333, 0015, 0245, 0076, 0205, 0223, 
+  0143, 0355, 0047, 0307, 0375, 0227, 0160, 0164, 0074, 0203, 0161, 0337, 0103, 0174, 0357, 0342, 
+  0007, 0070, 0065, 0206, 0123, 0343, 0042, 0247, 0306, 0275, 0275, 0050, 0050, 0367, 0012, 0216, 
+  0215, 0341, 0330, 0170, 0367, 0005, 0345, 0236, 0357, 0357, 0271, 0261, 0242, 0157, 0104, 0124, 
+  0112, 0175, 0153, 0205, 0363, 0332, 0114, 0103, 0376, 0117, 0123, 0253, 0256, 0224, 0250, 0213, 
+  0040, 0370, 0160, 0305, 0360, 0044, 0146, 0104, 0024, 0036, 0046, 0276, 0332, 0257, 0232, 0051, 
+  0246, 0030, 0167, 0035, 0052, 0244, 0244, 0213, 0312, 0323, 0351, 0160, 0122, 0174, 0046, 0326, 
+  0315, 0355, 0322, 0274, 0232, 0122, 0044, 0253, 0270, 0110, 0116, 0266, 0214, 0104, 0306, 0320, 
+  0276, 0130, 0014, 0137, 0115, 0254, 0021, 0136, 0024, 0336, 0270, 0240, 0043, 0377, 0327, 0354, 
+  0166, 0144, 0250, 0113, 0111, 0312, 0327, 0142, 0010, 0270, 0362, 0305, 0122, 0345, 0004, 0125, 
+  0044, 0335, 0353, 0110, 0273, 0142, 0052, 0073, 0347, 0321, 0364, 0215, 0330, 0235, 0351, 0253, 
+  0262, 0130, 0356, 0216, 0302, 0302, 0356, 0367, 0355, 0312, 0156, 0257, 0072, 0331, 0375, 0026, 
+  0140, 0037, 0204, 0267, 0132, 0341, 0045, 0312, 0074, 0156, 0205, 0364, 0366, 0253, 0223, 0336, 
+  0201, 0165, 0217, 0101, 0172, 0253, 0225, 0136, 0252, 0314, 0343, 0046, 0110, 0057, 0207, 0104, 
+  0003, 0034, 0130, 0241, 0070, 0265, 0132, 0024, 0140, 0372, 0364, 0165, 0131, 0344, 0120, 0143, 
+  0301, 0152, 0205, 0176, 0071, 0251, 0116, 0277, 0174, 0017, 0135, 0237, 0201, 0202, 0251, 0126, 
+  0301, 0004, 0352, 0114, 0156, 0211, 0206, 0351, 0201, 0206, 0251, 0265, 0206, 0071, 0255, 0116, 
+  0303, 0374, 0317, 0324, 0005, 0005, 0123, 0261, 0202, 0371, 0267, 0062, 0217, 0053, 0227, 0136, 
+  0271, 0027, 0124, 0122, 0051, 0162, 0053, 0245, 0126, 0027, 0127, 0026, 0166, 0134, 0266, 0137, 
+  0336, 0104, 0121, 0212, 0277, 0315, 0316, 0104, 0061, 0243, 0335, 0066, 0073, 0022, 0355, 0051, 
+  0253, 0154, 0023, 0260, 0247, 0346, 0015, 0354, 0001, 0325, 0356, 0001, 0174, 0376, 0366, 0016, 
+  0300, 0330, 0044, 0170, 0254, 0016, 0271, 0134, 0162, 0352, 0040, 0265, 0025, 0113, 0255, 0062, 
+  0217, 0033, 0054, 0266, 0201, 0105, 0031, 0256, 0320, 0246, 0027, 0344, 0101, 0160, 0053, 0266, 
+  0351, 0325, 0231, 0014, 0230, 0133, 0232, 0040, 0344, 0355, 0356, 0074, 0257, 0346, 0102, 0304, 
+  0130, 0162, 0361, 0147, 0213, 0227, 0111, 0044, 0241, 0227, 0373, 0027, 0103, 0222, 0134, 0071, 
+  0263, 0310, 0215, 0344, 0157, 0033, 0115, 0277, 0144, 0150, 0106, 0164, 0235, 0106, 0347, 0174, 
+  0110, 0330, 0330, 0030, 0223, 0320, 0375, 0147, 0333, 0027, 0152, 0010, 0306, 0257, 0226, 0323, 
+  0354, 0225, 0060, 0313, 0112, 0357, 0161, 0225, 0330, 0171, 0313, 0033, 0020, 0065, 0334, 0111, 
+  0100, 0102, 0146, 0361, 0045, 0250, 0255, 0247, 0353, 0141, 0204, 0142, 0314, 0307, 0112, 0267, 
+  0155, 0342, 0033, 0342, 0143, 0347, 0334, 0341, 0034, 0021, 0012, 0304, 0120, 0212, 0165, 0220, 
+  0335, 0065, 0345, 0156, 0007, 0321, 0272, 0165, 0254, 0043, 0070, 0046, 0023, 0062, 0302, 0076, 
+  0046, 0052, 0251, 0167, 0122, 0073, 0201, 0022, 0160, 0250, 0146, 0141, 0236, 0264, 0176, 0141, 
+  0146, 0110, 0270, 0132, 0100, 0004, 0210, 0170, 0323, 0104, 0134, 0204, 0016, 0044, 0167, 0316, 
+  0355, 0243, 0230, 0253, 0105, 0116, 0200, 0230, 0127, 0056, 0346, 0021, 0110, 0053, 0334, 0223, 
+  0110, 0276, 0237, 0354, 0223, 0220, 0133, 0272, 0341, 0243, 0361, 0204, 0144, 0217, 0212, 0166, 
+  0257, 0360, 0053, 0301, 0210, 0054, 0153, 0362, 0354, 0270, 0226, 0113, 0365, 0011, 0061, 0145, 
+  0022, 0064, 0344, 0131, 0014, 0211, 0325, 0345, 0371, 0010, 0171, 0325, 0145, 0363, 0252, 0373, 
+  0272, 0363, 0252, 0327, 0361, 0146, 0075, 0137, 0224, 0072, 0267, 0246, 0143, 0231, 0235, 0132, 
+  0070, 0235, 0345, 0306, 0346, 0012, 0146, 0312, 0117, 0076, 0074, 0071, 0356, 0344, 0167, 0274, 
+  0060, 0240, 0052, 0003, 0234, 0126, 0044, 0350, 0236, 0103, 0042, 0336, 0360, 0343, 0273, 0337, 
+  0315, 0357, 0337, 0256, 0276, 0336, 0274, 0277, 0066, 0277, 0174, 0273, 0271, 0372, 0366, 0325, 
+  0374, 0162, 0061, 0370, 0035, 0375, 0007, 0145, 0374, 0362, 0211, 0377, 0227, 0376, 0371, 0355, 
+  0217, 0233, 0033, 0376, 0365, 0367, 0353, 0367, 0203, 0101, 0306, 0367, 0327, 0357, 0077, 0277, 
+  0277, 0030, 0274, 0217, 0176, 0221, 0351, 0333, 0172, 0063, 0377, 0112, 0334, 0102, 0174, 0153, 
+  0331, 0170, 0323, 0014, 0157, 0105, 0220, 0062, 0134, 0116, 0326, 0320, 0050, 0344, 0166, 0055, 
+  0056, 0203, 0131, 0143, 0311, 0036, 0207, 0312, 0336, 0044, 0257, 0027, 0244, 0365, 0146, 0306, 
+  0120, 0227, 0206, 0271, 0070, 0304, 0205, 0037, 0317, 0104, 0265, 0116, 0016, 0343, 0343, 0313, 
+  0242, 0147, 0351, 0343, 0213, 0137, 0243, 0020, 0323, 0200, 0370, 0224, 0367, 0306, 0020, 0227, 
+  0262, 0217, 0261, 0027, 0044, 0066, 0316, 0331, 0321, 0302, 0223, 0371, 0355, 0137, 0164, 0316, 
+  0155, 0217, 0120, 0274, 0251, 0375, 0322, 0227, 0121, 0257, 0346, 0143, 0070, 0073, 0162, 0237, 
+  0044, 0364, 0374, 0340, 0377, 0001, 0341, 0130, 0377, 0355, 0000, 0050, 0165, 0165, 0141, 0171, 
+  0051, 0144, 0141, 0164, 0141, 0057, 0000, 0000, 0003, 0000, 0000, 0000, 0155, 0141, 0164, 0145, 
+  0057, 0000, 0000, 0000, 0006, 0000, 0000, 0000, 0155, 0143, 0143, 0057, 0001, 0000, 0000, 0000
+} };
+
+static GStaticResource static_resource = { appearance_resource_data.data, sizeof (appearance_resource_data.data) - 1 /* nul terminator */, NULL, NULL, NULL };
+
+G_MODULE_EXPORT
+GResource *appearance_get_resource (void);
+GResource *appearance_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(appearanceresource_constructor)
+#endif
+G_DEFINE_CONSTRUCTOR(appearanceresource_constructor)
+#ifdef G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA
+#pragma G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(appearanceresource_destructor)
+#endif
+G_DEFINE_DESTRUCTOR(appearanceresource_destructor)
+
+#else
+#warning "Constructor not supported on this compiler, linking in resources will not work"
+#endif
+
+static void appearanceresource_constructor (void)
+{
+  g_static_resource_init (&static_resource);
+}
+
+static void appearanceresource_destructor (void)
+{
+  g_static_resource_fini (&static_resource);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/22.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/22.html new file mode 100644 index 00000000..1b3a9472 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/22.html @@ -0,0 +1,433 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/*
+ *  Authors: Rodney Dawes <dobey@ximian.com>
+ *
+ *  Copyright 2003-2006 Novell, Inc. (www.novell.com)
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of version 2 of the GNU General Public License
+ *  as published by the Free Software Foundation
+ *
+ *  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., 59 Temple Street #330, 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 <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 <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "mate-wp-info.h"
+
+MateWPInfo* mate_wp_info_new(const char* uri, MateDesktopThumbnailFactory* thumbs)
+{
+	MateWPInfo* wp;
+
+	GFile* file = g_file_new_for_commandline_arg(uri);
+
+	GFileInfo* info = g_file_query_info(file,
+		G_FILE_ATTRIBUTE_STANDARD_NAME ","
+		G_FILE_ATTRIBUTE_STANDARD_SIZE ","<--- There is an unknown macro here somewhere. Configuration is required. If G_FILE_ATTRIBUTE_STANDARD_SIZE is a macro then please configure it.
+		G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE ","
+		G_FILE_ATTRIBUTE_TIME_MODIFIED,
+		G_FILE_QUERY_INFO_NONE,
+		NULL, NULL);
+
+	g_object_unref(file);
+
+	if (info == NULL || g_file_info_get_content_type (info) == NULL)
+	{
+		if (!strcmp (uri, "(none)"))
+		{
+		  wp = g_new0(MateWPInfo, 1);
+
+		  wp->mime_type = g_strdup("image/x-no-data");
+		  wp->uri = g_strdup(uri);
+		  wp->name = g_strdup(_("No Desktop Background"));
+		  wp->size = 0;
+		}
+		else
+		{
+			wp = NULL;
+		}
+	}
+	else
+	{
+		wp = g_new0 (MateWPInfo, 1);
+
+		wp->uri = g_strdup(uri);
+
+		wp->name = g_strdup(g_file_info_get_name(info));
+
+		if (g_file_info_get_content_type(info) != NULL)
+		{
+			wp->mime_type = g_strdup(g_file_info_get_content_type(info));
+		}
+
+		wp->size = g_file_info_get_size(info);
+		wp->mtime = g_file_info_get_attribute_uint64(info, G_FILE_ATTRIBUTE_TIME_MODIFIED);
+
+		wp->thumburi = mate_desktop_thumbnail_factory_lookup(thumbs, uri, wp->mtime);
+	}
+
+	if (info != NULL)
+	{
+		g_object_unref(info);
+	}
+
+	return wp;
+}
+
+void mate_wp_info_free(MateWPInfo* info)
+{
+	if (info == NULL)
+	{
+		return;
+	}
+
+	g_free(info->uri);
+	g_free(info->thumburi);
+	g_free(info->name);
+	g_free(info->mime_type);
+	g_free(info);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/23.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/23.html new file mode 100644 index 00000000..753ead19 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/23.html @@ -0,0 +1,935 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ *  Authors: Rodney Dawes <dobey@ximian.com>
+ *
+ *  Copyright 2003-2006 Novell, Inc. (www.novell.com)
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of version 2 of the GNU General Public License
+ *  as published by the Free Software Foundation
+ *
+ *  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., 59 Temple Street #330, 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 <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 <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "appearance.h"
+#include "mate-wp-item.h"
+
+const gchar *wp_item_option_to_string (MateBGPlacement type)
+{
+  switch (type)
+  {
+    case MATE_BG_PLACEMENT_CENTERED:
+      return "centered";
+      break;
+    case MATE_BG_PLACEMENT_FILL_SCREEN:
+      return "stretched";
+      break;
+    case MATE_BG_PLACEMENT_SCALED:
+      return "scaled";
+      break;
+    case MATE_BG_PLACEMENT_ZOOMED:
+      return "zoom";
+      break;
+    case MATE_BG_PLACEMENT_TILED:
+      return "wallpaper";
+      break;
+    case MATE_BG_PLACEMENT_SPANNED:
+      return "spanned";
+      break;
+  }
+  return "";
+}
+
+const gchar *wp_item_shading_to_string (MateBGColorType type)
+{
+  switch (type) {
+    case MATE_BG_COLOR_SOLID:
+      return "solid";
+      break;
+    case MATE_BG_COLOR_H_GRADIENT:
+      return "horizontal-gradient";
+      break;
+    case MATE_BG_COLOR_V_GRADIENT:
+      return "vertical-gradient";
+      break;
+  }
+  return "";
+}
+
+MateBGPlacement wp_item_string_to_option (const gchar *option)
+{
+  if (!g_strcmp0(option, "centered"))
+    return MATE_BG_PLACEMENT_CENTERED;
+  else if (!g_strcmp0(option, "stretched"))
+    return MATE_BG_PLACEMENT_FILL_SCREEN;
+  else if (!g_strcmp0(option, "scaled"))
+    return MATE_BG_PLACEMENT_SCALED;
+  else if (!g_strcmp0(option, "zoom"))
+    return MATE_BG_PLACEMENT_ZOOMED;
+  else if (!g_strcmp0(option, "wallpaper"))
+    return MATE_BG_PLACEMENT_TILED;
+  else if (!g_strcmp0(option, "spanned"))
+    return MATE_BG_PLACEMENT_SPANNED;
+  else
+    return MATE_BG_PLACEMENT_SCALED;
+}
+
+MateBGColorType wp_item_string_to_shading (const gchar *shade_type)
+{
+  if (!g_strcmp0(shade_type, "solid"))
+    return MATE_BG_COLOR_SOLID;
+  else if (!g_strcmp0(shade_type, "horizontal-gradient"))
+    return MATE_BG_COLOR_H_GRADIENT;
+  else if (!g_strcmp0(shade_type, "vertical-gradient"))
+    return MATE_BG_COLOR_V_GRADIENT;
+  else
+    return MATE_BG_COLOR_SOLID;
+}
+
+static void set_bg_properties (MateWPItem *item)
+{
+  if (item->filename)
+    mate_bg_set_filename (item->bg, item->filename);
+
+  mate_bg_set_color (item->bg, item->shade_type, item->pcolor, item->scolor);
+  mate_bg_set_placement (item->bg, item->options);
+}
+
+void mate_wp_item_ensure_mate_bg (MateWPItem *item)
+{
+  if (!item->bg) {
+    item->bg = mate_bg_new ();
+
+    set_bg_properties (item);
+  }
+}
+
+void mate_wp_item_update (MateWPItem *item) {
+  GSettings *settings;
+  GdkRGBA color1 = { 0, 0, 0, 1.0 }, color2 = { 0, 0, 0, 1.0 };
+  gchar *s;
+
+  settings = g_settings_new (WP_SCHEMA);
+
+  item->options = g_settings_get_enum (settings, WP_OPTIONS_KEY);
+
+  item->shade_type = g_settings_get_enum (settings, WP_SHADING_KEY);
+
+  s = g_settings_get_string (settings, WP_PCOLOR_KEY);
+  if (s != NULL) {
+    gdk_rgba_parse (&color1, s);
+    g_free (s);
+  }
+
+  s = g_settings_get_string (settings, WP_SCOLOR_KEY);
+  if (s != NULL) {
+    gdk_rgba_parse (&color2, s);
+    g_free (s);
+  }
+
+  g_object_unref (settings);
+
+  if (item->pcolor != NULL)
+    gdk_rgba_free (item->pcolor);
+
+  if (item->scolor != NULL)
+    gdk_rgba_free (item->scolor);
+
+  item->pcolor = gdk_rgba_copy (&color1);
+  item->scolor = gdk_rgba_copy (&color2);
+}
+
+MateWPItem * mate_wp_item_new (const gchar * filename,
+				 GHashTable * wallpapers,
+				 MateDesktopThumbnailFactory * thumbnails) {
+  MateWPItem *item = g_new0 (MateWPItem, 1);
+
+  item->filename = g_strdup (filename);
+  item->fileinfo = mate_wp_info_new (filename, thumbnails);
+
+  if (item->fileinfo != NULL && item->fileinfo->mime_type != NULL &&
+      (g_str_has_prefix (item->fileinfo->mime_type, "image/") ||
+       strcmp (item->fileinfo->mime_type, "application/xml") == 0)) {
+
+    if (g_utf8_validate (item->fileinfo->name, -1, NULL))
+      item->name = g_strdup (item->fileinfo->name);
+    else
+      item->name = g_filename_to_utf8 (item->fileinfo->name, -1, NULL,
+				       NULL, NULL);
+
+    mate_wp_item_update (item);
+    mate_wp_item_ensure_mate_bg (item);
+    mate_wp_item_update_description (item);
+
+    g_hash_table_insert (wallpapers, item->filename, item);
+  } else {
+    mate_wp_item_free (item);
+    item = NULL;
+  }
+
+  return item;
+}
+
+void mate_wp_item_free (MateWPItem * item) {
+  if (item == NULL) {
+    return;
+  }
+
+  g_free (item->name);
+  g_free (item->filename);
+  g_free (item->description);
+  g_free (item->artist);
+
+  if (item->pcolor != NULL)
+    gdk_rgba_free (item->pcolor);
+
+  if (item->scolor != NULL)
+    gdk_rgba_free (item->scolor);
+
+  mate_wp_info_free (item->fileinfo);
+  if (item->bg)
+    g_object_unref (item->bg);
+
+  gtk_tree_row_reference_free (item->rowref);
+
+  g_free (item);
+}
+
+static GdkPixbuf *
+add_slideshow_frame (GdkPixbuf *pixbuf)
+{
+  GdkPixbuf *sheet, *sheet2;
+  GdkPixbuf *tmp;
+  gint w, h;
+
+  w = gdk_pixbuf_get_width (pixbuf);
+  h = gdk_pixbuf_get_height (pixbuf);
+
+  sheet = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, w, h);
+  gdk_pixbuf_fill (sheet, 0x00000000);
+  sheet2 = gdk_pixbuf_new_subpixbuf (sheet, 1, 1, w - 2, h - 2);
+  gdk_pixbuf_fill (sheet2, 0xffffffff);
+  g_object_unref (sheet2);
+
+  tmp = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, w + 6, h + 6);
+
+  gdk_pixbuf_fill (tmp, 0x00000000);
+  gdk_pixbuf_composite (sheet, tmp, 6, 6, w, h, 6.0, 6.0, 1.0, 1.0, GDK_INTERP_NEAREST, 255);
+  gdk_pixbuf_composite (sheet, tmp, 3, 3, w, h, 3.0, 3.0, 1.0, 1.0, GDK_INTERP_NEAREST, 255);
+  gdk_pixbuf_composite (pixbuf, tmp, 0, 0, w, h, 0.0, 0.0, 1.0, 1.0, GDK_INTERP_NEAREST, 255);
+
+  g_object_unref (sheet);
+
+  return tmp;
+}
+
+GdkPixbuf * mate_wp_item_get_frame_thumbnail (MateWPItem * item,
+					       MateDesktopThumbnailFactory * thumbs,
+                                               int width,
+                                               int height,
+                                               gint frame) {
+  GdkPixbuf *pixbuf = NULL;
+
+  set_bg_properties (item);
+
+  if (frame != -1)
+    pixbuf = mate_bg_create_frame_thumbnail (item->bg, thumbs, gdk_screen_get_default (), width, height, frame);
+  else
+    pixbuf = mate_bg_create_thumbnail (item->bg, thumbs, gdk_screen_get_default(), width, height);
+
+  if (pixbuf && mate_bg_changes_with_time (item->bg))
+    {
+      GdkPixbuf *tmp;
+
+      tmp = add_slideshow_frame (pixbuf);
+      g_object_unref (pixbuf);
+      pixbuf = tmp;
+    }
+
+  mate_bg_get_image_size (item->bg, thumbs, width, height, &item->width, &item->height);
+
+  return pixbuf;
+}
+
+GdkPixbuf * mate_wp_item_get_thumbnail (MateWPItem * item,
+					 MateDesktopThumbnailFactory * thumbs,
+                                         gint width,
+                                         gint height) {
+  return mate_wp_item_get_frame_thumbnail (item, thumbs, width, height, -1);
+}
+
+void mate_wp_item_update_description (MateWPItem * item) {
+  g_free (item->description);
+
+  if (!strcmp (item->filename, "(none)")) {
+    item->description = g_strdup (item->name);
+  } else {
+    gchar *description;
+    gchar *size;
+    gchar *dirname = g_path_get_dirname (item->filename);
+    gchar *artist;
+
+    description = NULL;
+    size = NULL;
+
+    if (!item->artist || item->artist[0] == 0 || !g_strcmp0(item->artist, "(none)"))
+      artist = g_strdup (_("unknown"));
+    else
+      artist = g_strdup (item->artist);
+
+    if (strcmp (item->fileinfo->mime_type, "application/xml") == 0)
+      {
+        if (mate_bg_changes_with_time (item->bg))
+          description = g_strdup (_("Slide Show"));
+        else if (item->width > 0 && item->height > 0)
+          description = g_strdup (_("Image"));
+      }
+    else
+      description = g_content_type_get_description (item->fileinfo->mime_type);
+
+    if (mate_bg_has_multiple_sizes (item->bg))
+      size = g_strdup (_("multiple sizes"));
+    else if (item->width > 0 && item->height > 0) {
+      /* translators: x pixel(s) by y pixel(s) */
+      size = g_strdup_printf (_("%d %s by %d %s"),
+                              item->width,
+                              ngettext ("pixel", "pixels", item->width),
+                              item->height,
+                              ngettext ("pixel", "pixels", item->height));
+    }
+
+    if (description && size) {
+      /* translators: <b>wallpaper name</b>
+       * mime type, size
+       * Folder: /path/to/file
+       * Artist: wallpaper author
+       */
+      item->description = g_markup_printf_escaped (_("<b>%s</b>\n"
+                                                     "%s, %s\n"
+                                                     "Folder: %s\n"
+                                                     "Artist: %s"),
+                                                   item->name,
+                                                   description,
+                                                   size,
+                                                   dirname,
+                                                   artist);
+    } else {
+      /* translators: <b>wallpaper name</b>
+       * Image missing
+       * Folder: /path/to/file
+       * Artist: wallpaper author
+       */
+      item->description = g_markup_printf_escaped (_("<b>%s</b>\n"
+                                                     "%s\n"
+                                                     "Folder: %s\n"
+                                                     "Artist: %s"),
+                                                   item->name,
+                                                   _("Image missing"),
+                                                   dirname,
+                                                   artist);
+    }
+
+    g_free (size);
+    g_free (dirname);
+    g_free (artist);
+    g_free (description);
+  }
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/24.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/24.html new file mode 100644 index 00000000..80683d8b --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/24.html @@ -0,0 +1,1363 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ *  Authors: Rodney Dawes <dobey@ximian.com>
+ *
+ *  Copyright 2003-2006 Novell, Inc. (www.novell.com)
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of version 2 of the GNU General Public License
+ *  as published by the Free Software Foundation
+ *
+ *  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., 59 Temple Street #330, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "appearance.h"
+#include "mate-wp-xml.h"
+#include "mate-wp-item.h"
+#include <gio/gio.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/parser.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <errno.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+static gboolean mate_wp_xml_get_bool(const xmlNode* parent, const char* prop_name)
+{
+	gboolean ret_val = FALSE;
+
+	if (parent != NULL && prop_name != NULL)
+	{
+		xmlChar* prop = xmlGetProp((xmlNode*) parent, (xmlChar*) prop_name);
+
+		if (prop != NULL)
+		{
+			if (!g_ascii_strcasecmp((char*) prop, "true") || !g_ascii_strcasecmp((char*) prop, "1"))
+			{
+				ret_val = TRUE;
+			}
+			else
+			{
+				ret_val = FALSE;
+			}
+
+			g_free(prop);
+		}
+	}
+
+	return ret_val;
+}
+
+static void mate_wp_xml_set_bool(const xmlNode* parent, const xmlChar* prop_name, gboolean value)
+{
+	if (parent != NULL && prop_name != NULL)
+	{
+		if (value)
+		{
+			xmlSetProp((xmlNode*) parent, prop_name, (xmlChar*) "true");
+		}
+		else
+		{
+			xmlSetProp((xmlNode*) parent, prop_name, (xmlChar*) "false");
+		}
+	}
+}
+
+static void mate_wp_load_legacy(AppearanceData* data)
+{
+	/* Legacy of GNOME2
+	 * ~/.gnome2/wallpapers.list */
+	char* filename = g_build_filename(g_get_home_dir(), ".gnome2", "wallpapers.list", NULL);
+
+	if (g_file_test(filename, G_FILE_TEST_EXISTS))
+	{
+		FILE* fp;
+
+		if ((fp = fopen(filename, "r")) != NULL)
+		{
+			char* foo = (char*) g_malloc(sizeof(char) * 4096);
+
+			while (fgets(foo, 4096, fp))
+			{
+				MateWPItem * item;
+
+				if (foo[strlen(foo) - 1] == '\n')
+				{
+					foo[strlen(foo) - 1] = '\0';
+				}
+
+				item = g_hash_table_lookup(data->wp_hash, foo);
+
+				if (item != NULL)
+				{
+					continue;
+				}
+
+				if (!g_file_test(foo, G_FILE_TEST_EXISTS))
+				{
+					continue;
+				}
+
+				item = mate_wp_item_new(foo, data->wp_hash, data->thumb_factory);
+
+				if (item != NULL && item->fileinfo == NULL)
+				{
+					mate_wp_item_free(item);
+				}
+			}
+
+			fclose(fp);
+			g_free(foo);
+		}
+	}
+
+	g_free(filename);
+}
+
+static void mate_wp_xml_load_xml(AppearanceData* data, const char* filename)
+{
+	xmlDoc* wplist;
+	xmlNode* root;<--- Variable 'root' can be declared as pointer to const
+	xmlNode* list;<--- Variable 'list' can be declared as pointer to const
+	xmlNode* wpa;
+	xmlChar* nodelang;
+#ifdef ENABLE_NLS
+	const char* const* syslangs;
+	gint i;
+#endif /* ENABLE_NLS */
+	GdkRGBA color1;
+	GdkRGBA color2;
+
+	wplist = xmlParseFile(filename);
+
+	if (!wplist)
+	{
+		return;
+	}
+
+#ifdef ENABLE_NLS
+	syslangs = g_get_language_names();
+#endif /* ENABLE_NLS */
+
+	root = xmlDocGetRootElement(wplist);
+
+	for (list = root->children; list != NULL; list = list->next)
+	{
+		if (!strcmp((char*) list->name, "wallpaper"))
+		{
+			MateWPItem * wp;
+			char *pcolor = NULL, *scolor = NULL;
+			gboolean have_scale = FALSE, have_shade = FALSE, have_artist = FALSE;
+
+			wp = g_new0(MateWPItem, 1);
+
+			wp->deleted = mate_wp_xml_get_bool(list, "deleted");
+
+			for (wpa = list->children; wpa != NULL; wpa = wpa->next)
+			{
+				if (wpa->type != XML_ELEMENT_NODE)
+				{
+					continue;
+				}
+
+				if (!strcmp ((char*) wpa->name, "filename"))
+				{
+					if (wpa->last != NULL && wpa->last->content != NULL)
+					{
+						const char* none = "(none)";
+						char* content = g_strstrip((char*) wpa->last->content);
+
+						if (!strcmp (content, none))
+						{
+							wp->filename = g_strdup (content);
+						}
+						else if (g_utf8_validate (content, -1, NULL) && g_file_test (content, G_FILE_TEST_EXISTS))
+						{
+							wp->filename = g_strdup (content);
+						}
+						else
+						{
+							wp->filename = g_filename_from_utf8 (content, -1, NULL, NULL, NULL);
+						}
+					}
+					else
+					{
+						break;
+					}
+				}
+				else if (!strcmp ((char*) wpa->name, "name"))
+				{
+					if (wpa->last != NULL && wpa->last->content != NULL)
+					{
+						nodelang = xmlNodeGetLang (wpa->last);
+
+						if (wp->name == NULL && nodelang == NULL)
+						{
+							wp->name = g_strdup (g_strstrip ((char *)wpa->last->content));
+						}
+#ifdef ENABLE_NLS
+						else
+						{
+							for (i = 0; syslangs[i] != NULL; i++)
+							{
+								if (!strcmp (syslangs[i], (char *)nodelang))
+								{
+									g_free (wp->name);
+									wp->name = g_strdup (g_strstrip ((char*) wpa->last->content));
+									break;
+								}
+							}
+						}
+#endif /* ENABLE_NLS */
+
+						xmlFree (nodelang);
+					}
+					else
+					{
+						break;
+					}
+				}
+				else if (!strcmp ((char*) wpa->name, "options"))
+				{
+					if (wpa->last != NULL)
+					{
+						wp->options = wp_item_string_to_option(g_strstrip ((char *)wpa->last->content));
+						have_scale = TRUE;
+					}
+				}
+				else if (!strcmp ((char*) wpa->name, "shade_type"))
+				{
+					if (wpa->last != NULL)
+					{
+						wp->shade_type = wp_item_string_to_shading(g_strstrip ((char *)wpa->last->content));
+						have_shade = TRUE;
+					}
+				}
+				else if (!strcmp ((char*) wpa->name, "pcolor"))
+				{
+					if (wpa->last != NULL)
+					{
+						pcolor = g_strdup(g_strstrip ((char *)wpa->last->content));
+					}
+				}
+				else if (!strcmp ((char*) wpa->name, "scolor"))
+				{
+					if (wpa->last != NULL)
+					{
+						scolor = g_strdup(g_strstrip ((char *)wpa->last->content));
+					}
+				}
+				else if (!strcmp ((char*) wpa->name, "artist"))
+				{
+					if (wpa->last != NULL)
+					{
+						wp->artist = g_strdup (g_strstrip ((char *)wpa->last->content));
+						have_artist = TRUE;
+					}
+				}
+				else if (!strcmp ((char*) wpa->name, "text"))
+				{
+					/* Do nothing here, libxml2 is being weird */
+				}
+				else
+				{
+					g_warning ("Unknown Tag: %s", wpa->name);
+				}
+			}
+
+			/* Make sure we don't already have this one and that filename exists */
+			if (wp->filename == NULL || g_hash_table_lookup (data->wp_hash, wp->filename) != NULL)
+			{
+
+				mate_wp_item_free (wp);
+				g_free (pcolor);
+				g_free (scolor);
+				continue;
+			}
+
+			/* Verify the colors and alloc some GdkRGBA here */
+			if (!have_scale)
+			{
+				wp->options = g_settings_get_enum(data->wp_settings, WP_OPTIONS_KEY);
+			}
+
+			if (!have_shade)
+			{
+				wp->shade_type = g_settings_get_enum(data->wp_settings, WP_SHADING_KEY);
+			}
+
+			if (pcolor == NULL)
+			{
+				pcolor = g_settings_get_string(data->wp_settings, WP_PCOLOR_KEY);
+			}
+
+			if (scolor == NULL)
+			{
+				scolor = g_settings_get_string (data->wp_settings, WP_SCOLOR_KEY);
+			}
+
+			if (!have_artist)
+			{
+				wp->artist = g_strdup ("(none)");
+			}
+
+			gdk_rgba_parse(&color1, pcolor);
+			gdk_rgba_parse(&color2, scolor);
+			g_free(pcolor);
+			g_free(scolor);
+
+			wp->pcolor = gdk_rgba_copy(&color1);
+			wp->scolor = gdk_rgba_copy(&color2);
+
+			if ((wp->filename != NULL && g_file_test (wp->filename, G_FILE_TEST_EXISTS)) || !strcmp (wp->filename, "(none)"))
+			{
+				wp->fileinfo = mate_wp_info_new(wp->filename, data->thumb_factory);
+
+				if (wp->name == NULL || !strcmp(wp->filename, "(none)"))
+				{
+					g_free (wp->name);
+					wp->name = g_strdup (wp->fileinfo->name);
+				}
+
+				mate_wp_item_ensure_mate_bg (wp);
+				mate_wp_item_update_description (wp);
+				g_hash_table_insert (data->wp_hash, wp->filename, wp);
+			}
+			else
+			{
+				mate_wp_item_free(wp);
+				wp = NULL;
+			}
+		}
+	}
+
+	xmlFreeDoc(wplist);
+}
+
+static void mate_wp_file_changed(GFileMonitor* monitor, GFile* file, GFile* other_file, GFileMonitorEvent event_type, AppearanceData* data)
+{
+	char* filename;
+
+	switch (event_type)
+	{
+		case G_FILE_MONITOR_EVENT_CHANGED:
+		case G_FILE_MONITOR_EVENT_CREATED:
+			filename = g_file_get_path(file);
+			mate_wp_xml_load_xml(data, filename);
+			g_free(filename);
+			break;
+		default:
+			break;
+	}
+}
+
+static void mate_wp_xml_add_monitor(GFile* directory, AppearanceData* data)
+{
+	GError* error = NULL;
+
+	GFileMonitor* monitor = g_file_monitor_directory(directory, G_FILE_MONITOR_NONE, NULL, &error);
+
+	if (error != NULL)
+	{
+		char* path = g_file_get_parse_name (directory);
+		g_warning("Unable to monitor directory %s: %s", path, error->message);
+		g_error_free(error);
+		g_free(path);
+		return;
+	}
+
+	g_signal_connect(monitor, "changed", G_CALLBACK(mate_wp_file_changed), data);
+}
+
+static void mate_wp_xml_load_from_dir(const char* path, AppearanceData* data)
+{
+	GFile* directory;
+	GFileEnumerator* enumerator;
+	GError* error = NULL;
+	GFileInfo* info;
+
+	if (!g_file_test(path, G_FILE_TEST_IS_DIR))
+	{
+		return;
+	}
+
+	directory = g_file_new_for_path(path);
+	enumerator = g_file_enumerate_children(
+		directory,
+		G_FILE_ATTRIBUTE_STANDARD_NAME,
+		G_FILE_QUERY_INFO_NONE,
+		NULL,
+		&error);
+
+	if (error != NULL)
+	{
+		g_warning("Unable to check directory %s: %s", path, error->message);
+		g_error_free(error);
+		g_object_unref(directory);
+		return;
+	}
+
+	while ((info = g_file_enumerator_next_file(enumerator, NULL, NULL)))
+	{
+		const char* filename = g_file_info_get_name(info);
+		char* fullpath = g_build_filename(path, filename, NULL);
+
+		g_object_unref(info);
+
+		mate_wp_xml_load_xml(data, fullpath);
+		g_free(fullpath);
+	}
+
+	g_file_enumerator_close(enumerator, NULL, NULL);
+
+	mate_wp_xml_add_monitor(directory, data);
+
+	g_object_unref(directory);
+}
+
+void mate_wp_xml_load_list(AppearanceData* data)
+{
+	const char* const* system_data_dirs;
+	char* datadir;
+	char* wpdbfile;
+	gint i;
+
+		wpdbfile = g_build_filename(g_get_user_config_dir(), "mate", "backgrounds.xml", NULL);
+
+	if (g_file_test(wpdbfile, G_FILE_TEST_EXISTS))
+	{
+		mate_wp_xml_load_xml(data, wpdbfile);
+	}
+	else
+	{
+		g_free (wpdbfile);
+
+			wpdbfile = g_build_filename(g_get_user_config_dir(), "mate", "wp-list.xml", NULL);
+
+		if (g_file_test(wpdbfile, G_FILE_TEST_EXISTS))
+		{
+			mate_wp_xml_load_xml(data, wpdbfile);
+		}
+	}
+
+	g_free (wpdbfile);
+
+	datadir = g_build_filename(g_get_user_data_dir(), "mate-background-properties", NULL);
+	mate_wp_xml_load_from_dir(datadir, data);
+	g_free(datadir);
+
+	system_data_dirs = g_get_system_data_dirs();
+
+	for (i = 0; system_data_dirs[i]; i++)
+	{
+		datadir = g_build_filename(system_data_dirs[i], "mate-background-properties", NULL);
+		mate_wp_xml_load_from_dir(datadir, data);
+		g_free (datadir);
+	}
+
+	mate_wp_xml_load_from_dir(WALLPAPER_DATADIR, data);
+
+	mate_wp_load_legacy(data);
+}
+
+static void mate_wp_list_flatten(const char* key, MateWPItem* item, GSList** list)
+{
+	if (key != NULL && item != NULL)
+	{
+		*list = g_slist_prepend(*list, item);
+	}
+}
+
+void mate_wp_xml_save_list(AppearanceData* data)
+{
+	xmlDoc* wplist;
+	xmlNode* root;
+	xmlNode* wallpaper;
+	GSList* list = NULL;
+
+	g_hash_table_foreach(data->wp_hash, (GHFunc) mate_wp_list_flatten, &list);
+	g_hash_table_destroy(data->wp_hash);
+	list = g_slist_reverse(list);
+
+	xmlKeepBlanksDefault(0);
+
+	wplist = xmlNewDoc((xmlChar*) "1.0");
+	xmlCreateIntSubset(wplist, (xmlChar*) "wallpapers", NULL, (xmlChar*) "mate-wp-list.dtd");
+	root = xmlNewNode(NULL, (xmlChar*) "wallpapers");
+	xmlDocSetRootElement(wplist, root);
+
+	while (list != NULL)
+	{
+		MateWPItem* wpitem = list->data;
+		const char* none = "(none)";
+		char* filename;
+		const char* scale;
+		const char* shade;
+		char* pcolor;
+		char* scolor;
+
+		if (!strcmp(wpitem->filename, none) || (g_utf8_validate(wpitem->filename, -1, NULL) && g_file_test(wpitem->filename, G_FILE_TEST_EXISTS)))
+		{
+			filename = g_strdup(wpitem->filename);
+		}
+		else
+		{
+			filename = g_filename_to_utf8(wpitem->filename, -1, NULL, NULL, NULL);
+		}
+
+		pcolor = gdk_rgba_to_string(wpitem->pcolor);
+		scolor = gdk_rgba_to_string(wpitem->scolor);
+
+		scale = wp_item_option_to_string(wpitem->options);
+		shade = wp_item_shading_to_string(wpitem->shade_type);
+
+		wallpaper = xmlNewChild(root, NULL, (xmlChar*) "wallpaper", NULL);
+		mate_wp_xml_set_bool(wallpaper, (xmlChar*) "deleted", wpitem->deleted);
+
+		xmlNewTextChild(wallpaper, NULL, (xmlChar*) "name", (xmlChar*) wpitem->name);
+		xmlNewTextChild(wallpaper, NULL, (xmlChar*) "filename", (xmlChar*) filename);
+		xmlNewTextChild(wallpaper, NULL, (xmlChar*) "options", (xmlChar*) scale);
+		xmlNewTextChild(wallpaper, NULL, (xmlChar*) "shade_type", (xmlChar*) shade);
+		xmlNewTextChild(wallpaper, NULL, (xmlChar*) "pcolor", (xmlChar*) pcolor);
+		xmlNewTextChild(wallpaper, NULL, (xmlChar*) "scolor", (xmlChar*) scolor);
+		xmlNewTextChild(wallpaper, NULL, (xmlChar*) "artist", (xmlChar*) wpitem->artist);
+
+		g_free(pcolor);
+		g_free(scolor);
+		g_free(filename);
+
+		list = g_slist_delete_link(list, list);
+		mate_wp_item_free(wpitem);
+	}
+
+	/* save the xml document, only if there are nodes in <wallpapers> */
+	if (xmlChildElementCount(root) > 0)
+	{
+		g_autofree gchar *wpdir = NULL;
+		g_autofree gchar *wpfile = NULL;
+
+		wpdir = g_build_filename (g_get_user_config_dir(), "mate", NULL);
+		if (g_mkdir_with_parents (wpdir, 0700) == -1)
+		{
+			int errsv = errno;
+			g_warning ("failed, g_mkdir_with_parents(%s) failed: %s", wpdir, g_strerror (errsv));
+		}
+		else
+		{
+			wpfile = g_build_filename(wpdir, "backgrounds.xml", NULL);
+			xmlSaveFormatFile(wpfile, wplist, 1);
+		}
+	}
+
+	xmlFreeDoc(wplist);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/25.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/25.html new file mode 100644 index 00000000..b534714e --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/25.html @@ -0,0 +1,1997 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2007 The GNOME Foundation
+ * Written by Thomas Wood <thos@gnome.org>
+ *            Jens Granseuer <jensgr@gmx.net>
+ * All Rights Reserved
+ *
+ * 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.
+ */
+
+#include "appearance.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 <gio/gio.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 <unistd.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+#include "file-transfer-dialog.h"<--- Include file: "file-transfer-dialog.h" not found.
+#include "theme-installer.h"
+#include "theme-util.h"
+
+#if !GLIB_CHECK_VERSION(2,70,0)
+#define g_pattern_spec_match_string g_pattern_match_string
+#endif
+
+enum {
+	THEME_INVALID,
+	THEME_ICON,
+	THEME_MATE,
+	THEME_GTK,
+	THEME_ENGINE,
+	THEME_MARCO,
+	THEME_CURSOR,
+	THEME_ICON_CURSOR
+};
+
+enum {
+	TARGZ,
+	TARBZ,
+	TARXZ,
+	DIRECTORY
+};
+
+static void
+cleanup_tmp_dir (GTask        *task G_GNUC_UNUSED,
+                 gpointer      source_object G_GNUC_UNUSED,
+                 gpointer      task_data,
+                 GCancellable *cancellable G_GNUC_UNUSED)
+{
+	GFile *directory;
+	char  *tmp_dir = task_data;
+
+	directory = g_file_new_for_path (tmp_dir);
+	capplet_file_delete_recursive (directory, NULL);
+	g_object_unref (directory);
+}
+
+static int
+file_theme_type (const gchar *dir)
+{
+	gchar *filename = NULL;
+	gboolean exists;
+
+	if (!dir)
+		return THEME_INVALID;
+
+	filename = g_build_filename (dir, "index.theme", NULL);
+	exists = g_file_test (filename, G_FILE_TEST_IS_REGULAR);
+
+	if (exists) {
+		GPatternSpec *pattern;
+		gchar *file_contents = NULL;
+		gsize file_size;
+		gboolean match;
+
+		g_file_get_contents (filename, &file_contents, &file_size, NULL);
+		g_free (filename);
+
+		pattern = g_pattern_spec_new ("*[Icon Theme]*");
+		match = g_pattern_spec_match_string (pattern, file_contents);
+		g_pattern_spec_free (pattern);
+
+		if (match) {
+			pattern = g_pattern_spec_new ("*Directories=*");
+			match = g_pattern_spec_match_string (pattern, file_contents);
+			g_pattern_spec_free (pattern);
+			g_free (file_contents);
+
+			if (match) {
+				/* check if we have a cursor, too */
+				filename = g_build_filename (dir, "cursors", NULL);
+				exists = g_file_test (filename, G_FILE_TEST_IS_DIR);
+				g_free (filename);
+
+				if (exists)
+					return THEME_ICON_CURSOR;
+				else
+					return THEME_ICON;
+			}
+			return THEME_CURSOR;
+		}
+
+		pattern = g_pattern_spec_new ("*[X-GNOME-Metatheme]*");
+		match = g_pattern_spec_match_string (pattern, file_contents);
+		g_pattern_spec_free (pattern);
+		g_free (file_contents);
+
+		if (match)
+			return THEME_MATE;
+	} else {
+		g_free (filename);
+	}
+
+	filename = g_build_filename (dir, "gtk-2.0", "gtkrc", NULL);
+	exists = g_file_test (filename, G_FILE_TEST_IS_REGULAR);
+	g_free (filename);
+
+	if (exists)
+		return THEME_GTK;
+
+	filename = g_build_filename (dir, "metacity-1", "metacity-theme-2.xml", NULL);
+	exists = g_file_test (filename, G_FILE_TEST_IS_REGULAR);
+	g_free (filename);
+
+	if (exists)
+		return THEME_MARCO;
+
+	filename = g_build_filename (dir, "metacity-1", "metacity-theme-1.xml", NULL);
+	exists = g_file_test (filename, G_FILE_TEST_IS_REGULAR);
+	g_free (filename);
+
+	if (exists)
+		return THEME_MARCO;
+
+	/* cursor themes don't necessarily have an index.theme */
+	filename = g_build_filename (dir, "cursors", NULL);
+	exists = g_file_test (filename, G_FILE_TEST_IS_DIR);
+	g_free (filename);
+
+	if (exists)
+		return THEME_CURSOR;
+
+	filename = g_build_filename (dir, "configure", NULL);
+	exists = g_file_test (filename, G_FILE_TEST_IS_EXECUTABLE);
+	g_free (filename);
+
+	if (exists)
+		return THEME_ENGINE;
+
+	return THEME_INVALID;
+}
+
+static void
+transfer_cancel_cb (GtkWidget *dialog,
+		    gchar *path)
+{
+	GFile *todelete;
+
+	todelete = g_file_new_for_path (path);
+	capplet_file_delete_recursive (todelete, NULL);
+
+	g_object_unref (todelete);
+	g_free (path);
+	gtk_widget_destroy (dialog);
+}
+
+static void
+missing_utility_message_dialog (GtkWindow *parent,
+				const gchar *utility)
+{
+	GtkWidget *dialog = gtk_message_dialog_new (parent,
+						    GTK_DIALOG_MODAL,
+						    GTK_MESSAGE_ERROR,
+						    GTK_BUTTONS_OK,
+						    _("Cannot install theme"));
+	gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+						  _("The %s utility is not installed."), utility);
+	gtk_dialog_run (GTK_DIALOG (dialog));
+	gtk_widget_destroy (dialog);
+}
+
+/* this works around problems when doing fork/exec in a threaded app
+ * with some locks being held/waited on in different threads.
+ *
+ * we do the idle callback so that the async xfer has finished and
+ * cleaned up its vfs job.  otherwise it seems the slave thread gets
+ * woken up and it removes itself from the job queue before it is
+ * supposed to.  very strange.
+ *
+ * see bugzilla.gnome.org #86141 for details
+ */
+static gboolean
+process_local_theme_tgz_tbz (GtkWindow *parent,
+			     const gchar *util,
+			     const gchar *tmp_dir,
+			     const gchar *archive)
+{
+	gboolean rc;
+	int status;
+	gchar *command, *filename, *zip, *tar;
+
+	if (!(zip = g_find_program_in_path (util))) {
+		missing_utility_message_dialog (parent, util);
+		return FALSE;
+	}
+	if (!(tar = g_find_program_in_path ("tar"))) {
+		missing_utility_message_dialog (parent, "tar");
+		g_free (zip);
+		return FALSE;
+	}
+
+	filename = g_shell_quote (archive);
+
+	/* this should be something more clever and nonblocking */
+	command = g_strdup_printf ("sh -c 'cd \"%s\"; %s -d -c < \"%s\" | %s xf - '",
+				   tmp_dir, zip, filename, tar);
+	g_free (zip);
+	g_free (tar);
+	g_free (filename);
+
+	rc = (g_spawn_command_line_sync (command, NULL, NULL, &status, NULL) && status == 0);
+	g_free (command);
+
+	if (rc == FALSE) {
+		GtkWidget *dialog;
+
+		dialog = gtk_message_dialog_new (parent,
+						 GTK_DIALOG_MODAL,
+						 GTK_MESSAGE_ERROR,
+						 GTK_BUTTONS_OK,
+						 _("Cannot install theme"));
+		gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+							  _("There was a problem while extracting the theme."));
+		gtk_dialog_run (GTK_DIALOG (dialog));
+		gtk_widget_destroy (dialog);
+	}
+
+	return rc;
+}
+
+static gboolean
+process_local_theme_archive (GtkWindow *parent,
+			     gint filetype,
+			     const gchar *tmp_dir,
+			     const gchar *archive)
+{
+	if (filetype == TARGZ)
+		return process_local_theme_tgz_tbz (parent, "gzip", tmp_dir, archive);
+	else if (filetype == TARBZ)
+		return process_local_theme_tgz_tbz (parent, "bzip2", tmp_dir, archive);
+	else if (filetype == TARXZ)
+		return process_local_theme_tgz_tbz (parent, "xz", tmp_dir, archive);
+	else
+		return FALSE;
+}
+
+static void
+invalid_theme_dialog (GtkWindow *parent,
+		      const gchar *filename,
+		      gboolean maybe_theme_engine)
+{
+	GtkWidget *dialog;
+	const gchar *primary = _("There was an error installing the selected file");
+	const gchar *secondary = _("\"%s\" does not appear to be a valid theme.");
+	const gchar *engine = _("\"%s\" does not appear to be a valid theme. It may be a theme engine which you need to compile.");
+
+	dialog = gtk_message_dialog_new (parent,
+					 GTK_DIALOG_MODAL,
+					 GTK_MESSAGE_ERROR,
+					 GTK_BUTTONS_OK,
+					 "%s", primary);
+	if (maybe_theme_engine)
+		gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), engine, filename);
+	else
+		gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), secondary, filename);
+	gtk_dialog_run (GTK_DIALOG (dialog));
+	gtk_widget_destroy (dialog);
+}
+
+static gboolean
+mate_theme_install_real (GtkWindow *parent,
+			  const gchar *tmp_dir,
+			  const gchar *theme_name,
+			  gboolean ask_user)
+{
+	gboolean success = TRUE;
+	GtkWidget *dialog, *apply_button;
+	GFile *theme_source_dir, *theme_dest_dir;
+	GError *error = NULL;
+	gint theme_type;
+	gchar *target_dir = NULL;
+
+	/* What type of theme is it? */
+	theme_type = file_theme_type (tmp_dir);
+	switch (theme_type) {
+	case THEME_ICON:
+	case THEME_CURSOR:
+	case THEME_ICON_CURSOR:
+		target_dir = g_build_path (G_DIR_SEPARATOR_S,
+					   g_get_home_dir (), ".icons",
+					   theme_name, NULL);
+		break;
+	case THEME_MATE:
+	case THEME_MARCO:
+	case THEME_GTK:
+		target_dir = g_build_path (G_DIR_SEPARATOR_S,
+					   g_get_home_dir (), ".themes",
+					   theme_name, NULL);
+		break;
+	case THEME_ENGINE:
+		invalid_theme_dialog (parent, theme_name, TRUE);
+		return FALSE;
+	default:
+		invalid_theme_dialog (parent, theme_name, FALSE);
+		return FALSE;
+	}
+
+	/* see if there is an icon theme lurking in this package */
+	if (theme_type == THEME_MATE) {
+		gchar *path;
+
+		path = g_build_path (G_DIR_SEPARATOR_S,
+				     tmp_dir, "icons", NULL);
+		if (g_file_test (path, G_FILE_TEST_IS_DIR)
+		    && (file_theme_type (path) == THEME_ICON)) {
+			gchar *new_path, *update_icon_cache;
+			GFile *new_file;
+			GFile *src_file;
+
+			src_file = g_file_new_for_path (path);
+			new_path = g_build_path (G_DIR_SEPARATOR_S,
+						 g_get_home_dir (),
+						 ".icons",
+						 theme_name, NULL);
+			new_file = g_file_new_for_path (new_path);
+
+			if (!g_file_move (src_file, new_file, G_FILE_COPY_NONE,
+					  NULL, NULL, NULL, &error)) {
+				g_warning ("Error while moving from `%s' to `%s': %s",
+					   path, new_path, error->message);
+				g_error_free (error);
+				error = NULL;
+			}
+			g_object_unref (new_file);
+			g_object_unref (src_file);
+
+			/* update icon cache - shouldn't really matter if this fails */
+			update_icon_cache = g_strdup_printf ("gtk-update-icon-cache %s", new_path);
+			g_spawn_command_line_async (update_icon_cache, NULL);
+			g_free (update_icon_cache);
+
+			g_free (new_path);
+		}
+		g_free (path);
+	}
+
+	/* Move the dir to the target dir */
+	theme_source_dir = g_file_new_for_path (tmp_dir);
+	theme_dest_dir = g_file_new_for_path (target_dir);
+
+	if (g_file_test (target_dir, G_FILE_TEST_EXISTS)) {
+		gchar *str;
+
+		str = g_strdup_printf (_("The theme \"%s\" already exists."), theme_name);
+		dialog = gtk_message_dialog_new (parent,
+						 GTK_DIALOG_MODAL,
+						 GTK_MESSAGE_INFO,
+						 GTK_BUTTONS_NONE,
+						 "%s",
+						 str);
+		g_free (str);
+
+		gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+							  _("Do you want to install it again?"));
+
+		gtk_dialog_add_button (GTK_DIALOG (dialog),
+					   _("Cancel"),
+					   GTK_RESPONSE_CLOSE);
+
+		apply_button = gtk_button_new_with_label (_("Install"));
+		gtk_button_set_image (GTK_BUTTON (apply_button),
+					  gtk_image_new_from_icon_name ("gtk-apply",
+								GTK_ICON_SIZE_BUTTON));
+		gtk_dialog_add_action_widget (GTK_DIALOG (dialog), apply_button, GTK_RESPONSE_APPLY);
+		gtk_widget_set_can_default (apply_button, TRUE);
+		gtk_widget_show (apply_button);
+
+		gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_APPLY);
+
+		if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_APPLY) {
+			gtk_widget_destroy (dialog);
+
+			if (!capplet_file_delete_recursive (theme_dest_dir, NULL)) {
+				GtkWidget *info_dialog = gtk_message_dialog_new (NULL,
+									   GTK_DIALOG_MODAL,
+									   GTK_MESSAGE_ERROR,
+									   GTK_BUTTONS_OK,
+									   _("Theme cannot be deleted"));
+				gtk_dialog_run (GTK_DIALOG (info_dialog));
+				gtk_widget_destroy (info_dialog);
+				success = FALSE;
+				goto end;
+			}
+		}else{
+			gtk_widget_destroy (dialog);
+			success = FALSE;
+			goto end;
+		}
+	}
+
+	if (!g_file_move (theme_source_dir, theme_dest_dir,
+			  G_FILE_COPY_OVERWRITE, NULL, NULL,
+			  NULL, &error)) {
+		gchar *str;
+
+		str = g_strdup_printf (_("Installation for theme \"%s\" failed."), theme_name);
+		dialog = gtk_message_dialog_new (parent,
+						 GTK_DIALOG_MODAL,
+						 GTK_MESSAGE_ERROR,
+						 GTK_BUTTONS_OK,
+						 "%s",
+						 str);
+		gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+							  "%s", error->message);
+
+		g_free (str);
+		g_error_free (error);
+		error = NULL;
+
+		gtk_dialog_run (GTK_DIALOG (dialog));
+		gtk_widget_destroy (dialog);
+		success = FALSE;
+	} else {
+		if (theme_type == THEME_ICON || theme_type == THEME_ICON_CURSOR)
+		{
+			gchar *update_icon_cache;
+
+			/* update icon cache - shouldn't really matter if this fails */
+			update_icon_cache = g_strdup_printf ("gtk-update-icon-cache %s", target_dir);
+			g_spawn_command_line_async (update_icon_cache, NULL);
+
+			g_free (update_icon_cache);
+		}
+
+		if (ask_user) {
+			/* Ask to apply theme (if we can) */
+			if (theme_type == THEME_GTK
+			    || theme_type == THEME_MARCO
+			    || theme_type == THEME_ICON
+			    || theme_type == THEME_CURSOR
+			    || theme_type == THEME_ICON_CURSOR) {
+				/* TODO: currently cannot apply "mate themes" */
+				gchar *str;
+
+				str = g_strdup_printf (_("The theme \"%s\" has been installed."), theme_name);
+				dialog = gtk_message_dialog_new_with_markup (parent,
+									     GTK_DIALOG_MODAL,
+									     GTK_MESSAGE_INFO,
+									     GTK_BUTTONS_NONE,
+									     "<span weight=\"bold\" size=\"larger\">%s</span>",
+									     str);
+				g_free (str);
+
+				gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+									  _("Would you like to apply it now, or keep your current theme?"));
+
+				gtk_dialog_add_button (GTK_DIALOG (dialog),
+						       _("Keep Current Theme"),
+						       GTK_RESPONSE_CLOSE);
+
+				apply_button = gtk_button_new_with_label (_("Apply New Theme"));
+				gtk_button_set_image (GTK_BUTTON (apply_button),
+						      gtk_image_new_from_icon_name ("gtk-apply",
+										    GTK_ICON_SIZE_BUTTON));
+				gtk_dialog_add_action_widget (GTK_DIALOG (dialog), apply_button, GTK_RESPONSE_APPLY);
+				gtk_widget_set_can_default (apply_button, TRUE);
+				gtk_widget_show (apply_button);
+
+				gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_APPLY);
+
+				if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_APPLY) {
+					/* apply theme here! */
+					GSettings *settings;
+
+					switch (theme_type) {
+					case THEME_GTK:
+						settings = g_settings_new (INTERFACE_SCHEMA);
+						g_settings_set_string (settings, GTK_THEME_KEY, theme_name);
+						g_object_unref (settings);
+						break;
+					case THEME_MARCO:
+						settings = g_settings_new (MARCO_SCHEMA);
+						g_settings_set_string (settings, MARCO_THEME_KEY, theme_name);
+						g_object_unref (settings);
+						break;
+					case THEME_ICON:
+						settings = g_settings_new (INTERFACE_SCHEMA);
+						g_settings_set_string (settings, ICON_THEME_KEY, theme_name);
+						g_object_unref (settings);
+						break;
+					case THEME_CURSOR:
+						settings = g_settings_new (MOUSE_SCHEMA);
+						g_settings_set_string (settings, CURSOR_THEME_KEY, theme_name);
+						g_object_unref (settings);
+						break;
+					case THEME_ICON_CURSOR:
+						settings = g_settings_new (INTERFACE_SCHEMA);
+						g_settings_set_string (settings, ICON_THEME_KEY, theme_name);
+						g_object_unref (settings);
+						settings = g_settings_new (MOUSE_SCHEMA);
+						g_settings_set_string (settings, CURSOR_THEME_KEY, theme_name);
+						g_object_unref (settings);
+						break;
+					default:
+						break;
+					}
+				}
+			} else {
+				dialog = gtk_message_dialog_new (parent,
+								 GTK_DIALOG_MODAL,
+								 GTK_MESSAGE_INFO,
+								 GTK_BUTTONS_OK,
+								 _("MATE Theme %s correctly installed"),
+								 theme_name);
+				gtk_dialog_run (GTK_DIALOG (dialog));
+			}
+			gtk_widget_destroy (dialog);
+		}
+	}
+
+end:
+	g_free (target_dir);
+	g_object_unref (theme_source_dir);
+	g_object_unref (theme_dest_dir);
+
+	return success;
+}
+
+static void
+theme_cleanup_tmp_dir (char *tmp_dir)
+{
+	GTask *task;
+
+	task = g_task_new (NULL, NULL, NULL, NULL);
+	g_task_set_task_data (task, tmp_dir, g_free);
+	g_task_run_in_thread (task, cleanup_tmp_dir);
+
+	g_object_unref (task);
+}
+
+static void
+process_local_theme (GtkWindow  *parent,
+		     const char *path)
+{
+	GtkWidget *dialog;
+	gint filetype;
+
+	if (g_str_has_suffix (path, ".tar.gz")
+	    || g_str_has_suffix (path, ".tgz")
+	    || g_str_has_suffix(path, ".gtp")) {
+		filetype = TARGZ;
+	} else if (g_str_has_suffix (path, ".tar.bz2")) {
+		filetype = TARBZ;
+	} else if (g_str_has_suffix (path, ".tar.xz")) {
+		filetype = TARXZ;
+	} else if (g_file_test (path, G_FILE_TEST_IS_DIR)) {
+		filetype = DIRECTORY;
+	} else {
+		gchar *filename;
+		filename = g_path_get_basename (path);
+		invalid_theme_dialog (parent, filename, FALSE);
+		g_free (filename);
+		return;
+	}
+
+	if (filetype == DIRECTORY) {
+		gchar *name = g_path_get_basename (path);
+		mate_theme_install_real (parent,
+					  path,
+					  name,
+					  TRUE);
+		g_free (name);
+	} else {
+		/* Create a temp directory and uncompress file there */
+		GDir *dir;
+		const gchar *name;
+		gchar *tmp_dir;
+		gboolean ok;
+		gint n_themes;
+		GFile *todelete;
+
+		tmp_dir = g_strdup_printf ("%s/.themes/.theme-%u",
+					   g_get_home_dir (),
+					   g_random_int ());
+
+		if ((g_mkdir (tmp_dir, 0700)) != 0) {
+			dialog = gtk_message_dialog_new (parent,
+							 GTK_DIALOG_MODAL,
+							 GTK_MESSAGE_ERROR,
+							 GTK_BUTTONS_OK,
+							 _("Failed to create temporary directory"));
+			gtk_dialog_run (GTK_DIALOG (dialog));
+			gtk_widget_destroy (dialog);
+			g_free (tmp_dir);
+			return;
+		}
+
+		if (!process_local_theme_archive (parent, filetype, tmp_dir, path)
+		    || ((dir = g_dir_open (tmp_dir, 0, NULL)) == NULL)) {
+			theme_cleanup_tmp_dir (tmp_dir);
+			return;
+		}
+
+		todelete = g_file_new_for_path (path);
+		g_file_delete (todelete, NULL, NULL);
+		g_object_unref (todelete);
+
+		/* See whether we have multiple themes to install. If so,
+		 * we won't ask the user whether to apply the new theme
+		 * after installation. */
+		n_themes = 0;
+		for (name = g_dir_read_name (dir);
+		     name && n_themes <= 1;
+		     name = g_dir_read_name (dir)) {
+			gchar *theme_dir;
+
+			theme_dir = g_build_filename (tmp_dir, name, NULL);
+
+			if (g_file_test (theme_dir, G_FILE_TEST_IS_DIR))
+				++n_themes;
+
+			g_free (theme_dir);
+		}
+		g_dir_rewind (dir);
+
+		ok = TRUE;
+		for (name = g_dir_read_name (dir); name && ok;
+		     name = g_dir_read_name (dir)) {
+			gchar *theme_dir;
+
+			theme_dir = g_build_filename (tmp_dir, name, NULL);
+
+			if (g_file_test (theme_dir, G_FILE_TEST_IS_DIR))
+				ok = mate_theme_install_real (parent,
+							       theme_dir,
+							       name,
+							       n_themes == 1);
+
+			g_free (theme_dir);
+		}
+		g_dir_close (dir);
+
+		if (ok && n_themes > 1) {
+			dialog = gtk_message_dialog_new (parent,
+							 GTK_DIALOG_MODAL,
+							 GTK_MESSAGE_INFO,
+							 GTK_BUTTONS_OK,
+							 _("New themes have been successfully installed."));
+			gtk_dialog_run (GTK_DIALOG (dialog));
+			gtk_widget_destroy (dialog);
+		}
+		theme_cleanup_tmp_dir (tmp_dir);
+	}
+}
+
+typedef struct
+{
+	GtkWindow *parent;
+	char      *path;
+} TransferData;
+
+static void
+transfer_done_cb (GtkWidget *dialog,
+		  TransferData *tdata)
+{
+	/* XXX: path should be on the local filesystem by now? */
+
+	if (dialog != NULL) {
+		gtk_widget_destroy (dialog);
+	}
+
+	process_local_theme (tdata->parent, tdata->path);
+
+	g_free (tdata->path);
+	g_free (tdata);
+}
+
+void
+mate_theme_install (GFile *file,
+		     GtkWindow *parent)
+{
+	GtkWidget *dialog;
+	gchar *path, *base;
+	GList *src, *target;
+	const gchar *template;
+	TransferData *tdata;
+
+	if (file == NULL) {
+		dialog = gtk_message_dialog_new (parent,
+						 GTK_DIALOG_MODAL,
+						 GTK_MESSAGE_ERROR,
+						 GTK_BUTTONS_OK,
+						 _("No theme file location specified to install"));
+		gtk_dialog_run (GTK_DIALOG (dialog));
+		gtk_widget_destroy (dialog);
+		return;
+	}
+
+	/* see if someone dropped a local directory */
+	if (g_file_is_native (file)
+	    && g_file_query_file_type (file, G_FILE_QUERY_INFO_NONE, NULL) == G_FILE_TYPE_DIRECTORY) {
+		path = g_file_get_path (file);
+		process_local_theme (parent, path);
+		g_free (path);
+		return;
+	}
+
+	/* we can't tell if this is an icon theme yet, so just make a
+	 * temporary copy in .themes */
+	path = g_build_filename (g_get_home_dir (), ".themes", NULL);
+
+	if (access (path, X_OK | W_OK) != 0) {
+		dialog = gtk_message_dialog_new (parent,
+						 GTK_DIALOG_MODAL,
+						 GTK_MESSAGE_ERROR,
+						 GTK_BUTTONS_OK,
+						 _("Insufficient permissions to install the theme in:\n%s"), path);
+		gtk_dialog_run (GTK_DIALOG (dialog));
+		gtk_widget_destroy (dialog);
+		g_free (path);
+		return;
+	}
+
+	g_free (path);
+
+	base = g_file_get_basename (file);
+
+	if (g_str_has_suffix (base, ".tar.gz")
+	    || g_str_has_suffix (base, ".tgz")
+	    || g_str_has_suffix (base, ".gtp"))
+		template = "mate-theme-%d.gtp";
+	else if (g_str_has_suffix (base, ".tar.bz2"))
+		template = "mate-theme-%d.tar.bz2";
+	else if (g_str_has_suffix (base, ".tar.xz"))
+		template = "mate-theme-%d.tar.xz";
+	else {
+		invalid_theme_dialog (parent, base, FALSE);
+		g_free (base);
+		return;
+	}
+	g_free (base);
+
+	src = g_list_append (NULL, g_object_ref (file));
+
+	path = NULL;
+	do {
+	  	gchar *file_tmp;
+
+		g_free (path);
+    		file_tmp = g_strdup_printf (template, g_random_int ());
+	    	path = g_build_filename (g_get_home_dir (), ".themes", file_tmp, NULL);
+	  	g_free (file_tmp);
+	} while (g_file_test (path, G_FILE_TEST_EXISTS));
+
+	tdata = g_new0 (TransferData, 1);
+	tdata->parent = parent;
+	tdata->path = path;
+
+	dialog = file_transfer_dialog_new_with_parent (parent);
+	g_signal_connect (dialog,
+			  "cancel",
+			  (GCallback) transfer_cancel_cb, path);
+	g_signal_connect (dialog,
+			  "done",
+			  (GCallback) transfer_done_cb, tdata);
+
+	target = g_list_append (NULL, g_file_new_for_path (path));
+	file_transfer_dialog_copy_async (FILE_TRANSFER_DIALOG (dialog),
+					 src,
+					 target,
+					 FILE_TRANSFER_DIALOG_DEFAULT,
+					 G_PRIORITY_DEFAULT);
+	gtk_widget_show (dialog);
+
+	/* don't free the path since we're using that for the signals */
+	g_list_foreach (src, (GFunc) g_object_unref, NULL);
+	g_list_free (src);
+	g_list_foreach (target, (GFunc) g_object_unref, NULL);
+	g_list_free (target);
+}
+
+void
+mate_theme_installer_run (GtkWindow *parent)
+{
+	static gboolean running_theme_install = FALSE;
+	static gchar old_folder[512] = "";
+	GtkWidget *dialog;
+	GtkFileFilter *filter;
+
+	if (running_theme_install)
+		return;
+
+	running_theme_install = TRUE;
+
+	dialog = gtk_file_chooser_dialog_new (_("Select Theme"),
+					      parent,
+					      GTK_FILE_CHOOSER_ACTION_OPEN,
+					      "gtk-cancel",
+					      GTK_RESPONSE_REJECT,
+					      "gtk-open",
+					      GTK_RESPONSE_ACCEPT,
+					      NULL);
+	gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);
+
+	filter = gtk_file_filter_new ();
+	gtk_file_filter_set_name (filter, _("Theme Packages"));
+	gtk_file_filter_add_mime_type (filter, "application/x-bzip-compressed-tar");
+	gtk_file_filter_add_mime_type (filter, "application/x-xz-compressed-tar");
+	gtk_file_filter_add_mime_type (filter, "application/x-compressed-tar");
+	gtk_file_filter_add_mime_type (filter, "application/x-mate-theme-package");
+	gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
+
+	filter = gtk_file_filter_new ();
+	gtk_file_filter_set_name (filter, _("All Files"));
+	gtk_file_filter_add_pattern(filter, "*");
+	gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
+
+	if (strcmp (old_folder, ""))
+		gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), old_folder);
+
+	if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {
+		gchar *uri_selected, *folder;
+
+		uri_selected = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (dialog));
+
+		folder = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (dialog));
+		g_strlcpy (old_folder, folder, 255);
+		g_free (folder);
+
+		gtk_widget_destroy (dialog);
+
+		if (uri_selected != NULL) {
+			GFile *file = g_file_new_for_uri (uri_selected);
+			g_free (uri_selected);
+
+			mate_theme_install (file, parent);
+			g_object_unref (file);
+		}
+	} else {
+		gtk_widget_destroy (dialog);
+	}
+
+	/*
+	 * we're relying on the mate theme info module to pick up changes
+	 * to the themes so we don't need to update the model here
+	 */
+
+	running_theme_install = FALSE;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/26.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/26.html new file mode 100644 index 00000000..bb3b7f49 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/26.html @@ -0,0 +1,1027 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * Copyright (C) 2007 The GNOME Foundation
+ * Written by Thomas Wood <thos@gnome.org>
+ *            Jens Granseuer <jensgr@gmx.net>
+ * All Rights Reserved
+ *
+ * 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.
+ */
+
+#include "appearance.h"
+
+#include <glib/gstdio.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 <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "theme-save.h"
+#include "theme-util.h"
+#include "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+
+static GQuark error_quark;
+enum {
+  INVALID_THEME_NAME
+};
+
+/* taken from mate-desktop-item.c */
+static gchar *
+escape_string_and_dup (const gchar *s)
+{
+  gchar *return_value, *p;
+  const gchar *q;
+  int len = 0;
+
+  if (s == NULL)
+    return g_strdup("");
+
+  q = s;
+  while (*q)
+    {
+      len++;
+      if (strchr ("\n\r\t\\", *q) != NULL)
+	len++;
+      q++;
+    }
+  return_value = p = (gchar *) g_malloc (len + 1);
+  do
+    {
+      switch (*s)
+	{
+	case '\t':
+	  *p++ = '\\';
+	  *p++ = 't';
+	  break;
+	case '\n':
+	  *p++ = '\\';
+	  *p++ = 'n';
+	  break;
+	case '\r':
+	  *p++ = '\\';
+	  *p++ = 'r';
+	  break;
+	case '\\':
+	  *p++ = '\\';
+	  *p++ = '\\';
+	  break;
+	default:
+	  *p++ = *s;
+	}
+    }
+  while (*s++);
+  return return_value;
+}
+
+static gboolean
+check_theme_name (const gchar  *theme_name,
+		  GError      **error)
+{
+  if (theme_name == NULL) {
+    g_set_error (error,
+		 error_quark,
+		 INVALID_THEME_NAME,
+		 _("Theme name must be present"));
+    return FALSE;
+  }
+  return TRUE;
+}
+
+static gchar *
+str_remove_slash (const gchar *src)
+{
+  const gchar *i;
+  gchar *rtn;
+  gint len = 0;
+  i = src;
+
+  while (*i) {
+    if (*i != '/')
+      len++;
+    i++;
+  }
+
+  rtn = (gchar *) g_malloc (len + 1);
+  while (*src) {
+    if (*src != '/') {
+      *rtn = *src;
+      rtn++;
+    }
+    src++;
+  }
+  *rtn = '\0';
+  return rtn - len;
+}
+
+static gboolean
+setup_directory_structure (const gchar  *theme_name,
+			   GError      **error)
+{
+  gchar *dir, *theme_name_dir;
+  gboolean retval = TRUE;
+
+  theme_name_dir = str_remove_slash (theme_name);
+
+  dir = g_build_filename (g_get_home_dir (), ".themes", NULL);
+  if (!g_file_test (dir, G_FILE_TEST_EXISTS))
+    g_mkdir (dir, 0775);
+  g_free (dir);
+
+  dir = g_build_filename (g_get_home_dir (), ".themes", theme_name_dir, NULL);
+  if (!g_file_test (dir, G_FILE_TEST_EXISTS))
+    g_mkdir (dir, 0775);
+  g_free (dir);
+
+  dir = g_build_filename (g_get_home_dir (), ".themes", theme_name_dir, "index.theme", NULL);
+  g_free (theme_name_dir);
+
+  if (g_file_test (dir, G_FILE_TEST_EXISTS)) {
+    GtkDialog *dialog;
+    GtkWidget *button;
+    gint response;
+
+    dialog = (GtkDialog *) gtk_message_dialog_new (NULL,
+						   GTK_DIALOG_MODAL,
+						   GTK_MESSAGE_QUESTION,
+	 					   GTK_BUTTONS_CANCEL,
+						   _("The theme already exists. Would you like to replace it?"));
+    button = gtk_dialog_add_button (dialog, _("_Overwrite"), GTK_RESPONSE_ACCEPT);
+    gtk_button_set_image (GTK_BUTTON (button),
+			  gtk_image_new_from_icon_name ("document-save", GTK_ICON_SIZE_BUTTON));
+    response = gtk_dialog_run (dialog);
+    gtk_widget_destroy (GTK_WIDGET (dialog));
+    retval = (response != GTK_RESPONSE_CANCEL);
+  }
+  g_free (dir);
+
+  return retval;
+}
+
+static gboolean
+write_theme_to_disk (MateThemeMetaInfo  *theme_info,
+		     const gchar         *theme_name,
+		     const gchar         *theme_description,
+		     gboolean		  save_background,
+		     gboolean		  save_notification,
+		     GError             **error)
+{
+	gchar* dir;
+	gchar* theme_name_dir;
+	GFile* tmp_file;
+	GFile* target_file;
+	GOutputStream* output;
+
+	gchar* str;
+	gchar* current_background;
+
+	GSettings* settings;
+	const gchar* theme_header = ""
+		"[Desktop Entry]\n"
+		"Name=%s\n"
+		"Type=X-GNOME-Metatheme\n"
+		"Comment=%s\n"
+		"\n"
+		"[X-GNOME-Metatheme]\n"
+		"GtkTheme=%s\n"
+		"MetacityTheme=%s\n"
+		"IconTheme=%s\n";
+
+  theme_name_dir = str_remove_slash (theme_name);
+  dir = g_build_filename (g_get_home_dir (), ".themes", theme_name_dir, "index.theme~", NULL);
+  g_free (theme_name_dir);
+
+  tmp_file = g_file_new_for_path (dir);
+  dir [strlen (dir) - 1] = '\000';
+  target_file = g_file_new_for_path (dir);
+  g_free (dir);
+
+  /* start making the theme file */
+  str = g_strdup_printf(theme_header, theme_name, theme_description, theme_info->gtk_theme_name, theme_info->marco_theme_name, theme_info->icon_theme_name);
+
+  output = G_OUTPUT_STREAM (g_file_replace (tmp_file, NULL, FALSE, G_FILE_CREATE_NONE, NULL, NULL));
+  g_output_stream_write (output, str, strlen (str), NULL, NULL);
+  g_free (str);
+
+  if (theme_info->gtk_color_scheme) {
+    gchar *a, *tmp;
+    tmp = g_strdup (theme_info->gtk_color_scheme);
+    for (a = tmp; *a != '\0'; a++)
+      if (*a == '\n')
+        *a = ',';
+    str = g_strdup_printf ("GtkColorScheme=%s\n", tmp);
+    g_output_stream_write (output, str, strlen (str), NULL, NULL);
+
+    g_free (str);
+    g_free (tmp);
+  }
+
+  if (theme_info->cursor_theme_name) {
+    str = g_strdup_printf ("CursorTheme=%s\n"
+                           "CursorSize=%i\n",
+                           theme_info->cursor_theme_name,
+                           theme_info->cursor_size);
+    g_output_stream_write (output, str, strlen (str), NULL, NULL);
+    g_free (str);
+  }
+
+  if (theme_info->notification_theme_name && save_notification) {
+    str = g_strdup_printf ("NotificationTheme=%s\n", theme_info->notification_theme_name);
+    g_output_stream_write (output, str, strlen (str), NULL, NULL);
+    g_free (str);
+  }
+
+  if (save_background) {
+    settings = g_settings_new (WP_SCHEMA);
+    current_background = g_settings_get_string (settings, WP_FILE_KEY);
+
+    if (current_background != NULL) {
+      str = g_strdup_printf ("BackgroundImage=%s\n", current_background);
+
+      g_output_stream_write (output, str, strlen (str), NULL, NULL);
+
+      g_free (current_background);
+      g_free (str);
+    }
+    g_object_unref (settings);
+  }
+
+  g_file_move (tmp_file, target_file, G_FILE_COPY_OVERWRITE, NULL, NULL, NULL, NULL);
+  g_output_stream_close (output, NULL, NULL);
+
+  g_object_unref (tmp_file);
+  g_object_unref (target_file);
+
+  return TRUE;
+}
+
+static gboolean
+save_theme_to_disk (MateThemeMetaInfo  *theme_info,
+		    const gchar         *theme_name,
+		    const gchar         *theme_description,
+		    gboolean		 save_background,
+		    gboolean             save_notification,
+		    GError             **error)
+{
+  if (!check_theme_name (theme_name, error))
+    return FALSE;
+
+  if (!setup_directory_structure (theme_name, error))
+    return FALSE;
+
+  if (!write_theme_to_disk (theme_info, theme_name, theme_description, save_background, save_notification, error))
+    return FALSE;
+
+  return TRUE;
+}
+
+static void
+save_dialog_response (GtkWidget      *save_dialog,
+		      gint            response_id,
+		      AppearanceData *data)
+{
+  if (response_id == GTK_RESPONSE_OK) {
+    GtkWidget *entry;
+    GtkWidget *text_view;
+    GtkTextBuffer *buffer;
+    GtkTextIter start_iter;
+    GtkTextIter end_iter;
+    gchar *buffer_text;
+    MateThemeMetaInfo *theme_info;
+    gchar *theme_description = NULL;
+    gchar *theme_name = NULL;
+    gboolean save_background;
+    gboolean save_notification;
+    GError *error = NULL;
+
+    entry = appearance_capplet_get_widget (data, "save_dialog_entry");
+    theme_name = escape_string_and_dup (gtk_entry_get_text (GTK_ENTRY (entry)));
+
+    text_view = appearance_capplet_get_widget (data, "save_dialog_textview");
+    buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
+    gtk_text_buffer_get_start_iter (buffer, &start_iter);
+    gtk_text_buffer_get_end_iter (buffer, &end_iter);
+    buffer_text = gtk_text_buffer_get_text (buffer, &start_iter, &end_iter, FALSE);
+    theme_description = escape_string_and_dup (buffer_text);
+    g_free (buffer_text);
+    theme_info = (MateThemeMetaInfo *) g_object_get_data (G_OBJECT (save_dialog), "meta-theme-info");
+    save_background = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (
+		      appearance_capplet_get_widget (data, "save_background_checkbutton")));
+    save_notification = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (
+			appearance_capplet_get_widget (data, "save_notification_checkbutton")));
+
+    if (save_theme_to_disk (theme_info, theme_name, theme_description, save_background, save_notification, &error)) {
+      /* remove the custom theme */
+      GtkTreeIter iter;
+
+      if (theme_find_in_model (GTK_TREE_MODEL (data->theme_store), "__custom__", &iter))
+        gtk_list_store_remove (data->theme_store, &iter);
+    }
+
+    g_free (theme_name);
+    g_free (theme_description);
+    g_clear_error (&error);
+  }
+
+  gtk_widget_hide (save_dialog);
+}
+
+static void
+entry_text_changed (GtkEditable *editable,
+                    AppearanceData  *data)
+{
+  const gchar *text;
+  GtkWidget *button;
+
+  text = gtk_entry_get_text (GTK_ENTRY (editable));
+  button = appearance_capplet_get_widget (data, "save_dialog_save_button");
+
+  gtk_widget_set_sensitive (button, text != NULL && text[0] != '\000');
+}
+
+void
+theme_save_dialog_run (MateThemeMetaInfo *theme_info,
+		       AppearanceData     *data)
+{
+  GtkWidget *entry;
+  GtkWidget *text_view;
+  GtkTextBuffer *text_buffer;
+
+  entry = appearance_capplet_get_widget (data, "save_dialog_entry");
+  text_view = appearance_capplet_get_widget (data, "save_dialog_textview");
+
+  if (data->theme_save_dialog == NULL) {
+    data->theme_save_dialog = appearance_capplet_get_widget (data, "theme_save_dialog");
+
+    g_signal_connect (data->theme_save_dialog, "response", (GCallback) save_dialog_response, data);
+    g_signal_connect (data->theme_save_dialog, "delete-event", (GCallback) gtk_true, NULL);
+    g_signal_connect (entry, "changed", (GCallback) entry_text_changed, data);
+
+    error_quark = g_quark_from_string ("mate-theme-save");
+    gtk_widget_set_size_request (text_view, 300, 100);
+  }
+
+  gtk_entry_set_text (GTK_ENTRY (entry), "");
+  entry_text_changed (GTK_EDITABLE (entry), data);
+  gtk_widget_grab_focus (entry);
+
+  text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
+  gtk_text_buffer_set_text (text_buffer, "", 0);
+  g_object_set_data (G_OBJECT (data->theme_save_dialog), "meta-theme-info", theme_info);
+  gtk_window_set_transient_for (GTK_WINDOW (data->theme_save_dialog),
+                                GET_WINDOW ("appearance_window"));
+  gtk_widget_show (data->theme_save_dialog);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/27.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/27.html new file mode 100644 index 00000000..05cf0405 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/27.html @@ -0,0 +1,825 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * Copyright (C) 2007 The GNOME Foundation
+ * Written by Thomas Wood <thos@gnome.org>
+ *            Jens Granseuer <jensgr@gmx.net>
+ * All Rights Reserved
+ *
+ * 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.
+ */
+
+#include "appearance.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 "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+#include "theme-util.h"
+
+gboolean theme_is_writable (const gpointer theme)
+{
+  MateThemeCommonInfo *info = theme;
+  GFile *file;
+  GFileInfo *file_info;
+  gboolean writable;
+
+  if (info == NULL || info->path == NULL)
+    return FALSE;
+
+  file = g_file_new_for_path (info->path);
+  file_info = g_file_query_info (file,
+                                 G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE,
+                                 G_FILE_QUERY_INFO_NONE,
+                                 NULL, NULL);
+  g_object_unref (file);
+
+  if (file_info == NULL)
+    return FALSE;
+
+  writable = g_file_info_get_attribute_boolean (file_info,
+                                                G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE);
+  g_object_unref (file_info);
+
+  return writable;
+}
+
+gboolean theme_delete (const gchar *name, ThemeType type)
+{
+  gboolean rc;
+  GtkDialog *dialog;
+  gchar *theme_dir;
+  gint response;
+  MateThemeCommonInfo *theme;
+  GFile *dir;
+  gboolean del_empty_parent;
+
+  dialog = (GtkDialog *) gtk_message_dialog_new (NULL,
+						 GTK_DIALOG_MODAL,
+						 GTK_MESSAGE_QUESTION,
+						 GTK_BUTTONS_CANCEL,
+						 _("Would you like to delete this theme?"));
+  gtk_dialog_add_button (dialog, "gtk-delete", GTK_RESPONSE_ACCEPT);
+  response = gtk_dialog_run (dialog);
+  gtk_widget_destroy (GTK_WIDGET (dialog));
+  if (response != GTK_RESPONSE_ACCEPT)
+    return FALSE;
+
+  /* Most theme types are put into separate subdirectories. For those
+     we want to delete those directories as well. */
+  del_empty_parent = TRUE;
+
+  switch (type) {
+    case THEME_TYPE_GTK:
+      theme = (MateThemeCommonInfo *) mate_theme_info_find (name);
+      theme_dir = g_build_filename (theme->path, "gtk-2.0", NULL);
+      break;
+
+    case THEME_TYPE_ICON:
+      theme = (MateThemeCommonInfo *) mate_theme_icon_info_find (name);
+      theme_dir = g_path_get_dirname (theme->path);
+      del_empty_parent = FALSE;
+      break;
+
+    case THEME_TYPE_WINDOW:
+      theme = (MateThemeCommonInfo *) mate_theme_info_find (name);
+      theme_dir = g_build_filename (theme->path, "metacity-1", NULL);
+      break;
+
+    case THEME_TYPE_META:
+      theme = (MateThemeCommonInfo *) mate_theme_meta_info_find (name);
+      theme_dir = g_path_get_dirname (theme->path);
+      del_empty_parent = FALSE;
+      break;
+
+    case THEME_TYPE_CURSOR:
+      theme = (MateThemeCommonInfo *) mate_theme_cursor_info_find (name);
+      theme_dir = g_build_filename (theme->path, "cursors", NULL);
+      break;
+
+    default:
+      return FALSE;
+  }
+
+  dir = g_file_new_for_path (theme_dir);
+  g_free (theme_dir);
+
+  if (!capplet_file_delete_recursive (dir, NULL)) {
+    GtkWidget *info_dialog = gtk_message_dialog_new (NULL,
+						     GTK_DIALOG_MODAL,
+						     GTK_MESSAGE_ERROR,
+						     GTK_BUTTONS_OK,
+						     _("Theme cannot be deleted"));
+    gtk_dialog_run (GTK_DIALOG (info_dialog));
+    gtk_widget_destroy (info_dialog);
+    rc = FALSE;
+  } else {
+    if (del_empty_parent) {
+      /* also delete empty parent directories */
+      GFile *parent = g_file_get_parent (dir);
+      g_file_delete (parent, NULL, NULL);
+      g_object_unref (parent);
+    }
+    rc = TRUE;
+  }
+
+  g_object_unref (dir);
+  return rc;
+}
+
+gboolean theme_model_iter_last (GtkTreeModel *model, GtkTreeIter *iter)
+{
+  GtkTreeIter walk, prev;
+  gboolean valid;
+
+  valid = gtk_tree_model_get_iter_first (model, &walk);
+
+  if (valid) {
+    do {
+      prev = walk;
+      valid = gtk_tree_model_iter_next (model, &walk);
+    } while (valid);
+
+    *iter = prev;
+    return TRUE;
+  }
+  return FALSE;
+}
+
+gboolean theme_find_in_model (GtkTreeModel *model, const gchar *name, GtkTreeIter *iter)
+{
+  GtkTreeIter walk;
+  gboolean valid;
+  gchar *test;
+
+  if (!name)
+    return FALSE;
+
+  for (valid = gtk_tree_model_get_iter_first (model, &walk); valid;
+       valid = gtk_tree_model_iter_next (model, &walk))
+  {
+    gtk_tree_model_get (model, &walk, COL_NAME, &test, -1);
+
+    if (test) {
+      gint cmp = strcmp (test, name);
+      g_free (test);
+
+      if (!cmp) {
+      	if (iter)
+          *iter = walk;
+        return TRUE;
+      }
+    }
+  }
+
+  return FALSE;
+}
+
+gboolean packagekit_available (void)
+{
+  GDBusConnection *connection;
+  GDBusProxy *proxy;
+  gboolean available = FALSE;
+  GError   *error = NULL;
+  GVariant *variant;
+
+  connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
+  if (connection == NULL) {
+    return FALSE;
+  }
+
+  proxy = g_dbus_proxy_new_sync (connection,
+                                 G_DBUS_PROXY_FLAGS_NONE,
+                                 NULL,
+                                 "org.freedesktop.DBus",
+                                 "/org/freedesktop/DBus",
+                                 "org.freedesktop.DBus",
+                                 NULL,
+                                 NULL);
+  if (proxy == NULL) {
+    g_object_unref (connection);
+    return FALSE;
+  }
+
+  variant = g_dbus_proxy_call_sync (proxy, "NameHasOwner",
+                                    g_variant_new ("(s)", "org.freedesktop.PackageKit"),
+                                    G_DBUS_CALL_FLAGS_NONE,
+                                    -1,
+                                    NULL,
+                                    &error);
+  if (variant == NULL) {
+    g_warning ("Could not ask org.freedesktop.DBus if PackageKit is available: %s",
+               error->message);
+    g_error_free (error);
+    g_object_unref (proxy);
+    g_object_unref (connection);
+
+    return FALSE;
+  } else {
+    g_variant_get (variant, "(b)", &available);
+    g_variant_unref (variant);
+  }
+
+  g_object_unref (proxy);
+  g_object_unref (connection);
+
+  return available;
+}
+
+void theme_install_file(GtkWindow* parent, const gchar* path)
+{
+  GDBusConnection *connection;
+  GDBusProxy *proxy;
+  GError* error = NULL;
+  GVariant *variant;
+
+  connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
+
+  if (connection == NULL)
+  {
+    g_warning("Could not get session bus: %s", error->message);
+    g_error_free (error);
+    return;
+  }
+
+  proxy = g_dbus_proxy_new_sync (connection,
+                                 G_DBUS_PROXY_FLAGS_NONE,
+                                 NULL,
+                                 "org.freedesktop.PackageKit",
+                                 "/org/freedesktop/PackageKit",
+                                 "org.freedesktop.PackageKit",
+                                 NULL,
+                                 &error);
+  if (proxy == NULL) {
+    g_warning ("Failed to connect to PackageKit: %s\n", error->message);
+    g_error_free (error);
+    g_object_unref (connection);
+    return;
+  }
+
+  variant = g_dbus_proxy_call_sync (proxy, "InstallProvideFile",
+                                    g_variant_new ("(s)", path),
+                                    G_DBUS_CALL_FLAGS_NONE,
+                                    -1,
+                                    NULL,
+                                    &error);
+
+  if (variant == NULL) {
+    GtkWidget* dialog = gtk_message_dialog_new(NULL,
+                                               GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+                                               GTK_MESSAGE_ERROR,
+                                               GTK_BUTTONS_OK,
+                                               _("Could not install theme engine"));
+    gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG (dialog), "%s", error->message);
+
+    gtk_dialog_run(GTK_DIALOG(dialog));
+    gtk_widget_destroy(dialog);
+    g_error_free(error);
+  } else {
+    g_variant_unref (variant);
+  }
+
+  g_object_unref(proxy);
+  g_object_unref (connection);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/28.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/28.html new file mode 100644 index 00000000..997e9cf2 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/28.html @@ -0,0 +1,363 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
#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 <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 <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "activate-settings-daemon.h"
+
+static void popup_error_message (void)
+{
+  GtkWidget *dialog;
+
+  dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_WARNING,
+				   GTK_BUTTONS_OK, _("Unable to start the settings manager 'mate-settings-daemon'.\n"
+				   "Without the MATE settings manager running, some preferences may not take effect. This could "
+				   "indicate a problem with DBus, or a non-MATE (e.g. KDE) settings manager may already "
+				   "be active and conflicting with the MATE settings manager."));
+
+  gtk_dialog_run (GTK_DIALOG (dialog));
+  gtk_widget_destroy (dialog);
+}
+
+/* Returns FALSE if activation failed, else TRUE */
+gboolean
+activate_settings_daemon (void)
+{
+  GError     *error = NULL;
+  GDBusProxy *proxy = NULL;
+  GVariant *ret;
+
+  proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
+                                         G_DBUS_PROXY_FLAGS_NONE,
+                                         NULL,
+                                         "org.mate.SettingsDaemon",
+                                         "/org/mate/SettingsDaemon",
+                                         "org.mate.SettingsDaemon",
+                                         NULL,
+                                         &error);
+  if (proxy == NULL) {
+    popup_error_message ();
+    g_error_free (error);
+    return FALSE;
+  }
+
+  ret = g_dbus_proxy_call_sync (proxy,
+                                "Awake",
+                                g_variant_new ("()"),
+                                G_DBUS_CALL_FLAGS_NONE,
+                                -1,
+                                NULL,
+                                &error);
+  if (ret == NULL) {
+    popup_error_message ();
+    g_error_free (error);
+    return FALSE;
+  } else {
+    g_variant_get (ret, "()");
+    g_variant_unref (ret);
+  }
+
+  return TRUE;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/29.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/29.html new file mode 100644 index 00000000..1b950cd7 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/29.html @@ -0,0 +1,255 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
1
+2
+3
+4
+5
+6
+7
+8
+9
#ifndef ACTIVATE_SETINGS_DAEMON
+#define ACTIVATE_SETINGS_DAEMON
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+/* Returns FALSE if activation failed, else TRUE */
+gboolean activate_settings_daemon (void);
+
+#endif
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/3.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/3.html new file mode 100644 index 00000000..743803c3 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/3.html @@ -0,0 +1,2837 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
   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
/* mate-about-me.c
+ * Copyright (C) 2002 Diego Gonzalez
+ * Copyright (C) 2006 Johannes H. Jensen
+ *
+ * Written by: Diego Gonzalez <diego@pemas.net>
+ * Modified by: Johannes H. Jensen <joh@deworks.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, 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.
+ *
+ * Parts of this code come from Mate-System-Tools.
+ */
+
+#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
+
+/* Are all of these needed? */
+#include <gdk/gdkkeysyms.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <pwd.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 <unistd.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#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 <sys/wait.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#ifdef __sun
+#include <sys/types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <signal.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+#include "mate-about-me-password.h"
+
+/* Passwd states */
+typedef enum {
+	PASSWD_STATE_NONE,		/* Passwd is not asking for anything */
+	PASSWD_STATE_AUTH,		/* Passwd is asking for our current password */
+	PASSWD_STATE_NEW,		/* Passwd is asking for our new password */
+	PASSWD_STATE_RETYPE,	/* Passwd is asking for our retyped new password */
+	PASSWD_STATE_ERR		/* Passwd reported an error but has not yet exited */
+} PasswdState;
+
+typedef struct {
+	GtkBuilder  *ui;
+
+	/* Commonly used widgets */
+	GtkEntry *current_password;
+	GtkEntry *new_password;
+	GtkEntry *retyped_password;
+	GtkImage *dialog_image;
+	GtkLabel *status_label;
+
+	/* We need to save message from libpwquality globaly */
+	gchar *ext_msg;
+
+	/* Whether we have authenticated */
+	gboolean authenticated;
+
+	/* Communication with the passwd program */
+	GPid backend_pid;
+
+	GIOChannel *backend_stdin;
+	GIOChannel *backend_stdout;
+	GIOChannel *backend_stderr;
+
+	GQueue *backend_stdin_queue;		/* Write queue to backend_stdin */
+
+	/* GMainLoop IDs */
+	guint backend_child_watch_id;		/* g_child_watch_add (PID) */
+	guint backend_stdout_watch_id;		/* g_io_add_watch (stdout) */
+	guint backend_stderr_watch_id;		/* g_io_add_watch (stderr) */
+
+	/* State of the passwd program */
+	PasswdState backend_state;
+
+} PasswordDialog;
+
+/* Buffer size for backend output (64 is too small to store message from libpwquality)*/
+#define BUFSIZE 128
+
+/*
+ * Error handling {{
+ */
+#define PASSDLG_ERROR (mate_about_me_password_error_quark())
+
+static GQuark mate_about_me_password_error_quark(void)
+{
+	static GQuark q = 0;
+
+	if (q == 0) {
+		q = g_quark_from_static_string("mate_about_me_password_error");
+	}
+
+	return q;
+}
+
+/* error codes */
+enum {
+	PASSDLG_ERROR_NONE,
+	PASSDLG_ERROR_NEW_PASSWORD_EMPTY,
+	PASSDLG_ERROR_RETYPED_PASSWORD_EMPTY,
+	PASSDLG_ERROR_PASSWORDS_NOT_EQUAL,
+	PASSDLG_ERROR_BACKEND,	/* Backend error */
+	PASSDLG_ERROR_USER,		/* Generic user error */
+	PASSDLG_ERROR_FAILED	/* Fatal failure, error->message should explain */
+};
+
+/*
+ * }} Error handling
+ */
+
+/*
+ * Prototypes {{
+ */
+static void
+stop_passwd (PasswordDialog *pdialog);
+
+static void
+free_passwd_resources (PasswordDialog *pdialog);
+
+static gboolean
+io_watch_stdout (GIOChannel *source, GIOCondition condition, PasswordDialog *pdialog);
+
+static void
+passdlg_set_auth_state (PasswordDialog *pdialog, gboolean state);
+
+static void
+passdlg_set_status (PasswordDialog *pdialog, gchar *msg);
+
+static void
+passdlg_set_busy (PasswordDialog *pdialog, gboolean busy);
+
+static void
+passdlg_clear (PasswordDialog *pdialog);
+
+static guint
+passdlg_refresh_password_state (PasswordDialog *pdialog);
+
+/*
+ * }} Prototypes
+ */
+
+/*
+ * Spawning and closing of backend {{
+ */
+
+/* Child watcher */
+static void
+child_watch_cb (GPid pid, gint status, PasswordDialog *pdialog)
+{
+	if (WIFEXITED (status)) {
+		if (WEXITSTATUS (status) >= 255) {
+			g_warning (_("Child exited unexpectedly"));
+		}
+	}
+
+	free_passwd_resources (pdialog);
+}
+
+/* Spawn passwd backend
+ * Returns: TRUE on success, FALSE otherwise and sets error appropriately */
+static gboolean
+spawn_passwd (PasswordDialog *pdialog, GError **error)
+{
+	gchar	*argv[2];
+	gchar	*envp[1];
+	gint	my_stdin, my_stdout, my_stderr;
+
+	argv[0] = "/usr/bin/passwd";	/* Is it safe to rely on a hard-coded path? */
+	argv[1] = NULL;
+
+	envp[0] = NULL;		/* If we pass an empty array as the environment,
+				 * will the childs environment be empty, and the
+				 * locales set to the C default? From the manual:
+				 * "If envp is NULL, the child inherits its
+				 * parent'senvironment."
+				 * If I'm wrong here, we somehow have to set
+				 * the locales here.
+				 */
+
+	if (!g_spawn_async_with_pipes (NULL,				/* Working directory */
+				       argv,				/* Argument vector */
+				       envp,				/* Environment */
+				       G_SPAWN_DO_NOT_REAP_CHILD,	/* Flags */
+				       NULL,				/* Child setup */
+				       NULL,				/* Data to child setup */
+				       &pdialog->backend_pid,		/* PID */
+				       &my_stdin,			/* Stdin */
+				       &my_stdout,			/* Stdout */
+				       &my_stderr,			/* Stderr */
+				       error)) {			/* GError */
+
+		/* An error occurred */
+		free_passwd_resources (pdialog);
+
+		return FALSE;
+	}
+
+	/* Initialize ext_msg with NULL */
+	pdialog->ext_msg = NULL;
+
+	/* Open IO Channels */
+	pdialog->backend_stdin = g_io_channel_unix_new (my_stdin);
+	pdialog->backend_stdout = g_io_channel_unix_new (my_stdout);
+	pdialog->backend_stderr = g_io_channel_unix_new (my_stderr);
+	
+	/* Set raw encoding */
+	/* Set nonblocking mode */
+	if (g_io_channel_set_encoding (pdialog->backend_stdin, NULL, error) != G_IO_STATUS_NORMAL ||
+		g_io_channel_set_encoding (pdialog->backend_stdout, NULL, error) != G_IO_STATUS_NORMAL ||
+		g_io_channel_set_encoding (pdialog->backend_stderr, NULL, error) != G_IO_STATUS_NORMAL ||
+		g_io_channel_set_flags (pdialog->backend_stdin, G_IO_FLAG_NONBLOCK, error) != G_IO_STATUS_NORMAL ||
+		g_io_channel_set_flags (pdialog->backend_stdout, G_IO_FLAG_NONBLOCK, error) != G_IO_STATUS_NORMAL ||
+		g_io_channel_set_flags (pdialog->backend_stderr, G_IO_FLAG_NONBLOCK, error) != G_IO_STATUS_NORMAL) {
+
+		/* Clean up */
+		stop_passwd (pdialog);
+		return FALSE;
+	}
+
+	/* Turn off buffering */
+	g_io_channel_set_buffered (pdialog->backend_stdin, FALSE);
+	g_io_channel_set_buffered (pdialog->backend_stdout, FALSE);
+	g_io_channel_set_buffered (pdialog->backend_stderr, FALSE);
+
+	/* Add IO Channel watcher */
+	pdialog->backend_stdout_watch_id = g_io_add_watch (pdialog->backend_stdout,
+							   G_IO_IN | G_IO_PRI,
+							   (GIOFunc) io_watch_stdout, pdialog);
+	pdialog->backend_stderr_watch_id = g_io_add_watch (pdialog->backend_stderr,
+							   G_IO_IN | G_IO_PRI,
+							   (GIOFunc) io_watch_stdout, pdialog);
+
+	/* Add child watcher */
+	pdialog->backend_child_watch_id = g_child_watch_add (pdialog->backend_pid, (GChildWatchFunc) child_watch_cb, pdialog);
+
+	/* Success! */
+
+	return TRUE;
+}
+
+/* Stop passwd backend */
+static void
+stop_passwd (PasswordDialog *pdialog)
+{
+	/* This is the standard way of returning from the dialog with passwd.
+	 * If we return this way we can safely kill passwd as it has completed
+	 * its task.
+	 */
+
+	if (pdialog->backend_pid != -1) {
+		kill (pdialog->backend_pid, 9);
+	}
+
+	/* We must run free_passwd_resources here and not let our child
+	 * watcher do it, since it will access invalid memory after the
+	 * dialog has been closed and cleaned up.
+	 *
+	 * If we had more than a single thread we'd need to remove
+	 * the child watch before trying to kill the child.
+	 */
+	free_passwd_resources (pdialog);
+}
+
+/* Clean up passwd resources */
+static void
+free_passwd_resources (PasswordDialog *pdialog)
+{
+	GError	*error = NULL;
+
+	/* Remove the child watcher */
+	if (pdialog->backend_child_watch_id != 0) {
+
+		g_source_remove (pdialog->backend_child_watch_id);
+
+		pdialog->backend_child_watch_id = 0;
+	}
+
+	/* Close IO channels (internal file descriptors are automatically closed) */
+	if (pdialog->backend_stdin != NULL) {
+
+		if (g_io_channel_shutdown (pdialog->backend_stdin, TRUE, &error) != G_IO_STATUS_NORMAL) {
+			g_warning (_("Could not shutdown backend_stdin IO channel: %s"), error->message);
+			g_error_free (error);
+			error = NULL;
+		}
+
+		g_io_channel_unref (pdialog->backend_stdin);
+
+		pdialog->backend_stdin = NULL;
+	}
+
+	if (pdialog->backend_stdout != NULL) {
+
+		if (g_io_channel_shutdown (pdialog->backend_stdout, TRUE, &error) != G_IO_STATUS_NORMAL) {
+			g_warning (_("Could not shutdown backend_stdout IO channel: %s"), error->message);
+			g_error_free (error);
+			error = NULL;
+		}
+
+		g_io_channel_unref (pdialog->backend_stdout);
+
+		pdialog->backend_stdout = NULL;
+	}
+
+	if (pdialog->backend_stderr != NULL) {
+
+		if (g_io_channel_shutdown (pdialog->backend_stderr, TRUE, &error) != G_IO_STATUS_NORMAL) {
+			g_warning (_("Could not shutdown backend_stderr IO channel: %s"), error->message);
+			g_error_free (error);
+			error = NULL;
+		}
+
+		g_io_channel_unref (pdialog->backend_stderr);
+
+		pdialog->backend_stderr = NULL;
+	}
+
+	/* Remove IO watcher */
+	if (pdialog->backend_stdout_watch_id != 0) {
+
+		g_source_remove (pdialog->backend_stdout_watch_id);
+
+		pdialog->backend_stdout_watch_id = 0;
+	}
+
+	if (pdialog->backend_stderr_watch_id != 0) {
+
+		g_source_remove (pdialog->backend_stderr_watch_id);
+
+		pdialog->backend_stderr_watch_id = 0;
+	}
+
+	/* Close PID */
+	if (pdialog->backend_pid != -1) {
+
+		g_spawn_close_pid (pdialog->backend_pid);
+
+		pdialog->backend_pid = -1;
+	}
+
+	/* Clear backend state */
+	pdialog->backend_state = PASSWD_STATE_NONE;
+}
+
+/*
+ * }} Spawning and closing of backend
+ */
+
+/*
+ * Backend communication code {{
+ */
+
+/* Write the first element of queue through channel */
+static void
+io_queue_pop (GQueue *queue, GIOChannel *channel)
+{
+	gchar	*buf;
+	gsize	bytes_written;
+	GError	*error = NULL;
+
+	buf = g_queue_pop_head (queue);
+
+	if (buf != NULL) {
+		if (g_io_channel_write_chars (channel, buf, -1, &bytes_written, &error) != G_IO_STATUS_NORMAL) {
+			g_warning ("Could not write queue element \"%s\" to channel: %s", buf, error->message);
+			g_error_free (error);
+		}
+
+		g_free (buf);
+	}
+}
+
+/* Goes through the argument list, checking if one of them occurs in str
+ * Returns: TRUE as soon as an element is found to match, FALSE otherwise */
+static gboolean
+is_string_complete (gchar *str, ...)
+{
+	va_list	ap;
+	gchar	*arg;
+
+	if (strlen (str) == 0) {
+		return FALSE;
+	}
+
+	va_start (ap, str);
+
+	while ((arg = va_arg (ap, char *)) != NULL) {
+		if (g_strrstr (str, arg) != NULL) {
+			va_end (ap);
+			return TRUE;
+		}
+	}
+
+	va_end (ap);
+
+	return FALSE;
+}
+
+/* Authentication attempt succeeded. Update the GUI accordingly. */
+static void
+authenticated_user (PasswordDialog *pdialog, gboolean retry)
+{
+	pdialog->backend_state = PASSWD_STATE_NEW;
+
+	if (pdialog->authenticated) {
+		/* This is a re-authentication
+		 * It succeeded, so pop our new password from the queue */
+		io_queue_pop (pdialog->backend_stdin_queue, pdialog->backend_stdin);
+	}
+
+	/* Update UI state */
+	passdlg_set_auth_state (pdialog, TRUE);
+	if (!retry) {
+		passdlg_set_status (pdialog, _("Authenticated!"));
+	}
+
+	/* Check to see if the passwords are valid
+	 * (They might be non-empty if the user had to re-authenticate,
+	 *  and thus we need to enable the change-password-button) */
+	passdlg_refresh_password_state (pdialog);
+}
+
+/*
+ * IO watcher for stdout, called whenever there is data to read from the backend.
+ * This is where most of the actual IO handling happens.
+ */
+static gboolean
+io_watch_stdout (GIOChannel *source, GIOCondition condition, PasswordDialog *pdialog)
+{
+	static GString *str = NULL;		/* Persistent buffer */
+
+	gchar		buf[BUFSIZE];		/* Temporary buffer */
+	gsize		bytes_read;
+	GError		*error = NULL;
+
+	gchar		*msg = NULL;		/* Status error message */
+
+	gboolean	reinit = FALSE;
+
+	/* Initialize buffer */
+	if (str == NULL) {
+		str = g_string_new ("");
+	}
+
+	if (g_io_channel_read_chars (source, buf, BUFSIZE, &bytes_read, &error) != G_IO_STATUS_NORMAL) {
+		if (error) {
+			g_warning ("IO Channel read error: %s", error->message);
+			g_error_free (error);
+		}
+
+		return TRUE;
+	}
+
+	str = g_string_append_len (str, buf, bytes_read);
+	/* In which state is the backend? */
+	switch (pdialog->backend_state) {
+		case PASSWD_STATE_AUTH:
+			/* Passwd is asking for our current password */
+			if (is_string_complete (str->str, "assword: ", "failure", "wrong", "error", NULL)) {
+				/* Which response did we get? */
+				passdlg_set_busy (pdialog, FALSE);
+
+				if (g_strrstr (str->str, "New password: ") != NULL) {
+					/* Authentication successful */
+
+					authenticated_user (pdialog, FALSE);
+
+				} else {
+					/* Authentication failed */
+					if (pdialog->authenticated) {
+						/* This is a re-auth, and it failed.
+						 * The password must have been changed in the meantime!
+						 * Ask the user to re-authenticate
+						 */
+
+						/* Update status message and auth state */
+						passdlg_set_status (pdialog, _("Your password has been changed since you initially authenticated! Please re-authenticate."));
+					} else {
+						passdlg_set_status (pdialog, _("That password was incorrect."));
+					}
+
+					/* Focus current password */
+					gtk_widget_grab_focus (GTK_WIDGET (pdialog->current_password));
+				}
+
+				reinit = TRUE;
+			}
+			break;
+		case PASSWD_STATE_NEW:
+			/* Passwd is asking for our new password */
+			if (is_string_complete (str->str, " new password: ", NULL)) {
+				/* Pop retyped password from queue and into IO channel */
+				io_queue_pop (pdialog->backend_stdin_queue, pdialog->backend_stdin);
+				reinit = TRUE;
+				
+			} else if (is_string_complete (str->str, "New password: ", NULL)) {
+				authenticated_user(pdialog, TRUE);
+				reinit = TRUE;
+			}
+			/* Advance to next state */
+			pdialog->backend_state = PASSWD_STATE_RETYPE;
+			break;
+		case PASSWD_STATE_RETYPE:
+			/* Passwd is asking for our retyped new password */
+			if (is_string_complete (str->str, "successfully",
+							  "short",
+							  "longer",
+							  "palindrome",
+							  "dictionary",
+							  "simpl", /* catches both simple and simplistic */
+							  "similar",
+							  "different",
+							  "case",
+							  "wrapped",
+							  "recovered",
+							  "recent",
+							  "unchanged",
+							  "match",
+							  "1 numeric or special",
+							  "failure",
+							  "rotated",
+							  "error",
+							  "BAD PASSWORD",
+							  NULL)) {
+
+				/* What response did we get? */
+				passdlg_set_busy (pdialog, FALSE);
+
+				if (g_strrstr (str->str, "successfully") != NULL) {
+					/* Hooray! */
+
+					passdlg_clear (pdialog);
+					passdlg_set_status (pdialog, _("Your password has been changed."));
+				} else {
+					/* Ohnoes! */
+
+					/* Focus new password */
+					gtk_widget_grab_focus (GTK_WIDGET (pdialog->new_password));
+
+					if (g_strrstr (str->str, "recovered") != NULL) {
+						/* What does this indicate?
+						 * "Authentication information cannot be recovered?" from libpam? */
+						msg = g_strdup_printf (_("System error: %s."), str->str);
+					} else if (g_strrstr (str->str, "short") != NULL ||
+						   g_strrstr (str->str, "longer") != NULL) {
+						msg = g_strdup (_("The password is too short."));
+					} else if (g_strrstr (str->str, "palindrome") != NULL ||
+						   g_strrstr (str->str, "simpl") != NULL ||
+						   g_strrstr (str->str, "dictionary") != NULL) {
+						msg = g_strdup (_("The password is too simple."));
+					} else if (g_strrstr (str->str, "similar") != NULL ||
+					           g_strrstr (str->str, "different") != NULL ||
+					           g_strrstr (str->str, "case") != NULL ||
+						   g_strrstr (str->str, "wrapped") != NULL) {
+						msg = g_strdup (_("The old and new passwords are too similar."));
+					} else if (g_strrstr (str->str, "1 numeric or special") != NULL) {
+						msg = g_strdup (_("The new password must contain numeric or special character(s)."));
+					} else if (g_strrstr (str->str, "unchanged") != NULL ||
+						   g_strrstr (str->str, "match") != NULL) {
+						msg = g_strdup (_("The old and new passwords are the same."));
+					} else if (g_strrstr (str->str, "recent") != NULL) {
+						msg = g_strdup (_("The new password has already been used recently."));
+					} else if (g_strrstr (str->str, "failure") != NULL) {
+						/* Authentication failure */
+						msg = g_strdup (_("Your password has been changed since you initially authenticated! Please re-authenticate."));
+
+						passdlg_set_auth_state (pdialog, FALSE);
+					} else if (g_strrstr (str->str, "BAD PASSWORD") != NULL) {
+						/* Actual error description from libpwquality is located in the first string */
+						msg = g_strdup("Password hasn't changed!");
+						pdialog->ext_msg = g_strdup(g_strsplit(str->str, "\n", 2)[0]);
+						stop_passwd(pdialog);
+					}
+				}
+				/* child_watch_cb should clean up for us now */
+			}
+			reinit = TRUE;
+				if (msg != NULL) {
+					/* An error occurred! */
+					passdlg_clear(pdialog);
+					passdlg_set_status (pdialog, msg);
+
+					/* At this point, passwd might have exited, in which case
+					 * child_watch_cb should clean up for us and remove this watcher.
+					 * On some error conditions though, passwd just re-prompts us
+					 * for our new password. */
+					if (pdialog->ext_msg != NULL) {
+						passdlg_clear(pdialog);
+						passdlg_set_status (pdialog, g_strconcat(msg, "\n", pdialog->ext_msg, NULL));
+						g_free (pdialog->ext_msg);
+					}
+					pdialog->backend_state = PASSWD_STATE_ERR;
+					/* Clean backen_stdin_queue if error occured */
+#if GLIB_CHECK_VERSION(2, 60, 0)
+					g_queue_clear_full (pdialog->backend_stdin_queue, g_free);
+#else
+					/* TODO: Remove this if/when GLib compatibility gets dropped. */
+					g_queue_foreach (pdialog->backend_stdin_queue, (GFunc) g_free, NULL);
+					g_queue_clear (pdialog->backend_stdin_queue);
+#endif
+					g_free (msg);
+				}
+			break;
+		case PASSWD_STATE_NONE:
+			/* Passwd is not asking for anything yet */
+			if (is_string_complete (str->str, "assword: ", NULL)) {
+
+				/* If the user does not have a password set,
+				 * passwd will immediately ask for the new password,
+				 * so skip the AUTH phase */
+				if (is_string_complete (str->str, "new", "New", NULL)) {
+					gchar *pw;
+
+					pdialog->backend_state = PASSWD_STATE_NEW;
+
+					passdlg_set_busy (pdialog, FALSE);
+					authenticated_user (pdialog, FALSE);
+
+					/* since passwd didn't ask for our old password
+					 * in this case, simply remove it from the queue */
+					pw = g_queue_pop_head (pdialog->backend_stdin_queue);
+					g_free (pw);
+				} else {
+
+					pdialog->backend_state = PASSWD_STATE_AUTH;
+
+					/* Pop the IO queue, i.e. send current password */
+					io_queue_pop (pdialog->backend_stdin_queue, pdialog->backend_stdin);
+				}
+
+				reinit = TRUE;
+			}
+			break;
+		default:
+			/* Passwd has returned an error */
+			reinit = TRUE;
+			break;
+	}
+
+	if (reinit) {
+		g_string_free (str, TRUE);
+		str = NULL;
+	}
+
+	/* Continue calling us */
+	return TRUE;
+}
+
+/*
+ * }} Backend communication code
+ */
+
+/* Adds the current password to the IO queue */
+static void
+authenticate (PasswordDialog *pdialog)
+{
+	gchar	*s;
+
+	s = g_strdup_printf ("%s\n", gtk_entry_get_text (pdialog->current_password));
+
+	g_queue_push_tail (pdialog->backend_stdin_queue, s);
+}
+
+/* Adds the new password twice to the IO queue */
+static void
+update_password (PasswordDialog *pdialog)
+{
+	gchar	*s;
+
+	s = g_strdup_printf ("%s\n", gtk_entry_get_text (pdialog->new_password));
+
+	g_queue_push_tail (pdialog->backend_stdin_queue, s);
+	/* We need to allocate new space because io_queue_pop() g_free()s
+	 * every element of the queue after it's done */
+	g_queue_push_tail (pdialog->backend_stdin_queue, g_strdup (s));
+}
+
+/* Sets dialog busy state according to busy
+ *
+ * When busy:
+ *	Sets the cursor to busy
+ *  Disables the interface to prevent that the user interferes
+ * Reverts all this when non-busy
+ *
+ * Note that this function takes into account the
+ * authentication state of the dialog. So setting the
+ * dialog to busy and then back to normal should leave
+ * the dialog unchanged.
+ */
+static void
+passdlg_set_busy (PasswordDialog *pdialog, gboolean busy)
+{
+	GtkBuilder *dialog;<--- Variable 'dialog' can be declared as pointer to const
+	GtkWidget  *toplevel;
+	GdkCursor  *cursor = NULL;
+	GdkDisplay *display;
+
+	dialog = pdialog->ui;<--- Variable 'dialog' is assigned a value that is never used.
+
+	/* Set cursor */
+	toplevel = WID ("change-password");
+	display = gtk_widget_get_display (toplevel);
+	if (busy) {
+		cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
+	}
+
+	gdk_window_set_cursor (gtk_widget_get_window (toplevel), cursor);
+	gdk_display_flush (display);
+
+	if (busy) {
+		g_object_unref (cursor);
+	}
+
+	/* Disable/Enable UI */
+	if (pdialog->authenticated) {
+		/* Authenticated state */
+
+		/* Enable/disable new password section */
+		g_object_set (pdialog->new_password, "sensitive", !busy, NULL);
+		g_object_set (pdialog->retyped_password, "sensitive", !busy, NULL);
+		g_object_set (WID ("new-password-label"), "sensitive", !busy, NULL);
+		g_object_set (WID ("retyped-password-label"), "sensitive", !busy, NULL);
+
+		/* Enable/disable change password button */
+		g_object_set (WID ("change-password-button"), "sensitive", !busy, NULL);
+
+	} else {
+		/* Not-authenticated state */
+
+		/* Enable/disable auth section state */
+		g_object_set (pdialog->current_password, "sensitive", !busy, NULL);
+		g_object_set (WID ("authenticate-button"), "sensitive", !busy, NULL);
+		g_object_set (WID ("current-password-label"), "sensitive", !busy, NULL);
+	}
+}
+
+/* Launch an error dialog */
+static void
+passdlg_error_dialog (GtkWindow *parent, const gchar *title,
+		      const gchar *msg, const gchar *details)
+{
+	GtkWidget *dialog;
+
+	dialog = gtk_message_dialog_new (parent, GTK_DIALOG_MODAL,
+					 GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
+					 "%s", msg);
+	if (title)
+		gtk_window_set_title (GTK_WINDOW (dialog), title);
+
+	if (details)
+		gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+							  "%s", details);
+	gtk_dialog_run (GTK_DIALOG (dialog));
+	gtk_widget_destroy (dialog);
+}
+
+/* Set authenticated state of dialog according to state
+ *
+ * When in authenticated state:
+ * 	Disables authentication-part of interface
+ *  Enables new-password-part of interface
+ * When in not-authenticated state:
+ * 	Enables authentication-part of interface
+ *  Disables new-password-part of interface
+ * 	Disables the change-password-button
+ */
+static void
+passdlg_set_auth_state (PasswordDialog *pdialog, gboolean state)
+{
+	GtkBuilder *dialog;<--- Variable 'dialog' can be declared as pointer to const
+
+	dialog = pdialog->ui;<--- Variable 'dialog' is assigned a value that is never used.
+
+	/* Widgets which require a not-authenticated state to be accessible */
+	g_object_set (pdialog->current_password, "sensitive", !state, NULL);
+	g_object_set (WID ("current-password-label"), "sensitive", !state, NULL);
+	g_object_set (WID ("authenticate-button"), "sensitive", !state, NULL);
+
+	/* Widgets which require authentication to be accessible */
+	g_object_set (pdialog->new_password, "sensitive", state, NULL);
+	g_object_set (pdialog->retyped_password, "sensitive", state, NULL);
+	g_object_set (WID ("new-password-label"), "sensitive", state, NULL);
+	g_object_set (WID ("retyped-password-label"), "sensitive", state, NULL);
+
+	if (!state) {
+		/* Disable change-password-button when in not-authenticated state */
+		g_object_set (WID ("change-password-button"), "sensitive", FALSE, NULL);
+	}
+
+	pdialog->authenticated = state;
+
+	if (state) {
+		/* Authenticated state */
+
+		/* Focus new password */
+		gtk_widget_grab_focus (GTK_WIDGET (pdialog->new_password));
+
+		/* Set open lock image */
+		gtk_image_set_from_icon_name (GTK_IMAGE (pdialog->dialog_image), "changes-allow", GTK_ICON_SIZE_DIALOG);
+	} else {
+		/* Not authenticated state */
+
+		/* Focus current password */
+		gtk_widget_grab_focus (GTK_WIDGET (pdialog->current_password));
+
+		/* Set closed lock image */
+		gtk_image_set_from_icon_name (GTK_IMAGE (pdialog->dialog_image), "changes-prevent", GTK_ICON_SIZE_DIALOG);
+	}
+}
+
+/* Set status field message */
+static void
+passdlg_set_status (PasswordDialog *pdialog, gchar *msg)
+{
+	g_object_set (pdialog->status_label, "label", msg, NULL);
+}
+
+/* Clear dialog (except the status message) */
+static void
+passdlg_clear (PasswordDialog *pdialog)
+{
+	/* Set non-authenticated state */
+	passdlg_set_auth_state (pdialog, FALSE);
+
+	/* Clear password entries */
+	gtk_entry_set_text (pdialog->current_password, "");
+	gtk_entry_set_text (pdialog->new_password, "");
+	gtk_entry_set_text (pdialog->retyped_password, "");
+}
+
+/* Start backend and handle errors
+ * If backend is already running, stop it
+ * If an error occurs, show error dialog */
+static gboolean
+passdlg_spawn_passwd (PasswordDialog *pdialog)
+{
+	GError	*error = NULL;
+	gchar	*details;
+
+	/* If backend is running, stop it */
+	stop_passwd (pdialog);
+
+	/* Spawn backend */
+	if (!spawn_passwd (pdialog, &error)) {
+		GtkWidget *parent = GTK_WIDGET (gtk_builder_get_object (pdialog->ui, "change-password"));
+
+		/* translators: Unable to launch <program>: <error message> */
+		details = g_strdup_printf (_("Unable to launch %s: %s"),
+					   "/usr/bin/passwd", error->message);
+
+		passdlg_error_dialog (GTK_WINDOW (parent),
+				      _("Unable to launch backend"),
+				      _("A system error has occurred"),
+				      details);
+
+		g_free (details);
+		g_error_free (error);
+
+		return FALSE;
+	}
+
+	return TRUE;
+}
+
+/* Called when the "Authenticate" button is clicked */
+static void
+passdlg_authenticate (GtkButton *button, PasswordDialog *pdialog)
+{
+	/* Set busy as this can be a long process */
+	passdlg_set_busy (pdialog, TRUE);
+
+	/* Update status message */
+	passdlg_set_status (pdialog, _("Checking password..."));
+
+	/* Spawn backend */
+	if (!passdlg_spawn_passwd (pdialog)) {
+		passdlg_set_busy (pdialog, FALSE);
+		return;
+	}
+
+	authenticate (pdialog);
+
+	/* Our IO watcher should now handle the rest */
+}
+
+/* Validate passwords
+ * Returns:
+ * PASSDLG_ERROR_NONE (0) if passwords are valid
+ * PASSDLG_ERROR_NEW_PASSWORD_EMPTY
+ * PASSDLG_ERROR_RETYPED_PASSWORD_EMPTY
+ * PASSDLG_ERROR_PASSWORDS_NOT_EQUAL
+ */
+static guint
+passdlg_validate_passwords (PasswordDialog *pdialog)
+{
+	const gchar	*new_password, *retyped_password;
+	glong			nlen, rlen;
+
+	new_password = gtk_entry_get_text (pdialog->new_password);
+	retyped_password = gtk_entry_get_text (pdialog->retyped_password);
+
+	nlen = g_utf8_strlen (new_password, -1);
+	rlen = g_utf8_strlen (retyped_password, -1);
+
+	if (nlen == 0) {
+		/* New password empty */
+		return PASSDLG_ERROR_NEW_PASSWORD_EMPTY;
+	}
+
+	if (rlen == 0) {
+		/* Retyped password empty */
+		return PASSDLG_ERROR_RETYPED_PASSWORD_EMPTY;
+	}
+
+	if (nlen != rlen || strncmp (new_password, retyped_password, nlen) != 0) {
+		/* Passwords not equal */
+		return PASSDLG_ERROR_PASSWORDS_NOT_EQUAL;
+	}
+
+	/* Success */
+	return PASSDLG_ERROR_NONE;
+}
+
+/* Refresh the valid password UI state, i.e. re-validate
+ * and enable/disable the Change Password button.
+ * Returns: Return value of passdlg_validate_passwords */
+static guint
+passdlg_refresh_password_state (PasswordDialog *pdialog)
+{
+	GtkBuilder *dialog;<--- Variable 'dialog' can be declared as pointer to const
+	guint		ret;
+	gboolean	valid = FALSE;
+
+	dialog = pdialog->ui;<--- Variable 'dialog' is assigned a value that is never used.
+
+	ret = passdlg_validate_passwords (pdialog);
+
+	if (ret == PASSDLG_ERROR_NONE) {
+		valid = TRUE;
+	}
+
+	g_object_set (WID ("change-password-button"), "sensitive", valid, NULL);
+
+	return ret;
+}
+
+/* Called whenever any of the new password fields have changed */
+static void
+passdlg_check_password (GtkEntry *entry, PasswordDialog *pdialog)
+{
+	guint	ret;
+
+	ret = passdlg_refresh_password_state (pdialog);
+
+	switch (ret) {
+		case PASSDLG_ERROR_NONE:
+			passdlg_set_status (pdialog, _("Click <b>Change password</b> to change your password."));
+			break;
+		case PASSDLG_ERROR_NEW_PASSWORD_EMPTY:
+			passdlg_set_status (pdialog, _("Please type your password in the <b>New password</b> field."));
+			break;
+		case PASSDLG_ERROR_RETYPED_PASSWORD_EMPTY:
+			passdlg_set_status (pdialog, _("Please type your password again in the <b>Retype new password</b> field."));
+			break;
+		case PASSDLG_ERROR_PASSWORDS_NOT_EQUAL:
+			passdlg_set_status (pdialog, _("The two passwords are not equal."));
+			break;
+		default:
+			g_warning ("Unknown passdlg_check_password error: %d", ret);
+			break;
+	}
+}
+
+/* Called when the "Change password" dialog-button is clicked
+ * Returns: TRUE if we want to keep the dialog running, FALSE otherwise */
+static gboolean
+passdlg_process_response (PasswordDialog *pdialog, gint response_id)
+{
+
+	if (response_id == GTK_RESPONSE_OK) {
+		/* Set busy as this can be a long process */
+		passdlg_set_busy (pdialog, TRUE);
+
+		/* Stop passwd if an error occurred and it is still running */
+		if (pdialog->backend_state == PASSWD_STATE_ERR) {
+
+			/* Stop passwd, free resources */
+			stop_passwd (pdialog);
+		}
+
+		/* Check that the backend is still running, or that an error
+		 * has occurred but it has not yet exited */
+		if (pdialog->backend_pid == -1) {
+			/* If it is not, re-run authentication */
+
+			/* Spawn backend */
+			if (!passdlg_spawn_passwd (pdialog)) {
+				return TRUE;
+			}
+
+			/* Add current and new passwords to queue */
+			authenticate (pdialog);
+			update_password (pdialog);
+		} else {
+			/* Only add new passwords to queue */
+			update_password (pdialog);
+
+			/* Pop new password through the backend */
+			io_queue_pop (pdialog->backend_stdin_queue, pdialog->backend_stdin);
+		}
+
+		/* Our IO watcher should now handle the rest */
+
+		/* Keep the dialog running */
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+/* Activates (moves focus or activates) widget w */
+static void
+passdlg_activate (GtkEntry *entry, GtkWidget *w)
+{
+	if (GTK_IS_BUTTON (w)) {
+		gtk_widget_activate (w);
+	} else {
+		gtk_widget_grab_focus (w);
+	}
+}
+
+/* Initialize password dialog */
+static void
+passdlg_init (PasswordDialog *pdialog, GtkWindow *parent)
+{
+	GtkBuilder	*dialog;
+	GtkWidget	*wpassdlg;
+	GtkAccelGroup	*group;
+	GError 		*error = NULL;
+
+	/* Initialize dialog */
+	dialog = gtk_builder_new ();
+	if (gtk_builder_add_from_resource (dialog, "/org/mate/mcc/am/mate-about-me-password.ui", &error) == 0)
+	{
+		g_warning ("Could not parse UI definition: %s", error->message);
+		g_error_free (error);
+	}
+	pdialog->ui = dialog;
+
+	wpassdlg = WID ("change-password");
+	capplet_set_icon (wpassdlg, "user-info");
+
+	group = gtk_accel_group_new ();
+
+	/*
+	 * Initialize backend
+	 */
+
+	/* Initialize backend_pid. -1 means the backend is not running */
+	pdialog->backend_pid = -1;
+
+	/* Initialize IO Channels */
+	pdialog->backend_stdin = NULL;
+	pdialog->backend_stdout = NULL;
+	pdialog->backend_stderr = NULL;
+
+	/* Initialize write queue */
+	pdialog->backend_stdin_queue = g_queue_new ();
+
+	/* Initialize watchers */
+	pdialog->backend_child_watch_id = 0;
+	pdialog->backend_stdout_watch_id = 0;
+	pdialog->backend_stderr_watch_id = 0;
+
+	/* Initialize backend state */
+	pdialog->backend_state = PASSWD_STATE_NONE;
+
+	/*
+	 * Initialize UI
+	 */
+
+	/* Initialize pdialog widgets */
+	pdialog->current_password	= GTK_ENTRY (gtk_builder_get_object (dialog, "current-password"));
+	pdialog->new_password		= GTK_ENTRY (gtk_builder_get_object (dialog, "new-password"));
+	pdialog->retyped_password	= GTK_ENTRY (gtk_builder_get_object (dialog, "retyped-password"));
+	pdialog->dialog_image		= GTK_IMAGE (gtk_builder_get_object (dialog, "dialog-image"));
+	pdialog->status_label		= GTK_LABEL (gtk_builder_get_object (dialog, "status-label"));
+
+	/* Initialize accelerators */
+	gtk_widget_add_accelerator (GTK_WIDGET (pdialog->current_password),
+								"activate", group,
+								GDK_KEY_Return, 0,
+								0);
+
+	gtk_widget_add_accelerator (GTK_WIDGET (pdialog->new_password),
+								"activate", group,
+								GDK_KEY_Return, 0,
+								0);
+
+	/* Activate authenticate-button when enter is pressed in current-password */
+	g_signal_connect (pdialog->current_password, "activate",
+	                  G_CALLBACK (passdlg_activate),
+	                  WID ("authenticate-button"));
+
+	/* Activate retyped-password when enter is pressed in new-password */
+	g_signal_connect (pdialog->new_password, "activate",
+	                  G_CALLBACK (passdlg_activate),
+	                  pdialog->retyped_password);
+
+	/* Clear status message */
+	passdlg_set_status (pdialog, "");
+
+	/* Set non-authenticated state */
+	passdlg_set_auth_state (pdialog, FALSE);
+
+	/* Connect signal handlers */
+	g_signal_connect (gtk_builder_get_object (dialog, "authenticate-button"), "clicked",
+	                  G_CALLBACK (passdlg_authenticate),
+	                  pdialog);
+
+	/* Verify new passwords on-the-fly */
+	g_signal_connect (gtk_builder_get_object (dialog, "new-password"), "changed",
+	                  G_CALLBACK (passdlg_check_password),
+	                  pdialog);
+	g_signal_connect (gtk_builder_get_object (dialog, "retyped-password"), "changed",
+	                  G_CALLBACK (passdlg_check_password),
+	                  pdialog);
+
+	/* Set misc dialog properties */
+	gtk_window_set_resizable (GTK_WINDOW (wpassdlg), FALSE);
+	gtk_window_set_transient_for (GTK_WINDOW (wpassdlg), GTK_WINDOW (parent));
+}
+
+/* Main */
+void
+mate_about_me_password (GtkWindow *parent)
+{
+	PasswordDialog	*pdialog;
+	GtkBuilder		*dialog;
+	GtkWidget		*wpassdlg;
+
+	gint			result;
+	gboolean		response;
+
+	/* Initialize dialog */
+	pdialog = g_new0 (PasswordDialog, 1);
+	passdlg_init (pdialog, parent);
+
+	dialog = pdialog->ui;
+	wpassdlg = WID ("change-password");
+
+	/* Go! */
+	gtk_widget_show_all (wpassdlg);
+
+	do {
+		result = gtk_dialog_run (GTK_DIALOG (wpassdlg));
+		response = passdlg_process_response (pdialog, result);
+	} while (response);
+
+	/* Clean up */
+	stop_passwd (pdialog);
+	gtk_widget_destroy (wpassdlg);
+	g_queue_free (pdialog->backend_stdin_queue);
+	g_object_unref (dialog);
+	g_free (pdialog);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/30.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/30.html new file mode 100644 index 00000000..83c05653 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/30.html @@ -0,0 +1,757 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- mode: c; style: linux -*- */
+
+/* capplet-util.c
+ * Copyright (C) 2001 Ximian, Inc.
+ *
+ * Written by Bradford Hovinen <hovinen@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, 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 <ctype.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+/* For stat */
+#include <sys/types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/stat.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 <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 "capplet-util.h"
+
+static void
+capplet_error_dialog (GtkWindow *parent, char const *msg, GError *err)
+{
+	if (err != NULL) {
+		GtkWidget *dialog;
+
+		dialog = gtk_message_dialog_new (GTK_WINDOW (parent),
+			GTK_DIALOG_DESTROY_WITH_PARENT,
+			GTK_MESSAGE_ERROR,
+			GTK_BUTTONS_CLOSE,
+			msg, err->message);
+
+		g_signal_connect (dialog, "response",
+		                  G_CALLBACK (gtk_widget_destroy),
+		                  NULL);
+		gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
+		gtk_widget_show (dialog);
+		g_error_free (err);
+	}
+}
+
+/**
+ * capplet_help :
+ * @parent :
+ * @helpfile :
+ * @section  :
+ *
+ * A quick utility routine to display help for capplets, and handle errors in a
+ * Havoc happy way.
+ **/
+void
+capplet_help (GtkWindow *parent, char const *section)
+{
+	GError *error = NULL;
+	char *uri;
+
+	g_return_if_fail (section != NULL);
+
+	uri = g_strdup_printf ("help:mate-user-guide/%s", section);
+
+	if (!gtk_show_uri_on_window (parent , uri, gtk_get_current_event_time (), &error)) {
+		capplet_error_dialog (
+			parent,
+			_("There was an error displaying help: %s"),
+			error);
+	}
+
+	g_free (uri);
+}
+
+/**
+ * capplet_set_icon :
+ * @window :
+ * @file_name  :
+ *
+ * A quick utility routine to avoid the cut-n-paste of bogus code
+ * that caused several bugs.
+ **/
+void
+capplet_set_icon (GtkWidget *window, char const *icon_file_name)
+{
+	/* Make sure that every window gets an icon */
+	gtk_window_set_default_icon_name (icon_file_name);
+	gtk_window_set_icon_name (GTK_WINDOW (window), icon_file_name);
+}
+
+static gboolean
+directory_delete_recursive (GFile *directory, GError **error)
+{
+	GFileEnumerator *enumerator;
+	GFileInfo *info;
+	gboolean success = TRUE;
+
+	enumerator = g_file_enumerate_children (directory,
+						G_FILE_ATTRIBUTE_STANDARD_NAME ","
+						G_FILE_ATTRIBUTE_STANDARD_TYPE,
+						G_FILE_QUERY_INFO_NONE,
+						NULL, error);
+	if (enumerator == NULL)
+		return FALSE;
+
+	while (success &&
+	       (info = g_file_enumerator_next_file (enumerator, NULL, NULL))) {
+		GFile *child;
+
+		child = g_file_get_child (directory, g_file_info_get_name (info));
+
+		if (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) {
+			success = directory_delete_recursive (child, error);
+		} else {
+			success = g_file_delete (child, NULL, error);
+		}
+		g_object_unref (info);
+	}
+	g_file_enumerator_close (enumerator, NULL, NULL);
+
+	if (success)
+		success = g_file_delete (directory, NULL, error);
+
+	return success;
+}
+
+/**
+ * capplet_file_delete_recursive :
+ * @file :
+ * @error  :
+ *
+ * A utility routine to delete files and/or directories,
+ * including non-empty directories.
+ **/
+gboolean
+capplet_file_delete_recursive (GFile *file, GError **error)
+{
+	GFileInfo *info;
+	GFileType type;
+
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+	info = g_file_query_info (file,
+				  G_FILE_ATTRIBUTE_STANDARD_TYPE,
+				  G_FILE_QUERY_INFO_NONE,
+				  NULL, error);
+	if (info == NULL)
+		return FALSE;
+
+	type = g_file_info_get_file_type (info);
+	g_object_unref (info);
+
+	if (type == G_FILE_TYPE_DIRECTORY)
+		return directory_delete_recursive (file, error);
+	else
+		return g_file_delete (file, NULL, error);
+}
+
+gboolean
+capplet_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;
+}
+
+void
+capplet_init (GOptionContext *context,
+	      int *argc,
+	      char ***argv)
+{
+	GError *err = NULL;
+
+#ifdef ENABLE_NLS
+	bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
+	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+	textdomain (GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
+
+	if (context) {
+#ifdef ENABLE_NLS
+		g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
+		g_option_context_add_group (context, gtk_get_option_group (TRUE));
+
+		if (!g_option_context_parse (context, argc, argv, &err)) {
+			g_printerr ("%s\n", err->message);
+			exit (1);
+		}
+	}
+
+	gtk_init (argc, argv);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/31.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/31.html new file mode 100644 index 00000000..6ffee03b --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/31.html @@ -0,0 +1,327 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/* -*- mode: c; style: linux -*- */
+
+/* capplet-util.h
+ * Copyright (C) 2001 Ximian, Inc.
+ *
+ * Written by Bradford Hovinen <hovinen@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, 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 __CAPPLET_UTIL_H
+#define __CAPPLET_UTIL_H
+
+#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 <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+/* Macros to make certain repetitive tasks a bit easier */
+
+/* Retrieve a widget from the UI object */
+
+#define WID(s) GTK_WIDGET (gtk_builder_get_object (dialog, s))
+
+/* Some miscellaneous functions useful to all capplets */
+
+void capplet_help (GtkWindow *parent, char const *section);
+void capplet_set_icon (GtkWidget *window, char const *icon_file_name);
+gboolean capplet_file_delete_recursive (GFile *directory, GError **error);
+gboolean capplet_notebook_scroll_event_cb (GtkWidget *widget, GdkEventScroll *event);
+void capplet_init (GOptionContext *context, int *argc, char ***argv);
+
+#endif /* __CAPPLET_UTIL_H */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/32.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/32.html new file mode 100644 index 00000000..5b6c5c5d --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/32.html @@ -0,0 +1,441 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * dconf-util.c: helper API for dconf
+ *
+ * Copyright (C) 2012 Stefano Karapetsas
+ * Copyright (C) 2012-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., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * Authors:
+ *  Stefano Karapetsas <stefano@karapetsas.com>
+ *  Vincent Untz <vuntz@gnome.org>
+ */
+
+#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 <dconf.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "dconf-util.h"
+
+static DConfClient *
+dconf_util_client_get (void)
+{
+    return dconf_client_new ();
+}
+
+gboolean
+dconf_util_write_sync (const gchar  *key,
+                       GVariant     *value,
+                       GError      **error)
+{
+    gboolean     ret;
+    DConfClient *client = dconf_util_client_get ();
+
+    ret = dconf_client_write_sync (client, key, value, NULL, NULL, error);
+
+    g_object_unref (client);
+
+    return ret;
+}
+
+gboolean
+dconf_util_recursive_reset (const gchar  *dir,
+                            GError      **error)
+{
+    gboolean     ret;
+    DConfClient *client = dconf_util_client_get ();
+
+    ret = dconf_client_write_sync (client, dir, NULL, NULL, NULL, error);
+
+    g_object_unref (client);
+
+    return ret;
+}
+
+gchar **
+dconf_util_list_subdirs (const gchar *dir,
+                         gboolean     remove_trailing_slash)
+{
+    GArray       *array;
+    gchar       **children;
+    int       len;
+    int       i;
+    DConfClient  *client = dconf_util_client_get ();
+
+    array = g_array_new (TRUE, TRUE, sizeof (gchar *));
+
+    children = dconf_client_list (client, dir, &len);
+
+    g_object_unref (client);
+
+    for (i = 0; children[i] != NULL; i++) {
+        if (dconf_is_rel_dir (children[i], NULL)) {
+            char *val = g_strdup (children[i]);
+
+            if (remove_trailing_slash)
+                val[strlen (val) - 1] = '\0';
+
+            array = g_array_append_val (array, val);
+        }
+    }
+
+    g_strfreev (children);
+
+    return (gchar **) g_array_free (array, FALSE);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/33.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/33.html new file mode 100644 index 00000000..2eb8f1a4 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/33.html @@ -0,0 +1,329 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/*
+ * dconf-util.h: helper API for dconf
+ *
+ * Copyright (C) 2012 Stefano Karapetsas
+ * Copyright (C) 2012-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., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * Authors:
+ *  Stefano Karapetsas <stefano@karapetsas.com>
+ *  Vincent Untz <vuntz@gnome.org>
+ */
+
+#ifndef __DCONF_UTIL_H__
+#define __DCONF_UTIL_H__
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+gboolean dconf_util_write_sync (const gchar  *key,
+                                 GVariant     *value,
+                                 GError      **error);
+
+gboolean dconf_util_recursive_reset (const gchar  *dir,
+                                      GError     **error);
+
+gchar **dconf_util_list_subdirs (const gchar *dir,
+                                  gboolean     remove_trailing_slash);
+
+G_END_DECLS
+
+#endif /* __DCONF_UTIL_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/34.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/34.html new file mode 100644 index 00000000..35341d2d --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/34.html @@ -0,0 +1,1423 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* file-transfer-dialog.c
+ * Copyright (C) 2002 Ximian, Inc.
+ *
+ * Written by Rachel Hestilow <hestilow@ximian.com>
+ *            Jens Granseuer <jensgr@gmx.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, 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 <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 <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <limits.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "file-transfer-dialog.h"
+
+enum
+{
+	PROP_0,
+	PROP_FROM_URI,
+	PROP_TO_URI,
+	PROP_FRACTION_COMPLETE,
+	PROP_NTH_URI,
+	PROP_TOTAL_URIS,
+	PROP_PARENT
+};
+
+enum
+{
+	CANCEL,
+	DONE,
+	LAST_SIGNAL
+};
+
+guint file_transfer_dialog_signals[LAST_SIGNAL] = {0, };
+
+struct _FileTransferDialogPrivate
+{
+	GtkWidget *progress;
+	GtkWidget *status;
+	guint nth;
+	guint total;
+	GCancellable *cancellable;
+};
+
+typedef struct _FileTransferJob
+{
+	FileTransferDialog *dialog;
+	GtkDialog *overwrite_dialog;
+	GSList *source_files;
+	GSList *target_files;
+	FileTransferDialogOptions options;
+} FileTransferJob;
+
+/* structure passed to the various callbacks */
+typedef struct {
+	FileTransferDialog *dialog;
+	gchar *source;
+	gchar *target;
+	guint current_file;
+	guint total_files;
+	goffset current_bytes;
+	goffset total_bytes;
+	gint response;
+	GtkDialog *overwrite_dialog;
+} FileTransferData;
+
+G_DEFINE_TYPE_WITH_PRIVATE (FileTransferDialog, file_transfer_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
+file_transfer_dialog_update_num_files (FileTransferDialog *dlg)
+{
+	gchar *str;
+
+	if (dlg->priv->total <= 1)
+		return;
+
+	str = g_strdup_printf (_("Copying file: %u of %u"),
+			      dlg->priv->nth, dlg->priv->total);
+	gtk_progress_bar_set_text (GTK_PROGRESS_BAR (dlg->priv->progress), str);
+	g_free (str);
+}
+
+static void
+file_transfer_dialog_response (GtkDialog *dlg, gint response_id)
+{
+	FileTransferDialog *dialog = FILE_TRANSFER_DIALOG (dlg);
+
+	g_cancellable_cancel (dialog->priv->cancellable);
+}
+
+static void
+file_transfer_dialog_finalize (GObject *object)
+{
+	FileTransferDialog *dlg = FILE_TRANSFER_DIALOG (object);
+
+	if (dlg->priv->cancellable)
+	{
+		g_object_unref (dlg->priv->cancellable);
+		dlg->priv->cancellable = NULL;
+	}
+
+	G_OBJECT_CLASS (file_transfer_dialog_parent_class)->finalize (object);
+}
+
+static void
+file_transfer_dialog_set_prop (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
+{
+	FileTransferDialog *dlg = FILE_TRANSFER_DIALOG (object);
+	GFile *file;
+	gchar *str;
+	gchar *str2;
+	gchar *base;
+	gchar *escaped;
+	GtkWindow *parent;
+	guint n;
+
+	switch (prop_id)
+	{
+	case PROP_FROM_URI:
+		file = g_file_new_for_uri (g_value_get_string (value));
+		base = g_file_get_basename (file);
+		escaped = g_uri_escape_string (base, G_URI_RESERVED_CHARS_ALLOWED_IN_PATH, TRUE);
+
+		str = g_strdup_printf (_("Copying '%s'"), escaped);
+		str2 = g_strdup_printf ("<big><b>%s</b></big>", str);
+		gtk_label_set_markup (GTK_LABEL (dlg->priv->status), str2);
+
+		g_free (base);
+		g_free (escaped);
+		g_free (str);
+		g_free (str2);
+		g_object_unref (file);
+		break;
+	case PROP_TO_URI:
+		break;
+	case PROP_FRACTION_COMPLETE:
+		gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (dlg->priv->progress), g_value_get_double (value));
+		break;
+	case PROP_NTH_URI:
+		n = g_value_get_uint (value);
+		if (n != dlg->priv->nth)
+		{
+			dlg->priv->nth = g_value_get_uint (value);
+			file_transfer_dialog_update_num_files (dlg);
+		}
+		break;
+	case PROP_TOTAL_URIS:
+		n = g_value_get_uint (value);
+		if (n != dlg->priv->nth)
+		{
+			dlg->priv->total = g_value_get_uint (value);
+			file_transfer_dialog_update_num_files (dlg);
+		}
+		break;
+	case PROP_PARENT:
+		parent = g_value_get_pointer (value);
+		if (parent)
+		{
+			gtk_window_set_title (GTK_WINDOW (dlg), gtk_window_get_title (parent));
+			gtk_window_set_transient_for (GTK_WINDOW (dlg), parent);
+		}
+		else
+			gtk_window_set_title (GTK_WINDOW (dlg),
+					      _("Copying files"));
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+	}
+}
+
+static void
+file_transfer_dialog_get_prop (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+{
+	FileTransferDialog *dlg = FILE_TRANSFER_DIALOG (object);
+
+	switch (prop_id)
+	{
+	case PROP_NTH_URI:
+		g_value_set_uint (value, dlg->priv->nth);
+		break;
+	case PROP_TOTAL_URIS:
+		g_value_set_uint (value, dlg->priv->total);
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+	}
+}
+
+static void
+file_transfer_dialog_class_init (FileTransferDialogClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	object_class->finalize = file_transfer_dialog_finalize;
+	object_class->get_property = file_transfer_dialog_get_prop;
+	object_class->set_property = file_transfer_dialog_set_prop;
+
+	GTK_DIALOG_CLASS (klass)->response = file_transfer_dialog_response;
+
+	g_object_class_install_property
+		(object_class, PROP_PARENT,
+		 g_param_spec_pointer ("parent",
+				      _("Parent Window"),
+				      _("Parent window of the dialog"),
+				      G_PARAM_READWRITE));
+
+	g_object_class_install_property
+		(object_class, PROP_FROM_URI,
+		 g_param_spec_string ("from_uri",
+				      _("From URI"),
+				      _("URI currently transferring from"),
+				      NULL,
+				      G_PARAM_READWRITE));
+
+	g_object_class_install_property
+		(object_class, PROP_TO_URI,
+		 g_param_spec_string ("to_uri",
+				      _("To URI"),
+				      _("URI currently transferring to"),
+				      NULL,
+				      G_PARAM_WRITABLE));
+
+	g_object_class_install_property
+		(object_class, PROP_FRACTION_COMPLETE,
+		 g_param_spec_double ("fraction_complete",
+				      _("Fraction completed"),
+				      _("Fraction of transfer currently completed"),
+				      0, 1, 0,
+				      G_PARAM_WRITABLE));
+
+	g_object_class_install_property
+		(object_class, PROP_NTH_URI,
+		 g_param_spec_uint ("nth_uri",
+				    _("Current URI index"),
+				    _("Current URI index - starts from 1"),
+				    1, INT_MAX, 1,
+				    G_PARAM_READWRITE));
+
+	g_object_class_install_property
+		(object_class, PROP_TOTAL_URIS,
+		 g_param_spec_uint ("total_uris",
+				    _("Total URIs"),
+				    _("Total number of URIs"),
+				    1, INT_MAX, 1,
+				    G_PARAM_READWRITE));
+
+	file_transfer_dialog_signals[CANCEL] =
+		g_signal_new ("cancel",
+			      G_TYPE_FROM_CLASS (object_class),
+			      G_SIGNAL_RUN_FIRST,
+			      0,
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE, 0);
+
+	file_transfer_dialog_signals[DONE] =
+		g_signal_new ("done",
+			      G_TYPE_FROM_CLASS (object_class),
+			      G_SIGNAL_RUN_LAST,
+			      0,
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE, 0);
+}
+
+static void
+file_transfer_dialog_init (FileTransferDialog *dlg)
+{
+	GtkWidget *vbox;
+	GtkWidget *hbox;
+	GtkWidget *progress_vbox;
+	char      *markup;
+	GtkWidget *content_area;
+
+	content_area = gtk_dialog_get_content_area (GTK_DIALOG (dlg));
+	dlg->priv = file_transfer_dialog_get_instance_private (dlg);
+	dlg->priv->cancellable = g_cancellable_new ();
+
+	gtk_container_set_border_width (GTK_CONTAINER (content_area), 4);
+	gtk_box_set_spacing (GTK_BOX (content_area), 4);
+
+	gtk_widget_set_size_request (GTK_WIDGET (dlg), 350, -1);
+
+	vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+	gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
+	gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
+
+	dlg->priv->status = gtk_label_new (NULL);
+	markup = g_strconcat ("<big><b>", _("Copying files"), "</b></big>", NULL);
+	gtk_label_set_markup (GTK_LABEL (dlg->priv->status), markup);
+	g_free (markup);
+
+	gtk_label_set_xalign (GTK_LABEL (dlg->priv->status), 0.0);
+	gtk_label_set_yalign (GTK_LABEL (dlg->priv->status), 0.0);
+
+	gtk_box_pack_start (GTK_BOX (vbox), dlg->priv->status, FALSE, FALSE, 0);
+
+	hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+	gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
+
+	progress_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+	gtk_box_pack_start (GTK_BOX (vbox), progress_vbox, FALSE, FALSE, 0);
+
+	dlg->priv->progress = gtk_progress_bar_new ();
+	gtk_box_pack_start (GTK_BOX (progress_vbox),
+			    dlg->priv->progress, FALSE, FALSE, 0);
+
+	gtk_dialog_add_button (GTK_DIALOG (dlg),
+			       "gtk-cancel", GTK_RESPONSE_CANCEL);
+
+	gtk_container_set_border_width (GTK_CONTAINER (dlg), 6);
+
+	gtk_widget_show_all (content_area);
+}
+
+GtkWidget*
+file_transfer_dialog_new (void)
+{
+	return GTK_WIDGET (g_object_new (file_transfer_dialog_get_type (),
+					 NULL));
+}
+
+GtkWidget*
+file_transfer_dialog_new_with_parent (GtkWindow *parent)
+{
+	return GTK_WIDGET (g_object_new (file_transfer_dialog_get_type (),
+					 "parent", parent, NULL));
+}
+
+static gboolean
+file_transfer_job_update (gpointer user_data)
+{
+	FileTransferData *data = user_data;
+	gdouble fraction;
+	gdouble current_fraction;
+
+	if (data->total_bytes == 0)
+		current_fraction = 0.0;
+	else
+		current_fraction = ((gdouble) data->current_bytes) / data->total_bytes;
+
+	fraction = ((gdouble) data->current_file - 1) / data->total_files +
+		   (1.0 / data->total_files) * current_fraction;
+
+	g_object_set (data->dialog,
+		      "from_uri", data->source,
+		      "to_uri", data->target,
+		      "nth_uri", data->current_file,
+		      "fraction_complete", fraction,
+		      NULL);
+	return FALSE;
+}
+
+static void
+file_transfer_job_progress (goffset current_bytes,
+			    goffset total_bytes,
+			    gpointer user_data)
+{
+	FileTransferData *data = user_data;
+
+	data->current_bytes = current_bytes;
+	data->total_bytes = total_bytes;
+
+	file_transfer_job_update (data);
+}
+
+static void
+file_transfer_job_destroy (FileTransferJob *job)
+{
+	g_object_unref (job->dialog);
+	g_slist_free_full (job->source_files, g_object_unref);
+	g_slist_free_full (job->target_files, g_object_unref);
+	if (job->overwrite_dialog != NULL)
+		gtk_widget_destroy (GTK_WIDGET (job->overwrite_dialog));
+	g_free (job);
+}
+
+static gboolean
+file_transfer_dialog_done (FileTransferDialog *dialog)
+{
+	g_signal_emit (dialog,
+		       file_transfer_dialog_signals[DONE],
+		       0, NULL);
+	return FALSE;
+}
+
+static gboolean
+file_transfer_dialog_cancel (FileTransferDialog *dialog)
+{
+	g_signal_emit (dialog,
+		       file_transfer_dialog_signals[CANCEL],
+		       0, NULL);
+	return FALSE;
+}
+
+static gboolean
+file_transfer_dialog_overwrite (gpointer user_data)
+{
+	FileTransferData *data = user_data;
+	GtkDialog *dialog;
+
+	dialog = data->overwrite_dialog;
+
+	if (dialog != NULL) {
+	} else {
+		GtkWidget *button;
+
+		dialog = GTK_DIALOG (gtk_message_dialog_new (GTK_WINDOW (data->dialog),
+							     GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION,
+							     GTK_BUTTONS_NONE,
+							     _("File '%s' already exists. Do you want to overwrite it?"),
+							     data->target));
+
+		gtk_dialog_add_button (dialog, _("_Skip"), GTK_RESPONSE_NO);
+		gtk_dialog_add_button (dialog, _("Overwrite _All"), GTK_RESPONSE_APPLY);
+
+		button = gtk_button_new_with_label (_("_Overwrite"));
+		gtk_button_set_image (GTK_BUTTON (button),
+				      gtk_image_new_from_icon_name ("gtk-apply",
+								    GTK_ICON_SIZE_BUTTON));
+		gtk_dialog_add_action_widget (dialog, button, GTK_RESPONSE_YES);
+		gtk_widget_show (button);
+
+		data->overwrite_dialog = dialog;
+	}
+
+	data->response = gtk_dialog_run (dialog);
+
+	gtk_widget_hide (GTK_WIDGET (dialog));
+	return FALSE;
+}
+
+/* TODO: support transferring directories recursively? */
+static gboolean
+file_transfer_job_schedule (GIOSchedulerJob *io_job,
+			    GCancellable *cancellable,
+			    FileTransferJob *job)
+{
+	GFile *source, *target;
+	gboolean success;
+	GFileCopyFlags copy_flags = G_FILE_COPY_NONE;
+	FileTransferData data;
+	GError *error;
+	gboolean retry;
+
+	/* take the first file from the list and copy it */
+	source = job->source_files->data;
+	job->source_files = g_slist_delete_link (job->source_files, job->source_files);
+
+	target = job->target_files->data;
+	job->target_files = g_slist_delete_link (job->target_files, job->target_files);
+
+	data.dialog = job->dialog;
+	data.overwrite_dialog = job->overwrite_dialog;
+	data.current_file = job->dialog->priv->nth + 1;
+	data.total_files = job->dialog->priv->total;
+	data.current_bytes = data.total_bytes = 0;
+	data.source = g_file_get_basename (source);
+	data.target = g_file_get_basename (target);
+
+	g_io_scheduler_job_send_to_mainloop (io_job,
+					     file_transfer_job_update,
+					     &data,
+					     NULL);
+
+	if (job->options & FILE_TRANSFER_DIALOG_OVERWRITE)
+		copy_flags |= G_FILE_COPY_OVERWRITE;
+
+	do {
+		retry = FALSE;
+		error = NULL;
+		success = g_file_copy (source, target,
+				       copy_flags,
+				       job->dialog->priv->cancellable,
+				       file_transfer_job_progress,
+				       &data,
+				       &error);
+
+		if (error != NULL)
+		{
+			if (error->domain == G_IO_ERROR &&
+			    error->code == G_IO_ERROR_EXISTS)
+			{
+				/* since the job is run in a thread, we cannot simply run
+				 * a dialog here and need to defer it to the mainloop */
+				data.response = GTK_RESPONSE_NONE;
+				g_io_scheduler_job_send_to_mainloop (io_job,
+								     file_transfer_dialog_overwrite,
+								     &data,
+								     NULL);
+
+				if (data.response == GTK_RESPONSE_YES) {
+					retry = TRUE;
+					copy_flags |= G_FILE_COPY_OVERWRITE;
+				} else if (data.response == GTK_RESPONSE_APPLY) {
+					retry = TRUE;
+					job->options |= FILE_TRANSFER_DIALOG_OVERWRITE;
+					copy_flags |= G_FILE_COPY_OVERWRITE;
+				} else {
+					success = TRUE;
+				}
+
+				job->overwrite_dialog = data.overwrite_dialog;
+			}
+			g_error_free (error);
+		}
+	} while (retry);
+
+	g_object_unref (source);
+	g_object_unref (target);
+
+	g_free (data.source);
+	g_free (data.target);
+
+	if (success)
+	{
+		if (job->source_files == NULL)
+		{
+			g_io_scheduler_job_send_to_mainloop_async (io_job,
+								   (GSourceFunc) file_transfer_dialog_done,
+								   g_object_ref (job->dialog),
+								   g_object_unref);
+			return FALSE;
+		}
+	}
+	else /* error on copy or cancelled */
+	{
+		g_io_scheduler_job_send_to_mainloop_async (io_job,
+							   (GSourceFunc) file_transfer_dialog_cancel,
+							   g_object_ref (job->dialog),
+							   g_object_unref);
+		return FALSE;
+	}
+
+	/* more work to do... */
+	return TRUE;
+}
+
+void
+file_transfer_dialog_copy_async (FileTransferDialog *dlg,
+				 GList *source_files,
+				 GList *target_files,
+				 FileTransferDialogOptions options,
+				 int priority)
+{
+	FileTransferJob *job;
+	GList *l;
+	guint n;
+
+	job = g_new0 (FileTransferJob, 1);
+	job->dialog = g_object_ref (dlg);
+	job->options = options;
+
+	/* we need to copy the list contents for private use */
+	n = 0;
+	for (l = g_list_last (source_files); l; l = l->prev, ++n)
+	{
+		job->source_files = g_slist_prepend (job->source_files,
+						     g_object_ref (l->data));
+	}
+	for (l = g_list_last (target_files); l; l = l->prev)
+	{
+		job->target_files = g_slist_prepend (job->target_files,
+						     g_object_ref (l->data));
+	}
+
+	g_object_set (dlg, "total_uris", n, NULL);
+
+	g_io_scheduler_push_job ((GIOSchedulerJobFunc) file_transfer_job_schedule,
+				 job,
+				 (GDestroyNotify) file_transfer_job_destroy,
+				 priority,
+				 dlg->priv->cancellable);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/35.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/35.html new file mode 100644 index 00000000..71cbc713 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/35.html @@ -0,0 +1,377 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/* -*- mode: c; style: linux -*- */
+
+/* file-transfer-dialog.h
+ * Copyright (C) 2002 Ximian, Inc.
+ *
+ * Written by Rachel Hestilow <hestilow@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, 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 __FILE_TRANSFER_DIALOG_H__
+#define __FILE_TRANSFER_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.
+
+G_BEGIN_DECLS
+
+#define FILE_TRANSFER_DIALOG(obj)          G_TYPE_CHECK_INSTANCE_CAST (obj, file_transfer_dialog_get_type (), FileTransferDialog)
+#define FILE_TRANSFER_DIALOG_CLASS(klass)  G_TYPE_CHECK_CLASS_CAST (klass, file_transfer_dialog_get_type (), FileTransferDialogClass)
+#define IS_FILE_TRANSFER_DIALOG(obj)       G_TYPE_CHECK_INSTANCE_TYPE (obj, file_transfer_dialog_get_type ())
+
+typedef struct _FileTransferDialog FileTransferDialog;
+typedef struct _FileTransferDialogClass FileTransferDialogClass;
+typedef struct _FileTransferDialogPrivate FileTransferDialogPrivate;
+
+typedef enum {
+	FILE_TRANSFER_DIALOG_DEFAULT = 1 << 0,
+	FILE_TRANSFER_DIALOG_OVERWRITE = 1 << 1
+} FileTransferDialogOptions;
+
+struct _FileTransferDialog
+{
+	GtkDialog dialog;
+
+	FileTransferDialogPrivate *priv;
+};
+
+struct _FileTransferDialogClass
+{
+	GtkDialogClass parent_class;
+};
+
+GType	       file_transfer_dialog_get_type (void);
+GtkWidget*     file_transfer_dialog_new (void);
+GtkWidget*     file_transfer_dialog_new_with_parent (GtkWindow *parent);
+
+void	       file_transfer_dialog_copy_async (FileTransferDialog *dlg,
+						GList *source_files,
+						GList *target_files,
+						FileTransferDialogOptions options,
+						int priority);
+
+
+G_END_DECLS
+
+#endif /* __FILE_TRANSFER_DIALOG_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/36.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/36.html new file mode 100644 index 00000000..fe76bd97 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/36.html @@ -0,0 +1,845 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * Copyright (C) 2007 The GNOME Foundation
+ * Written by Thomas Wood <thos@gnome.org>
+ *            Jens Granseuer <jensgr@gmx.net>
+ * All Rights Reserved
+ *
+ * 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 <string.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 <glib.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 <fcntl.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 "gtkrc-utils.h"
+
+#define INCLUDE_SYMBOL ((gpointer) 1)
+#define ENGINE_SYMBOL ((gpointer) 2)
+#define COLOR_SCHEME_SYMBOL ((gpointer) 3)
+
+gchar* gtkrc_find_named(const gchar* name)
+{
+	/* find the gtkrc of the named theme
+	 * taken from gtkrc.c (gtk_rc_parse_named)
+	 */
+	gchar* path = NULL;
+	const gchar* home_dir;
+	const gchar* subpath = "gtk-2.0" G_DIR_SEPARATOR_S "gtkrc";<--- There is an unknown macro here somewhere. Configuration is required. If G_DIR_SEPARATOR_S is a macro then please configure it.
+
+	/* First look in the users home directory
+	*/
+	home_dir = g_get_home_dir();
+
+	if (home_dir)
+	{
+		path = g_build_filename(home_dir, ".themes", name, subpath, NULL);
+
+		if (!g_file_test (path, G_FILE_TEST_EXISTS))
+		{
+			g_free (path);
+			path = NULL;
+		}
+	}
+
+	if (!path)
+	{
+		const gchar * const * dirs = g_get_system_data_dirs();
+
+		if (dirs != NULL)
+			for (; !path && *dirs != NULL; ++dirs)
+			{
+				path = g_build_filename(*dirs, "themes", name, subpath, NULL);
+
+				if (!g_file_test(path, G_FILE_TEST_EXISTS))
+				{
+					g_free (path);
+					path = NULL;
+				}
+			}
+	}
+
+	return path;
+
+}
+
+void gtkrc_get_details(gchar* filename, GSList** engines, GSList** symbolic_colors)
+{
+	gint file = -1;
+	GSList* files = NULL;
+	GSList* read_files = NULL;
+	GTokenType token;
+	GScanner *scanner = g_scanner_new (NULL);
+
+	g_scanner_scope_add_symbol (scanner, 0, "include", INCLUDE_SYMBOL);
+
+	if (engines != NULL)
+	{
+		g_scanner_scope_add_symbol (scanner, 0, "engine", ENGINE_SYMBOL);
+	}
+
+	files = g_slist_prepend (files, g_strdup (filename));
+
+	while (files != NULL)
+	{
+		filename = files->data;
+		files = g_slist_delete_link (files, files);
+
+		if (filename == NULL)
+			continue;
+
+		if (g_slist_find_custom (read_files, filename, (GCompareFunc) strcmp))
+		{
+			g_warning ("Recursion in the gtkrc detected!");
+			g_free (filename);
+			continue; /* skip this file since we've done it before... */
+		}
+
+		read_files = g_slist_prepend (read_files, filename);
+
+		file = g_open (filename, O_RDONLY);
+		if (file == -1)
+		{
+			g_warning ("Could not open file \"%s\"", filename);
+		}
+		else
+		{
+			g_scanner_input_file (scanner, file);
+			while ((token = g_scanner_get_next_token (scanner)) != G_TOKEN_EOF)
+			{
+				GTokenType string_token;
+				if (token == '@')
+				{
+					if (symbolic_colors == NULL)
+						continue;
+					token = g_scanner_get_next_token (scanner);
+					if (token != G_TOKEN_IDENTIFIER)
+						continue;
+					if (!g_slist_find_custom (*symbolic_colors, scanner->value.v_identifier, (GCompareFunc) strcmp))
+						*symbolic_colors = g_slist_append (*symbolic_colors, g_strdup (scanner->value.v_identifier));
+					continue;
+				}
+
+				if (token != G_TOKEN_SYMBOL)
+					continue;
+
+				if (scanner->value.v_symbol == INCLUDE_SYMBOL)
+				{
+					string_token = g_scanner_get_next_token (scanner);
+					if (string_token != G_TOKEN_STRING)
+						continue;
+					if (g_path_is_absolute (scanner->value.v_string))
+					{
+						files = g_slist_prepend (files, g_strdup (scanner->value.v_string));
+					}
+					else
+					{
+						gchar *basedir = g_path_get_dirname (filename);
+						files = g_slist_prepend (files, g_build_path (G_DIR_SEPARATOR_S, basedir, scanner->value.v_string, NULL));
+						g_free (basedir);
+					}
+				}
+				else if (scanner->value.v_symbol == ENGINE_SYMBOL)
+				{
+					string_token = g_scanner_get_next_token (scanner);
+					if (string_token != G_TOKEN_STRING || scanner->value.v_string[0] == '\0')
+						continue;
+					if (!g_slist_find_custom (*engines, scanner->value.v_string, (GCompareFunc) strcmp))
+						*engines = g_slist_append (*engines, g_strdup (scanner->value.v_string));
+				}
+
+			}
+			close (file);
+		}
+	}
+
+	g_slist_free_full (read_files, g_free);
+
+	g_scanner_destroy (scanner);
+}
+
+static const GScannerConfig gtk_rc_scanner_config =
+{
+  (
+   " \t\r\n"
+   )            /* cset_skip_characters */,
+  (
+   "_"
+   G_CSET_a_2_z
+   G_CSET_A_2_Z
+   )            /* cset_identifier_first */,
+  (
+   G_CSET_DIGITS
+   "-_"
+   G_CSET_a_2_z
+   G_CSET_A_2_Z
+   )            /* cset_identifier_nth */,
+  ( "#\n" )     /* cpair_comment_single */,
+
+  TRUE          /* case_sensitive */,
+
+  TRUE          /* skip_comment_multi */,
+  TRUE          /* skip_comment_single */,
+  TRUE          /* scan_comment_multi */,
+  TRUE          /* scan_identifier */,
+  FALSE         /* scan_identifier_1char */,
+  FALSE         /* scan_identifier_NULL */,
+  TRUE          /* scan_symbols */,
+  TRUE          /* scan_binary */,
+  TRUE          /* scan_octal */,
+  TRUE          /* scan_float */,
+  TRUE          /* scan_hex */,
+  TRUE          /* scan_hex_dollar */,
+  TRUE          /* scan_string_sq */,
+  TRUE          /* scan_string_dq */,
+  TRUE          /* numbers_2_int */,
+  FALSE         /* int_2_float */,
+  FALSE         /* identifier_2_string */,
+  TRUE          /* char_2_token */,
+  TRUE          /* symbol_2_token */,
+  FALSE         /* scope_0_fallback */,
+  FALSE         /* store_int64 */,
+
+  0             /* < private > padding_dummy*/,
+};
+
+gchar *
+gtkrc_get_color_scheme (const gchar *gtkrc_file)
+{
+	gint file = -1;
+	gchar *result = NULL;
+	GSList *files = NULL;
+	GSList *read_files = NULL;
+	GTokenType token;
+	GScanner *scanner = g_scanner_new (&gtk_rc_scanner_config);
+
+	g_scanner_scope_add_symbol (scanner, 0, "include", INCLUDE_SYMBOL);
+	g_scanner_scope_add_symbol (scanner, 0, "gtk_color_scheme", COLOR_SCHEME_SYMBOL);
+	g_scanner_scope_add_symbol (scanner, 0, "gtk-color-scheme", COLOR_SCHEME_SYMBOL);
+
+	files = g_slist_prepend (files, g_strdup (gtkrc_file));
+	while (files != NULL)
+	{
+		gchar *filename = files->data;
+		files = g_slist_delete_link (files, files);
+
+		if (filename == NULL)
+			continue;
+
+		if (g_slist_find_custom (read_files, filename, (GCompareFunc) strcmp))
+		{
+			g_warning ("Recursion in the gtkrc detected!");
+			g_free (filename);
+			continue; /* skip this file since we've done it before... */
+		}
+
+		read_files = g_slist_prepend (read_files, filename);
+
+		file = g_open (filename, O_RDONLY);
+		if (file == -1)
+		{
+			g_warning ("Could not open file \"%s\"", filename);
+		}
+		else
+		{
+			g_scanner_input_file (scanner, file);
+			while ((token = g_scanner_get_next_token (scanner)) != G_TOKEN_EOF)
+			{
+				if (GINT_TO_POINTER (token) == COLOR_SCHEME_SYMBOL)
+				{
+					if (g_scanner_get_next_token (scanner) == '=')
+					{
+						token = g_scanner_get_next_token (scanner);
+						if (token == G_TOKEN_STRING)
+						{
+							g_free (result);
+							result = g_strdup (scanner->value.v_string);
+						}
+					}
+				}
+			}
+			close (file);
+		}
+	}
+
+	g_slist_free_full (read_files, g_free);
+
+	g_scanner_destroy (scanner);
+	return result;
+}
+
+gchar* gtkrc_get_color_scheme_for_theme(const gchar* theme_name)
+{
+	/* try to find the color scheme from the gtkrc */
+	gchar* gtkrc_file;
+	gchar* scheme = NULL;
+
+	gtkrc_file = gtkrc_find_named(theme_name);
+
+	if (gtkrc_file)
+	{
+		scheme = gtkrc_get_color_scheme(gtkrc_file);
+		g_free(gtkrc_file);
+	}
+
+	return scheme;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/37.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/37.html new file mode 100644 index 00000000..5d3768f2 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/37.html @@ -0,0 +1,521 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- mode: C; c-basic-offset: 4 -*-
+ * themus - utilities for MATE themes
+ * Copyright (C) 2002 Jonathan Blandford <aes@gnome.org>
+ *
+ * This library 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.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
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU 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 <string.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 <libmate-desktop/mate-gsettings.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "mate-theme-apply.h"
+#include "gtkrc-utils.h"
+
+#define INTERFACE_SCHEMA        "org.mate.interface"
+#define GTK_THEME_KEY           "gtk-theme"
+#define COLOR_SCHEME_KEY        "gtk-color-scheme"
+#define ICON_THEME_KEY          "icon-theme"
+
+#define MARCO_SCHEMA            "org.mate.Marco.general"
+#define MARCO_THEME_KEY         "theme"
+
+#define MOUSE_SCHEMA            "org.mate.peripherals-mouse"
+#define CURSOR_THEME_KEY        "cursor-theme"
+#define CURSOR_SIZE_KEY         "cursor-size"
+
+#define NOTIFICATION_SCHEMA     "org.mate.NotificationDaemon"
+#define NOTIFICATION_THEME_KEY  "theme"
+
+#define compare(x,y) (!x && y) || (x && !y) || (x && y && strcmp (x, y))
+
+void
+mate_meta_theme_set (MateThemeMetaInfo *meta_theme_info)
+{
+  GSettings *interface_settings;
+  GSettings *marco_settings;
+  GSettings *mouse_settings;
+  GSettings *notification_settings = NULL;
+  gchar *old_key;
+  gint old_key_int;
+
+  interface_settings = g_settings_new (INTERFACE_SCHEMA);
+  marco_settings = g_settings_new (MARCO_SCHEMA);
+  mouse_settings = g_settings_new (MOUSE_SCHEMA);
+
+  if (mate_gsettings_schema_exists (NOTIFICATION_SCHEMA))
+    {
+      notification_settings = g_settings_new (NOTIFICATION_SCHEMA);
+    }
+
+  /* Set the gtk+ key */
+  old_key = g_settings_get_string (interface_settings, GTK_THEME_KEY);
+  if (compare (old_key, meta_theme_info->gtk_theme_name))
+    {
+      g_settings_set_string (interface_settings, GTK_THEME_KEY, meta_theme_info->gtk_theme_name);
+    }
+  g_free (old_key);
+
+  /* Set the color scheme key */
+  old_key = g_settings_get_string (interface_settings, COLOR_SCHEME_KEY);
+  if (compare (old_key, meta_theme_info->gtk_color_scheme))
+    {
+      /* only save the color scheme if it differs from the default
+         scheme for the selected gtk theme */
+      gchar *newval, *gtkcols;
+
+      newval = meta_theme_info->gtk_color_scheme;
+      gtkcols = gtkrc_get_color_scheme_for_theme (meta_theme_info->gtk_theme_name);
+
+      if (newval == NULL || !strcmp (newval, "") ||
+          mate_theme_color_scheme_equal (newval, gtkcols))
+        {
+          g_settings_reset (interface_settings, COLOR_SCHEME_KEY);
+        }
+      else
+        {
+          g_settings_set_string (interface_settings, COLOR_SCHEME_KEY, newval);
+        }
+      g_free (gtkcols);
+    }
+  g_free (old_key);
+
+  /* Set the wm key */
+  g_settings_set_string (marco_settings, MARCO_THEME_KEY, meta_theme_info->marco_theme_name);
+
+  /* set the icon theme */
+  old_key = g_settings_get_string (interface_settings, ICON_THEME_KEY);
+  if (compare (old_key, meta_theme_info->icon_theme_name))
+    {
+      g_settings_set_string (interface_settings, ICON_THEME_KEY, meta_theme_info->icon_theme_name);
+    }
+  g_free (old_key);
+
+  /* set the notification theme */
+  if (notification_settings != NULL)
+    {
+    if (meta_theme_info->notification_theme_name != NULL)
+      {
+        old_key = g_settings_get_string (notification_settings, NOTIFICATION_THEME_KEY);
+        if (compare (old_key, meta_theme_info->notification_theme_name))
+          {
+            g_settings_set_string (notification_settings, NOTIFICATION_THEME_KEY, meta_theme_info->notification_theme_name);
+          }
+        g_free (old_key);
+      }
+    }
+
+  /* Set the cursor theme key */
+  old_key = g_settings_get_string (mouse_settings, CURSOR_THEME_KEY);
+  if (compare (old_key, meta_theme_info->cursor_theme_name))
+    {
+      g_settings_set_string (mouse_settings, CURSOR_THEME_KEY, meta_theme_info->cursor_theme_name);
+    }
+
+  old_key_int = g_settings_get_int (mouse_settings, CURSOR_SIZE_KEY);
+  if (old_key_int != meta_theme_info->cursor_size)
+    {
+      g_settings_set_int (mouse_settings, CURSOR_SIZE_KEY, meta_theme_info->cursor_size);
+    }
+
+  g_free (old_key);
+  g_object_unref (interface_settings);
+  g_object_unref (marco_settings);
+  g_object_unref (mouse_settings);
+  if (notification_settings != NULL)
+    g_object_unref (notification_settings);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/38.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/38.html new file mode 100644 index 00000000..f7dc1f1b --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/38.html @@ -0,0 +1,619 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* mate-theme-info.h - MATE Theme information
+
+   Copyright (C) 2002 Jonathan Blandford <jrb@gnome.org>
+   All rights reserved.
+
+   This file is part of the Mate Library.
+
+   The Mate Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The Mate 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the Mate Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+#ifndef MATE_THEME_INFO_H
+#define MATE_THEME_INFO_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.
+#include <gdk/gdk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+typedef enum {
+	MATE_THEME_TYPE_METATHEME,
+	MATE_THEME_TYPE_ICON,
+	MATE_THEME_TYPE_CURSOR,
+	MATE_THEME_TYPE_REGULAR
+} MateThemeType;
+
+typedef enum {
+	MATE_THEME_CHANGE_CREATED,
+	MATE_THEME_CHANGE_DELETED,
+	MATE_THEME_CHANGE_CHANGED
+} MateThemeChangeType;
+
+typedef enum {
+	MATE_THEME_MARCO = 1 << 0,
+	MATE_THEME_GTK_2 = 1 << 1,
+	MATE_THEME_GTK_2_KEYBINDING = 1 << 2
+} MateThemeElement;
+
+typedef struct _MateThemeCommonInfo MateThemeCommonInfo;
+typedef struct _MateThemeCommonInfo MateThemeIconInfo;
+struct _MateThemeCommonInfo
+{
+	MateThemeType type;
+	gchar* path;
+	gchar* name;
+	gchar* readable_name;
+	gint priority;
+	gboolean hidden;
+};
+
+typedef struct _MateThemeInfo MateThemeInfo;
+struct _MateThemeInfo
+{
+	MateThemeType type;
+	gchar* path;
+	gchar* name;
+	gchar* readable_name;
+	gint priority;
+	gboolean hidden;
+
+	guint has_gtk : 1;
+	guint has_keybinding : 1;
+	guint has_marco : 1;
+};
+
+typedef struct _MateThemeCursorInfo MateThemeCursorInfo;
+struct _MateThemeCursorInfo {
+	MateThemeType type;
+	gchar* path;
+	gchar* name;
+	gchar* readable_name;
+	gint priority;
+	gboolean hidden;
+
+	GArray* sizes;
+	GdkPixbuf* thumbnail;
+};
+
+typedef struct _MateThemeMetaInfo MateThemeMetaInfo;
+struct _MateThemeMetaInfo {
+	MateThemeType type;
+	gchar* path;
+	gchar* name;
+	gchar* readable_name;
+	gint priority;
+	gboolean hidden;
+
+	gchar* comment;
+	gchar* icon_file;
+
+	gchar* gtk_theme_name;
+	gchar* gtk_color_scheme;
+	gchar* marco_theme_name;
+	gchar* icon_theme_name;
+	gchar* notification_theme_name;
+	gchar* sound_theme_name;
+	gchar* cursor_theme_name;
+	guint cursor_size;
+
+	gchar* application_font;
+	gchar* documents_font;
+	gchar* desktop_font;
+	gchar* windowtitle_font;
+	gchar* monospace_font;
+	gchar* background_image;
+};
+
+enum {
+	COLOR_FG,
+	COLOR_BG,
+	COLOR_TEXT,
+	COLOR_BASE,
+	COLOR_SELECTED_FG,
+	COLOR_SELECTED_BG,
+	COLOR_TOOLTIP_FG,
+	COLOR_TOOLTIP_BG,
+	NUM_SYMBOLIC_COLORS
+};
+
+typedef void (*ThemeChangedCallback) (MateThemeCommonInfo* theme, MateThemeChangeType change_type, MateThemeElement element_type, gpointer user_data);
+
+#define MATE_THEME_ERROR mate_theme_info_error_quark()
+
+enum {
+	MATE_THEME_ERROR_GTK_THEME_NOT_AVAILABLE = 1,
+	MATE_THEME_ERROR_WM_THEME_NOT_AVAILABLE,
+	MATE_THEME_ERROR_ICON_THEME_NOT_AVAILABLE,
+	MATE_THEME_ERROR_GTK_ENGINE_NOT_AVAILABLE,
+	MATE_THEME_ERROR_UNKNOWN
+};
+
+
+/* GTK/Marco/keybinding Themes */
+MateThemeInfo     *mate_theme_info_new                   (void);
+void                mate_theme_info_free                  (MateThemeInfo     *theme_info);
+MateThemeInfo     *mate_theme_info_find                  (const gchar        *theme_name);
+GList              *mate_theme_info_find_by_type          (guint               elements);
+GQuark              mate_theme_info_error_quark           (void);
+gchar              *gtk_theme_info_missing_engine          (const gchar *gtk_theme,
+                                                            gboolean nameOnly);
+
+/* Icon Themes */
+MateThemeIconInfo *mate_theme_icon_info_new              (void);
+void                mate_theme_icon_info_free             (MateThemeIconInfo *icon_theme_info);
+MateThemeIconInfo *mate_theme_icon_info_find             (const gchar        *icon_theme_name);
+GList              *mate_theme_icon_info_find_all         (void);
+gint                mate_theme_icon_info_compare          (MateThemeIconInfo *a,
+							    MateThemeIconInfo *b);
+
+/* Cursor Themes */
+MateThemeCursorInfo *mate_theme_cursor_info_new	   (void);
+void                  mate_theme_cursor_info_free	   (MateThemeCursorInfo *info);
+MateThemeCursorInfo *mate_theme_cursor_info_find	   (const gchar          *name);
+GList                *mate_theme_cursor_info_find_all	   (void);
+gint                  mate_theme_cursor_info_compare      (MateThemeCursorInfo *a,
+							    MateThemeCursorInfo *b);
+
+/* Meta themes*/
+MateThemeMetaInfo *mate_theme_meta_info_new              (void);
+void                mate_theme_meta_info_free             (MateThemeMetaInfo *meta_theme_info);
+MateThemeMetaInfo *mate_theme_meta_info_find             (const gchar        *meta_theme_name);
+GList              *mate_theme_meta_info_find_all         (void);
+gint                mate_theme_meta_info_compare          (MateThemeMetaInfo *a,
+							    MateThemeMetaInfo *b);
+gboolean            mate_theme_meta_info_validate         (const MateThemeMetaInfo *info,
+                                                            GError            **error);
+MateThemeMetaInfo *mate_theme_read_meta_theme            (GFile              *meta_theme_uri);
+
+/* Other */
+void                mate_theme_init                       (void);
+void                mate_theme_info_register_theme_change (ThemeChangedCallback func,
+							    gpointer             data);
+
+gboolean            mate_theme_color_scheme_parse         (const gchar         *scheme,
+							    GdkRGBA             *colors);
+gboolean            mate_theme_color_scheme_equal         (const gchar         *s1,
+							    const gchar         *s2);
+
+#endif /* MATE_THEME_INFO_H */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/39.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/39.html new file mode 100644 index 00000000..2a706b5e --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/39.html @@ -0,0 +1,3987 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
   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
/* mate-theme-info.c - MATE Theme information
+ *
+ * Copyright (C) 2002 Jonathan Blandford <jrb@gnome.org>
+ * Copyright (C) 2011 Perberos
+ * All rights reserved.
+ *
+ * This file is part of the Mate Library.
+ *
+ * The Mate Library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * The Mate 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with the Mate Library; see the file COPYING.LIB.  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.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 <gmodule.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.
+#include <gio/gio.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 <libmate-desktop/mate-desktop-item.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "mate-theme-info.h"
+#include "gtkrc-utils.h"
+
+#include <X11/Xcursor/Xcursor.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define THEME_NAME "X-GNOME-Metatheme/Name"
+#define THEME_COMMENT "X-GNOME-Metatheme/Comment"
+#define GTK_THEME_KEY "X-GNOME-Metatheme/GtkTheme"
+#define GTK_COLOR_SCHEME_KEY "X-GNOME-Metatheme/GtkColorScheme"
+#define MARCO_THEME_KEY "X-GNOME-Metatheme/MetacityTheme"
+#define ICON_THEME_KEY "X-GNOME-Metatheme/IconTheme"
+#define CURSOR_THEME_KEY "X-GNOME-Metatheme/CursorTheme"
+#define NOTIFICATION_THEME_KEY "X-GNOME-Metatheme/NotificationTheme"
+#define CURSOR_SIZE_KEY "X-GNOME-Metatheme/CursorSize"
+#define APPLICATION_FONT_KEY "X-GNOME-Metatheme/ApplicationFont"
+#define DOCUMENTS_FONT_KEY "X-GNOME-Metatheme/DocumentsFont"
+#define DESKTOP_FONT_KEY "X-GNOME-Metatheme/DesktopFont"
+#define WINDOWTITLE_FONT_KEY "X-GNOME-Metatheme/WindowTitleFont"
+#define MONOSPACE_FONT_KEY "X-GNOME-Metatheme/MonospaceFont"
+#define BACKGROUND_IMAGE_KEY "X-GNOME-Metatheme/BackgroundImage"
+#define HIDDEN_KEY "X-GNOME-Metatheme/Hidden"
+
+/* Terminology used in this lib:
+ *
+ * /usr/share/themes, ~/.themes   -- top_theme_dir
+ * top_theme_dir/theme_name/      -- common_theme_dir
+ * /usr/share/icons, ~/.icons     -- top_icon_theme_dir
+ * top_icon_theme_dir/theme_name/ -- icon_common_theme_dir
+ *
+ */
+
+typedef struct _ThemeCallbackData {
+  ThemeChangedCallback   func;
+  gpointer               data;
+} ThemeCallbackData;
+
+typedef struct {
+  GFileMonitor  *common_theme_dir_handle;
+  GFileMonitor  *gtk2_dir_handle;
+  GFileMonitor  *keybinding_dir_handle;
+  GFileMonitor  *marco_dir_handle;
+  gint           priority;
+} CommonThemeDirMonitorData;
+
+typedef struct {
+  GFileMonitor  *common_icon_theme_dir_handle;
+  gint           priority;
+} CommonIconThemeDirMonitorData;
+
+typedef struct {
+  GHashTable  *handle_hash;
+  gint         priority;
+} CallbackTuple;
+
+/* Hash tables */
+
+/* The hashes_by_dir are indexed by an escaped uri of the common_theme_dir that
+ * that particular theme is part of.  The data pointed to by them is a
+ * MateTheme{Meta,Icon,}Info struct.  Note that the uri is of the form
+ * "file:///home/username/.themes/foo", and not "/home/username/.themes/foo"
+ */
+
+/* The hashes_by_name are hashed by the index of the theme.  The data pointed to
+ * by them is a GList whose data elements are MateTheme{Meta,Icon,}Info
+ * structs.  This is because a theme can be found both in the users ~/.theme as
+ * well as globally in $prefix.  All access to them must be done via helper
+ * functions.
+ */
+static GList      *callbacks = NULL;
+
+static GHashTable *meta_theme_hash_by_uri;
+static GHashTable *meta_theme_hash_by_name;
+static GHashTable *icon_theme_hash_by_uri;
+static GHashTable *icon_theme_hash_by_name;
+static GHashTable *cursor_theme_hash_by_uri;
+static GHashTable *cursor_theme_hash_by_name;
+static GHashTable *theme_hash_by_uri;
+static GHashTable *theme_hash_by_name;
+static gboolean    initting = FALSE;
+
+/* private functions */
+static gint
+safe_strcmp (const gchar *a_str,
+             const gchar *b_str)
+{
+  if (a_str && b_str)
+    return strcmp (a_str, b_str);
+  else
+    return a_str - b_str;
+}
+
+static GFileType
+get_file_type (GFile *file)
+{
+  GFileType file_type = G_FILE_TYPE_UNKNOWN;
+  GFileInfo *file_info;
+
+  file_info = g_file_query_info (file,
+                                 G_FILE_ATTRIBUTE_STANDARD_TYPE,
+                                 G_FILE_QUERY_INFO_NONE,
+                                 NULL, NULL);
+  if (file_info != NULL) {
+    file_type = g_file_info_get_file_type (file_info);
+    g_object_unref (file_info);
+  }
+
+  return file_type;
+}
+
+static void
+add_theme_to_hash_by_name (GHashTable *hash_table,
+                           gpointer    data)
+{
+  MateThemeCommonInfo *info = data;
+  GList *list;
+
+  list = g_hash_table_lookup (hash_table, info->name);
+  if (list == NULL) {
+    list = g_list_append (list, info);
+  } else {
+    GList *list_ptr = list;
+    gboolean added = FALSE;
+
+    while (list_ptr) {
+      gint theme_priority;
+
+      theme_priority = ((MateThemeCommonInfo *) list_ptr->data)->priority;
+
+      if (theme_priority == info->priority) {
+        /* Swap it in */
+        list_ptr->data = info;
+        added = TRUE;
+        break;
+      } else if (theme_priority > info->priority) {
+        list = g_list_insert_before (list, list_ptr, info);
+        added = TRUE;
+        break;
+      }
+      list_ptr = list_ptr->next;
+    }
+    if (!added)
+      list = g_list_append (list, info);
+  }
+  g_hash_table_insert (hash_table,
+                       g_strdup (info->name),
+                       list);
+}
+
+static void
+remove_theme_from_hash_by_name (GHashTable *hash_table,
+                                gpointer    data)
+{
+  MateThemeCommonInfo *info = data;
+  GList *list;
+
+  list = g_hash_table_lookup (hash_table, info->name);
+
+  list = g_list_remove (list, info);
+  if (list == NULL)
+    g_hash_table_remove (hash_table, info->name);
+  else
+    g_hash_table_insert (hash_table, g_strdup (info->name), list);
+}
+
+static MateThemeCommonInfo *
+get_theme_from_hash_by_name (GHashTable  *hash_table,
+                             const gchar *name,
+                             gint         priority)
+{
+  GList *list;
+
+  list = g_hash_table_lookup (hash_table, name);
+
+  /* -1 implies return the first one */
+  if (priority == -1) {
+    return list ? list->data : NULL;
+  }
+
+  while (list) {
+    MateThemeCommonInfo *info = (MateThemeCommonInfo *) list->data;
+
+    if (info->priority == priority)
+      return info;
+
+    list = list->next;
+  }
+  return NULL;
+}
+
+static gint
+theme_compare (MateThemeCommonInfo *a,
+               MateThemeCommonInfo *b)
+{
+  gint cmp;
+
+  g_return_val_if_fail (a->type == b->type, a->type - b->type);
+
+  switch (a->type) {
+  case MATE_THEME_TYPE_METATHEME:
+    cmp = mate_theme_meta_info_compare (
+                    (MateThemeMetaInfo *) a, (MateThemeMetaInfo *) b);
+    break;
+  case MATE_THEME_TYPE_ICON:
+    cmp = mate_theme_icon_info_compare (
+                    (MateThemeIconInfo *) a, (MateThemeIconInfo *) b);
+    break;
+  case MATE_THEME_TYPE_CURSOR:
+    cmp = mate_theme_cursor_info_compare (
+                    (MateThemeCursorInfo *) a, (MateThemeCursorInfo *) b);
+    break;
+  default:
+    /* not supported at this time */
+    g_assert_not_reached ();
+  }
+
+  return cmp;
+}
+
+static void
+theme_free (MateThemeCommonInfo *info)
+{
+  switch (info->type) {
+  case MATE_THEME_TYPE_METATHEME:
+    mate_theme_meta_info_free ((MateThemeMetaInfo *) info);
+    break;
+  case MATE_THEME_TYPE_ICON:
+    mate_theme_icon_info_free ((MateThemeIconInfo *) info);
+    break;
+  case MATE_THEME_TYPE_REGULAR:
+    mate_theme_info_free ((MateThemeInfo *) info);
+    break;
+  case MATE_THEME_TYPE_CURSOR:
+    mate_theme_cursor_info_free ((MateThemeCursorInfo *) info);
+    break;
+  default:
+    g_assert_not_reached ();
+  }
+}
+
+GQuark
+mate_theme_info_error_quark (void)
+{
+  return g_quark_from_static_string ("mate-theme-info-error-quark");
+}
+
+MateThemeMetaInfo *
+mate_theme_read_meta_theme (GFile *meta_theme_uri)
+{
+  MateThemeMetaInfo *meta_theme_info;
+  GFile             *common_theme_dir_uri;
+  MateDesktopItem   *meta_theme_ditem;
+  gchar             *meta_theme_file;
+  const gchar       *str;
+  gchar             *scheme;
+
+  meta_theme_file = g_file_get_uri (meta_theme_uri);
+  meta_theme_ditem = mate_desktop_item_new_from_uri (meta_theme_file, 0, NULL);
+  g_free (meta_theme_file);
+
+  if (meta_theme_ditem == NULL)
+    return NULL;
+
+  common_theme_dir_uri = g_file_get_parent (meta_theme_uri);
+
+  meta_theme_info = mate_theme_meta_info_new ();
+
+  /* meta_theme_info->path */
+  meta_theme_info->path = g_file_get_path (meta_theme_uri);
+
+  /* meta_theme_info->name */
+  meta_theme_info->name = g_file_get_basename (common_theme_dir_uri);
+
+  g_object_unref (common_theme_dir_uri);
+
+  /* meta_theme_info->readable_name */
+  str = mate_desktop_item_get_localestring (meta_theme_ditem,
+                                            THEME_NAME);
+  if (str == NULL) {
+    str = mate_desktop_item_get_localestring (meta_theme_ditem,
+                                              MATE_DESKTOP_ITEM_NAME);
+    if (str == NULL) /* shouldn't reach */
+      goto mate_theme_read_meta_theme_out;
+  }
+  meta_theme_info->readable_name = g_strdup (str);
+
+  /* meta_theme_info->comment */
+  str = mate_desktop_item_get_localestring (meta_theme_ditem,
+                                            THEME_COMMENT);
+  if (str == NULL)
+    str = mate_desktop_item_get_localestring (meta_theme_ditem,
+                                              MATE_DESKTOP_ITEM_COMMENT);
+  if (str != NULL)
+    meta_theme_info->comment = g_strdup (str);
+
+  /* meta_theme_info->icon_file */
+  str = mate_desktop_item_get_string (meta_theme_ditem,
+                                      MATE_DESKTOP_ITEM_ICON);
+  if (str != NULL)
+    meta_theme_info->icon_file = g_strdup(str);
+
+  /* meta_theme_info->gtk_theme_name */
+  str = mate_desktop_item_get_string (meta_theme_ditem,
+                                      GTK_THEME_KEY);
+  if (str == NULL)
+    goto mate_theme_read_meta_theme_out;
+  meta_theme_info->gtk_theme_name = g_strdup (str);
+
+  /* meta_theme_info->gtk_color_scheme */
+  str = mate_desktop_item_get_string (meta_theme_ditem,
+                                      GTK_COLOR_SCHEME_KEY);
+  if (str == NULL || str[0] == '\0')
+    scheme = gtkrc_get_color_scheme_for_theme (meta_theme_info->gtk_theme_name);
+  else
+    scheme = g_strdup(str);
+
+  if (scheme != NULL) {
+    meta_theme_info->gtk_color_scheme = scheme;
+
+    for (; *scheme != '\0'; scheme++)
+      if (*scheme == ',')
+
+    *scheme = '\n';
+  }
+
+  /* meta_theme_info->marco_theme_name */
+  str = mate_desktop_item_get_string (meta_theme_ditem,
+                                      MARCO_THEME_KEY);
+  if (str == NULL)
+    goto mate_theme_read_meta_theme_out;
+  meta_theme_info->marco_theme_name = g_strdup (str);
+
+  /* meta_theme_info->icon_theme_name */
+  str = mate_desktop_item_get_string (meta_theme_ditem,
+                                      ICON_THEME_KEY);
+  if (str == NULL)
+    goto mate_theme_read_meta_theme_out;
+  meta_theme_info->icon_theme_name = g_strdup (str);
+
+  /* meta_theme_info->notification_theme_name */
+  str = mate_desktop_item_get_string (meta_theme_ditem,
+                                      NOTIFICATION_THEME_KEY);
+  if (str != NULL)
+     meta_theme_info->notification_theme_name = g_strdup (str);
+
+  /* meta_theme_info->cursor_theme_name
+   * meta_theme_info->cursor_size */
+  str = mate_desktop_item_get_string (meta_theme_ditem,
+                                      CURSOR_THEME_KEY);
+  if (str != NULL) {
+    meta_theme_info->cursor_theme_name = g_strdup (str);
+
+    str = mate_desktop_item_get_string (meta_theme_ditem,
+                                        CURSOR_SIZE_KEY);
+    if (str != NULL)
+      meta_theme_info->cursor_size = (int) g_ascii_strtoll (str, NULL, 10);
+    else
+      meta_theme_info->cursor_size = 24;
+  } else {
+    meta_theme_info->cursor_theme_name = g_strdup ("default");
+    meta_theme_info->cursor_size = 24;
+  }
+
+  /* meta_theme_info->application_font */
+  str = mate_desktop_item_get_string (meta_theme_ditem,
+                                      APPLICATION_FONT_KEY);
+  if (str != NULL)
+    meta_theme_info->application_font = g_strdup (str);
+
+  /* meta_theme_info->documents_font */
+  str = mate_desktop_item_get_string (meta_theme_ditem,
+                                      DOCUMENTS_FONT_KEY);
+  if (str != NULL)
+    meta_theme_info->documents_font = g_strdup (str);
+
+  /* meta_theme_info->desktop_font */
+  str = mate_desktop_item_get_string (meta_theme_ditem,
+                                      DESKTOP_FONT_KEY);
+  if (str != NULL)
+    meta_theme_info->desktop_font = g_strdup (str);
+
+  /* meta_theme_info->windowtitle_font */
+  str = mate_desktop_item_get_string (meta_theme_ditem,
+                                      WINDOWTITLE_FONT_KEY);
+  if (str != NULL)
+    meta_theme_info->windowtitle_font = g_strdup (str);
+
+  /* meta_theme_info->monospace_font */
+  str = mate_desktop_item_get_string (meta_theme_ditem,
+                                      MONOSPACE_FONT_KEY);
+  if (str != NULL)
+    meta_theme_info->monospace_font = g_strdup (str);
+
+  /* meta_theme_info->background_image */
+  str = mate_desktop_item_get_string (meta_theme_ditem,
+                                      BACKGROUND_IMAGE_KEY);
+  if (str != NULL)
+      meta_theme_info->background_image = g_strdup (str);
+
+  /* meta_theme_info->hidden */
+  meta_theme_info->hidden = mate_desktop_item_get_boolean (meta_theme_ditem,
+                                                           HIDDEN_KEY);
+
+  mate_desktop_item_unref (meta_theme_ditem);
+
+  return meta_theme_info;
+
+mate_theme_read_meta_theme_out:
+  mate_theme_meta_info_free (meta_theme_info);
+  return NULL;
+}
+
+static MateThemeIconInfo *
+read_icon_theme (GFile *icon_theme_uri)
+{
+  MateThemeIconInfo *icon_theme_info;
+  MateDesktopItem *icon_theme_ditem;
+  gchar *icon_theme_file;
+  gchar *dir_name;
+  const gchar *name;
+  const gchar *directories;
+
+  icon_theme_file = g_file_get_uri (icon_theme_uri);
+  icon_theme_ditem = mate_desktop_item_new_from_uri (icon_theme_file, 0, NULL);
+  g_free (icon_theme_file);
+
+  if (icon_theme_ditem == NULL)
+    return NULL;
+
+  name = mate_desktop_item_get_localestring (icon_theme_ditem,
+                                             "Icon Theme/Name");
+  if (!name) {
+    name = mate_desktop_item_get_localestring (icon_theme_ditem,
+                                               MATE_DESKTOP_ITEM_NAME);
+    if (!name)
+      goto read_icon_theme_out;
+  }
+
+  /* If index.theme has no Directories entry, it is only a cursor theme */
+  directories = mate_desktop_item_get_string (icon_theme_ditem,
+                                              "Icon Theme/Directories");
+  if (directories == NULL)
+    goto read_icon_theme_out;
+
+  icon_theme_info = mate_theme_icon_info_new ();
+  icon_theme_info->readable_name = g_strdup (name);
+  icon_theme_info->path = g_file_get_path (icon_theme_uri);
+  icon_theme_info->hidden = mate_desktop_item_get_boolean (icon_theme_ditem,
+                                                           "Icon Theme/Hidden");
+  dir_name = g_path_get_dirname (icon_theme_info->path);
+  icon_theme_info->name = g_path_get_basename (dir_name);
+  g_free (dir_name);
+
+  mate_desktop_item_unref (icon_theme_ditem);
+
+  return icon_theme_info;
+
+read_icon_theme_out:
+  mate_desktop_item_unref (icon_theme_ditem);
+  return NULL;
+}
+
+static void
+add_default_cursor_theme (void)
+{
+  MateThemeCursorInfo *theme_info;
+
+  theme_info = mate_theme_cursor_info_new ();
+  theme_info->path = g_strdup ("builtin");
+  theme_info->name = g_strdup ("default");
+  theme_info->readable_name = g_strdup (_("Default Pointer"));
+  theme_info->sizes = g_array_sized_new (FALSE, FALSE, sizeof (gint), 0);
+
+  g_hash_table_insert (cursor_theme_hash_by_uri, theme_info->path, theme_info);
+  add_theme_to_hash_by_name (cursor_theme_hash_by_name, theme_info);
+}
+
+static GdkPixbuf *
+gdk_pixbuf_from_xcursor_image (XcursorImage *cursor)
+{
+  GdkPixbuf *pixbuf;
+#define BUF_SIZE sizeof(guint32) * cursor->width * cursor->height
+  guchar *buf = g_malloc0 (BUF_SIZE);
+  guchar *it;
+
+  for (it = buf; it < (buf + BUF_SIZE); it += 4) {
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
+    /* on little endianess it's BGRA to RGBA */
+    it[0] = ((guchar *) (cursor->pixels))[it - buf + 2];
+    it[1] = ((guchar *) (cursor->pixels))[it - buf + 1];
+    it[2] = ((guchar *) (cursor->pixels))[it - buf + 0];
+    it[3] = ((guchar *) (cursor->pixels))[it - buf + 3];
+#else
+    /* on big endianess it's ARGB to RGBA */
+    it[0] = ((guchar *) cursor->pixels)[it - buf + 1];
+    it[1] = ((guchar *) cursor->pixels)[it - buf + 2];
+    it[2] = ((guchar *) cursor->pixels)[it - buf + 3];
+    it[3] = ((guchar *) cursor->pixels)[it - buf + 0];
+#endif
+  }
+
+  pixbuf = gdk_pixbuf_new_from_data ((const guchar *) buf,
+                                     GDK_COLORSPACE_RGB, TRUE, 8,
+                                     cursor->width, cursor->height,
+                                     cursor->width * 4,
+                                     (GdkPixbufDestroyNotify) g_free,
+                                     NULL);
+
+  if (!pixbuf)
+    g_free (buf);
+
+  return pixbuf;
+}
+
+static MateThemeCursorInfo *
+read_cursor_theme (GFile *cursor_theme_uri)
+{
+  MateThemeCursorInfo *cursor_theme_info = NULL;
+  GFile *parent_uri, *cursors_uri;
+
+  const gint filter_sizes[] = { 12, 16, 18, 24, 32, 36, 40, 48, 64, 96, 128 };
+  const gint num_sizes = G_N_ELEMENTS (filter_sizes);
+
+  parent_uri = g_file_get_parent (cursor_theme_uri);
+  cursors_uri = g_file_get_child (parent_uri, "cursors");
+
+  if (get_file_type (cursors_uri) == G_FILE_TYPE_DIRECTORY) {
+    GArray *sizes;
+    XcursorImage *cursor;
+    GdkPixbuf *thumbnail = NULL;
+    gchar *name;
+    gint i;
+
+    name = g_file_get_basename (parent_uri);
+
+    sizes = g_array_sized_new (FALSE, FALSE, sizeof (gint), num_sizes);
+
+    for (i = 0; i < num_sizes; ++i) {
+      cursor = XcursorLibraryLoadImage ("left_ptr", name, filter_sizes[i]);
+
+      if (cursor) {
+        if (cursor->size == filter_sizes[i]) {
+          g_array_append_val (sizes, filter_sizes[i]);
+
+          if (thumbnail == NULL && i >= 1)
+            thumbnail = gdk_pixbuf_from_xcursor_image (cursor);
+        }
+
+        XcursorImageDestroy (cursor);
+      }
+    }
+
+    if (sizes->len == 0) {
+      g_array_free (sizes, TRUE);
+      g_free (name);
+    } else {
+      MateDesktopItem *cursor_theme_ditem;
+      gchar *cursor_theme_file;
+
+      if (!thumbnail) {
+        cursor = XcursorLibraryLoadImage ("left_ptr", name,
+                                          g_array_index (sizes, gint, 0));
+        if (cursor) {
+          thumbnail = gdk_pixbuf_from_xcursor_image (cursor);
+          XcursorImageDestroy (cursor);
+        }
+      }
+
+      cursor_theme_info = mate_theme_cursor_info_new ();
+      cursor_theme_info->path = g_file_get_path (parent_uri);
+      cursor_theme_info->name = name;
+      cursor_theme_info->sizes = sizes;
+      cursor_theme_info->thumbnail = thumbnail;
+
+      cursor_theme_file = g_file_get_path (cursor_theme_uri);
+      cursor_theme_ditem = mate_desktop_item_new_from_file (cursor_theme_file, 0, NULL);
+      g_free (cursor_theme_file);
+
+      if (cursor_theme_ditem != NULL) {
+        const gchar *readable_name;
+
+        readable_name = mate_desktop_item_get_string (cursor_theme_ditem,
+                                                      "Icon Theme/Name");
+        if (readable_name)
+          cursor_theme_info->readable_name = g_strdup (readable_name);
+        else
+          cursor_theme_info->readable_name = g_strdup (name);
+
+        cursor_theme_info->hidden = mate_desktop_item_get_boolean (cursor_theme_ditem,
+                                                                   "Icon Theme/Hidden");
+
+        mate_desktop_item_unref (cursor_theme_ditem);
+      } else {
+        cursor_theme_info->readable_name = g_strdup (name);
+      }
+    }
+  }
+
+  g_object_unref (cursors_uri);
+  g_object_unref (parent_uri);
+
+  return cursor_theme_info;
+}
+
+static void
+handle_change_signal (gpointer             data,
+                      MateThemeChangeType  change_type,
+                      MateThemeElement     element_type)
+{
+#ifdef DEBUG
+  gchar *type_str = NULL;
+  gchar *change_str = NULL;<--- Variable 'change_str' can be declared as pointer to const
+  gchar *element_str = NULL;
+#endif
+  MateThemeCommonInfo *theme = data;
+  GList *list;
+
+  if (initting)
+    return;
+
+  for (list = callbacks; list; list = list->next) {
+    ThemeCallbackData *callback_data = list->data;
+    (* callback_data->func) (theme, change_type, element_type, callback_data->data);
+  }
+
+#ifdef DEBUG
+  if (theme->type == MATE_THEME_TYPE_METATHEME)
+    type_str = "meta";
+  else if (theme->type == MATE_THEME_TYPE_ICON)
+    type_str = "icon";
+  else if (theme->type == MATE_THEME_TYPE_CURSOR)
+    type_str = "cursor";
+  else if (theme->type == MATE_THEME_TYPE_REGULAR) {
+    if (element_type & MATE_THEME_GTK_2)
+      element_str = "gtk-2";
+    else if (element_type & MATE_THEME_GTK_2_KEYBINDING)
+      element_str = "keybinding";
+    else if (element_type & MATE_THEME_MARCO)
+      element_str = "marco";
+  }
+
+  if (change_type == MATE_THEME_CHANGE_CREATED)
+    change_str = "created";<--- Variable 'change_str' is assigned a value that is never used.
+  else if (change_type == MATE_THEME_CHANGE_CHANGED)
+    change_str = "changed";<--- Variable 'change_str' is assigned a value that is never used.
+  else if (change_type == MATE_THEME_CHANGE_DELETED)
+    change_str = "deleted";<--- Variable 'change_str' is assigned a value that is never used.
+
+  if (type == MATE_THEME_TYPE_REGULAR) {
+    g_print ("theme \"%s\" has a theme of type %s (priority %d) has been %s\n",
+             theme->name,
+             element_str,
+             theme->priority,
+             type_str);
+  } else if (type_str != NULL) {
+    g_print ("%s theme \"%s\" (priority %d) has been %s\n",
+             type_str,
+             theme->name,
+             theme->priority,
+             type_str);
+    }
+#endif
+}
+
+/* index_uri should point to the gtkrc file that was modified */
+static void
+update_theme_index (GFile            *index_uri,
+                    MateThemeElement  key_element,
+                    gint              priority)
+{
+  gboolean theme_exists;
+  MateThemeInfo *theme_info;
+  GFile *parent;
+  GFile *common_theme_dir_uri;
+  gchar *common_theme_dir;
+
+  /* First, we determine the new state of the file.  We do no more
+   * sophisticated a test than "files exists and is a file" */
+  theme_exists = (get_file_type (index_uri) == G_FILE_TYPE_REGULAR);
+
+  /* Next, we see what currently exists */
+  parent = g_file_get_parent (index_uri);
+  common_theme_dir_uri = g_file_get_parent (parent);
+  common_theme_dir = g_file_get_path (common_theme_dir_uri);
+
+  theme_info = g_hash_table_lookup (theme_hash_by_uri, common_theme_dir);
+  if (theme_info == NULL) {
+    if (theme_exists) {
+      theme_info = mate_theme_info_new ();
+      theme_info->path = g_strdup (common_theme_dir);
+      theme_info->name = g_file_get_basename (common_theme_dir_uri);
+      theme_info->readable_name = g_strdup (theme_info->name);
+      theme_info->priority = priority;
+      if (key_element & MATE_THEME_GTK_2)
+        theme_info->has_gtk = TRUE;
+      else if (key_element & MATE_THEME_GTK_2_KEYBINDING)
+        theme_info->has_keybinding = TRUE;
+      else if (key_element & MATE_THEME_MARCO)
+        theme_info->has_marco = TRUE;
+
+      g_hash_table_insert (theme_hash_by_uri, g_strdup (common_theme_dir), theme_info);
+      add_theme_to_hash_by_name (theme_hash_by_name, theme_info);
+      handle_change_signal (theme_info, MATE_THEME_CHANGE_CREATED, key_element);
+    }
+  } else {
+    gboolean theme_used_to_exist = FALSE;
+
+    if (key_element & MATE_THEME_GTK_2) {
+      theme_used_to_exist = theme_info->has_gtk;
+      theme_info->has_gtk = (theme_exists != FALSE);
+    } else if (key_element & MATE_THEME_GTK_2_KEYBINDING) {
+      theme_used_to_exist = theme_info->has_keybinding;
+      theme_info->has_keybinding = (theme_exists != FALSE);
+    } else if (key_element & MATE_THEME_MARCO) {
+      theme_used_to_exist = theme_info->has_marco;
+      theme_info->has_marco = (theme_exists != FALSE);
+    }
+
+    if (!theme_info->has_marco && !theme_info->has_keybinding && !theme_info->has_gtk) {
+      g_hash_table_remove (theme_hash_by_uri, common_theme_dir);
+      remove_theme_from_hash_by_name (theme_hash_by_name, theme_info);
+    }
+
+    if (theme_exists && theme_used_to_exist) {
+      handle_change_signal (theme_info, MATE_THEME_CHANGE_CHANGED, key_element);
+    } else if (theme_exists && !theme_used_to_exist) {
+      handle_change_signal (theme_info, MATE_THEME_CHANGE_CREATED, key_element);
+    } else if (!theme_exists && theme_used_to_exist) {
+      handle_change_signal (theme_info, MATE_THEME_CHANGE_DELETED, key_element);
+    }
+
+    if (!theme_info->has_marco && !theme_info->has_keybinding && !theme_info->has_gtk) {
+      mate_theme_info_free (theme_info);
+    }
+  }
+
+  g_free (common_theme_dir);
+  g_object_unref (parent);
+  g_object_unref (common_theme_dir_uri);
+}
+
+static void
+update_gtk2_index (GFile *gtk2_index_uri,
+                   gint   priority)
+{
+  update_theme_index (gtk2_index_uri,
+                      MATE_THEME_GTK_2,
+                      priority);
+}
+
+static void
+update_keybinding_index (GFile *keybinding_index_uri,
+                         gint   priority)
+{
+  update_theme_index (keybinding_index_uri,
+                      MATE_THEME_GTK_2_KEYBINDING,
+                      priority);
+}
+
+static void
+update_marco_index (GFile *marco_index_uri,
+                    gint   priority)
+{
+  update_theme_index (marco_index_uri,
+                      MATE_THEME_MARCO,
+                      priority);
+}
+
+static void
+update_common_theme_dir_index (GFile          *theme_index_uri,
+                               MateThemeType   type,
+                               gint            priority)
+{
+  gboolean theme_exists;
+  MateThemeCommonInfo *theme_info = NULL;
+  MateThemeCommonInfo *old_theme_info;
+  GFile *common_theme_dir_uri;
+  gchar *common_theme_dir;
+  GHashTable *hash_by_uri;
+  GHashTable *hash_by_name;
+
+  if (type == MATE_THEME_TYPE_ICON) {
+    hash_by_uri = icon_theme_hash_by_uri;
+    hash_by_name = icon_theme_hash_by_name;
+  } else if (type == MATE_THEME_TYPE_CURSOR) {
+    hash_by_uri = cursor_theme_hash_by_uri;
+    hash_by_name = cursor_theme_hash_by_name;
+  } else {
+    hash_by_uri = meta_theme_hash_by_uri;
+    hash_by_name = meta_theme_hash_by_name;
+  }
+
+  if (type != MATE_THEME_TYPE_CURSOR) {
+    /* First, we determine the new state of the file. */
+    if (get_file_type (theme_index_uri) == G_FILE_TYPE_REGULAR) {
+      /* It's an interesting file. Let's try to load it. */
+      if (type == MATE_THEME_TYPE_ICON)
+        theme_info = (MateThemeCommonInfo *) read_icon_theme (theme_index_uri);
+      else
+        theme_info = (MateThemeCommonInfo *) mate_theme_read_meta_theme (theme_index_uri);
+    } else {
+      theme_info = NULL;
+    }
+
+  }
+  /* cursor themes don't necessarily have an index file, so try those in any case */
+  else {
+    theme_info = (MateThemeCommonInfo *) read_cursor_theme (theme_index_uri);
+  }
+
+  if (theme_info) {
+    theme_info->priority = priority;
+    theme_exists = TRUE;
+  } else {
+    theme_exists = FALSE;
+  }
+
+  /* Next, we see what currently exists */
+  common_theme_dir_uri = g_file_get_parent (theme_index_uri);
+  common_theme_dir = g_file_get_path (common_theme_dir_uri);
+  g_object_unref (common_theme_dir_uri);
+
+  old_theme_info = (MateThemeCommonInfo *) g_hash_table_lookup (hash_by_uri, common_theme_dir);
+
+  if (old_theme_info == NULL) {
+    if (theme_exists) {
+      g_hash_table_insert (hash_by_uri, g_strdup (common_theme_dir), theme_info);
+      add_theme_to_hash_by_name (hash_by_name, theme_info);
+      handle_change_signal (theme_info, MATE_THEME_CHANGE_CREATED, 0);
+    }
+  } else {
+    if (theme_exists) {
+      if (theme_compare (theme_info, old_theme_info) != 0) {
+        /* Remove old theme */
+        g_hash_table_remove (hash_by_uri, common_theme_dir);
+        remove_theme_from_hash_by_name (hash_by_name, old_theme_info);
+        g_hash_table_insert (hash_by_uri, g_strdup (common_theme_dir), theme_info);
+        add_theme_to_hash_by_name (hash_by_name, theme_info);
+        handle_change_signal (theme_info, MATE_THEME_CHANGE_CHANGED, 0);
+        theme_free (old_theme_info);
+      } else {
+        theme_free (theme_info);
+      }
+    } else {
+      g_hash_table_remove (hash_by_uri, common_theme_dir);
+      remove_theme_from_hash_by_name (hash_by_name, old_theme_info);
+
+      handle_change_signal (old_theme_info, MATE_THEME_CHANGE_DELETED, 0);
+      theme_free (old_theme_info);
+    }
+  }
+
+  g_free (common_theme_dir);
+}
+
+static void
+update_meta_theme_index (GFile *meta_theme_index_uri,
+                         gint   priority)
+{
+  update_common_theme_dir_index (meta_theme_index_uri,
+                                 MATE_THEME_TYPE_METATHEME,
+                                 priority);
+}
+
+static void
+update_icon_theme_index (GFile *icon_theme_index_uri,
+                         gint   priority)
+{
+  update_common_theme_dir_index (icon_theme_index_uri,
+                                 MATE_THEME_TYPE_ICON,
+                                 priority);
+}
+
+static void
+update_cursor_theme_index (GFile *cursor_theme_index_uri,
+                           gint   priority)
+{
+  update_common_theme_dir_index (cursor_theme_index_uri,
+                                 MATE_THEME_TYPE_CURSOR,
+                                 priority);
+}
+
+static void
+gtk2_dir_changed (GFileMonitor              *monitor,
+                  GFile                     *file,
+                  GFile                     *other_file,
+                  GFileMonitorEvent          event_type,
+                  CommonThemeDirMonitorData *monitor_data)
+{
+  gchar *affected_file;
+
+  affected_file = g_file_get_basename (file);
+
+  /* The only file we care about is gtkrc */
+  if (!strcmp (affected_file, "gtkrc")) {
+    update_gtk2_index (file, monitor_data->priority);
+  }
+
+  g_free (affected_file);
+}
+
+static void
+keybinding_dir_changed (GFileMonitor              *monitor,
+                        GFile                     *file,
+                        GFile                     *other_file,
+                        GFileMonitorEvent          event_type,
+                        CommonThemeDirMonitorData *monitor_data)
+{
+  gchar *affected_file;
+
+  affected_file = g_file_get_basename (file);
+
+  /* The only file we care about is gtkrc */
+  if (!strcmp (affected_file, "gtkrc")) {
+    update_keybinding_index (file, monitor_data->priority);
+  }
+
+  g_free (affected_file);
+}
+
+static void
+marco_dir_changed (GFileMonitor              *monitor,
+                   GFile                     *file,
+                   GFile                     *other_file,
+                   GFileMonitorEvent          event_type,
+                   CommonThemeDirMonitorData *monitor_data)
+{
+  gchar *affected_file;
+
+  affected_file = g_file_get_basename (file);
+
+  /* The only file we care about is metacity-theme-(1|2).xml */
+  if (!strcmp (affected_file, "metacity-theme-1.xml") || !strcmp (affected_file, "metacity-theme-2.xml")) {
+    update_marco_index (file, monitor_data->priority);
+  }
+
+  g_free (affected_file);
+}
+
+static void
+common_theme_dir_changed (GFileMonitor              *monitor,
+                          GFile                     *file,
+                          GFile                     *other_file,
+                          GFileMonitorEvent          event_type,
+                          CommonThemeDirMonitorData *monitor_data)
+{
+  gchar *affected_file;
+
+  affected_file = g_file_get_basename (file);
+
+  /* The only file we care about is index.theme */
+  if (!strcmp (affected_file, "index.theme")) {
+    update_meta_theme_index (file, monitor_data->priority);
+  }
+
+  g_free (affected_file);
+}
+
+static void
+common_icon_theme_dir_changed (GFileMonitor                  *monitor,
+                               GFile                         *file,
+                               GFile                         *other_file,
+                               GFileMonitorEvent              event_type,
+                               CommonIconThemeDirMonitorData *monitor_data)
+{
+  gchar *affected_file;
+
+  affected_file = g_file_get_basename (file);
+
+  /* The only file we care about is index.theme */
+  if (!strcmp (affected_file, "index.theme")) {
+    update_icon_theme_index (file, monitor_data->priority);
+    update_cursor_theme_index (file, monitor_data->priority);
+  }
+  /* and the cursors subdir for cursor themes */
+  else if (!strcmp (affected_file, "cursors")) {
+    /* always call update_cursor_theme_index with the index.theme URI */
+    GFile *parent, *index;
+
+    parent = g_file_get_parent (file);
+    index = g_file_get_child (parent, "index.theme");
+    g_object_unref (parent);
+
+    update_cursor_theme_index (index, monitor_data->priority);
+
+    g_object_unref (index);
+  }
+
+  g_free (affected_file);
+}
+
+/* Add a monitor to a common_theme_dir. */
+static gboolean
+add_common_theme_dir_monitor (GFile                      *theme_dir_uri,
+                              CommonThemeDirMonitorData  *monitor_data,
+                              GError                    **error)
+{
+  GFile *uri, *subdir;
+  GFileMonitor *monitor;
+
+  uri = g_file_get_child (theme_dir_uri, "index.theme");
+  update_meta_theme_index (uri, monitor_data->priority);
+  g_object_unref (uri);
+
+  /* Add the handle for this directory */
+  monitor = g_file_monitor_file (theme_dir_uri, G_FILE_MONITOR_NONE, NULL, NULL);
+  if (monitor == NULL)
+    return FALSE;
+
+  g_signal_connect (monitor, "changed",
+                    (GCallback) common_theme_dir_changed,
+                    monitor_data);
+
+  monitor_data->common_theme_dir_handle = monitor;
+
+  /* gtk-2 theme subdir */
+  subdir = g_file_get_child (theme_dir_uri, "gtk-2.0");
+  uri = g_file_get_child (subdir, "gtkrc");
+  if (g_file_query_exists (uri, NULL)) {
+    update_gtk2_index (uri, monitor_data->priority);
+  }
+  g_object_unref (uri);
+
+  monitor = g_file_monitor_directory (subdir, G_FILE_MONITOR_NONE, NULL, NULL);
+  if (monitor != NULL) {
+    g_signal_connect (monitor, "changed",
+                      (GCallback) gtk2_dir_changed,
+                      monitor_data);
+  }
+  monitor_data->gtk2_dir_handle = monitor;
+  g_object_unref (subdir);
+
+  /* keybinding theme subdir */
+  subdir = g_file_get_child (theme_dir_uri, "gtk-2.0-key");
+  uri = g_file_get_child (subdir, "gtkrc");
+  if (g_file_query_exists (uri, NULL)) {
+    update_keybinding_index (uri, monitor_data->priority);
+  }
+  g_object_unref (uri);
+
+  monitor = g_file_monitor_directory (subdir, G_FILE_MONITOR_NONE, NULL, NULL);
+  if (monitor != NULL) {
+    g_signal_connect (monitor, "changed",
+                      (GCallback) keybinding_dir_changed,
+                      monitor_data);
+  }
+  monitor_data->keybinding_dir_handle = monitor;
+  g_object_unref (subdir);
+
+  /* marco theme subdir */
+  subdir = g_file_get_child (theme_dir_uri, "metacity-1");
+  uri = g_file_get_child (subdir, "metacity-theme-2.xml");
+  if (g_file_query_exists (uri, NULL)) {
+    update_marco_index (uri, monitor_data->priority);
+  }
+  else {
+    g_object_unref (uri);
+    uri = g_file_get_child (subdir, "metacity-theme-1.xml");
+    if (g_file_query_exists (uri, NULL)) {
+      update_marco_index (uri, monitor_data->priority);
+    }
+  }
+  g_object_unref (uri);
+
+  monitor = g_file_monitor_directory (subdir, G_FILE_MONITOR_NONE, NULL, NULL);
+  if (monitor != NULL) {
+    g_signal_connect (monitor, "changed",
+                      (GCallback) marco_dir_changed,
+                      monitor_data);
+  }
+  monitor_data->marco_dir_handle = monitor;
+  g_object_unref (subdir);
+
+  return TRUE;
+}
+
+static gboolean
+add_common_icon_theme_dir_monitor (GFile                          *theme_dir_uri,
+                                   CommonIconThemeDirMonitorData  *monitor_data,
+                                   GError                        **error)
+{
+  GFile *index_uri;
+  GFileMonitor *monitor;
+
+  /* Add the handle for this directory */
+  index_uri = g_file_get_child (theme_dir_uri, "index.theme");
+  update_icon_theme_index (index_uri, monitor_data->priority);
+  update_cursor_theme_index (index_uri, monitor_data->priority);
+  g_object_unref (index_uri);
+
+  monitor = g_file_monitor_file (theme_dir_uri, G_FILE_MONITOR_NONE, NULL, NULL);
+  if (monitor == NULL)
+    return FALSE;
+
+  g_signal_connect (monitor, "changed",
+                    (GCallback) common_icon_theme_dir_changed,
+                    monitor_data);
+
+  monitor_data->common_icon_theme_dir_handle = monitor;
+  return TRUE;
+}
+
+static void
+remove_common_theme_dir_monitor (CommonThemeDirMonitorData *monitor_data)
+{
+  g_file_monitor_cancel (monitor_data->common_theme_dir_handle);
+  g_file_monitor_cancel (monitor_data->gtk2_dir_handle);
+  g_file_monitor_cancel (monitor_data->keybinding_dir_handle);
+  g_file_monitor_cancel (monitor_data->marco_dir_handle);
+}
+
+static void
+remove_common_icon_theme_dir_monitor (CommonIconThemeDirMonitorData *monitor_data)
+{
+  g_file_monitor_cancel (monitor_data->common_icon_theme_dir_handle);
+}
+
+static void
+top_theme_dir_changed (GFileMonitor      *monitor,
+                       GFile             *file,
+                       GFile             *other_file,
+                       GFileMonitorEvent  event_type,
+                       CallbackTuple     *tuple)
+{
+  GHashTable *handle_hash;
+  CommonThemeDirMonitorData *monitor_data;
+  gint priority;
+
+  handle_hash = tuple->handle_hash;
+  priority = tuple->priority;
+
+  if (event_type == G_FILE_MONITOR_EVENT_CREATED) {
+    if (get_file_type (file) == G_FILE_TYPE_DIRECTORY) {
+      monitor_data = g_new0 (CommonThemeDirMonitorData, 1);
+      monitor_data->priority = priority;
+      add_common_theme_dir_monitor (file, monitor_data, NULL);
+      g_hash_table_insert (handle_hash, g_file_get_basename (file), monitor_data);
+    }
+
+  } else if (event_type == G_FILE_MONITOR_EVENT_DELETED) {
+    gchar *name;
+
+    name = g_file_get_basename (file);
+    monitor_data = g_hash_table_lookup (handle_hash, name);
+    if (monitor_data != NULL) {
+      remove_common_theme_dir_monitor (monitor_data);
+      g_hash_table_remove (handle_hash, name);
+    }
+    g_free (name);
+  }
+}
+
+static void
+top_icon_theme_dir_changed (GFileMonitor      *monitor,
+                            GFile             *file,
+                            GFile             *other_file,
+                            GFileMonitorEvent  event_type,
+                            CallbackTuple     *tuple)
+{
+  GHashTable *handle_hash;
+  CommonIconThemeDirMonitorData *monitor_data;
+  gint priority;
+
+  handle_hash = tuple->handle_hash;
+  priority = tuple->priority;
+
+  if (event_type == G_FILE_MONITOR_EVENT_CREATED) {
+    if (get_file_type (file) == G_FILE_TYPE_DIRECTORY) {
+      monitor_data = g_new0 (CommonIconThemeDirMonitorData, 1);
+      monitor_data->priority = priority;
+      add_common_icon_theme_dir_monitor (file, monitor_data, NULL);
+      g_hash_table_insert (handle_hash, g_file_get_basename (file), monitor_data);
+    }
+
+  } else if (event_type == G_FILE_MONITOR_EVENT_DELETED) {
+    gchar *name;
+
+    name = g_file_get_basename (file);
+    monitor_data = g_hash_table_lookup (handle_hash, name);
+    if (monitor_data != NULL) {
+      remove_common_icon_theme_dir_monitor (monitor_data);
+      g_hash_table_remove (handle_hash, name);
+    }
+    g_free (name);
+  }
+}
+
+/* Add a monitor to a top dir.  These monitors persist for the duration of the
+ * lib.
+ */
+static gboolean
+real_add_top_theme_dir_monitor (GFile    *uri,
+                                gint      priority,
+                                gboolean  icon_theme,
+                                GError  **error)
+{
+  GFileInfo *file_info;
+  GFileMonitor *monitor;
+  GFileEnumerator *enumerator;
+  CallbackTuple *tuple;
+
+  /* Check the URI */
+  if (get_file_type (uri) != G_FILE_TYPE_DIRECTORY)
+    return FALSE;
+
+  /* handle_hash is a hash of common_theme_dir names to their monitor_data.  We
+   * use it to remove the monitor handles when a dir is removed.
+   */
+  tuple = g_new (CallbackTuple, 1);
+  tuple->handle_hash = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, (GDestroyNotify) g_free);
+  tuple->priority = priority;
+
+  /* Monitor the top directory */
+  if ((monitor = g_file_monitor_directory (uri, G_FILE_MONITOR_NONE, NULL, NULL)) != NULL) {
+    g_signal_connect (monitor, "changed",
+                      (GCallback) (icon_theme ? top_icon_theme_dir_changed : top_theme_dir_changed),
+                      tuple);
+  } else {
+    g_hash_table_destroy (tuple->handle_hash);
+    g_free (tuple);
+    return FALSE;
+  }
+
+  /* Go through the directory to add monitoring */
+  enumerator = g_file_enumerate_children (uri,
+                                          G_FILE_ATTRIBUTE_STANDARD_TYPE ","
+                                          G_FILE_ATTRIBUTE_STANDARD_NAME,
+                                          G_FILE_QUERY_INFO_NONE,
+                                          NULL, NULL);
+  if (enumerator == NULL)
+    return FALSE;
+
+  while ((file_info = g_file_enumerator_next_file (enumerator, NULL, NULL))) {
+    GFileType type = g_file_info_get_file_type (file_info);
+
+    if (type == G_FILE_TYPE_DIRECTORY || type == G_FILE_TYPE_SYMBOLIC_LINK) {
+      GFile *child;
+      const gchar *name;
+      gpointer data;
+
+      /* Add the directory */
+      name = g_file_info_get_name (file_info);
+      child = g_file_get_child (uri, name);
+
+      if (icon_theme) {
+        CommonIconThemeDirMonitorData *monitor_data;
+        monitor_data = g_new0 (CommonIconThemeDirMonitorData, 1);
+        monitor_data->priority = priority;
+        add_common_icon_theme_dir_monitor (child, monitor_data, error);
+        data = monitor_data;
+      } else {
+        CommonThemeDirMonitorData *monitor_data;
+        monitor_data = g_new0 (CommonThemeDirMonitorData, 1);
+        monitor_data->priority = priority;
+        add_common_theme_dir_monitor (child, monitor_data, error);
+        data = monitor_data;
+      }
+      g_object_unref (child);
+
+      g_hash_table_insert (tuple->handle_hash, g_strdup (name), data);
+    }
+    g_object_unref (file_info);
+  }
+  g_file_enumerator_close (enumerator, NULL, NULL);
+
+  return TRUE;
+}
+
+static gboolean
+add_top_theme_dir_monitor (GFile   *uri,
+                           gint     priority,
+                           GError **error)
+{
+  return real_add_top_theme_dir_monitor (uri, priority, FALSE, error);
+}
+
+static gboolean
+add_top_icon_theme_dir_monitor (GFile   *uri,
+                                gint     priority,
+                                GError **error)
+{
+  return real_add_top_theme_dir_monitor (uri, priority, TRUE, error);
+}
+
+/* Public functions */
+
+/* GTK/Marco/keybinding Themes */
+MateThemeInfo *
+mate_theme_info_new (void)
+{
+  MateThemeInfo *theme_info;
+
+  theme_info = g_new0 (MateThemeInfo, 1);
+  theme_info->type = MATE_THEME_TYPE_REGULAR;
+
+  return theme_info;
+}
+
+void
+mate_theme_info_free (MateThemeInfo *theme_info)
+{
+  g_free (theme_info->path);
+  g_free (theme_info->name);
+  g_free (theme_info->readable_name);
+  g_free (theme_info);
+}
+
+MateThemeInfo *
+mate_theme_info_find (const gchar *theme_name)
+{
+  return (MateThemeInfo *)
+         get_theme_from_hash_by_name (theme_hash_by_name, theme_name, -1);
+}
+
+struct MateThemeInfoHashData
+{
+  gconstpointer user_data;
+  GList *list;
+};
+
+static void
+mate_theme_info_find_by_type_helper (gpointer key,
+                                      GList *list,
+                                      struct MateThemeInfoHashData *hash_data)
+{
+  guint elements = GPOINTER_TO_INT (hash_data->user_data);
+
+  do {
+    MateThemeInfo *theme_info = list->data;
+
+    if ((elements & MATE_THEME_MARCO && theme_info->has_marco) ||
+        (elements & MATE_THEME_GTK_2 && theme_info->has_gtk) ||
+        (elements & MATE_THEME_GTK_2_KEYBINDING && theme_info->has_keybinding)) {
+      hash_data->list = g_list_prepend (hash_data->list, theme_info);
+      return;
+    }
+
+    list = list->next;
+  } while (list);
+}
+
+GList *
+mate_theme_info_find_by_type (guint elements)
+{
+  struct MateThemeInfoHashData data;
+  data.user_data = GINT_TO_POINTER (elements);
+  data.list = NULL;
+
+  g_hash_table_foreach (theme_hash_by_name,
+                        (GHFunc) mate_theme_info_find_by_type_helper,
+                        &data);
+
+  return data.list;
+}
+
+static void
+mate_theme_info_find_all_helper (const gchar  *key,
+                                 GList        *list,
+                                 GList       **themes)
+{
+  /* only return visible themes */
+  if (!((MateThemeCommonInfo*) list->data)->hidden)
+    *themes = g_list_prepend(*themes, list->data);
+}
+
+gchar*
+gtk_theme_info_missing_engine (const gchar *gtk_theme,
+                               gboolean     name_only)
+{
+  gchar* engine = NULL;
+  gchar* gtkrc;
+
+  gtkrc = gtkrc_find_named (gtk_theme);
+
+  if (gtkrc) {
+    GSList *engines = NULL;
+    GSList *l;
+
+    gtkrc_get_details (gtkrc, &engines, NULL);
+    g_free (gtkrc);
+
+    for (l = engines; l; l = l->next) {
+      /* This code do not work on distros with more of one gtk theme
+       * engine path. Like debian. But yes on others like Archlinux.
+       * Example, debian use:
+       * /usr/lib/i386-linux-gnu/2.10.0/engines/
+       * and /usr/lib/2.10.0/engines/
+       *
+       * some links
+       * http://forums.linuxmint.com/viewtopic.php?f=190&t=85015
+       */
+      gchar *full = g_module_build_path (GTK_ENGINE_DIR, l->data);
+      gboolean found = g_file_test (full, G_FILE_TEST_EXISTS);
+      if (!found) {
+         if (name_only) {
+           engine = g_strdup(l->data);
+           g_free (full);
+         } else {
+           engine = full;
+         }
+         break;
+       }
+
+       g_free(full);
+    }
+
+    g_slist_foreach (engines, (GFunc) g_free, NULL);
+    g_slist_free (engines);
+  }
+  return engine;
+}
+
+/* Icon themes */
+MateThemeIconInfo *
+mate_theme_icon_info_new (void)
+{
+  MateThemeIconInfo *icon_theme_info;
+
+  icon_theme_info = g_new0 (MateThemeIconInfo, 1);
+  icon_theme_info->type = MATE_THEME_TYPE_ICON;
+
+  return icon_theme_info;
+}
+
+void
+mate_theme_icon_info_free (MateThemeIconInfo *icon_theme_info)
+{
+  g_free (icon_theme_info->name);
+  g_free (icon_theme_info->readable_name);
+  g_free (icon_theme_info->path);
+  g_free (icon_theme_info);
+}
+
+MateThemeIconInfo *
+mate_theme_icon_info_find (const gchar *icon_theme_name)
+{
+  g_return_val_if_fail (icon_theme_name != NULL, NULL);
+
+  return (MateThemeIconInfo *)
+         get_theme_from_hash_by_name (icon_theme_hash_by_name, icon_theme_name, -1);
+}
+
+GList *
+mate_theme_icon_info_find_all (void)
+{
+  GList *list = NULL;
+
+  g_hash_table_foreach (icon_theme_hash_by_name,
+                        (GHFunc) mate_theme_info_find_all_helper,
+                        &list);
+
+  return list;
+}
+
+gint
+mate_theme_icon_info_compare (MateThemeIconInfo *a,<--- Parameter 'a' can be declared as pointer to const
+                              MateThemeIconInfo *b)<--- Parameter 'b' can be declared as pointer to const
+{
+  gint cmp;
+
+  cmp = safe_strcmp (a->path, b->path);
+  if (cmp != 0) return cmp;
+
+  return safe_strcmp (a->name, b->name);
+}
+
+/* Cursor themes */
+MateThemeCursorInfo *
+mate_theme_cursor_info_new (void)
+{
+  MateThemeCursorInfo *theme_info;
+
+  theme_info = g_new0 (MateThemeCursorInfo, 1);
+  theme_info->type = MATE_THEME_TYPE_CURSOR;
+
+  return theme_info;
+}
+
+void
+mate_theme_cursor_info_free (MateThemeCursorInfo *cursor_theme_info)
+{
+  g_free (cursor_theme_info->name);
+  g_free (cursor_theme_info->readable_name);
+  g_free (cursor_theme_info->path);
+  g_array_free (cursor_theme_info->sizes, TRUE);
+  if (cursor_theme_info->thumbnail != NULL)
+    g_object_unref (cursor_theme_info->thumbnail);
+  g_free (cursor_theme_info);
+}
+
+MateThemeCursorInfo *
+mate_theme_cursor_info_find (const gchar *cursor_theme_name)
+{
+  g_return_val_if_fail (cursor_theme_name != NULL, NULL);
+
+  return (MateThemeCursorInfo *)
+         get_theme_from_hash_by_name (cursor_theme_hash_by_name, cursor_theme_name, -1);
+}
+
+GList *
+mate_theme_cursor_info_find_all (void)
+{
+  GList *list = NULL;
+
+  g_hash_table_foreach (cursor_theme_hash_by_name,
+                        (GHFunc) mate_theme_info_find_all_helper,
+                        &list);
+
+  return list;
+}
+
+gint
+mate_theme_cursor_info_compare (MateThemeCursorInfo *a,<--- Parameter 'a' can be declared as pointer to const
+                                MateThemeCursorInfo *b)<--- Parameter 'b' can be declared as pointer to const
+{
+  gint cmp;
+
+  cmp = safe_strcmp (a->path, b->path);
+  if (cmp != 0) return cmp;
+
+  return safe_strcmp (a->name, b->name);
+}
+
+/* Meta themes */
+MateThemeMetaInfo*
+mate_theme_meta_info_new (void)
+{
+  MateThemeMetaInfo* theme_info;
+
+  theme_info = g_new0 (MateThemeMetaInfo, 1);
+  theme_info->type = MATE_THEME_TYPE_METATHEME;
+
+  return theme_info;
+}
+
+void
+mate_theme_meta_info_free (MateThemeMetaInfo *meta_theme_info)
+{
+  g_free (meta_theme_info->application_font);
+  g_free (meta_theme_info->background_image);
+  g_free (meta_theme_info->comment);
+  g_free (meta_theme_info->cursor_theme_name);
+  g_free (meta_theme_info->desktop_font);
+  g_free (meta_theme_info->documents_font);
+  g_free (meta_theme_info->gtk_color_scheme);
+  g_free (meta_theme_info->gtk_theme_name);
+  g_free (meta_theme_info->icon_file);
+  g_free (meta_theme_info->icon_theme_name);
+  g_free (meta_theme_info->marco_theme_name);
+  g_free (meta_theme_info->monospace_font);
+  g_free (meta_theme_info->name);
+  g_free (meta_theme_info->notification_theme_name);
+  g_free (meta_theme_info->path);
+  g_free (meta_theme_info->sound_theme_name);
+  g_free (meta_theme_info->windowtitle_font);
+  g_free (meta_theme_info->readable_name);
+  g_free (meta_theme_info);
+}
+
+gboolean
+mate_theme_meta_info_validate (const MateThemeMetaInfo   *info,
+                               GError                   **error)
+{
+  MateThemeInfo *theme;<--- Variable 'theme' can be declared as pointer to const
+
+  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+  theme = mate_theme_info_find (info->gtk_theme_name);
+  if (!theme || !theme->has_gtk) {
+    g_set_error (error, MATE_THEME_ERROR, MATE_THEME_ERROR_GTK_THEME_NOT_AVAILABLE,
+                 _("This theme will not look as intended because the required GTK+ theme '%s' is not installed."),
+                info->gtk_theme_name);
+    return FALSE;
+  }
+
+  theme = mate_theme_info_find (info->marco_theme_name);
+  if (!theme || !theme->has_marco) {
+    g_set_error (error, MATE_THEME_ERROR, MATE_THEME_ERROR_WM_THEME_NOT_AVAILABLE,
+                 _("This theme will not look as intended because the required window manager theme '%s' is not installed."),
+                 info->marco_theme_name);
+    return FALSE;
+  }
+
+  if (!mate_theme_icon_info_find (info->icon_theme_name)) {
+    g_set_error (error, MATE_THEME_ERROR, MATE_THEME_ERROR_ICON_THEME_NOT_AVAILABLE,
+                 _("This theme will not look as intended because the required icon theme '%s' is not installed."),
+                 info->icon_theme_name);
+    return FALSE;
+  }
+
+  return TRUE;
+}
+
+MateThemeMetaInfo *
+mate_theme_meta_info_find (const char *meta_theme_name)
+{
+  g_return_val_if_fail(meta_theme_name != NULL, NULL);
+
+  return (MateThemeMetaInfo*) get_theme_from_hash_by_name (meta_theme_hash_by_name, meta_theme_name, -1);
+}
+
+GList *
+mate_theme_meta_info_find_all (void)
+{
+  GList *list = NULL;
+
+  g_hash_table_foreach (meta_theme_hash_by_name,
+                        (GHFunc) mate_theme_info_find_all_helper,
+                        &list);
+
+  return list;
+}
+
+gint
+mate_theme_meta_info_compare (MateThemeMetaInfo *a,<--- Parameter 'a' can be declared as pointer to const
+                              MateThemeMetaInfo *b)<--- Parameter 'b' can be declared as pointer to const
+{
+  gint cmp;
+
+  cmp = safe_strcmp (a->path, b->path);
+  if (cmp != 0) return cmp;
+
+  cmp = safe_strcmp (a->readable_name, b->readable_name);
+  if (cmp != 0) return cmp;
+
+  cmp = safe_strcmp (a->name, b->name);
+  if (cmp != 0) return cmp;
+
+  cmp = safe_strcmp (a->comment, b->comment);
+  if (cmp != 0) return cmp;
+
+  cmp = safe_strcmp (a->icon_file, b->icon_file);
+  if (cmp != 0) return cmp;
+
+  cmp = safe_strcmp (a->gtk_theme_name, b->gtk_theme_name);
+  if (cmp != 0) return cmp;
+
+  cmp = safe_strcmp (a->gtk_color_scheme, b->gtk_color_scheme);
+  if (cmp != 0) return cmp;
+
+  cmp = safe_strcmp (a->marco_theme_name, b->marco_theme_name);
+  if (cmp != 0) return cmp;
+
+  cmp = safe_strcmp (a->icon_theme_name, b->icon_theme_name);
+  if (cmp != 0) return cmp;
+
+  cmp = safe_strcmp (a->notification_theme_name, b->notification_theme_name);
+  if (cmp != 0) return cmp;
+
+  cmp = safe_strcmp (a->sound_theme_name, b->sound_theme_name);
+  if (cmp != 0) return cmp;
+
+  cmp = safe_strcmp (a->application_font, b->application_font);
+  if (cmp != 0) return cmp;
+
+  cmp = safe_strcmp (a->documents_font, b->documents_font);
+  if (cmp != 0) return cmp;
+
+  cmp = safe_strcmp (a->desktop_font, b->desktop_font);
+  if (cmp != 0) return cmp;
+
+  cmp = safe_strcmp (a->windowtitle_font, b->windowtitle_font);
+  if (cmp != 0) return cmp;
+
+  cmp = safe_strcmp (a->monospace_font, b->monospace_font);
+  if (cmp != 0) return cmp;
+
+  return safe_strcmp (a->background_image, b->background_image);
+}
+
+void
+mate_theme_info_register_theme_change (ThemeChangedCallback func,
+                                       gpointer             data)
+{
+  ThemeCallbackData *callback_data;
+
+  g_return_if_fail (func != NULL);
+
+  callback_data = g_new (ThemeCallbackData, 1);
+  callback_data->func = func;
+  callback_data->data = data;
+
+  callbacks = g_list_prepend (callbacks, callback_data);
+}
+
+gboolean
+mate_theme_color_scheme_parse (const gchar *scheme,
+                               GdkRGBA     *colors)
+{
+  gchar **color_scheme_strings, **color_scheme_pair, *current_string;
+  gint i;
+
+  if (!scheme || !strcmp (scheme, ""))
+    return FALSE;
+
+  /* initialise the array */
+  for (i = 0; i < NUM_SYMBOLIC_COLORS; i++)
+    colors[i].red = colors[i].green = colors[i].blue = 0;
+
+  /* The color scheme string consists of name:color pairs, separated by
+   * newlines, so first we split the string up by new line */
+
+  color_scheme_strings = g_strsplit (scheme, "\n", 0);
+
+  /* loop through the name:color pairs, and save the color if we recognise the name */
+  i = 0;
+  while ((current_string = color_scheme_strings[i++])) {
+    color_scheme_pair = g_strsplit (current_string, ":", 0);
+
+    if (color_scheme_pair[0] != NULL && color_scheme_pair[1] != NULL) {
+      g_strstrip (color_scheme_pair[0]);
+      g_strstrip (color_scheme_pair[1]);
+
+      if (!strcmp ("fg_color", color_scheme_pair[0]))
+        gdk_rgba_parse (&colors[COLOR_FG], color_scheme_pair[1]);
+      else if (!strcmp ("bg_color", color_scheme_pair[0]))
+        gdk_rgba_parse (&colors[COLOR_BG], color_scheme_pair[1]);
+      else if (!strcmp ("text_color", color_scheme_pair[0]))
+        gdk_rgba_parse (&colors[COLOR_TEXT], color_scheme_pair[1]);
+      else if (!strcmp ("base_color", color_scheme_pair[0]))
+        gdk_rgba_parse (&colors[COLOR_BASE], color_scheme_pair[1]);
+      else if (!strcmp ("selected_fg_color", color_scheme_pair[0]))
+        gdk_rgba_parse (&colors[COLOR_SELECTED_FG], color_scheme_pair[1]);
+      else if (!strcmp ("selected_bg_color", color_scheme_pair[0]))
+        gdk_rgba_parse ( &colors[COLOR_SELECTED_BG], color_scheme_pair[1]);
+      else if (!strcmp ("tooltip_fg_color", color_scheme_pair[0]))
+        gdk_rgba_parse (&colors[COLOR_TOOLTIP_FG], color_scheme_pair[1]);
+      else if (!strcmp ("tooltip_bg_color", color_scheme_pair[0]))
+        gdk_rgba_parse (&colors[COLOR_TOOLTIP_BG], color_scheme_pair[1]);
+    }
+
+    g_strfreev (color_scheme_pair);
+  }
+
+  g_strfreev (color_scheme_strings);
+
+  return TRUE;
+}
+
+gboolean
+mate_theme_color_scheme_equal (const gchar *s1,
+                               const gchar *s2)
+{
+  GdkRGBA c1[NUM_SYMBOLIC_COLORS], c2[NUM_SYMBOLIC_COLORS];
+  int i;
+
+  if (!mate_theme_color_scheme_parse (s1, c1) ||
+      !mate_theme_color_scheme_parse (s2, c2))
+    return FALSE;
+
+  for (i = 0; i < NUM_SYMBOLIC_COLORS; ++i) {
+    if (!gdk_rgba_equal (&c1[i], &c2[i]))
+      return FALSE;
+  }
+
+  return TRUE;
+}
+
+void
+mate_theme_init ()
+{
+  const gchar * const * dirs;
+  GFile *top_theme_dir;
+  gchar *top_theme_dir_string;
+  static gboolean initted = FALSE;
+  gchar **search_path;
+  gint i, n;
+
+  if (initted)
+    return;
+
+  initting = TRUE;
+
+  meta_theme_hash_by_uri = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+  meta_theme_hash_by_name = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+  icon_theme_hash_by_uri = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+  icon_theme_hash_by_name = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+  cursor_theme_hash_by_uri = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+  cursor_theme_hash_by_name = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+  theme_hash_by_uri = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+  theme_hash_by_name = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+
+  /* Add all the toplevel theme dirs following the XDG Base Directory Specification */
+  dirs = g_get_system_data_dirs ();
+  if (dirs != NULL)
+    for (; *dirs != NULL; ++dirs) {
+      top_theme_dir_string = g_build_filename (*dirs, "themes", NULL);
+      top_theme_dir = g_file_new_for_path (top_theme_dir_string);
+      g_free (top_theme_dir_string);
+      add_top_theme_dir_monitor (top_theme_dir, 1, NULL);
+      g_object_unref (top_theme_dir);
+    }
+
+  /* ~/.themes */
+  top_theme_dir_string = g_build_filename (g_get_home_dir (), ".themes", NULL);
+  top_theme_dir = g_file_new_for_path (top_theme_dir_string);
+  g_free (top_theme_dir_string);
+  if (!g_file_query_exists (top_theme_dir, NULL))
+    g_file_make_directory (top_theme_dir, NULL, NULL);
+  add_top_theme_dir_monitor (top_theme_dir, 0, NULL);
+  g_object_unref (top_theme_dir);
+
+  /* ~/.icons */
+  top_theme_dir_string = g_build_filename (g_get_home_dir (), ".icons", NULL);
+  top_theme_dir = g_file_new_for_path (top_theme_dir_string);
+  g_free (top_theme_dir_string);
+  if (!g_file_query_exists (top_theme_dir, NULL))
+    g_file_make_directory (top_theme_dir, NULL, NULL);
+  g_object_unref (top_theme_dir);
+
+  /* icon theme search path */
+  gtk_icon_theme_get_search_path (gtk_icon_theme_get_default (), &search_path, &n);
+  for (i = 0; i < n; ++i) {
+    top_theme_dir = g_file_new_for_path (search_path[i]);
+    add_top_icon_theme_dir_monitor (top_theme_dir, i, NULL);
+    g_object_unref (top_theme_dir);
+  }
+  g_strfreev (search_path);
+
+  /* if there's a separate xcursors dir, add that as well */
+  if (strcmp (XCURSOR_ICONDIR, "/usr/share/icons")) {
+    top_theme_dir = g_file_new_for_path (XCURSOR_ICONDIR);
+    add_top_icon_theme_dir_monitor (top_theme_dir, 1, NULL);
+    g_object_unref (top_theme_dir);
+  }
+
+  /* make sure we have the default theme */
+  if (!mate_theme_cursor_info_find ("default"))
+    add_default_cursor_theme ();
+
+  /* done */
+  initted = TRUE;
+  initting = FALSE;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/4.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/4.html new file mode 100644 index 00000000..7d751e4d --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/4.html @@ -0,0 +1,255 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
1
+2
+3
+4
+5
+6
+7
+8
+9
#ifndef __MATE_ABOUT_ME_PASSWORD_H__
+#define __MATE_ABOUT_ME_PASSWORD_H__
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+void
+mate_about_me_password (GtkWindow *parent);
+
+#endif /* __MATE_ABOUT_ME_PASSWORD_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/40.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/40.html new file mode 100644 index 00000000..dff682c1 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/40.html @@ -0,0 +1,533 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
#include <config.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 "mate-theme-info.h"
+
+static gchar *
+mate_rc_get_theme_dir (void)
+{
+  const gchar *var;
+  gchar *path;
+
+  var = g_getenv ("GTK_DATA_PREFIX");
+
+  if (var)
+    path = g_build_filename (var, "share", "themes", NULL);
+  else
+    path = g_build_filename (MATEDATADIR, "share", "themes", NULL);
+
+  return path;
+}
+
+int
+main (int argc, char *argv[])
+{
+  GList *themes, *list;
+
+  gtk_init (&argc, &argv);
+  mate_theme_init ();
+
+  themes = mate_theme_meta_info_find_all ();
+  if (themes == NULL)
+    {
+      g_print ("No meta themes were found.\n");
+    }
+  else
+    {
+      g_print ("%d meta themes were found:\n", g_list_length (themes));
+      for (list = themes; list; list = list->next)
+	{
+	  MateThemeMetaInfo *meta_theme_info;
+
+	  meta_theme_info = list->data;
+	  g_print ("\t%s\n", meta_theme_info->readable_name);
+	}
+    }
+  g_list_free (themes);
+
+  themes = mate_theme_icon_info_find_all ();
+  if (themes == NULL)
+    {
+      g_print ("No icon themes were found.\n");
+    }
+  else
+    {
+      g_print ("%d icon themes were found:\n", g_list_length (themes));
+      for (list = themes; list; list = list->next)
+	{
+	  MateThemeIconInfo *icon_theme_info;
+
+	  icon_theme_info = list->data;
+	  g_print ("\t%s\n", icon_theme_info->name);
+	}
+    }
+  g_list_free (themes);
+
+  themes = mate_theme_info_find_by_type (MATE_THEME_MARCO);
+  if (themes == NULL)
+    {
+      g_print ("No marco themes were found.\n");
+    }
+  else
+    {
+      g_print ("%d marco themes were found:\n", g_list_length (themes));
+      for (list = themes; list; list = list->next)
+	{
+	  MateThemeInfo *theme_info;
+
+	  theme_info = list->data;
+	  g_print ("\t%s\n", theme_info->name);
+	}
+    }
+  g_list_free (themes);
+
+  themes = mate_theme_info_find_by_type (MATE_THEME_GTK_2);
+  if (themes == NULL)
+    {
+      gchar *str;
+
+      g_print ("No gtk-2 themes were found.  The following directories were tested:\n");
+      str = mate_rc_get_theme_dir ();
+      g_print ("\t%s\n", str);
+      g_free (str);
+      str = g_build_filename (g_get_home_dir (), ".themes", NULL);
+      g_print ("\t%s\n", str);
+      g_free (str);
+    }
+  else
+    {
+      g_print ("%d gtk-2 themes were found:\n", g_list_length (themes));
+      for (list = themes; list; list = list->next)
+	{
+	  MateThemeInfo *theme_info;
+
+	  theme_info = list->data;
+	  g_print ("\t%s\n", theme_info->name);
+	}
+    }
+  g_list_free (themes);
+
+  themes = mate_theme_info_find_by_type (MATE_THEME_GTK_2_KEYBINDING);
+  if (themes == NULL)
+    {
+      g_print ("No keybinding themes were found.\n");
+    }
+  else
+    {
+      g_print ("%d keybinding themes were found:\n", g_list_length (themes));
+      for (list = themes; list; list = list->next)
+	{
+	  MateThemeInfo *theme_info;
+
+	  theme_info = list->data;
+	  g_print ("\t%s\n", theme_info->name);
+	}
+    }
+  g_list_free (themes);
+
+  themes = mate_theme_cursor_info_find_all ();
+  if (themes == NULL)
+    {
+      g_print ("No cursor themes were found.\n");
+    }
+  else
+    {
+      g_print ("%d cursor themes were found:\n", g_list_length (themes));
+      for (list = themes; list; list = list->next)
+	{
+	  MateThemeCursorInfo *cursor_theme_info;
+
+	  cursor_theme_info = list->data;
+	  g_print ("\t%s\n", cursor_theme_info->name);
+	}
+    }
+  g_list_free (themes);
+
+  return 0;
+}
+
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/41.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/41.html new file mode 100644 index 00000000..65bc93a8 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/41.html @@ -0,0 +1,2469 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
   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
#include <config.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 <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <marco-private/util.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <marco-private/theme.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <marco-private/theme-parser.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <marco-private/preview-widget.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <signal.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <errno.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.
+
+/* We have to #undef this as marco #defines these. */
+#undef _
+#undef N_
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "theme-thumbnail.h"
+#include "gtkrc-utils.h"
+#include "capplet-util.h"
+
+typedef struct {
+	gboolean set;
+	gint thumbnail_width;
+	gint thumbnail_height;
+	GByteArray* data;
+	gchar* theme_name;
+	ThemeThumbnailFunc func;
+	gpointer user_data;
+	GDestroyNotify destroy;
+	GIOChannel* channel;
+	guint watch_id;
+} ThemeThumbnailAsyncData;
+
+static ThemeThumbnailAsyncData async_data;
+
+/* Protocol */
+
+/* Our protocol is pretty simple.  The parent process will write several strings
+ * (separated by a '\000'). They are the widget theme, the wm theme, the icon
+ * theme, etc.  Then, it will wait for the child to write back the data.  The
+ * parent expects ICON_SIZE_WIDTH * ICON_SIZE_HEIGHT * 4 bytes of information.
+ * After that, the child is ready for the next theme to render.
+ */
+
+enum {
+	READY_FOR_THEME,
+	READING_TYPE,
+	READING_CONTROL_THEME_NAME,
+	READING_GTK_COLOR_SCHEME,
+	READING_WM_THEME_NAME,
+	READING_ICON_THEME_NAME,
+	READING_APPLICATION_FONT,
+	WRITING_PIXBUF_DATA
+};
+
+typedef struct {
+	gint status;
+	GByteArray* type;
+	GByteArray* control_theme_name;
+	GByteArray* gtk_color_scheme;
+	GByteArray* wm_theme_name;
+	GByteArray* icon_theme_name;
+	GByteArray* application_font;
+} ThemeThumbnailData;
+
+typedef struct {
+	gchar* thumbnail_type;
+	gpointer theme_info;
+	ThemeThumbnailFunc func;
+	gpointer user_data;
+	GDestroyNotify destroy;
+} ThemeQueueItem;
+
+static GList* theme_queue = NULL;
+
+static int pipe_to_factory_fd[2];
+static int pipe_from_factory_fd[2];
+
+#define THUMBNAIL_TYPE_META     "meta"
+#define THUMBNAIL_TYPE_GTK      "gtk"
+#define THUMBNAIL_TYPE_MARCO    "marco"
+#define THUMBNAIL_TYPE_ICON     "icon"
+
+#define META_THUMBNAIL_SIZE       128
+#define GTK_THUMBNAIL_SIZE         96
+#define MARCO_THUMBNAIL_WIDTH  120
+#define MARCO_THUMBNAIL_HEIGHT  60
+
+static void pixbuf_apply_mask_region(GdkPixbuf* pixbuf, cairo_region_t* region)
+{
+  gint nchannels, rowstride, w, h;
+  guchar *pixels, *p;
+
+  g_return_if_fail (pixbuf);
+  g_return_if_fail (region);
+
+  nchannels = gdk_pixbuf_get_n_channels (pixbuf);
+  rowstride = gdk_pixbuf_get_rowstride (pixbuf);
+  pixels = gdk_pixbuf_get_pixels (pixbuf);
+
+  /* we need an alpha channel ... */
+  if (!gdk_pixbuf_get_has_alpha (pixbuf) || nchannels != 4)
+    return;
+
+  for (w = 0; w < gdk_pixbuf_get_width (pixbuf); ++w)
+    for (h = 0; h < gdk_pixbuf_get_height (pixbuf); ++h)
+    {
+      if (!cairo_region_contains_point (region, w, h))
+      {
+        p = pixels + h * rowstride + w * nchannels;
+        if (G_BYTE_ORDER == G_BIG_ENDIAN)
+          p[0] = 0x0;
+        else
+          p[3] = 0x0;
+      }
+    }
+
+}
+
+static GdkPixbuf *
+create_folder_icon (char *icon_theme_name)
+{
+  GtkIconTheme *icon_theme;
+  GdkPixbuf *folder_icon = NULL;
+  GtkIconInfo *folder_icon_info;
+  gchar *example_icon_name;
+  const gchar *icon_names[5];
+  gint i;
+
+  icon_theme = gtk_icon_theme_new ();
+  gtk_icon_theme_set_custom_theme (icon_theme, icon_theme_name);
+
+  i = 0;
+  /* Get the Example icon name in the theme if specified */
+  example_icon_name = gtk_icon_theme_get_example_icon_name (icon_theme);
+  if (example_icon_name != NULL)
+    icon_names[i++] = example_icon_name;
+  icon_names[i++] = "x-directory-normal";
+  icon_names[i++] = "mate-fs-directory";
+  icon_names[i++] = "folder";
+  icon_names[i++] = NULL;
+
+  folder_icon_info = gtk_icon_theme_choose_icon (icon_theme, icon_names, 48, GTK_ICON_LOOKUP_FORCE_SIZE);
+  if (folder_icon_info != NULL)
+  {
+    folder_icon = gtk_icon_info_load_icon (folder_icon_info, NULL);
+    g_object_unref (folder_icon_info);
+  }
+
+  if (folder_icon == NULL)
+  {
+    folder_icon = gtk_icon_theme_load_icon (icon_theme,
+                                            "image-missing",
+                                            48, 0, NULL);
+  }
+
+  g_object_unref (icon_theme);
+  g_free (example_icon_name);
+
+  return folder_icon;
+}
+
+static GdkPixbuf *
+create_meta_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
+{
+  GtkWidget *window;
+  GtkWidget *preview;
+  GtkWidget *vbox;
+  GtkWidget *box;
+  GtkWidget *image_button;
+  GtkWidget *checkbox;
+  GtkWidget *radio;
+
+  GtkRequisition requisition;
+  GtkAllocation allocation;
+  GtkAllocation vbox_allocation;
+  MetaFrameFlags flags;
+  MetaTheme *theme;
+  GdkPixbuf *pixbuf, *icon;
+  int icon_width, icon_height;
+  cairo_region_t *region;
+
+  g_object_set (gtk_settings_get_default (),
+    "gtk-theme-name", (char *) theme_thumbnail_data->control_theme_name->data,
+    "gtk-font-name", (char *) theme_thumbnail_data->application_font->data,
+    "gtk-icon-theme-name", (char *) theme_thumbnail_data->icon_theme_name->data,
+    "gtk-color-scheme", (char *) theme_thumbnail_data->gtk_color_scheme->data,
+    NULL);
+
+  theme = meta_theme_load ((char *) theme_thumbnail_data->wm_theme_name->data, NULL);
+  if (theme == NULL)
+    return NULL;
+
+  /* Represent the icon theme */
+  icon = create_folder_icon ((char *) theme_thumbnail_data->icon_theme_name->data);
+  icon_width = gdk_pixbuf_get_width (icon);
+  icon_height = gdk_pixbuf_get_height (icon);
+
+  /* Create a fake window */
+  flags = META_FRAME_ALLOWS_DELETE |
+          META_FRAME_ALLOWS_MENU |
+          META_FRAME_ALLOWS_MINIMIZE |
+          META_FRAME_ALLOWS_MAXIMIZE |
+          META_FRAME_ALLOWS_VERTICAL_RESIZE |
+          META_FRAME_ALLOWS_HORIZONTAL_RESIZE |
+          META_FRAME_HAS_FOCUS |
+          META_FRAME_ALLOWS_SHADE |
+          META_FRAME_ALLOWS_MOVE;
+
+  window = gtk_offscreen_window_new ();
+  preview = meta_preview_new ();
+  gtk_container_add (GTK_CONTAINER (window), preview);
+  gtk_widget_show_all (window);
+
+  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+  gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
+  gtk_container_add (GTK_CONTAINER (preview), vbox);
+
+  image_button = gtk_button_new_with_mnemonic (_("_Open"));
+  gtk_button_set_image (GTK_BUTTON (image_button), gtk_image_new_from_icon_name ("document-open", GTK_ICON_SIZE_BUTTON));
+
+  gtk_widget_set_halign (image_button, GTK_ALIGN_START);
+  gtk_widget_set_valign (image_button, GTK_ALIGN_START);
+  gtk_widget_show (image_button);
+  gtk_box_pack_start (GTK_BOX (vbox), image_button, FALSE, FALSE, 0);
+  box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+  gtk_box_pack_start (GTK_BOX (vbox), box, FALSE, FALSE, 0);
+  checkbox = gtk_check_button_new ();
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox), TRUE);
+  gtk_box_pack_start (GTK_BOX (box), checkbox, FALSE, FALSE, 0);
+  radio = gtk_radio_button_new (NULL);
+  gtk_box_pack_start (GTK_BOX (box), radio, FALSE, FALSE, 0);
+
+  gtk_widget_show_all (preview);
+
+  meta_preview_set_frame_flags (META_PREVIEW (preview), flags);
+  meta_preview_set_theme (META_PREVIEW (preview), theme);
+  meta_preview_set_title (META_PREVIEW (preview), "");
+
+  gtk_window_set_default_size (GTK_WINDOW (window), META_THUMBNAIL_SIZE, META_THUMBNAIL_SIZE);
+
+  gtk_widget_get_preferred_size (window, &requisition, NULL);
+  allocation.x = 0;
+  allocation.y = 0;
+  allocation.width = META_THUMBNAIL_SIZE;
+  allocation.height = META_THUMBNAIL_SIZE;
+  gtk_widget_size_allocate (window, &allocation);
+  gtk_widget_get_preferred_size (window, &requisition, NULL);
+
+  gtk_widget_queue_draw (window);
+  while (gtk_events_pending ())
+    gtk_main_iteration ();
+
+  pixbuf = gtk_offscreen_window_get_pixbuf (GTK_OFFSCREEN_WINDOW (window));
+
+  gtk_widget_get_allocation (vbox, &vbox_allocation);
+
+  /* Add the icon theme to the pixbuf */
+  gdk_pixbuf_composite (icon, pixbuf,
+                        vbox_allocation.x + vbox_allocation.width - icon_width - 5,
+                        vbox_allocation.y + vbox_allocation.height - icon_height - 5,
+                        icon_width, icon_height,
+                        vbox_allocation.x + vbox_allocation.width - icon_width - 5,
+                        vbox_allocation.y + vbox_allocation.height - icon_height - 5,
+                        1.0, 1.0, GDK_INTERP_BILINEAR, 255);
+  region = meta_preview_get_clip_region (META_PREVIEW (preview),
+      META_THUMBNAIL_SIZE, META_THUMBNAIL_SIZE);
+  pixbuf_apply_mask_region (pixbuf, region);
+  cairo_region_destroy (region);
+
+  g_object_unref (icon);
+  gtk_widget_destroy (window);
+  meta_theme_free (theme);
+
+  return pixbuf;
+}
+
+static GdkPixbuf *
+create_gtk_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
+{
+  GtkSettings *settings;
+  GtkWidget *window, *vbox, *box, *image_button, *checkbox, *radio;
+  GtkRequisition requisition;
+  GtkAllocation allocation;
+  GdkPixbuf *pixbuf, *retval;
+  gint width, height;
+
+  settings = gtk_settings_get_default ();
+  g_object_set (settings, "gtk-theme-name", (char *) theme_thumbnail_data->control_theme_name->data,
+			  "gtk-color-scheme", (char *) theme_thumbnail_data->gtk_color_scheme->data,
+ 			  NULL);
+
+  window = gtk_offscreen_window_new ();
+
+  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+  gtk_container_add (GTK_CONTAINER (window), vbox);
+  box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+  gtk_container_set_border_width (GTK_CONTAINER (box), 6);
+  gtk_box_pack_start (GTK_BOX (vbox), box, FALSE, FALSE, 0);
+
+  image_button = gtk_button_new_with_mnemonic (_("_Open"));
+  gtk_button_set_image (GTK_BUTTON (image_button), gtk_image_new_from_icon_name ("document-open", GTK_ICON_SIZE_BUTTON));
+
+  gtk_box_pack_start (GTK_BOX (box), image_button, FALSE, FALSE, 0);
+  checkbox = gtk_check_button_new ();
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox), TRUE);
+  gtk_box_pack_start (GTK_BOX (box), checkbox, FALSE, FALSE, 0);
+  radio = gtk_radio_button_new_from_widget (NULL);
+  gtk_box_pack_start (GTK_BOX (box), radio, FALSE, FALSE, 0);
+
+  gtk_widget_show_all (window);
+  gtk_widget_show_all (vbox);
+  gtk_widget_realize (image_button);
+  gtk_widget_realize (gtk_bin_get_child (GTK_BIN (image_button)));
+  gtk_widget_realize (checkbox);
+  gtk_widget_realize (radio);
+  gtk_widget_map (image_button);
+  gtk_widget_map (gtk_bin_get_child (GTK_BIN (image_button)));
+  gtk_widget_map (checkbox);
+  gtk_widget_map (radio);
+
+  gtk_widget_get_preferred_size (window, &requisition, NULL);
+  allocation.x = 0;
+  allocation.y = 0;
+  allocation.width = requisition.width;
+  allocation.height = requisition.height;
+  gtk_widget_size_allocate (window, &allocation);
+  gtk_widget_get_preferred_size (window, &requisition, NULL);
+
+  gtk_window_get_size (GTK_WINDOW (window), &width, &height);
+
+  gtk_widget_queue_draw (window);
+  while (gtk_events_pending ())
+    gtk_main_iteration ();
+
+  pixbuf = gtk_offscreen_window_get_pixbuf (GTK_OFFSCREEN_WINDOW (window));
+
+  retval = gdk_pixbuf_scale_simple (pixbuf,
+                                    GTK_THUMBNAIL_SIZE,
+                                    (int) GTK_THUMBNAIL_SIZE * (((double) height) / ((double) width)),
+                                    GDK_INTERP_BILINEAR);
+  g_object_unref (pixbuf);
+  gtk_widget_destroy (window);
+
+  return retval;
+}
+
+static GdkPixbuf *
+create_marco_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
+{
+  GtkWidget *window, *preview, *dummy;
+  MetaFrameFlags flags;
+  MetaTheme *theme;
+  GtkRequisition requisition;
+  GtkAllocation allocation;
+  GdkPixbuf *pixbuf, *retval;
+  cairo_region_t *region;
+
+  theme = meta_theme_load ((char *) theme_thumbnail_data->wm_theme_name->data, NULL);
+  if (theme == NULL)
+    return NULL;
+
+  flags = META_FRAME_ALLOWS_DELETE |
+          META_FRAME_ALLOWS_MENU |
+          META_FRAME_ALLOWS_MINIMIZE |
+          META_FRAME_ALLOWS_MAXIMIZE |
+          META_FRAME_ALLOWS_VERTICAL_RESIZE |
+          META_FRAME_ALLOWS_HORIZONTAL_RESIZE |
+          META_FRAME_HAS_FOCUS |
+          META_FRAME_ALLOWS_SHADE |
+          META_FRAME_ALLOWS_MOVE;
+
+  window = gtk_offscreen_window_new ();
+  gtk_window_set_default_size (GTK_WINDOW (window), (int) MARCO_THUMBNAIL_WIDTH * 1.2, (int) MARCO_THUMBNAIL_HEIGHT * 1.2);
+
+  preview = meta_preview_new ();
+  meta_preview_set_frame_flags (META_PREVIEW (preview), flags);
+  meta_preview_set_theme (META_PREVIEW (preview), theme);
+  meta_preview_set_title (META_PREVIEW (preview), "");
+  gtk_container_add (GTK_CONTAINER (window), preview);
+
+  dummy = gtk_label_new ("");
+  gtk_container_add (GTK_CONTAINER (preview), dummy);
+
+  gtk_widget_show_all (window);
+
+  gtk_widget_get_preferred_size (window, &requisition, NULL);
+  allocation.x = 0;
+  allocation.y = 0;
+  allocation.width = (int) MARCO_THUMBNAIL_WIDTH * 1.2;
+  allocation.height = (int) MARCO_THUMBNAIL_HEIGHT * 1.2;
+  gtk_widget_size_allocate (window, &allocation);
+  gtk_widget_get_preferred_size (window, &requisition, NULL);
+
+  gtk_widget_queue_draw (window);
+  while (gtk_events_pending ())
+    gtk_main_iteration ();
+
+  pixbuf = gtk_offscreen_window_get_pixbuf (GTK_OFFSCREEN_WINDOW (window));
+
+  region = meta_preview_get_clip_region (META_PREVIEW (preview),
+      MARCO_THUMBNAIL_WIDTH * 1.2, MARCO_THUMBNAIL_HEIGHT * 1.2);
+  pixbuf_apply_mask_region (pixbuf, region);
+  cairo_region_destroy (region);
+
+  retval = gdk_pixbuf_scale_simple (pixbuf,
+                                    MARCO_THUMBNAIL_WIDTH,
+                                    MARCO_THUMBNAIL_HEIGHT,
+                                    GDK_INTERP_BILINEAR);
+  g_object_unref (pixbuf);
+
+  gtk_widget_destroy (window);
+  meta_theme_free (theme);
+
+  return retval;
+}
+
+static GdkPixbuf *
+create_icon_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
+{
+  return create_folder_icon ((char *) theme_thumbnail_data->icon_theme_name->data);
+}
+
+static void
+handle_bytes (const guint8       *buffer,
+              gint                bytes_read,
+              ThemeThumbnailData *theme_thumbnail_data)
+{
+  const guint8 *ptr;
+  ptr = buffer;
+
+  while (bytes_read > 0)
+  {
+    guint8 *nil;
+
+    switch (theme_thumbnail_data->status)
+    {
+      case READY_FOR_THEME:
+        theme_thumbnail_data->status = READING_TYPE;
+        /* fall through */
+      case READING_TYPE:
+        nil = memchr (ptr, '\000', bytes_read);
+        if (nil == NULL)
+        {
+          g_byte_array_append (theme_thumbnail_data->type, ptr, bytes_read);
+          bytes_read = 0;
+        }
+        else
+        {
+          g_byte_array_append (theme_thumbnail_data->type, ptr, nil - ptr + 1);
+          bytes_read -= (nil - ptr + 1);
+          ptr = nil + 1;
+          theme_thumbnail_data->status = READING_CONTROL_THEME_NAME;
+        }
+        break;
+
+      case READING_CONTROL_THEME_NAME:
+        nil = memchr (ptr, '\000', bytes_read);
+        if (nil == NULL)
+        {
+          g_byte_array_append (theme_thumbnail_data->control_theme_name, ptr, bytes_read);
+          bytes_read = 0;
+        }
+        else
+        {
+          g_byte_array_append (theme_thumbnail_data->control_theme_name, ptr, nil - ptr + 1);
+          bytes_read -= (nil - ptr + 1);
+          ptr = nil + 1;
+          theme_thumbnail_data->status = READING_GTK_COLOR_SCHEME;
+        }
+        break;
+
+      case READING_GTK_COLOR_SCHEME:
+        nil = memchr (ptr, '\000', bytes_read);
+        if (nil == NULL)
+        {
+          g_byte_array_append (theme_thumbnail_data->gtk_color_scheme, ptr, bytes_read);
+          bytes_read = 0;
+        }
+        else
+        {
+          g_byte_array_append (theme_thumbnail_data->gtk_color_scheme, ptr, nil - ptr + 1);
+          bytes_read -= (nil - ptr + 1);
+          ptr = nil + 1;
+          theme_thumbnail_data->status = READING_WM_THEME_NAME;
+        }
+        break;
+
+      case READING_WM_THEME_NAME:
+        nil = memchr (ptr, '\000', bytes_read);
+        if (nil == NULL)
+        {
+          g_byte_array_append (theme_thumbnail_data->wm_theme_name, ptr, bytes_read);
+          bytes_read = 0;
+        }
+        else
+        {
+          g_byte_array_append (theme_thumbnail_data->wm_theme_name, ptr, nil - ptr + 1);
+          bytes_read -= (nil - ptr + 1);
+          ptr = nil + 1;
+          theme_thumbnail_data->status = READING_ICON_THEME_NAME;
+        }
+        break;
+
+      case READING_ICON_THEME_NAME:
+        nil = memchr (ptr, '\000', bytes_read);
+        if (nil == NULL)
+        {
+          g_byte_array_append (theme_thumbnail_data->icon_theme_name, ptr, bytes_read);
+          bytes_read = 0;
+        }
+        else
+        {
+          g_byte_array_append (theme_thumbnail_data->icon_theme_name, ptr, nil - ptr + 1);
+          bytes_read -= (nil - ptr + 1);
+          ptr = nil + 1;
+          theme_thumbnail_data->status = READING_APPLICATION_FONT;
+        }
+        break;
+
+      case READING_APPLICATION_FONT:
+        nil = memchr (ptr, '\000', bytes_read);
+        if (nil == NULL)
+        {
+          g_byte_array_append (theme_thumbnail_data->application_font, ptr, bytes_read);
+          bytes_read = 0;
+        }
+        else
+        {
+          g_byte_array_append (theme_thumbnail_data->application_font, ptr, nil - ptr + 1);
+          bytes_read -= (nil - ptr + 1);
+          ptr = nil + 1;
+          theme_thumbnail_data->status = WRITING_PIXBUF_DATA;
+        }
+        break;
+
+      default:
+        g_assert_not_reached ();
+    }
+  }
+}
+
+static gboolean
+message_from_capplet (GIOChannel   *source,
+                      GIOCondition  condition,
+                      gpointer      data)
+{
+  gchar buffer[1024];
+  GIOStatus status;
+  gsize bytes_read;
+  ThemeThumbnailData *theme_thumbnail_data;
+
+  theme_thumbnail_data = (ThemeThumbnailData *) data;
+  status = g_io_channel_read_chars (source,
+                                    buffer,
+                                    1024,
+                                    &bytes_read,
+                                    NULL);
+
+  switch (status)
+  {
+    case G_IO_STATUS_NORMAL:
+      handle_bytes ((guint8 *) buffer, bytes_read, theme_thumbnail_data);
+
+      if (theme_thumbnail_data->status == WRITING_PIXBUF_DATA)
+      {
+        GdkPixbuf *pixbuf = NULL;
+        gint i, rowstride;
+        guchar *pixels;
+        gint width, height;
+        const gchar *type = (const gchar *) theme_thumbnail_data->type->data;
+
+        if (!strcmp (type, THUMBNAIL_TYPE_META))
+          pixbuf = create_meta_theme_pixbuf (theme_thumbnail_data);
+        else if (!strcmp (type, THUMBNAIL_TYPE_GTK))
+          pixbuf = create_gtk_theme_pixbuf (theme_thumbnail_data);
+        else if (!strcmp (type, THUMBNAIL_TYPE_MARCO))
+          pixbuf = create_marco_theme_pixbuf (theme_thumbnail_data);
+        else if (!strcmp (type, THUMBNAIL_TYPE_ICON))
+          pixbuf = create_icon_theme_pixbuf (theme_thumbnail_data);
+        else
+          g_assert_not_reached ();
+
+        if (pixbuf == NULL) {
+          width = height = rowstride = 0;
+          pixels = NULL;
+        } else {
+          width = gdk_pixbuf_get_width (pixbuf);
+          height = gdk_pixbuf_get_height (pixbuf);
+          rowstride = gdk_pixbuf_get_rowstride (pixbuf);
+          pixels = gdk_pixbuf_get_pixels (pixbuf);
+        }
+
+        /* Write the pixbuf's size */
+
+        if (write (pipe_from_factory_fd[1], &width, sizeof (width)) == -1)
+          perror ("write error");
+
+        if (write (pipe_from_factory_fd[1], &height, sizeof (height)) == -1)
+          perror ("write error");
+
+        for (i = 0; i < height; i++)
+        {
+          if (write (pipe_from_factory_fd[1], pixels + rowstride * i, width * gdk_pixbuf_get_n_channels (pixbuf)) == -1)
+            perror ("write error");
+        }
+
+        if (pixbuf)
+          g_object_unref (pixbuf);
+        g_byte_array_set_size (theme_thumbnail_data->type, 0);
+        g_byte_array_set_size (theme_thumbnail_data->control_theme_name, 0);
+        g_byte_array_set_size (theme_thumbnail_data->gtk_color_scheme, 0);
+        g_byte_array_set_size (theme_thumbnail_data->wm_theme_name, 0);
+        g_byte_array_set_size (theme_thumbnail_data->icon_theme_name, 0);
+        g_byte_array_set_size (theme_thumbnail_data->application_font, 0);
+        theme_thumbnail_data->status = READY_FOR_THEME;
+      }
+      return TRUE;
+
+    case G_IO_STATUS_AGAIN:
+      return TRUE;
+
+    case G_IO_STATUS_EOF:
+    case G_IO_STATUS_ERROR:
+      _exit (0);
+
+    default:
+      g_assert_not_reached ();
+    }
+
+  return TRUE;
+}
+
+static void
+generate_next_in_queue (void)
+{
+  ThemeQueueItem *item;
+
+  if (theme_queue == NULL)
+    return;
+
+  item = theme_queue->data;
+  theme_queue = g_list_delete_link (theme_queue, g_list_first (theme_queue));
+
+  if (!strcmp (item->thumbnail_type, THUMBNAIL_TYPE_META))
+    generate_meta_theme_thumbnail_async ((MateThemeMetaInfo *) item->theme_info,
+                                         item->func,
+                                         item->user_data,
+                                         item->destroy);
+  else if (!strcmp (item->thumbnail_type, THUMBNAIL_TYPE_GTK))
+    generate_gtk_theme_thumbnail_async ((MateThemeInfo *) item->theme_info,
+                                        item->func,
+                                        item->user_data,
+                                        item->destroy);
+  else if (!strcmp (item->thumbnail_type, THUMBNAIL_TYPE_MARCO))
+    generate_marco_theme_thumbnail_async ((MateThemeInfo *) item->theme_info,
+                                             item->func,
+                                             item->user_data,
+                                             item->destroy);
+  else if (!strcmp (item->thumbnail_type, THUMBNAIL_TYPE_ICON))
+    generate_icon_theme_thumbnail_async ((MateThemeIconInfo *) item->theme_info,
+                                         item->func,
+                                         item->user_data,
+                                         item->destroy);
+
+  g_free (item);
+}
+
+static gboolean
+message_from_child (GIOChannel   *source,
+                    GIOCondition  condition,
+                    gpointer      data)
+{
+  gchar buffer[1024];
+  GIOStatus status;
+  gsize bytes_read;
+
+  if (async_data.set == FALSE)
+    return TRUE;
+
+  if (condition == G_IO_HUP)
+    return FALSE;
+
+  status = g_io_channel_read_chars (source,
+                                    buffer,
+                                    1024,
+                                    &bytes_read,
+                                    NULL);
+  switch (status)
+  {
+    case G_IO_STATUS_NORMAL:
+      g_byte_array_append (async_data.data, (guchar *) buffer, bytes_read);
+
+      if (async_data.thumbnail_width == -1 && async_data.data->len >= 2 * sizeof (gint))
+      {
+        async_data.thumbnail_width = *((gint *) async_data.data->data);
+        async_data.thumbnail_height = *(((gint *) async_data.data->data) + 1);
+        g_byte_array_remove_range (async_data.data, 0, 2 * sizeof (gint));
+      }
+
+      if (async_data.thumbnail_width >= 0 && async_data.data->len == async_data.thumbnail_width * async_data.thumbnail_height * 4)
+      {
+        GdkPixbuf *pixbuf = NULL;
+
+        if (async_data.thumbnail_width > 0) {
+          gchar *pixels;
+          gint i, rowstride;
+
+          pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, async_data.thumbnail_width, async_data.thumbnail_height);
+          pixels = (gchar *) gdk_pixbuf_get_pixels (pixbuf);
+          rowstride = gdk_pixbuf_get_rowstride (pixbuf);
+
+          for (i = 0; i < async_data.thumbnail_height; ++i)
+            memcpy (pixels + rowstride * i, async_data.data->data + 4 * async_data.thumbnail_width * i, async_data.thumbnail_width * 4);
+        }
+
+        /* callback function needs to ref the pixbuf if it wants to keep it */
+        (* async_data.func) (pixbuf, async_data.theme_name, async_data.user_data);
+
+        if (async_data.destroy)
+          (* async_data.destroy) (async_data.user_data);
+
+        if (pixbuf)
+          g_object_unref (pixbuf);
+
+        /* Clean up async_data */
+        g_free (async_data.theme_name);
+        g_source_remove (async_data.watch_id);
+        g_io_channel_unref (async_data.channel);
+
+        /* reset async_data */
+        async_data.thumbnail_width = -1;
+        async_data.thumbnail_height = -1;
+        async_data.theme_name = NULL;
+        async_data.channel = NULL;
+        async_data.func = NULL;
+        async_data.user_data = NULL;
+        async_data.destroy = NULL;
+        async_data.set = FALSE;
+        g_byte_array_set_size (async_data.data, 0);
+
+        generate_next_in_queue ();
+      }
+      return TRUE;
+
+    case G_IO_STATUS_AGAIN:
+      return TRUE;
+
+    case G_IO_STATUS_EOF:
+    case G_IO_STATUS_ERROR:
+      return FALSE;
+
+    default:
+      g_assert_not_reached ();
+  }
+
+  return TRUE;
+}
+
+static void
+send_thumbnail_request (gchar *thumbnail_type,
+                        gchar *gtk_theme_name,
+                        gchar *gtk_color_scheme,
+                        gchar *marco_theme_name,
+                        gchar *icon_theme_name,
+                        gchar *application_font)
+{
+  if (write (pipe_to_factory_fd[1], thumbnail_type, strlen (thumbnail_type) + 1) == -1)
+    perror ("write error");
+
+  if (gtk_theme_name)
+  {
+    if (write (pipe_to_factory_fd[1], gtk_theme_name, strlen (gtk_theme_name) + 1) == -1)
+      perror ("write error");
+  }
+  else
+  {
+    if (write (pipe_to_factory_fd[1], "", 1) == -1)
+      perror ("write error");
+  }
+
+  if (gtk_color_scheme)
+  {
+    if (write (pipe_to_factory_fd[1], gtk_color_scheme, strlen (gtk_color_scheme) + 1) == -1)
+      perror ("write error");
+  }
+  else
+  {
+    if (write (pipe_to_factory_fd[1], "", 1) == -1)
+      perror ("write error");
+  }
+
+  if (marco_theme_name)
+  {
+    if (write (pipe_to_factory_fd[1], marco_theme_name, strlen (marco_theme_name) + 1) == -1)
+      perror ("write error");
+  }
+  else
+  {
+    if (write (pipe_to_factory_fd[1], "", 1) == -1)
+      perror ("write error");
+  }
+
+  if (icon_theme_name)
+  {
+    if (write (pipe_to_factory_fd[1], icon_theme_name, strlen (icon_theme_name) + 1) == -1)
+      perror ("write error");
+  }
+  else
+  {
+    if (write (pipe_to_factory_fd[1], "", 1) == -1)
+      perror ("write error");
+  }
+
+  if (application_font)
+  {
+    if (write (pipe_to_factory_fd[1], application_font, strlen (application_font) + 1) == -1)
+      perror ("write error");
+  }
+  else
+  {
+    if (write (pipe_to_factory_fd[1], "Sans 10", strlen ("Sans 10") + 1) == -1)
+      perror ("write error");
+  }
+}
+
+static GdkPixbuf *
+read_pixbuf (void)
+{
+  gint bytes_read, i, j = 0;
+  gint size[2];
+  GdkPixbuf *pixbuf;
+  gint rowstride;
+  guchar *pixels;
+
+  do
+  {
+    bytes_read = read (pipe_from_factory_fd[0], ((guint8*) size) + j, 2 * sizeof (gint));
+    if (bytes_read == 0)
+      goto eof;
+    j += bytes_read;
+  }
+  while (j < 2 * sizeof (gint));
+
+  if (size[0] <= 0 || size[1] <= 0)
+    return NULL;
+
+  pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, size[0], size[1]);
+  rowstride = gdk_pixbuf_get_rowstride (pixbuf);
+  pixels = gdk_pixbuf_get_pixels (pixbuf);
+
+  for (i = 0; i < size[1]; i++)
+  {
+    j = 0;
+
+    do
+    {
+      bytes_read = read (pipe_from_factory_fd[0], pixels + rowstride * i + j, size[0] * gdk_pixbuf_get_n_channels (pixbuf) - j);
+
+      if (bytes_read > 0)
+        j += bytes_read;
+      else if (bytes_read == 0)
+      {
+        g_object_unref (pixbuf);
+        goto eof;
+      }
+    }
+    while (j < size[0] * gdk_pixbuf_get_n_channels (pixbuf));
+  }
+
+  return pixbuf;
+
+eof:
+  g_warning ("Received EOF while reading thumbnail");
+  close (pipe_to_factory_fd[1]);
+  pipe_to_factory_fd[1] = 0;
+  close (pipe_from_factory_fd[0]);
+  pipe_from_factory_fd[0] = 0;
+  return NULL;
+}
+
+static GdkPixbuf *
+generate_theme_thumbnail (gchar *thumbnail_type,
+                          gchar *gtk_theme_name,
+                          gchar *gtk_color_scheme,
+                          gchar *marco_theme_name,
+                          gchar *icon_theme_name,
+                          gchar *application_font)
+{
+  if (async_data.set || !pipe_to_factory_fd[1] || !pipe_from_factory_fd[0])
+    return NULL;
+
+  send_thumbnail_request (thumbnail_type,
+                          gtk_theme_name,
+                          gtk_color_scheme,
+                          marco_theme_name,
+                          icon_theme_name,
+                          application_font);
+
+  return read_pixbuf ();
+}
+
+GdkPixbuf *
+generate_meta_theme_thumbnail (MateThemeMetaInfo *theme_info)
+{
+  return generate_theme_thumbnail (THUMBNAIL_TYPE_META,
+                                   theme_info->gtk_theme_name,
+                                   theme_info->gtk_color_scheme,
+                                   theme_info->marco_theme_name,
+                                   theme_info->icon_theme_name,
+                                   theme_info->application_font);
+}
+
+GdkPixbuf *
+generate_gtk_theme_thumbnail (MateThemeInfo *theme_info)
+{
+  gchar *scheme;
+
+  scheme = gtkrc_get_color_scheme_for_theme (theme_info->name);
+
+  return generate_theme_thumbnail (THUMBNAIL_TYPE_GTK,
+                                   theme_info->name,
+                                   scheme,
+                                   NULL,
+                                   NULL,
+                                   NULL);
+  g_free (scheme);<--- Statements following 'return' will never be executed.
+}
+
+GdkPixbuf *
+generate_marco_theme_thumbnail (MateThemeInfo *theme_info)
+{
+  return generate_theme_thumbnail (THUMBNAIL_TYPE_MARCO,
+                                   NULL,
+                                   NULL,
+                                   theme_info->name,
+                                   NULL,
+                                   NULL);
+}
+
+GdkPixbuf *
+generate_icon_theme_thumbnail (MateThemeIconInfo *theme_info)
+{
+  return generate_theme_thumbnail (THUMBNAIL_TYPE_ICON,
+                                   NULL,
+                                   NULL,
+                                   NULL,
+                                   theme_info->name,
+                                   NULL);
+}
+
+static void generate_theme_thumbnail_async(gpointer theme_info, gchar* theme_name, gchar* thumbnail_type, gchar* gtk_theme_name, gchar* gtk_color_scheme, gchar* marco_theme_name, gchar* icon_theme_name, gchar* application_font, ThemeThumbnailFunc func, gpointer user_data, GDestroyNotify destroy)
+{
+	if (async_data.set)
+	{
+		ThemeQueueItem* item = g_new0 (ThemeQueueItem, 1);
+
+		item->thumbnail_type = thumbnail_type;
+		item->theme_info = theme_info;
+		item->func = func;
+		item->user_data = user_data;
+		item->destroy = destroy;
+
+		theme_queue = g_list_append(theme_queue, item);
+
+		return;
+	}
+
+	if (!pipe_to_factory_fd[1] || !pipe_from_factory_fd[0])
+	{
+		(*func)(NULL, theme_name, user_data);
+
+		if (destroy)
+		{
+			(*destroy)(user_data);
+		}
+
+		return;
+	}
+
+	if (async_data.channel == NULL)
+	{
+		async_data.channel = g_io_channel_unix_new(pipe_from_factory_fd[0]);
+
+		g_io_channel_set_flags(async_data.channel, g_io_channel_get_flags (async_data.channel) | G_IO_FLAG_NONBLOCK, NULL);
+		g_io_channel_set_encoding(async_data.channel, NULL, NULL);
+
+		async_data.watch_id = g_io_add_watch(async_data.channel, G_IO_IN | G_IO_HUP, message_from_child, NULL);
+	}
+
+	async_data.set = TRUE;
+	async_data.thumbnail_width = -1;
+	async_data.thumbnail_height = -1;
+	async_data.theme_name = g_strdup(theme_name);
+	async_data.func = func;
+	async_data.user_data = user_data;
+	async_data.destroy = destroy;
+
+	send_thumbnail_request(thumbnail_type, gtk_theme_name, gtk_color_scheme, marco_theme_name, icon_theme_name, application_font);
+}
+
+void
+generate_meta_theme_thumbnail_async (MateThemeMetaInfo *theme_info,
+                                     ThemeThumbnailFunc  func,
+                                     gpointer            user_data,
+                                     GDestroyNotify      destroy)
+{
+  generate_theme_thumbnail_async (theme_info,
+                                         theme_info->name,
+                                         THUMBNAIL_TYPE_META,
+                                         theme_info->gtk_theme_name,
+                                         theme_info->gtk_color_scheme,
+                                         theme_info->marco_theme_name,
+                                         theme_info->icon_theme_name,
+                                         theme_info->application_font,
+                                         func, user_data, destroy);
+}
+
+void generate_gtk_theme_thumbnail_async (MateThemeInfo* theme_info, ThemeThumbnailFunc  func, gpointer user_data, GDestroyNotify destroy)
+{
+	gchar* scheme = gtkrc_get_color_scheme_for_theme(theme_info->name);
+
+	generate_theme_thumbnail_async(theme_info, theme_info->name, THUMBNAIL_TYPE_GTK, theme_info->name, scheme,  NULL, NULL, NULL, func, user_data, destroy);
+
+	g_free(scheme);
+}
+
+void
+generate_marco_theme_thumbnail_async (MateThemeInfo *theme_info,
+                                         ThemeThumbnailFunc  func,
+                                         gpointer            user_data,
+                                         GDestroyNotify      destroy)
+{
+  generate_theme_thumbnail_async (theme_info,
+                                         theme_info->name,
+                                         THUMBNAIL_TYPE_MARCO,
+                                         NULL,
+                                         NULL,
+                                         theme_info->name,
+                                         NULL,
+                                         NULL,
+                                         func, user_data, destroy);
+}
+
+void
+generate_icon_theme_thumbnail_async (MateThemeIconInfo *theme_info,
+                                     ThemeThumbnailFunc  func,
+                                     gpointer            user_data,
+                                     GDestroyNotify      destroy)
+{
+  generate_theme_thumbnail_async (theme_info,
+                                         theme_info->name,
+                                         THUMBNAIL_TYPE_ICON,
+                                         NULL,
+                                         NULL,
+                                         NULL,
+                                         theme_info->name,
+                                         NULL,
+                                         func, user_data, destroy);
+}
+
+void
+theme_thumbnail_factory_init (int argc, char *argv[])
+{
+  gint child_pid;
+
+  if (pipe (pipe_to_factory_fd) == -1)
+    perror ("pipe error");
+
+  if (pipe (pipe_from_factory_fd) == -1)
+    perror ("pipe error");
+
+  child_pid = fork ();
+  if (child_pid == 0)
+  {
+    ThemeThumbnailData data;
+    GIOChannel *channel;
+
+    /* Child */
+    gtk_init (&argc, &argv);
+
+    close (pipe_to_factory_fd[1]);
+    pipe_to_factory_fd[1] = 0;
+    close (pipe_from_factory_fd[0]);
+    pipe_from_factory_fd[0] = 0;
+
+    data.status = READY_FOR_THEME;
+    data.type = g_byte_array_new ();
+    data.control_theme_name = g_byte_array_new ();
+    data.gtk_color_scheme = g_byte_array_new ();
+    data.wm_theme_name = g_byte_array_new ();
+    data.icon_theme_name = g_byte_array_new ();
+    data.application_font = g_byte_array_new ();
+
+    channel = g_io_channel_unix_new (pipe_to_factory_fd[0]);
+    g_io_channel_set_flags (channel, g_io_channel_get_flags (channel) |
+          G_IO_FLAG_NONBLOCK, NULL);
+    g_io_channel_set_encoding (channel, NULL, NULL);
+    g_io_add_watch (channel, G_IO_IN | G_IO_HUP, message_from_capplet, &data);
+    g_io_channel_unref (channel);
+
+    gtk_main ();
+    _exit (0);
+  }
+
+  g_assert (child_pid > 0);
+
+  /* Parent */
+  close (pipe_to_factory_fd[0]);
+  close (pipe_from_factory_fd[1]);
+
+  async_data.set = FALSE;
+  async_data.theme_name = NULL;
+  async_data.data = g_byte_array_new ();
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/42.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/42.html new file mode 100644 index 00000000..58aed32a --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/42.html @@ -0,0 +1,311 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
#ifndef __THEME_THUMBNAIL_H__
+#define __THEME_THUMBNAIL_H__
+
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "mate-theme-info.h"
+
+typedef void (* ThemeThumbnailFunc)          (GdkPixbuf          *pixbuf,
+                                              gchar              *theme_name,
+                                              gpointer            data);
+
+GdkPixbuf *generate_meta_theme_thumbnail     (MateThemeMetaInfo *theme_info);
+GdkPixbuf *generate_gtk_theme_thumbnail      (MateThemeInfo     *theme_info);
+GdkPixbuf *generate_marco_theme_thumbnail (MateThemeInfo     *theme_info);
+GdkPixbuf *generate_icon_theme_thumbnail     (MateThemeIconInfo *theme_info);
+
+void generate_meta_theme_thumbnail_async     (MateThemeMetaInfo *theme_info,
+                                              ThemeThumbnailFunc  func,
+                                              gpointer            data,
+                                              GDestroyNotify      destroy);
+void generate_gtk_theme_thumbnail_async      (MateThemeInfo     *theme_info,
+                                              ThemeThumbnailFunc  func,
+                                              gpointer            data,
+                                              GDestroyNotify      destroy);
+void generate_marco_theme_thumbnail_async (MateThemeInfo     *theme_info,
+                                              ThemeThumbnailFunc  func,
+                                              gpointer            data,
+                                              GDestroyNotify      destroy);
+void generate_icon_theme_thumbnail_async     (MateThemeIconInfo *theme_info,
+                                              ThemeThumbnailFunc  func,
+                                              gpointer            data,
+                                              GDestroyNotify      destroy);
+
+void theme_thumbnail_factory_init            (int                 argc,
+                                              char               *argv[]);
+
+#endif /* __THEME_THUMBNAIL_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/43.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/43.html new file mode 100644 index 00000000..b0fe96b3 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/43.html @@ -0,0 +1,621 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
#include <X11/Xatom.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 <gdk/gdk.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 "wm-common.h"
+
+typedef struct _WMCallbackData
+{
+  GFunc func;
+  gpointer data;
+} WMCallbackData;
+
+/* Our WM Window */
+static Window wm_window = None;
+
+static char *
+wm_common_get_window_manager_property (Atom atom)
+{
+  Atom utf8_string, type;
+  GdkDisplay *display;
+  int result;
+  char *retval;
+  int format;
+  gulong nitems;
+  gulong bytes_after;
+  gchar *val;
+
+  if (wm_window == None)
+    return NULL;
+
+  utf8_string = gdk_x11_get_xatom_by_name ("UTF8_STRING");
+
+  display = gdk_display_get_default ();
+  gdk_x11_display_error_trap_push (display);
+
+  val = NULL;
+  result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY(display),
+		  	       wm_window,
+			       atom,
+			       0, G_MAXLONG,
+			       False, utf8_string,
+			       &type, &format, &nitems,
+			       &bytes_after, (guchar **) &val);
+
+  if (gdk_x11_display_error_trap_pop (display) || result != Success ||
+      type != utf8_string || format != 8 || nitems == 0 ||
+      !g_utf8_validate (val, nitems, NULL))
+    {
+      retval = NULL;
+    }
+  else
+    {
+      retval = g_strndup (val, nitems);
+    }
+
+  if (val)
+    XFree (val);
+
+  return retval;
+}
+
+char*
+wm_common_get_current_window_manager (void)
+{
+  Atom atom = gdk_x11_get_xatom_by_name ("_NET_WM_NAME");
+  char *result;
+
+  result = wm_common_get_window_manager_property (atom);
+  if (result)
+    return result;
+  else
+    return g_strdup (WM_COMMON_UNKNOWN);
+}
+
+char**
+wm_common_get_current_keybindings (void)
+{
+  Atom keybindings_atom = gdk_x11_get_xatom_by_name ("_MATE_WM_KEYBINDINGS");
+  char *keybindings = wm_common_get_window_manager_property (keybindings_atom);
+  char **results;
+
+  if (keybindings)
+    {
+      char **p;
+      results = g_strsplit(keybindings, ",", -1);
+      for (p = results; *p; p++)
+	g_strstrip (*p);
+      g_free (keybindings);
+    }
+  else
+    {
+      Atom wm_atom = gdk_x11_get_xatom_by_name ("_NET_WM_NAME");
+      char *wm_name = wm_common_get_window_manager_property (wm_atom);
+      char *to_copy[] = { NULL, NULL };
+
+      to_copy[0] = wm_name ? wm_name : WM_COMMON_UNKNOWN;
+
+      results = g_strdupv (to_copy);
+      g_free (wm_name);
+    }
+
+  return results;
+}
+
+static void
+update_wm_window (void)
+{
+  GdkDisplay *display;
+  Window *xwindow;
+  Atom type;
+  gint format;
+  gulong nitems;
+  gulong bytes_after;
+
+  display = gdk_display_get_default ();
+  XGetWindowProperty (GDK_DISPLAY_XDISPLAY(display), GDK_ROOT_WINDOW (),
+		      gdk_x11_get_xatom_by_name ("_NET_SUPPORTING_WM_CHECK"),
+		      0, G_MAXLONG, False, XA_WINDOW, &type, &format,
+		      &nitems, &bytes_after, (guchar **) &xwindow);
+
+  if (type != XA_WINDOW)
+    {
+      wm_window = None;
+     return;
+    }
+
+  gdk_x11_display_error_trap_push (display);
+  XSelectInput (GDK_DISPLAY_XDISPLAY(display), *xwindow, StructureNotifyMask | PropertyChangeMask);
+  XSync (GDK_DISPLAY_XDISPLAY(display), False);
+
+  if (gdk_x11_display_error_trap_pop (display))
+    {
+       XFree (xwindow);
+       wm_window = None;
+       return;
+    }
+
+    wm_window = *xwindow;
+    XFree (xwindow);
+}
+
+static GdkFilterReturn
+wm_window_event_filter (GdkXEvent *xev,
+			GdkEvent  *event,
+			gpointer   data)
+{
+  WMCallbackData *ncb_data = (WMCallbackData*) data;
+  XEvent *xevent = (XEvent *)xev;<--- Variable 'xevent' can be declared as pointer to const
+
+  if ((xevent->type == DestroyNotify &&
+       wm_window != None && xevent->xany.window == wm_window) ||
+      (xevent->type == PropertyNotify &&
+       xevent->xany.window == GDK_ROOT_WINDOW () &&
+       xevent->xproperty.atom == (gdk_x11_get_xatom_by_name ("_NET_SUPPORTING_WM_CHECK"))) ||
+      (xevent->type == PropertyNotify &&
+       wm_window != None && xevent->xany.window == wm_window &&
+       xevent->xproperty.atom == (gdk_x11_get_xatom_by_name ("_NET_WM_NAME"))))
+    {
+      update_wm_window ();
+      (* ncb_data->func) ((gpointer)wm_common_get_current_window_manager(),
+		   	  ncb_data->data);
+    }
+
+  return GDK_FILTER_CONTINUE;
+}
+
+void
+wm_common_register_window_manager_change (GFunc    func,
+					  gpointer data)
+{
+  WMCallbackData *ncb_data;
+
+  ncb_data = g_new0 (WMCallbackData, 1);
+
+  ncb_data->func = func;
+  ncb_data->data = data;
+
+  gdk_window_add_filter (NULL, wm_window_event_filter, ncb_data);
+
+  update_wm_window ();
+
+  XSelectInput (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), GDK_ROOT_WINDOW (), PropertyChangeMask);
+  XSync (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), False);
+}
+
+void
+wm_common_update_window ()
+{
+  update_wm_window();
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/44.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/44.html new file mode 100644 index 00000000..2a9a1c05 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/44.html @@ -0,0 +1,1907 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ *  Authors: Luca Cavalli <loopback@slackit.org>
+ *
+ *  Copyright 2005-2006 Luca Cavalli
+ *  Copyright 2008 Thomas Wood <thos@gnome.org>
+ *  Copyright 2010 Perberos <perberos@gmail.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of version 2 of the GNU General Public License
+ *  as published by the Free Software Foundation
+ *
+ *  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., 59 Temple Street #330, 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 <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 <gio/gio.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 <cairo-gobject.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "mate-da-capplet.h"
+#include "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+
+enum {
+	DA_TYPE_WEB_BROWSER,
+	DA_TYPE_EMAIL,
+	DA_TYPE_TERMINAL,
+	DA_TYPE_MEDIA,
+	DA_TYPE_VIDEO,
+	DA_TYPE_VISUAL,
+	DA_TYPE_MOBILITY,
+	DA_TYPE_IMAGE,
+	DA_TYPE_TEXT,
+	DA_TYPE_FILE,
+	DA_TYPE_DOCUMENT,
+	DA_TYPE_WORD,
+	DA_TYPE_SPREADSHEET,
+	DA_TYPE_CALCULATOR,
+	DA_TYPE_MESSENGER,
+	DA_N_COLUMNS
+};
+
+/* For combo box */
+enum {
+	SURFACE_COL,
+	TEXT_COL,
+	ID_COL,
+	ICONAME_COL,
+	N_COLUMNS
+};
+
+static void
+set_changed(GtkComboBox* combo, MateDACapplet* capplet, GList* list, gint type)
+{
+	guint index;
+	GAppInfo* item;
+
+	index = gtk_combo_box_get_active(combo);
+
+	if (index < g_list_length(list))
+	{
+		item = (GAppInfo*) g_list_nth_data(list, index);
+
+		switch (type)
+		{
+			case DA_TYPE_WEB_BROWSER:
+				g_app_info_set_as_default_for_type(item, "x-scheme-handler/http", NULL);
+				g_app_info_set_as_default_for_type(item, "x-scheme-handler/https", NULL);
+				g_app_info_set_as_default_for_type(item, "text/html", NULL);
+				/* about:config is used by firefox and others */
+				g_app_info_set_as_default_for_type(item, "x-scheme-handler/about", NULL);
+				break;
+
+			case DA_TYPE_EMAIL:
+				g_app_info_set_as_default_for_type(item, "x-scheme-handler/mailto", NULL);
+				g_app_info_set_as_default_for_type(item, "application/x-extension-eml", NULL);
+				g_app_info_set_as_default_for_type(item, "message/rfc822", NULL);
+				break;
+
+			case DA_TYPE_FILE:
+				g_app_info_set_as_default_for_type(item, "inode/directory", NULL);
+				break;
+
+			case DA_TYPE_TEXT:
+				g_app_info_set_as_default_for_type(item, "text/plain", NULL);
+				break;
+
+			case DA_TYPE_MEDIA:
+				g_app_info_set_as_default_for_type(item, "audio/flac", NULL);
+				g_app_info_set_as_default_for_type(item, "audio/x-flac", NULL);
+				g_app_info_set_as_default_for_type(item, "audio/mpeg", NULL);
+				g_app_info_set_as_default_for_type(item, "audio/x-mpegurl", NULL);
+				g_app_info_set_as_default_for_type(item, "audio/x-scpls", NULL);
+				g_app_info_set_as_default_for_type(item, "audio/x-vorbis+ogg", NULL);
+				g_app_info_set_as_default_for_type(item, "audio/x-wav", NULL);
+				break;
+
+			case DA_TYPE_VIDEO:
+				g_app_info_set_as_default_for_type(item, "video/mp4", NULL);
+				g_app_info_set_as_default_for_type(item, "video/mpeg", NULL);
+				g_app_info_set_as_default_for_type(item, "video/mp2t", NULL);
+				g_app_info_set_as_default_for_type(item, "video/msvideo", NULL);
+				g_app_info_set_as_default_for_type(item, "video/quicktime", NULL);
+				g_app_info_set_as_default_for_type(item, "video/webm", NULL);
+				g_app_info_set_as_default_for_type(item, "video/x-avi", NULL);
+				g_app_info_set_as_default_for_type(item, "video/x-flv", NULL);
+				g_app_info_set_as_default_for_type(item, "video/x-matroska", NULL);
+				g_app_info_set_as_default_for_type(item, "video/x-mpeg", NULL);
+				g_app_info_set_as_default_for_type(item, "video/x-ogm+ogg", NULL);
+				break;
+
+			case DA_TYPE_IMAGE:
+				g_app_info_set_as_default_for_type(item, "image/bmp", NULL);
+				g_app_info_set_as_default_for_type(item, "image/gif", NULL);
+				g_app_info_set_as_default_for_type(item, "image/jpeg", NULL);
+				g_app_info_set_as_default_for_type(item, "image/png", NULL);
+				g_app_info_set_as_default_for_type(item, "image/tiff", NULL);
+				break;
+
+			case DA_TYPE_DOCUMENT:
+				g_app_info_set_as_default_for_type(item, "application/pdf", NULL);
+				break;
+
+			case DA_TYPE_WORD:
+				g_app_info_set_as_default_for_type(item, "application/vnd.oasis.opendocument.text", NULL);
+				g_app_info_set_as_default_for_type(item, "application/rtf", NULL);
+				g_app_info_set_as_default_for_type(item, "application/msword", NULL);
+				g_app_info_set_as_default_for_type(item, "application/vnd.openxmlformats-officedocument.wordprocessingml.document", NULL);
+				break;
+
+			case DA_TYPE_SPREADSHEET:
+				g_app_info_set_as_default_for_type(item, "application/vnd.oasis.opendocument.spreadsheet", NULL);
+				g_app_info_set_as_default_for_type(item, "application/vnd.ms-excel", NULL);
+				g_app_info_set_as_default_for_type(item, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", NULL);
+				break;
+
+			case DA_TYPE_TERMINAL:
+				g_settings_set_string (capplet->terminal_settings, TERMINAL_KEY, g_app_info_get_executable (item));
+				break;
+
+			case DA_TYPE_VISUAL:
+				g_settings_set_string (capplet->visual_settings, VISUAL_KEY, g_app_info_get_executable (item));
+				break;
+
+			case DA_TYPE_MOBILITY:
+				g_settings_set_string (capplet->mobility_settings, MOBILITY_KEY, g_app_info_get_executable (item));
+				break;
+
+			case DA_TYPE_CALCULATOR:
+				g_settings_set_string (capplet->calculator_settings, CALCULATOR_KEY, g_app_info_get_executable (item));
+				break;
+
+			case DA_TYPE_MESSENGER:
+				g_app_info_set_as_default_for_type(item, "x-scheme-handler/icq", NULL);
+				g_app_info_set_as_default_for_type(item, "x-scheme-handler/irc", NULL);
+				g_app_info_set_as_default_for_type(item, "x-scheme-handler/ircs", NULL);
+				g_app_info_set_as_default_for_type(item, "x-scheme-handler/sip", NULL);
+				g_app_info_set_as_default_for_type(item, "x-scheme-handler/xmpp", NULL);
+				g_settings_set_string (capplet->messenger_settings, MESSENGER_KEY, g_app_info_get_executable (item));
+
+			default:
+				break;
+		}
+	}
+}
+
+static void
+close_cb(GtkWidget* window, gint response, MateDACapplet* capplet)
+{
+	if (response == GTK_RESPONSE_HELP)
+	{
+		capplet_help(GTK_WINDOW(window), "prefs-preferredapps");
+	}
+	else
+	{
+		set_changed(GTK_COMBO_BOX(capplet->web_combo_box), capplet, capplet->web_browsers, DA_TYPE_WEB_BROWSER);
+		set_changed(GTK_COMBO_BOX(capplet->mail_combo_box), capplet, capplet->mail_readers, DA_TYPE_EMAIL);
+		set_changed(GTK_COMBO_BOX(capplet->file_combo_box), capplet, capplet->file_managers, DA_TYPE_FILE);
+		set_changed(GTK_COMBO_BOX(capplet->text_combo_box), capplet, capplet->text_editors, DA_TYPE_TEXT);
+		set_changed(GTK_COMBO_BOX(capplet->media_combo_box), capplet, capplet->media_players, DA_TYPE_MEDIA);
+		set_changed(GTK_COMBO_BOX(capplet->video_combo_box), capplet, capplet->video_players, DA_TYPE_VIDEO);
+		set_changed(GTK_COMBO_BOX(capplet->term_combo_box), capplet, capplet->terminals, DA_TYPE_TERMINAL);
+		set_changed(GTK_COMBO_BOX(capplet->visual_combo_box), capplet, capplet->visual_ats, DA_TYPE_VISUAL);
+		set_changed(GTK_COMBO_BOX(capplet->mobility_combo_box), capplet, capplet->mobility_ats, DA_TYPE_MOBILITY);
+		set_changed(GTK_COMBO_BOX(capplet->image_combo_box), capplet, capplet->image_viewers, DA_TYPE_IMAGE);
+		set_changed(GTK_COMBO_BOX(capplet->document_combo_box), capplet, capplet->document_viewers, DA_TYPE_DOCUMENT);
+		set_changed(GTK_COMBO_BOX(capplet->word_combo_box), capplet, capplet->word_editors, DA_TYPE_WORD);
+		set_changed(GTK_COMBO_BOX(capplet->spreadsheet_combo_box), capplet, capplet->spreadsheet_editors, DA_TYPE_SPREADSHEET);
+		set_changed(GTK_COMBO_BOX(capplet->calculator_combo_box), capplet, capplet->calculators, DA_TYPE_CALCULATOR);
+		set_changed(GTK_COMBO_BOX(capplet->messenger_combo_box), capplet, capplet->messengers, DA_TYPE_MESSENGER);
+
+		gtk_widget_destroy(window);
+		gtk_main_quit();
+	}
+}
+
+/* Combo boxes callbacks */
+static void
+web_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet)
+{
+	set_changed(combo, capplet, capplet->web_browsers, DA_TYPE_WEB_BROWSER);
+}
+
+static void
+mail_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet)
+{
+	set_changed(combo, capplet, capplet->mail_readers, DA_TYPE_EMAIL);
+}
+
+static void
+file_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet)
+{
+	set_changed(combo, capplet, capplet->file_managers, DA_TYPE_FILE);
+}
+
+static void
+text_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet)
+{
+	set_changed(combo, capplet, capplet->text_editors, DA_TYPE_TEXT);
+}
+
+static void
+media_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet)
+{
+	set_changed(combo, capplet, capplet->media_players, DA_TYPE_MEDIA);
+}
+
+static void
+video_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet)
+{
+	set_changed(combo, capplet, capplet->video_players, DA_TYPE_VIDEO);
+}
+
+static void
+terminal_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet)
+{
+	set_changed(combo, capplet, capplet->terminals, DA_TYPE_TERMINAL);
+}
+
+static void
+visual_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet)
+{
+	set_changed(combo, capplet, capplet->visual_ats, DA_TYPE_VISUAL);
+}
+
+static void
+mobility_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet)
+{
+	set_changed(combo, capplet, capplet->mobility_ats, DA_TYPE_MOBILITY);
+}
+
+static void
+image_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet)
+{
+	set_changed(combo, capplet, capplet->image_viewers, DA_TYPE_IMAGE);
+}
+
+static void
+document_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet)
+{
+	set_changed(combo, capplet, capplet->document_viewers, DA_TYPE_DOCUMENT);
+}
+
+static void
+word_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet)
+{
+	set_changed(combo, capplet, capplet->word_editors, DA_TYPE_WORD);
+}
+
+static void
+spreadsheet_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet)
+{
+	set_changed(combo, capplet, capplet->spreadsheet_editors, DA_TYPE_SPREADSHEET);
+}
+
+static void
+calculator_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet)
+{
+	set_changed(combo, capplet, capplet->calculators, DA_TYPE_CALCULATOR);
+}
+
+static void
+messenger_combo_changed_cb(GtkComboBox* combo, MateDACapplet* capplet)
+{
+        set_changed(combo, capplet, capplet->messengers, DA_TYPE_MESSENGER);
+}
+
+static void
+refresh_combo_box_icons(GtkIconTheme* theme, GtkComboBox* combo_box, GList* app_list)
+{
+	GtkTreeIter iter;
+	GtkTreeModel* model;
+	gboolean valid;
+	cairo_surface_t *surface;
+	gchar* icon_name;
+	gint scale_factor;
+
+	model = gtk_combo_box_get_model(combo_box);
+
+	if (model == NULL)
+		return;
+
+	valid = gtk_tree_model_get_iter_first(model, &iter);
+	scale_factor = gtk_widget_get_scale_factor (GTK_WIDGET (combo_box));
+
+	while (valid)
+	{
+		gtk_tree_model_get (model, &iter,
+		                    ICONAME_COL, &icon_name,
+		                    -1);
+
+		surface = gtk_icon_theme_load_surface (theme, icon_name,
+		                                       22, scale_factor,
+		                                       NULL,
+		                                       GTK_ICON_LOOKUP_FORCE_SIZE,
+		                                       NULL);
+
+		gtk_list_store_set (GTK_LIST_STORE(model), &iter,
+		                    SURFACE_COL, surface,
+		                    -1);
+
+		if (surface)
+			cairo_surface_destroy (surface);
+
+		g_free (icon_name);
+
+		valid = gtk_tree_model_iter_next(model, &iter);
+	}
+}
+
+/* Callback for icon theme change */
+static void
+theme_changed_cb(GtkIconTheme* theme, MateDACapplet* capplet)
+{
+	refresh_combo_box_icons(theme, GTK_COMBO_BOX(capplet->web_combo_box), capplet->web_browsers);
+	refresh_combo_box_icons(theme, GTK_COMBO_BOX(capplet->mail_combo_box), capplet->mail_readers);
+	refresh_combo_box_icons(theme, GTK_COMBO_BOX(capplet->media_combo_box), capplet->media_players);
+	refresh_combo_box_icons(theme, GTK_COMBO_BOX(capplet->video_combo_box), capplet->video_players);
+	refresh_combo_box_icons(theme, GTK_COMBO_BOX(capplet->term_combo_box), capplet->terminals);
+	refresh_combo_box_icons(theme, GTK_COMBO_BOX(capplet->visual_combo_box), capplet->visual_ats);
+	refresh_combo_box_icons(theme, GTK_COMBO_BOX(capplet->mobility_combo_box), capplet->mobility_ats);
+	refresh_combo_box_icons(theme, GTK_COMBO_BOX(capplet->file_combo_box), capplet->file_managers);
+	refresh_combo_box_icons(theme, GTK_COMBO_BOX(capplet->text_combo_box), capplet->text_editors);
+	refresh_combo_box_icons(theme, GTK_COMBO_BOX(capplet->document_combo_box), capplet->document_viewers);
+	refresh_combo_box_icons(theme, GTK_COMBO_BOX(capplet->word_combo_box), capplet->word_editors);
+	refresh_combo_box_icons(theme, GTK_COMBO_BOX(capplet->spreadsheet_combo_box), capplet->spreadsheet_editors);
+	refresh_combo_box_icons(theme, GTK_COMBO_BOX(capplet->calculator_combo_box), capplet->calculators);
+        refresh_combo_box_icons(theme, GTK_COMBO_BOX(capplet->messenger_combo_box), capplet->messengers);
+}
+
+static void
+screen_changed_cb(GtkWidget* widget, GdkScreen* screen, MateDACapplet* capplet)
+{
+	GtkIconTheme* theme;
+
+	theme = gtk_icon_theme_get_for_screen (screen);
+
+	if (capplet->icon_theme != NULL)
+	{
+		g_signal_handlers_disconnect_by_func (capplet->icon_theme, theme_changed_cb, capplet);
+	}
+
+	g_signal_connect (theme, "changed", G_CALLBACK (theme_changed_cb), capplet);
+	theme_changed_cb (theme, capplet);
+
+	capplet->icon_theme = theme;
+}
+
+static void
+fill_combo_box(GtkIconTheme* theme, GtkComboBox* combo_box, GList* app_list, gchar* mime)
+{
+	guint index = 0;
+	GList* entry;
+	GtkTreeModel* model;
+	GtkCellRenderer* renderer;
+	GtkTreeIter iter;
+	cairo_surface_t *surface;
+	GAppInfo* default_app;
+	gint scale_factor;
+
+	default_app = NULL;
+	if (g_strcmp0(mime, "terminal") == 0)
+	{
+		GSettings *terminal_settings = g_settings_new (TERMINAL_SCHEMA);
+		gchar *default_terminal = g_settings_get_string (terminal_settings, TERMINAL_KEY);
+		for (entry = app_list; entry != NULL; entry = g_list_next(entry))
+		{
+			GAppInfo* item = (GAppInfo*) entry->data;
+			if (g_strcmp0 (g_app_info_get_executable (item), default_terminal) == 0)
+			{
+				default_app = item;
+			}
+		}
+		g_free (default_terminal);
+		g_object_unref (terminal_settings);
+	}
+	else if (g_strcmp0(mime, "visual") == 0)
+	{
+		GSettings *visual_settings = g_settings_new (VISUAL_SCHEMA);
+		gchar *default_visual = g_settings_get_string (visual_settings, VISUAL_KEY);
+		for (entry = app_list; entry != NULL; entry = g_list_next(entry))
+		{
+			GAppInfo* item = (GAppInfo*) entry->data;
+			if (g_strcmp0 (g_app_info_get_executable (item), default_visual) == 0)
+			{
+				default_app = item;
+			}
+		}
+		g_free (default_visual);
+		g_object_unref (visual_settings);
+	}
+	else if (g_strcmp0(mime, "mobility") == 0)
+	{
+		GSettings *mobility_settings = g_settings_new (MOBILITY_SCHEMA);
+		gchar *default_mobility = g_settings_get_string (mobility_settings, MOBILITY_KEY);
+		for (entry = app_list; entry != NULL; entry = g_list_next(entry))
+		{
+			GAppInfo* item = (GAppInfo*) entry->data;
+			if (g_strcmp0 (g_app_info_get_executable (item), default_mobility) == 0)
+			{
+				default_app = item;
+			}
+		}
+		g_free (default_mobility);
+		g_object_unref (mobility_settings);
+	}
+	else if (g_strcmp0(mime, "calculator") == 0)
+	{
+		GSettings *calculator_settings = g_settings_new (CALCULATOR_SCHEMA);
+		gchar *default_calculator = g_settings_get_string (calculator_settings, CALCULATOR_KEY);
+		for (entry = app_list; entry != NULL; entry = g_list_next(entry))
+		{
+			GAppInfo* item = (GAppInfo*) entry->data;
+			if (g_strcmp0 (g_app_info_get_executable (item), default_calculator) == 0)
+			{
+				default_app = item;
+			}
+		}
+		g_free (default_calculator);
+		g_object_unref (calculator_settings);
+	}
+	else if (g_strcmp0(mime, "messenger") == 0)
+	{
+		GSettings *messenger_settings = g_settings_new (MESSENGER_SCHEMA);
+		gchar *default_messenger = g_settings_get_string (messenger_settings, MESSENGER_KEY);
+		for (entry = app_list; entry != NULL; entry = g_list_next(entry))
+		{
+			GAppInfo* item = (GAppInfo*) entry->data;
+			if (g_strcmp0 (g_app_info_get_executable (item), default_messenger) == 0)
+			{
+				default_app = item;
+			}
+		}
+		g_free (default_messenger);
+		g_object_unref (messenger_settings);
+	}
+	else
+	{
+		default_app = g_app_info_get_default_for_type (mime, FALSE);
+	}
+
+	if (theme == NULL)
+	{
+		theme = gtk_icon_theme_get_default();
+	}
+
+	model = GTK_TREE_MODEL (gtk_list_store_new (4,
+	                                            CAIRO_GOBJECT_TYPE_SURFACE,
+	                                            G_TYPE_STRING,
+	                                            G_TYPE_STRING,
+	                                            G_TYPE_STRING));
+	gtk_combo_box_set_model(combo_box, model);
+
+	renderer = gtk_cell_renderer_pixbuf_new();
+
+	/* Not all cells have an icon, this prevents the combo box to shrink */
+	gtk_cell_renderer_set_fixed_size(renderer, 22, 22);
+	gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo_box), renderer, FALSE);
+	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), renderer,
+	                                "surface", SURFACE_COL,
+	                                NULL);
+
+	renderer = gtk_cell_renderer_text_new();
+
+	gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo_box), renderer, TRUE);
+	gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), renderer,
+		"text", TEXT_COL,
+		NULL);
+
+	scale_factor = gtk_widget_get_scale_factor (GTK_WIDGET (combo_box));
+
+	for (entry = app_list; entry != NULL; entry = g_list_next(entry))
+	{
+		GAppInfo* item = (GAppInfo*) entry->data;
+
+		/* Icon */
+		GIcon* icon = g_app_info_get_icon(item);
+		gchar* icon_name;
+
+		if (icon != NULL) {
+			icon_name = g_icon_to_string (icon);
+			if (icon_name == NULL) {
+				/* Default icon */
+				icon_name = g_strdup ("binary");
+			}
+		} else {
+			icon_name = g_strdup ("binary");
+		}
+
+		surface = gtk_icon_theme_load_surface (theme, icon_name,
+		                                       22, scale_factor,
+		                                       NULL,
+		                                       GTK_ICON_LOOKUP_FORCE_SIZE,
+		                                       NULL);
+
+		gtk_list_store_append(GTK_LIST_STORE(model), &iter);
+		gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+		                    SURFACE_COL, surface,
+		                    TEXT_COL, g_app_info_get_display_name(item),
+		                    ID_COL, g_app_info_get_id(item),
+		                    ICONAME_COL, icon_name,
+		                    -1);
+
+		if (surface)
+			cairo_surface_destroy (surface);
+
+		/* Set the index for the default app */
+		if (default_app != NULL && g_app_info_equal(item, default_app))
+		{
+			gtk_combo_box_set_active(combo_box, index);
+		}
+
+		g_free(icon_name);
+
+		index++;
+	}
+}
+
+static GList*
+fill_list_from_desktop_file (GList* app_list, const gchar *desktop_id)
+{
+	GList* list = app_list;
+	GDesktopAppInfo* appinfo;
+
+	appinfo = g_desktop_app_info_new_from_filename (desktop_id);
+	if (appinfo != NULL) {
+		list = g_list_prepend (list, appinfo);
+	}
+	return list;
+}
+
+static gint
+compare_apps (gconstpointer a, gconstpointer b)
+{
+	GAppInfo *app_info_1, *app_info_2;
+	gchar *app_dpy_name_1, *app_dpy_name_2;
+	gint ret;
+
+	app_info_1 = G_APP_INFO (a);
+	app_info_2 = G_APP_INFO (b);
+	app_dpy_name_1 = g_utf8_casefold (g_app_info_get_display_name (app_info_1), -1);
+	app_dpy_name_2 = g_utf8_casefold (g_app_info_get_display_name (app_info_2), -1);
+	ret = g_strcmp0 (app_dpy_name_1, app_dpy_name_2);
+	g_free (app_dpy_name_1);
+	g_free (app_dpy_name_2);
+	return ret;
+}
+
+static void
+show_dialog(MateDACapplet* capplet, const gchar* start_page)
+{
+	#define get_widget(name) GTK_WIDGET(gtk_builder_get_object(builder, name))
+
+	GtkBuilder* builder;
+
+	capplet->builder = builder = gtk_builder_new_from_resource ("/org/mate/mcc/da/mate-default-applications-properties.ui");
+
+	capplet->window = get_widget("preferred_apps_dialog");
+
+	g_signal_connect(capplet->window, "response", G_CALLBACK(close_cb), capplet);
+
+	capplet->web_combo_box = get_widget("web_browser_combobox");
+	capplet->mail_combo_box = get_widget("mail_reader_combobox");
+	capplet->term_combo_box = get_widget("terminal_combobox");
+	capplet->media_combo_box = get_widget("media_player_combobox");
+	capplet->video_combo_box = get_widget("video_combobox");
+	capplet->visual_combo_box = get_widget("visual_combobox");
+	capplet->mobility_combo_box = get_widget("mobility_combobox");
+	capplet->text_combo_box = get_widget("text_combobox");
+	capplet->file_combo_box = get_widget("filemanager_combobox");
+	capplet->image_combo_box = get_widget("image_combobox");
+	capplet->document_combo_box = get_widget("document_combobox");
+	capplet->word_combo_box = get_widget("word_combobox");
+	capplet->spreadsheet_combo_box = get_widget("spreadsheet_combobox");
+	capplet->calculator_combo_box = get_widget("calculator_combobox");
+        capplet->messenger_combo_box = get_widget("messenger_combobox");
+
+	capplet->visual_startup_checkbutton = get_widget("visual_start_checkbutton");
+	capplet->mobility_startup_checkbutton = get_widget("mobility_start_checkbutton");
+
+	g_signal_connect(capplet->window, "screen-changed", G_CALLBACK(screen_changed_cb), capplet);
+	screen_changed_cb(capplet->window, gdk_screen_get_default(), capplet);
+
+	/* Lists of default applications */
+	capplet->web_browsers = g_app_info_get_all_for_type("x-scheme-handler/http");
+	capplet->mail_readers = g_app_info_get_all_for_type("x-scheme-handler/mailto");
+	capplet->media_players = g_app_info_get_all_for_type("audio/x-vorbis+ogg");
+	capplet->video_players = g_app_info_get_all_for_type("video/x-ogm+ogg");
+	capplet->text_editors = g_app_info_get_all_for_type("text/plain");
+	capplet->image_viewers = g_app_info_get_all_for_type("image/png");
+	capplet->file_managers = g_app_info_get_all_for_type("inode/directory");
+	capplet->document_viewers = g_app_info_get_all_for_type("application/pdf");
+	capplet->word_editors = g_app_info_get_all_for_type("application/msword");
+	capplet->spreadsheet_editors = g_app_info_get_all_for_type("application/vnd.ms-excel");
+
+	capplet->visual_ats = NULL;
+        const gchar *const *sys_config_dirs = g_get_system_config_dirs();
+	for (const gchar* c = *sys_config_dirs; c; c=*++sys_config_dirs)
+        {
+		gchar* path = g_strconcat (c, "/autostart/orca-autostart.desktop", NULL);
+		capplet->visual_ats = fill_list_from_desktop_file (capplet->visual_ats, path);
+		g_free (path);
+	}
+	capplet->visual_ats = g_list_reverse (capplet->visual_ats);
+
+	capplet->mobility_ats = NULL;
+	capplet->mobility_ats = fill_list_from_desktop_file (capplet->mobility_ats, APPLICATIONSDIR "/dasher.desktop");
+	capplet->mobility_ats = fill_list_from_desktop_file (capplet->mobility_ats, APPLICATIONSDIR "/gok.desktop");
+	capplet->mobility_ats = fill_list_from_desktop_file (capplet->mobility_ats, APPLICATIONSDIR "/onboard.desktop");
+	capplet->mobility_ats = g_list_reverse (capplet->mobility_ats);
+
+	/* Terminal havent mime types, so check in .desktop files for
+	   Categories=TerminalEmulator */
+	GList *entry;
+	GList *all_apps;
+	capplet->terminals = NULL;
+	all_apps = g_app_info_get_all();
+	for (entry = all_apps; entry != NULL; entry = g_list_next(entry))
+	{
+		GDesktopAppInfo* item = (GDesktopAppInfo*) entry->data;
+		if (g_desktop_app_info_get_categories (item) != NULL &&
+			g_strrstr (g_desktop_app_info_get_categories (item), "TerminalEmulator"))
+		{
+			capplet->terminals = g_list_prepend (capplet->terminals, item);
+		}
+	}
+	capplet->terminals = g_list_reverse (capplet->terminals);
+
+	/* Calculator havent mime types, so check in .desktop files for
+	   Categories=Calculator */
+	capplet->calculators = NULL;
+	all_apps = g_app_info_get_all();
+	for (entry = all_apps; entry != NULL; entry = g_list_next(entry))
+	{
+		GDesktopAppInfo* item = (GDesktopAppInfo*) entry->data;
+		if (g_desktop_app_info_get_categories (item) != NULL &&
+			g_strrstr (g_desktop_app_info_get_categories (item), "Calculator"))
+		{
+			capplet->calculators = g_list_prepend (capplet->calculators, item);
+		}
+	}
+	capplet->calculators = g_list_reverse (capplet->calculators);
+
+	/* Messenger havent mime types, so check in .desktop files for
+	   Categories=InstantMessaging */
+	capplet->messengers = g_app_info_get_all_for_type ("x-scheme-handler/irc");
+	all_apps = g_app_info_get_all();
+	for (entry = all_apps; entry != NULL; entry = g_list_next(entry))
+	{
+		if (capplet->messengers && g_list_index (capplet->messengers, entry) != -1)
+			continue;
+
+		GDesktopAppInfo* item = (GDesktopAppInfo*) entry->data;
+		if (g_desktop_app_info_get_categories (item) != NULL &&
+			g_strrstr (g_desktop_app_info_get_categories (item), "InstantMessaging"))
+		{
+			capplet->messengers = g_list_prepend (capplet->messengers, item);
+		}
+	}
+	capplet->messengers = g_list_sort (capplet->messengers, compare_apps);
+
+	fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->web_combo_box), capplet->web_browsers, "x-scheme-handler/http");
+	fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->mail_combo_box), capplet->mail_readers, "x-scheme-handler/mailto");
+	fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->term_combo_box), capplet->terminals, "terminal");
+	fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->media_combo_box), capplet->media_players, "audio/x-vorbis+ogg");
+	fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->video_combo_box), capplet->video_players, "video/x-ogm+ogg");
+	fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->image_combo_box), capplet->image_viewers, "image/png");
+	fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->text_combo_box), capplet->text_editors, "text/plain");
+	fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->file_combo_box), capplet->file_managers, "inode/directory");
+	fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->visual_combo_box), capplet->visual_ats, "visual");
+	fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->mobility_combo_box), capplet->mobility_ats, "mobility");
+	fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->document_combo_box), capplet->document_viewers, "application/pdf");
+	fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->word_combo_box), capplet->word_editors, "application/vnd.oasis.opendocument.text");
+	fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->spreadsheet_combo_box), capplet->spreadsheet_editors, "application/vnd.oasis.opendocument.spreadsheet");
+	fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->calculator_combo_box), capplet->calculators, "calculator");
+        fill_combo_box(capplet->icon_theme, GTK_COMBO_BOX(capplet->messenger_combo_box), capplet->messengers, "messenger");
+
+	g_signal_connect(capplet->web_combo_box, "changed", G_CALLBACK(web_combo_changed_cb), capplet);
+	g_signal_connect(capplet->mail_combo_box, "changed", G_CALLBACK(mail_combo_changed_cb), capplet);
+	g_signal_connect(capplet->term_combo_box, "changed", G_CALLBACK(terminal_combo_changed_cb), capplet);
+	g_signal_connect(capplet->media_combo_box, "changed", G_CALLBACK(media_combo_changed_cb), capplet);
+	g_signal_connect(capplet->video_combo_box, "changed", G_CALLBACK(video_combo_changed_cb), capplet);
+	g_signal_connect(capplet->visual_combo_box, "changed", G_CALLBACK(visual_combo_changed_cb), capplet);
+	g_signal_connect(capplet->mobility_combo_box, "changed", G_CALLBACK(mobility_combo_changed_cb), capplet);
+	g_signal_connect(capplet->image_combo_box, "changed", G_CALLBACK(image_combo_changed_cb), capplet);
+	g_signal_connect(capplet->text_combo_box, "changed", G_CALLBACK(text_combo_changed_cb), capplet);
+	g_signal_connect(capplet->file_combo_box, "changed", G_CALLBACK(file_combo_changed_cb), capplet);
+	g_signal_connect(capplet->document_combo_box, "changed", G_CALLBACK(document_combo_changed_cb), capplet);
+	g_signal_connect(capplet->word_combo_box, "changed", G_CALLBACK(word_combo_changed_cb), capplet);
+	g_signal_connect(capplet->spreadsheet_combo_box, "changed", G_CALLBACK(spreadsheet_combo_changed_cb), capplet);
+	g_signal_connect(capplet->calculator_combo_box, "changed", G_CALLBACK(calculator_combo_changed_cb), capplet);
+        g_signal_connect(capplet->messenger_combo_box, "changed", G_CALLBACK(messenger_combo_changed_cb), capplet);
+
+	g_settings_bind (capplet->mobility_settings, MOBILITY_STARTUP_KEY, capplet->mobility_startup_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
+	g_settings_bind (capplet->visual_startup_settings, VISUAL_STARTUP_KEY, capplet->visual_startup_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
+
+	gtk_window_set_icon_name(GTK_WINDOW (capplet->window), "preferences-desktop-default-applications");
+
+        GtkNotebook* nb = GTK_NOTEBOOK(get_widget("preferred_apps_notebook"));
+        gtk_widget_add_events (GTK_WIDGET (nb), GDK_SCROLL_MASK);
+        g_signal_connect (GTK_WIDGET (nb),
+                          "scroll-event",
+                          G_CALLBACK (capplet_notebook_scroll_event_cb),
+                          NULL);
+
+	if (start_page != NULL)
+	{
+		gchar* page_name;
+		GtkWidget* w;
+
+		page_name = g_strconcat (start_page, "_vbox", NULL);
+
+		w = get_widget(page_name);
+
+		if (w != NULL)
+		{
+			gint pindex;
+
+			pindex = gtk_notebook_page_num(nb, w);
+
+			if (pindex != -1)
+			{
+				gtk_notebook_set_current_page(nb, pindex);
+			}
+		}
+
+		g_free(page_name);
+	}
+
+	gtk_widget_show(capplet->window);
+
+	#undef get_widget
+}
+
+int
+main(int argc, char** argv)
+{
+	gchar* start_page = NULL;
+
+	GOptionEntry option_entries[] = {
+		{
+			"show-page",
+			'p',
+			G_OPTION_FLAG_IN_MAIN,
+			G_OPTION_ARG_STRING,
+			&start_page,
+			/* TRANSLATORS: don't translate the terms in brackets */
+			N_("Specify the name of the page to show (internet|multimedia|system|a11y)"),
+			N_("page")
+		},
+		{
+			NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL
+		}
+	};
+
+	GOptionContext* context = g_option_context_new(_("- MATE Default Applications"));
+	g_option_context_add_main_entries(context, option_entries, GETTEXT_PACKAGE);
+
+	capplet_init(context, &argc, &argv);
+	g_option_context_free(context);
+
+	MateDACapplet* capplet = g_new0(MateDACapplet, 1);
+
+	capplet->terminal_settings = g_settings_new (TERMINAL_SCHEMA);
+	capplet->mobility_settings = g_settings_new (MOBILITY_SCHEMA);
+	capplet->visual_settings = g_settings_new (VISUAL_SCHEMA);
+	capplet->visual_startup_settings = g_settings_new (VISUAL_STARTUP_SCHEMA);
+	capplet->calculator_settings = g_settings_new (CALCULATOR_SCHEMA);
+	capplet->messenger_settings = g_settings_new (MESSENGER_SCHEMA);
+
+	show_dialog(capplet, start_page);
+	g_free(start_page);
+
+	gtk_main();
+
+	g_object_unref (capplet->terminal_settings);
+	g_object_unref (capplet->mobility_settings);
+	g_object_unref (capplet->visual_settings);
+	g_object_unref (capplet->visual_startup_settings);
+	g_object_unref (capplet->calculator_settings);
+	g_object_unref (capplet->messenger_settings);
+
+	return 0;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/45.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/45.html new file mode 100644 index 00000000..e2ad4e24 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/45.html @@ -0,0 +1,437 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ *  Authors: Luca Cavalli <loopback@slackit.org>
+ *
+ *  Copyright 2005-2006 Luca Cavalli
+ *  Copyright 2010 Perberos <perberos@gmail.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of version 2 of the GNU General Public License
+ *  as published by the Free Software Foundation
+ *
+ *  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., 59 Temple Street #330, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef _MATE_DA_CAPPLET_H_
+#define _MATE_DA_CAPPLET_H_
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define TERMINAL_SCHEMA       "org.mate.applications-terminal"
+#define TERMINAL_KEY          "exec"
+
+#define VISUAL_SCHEMA         "org.mate.applications-at-visual"
+#define VISUAL_KEY            "exec"
+#define VISUAL_STARTUP_SCHEMA "org.gnome.desktop.a11y.applications"
+#define VISUAL_STARTUP_KEY    "screen-reader-enabled"
+
+#define MOBILITY_SCHEMA       "org.mate.applications-at-mobility"
+#define MOBILITY_KEY          "exec"
+#define MOBILITY_STARTUP_KEY  "startup"
+
+#define CALCULATOR_SCHEMA     "org.mate.applications-calculator"
+#define CALCULATOR_KEY        "exec"
+
+#define MESSENGER_SCHEMA     "org.mate.applications-messenger"
+#define MESSENGER_KEY        "exec"
+
+typedef struct _MateDACapplet {
+	GtkBuilder* builder;
+
+	GtkIconTheme* icon_theme;
+
+	GtkWidget* window;
+
+	GtkWidget* web_combo_box;
+	GtkWidget* mail_combo_box;
+	GtkWidget* term_combo_box;
+	GtkWidget* media_combo_box;
+	GtkWidget* video_combo_box;
+	GtkWidget* visual_combo_box;
+	GtkWidget* mobility_combo_box;
+	GtkWidget* file_combo_box;
+	GtkWidget* text_combo_box;
+	GtkWidget* image_combo_box;
+	GtkWidget* document_combo_box;
+	GtkWidget* word_combo_box;
+	GtkWidget* spreadsheet_combo_box;
+	GtkWidget* calculator_combo_box;
+        GtkWidget* messenger_combo_box;
+
+	/* Visual Accessibility */
+	GtkWidget* visual_startup_checkbutton;
+
+	/* Mobility Accessibility */
+	GtkWidget* mobility_startup_checkbutton;
+
+	/* Lists of available apps */
+	GList* web_browsers;
+	GList* mail_readers;
+	GList* terminals;
+	GList* media_players;
+	GList* video_players;
+	GList* visual_ats;
+	GList* mobility_ats;
+	GList* file_managers;
+	GList* text_editors;
+	GList* image_viewers;
+	GList* document_viewers;
+	GList* word_editors;
+	GList* spreadsheet_editors;
+	GList* calculators;
+        GList* messengers;
+
+	/* Settings objects */
+	GSettings* terminal_settings;
+	GSettings* visual_settings;
+	GSettings* visual_startup_settings;
+	GSettings* mobility_settings;
+	GSettings* calculator_settings;
+	GSettings* messenger_settings;
+} MateDACapplet;
+
+#endif
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/46.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/46.html new file mode 100644 index 00000000..1d9efd33 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/46.html @@ -0,0 +1,1009 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
#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.default_applications"), aligned (8)))
+#else
+# define SECTION
+#endif
+
+static const SECTION union { const guint8 data[2853]; const double alignment; void * const ptr;}  default_applications_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, 0310, 0000, 0000, 0000, 0000, 0000, 0000, 0050, 0006, 0000, 0000, 0000, 
+  0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0001, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 
+  0003, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 0113, 0120, 0220, 0013, 0002, 0000, 0000, 0000, 
+  0310, 0000, 0000, 0000, 0004, 0000, 0114, 0000, 0314, 0000, 0000, 0000, 0320, 0000, 0000, 0000, 
+  0012, 0212, 0356, 0256, 0005, 0000, 0000, 0000, 0320, 0000, 0000, 0000, 0047, 0000, 0166, 0000, 
+  0370, 0000, 0000, 0000, 0002, 0013, 0000, 0000, 0324, 0265, 0002, 0000, 0377, 0377, 0377, 0377, 
+  0002, 0013, 0000, 0000, 0001, 0000, 0114, 0000, 0004, 0013, 0000, 0000, 0010, 0013, 0000, 0000, 
+  0143, 0041, 0175, 0170, 0004, 0000, 0000, 0000, 0010, 0013, 0000, 0000, 0004, 0000, 0114, 0000, 
+  0014, 0013, 0000, 0000, 0020, 0013, 0000, 0000, 0201, 0321, 0040, 0031, 0000, 0000, 0000, 0000, 
+  0020, 0013, 0000, 0000, 0005, 0000, 0114, 0000, 0030, 0013, 0000, 0000, 0034, 0013, 0000, 0000, 
+  0227, 0200, 0255, 0025, 0003, 0000, 0000, 0000, 0034, 0013, 0000, 0000, 0003, 0000, 0114, 0000, 
+  0040, 0013, 0000, 0000, 0044, 0013, 0000, 0000, 0157, 0162, 0147, 0057, 0004, 0000, 0000, 0000, 
+  0155, 0141, 0164, 0145, 0055, 0144, 0145, 0146, 0141, 0165, 0154, 0164, 0055, 0141, 0160, 0160, 
+  0154, 0151, 0143, 0141, 0164, 0151, 0157, 0156, 0163, 0055, 0160, 0162, 0157, 0160, 0145, 0162, 
+  0164, 0151, 0145, 0163, 0056, 0165, 0151, 0000, 0366, 0013, 0001, 0000, 0001, 0000, 0000, 0000, 
+  0170, 0332, 0355, 0235, 0135, 0163, 0243, 0070, 0026, 0206, 0357, 0373, 0127, 0260, 0334, 0116, 
+  0321, 0151, 0047, 0263, 0275, 0163, 0341, 0170, 0252, 0077, 0147, 0247, 0152, 0263, 0333, 0065, 
+  0323, 0323, 0175, 0111, 0311, 0160, 0154, 0153, 0203, 0021, 0213, 0104, 0034, 0367, 0257, 0137, 
+  0361, 0021, 0002, 0030, 0333, 0100, 0154, 0007, 0207, 0367, 0256, 0073, 0040, 0041, 0275, 0322, 
+  0071, 0350, 0171, 0055, 0331, 0343, 0137, 0357, 0227, 0236, 0161, 0107, 0241, 0344, 0302, 0277, 
+  0066, 0107, 0257, 0337, 0230, 0006, 0371, 0216, 0160, 0271, 0077, 0277, 0066, 0377, 0372, 0372, 
+  0331, 0372, 0305, 0374, 0165, 0362, 0152, 0374, 0067, 0313, 0062, 0176, 0043, 0237, 0102, 0246, 
+  0310, 0065, 0126, 0134, 0055, 0214, 0271, 0307, 0134, 0062, 0256, 0136, 0137, 0275, 0175, 0375, 
+  0306, 0260, 0054, 0175, 0023, 0367, 0025, 0205, 0063, 0346, 0320, 0344, 0225, 0141, 0214, 0103, 
+  0372, 0137, 0304, 0103, 0222, 0206, 0307, 0247, 0327, 0346, 0134, 0335, 0376, 0144, 0076, 0076, 
+  0350, 0352, 0365, 0350, 0147, 0363, 0042, 0271, 0057, 0256, 0072, 0057, 0151, 0171, 0334, 0041, 
+  0137, 0222, 0245, 0326, 0001, 0031, 0363, 0300, 0273, 0273, 0114, 0352, 0336, 0270, 0317, 0147, 
+  0113, 0062, 0226, 0272, 0065, 0226, 0113, 0063, 0026, 0171, 0312, 0142, 0101, 0240, 0013, 0063, 
+  0245, 0353, 0227, 0126, 0020, 0212, 0200, 0102, 0305, 0365, 0343, 0153, 0213, 0273, 0044, 0235, 
+  0220, 0007, 0361, 0315, 0315, 0152, 0131, 0161, 0337, 0025, 0253, 0372, 0312, 0034, 0021, 0254, 
+  0103, 0076, 0137, 0050, 0343, 0346, 0335, 0327, 0117, 0306, 0107, 0272, 0043, 0057, 0056, 0270, 
+  0345, 0331, 0054, 0122, 0013, 0241, 0057, 0176, 0027, 0336, 0154, 0316, 0374, 0271, 0361, 0227, 
+  0067, 0015, 0271, 0263, 0170, 0270, 0133, 0114, 0377, 0113, 0216, 0062, 0034, 0217, 0111, 0171, 
+  0155, 0376, 0246, 0156, 0177, 0137, 0262, 0071, 0231, 0006, 0167, 0257, 0115, 0307, 0023, 0222, 
+  0154, 0276, 0234, 0233, 0361, 0255, 0372, 0346, 0254, 0211, 0153, 0043, 0026, 0344, 0332, 0274, 
+  0343, 0222, 0117, 0075, 0062, 0047, 0137, 0303, 0210, 0306, 0027, 0017, 0127, 0353, 0157, 0166, 
+  0230, 0157, 0317, 0204, 0023, 0111, 0163, 0362, 0231, 0171, 0162, 0357, 0375, 0334, 0021, 0276, 
+  0035, 0377, 0323, 0234, 0244, 0162, 0130, 0111, 0163, 0312, 0305, 0306, 0027, 0151, 0373, 0367, 
+  0166, 0145, 0101, 0136, 0320, 0203, 0236, 0304, 0315, 0260, 0246, 0241, 0130, 0111, 0012, 0333, 
+  0364, 0344, 0043, 0147, 0236, 0230, 0247, 0135, 0011, 0102, 0232, 0121, 0030, 0222, 0153, 0353, 
+  0351, 0043, 0155, 0067, 0275, 0164, 0230, 0246, 0116, 0105, 0350, 0122, 0150, 0257, 0270, 0253, 
+  0026, 0346, 0344, 0357, 0373, 0156, 0127, 0134, 0151, 0321, 0014, 0025, 0062, 0137, 0172, 0114, 
+  0061, 0055, 0341, 0265, 0271, 0046, 0375, 0264, 0057, 0017, 0215, 0064, 0336, 0025, 0346, 0370, 
+  0276, 0372, 0164, 0000, 0363, 0037, 0054, 0031, 0210, 0106, 0315, 0215, 0343, 0326, 0136, 0350, 
+  0311, 0156, 0116, 0122, 0031, 0066, 0012, 0070, 0013, 0356, 0271, 0151, 0070, 0370, 0314, 0263, 
+  0222, 0377, 0352, 0341, 0236, 0212, 0373, 0114, 0261, 0072, 0265, 0337, 0353, 0253, 0211, 0324, 
+  0151, 0245, 0126, 0351, 0366, 0226, 0223, 0247, 0313, 0250, 0324, 0225, 0021, 0041, 0047, 0137, 
+  0045, 0062, 0232, 0223, 0273, 0070, 0117, 0070, 0314, 0253, 0055, 0130, 0337, 0145, 0346, 0304, 
+  0105, 0155, 0026, 0022, 0053, 0164, 0245, 0266, 0367, 0221, 0122, 0302, 0257, 0152, 0260, 0255, 
+  0174, 0007, 0071, 0272, 0112, 0122, 0127, 0316, 0143, 0153, 0021, 0051, 0133, 0252, 0165, 0374, 
+  0104, 0362, 0335, 0255, 0005, 0023, 0035, 0312, 0177, 0333, 0336, 0373, 0307, 0244, 0061, 0115, 
+  0376, 0077, 0062, 0253, 0045, 0353, 0232, 0062, 0045, 0257, 0066, 0030, 0354, 0177, 0352, 0212, 
+  0266, 0065, 0254, 0263, 0204, 0173, 0144, 0354, 0122, 0064, 0173, 0057, 0265, 0057, 0034, 0222, 
+  0103, 0374, 0216, 0344, 0143, 0015, 0073, 0107, 0261, 0066, 0113, 0046, 0311, 0172, 0362, 0220, 
+  0250, 0333, 0024, 0215, 0364, 0133, 0052, 0362, 0165, 0342, 0362, 0270, 0337, 0101, 0064, 0346, 
+  0255, 0330, 0132, 0332, 0162, 0041, 0126, 0166, 0326, 0212, 0335, 0125, 0024, 0163, 0165, 0271, 
+  0142, 0346, 0334, 0352, 0265, 0314, 0376, 0107, 0322, 0175, 0300, 0174, 0267, 0203, 0112, 0063, 
+  0356, 0171, 0035, 0212, 0005, 0102, 0362, 0064, 0165, 0274, 0331, 0325, 0255, 0332, 0366, 0217, 
+  0057, 0152, 0102, 0247, 0113, 0070, 0045, 0357, 0357, 0203, 0304, 0323, 0207, 0315, 0225, 0000, 
+  0002, 0152, 0113, 0100, 0345, 0213, 0070, 0104, 0324, 0161, 0042, 0152, 0164, 0210, 0210, 0252, 
+  0023, 0240, 0276, 0363, 0235, 0072, 0336, 0241, 0323, 0033, 0035, 0326, 0215, 0261, 0343, 0005, 
+  0327, 0356, 0327, 0154, 0333, 0304, 0123, 0043, 0321, 0206, 0074, 0233, 0311, 0146, 0063, 0321, 
+  0374, 0133, 0050, 0232, 0012, 0161, 0133, 0273, 0106, 0366, 0037, 0056, 0036, 0167, 0345, 0322, 
+  0246, 0330, 0236, 0225, 0166, 0353, 0074, 0373, 0260, 0134, 0113, 0327, 0175, 0244, 0354, 0312, 
+  0242, 0365, 0230, 0231, 0261, 0165, 0360, 0224, 0073, 0077, 0272, 0154, 0123, 0266, 0361, 0102, 
+  0170, 0133, 0005, 0122, 0117, 0070, 0075, 0337, 0364, 0163, 0177, 0331, 0131, 0254, 0126, 0371, 
+  0172, 0365, 0077, 0207, 0011, 0335, 0325, 0334, 0373, 0004, 0301, 0237, 0052, 0372, 0326, 0167, 
+  0252, 0175, 0317, 0074, 0076, 0337, 0275, 0026, 0330, 0042, 0335, 0202, 0151, 0020, 0317, 0262, 
+  0200, 0057, 0374, 0375, 0317, 0337, 0052, 0342, 0236, 0151, 0274, 0242, 0251, 0235, 0161, 0262, 
+  0275, 0250, 0237, 0311, 0007, 0021, 0370, 0020, 0042, 0327, 0325, 0261, 0144, 0341, 0234, 0373, 
+  0266, 0022, 0201, 0071, 0171, 0333, 0245, 0202, 0307, 0131, 0172, 0331, 0250, 0370, 0116, 0241, 
+  0353, 0305, 0056, 0330, 0043, 0105, 0271, 0263, 0027, 0366, 0216, 0252, 0016, 0240, 0371, 0241, 
+  0164, 0257, 0155, 0114, 0066, 0275, 0245, 0142, 0241, 0352, 0132, 0111, 0321, 0176, 0242, 0151, 
+  0275, 0147, 0323, 0262, 0066, 0311, 0177, 0320, 0216, 0124, 0337, 0154, 0105, 0324, 0154, 0165, 
+  0164, 0220, 0225, 0322, 0001, 0126, 0115, 0117, 0146, 0222, 0006, 0253, 0251, 0275, 0254, 0362, 
+  0324, 0070, 0251, 0115, 0112, 0042, 0261, 0163, 0345, 0266, 0327, 0354, 0331, 0004, 0113, 0353, 
+  0327, 0151, 0243, 0244, 0365, 0266, 0161, 0015, 0173, 0307, 0243, 0176, 0114, 0076, 0210, 0345, 
+  0124, 0324, 0016, 0214, 0023, 0137, 0331, 0077, 0050, 0007, 0033, 0230, 0103, 0016, 0116, 0263, 
+  0260, 0157, 0036, 0372, 0007, 0013, 0377, 0355, 0051, 0340, 0251, 0122, 0265, 0316, 0002, 0015, 
+  0063, 0101, 0243, 0154, 0160, 0212, 0064, 0373, 0224, 0040, 0157, 0057, 0161, 0047, 0114, 0075, 
+  0154, 0222, 0335, 0055, 0351, 0316, 0302, 0231, 0167, 0035, 0257, 0057, 0037, 0374, 0237, 0346, 
+  0153, 0307, 0177, 0245, 0176, 0121, 0065, 0037, 0354, 0256, 0246, 0247, 0313, 0307, 0105, 0333, 
+  0045, 0114, 0163, 0363, 0354, 0073, 0115, 0215, 0367, 0315, 0127, 0063, 0143, 0246, 0124, 0310, 
+  0247, 0221, 0042, 0271, 0163, 0332, 0344, 0267, 0145, 0015, 0130, 0121, 0374, 0031, 0245, 0151, 
+  0350, 0305, 0130, 0224, 0020, 0237, 0347, 0246, 0037, 0301, 0156, 0233, 0064, 0373, 0237, 0323, 
+  0171, 0142, 0355, 0052, 0270, 0073, 0270, 0237, 0224, 0074, 0273, 0107, 0163, 0347, 0044, 0271, 
+  0043, 0172, 0267, 0352, 0003, 0320, 0175, 0116, 0320, 0135, 0062, 0356, 0331, 0041, 0061, 0027, 
+  0240, 0173, 0012, 0320, 0055, 0312, 0015, 0320, 0255, 0200, 0056, 0055, 0165, 0327, 0226, 0126, 
+  0254, 0021, 0100, 0167, 0310, 0240, 0133, 0214, 0022, 0200, 0156, 0217, 0100, 0267, 0070, 0060, 
+  0000, 0135, 0200, 0056, 0100, 0167, 0330, 0240, 0133, 0314, 0007, 0000, 0335, 0062, 0350, 0336, 
+  0150, 0155, 0214, 0077, 0022, 0155, 0000, 0272, 0147, 0007, 0272, 0043, 0200, 0356, 0013, 0003, 
+  0135, 0222, 0222, 0374, 0071, 0060, 0367, 0044, 0230, 0233, 0213, 0015, 0310, 0255, 0100, 0056, 
+  0367, 0165, 0115, 0276, 0262, 0142, 0211, 0230, 0036, 0323, 0071, 0120, 0167, 0320, 0250, 0233, 
+  0107, 0012, 0100, 0267, 0117, 0240, 0233, 0017, 0013, 0060, 0027, 0230, 0013, 0314, 0035, 0070, 
+  0346, 0346, 0331, 0000, 0220, 0133, 0206, 0334, 0337, 0323, 0325, 0214, 0161, 0363, 0240, 0020, 
+  0120, 0367, 0354, 0120, 0367, 0362, 0320, 0250, 0133, 0257, 0315, 0216, 0163, 0074, 0131, 0204, 
+  0352, 0211, 0145, 0356, 0337, 0152, 0136, 0210, 0313, 0174, 0263, 0171, 0262, 0313, 0176, 0133, 
+  0154, 0366, 0142, 0313, 0371, 0256, 0020, 0112, 0073, 0161, 0314, 0323, 0051, 0372, 0171, 0166, 
+  0243, 0345, 0365, 0121, 0316, 0140, 0345, 0213, 0252, 0310, 0123, 0174, 0111, 0056, 0147, 0070, 
+  0035, 0260, 0237, 0323, 0161, 0072, 0240, 0267, 0136, 0122, 0142, 0152, 0300, 0107, 0072, 0276, 
+  0217, 0224, 0010, 0175, 0307, 0151, 0005, 0047, 0251, 0306, 0111, 0212, 0005, 0261, 0356, 0255, 
+  0171, 0374, 0125, 0045, 0334, 0201, 0217, 0064, 0144, 0037, 0051, 0115, 0111, 0360, 0220, 0172, 
+  0344, 0041, 0245, 0103, 0002, 0377, 0010, 0376, 0021, 0374, 0243, 0141, 0373, 0107, 0151, 0046, 
+  0200, 0167, 0124, 0001, 0337, 0130, 0025, 0343, 0133, 0262, 0272, 0203, 0155, 0204, 0243, 0000, 
+  0240, 0332, 0347, 0336, 0041, 0021, 0073, 0063, 0201, 0307, 0326, 0330, 0044, 0161, 0232, 0115, 
+  0022, 0005, 0275, 0101, 0267, 0025, 0272, 0145, 0221, 0313, 0005, 0350, 0026, 0164, 0273, 0021, 
+  0052, 0200, 0334, 0136, 0155, 0224, 0050, 0214, 0014, 0130, 0027, 0254, 0013, 0326, 0035, 0372, 
+  0136, 0211, 0102, 0102, 0000, 0362, 0126, 0316, 0004, 0344, 0237, 0200, 0032, 0137, 0022, 0205, 
+  0300, 0275, 0070, 0031, 0000, 0356, 0175, 0136, 0356, 0275, 0343, 0056, 0011, 0000, 0357, 0361, 
+  0201, 0067, 0025, 0032, 0244, 0133, 0041, 0335, 0104, 0026, 0220, 0056, 0110, 0367, 0061, 0106, 
+  0200, 0270, 0075, 0102, 0334, 0164, 0110, 0300, 0266, 0140, 0133, 0260, 0355, 0260, 0331, 0066, 
+  0315, 0004, 0200, 0332, 0062, 0324, 0176, 0213, 0125, 0001, 0317, 0236, 0053, 0317, 0236, 0150, 
+  0373, 0177, 0233, 0355, 0352, 0007, 0376, 0161, 0203, 0247, 0036, 0063, 0050, 0354, 0133, 0077, 
+  0323, 0063, 0006, 0217, 0276, 0323, 0061, 0117, 0031, 0064, 0174, 0051, 0364, 0363, 0160, 0202, 
+  0134, 0113, 0105, 0113, 0034, 0114, 0330, 0157, 0025, 0340, 0140, 0102, 0157, 0255, 0054, 0105, 
+  0367, 0012, 0116, 0326, 0361, 0235, 0254, 0104, 0147, 0030, 0131, 0025, 0043, 0053, 0126, 0305, 
+  0322, 0057, 0031, 0045, 0360, 0103, 0005, 0203, 0066, 0261, 0222, 0360, 0200, 0207, 0325, 0043, 
+  0017, 0053, 0031, 0021, 0130, 0130, 0260, 0260, 0140, 0141, 0015, 0333, 0302, 0112, 0022, 0001, 
+  0034, 0254, 0062, 0036, 0177, 0325, 0242, 0030, 0237, 0032, 0057, 0134, 0140, 0140, 0341, 0040, 
+  0002, 0050, 0366, 0230, 0024, 0033, 0056, 0271, 0317, 0074, 0220, 0354, 0051, 0110, 0066, 0323, 
+  0032, 0064, 0273, 0101, 0263, 0251, 0062, 0100, 0331, 0141, 0243, 0154, 0026, 0037, 0300, 0331, 
+  0136, 0341, 0154, 0066, 0052, 0100, 0132, 0040, 0055, 0220, 0166, 0350, 0110, 0233, 0045, 0003, 
+  0140, 0155, 0025, 0153, 0123, 0141, 0214, 0117, 0313, 0110, 0137, 0001, 0334, 0236, 0041, 0334, 
+  0342, 0264, 0301, 0013, 0203, 0133, 0075, 0051, 0150, 0311, 0174, 0206, 0137, 0042, 0070, 0011, 
+  0337, 0026, 0345, 0006, 0342, 0126, 0020, 0067, 0026, 0307, 0312, 0324, 0001, 0346, 0016, 0031, 
+  0163, 0213, 0141, 0002, 0322, 0355, 0021, 0351, 0026, 0007, 0006, 0260, 0013, 0330, 0005, 0354, 
+  0016, 0033, 0166, 0213, 0371, 0000, 0274, 0133, 0346, 0335, 0317, 0132, 0033, 0343, 0246, 0371, 
+  0162, 0006, 0250, 0373, 0262, 0017, 0042, 0000, 0165, 0237, 0027, 0165, 0365, 0162, 0313, 0111, 
+  0215, 0047, 0220, 0356, 0361, 0111, 0267, 0240, 0066, 0100, 0267, 0372, 0145, 0162, 0216, 0103, 
+  0122, 0306, 0100, 0040, 0255, 0107, 0235, 0200, 0274, 0103, 0106, 0336, 0102, 0274, 0200, 0170, 
+  0173, 0104, 0274, 0205, 0161, 0001, 0360, 0002, 0170, 0001, 0274, 0303, 0006, 0336, 0102, 0072, 
+  0000, 0357, 0226, 0171, 0367, 0103, 0253, 0225, 0014, 0150, 0267, 0127, 0264, 0173, 0325, 0347, 
+  0143, 0367, 0227, 0175, 0070, 0166, 0237, 0235, 0310, 0076, 0323, 0043, 0367, 0177, 0046, 0255, 
+  0077, 0315, 0161, 0373, 0313, 0363, 0073, 0156, 0057, 0146, 0063, 0356, 0020, 0216, 0333, 0357, 
+  0367, 0016, 0160, 0334, 0276, 0267, 0006, 0227, 0253, 0073, 0271, 0324, 0343, 0014, 0173, 0353, 
+  0370, 0366, 0126, 0256, 0065, 0314, 0255, 0252, 0271, 0025, 0004, 0236, 0116, 0057, 0161, 0256, 
+  0261, 0002, 0167, 0006, 0127, 0153, 0310, 0256, 0126, 0036, 0046, 0360, 0264, 0172, 0344, 0151, 
+  0345, 0243, 0002, 0107, 0013, 0216, 0026, 0034, 0255, 0141, 0073, 0132, 0171, 0062, 0200, 0237, 
+  0125, 0106, 0346, 0217, 0231, 0060, 0370, 0115, 0300, 0163, 0065, 0265, 0160, 0024, 0377, 0205, 
+  0021, 0356, 0112, 0204, 0056, 0350, 0366, 0370, 0164, 0233, 0350, 0014, 0262, 0255, 0220, 0355, 
+  0275, 0225, 0332, 0204, 0326, 0303, 0053, 0023, 0154, 0073, 0144, 0266, 0115, 0202, 0004, 0134, 
+  0333, 0043, 0256, 0115, 0106, 0004, 0114, 0013, 0246, 0005, 0323, 0016, 0233, 0151, 0223, 0104, 
+  0000, 0236, 0055, 0363, 0354, 0167, 0055, 0212, 0361, 0045, 0024, 0351, 0336, 0123, 0340, 0054, 
+  0016, 0337, 0003, 0147, 0237, 0027, 0147, 0145, 0020, 0022, 0163, 0345, 0202, 0010, 0237, 0331, 
+  0236, 0200, 0152, 0213, 0162, 0003, 0156, 0267, 0301, 0155, 0101, 0045, 0360, 0355, 0220, 0371, 
+  0266, 0030, 0056, 0300, 0334, 0036, 0141, 0156, 0161, 0140, 0100, 0273, 0240, 0135, 0320, 0356, 
+  0260, 0151, 0267, 0230, 0017, 0000, 0275, 0225, 0175, 0317, 0217, 0332, 0340, 0053, 0325, 0317, 
+  0025, 0174, 0173, 0375, 0233, 0200, 0127, 0175, 0070, 0234, 0220, 0355, 0137, 0077, 0323, 0303, 
+  0011, 0377, 0111, 0132, 0217, 0303, 0011, 0133, 0026, 0342, 0154, 0064, 0132, 0343, 0150, 0302, 
+  0176, 0017, 0001, 0107, 0023, 0172, 0353, 0164, 0151, 0225, 0042, 0374, 0202, 0302, 0051, 0114, 
+  0256, 0114, 0151, 0370, 0133, 0025, 0177, 0353, 0207, 0020, 0113, 0153, 0112, 0122, 0131, 0063, 
+  0016, 0143, 0153, 0320, 0306, 0126, 0026, 0042, 0360, 0264, 0172, 0344, 0151, 0145, 0143, 0002, 
+  0073, 0013, 0166, 0126, 0163, 0073, 0353, 0011, 0223, 0157, 0101, 0316, 0355, 0373, 0110, 0051, 
+  0335, 0366, 0342, 0374, 0113, 0336, 0066, 0266, 0023, 0137, 0235, 0246, 0127, 0333, 0213, 0262, 
+  0235, 0163, 0354, 0077, 0042, 0337, 0140, 0312, 0150, 0365, 0116, 0073, 0325, 0134, 0177, 0152, 
+  0125, 0041, 0071, 0304, 0357, 0110, 0332, 0056, 0315, 0130, 0344, 0251, 0003, 0114, 0322, 0105, 
+  0227, 0065, 0100, 0135, 0105, 0221, 0044, 0073, 0362, 0065, 0243, 0170, 0334, 0077, 0200, 0152, 
+  0156, 0310, 0126, 0066, 0367, 0335, 0370, 0230, 0243, 0010, 0333, 0326, 0067, 0340, 0054, 0061, 
+  0202, 0351, 0015, 0323, 0373, 0060, 0246, 0167, 0226, 0260, 0341, 0167, 0227, 0137, 0061, 0337, 
+  0022, 0131, 0340, 0161, 0343, 0254, 0022, 0054, 0257, 0347, 0265, 0274, 0226, 0142, 0312, 0075, 
+  0256, 0326, 0060, 0275, 0216, 0157, 0172, 0345, 0132, 0303, 0366, 0252, 0330, 0136, 0101, 0110, 
+  0063, 0012, 0311, 0167, 0110, 0132, 0056, 0311, 0133, 0075, 0242, 0126, 0372, 0365, 0263, 0074, 
+  0225, 0014, 0126, 0330, 0220, 0255, 0260, 0074, 0160, 0140, 0206, 0365, 0310, 0014, 0313, 0107, 
+  0005, 0166, 0030, 0354, 0260, 0147, 0261, 0303, 0362, 0031, 0170, 0134, 0103, 0054, 0367, 0303, 
+  0154, 0030, 0142, 0060, 0304, 0140, 0210, 0301, 0020, 0203, 0041, 0326, 0325, 0020, 0313, 0123, 
+  0066, 0054, 0261, 0362, 0113, 0346, 0106, 0064, 0047, 0035, 0230, 0142, 0057, 0373, 0304, 0343, 
+  0041, 0167, 0022, 0376, 0334, 0207, 0215, 0237, 0311, 0336, 0100, 0026, 0004, 0362, 0134, 0367, 
+  0176, 0276, 0153, 0146, 0106, 0234, 0150, 0340, 0116, 0262, 0005, 0264, 0256, 0057, 0365, 0375, 
+  0350, 0024, 0220, 0355, 0003, 0261, 0165, 0000, 0326, 0364, 0265, 0322, 0317, 0162, 0037, 0113, 
+  0027, 0307, 0314, 0111, 0276, 0034, 0166, 0305, 0335, 0071, 0251, 0074, 0377, 0225, 0377, 0154, 
+  0204, 0044, 0003, 0341, 0113, 0335, 0032, 0153, 0064, 0062, 0047, 0013, 0362, 0202, 0024, 0100, 
+  0164, 0223, 0112, 0167, 0356, 0057, 0377, 0017, 0163, 0342, 0170, 0102, 0322, 0256, 0362, 0225, 
+  0077, 0146, 0255, 0052, 0307, 0046, 0127, 0036, 0115, 0131, 0230, 0307, 0330, 0070, 0360, 0230, 
+  0103, 0013, 0235, 0353, 0051, 0274, 0330, 0350, 0350, 0243, 0002, 0343, 0013, 0356, 0053, 0012, 
+  0147, 0372, 0346, 0311, 0253, 0377, 0003, 0142, 0042, 0313, 0263, 0000, 0050, 0165, 0165, 0141, 
+  0171, 0051, 0057, 0000, 0000, 0000, 0000, 0000, 0155, 0143, 0143, 0057, 0005, 0000, 0000, 0000, 
+  0155, 0141, 0164, 0145, 0057, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 0144, 0141, 0057, 0000, 
+  0001, 0000, 0000, 0000
+} };
+
+static GStaticResource static_resource = { default_applications_resource_data.data, sizeof (default_applications_resource_data.data) - 1 /* nul terminator */, NULL, NULL, NULL };
+
+G_MODULE_EXPORT
+GResource *default_applications_get_resource (void);
+GResource *default_applications_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(default_applicationsresource_constructor)
+#endif
+G_DEFINE_CONSTRUCTOR(default_applicationsresource_constructor)
+#ifdef G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA
+#pragma G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(default_applicationsresource_destructor)
+#endif
+G_DEFINE_DESTRUCTOR(default_applicationsresource_destructor)
+
+#else
+#warning "Constructor not supported on this compiler, linking in resources will not work"
+#endif
+
+static void default_applicationsresource_constructor (void)
+{
+  g_static_resource_init (&static_resource);
+}
+
+static void default_applicationsresource_destructor (void)
+{
+  g_static_resource_fini (&static_resource);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/47.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/47.html new file mode 100644 index 00000000..a4ef21e1 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/47.html @@ -0,0 +1,369 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/* 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 __FOO_MARSHAL_MARSHAL_H__
+#define __FOO_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:OBJECT,OBJECT (foo-marshal.list:1) */
+extern
+void foo_marshal_VOID__OBJECT_OBJECT (GClosure     *closure,
+                                      GValue       *return_value,
+                                      guint         n_param_values,
+                                      const GValue *param_values,
+                                      gpointer      invocation_hint,
+                                      gpointer      marshal_data);
+
+/* VOID:UINT,UINT,UINT,UINT (foo-marshal.list:2) */
+extern
+void foo_marshal_VOID__UINT_UINT_UINT_UINT (GClosure     *closure,
+                                            GValue       *return_value,
+                                            guint         n_param_values,
+                                            const GValue *param_values,
+                                            gpointer      invocation_hint,
+                                            gpointer      marshal_data);
+
+/* VOID:UINT,UINT (foo-marshal.list:3) */
+extern
+void foo_marshal_VOID__UINT_UINT (GClosure     *closure,
+                                  GValue       *return_value,
+                                  guint         n_param_values,
+                                  const GValue *param_values,
+                                  gpointer      invocation_hint,
+                                  gpointer      marshal_data);
+
+/* VOID:BOXED,BOXED (foo-marshal.list:4) */
+extern
+void foo_marshal_VOID__BOXED_BOXED (GClosure     *closure,
+                                    GValue       *return_value,
+                                    guint         n_param_values,
+                                    const GValue *param_values,
+                                    gpointer      invocation_hint,
+                                    gpointer      marshal_data);
+
+/* VOID:POINTER,BOXED,POINTER (foo-marshal.list:5) */
+extern
+void foo_marshal_VOID__POINTER_BOXED_POINTER (GClosure     *closure,
+                                              GValue       *return_value,
+                                              guint         n_param_values,
+                                              const GValue *param_values,
+                                              gpointer      invocation_hint,
+                                              gpointer      marshal_data);
+
+/* VOID:POINTER,POINTER (foo-marshal.list:6) */
+extern
+void foo_marshal_VOID__POINTER_POINTER (GClosure     *closure,
+                                        GValue       *return_value,
+                                        guint         n_param_values,
+                                        const GValue *param_values,
+                                        gpointer      invocation_hint,
+                                        gpointer      marshal_data);
+
+
+G_END_DECLS
+
+#endif /* __FOO_MARSHAL_MARSHAL_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/48.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/48.html new file mode 100644 index 00000000..27c88ccd --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/48.html @@ -0,0 +1,801 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * mate-display-properties-install-systemwide - Install a RANDR profile for the whole system
+ *
+ * Copyright (C) 2010 Novell, Inc.
+ *
+ * Authors: Federico Mena Quintero <federico@novell.com>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * 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.
+ */
+
+#include "config.h"<--- Include file: "config.h" not found.
+
+#include <errno.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#ifdef ENABLE_NLS
+#include <locale.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif /* ENABLE_NLS */
+#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 <fcntl.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/stat.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 <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.
+
+#define SYSTEM_RANDR_PATH "/etc/mate-settings-daemon/xrandr"
+
+static void
+usage (const char *program_name)
+{
+	g_print (_("Usage: %s SOURCE_FILE DEST_NAME\n"
+		   "\n"
+		   "This program installs a RANDR profile for multi-monitor setups into\n"
+		   "a systemwide location.  The resulting profile will get used when\n"
+		   "the RANDR plug-in gets run in mate-settings-daemon.\n"
+		   "\n"
+		   "SOURCE_FILE - a full pathname, typically /home/username/.config/monitors.xml\n"
+		   "\n"
+		   "DEST_NAME - relative name for the installed file.  This will get put in\n"
+		   "            the systemwide directory for RANDR configurations,\n"
+		   "            so the result will typically be %s/DEST_NAME\n"),
+		 program_name,
+		 SYSTEM_RANDR_PATH);
+}
+
+static gboolean
+is_basename (const char *filename)
+{
+	if (*filename == '\0')
+		return FALSE; /* no empty strings, please */
+
+	for (; *filename; filename++)
+		if (G_IS_DIR_SEPARATOR (*filename))
+			return FALSE;
+
+	return TRUE;
+}
+
+static gboolean
+copy_file (int source_fd, int dest_fd)
+{
+	char buf[1024];
+	ssize_t num_read;
+	ssize_t num_written;
+
+	while (TRUE) {
+		char *p;
+
+		num_read = read (source_fd, buf, sizeof (buf));
+		if (num_read == 0)
+			break;
+
+		if (num_read == -1) {
+			if (errno == EINTR)
+				continue;
+			else
+				return FALSE;
+		}
+
+		p = buf;
+		while (num_read > 0) {
+			num_written = write (dest_fd, p, (size_t) num_read);
+			if (num_written == -1) {
+				if (errno == EINTR)
+					continue;
+				else
+					return FALSE;
+			}
+
+			num_read -= num_written;
+			p += num_written;
+		}
+	}
+
+	return TRUE;
+}
+
+/* This is essentially a "please copy a file to a privileged location" program.
+ * We try to be paranoid in the following ways:
+ *
+ * - We copy only regular files, owned by the user who called pkexec(1), to
+ *   avoid attacks like "copy a file that I'm not allowed to read into a
+ *   world-readable location".
+ *
+ * - We copy only to a well-known directory.
+ *
+ * - We try to avoid race conditions.  We only fstat() files that we have open
+ *   to avoid files moving under our feet.  We only create files in directories
+ *   that we have open.
+ *
+ * - We replace the destination file atomically.
+ */
+
+int
+main (int argc, char **argv)
+{
+	uid_t uid, euid;
+	const char *source_filename;
+	const char *dest_name;
+	const char *pkexec_uid_str;
+	unsigned int pkexec_uid;
+	struct stat statbuf;
+	int err;
+	int source_fd;
+	int dest_fd;
+	char template[100];
+
+#ifdef ENABLE_NLS
+	setlocale (LC_ALL, "");
+	bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
+	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+	textdomain (GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
+
+	/* We only run as root */
+	uid = getuid ();
+	euid = geteuid ();
+	if (uid != 0 || euid != 0) {
+		/* Translators: only able to install RANDR profiles as root */
+		g_print ("%s\n", _("This program can only be used by the root user"));
+		return EXIT_FAILURE;
+	}
+
+	/* Usage: gsd-xrandr-install-systemwide SOURCE_FILE DEST_NAME */
+
+	if (argc != 3) {
+		usage (argv[0]);
+		return EXIT_FAILURE;
+	}
+
+	source_filename = argv[1];
+	dest_name = argv[2];
+
+	/* Absolute source filenames only, please */
+
+	if (!g_path_is_absolute (source_filename)) {
+		g_print ("%s\n", _("The source filename must be absolute"));
+		return EXIT_FAILURE;
+	}
+
+	/* We only copy regular files */
+
+	source_fd = open (source_filename, O_RDONLY);
+	if (source_fd == -1) {
+		err = errno;
+
+		/* Translators: first %s is a filename; second %s is an error message */
+		g_print (_("Could not open %s: %s\n"),
+			 source_filename,
+			 g_strerror (err));
+		return EXIT_FAILURE;
+	}
+
+	if (fstat (source_fd, &statbuf) != 0) {
+		err = errno;
+		/* Translators: first %s is a filename; second %s is an error message */
+		g_print (_("Could not get information for %s: %s\n"),
+			 source_filename,
+			 g_strerror (err));
+		return EXIT_FAILURE;
+	}
+
+	if (!S_ISREG (statbuf.st_mode)) {
+		g_print (_("%s must be a regular file\n"),
+			 source_filename);
+		return EXIT_FAILURE;
+	}
+
+	/* We only copy files that are really owned by the calling user */
+
+	pkexec_uid_str = g_getenv ("PKEXEC_UID");
+	if (pkexec_uid_str == NULL) {
+		g_print ("%s\n", _("This program must only be run through pkexec(1)"));
+		return EXIT_FAILURE;
+	}
+
+	if (sscanf (pkexec_uid_str, "%d", &pkexec_uid) != 1) {<--- %d in format string (no. 1) requires 'int *' but the argument type is 'unsigned int *'.
+		g_print ("%s\n", _("PKEXEC_UID must be set to an integer value"));
+		return EXIT_FAILURE;
+	}
+
+	if (statbuf.st_uid != pkexec_uid) {
+		/* Translators: we are complaining that a file must be really owned by the user who called this program */
+		g_print (_("%s must be owned by you\n"), source_filename);
+		return EXIT_FAILURE;
+	}
+
+	/* We only accept basenames for the destination */
+
+	if (!is_basename (dest_name)) {
+		/* Translators: here we are saying that a plain filename must look like "filename", not like "some_dir/filename" */
+		g_print (_("%s must not have any directory components\n"),
+			 dest_name);
+		return EXIT_FAILURE;
+	}
+
+	/* Chdir to the destination directory to keep it open... */
+
+	if (chdir (SYSTEM_RANDR_PATH) != 0) {
+		g_print (_("%s must be a directory\n"), SYSTEM_RANDR_PATH);
+		return EXIT_FAILURE;
+	}
+
+	/* ... and open our temporary destination file right there */
+
+	strcpy (template, "gsd-XXXXXX");
+	dest_fd = g_mkstemp_full (template, O_WRONLY, 0644);
+	if (dest_fd == -1) {
+		err = errno;
+		/* Translators: the first %s/%s is a directory/filename; the last %s is an error message */
+		g_print (_("Could not open %s/%s: %s\n"),
+			 SYSTEM_RANDR_PATH,
+			 template,
+			 g_strerror (err));
+		return EXIT_FAILURE;
+	}
+
+	/* Do the copy */
+
+	if (!copy_file (source_fd, dest_fd)) {
+		/* If something went wrong, remove the destination file to avoid leaving trash around */
+		unlink (template);
+		return EXIT_FAILURE;
+	}
+
+	/* Rename to the final filename */
+
+	if (rename (template, dest_name) != 0) {
+		err = errno;
+		unlink (template);
+		g_print (_("Could not rename %s to %s: %s\n"),
+			 template,
+			 dest_name,
+			 g_strerror (err));
+		return EXIT_FAILURE;
+	}
+
+	/* Whew!  We'll leave the final closing of the files to the almighty kernel. */
+
+	return EXIT_SUCCESS;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/49.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/49.html new file mode 100644 index 00000000..6d988766 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/49.html @@ -0,0 +1,951 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
#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.display"), aligned (8)))
+#else
+# define SECTION
+#endif
+
+static const SECTION union { const guint8 data[2393]; const double alignment; void * const ptr;}  display_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, 0310, 0000, 0000, 0000, 0000, 0000, 0000, 0050, 0006, 0000, 0000, 0000, 
+  0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0001, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 
+  0003, 0000, 0000, 0000, 0004, 0000, 0000, 0000, 0113, 0120, 0220, 0013, 0002, 0000, 0000, 0000, 
+  0310, 0000, 0000, 0000, 0004, 0000, 0114, 0000, 0314, 0000, 0000, 0000, 0320, 0000, 0000, 0000, 
+  0140, 0066, 0015, 0034, 0003, 0000, 0000, 0000, 0320, 0000, 0000, 0000, 0022, 0000, 0166, 0000, 
+  0350, 0000, 0000, 0000, 0061, 0011, 0000, 0000, 0324, 0265, 0002, 0000, 0377, 0377, 0377, 0377, 
+  0061, 0011, 0000, 0000, 0001, 0000, 0114, 0000, 0064, 0011, 0000, 0000, 0070, 0011, 0000, 0000, 
+  0210, 0305, 0360, 0254, 0004, 0000, 0000, 0000, 0070, 0011, 0000, 0000, 0010, 0000, 0114, 0000, 
+  0100, 0011, 0000, 0000, 0104, 0011, 0000, 0000, 0143, 0041, 0175, 0170, 0005, 0000, 0000, 0000, 
+  0104, 0011, 0000, 0000, 0004, 0000, 0114, 0000, 0110, 0011, 0000, 0000, 0114, 0011, 0000, 0000, 
+  0201, 0321, 0040, 0031, 0000, 0000, 0000, 0000, 0114, 0011, 0000, 0000, 0005, 0000, 0114, 0000, 
+  0124, 0011, 0000, 0000, 0130, 0011, 0000, 0000, 0157, 0162, 0147, 0057, 0005, 0000, 0000, 0000, 
+  0144, 0151, 0163, 0160, 0154, 0141, 0171, 0055, 0143, 0141, 0160, 0160, 0154, 0145, 0164, 0056, 
+  0165, 0151, 0000, 0000, 0000, 0000, 0000, 0000, 0366, 0142, 0000, 0000, 0001, 0000, 0000, 0000, 
+  0170, 0332, 0355, 0135, 0113, 0163, 0333, 0066, 0020, 0276, 0367, 0127, 0240, 0274, 0364, 0320, 
+  0241, 0025, 0311, 0111, 0232, 0166, 0044, 0165, 0322, 0264, 0115, 0063, 0223, 0246, 0031, 0073, 
+  0075, 0163, 0040, 0162, 0051, 0241, 0206, 0000, 0026, 0200, 0154, 0353, 0337, 0167, 0101, 0122, 
+  0262, 0036, 0244, 0370, 0164, 0104, 0251, 0272, 0144, 0054, 0222, 0273, 0004, 0026, 0370, 0276, 
+  0175, 0020, 0100, 0206, 0077, 0077, 0316, 0071, 0271, 0007, 0245, 0231, 0024, 0043, 0247, 0177, 
+  0365, 0302, 0041, 0040, 0174, 0031, 0060, 0061, 0035, 0071, 0177, 0177, 0371, 0335, 0175, 0343, 
+  0374, 0074, 0376, 0146, 0370, 0255, 0353, 0222, 0367, 0040, 0100, 0121, 0003, 0001, 0171, 0140, 
+  0146, 0106, 0246, 0234, 0006, 0100, 0256, 0257, 0256, 0337, 0134, 0015, 0210, 0353, 0342, 0103, 
+  0114, 0030, 0120, 0041, 0365, 0141, 0374, 0015, 0041, 0103, 0005, 0377, 0056, 0230, 0002, 0115, 
+  0070, 0233, 0214, 0234, 0251, 0271, 0373, 0336, 0171, 0172, 0321, 0365, 0325, 0140, 0340, 0364, 
+  0342, 0347, 0344, 0344, 0037, 0360, 0015, 0361, 0071, 0325, 0172, 0344, 0274, 0067, 0167, 0037, 
+  0346, 0164, 0012, 0016, 0141, 0301, 0310, 0241, 0121, 0304, 0227, 0336, 0144, 0141, 0214, 0024, 
+  0036, 0233, 0117, 0035, 0053, 0201, 0062, 0221, 0222, 0021, 0050, 0263, 0044, 0202, 0316, 0141, 
+  0344, 0334, 0063, 0315, 0046, 0034, 0234, 0361, 0027, 0265, 0200, 0141, 0157, 0165, 0067, 0373, 
+  0141, 0237, 0012, 0067, 0224, 0376, 0102, 0073, 0343, 0337, 0051, 0327, 0205, 0317, 0063, 0137, 
+  0012, 0327, 0376, 0351, 0214, 0261, 0023, 0156, 0334, 0244, 0155, 0231, 0141, 0057, 0351, 0103, 
+  0141, 0167, 0146, 0300, 0243, 0356, 0364, 0306, 0266, 0306, 0235, 0050, 0371, 0240, 0101, 0125, 
+  0351, 0320, 0107, 0246, 0315, 0255, 0221, 0052, 0355, 0024, 0307, 0237, 0332, 0376, 0354, 0257, 
+  0372, 0343, 0113, 0276, 0230, 0013, 0235, 0374, 0302, 0337, 0166, 0362, 0044, 0327, 0342, 0067, 
+  0023, 0146, 0140, 0036, 0317, 0230, 0364, 0176, 0162, 0217, 0230, 0145, 0204, 0015, 0234, 0372, 
+  0063, 0252, 0250, 0122, 0164, 0231, 0314, 0017, 0333, 0232, 0055, 0205, 0303, 0200, 0032, 0272, 
+  0226, 0305, 0346, 0257, 0376, 0116, 0064, 0305, 0155, 0302, 0131, 0154, 0024, 0025, 0232, 0343, 
+  0243, 0150, 0312, 0221, 0263, 0004, 0064, 0320, 0047, 0251, 0346, 0224, 0307, 0352, 0326, 0362, 
+  0275, 0015, 0005, 0225, 0224, 0175, 0204, 0320, 0264, 0244, 0352, 0206, 0115, 0147, 0155, 0351, 
+  0372, 0073, 0322, 0054, 0000, 0067, 0220, 0017, 0042, 0117, 0343, 0260, 0267, 0262, 0140, 0351, 
+  0211, 0373, 0300, 0004, 0152, 0364, 0174, 0056, 0065, 0164, 0013, 0216, 0050, 0356, 0003, 0257, 
+  0062, 0175, 0177, 0145, 0224, 0313, 0151, 0322, 0257, 0040, 0371, 0273, 0235, 0226, 0115, 0244, 
+  0012, 0100, 0271, 0017, 0054, 0060, 0063, 0147, 0374, 0252, 0350, 0161, 0303, 0014, 0332, 0050, 
+  0153, 0014, 0377, 0224, 0202, 0041, 0240, 0310, 0147, 0005, 0041, 0050, 0244, 0143, 0320, 0205, 
+  0312, 0020, 0073, 0356, 0014, 0011, 0330, 0031, 0047, 0175, 0332, 0023, 0360, 0147, 0214, 0007, 
+  0044, 0246, 0150, 0101, 0271, 0033, 0377, 0304, 0241, 0232, 0310, 0107, 0147, 0075, 0107, 0366, 
+  0154, 0365, 0013, 0336, 0335, 0060, 0224, 0153, 0037, 0357, 0073, 0033, 0223, 0261, 0312, 0310, 
+  0327, 0261, 0161, 0226, 0214, 0124, 0014, 0204, 0241, 0006, 0035, 0211, 0063, 0106, 0217, 0142, 
+  0230, 0117, 0171, 0031, 0101, 0035, 0121, 0037, 0375, 0232, 0063, 0036, 0144, 0076, 0235, 0155, 
+  0041, 0352, 0333, 0027, 0171, 0124, 0001, 0335, 0350, 0170, 0246, 0261, 0142, 0134, 0354, 0232, 
+  0154, 0103, 0276, 0277, 0245, 0240, 0206, 0365, 0352, 0132, 0060, 0113, 0216, 0323, 0245, 0134, 
+  0030, 0127, 0233, 0245, 0175, 0043, 0210, 0040, 0127, 0060, 0066, 0304, 0366, 0265, 0374, 0356, 
+  0077, 0071, 0272, 0204, 0046, 0166, 0373, 0234, 0335, 0224, 0011, 0360, 0114, 0044, 0170, 0177, 
+  0240, 0242, 0274, 0206, 0325, 0066, 0141, 0201, 0031, 0353, 0210, 0006, 0020, 0322, 0005, 0067, 
+  0325, 0205, 0025, 0370, 0300, 0356, 0101, 0077, 0151, 0070, 0070, 0212, 0231, 0214, 0030, 0363, 
+  0364, 0170, 0047, 0270, 0250, 0242, 0141, 0241, 0301, 0135, 0010, 0044, 0057, 0316, 0104, 0241, 
+  0355, 0066, 0331, 0165, 0133, 0051, 0365, 0357, 0020, 0136, 0305, 0257, 0203, 0307, 0210, 0212, 
+  0240, 0106, 0117, 0103, 0306, 0171, 0015, 0261, 0110, 0152, 0226, 0260, 0305, 0213, 0052, 0142, 
+  0032, 0320, 0325, 0004, 0124, 0055, 0213, 0055, 0222, 0331, 0165, 0364, 0277, 0373, 0310, 0251, 
+  0203, 0246, 0071, 0275, 0003, 0057, 0235, 0037, 0351, 0010, 0067, 0102, 0325, 0133, 0033, 0302, 
+  0022, 0275, 0324, 0030, 0207, 0131, 0167, 0005, 0135, 0107, 0330, 0076, 0110, 0252, 0152, 0060, 
+  0122, 0162, 0303, 0042, 0327, 0300, 0243, 0311, 0265, 0011, 0303, 0144, 0305, 0314, 0200, 0370, 
+  0013, 0205, 0136, 0027, 0107, 0103, 0212, 0220, 0115, 0027, 0052, 0166, 0065, 0044, 0104, 0217, 
+  0054, 0361, 0266, 0042, 0177, 0276, 0375, 0362, 0033, 0101, 0314, 0050, 0115, 0360, 0172, 0054, 
+  0041, 0347, 0321, 0002, 0375, 0306, 0025, 0371, 0044, 0015, 0340, 0045, 0152, 0360, 0037, 0246, 
+  0111, 0040, 0101, 0213, 0357, 0014, 0241, 0141, 0150, 0307, 0027, 0035, 0002, 0023, 0104, 0373, 
+  0012, 0100, 0240, 0360, 0112, 0141, 0000, 0372, 0316, 0310, 0010, 0063, 0257, 0173, 0246, 0244, 
+  0230, 0343, 0313, 0365, 0325, 0005, 0300, 0031, 0000, 0356, 0037, 0017, 0205, 0233, 0271, 0150, 
+  0063, 0247, 0366, 0166, 0077, 0205, 0274, 0170, 0265, 0034, 0257, 0266, 0133, 0001, 0270, 0240, 
+  0042, 0003, 0025, 0203, 0343, 0241, 0042, 0031, 0231, 0101, 0063, 0100, 0274, 0263, 0171, 0345, 
+  0005, 0020, 0245, 0000, 0221, 0223, 0212, 0137, 0160, 0221, 0201, 0213, 0353, 0066, 0160, 0221, 
+  0145, 0200, 0354, 0316, 0327, 0352, 0170, 0166, 0247, 0253, 0144, 0200, 0266, 0055, 0256, 0055, 
+  0000, 0034, 0116, 0343, 0252, 0006, 0305, 0031, 0026, 0332, 0263, 0316, 0076, 0143, 0304, 0305, 
+  0076, 0341, 0246, 0025, 0273, 0321, 0000, 0377, 0266, 0025, 0306, 0321, 0365, 0106, 0301, 0057, 
+  0233, 0125, 0336, 0053, 0026, 0044, 0234, 0022, 0163, 0303, 0240, 0113, 0311, 0062, 0166, 0301, 
+  0135, 0127, 0017, 0372, 0203, 0322, 0257, 0113, 0212, 0236, 0145, 0044, 0313, 0122, 0357, 0252, 
+  0272, 0140, 0053, 0061, 0327, 0316, 0327, 0141, 0312, 0312, 0010, 0054, 0135, 0241, 0051, 0254, 
+  0324, 0364, 0007, 0007, 0305, 0062, 0255, 0226, 0155, 0271, 0267, 0234, 0115, 0343, 0310, 0072, 
+  0215, 0346, 0354, 0117, 0047, 0113, 0264, 0201, 0015, 0233, 0332, 0361, 0160, 0237, 0022, 0355, 
+  0234, 0372, 0060, 0223, 0034, 0331, 0273, 0227, 0243, 0240, 0227, 0157, 0225, 0034, 0056, 0077, 
+  0314, 0347, 0207, 0250, 0255, 0216, 0105, 0212, 0031, 0256, 0141, 0042, 0237, 0313, 0356, 0007, 
+  0315, 0123, 0145, 0062, 0255, 0141, 0070, 0333, 0051, 0210, 0166, 0147, 0032, 0325, 0103, 0124, 
+  0211, 0031, 0270, 0147, 0214, 0167, 0063, 0360, 0267, 0142, 0102, 0214, 0115, 0004, 0170, 0276, 
+  0275, 0274, 0131, 0136, 0056, 0156, 0144, 0176, 0210, 0170, 0113, 0075, 0373, 0341, 0310, 0206, 
+  0100, 0004, 0063, 0150, 0312, 0071, 0231, 0047, 0125, 0162, 0135, 0324, 0235, 0306, 0103, 0321, 
+  0060, 0216, 0154, 0061, 0044, 0154, 0045, 0240, 0313, 0127, 0023, 0050, 0372, 0340, 0142, 0170, 
+  0211, 0154, 0215, 0206, 0055, 0253, 0347, 0020, 0251, 0024, 0023, 0113, 0243, 0200, 0261, 0141, 
+  0340, 0330, 0230, 0146, 0012, 0250, 0246, 0200, 0215, 0253, 0043, 0155, 0023, 0144, 0001, 0030, 
+  0274, 0351, 0005, 0114, 0243, 0113, 0130, 0352, 0374, 0302, 0104, 0215, 0174, 0354, 0327, 0130, 
+  0367, 0031, 0042, 0254, 0256, 0246, 0132, 0000, 0073, 0103, 0140, 0224, 0312, 0064, 0032, 0127, 
+  0362, 0232, 0103, 0253, 0375, 0100, 0247, 0226, 0323, 0255, 0140, 0356, 0332, 0206, 0252, 0036, 
+  0352, 0064, 0317, 0350, 0071, 0204, 0306, 0245, 0306, 0120, 0177, 0126, 0361, 0233, 0212, 0221, 
+  0121, 0031, 0301, 0347, 0250, 0132, 0145, 0045, 0000, 0366, 0147, 0277, 0253, 0131, 0324, 0143, 
+  0232, 0243, 0124, 0062, 0360, 0262, 0224, 0120, 0076, 0160, 0162, 0322, 0367, 0037, 0166, 0322, 
+  0367, 0322, 0151, 0374, 0111, 0004, 0307, 0133, 0351, 0375, 0353, 0312, 0157, 0057, 0235, 0345, 
+  0327, 0365, 0373, 0037, 0023, 0127, 0035, 0257, 0266, 0262, 0177, 0016, 0234, 0343, 0070, 0342, 
+  0332, 0216, 0343, 0100, 0254, 0161, 0003, 0032, 0355, 0147, 0251, 0356, 0247, 0043, 0206, 0276, 
+  0163, 0001, 0066, 0332, 0361, 0355, 0347, 0320, 0051, 0140, 0244, 0240, 0326, 0315, 0362, 0174, 
+  0071, 0237, 0310, 0072, 0112, 0113, 0001, 0370, 0271, 0142, 0205, 0362, 0034, 0135, 0206, 0253, 
+  0257, 0273, 0025, 0010, 0357, 0002, 0342, 0372, 0174, 0000, 0161, 0003, 0136, 0210, 0223, 0157, 
+  0106, 0354, 0122, 0333, 0216, 0101, 0042, 0156, 0330, 0005, 0017, 0250, 0340, 0145, 0267, 0360, 
+  0360, 0316, 0016, 0311, 0272, 0050, 0265, 0313, 0135, 0335, 0006, 0307, 0063, 0017, 0165, 0377, 
+  0314, 0250, 0157, 0167, 0250, 0067, 0060, 0171, 0031, 0347, 0063, 0202, 0364, 0126, 0211, 0371, 
+  0344, 0002, 0276, 0012, 0301, 0160, 0261, 0161, 0262, 0015, 0164, 0103, 0003, 0046, 0267, 0226, 
+  0311, 0045, 0345, 0052, 0017, 0151, 0117, 0331, 0173, 0316, 0041, 0175, 0125, 0134, 0362, 0137, 
+  0242, 0114, 0037, 0132, 0031, 0213, 0226, 0052, 0141, 0055, 0327, 0233, 0133, 0214, 0062, 0262, 
+  0124, 0331, 0045, 0322, 0367, 0015, 0165, 0324, 0253, 0135, 0227, 0341, 0245, 0162, 0334, 0324, 
+  0112, 0271, 0256, 0205, 0222, 0135, 0343, 0172, 0166, 0011, 0236, 0053, 0344, 0272, 0366, 0041, 
+  0035, 0206, 0155, 0143, 0072, 0014, 0057, 0240, 0176, 0116, 0120, 0327, 0007, 0344, 0276, 0256, 
+  0251, 0222, 0213, 0310, 0031, 0357, 0022, 0374, 0005, 0337, 0065, 0212, 0352, 0355, 0340, 0273, 
+  0353, 0371, 0131, 0277, 0323, 0101, 0273, 0114, 0326, 0306, 0234, 0102, 0324, 0236, 0121, 0027, 
+  0220, 0001, 0162, 0352, 0370, 0151, 0333, 0347, 0163, 0005, 0170, 0357, 0200, 0363, 0033, 0260, 
+  0154, 0004, 0352, 0113, 0274, 0156, 0077, 0136, 0134, 0200, 0127, 0125, 0172, 0325, 0256, 0346, 
+  0357, 0073, 0275, 0203, 0152, 0161, 0106, 0050, 0066, 0131, 0030, 0320, 0005, 0240, 0132, 0077, 
+  0270, 0232, 0116, 0366, 0225, 0166, 0046, 0256, 0157, 0034, 0206, 0124, 0231, 0027, 0035, 0027, 
+  0125, 0215, 0123, 0244, 0127, 0035, 0103, 0325, 0356, 0302, 0023, 0244, 0143, 0340, 0355, 0056, 
+  0074, 0371, 0040, 0174, 0276, 0010, 0200, 0170, 0261, 0356, 0313, 0122, 0221, 0216, 0055, 0025, 
+  0151, 0327, 0153, 0274, 0356, 0326, 0374, 0316, 0373, 0142, 0371, 0262, 0363, 0056, 0243, 0230, 
+  0355, 0213, 0327, 0061, 0136, 0370, 0362, 0071, 0227, 0017, 0105, 0212, 0315, 0251, 0132, 0266, 
+  0271, 0154, 0350, 0026, 0014, 0241, 0232, 0244, 0232, 0217, 0262, 0150, 0110, 0203, 0260, 0241, 
+  0260, 0055, 0046, 0324, 0146, 0310, 0116, 0055, 0074, 0052, 0334, 0267, 0210, 0106, 0117, 0066, 
+  0055, 0152, 0340, 0070, 0332, 0020, 0254, 0126, 0155, 0155, 0014, 0305, 0325, 0351, 0063, 0363, 
+  0240, 0216, 0202, 0364, 0044, 0206, 0101, 0267, 0277, 0135, 0276, 0072, 0243, 0157, 0227, 0136, 
+  0232, 0331, 0164, 0353, 0273, 0345, 0126, 0272, 0365, 0077, 0377, 0160, 0331, 0061, 0227, 0364, 
+  0333, 0075, 0306, 0063, 0353, 0304, 0070, 0335, 0170, 0355, 0255, 0012, 0075, 0140, 0357, 0172, 
+  0325, 0102, 0371, 0116, 0100, 0044, 0155, 0204, 0233, 0154, 0326, 0153, 0067, 0162, 0072, 0104, 
+  0050, 0273, 0006, 0114, 0240, 0172, 0334, 0362, 0146, 0243, 0322, 0126, 0076, 0327, 0244, 0207, 
+  0344, 0324, 0125, 0134, 0001, 0322, 0025, 0013, 0011, 0031, 0245, 0204, 0007, 0260, 0047, 0074, 
+  0071, 0344, 0236, 0362, 0105, 0174, 0120, 0020, 0017, 0016, 0127, 0055, 0312, 0326, 0023, 0312, 
+  0124, 0067, 0117, 0274, 0222, 0367, 0342, 0144, 0075, 0177, 0243, 0255, 0132, 0307, 0332, 0010, 
+  0366, 0165, 0326, 0014, 0367, 0117, 0144, 0315, 0360, 0326, 0166, 0313, 0227, 0347, 0277, 0335, 
+  0362, 0165, 0133, 0273, 0055, 0167, 0203, 0334, 0067, 0247, 0260, 0014, 0070, 0337, 0331, 0174, 
+  0266, 0305, 0077, 0142, 0217, 0236, 0253, 0252, 0263, 0264, 0237, 0051, 0341, 0137, 0232, 0370, 
+  0225, 0042, 0177, 0162, 0116, 0073, 0046, 0216, 0274, 0071, 0064, 0257, 0154, 0067, 0070, 0011, 
+  0014, 0130, 0232, 0216, 0150, 0020, 0174, 0255, 0315, 0242, 0172, 0046, 0037, 0074, 0041, 0015, 
+  0013, 0155, 0055, 0331, 0246, 0151, 0026, 0146, 0355, 0354, 0143, 0273, 0105, 0335, 0353, 0135, 
+  0154, 0166, 0337, 0150, 0355, 0042, 0376, 0231, 0155, 0030, 0235, 0245, 0254, 0244, 0015, 0125, 
+  0346, 0314, 0076, 0043, 0134, 0266, 0205, 0325, 0043, 0271, 0256, 0154, 0013, 0033, 0034, 0051, 
+  0304, 0323, 0030, 0064, 0201, 0167, 0237, 0135, 0155, 0270, 0304, 0171, 0345, 0342, 0274, 0037, 
+  0117, 0073, 0316, 0273, 0105, 0203, 0242, 0201, 0056, 0101, 0336, 0045, 0310, 0253, 0222, 0155, 
+  0167, 0234, 0121, 0237, 0367, 0320, 0304, 0174, 0323, 0074, 0233, 0226, 0346, 0107, 0162, 0125, 
+  0071, 0064, 0252, 0306, 0211, 0134, 0105, 0136, 0272, 0370, 0154, 0255, 0355, 0056, 0156, 0335, 
+  0034, 0046, 0107, 0112, 0247, 0337, 0067, 0236, 0216, 0331, 0337, 0272, 0114, 0024, 0350, 0110, 
+  0012, 0215, 0255, 0161, 0373, 0375, 0344, 0164, 0340, 0364, 0104, 0146, 0144, 0211, 0315, 0047, 
+  0013, 0345, 0121, 0072, 0343, 0004, 0332, 0252, 0132, 0334, 0376, 0213, 0355, 0323, 0034, 0053, 
+  0053, 0370, 0301, 0031, 0247, 0247, 0015, 0146, 0212, 0356, 0134, 0324, 0333, 0047, 0301, 0017, 
+  0173, 0033, 0377, 0073, 0305, 0177, 0337, 0021, 0277, 0305, 0000, 0050, 0165, 0165, 0141, 0171, 
+  0051, 0057, 0000, 0000, 0000, 0000, 0000, 0000, 0144, 0151, 0163, 0160, 0154, 0141, 0171, 0057, 
+  0001, 0000, 0000, 0000, 0155, 0143, 0143, 0057, 0003, 0000, 0000, 0000, 0155, 0141, 0164, 0145, 
+  0057, 0000, 0000, 0000, 0004, 0000, 0000, 0000
+} };
+
+static GStaticResource static_resource = { display_resource_data.data, sizeof (display_resource_data.data) - 1 /* nul terminator */, NULL, NULL, NULL };
+
+G_MODULE_EXPORT
+GResource *display_get_resource (void);
+GResource *display_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(displayresource_constructor)
+#endif
+G_DEFINE_CONSTRUCTOR(displayresource_constructor)
+#ifdef G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA
+#pragma G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(displayresource_destructor)
+#endif
+G_DEFINE_DESTRUCTOR(displayresource_destructor)
+
+#else
+#warning "Constructor not supported on this compiler, linking in resources will not work"
+#endif
+
+static void displayresource_constructor (void)
+{
+  g_static_resource_init (&static_resource);
+}
+
+static void displayresource_destructor (void)
+{
+  g_static_resource_fini (&static_resource);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/5.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/5.html new file mode 100644 index 00000000..1988c646 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/5.html @@ -0,0 +1,1415 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
#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.about_me"), aligned (8)))
+#else
+# define SECTION
+#endif
+
+static const SECTION union { const guint8 data[6110]; const double alignment; void * const ptr;}  about_me_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, 0000, 0001, 0000, 0000, 0000, 0000, 0000, 0050, 0010, 0000, 0000, 0000, 
+  0000, 0000, 0000, 0000, 0001, 0000, 0000, 0000, 0002, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 
+  0005, 0000, 0000, 0000, 0006, 0000, 0000, 0000, 0006, 0000, 0000, 0000, 0006, 0000, 0000, 0000, 
+  0140, 0165, 0255, 0025, 0004, 0000, 0000, 0000, 0000, 0001, 0000, 0000, 0003, 0000, 0114, 0000, 
+  0004, 0001, 0000, 0000, 0020, 0001, 0000, 0000, 0201, 0321, 0040, 0031, 0003, 0000, 0000, 0000, 
+  0020, 0001, 0000, 0000, 0005, 0000, 0114, 0000, 0030, 0001, 0000, 0000, 0034, 0001, 0000, 0000, 
+  0372, 0040, 0377, 0037, 0000, 0000, 0000, 0000, 0034, 0001, 0000, 0000, 0031, 0000, 0166, 0000, 
+  0070, 0001, 0000, 0000, 0267, 0011, 0000, 0000, 0113, 0120, 0220, 0013, 0005, 0000, 0000, 0000, 
+  0267, 0011, 0000, 0000, 0004, 0000, 0114, 0000, 0274, 0011, 0000, 0000, 0300, 0011, 0000, 0000, 
+  0143, 0041, 0175, 0170, 0001, 0000, 0000, 0000, 0300, 0011, 0000, 0000, 0004, 0000, 0114, 0000, 
+  0304, 0011, 0000, 0000, 0310, 0011, 0000, 0000, 0324, 0265, 0002, 0000, 0377, 0377, 0377, 0377, 
+  0310, 0011, 0000, 0000, 0001, 0000, 0114, 0000, 0314, 0011, 0000, 0000, 0320, 0011, 0000, 0000, 
+  0357, 0104, 0034, 0226, 0000, 0000, 0000, 0000, 0320, 0011, 0000, 0000, 0034, 0000, 0166, 0000, 
+  0360, 0011, 0000, 0000, 0155, 0021, 0000, 0000, 0227, 0065, 0213, 0012, 0000, 0000, 0000, 0000, 
+  0155, 0021, 0000, 0000, 0027, 0000, 0166, 0000, 0210, 0021, 0000, 0000, 0335, 0027, 0000, 0000, 
+  0141, 0155, 0057, 0000, 0007, 0000, 0000, 0000, 0006, 0000, 0000, 0000, 0002, 0000, 0000, 0000, 
+  0155, 0141, 0164, 0145, 0057, 0000, 0000, 0000, 0004, 0000, 0000, 0000, 0155, 0141, 0164, 0145, 
+  0055, 0141, 0142, 0157, 0165, 0164, 0055, 0155, 0145, 0055, 0160, 0141, 0163, 0163, 0167, 0157, 
+  0162, 0144, 0056, 0165, 0151, 0000, 0000, 0000, 0156, 0117, 0000, 0000, 0001, 0000, 0000, 0000, 
+  0170, 0332, 0355, 0134, 0133, 0163, 0342, 0270, 0022, 0176, 0347, 0127, 0364, 0372, 0141, 0153, 
+  0267, 0116, 0034, 0002, 0123, 0273, 0263, 0265, 0041, 0154, 0061, 0331, 0144, 0066, 0125, 0063, 
+  0231, 0124, 0102, 0152, 0152, 0236, 0050, 0141, 0013, 0320, 0106, 0130, 0034, 0111, 0100, 0070, 
+  0277, 0376, 0264, 0154, 0007, 0014, 0030, 0337, 0223, 0220, 0031, 0336, 0300, 0110, 0055, 0365, 
+  0327, 0375, 0165, 0267, 0056, 0246, 0365, 0327, 0343, 0230, 0303, 0214, 0112, 0305, 0204, 0167, 
+  0146, 0065, 0216, 0117, 0054, 0240, 0236, 0043, 0134, 0346, 0015, 0317, 0254, 0373, 0356, 0245, 
+  0375, 0207, 0365, 0127, 0273, 0326, 0372, 0311, 0266, 0341, 0043, 0365, 0250, 0044, 0232, 0272, 
+  0060, 0147, 0172, 0004, 0103, 0116, 0134, 0012, 0357, 0216, 0233, 0315, 0343, 0223, 0132, 0155, 
+  0214, 0077, 0330, 0244, 0057, 0246, 0332, 0036, 0123, 0173, 0102, 0224, 0232, 0013, 0351, 0326, 
+  0316, 0305, 0144, 0041, 0331, 0160, 0244, 0341, 0227, 0363, 0137, 0341, 0163, 0247, 0173, 0001, 
+  0177, 0323, 0031, 0345, 0142, 0202, 0103, 0326, 0152, 0335, 0021, 0123, 0060, 0221, 0142, 0050, 
+  0311, 0030, 0360, 0343, 0100, 0122, 0012, 0112, 0014, 0364, 0234, 0110, 0172, 0012, 0013, 0061, 
+  0005, 0207, 0170, 0040, 0251, 0313, 0224, 0226, 0254, 0077, 0325, 0024, 0230, 0006, 0342, 0271, 
+  0165, 0041, 0153, 0143, 0234, 0346, 0140, 0141, 0036, 0114, 0075, 0227, 0112, 0320, 0043, 0012, 
+  0232, 0312, 0261, 0002, 0061, 0360, 0277, 0174, 0274, 0276, 0017, 0147, 0315, 0341, 0146, 0332, 
+  0347, 0314, 0201, 0117, 0314, 0241, 0236, 0242, 0065, 0202, 0343, 0232, 0047, 0152, 0204, 0372, 
+  0364, 0027, 0176, 0363, 0113, 0063, 0372, 0135, 0070, 0072, 0134, 0012, 0224, 0112, 0064, 0342, 
+  0162, 0012, 0024, 0025, 0306, 0001, 0102, 0234, 0240, 0131, 0013, 0007, 0010, 0245, 0035, 0201, 
+  0220, 0360, 0013, 0321, 0146, 0302, 0022, 0304, 0304, 0164, 0372, 0025, 0147, 0271, 0000, 0216, 
+  0260, 0054, 0373, 0035, 0157, 0053, 0274, 0322, 0313, 0005, 0346, 0371, 0062, 0107, 0210, 0015, 
+  0176, 0100, 0151, 0250, 0330, 0234, 0161, 0016, 0175, 0012, 0123, 0105, 0007, 0123, 0176, 0124, 
+  0303, 0226, 0360, 0365, 0252, 0373, 0317, 0227, 0373, 0056, 0164, 0256, 0277, 0301, 0327, 0316, 
+  0355, 0155, 0347, 0272, 0373, 0355, 0324, 0267, 0011, 0242, 0017, 0210, 0156, 0040, 0207, 0215, 
+  0047, 0234, 0031, 0143, 0021, 0051, 0211, 0247, 0027, 0010, 0112, 0355, 0363, 0305, 0355, 0371, 
+  0077, 0330, 0276, 0363, 0341, 0352, 0323, 0125, 0367, 0233, 0231, 0366, 0345, 0125, 0367, 0372, 
+  0342, 0356, 0016, 0056, 0277, 0334, 0102, 0007, 0156, 0072, 0267, 0335, 0253, 0363, 0373, 0117, 
+  0235, 0133, 0270, 0271, 0277, 0275, 0371, 0162, 0167, 0161, 0014, 0160, 0107, 0315, 0204, 0150, 
+  0155, 0067, 0234, 0060, 0100, 0111, 0143, 0201, 0250, 0271, 0124, 0023, 0306, 0025, 0252, 0372, 
+  0015, 0215, 0247, 0160, 0112, 0334, 0205, 0021, 0231, 0121, 0064, 0242, 0103, 0331, 0014, 0047, 
+  0104, 0300, 0101, 0257, 0310, 0142, 0043, 0056, 0274, 0141, 0340, 0154, 0072, 0202, 0333, 0051, 
+  0260, 0001, 0170, 0102, 0037, 0301, 0134, 0062, 0164, 0010, 0055, 0266, 0255, 0127, 0133, 0131, 
+  0357, 0010, 0256, 0074, 0347, 0370, 0010, 0176, 0153, 0140, 0023, 0342, 0075, 0160, 0304, 0371, 
+  0116, 0143, 0143, 0024, 0160, 0311, 0006, 0050, 0374, 0222, 0013, 0041, 0217, 0340, 0203, 0120, 
+  0332, 0064, 0377, 0334, 0001, 0070, 0151, 0066, 0032, 0047, 0166, 0343, 0335, 0111, 0343, 0010, 
+  0356, 0357, 0072, 0250, 0116, 0147, 0212, 0370, 0312, 0077, 0341, 0253, 0340, 0203, 0041, 0301, 
+  0171, 0335, 0363, 0276, 0144, 0316, 0250, 0126, 0263, 0155, 0044, 0010, 0363, 0320, 0320, 0003, 
+  0342, 0320, 0166, 0015, 0240, 0045, 0351, 0177, 0247, 0114, 0122, 0005, 0234, 0365, 0317, 0254, 
+  0241, 0176, 0370, 0217, 0265, 0042, 0231, 0241, 0214, 0125, 0367, 0333, 0031, 0132, 0055, 0173, 
+  0332, 0074, 0320, 0333, 0326, 0013, 0364, 0200, 0341, 0204, 0317, 0232, 0140, 0144, 0157, 0265, 
+  0363, 0310, 0230, 0102, 0074, 0341, 0342, 0073, 0070, 0113, 0026, 0156, 0060, 0060, 0276, 0071, 
+  0361, 0125, 0125, 0133, 0252, 0076, 0265, 0026, 0375, 0177, 0251, 0243, 0301, 0341, 0070, 0350, 
+  0231, 0365, 0121, 0077, 0134, 0215, 0311, 0220, 0132, 0300, 0334, 0063, 0153, 0316, 0074, 0127, 
+  0314, 0173, 0016, 0027, 0212, 0366, 0320, 0133, 0021, 0321, 0036, 0033, 0017, 0055, 0323, 0021, 
+  0273, 0242, 0011, 0161, 0134, 0164, 0106, 0243, 0303, 0231, 0065, 0143, 0212, 0365, 0071, 0265, 
+  0332, 0135, 0071, 0245, 0255, 0372, 0323, 0257, 0361, 0215, 0061, 0022, 0364, 0006, 0302, 0231, 
+  0052, 0253, 0175, 0111, 0270, 0112, 0155, 0317, 0034, 0034, 0333, 0174, 0264, 0332, 0301, 0254, 
+  0154, 0177, 0126, 0353, 0335, 0132, 0365, 0100, 0233, 0170, 0305, 0376, 0146, 0350, 0203, 0303, 
+  0100, 0063, 0147, 0204, 0120, 0254, 0220, 0266, 0252, 0231, 0144, 0037, 0105, 0121, 0331, 0233, 
+  0063, 0127, 0217, 0254, 0366, 0357, 0151, 0315, 0065, 0323, 0010, 0027, 0150, 0164, 0144, 0205, 
+  0261, 0205, 0040, 0170, 0147, 0326, 0202, 0342, 0150, 0347, 0376, 0364, 0340, 0151, 0172, 0151, 
+  0202, 0320, 0071, 0331, 0377, 0210, 0217, 0175, 0246, 0171, 0032, 0237, 0354, 0215, 0320, 0107, 
+  0254, 0266, 0353, 0203, 0262, 0325, 0301, 0031, 0061, 0356, 0006, 0136, 0344, 0021, 0156, 0373, 
+  0137, 0321, 0302, 0175, 0361, 0030, 0102, 0025, 0007, 0360, 0007, 0374, 0325, 0107, 0067, 0020, 
+  0152, 0257, 0065, 0317, 0351, 0057, 0105, 0314, 0021, 0327, 0107, 0110, 0106, 0075, 0355, 0307, 
+  0016, 0253, 0215, 0254, 0325, 0314, 0041, 0074, 0113, 0107, 0065, 0041, 0016, 0346, 0315, 0030, 
+  0063, 0046, 0000, 0104, 0034, 0063, 0120, 0017, 0143, 0026, 0211, 0050, 0036, 0213, 0225, 0317, 
+  0246, 0115, 0304, 0202, 0376, 0366, 0126, 0377, 0002, 0340, 0025, 0005, 0060, 0256, 0037, 0047, 
+  0230, 0013, 0165, 0117, 0351, 0205, 0031, 0221, 0172, 0356, 0316, 0216, 0076, 0016, 0353, 0317, 
+  0166, 0153, 0037, 0122, 0221, 0170, 0016, 0345, 0166, 0020, 0136, 0254, 0315, 0276, 0161, 0223, 
+  0351, 0123, 0036, 0313, 0232, 0336, 0371, 0166, 0110, 0110, 0226, 0225, 0011, 0305, 0024, 0044, 
+  0213, 0164, 0165, 0351, 0200, 0114, 0271, 0316, 0337, 0071, 0314, 0273, 0152, 0045, 0041, 0321, 
+  0220, 0261, 0221, 0324, 0217, 0357, 0355, 0035, 0261, 0075, 0217, 0044, 0254, 0143, 0172, 0176, 
+  0261, 0206, 0131, 0070, 0025, 0303, 0150, 0154, 0136, 0027, 0112, 0234, 0007, 0044, 0132, 0372, 
+  0160, 0364, 0161, 0202, 0265, 0142, 0001, 0215, 0007, 0130, 0167, 0025, 0350, 0066, 0021, 0212, 
+  0005, 0161, 0343, 0044, 0111, 0255, 0330, 0371, 0267, 0352, 0061, 0114, 0050, 0304, 0216, 0365, 
+  0104, 0125, 0005, 0115, 0226, 0311, 0245, 0027, 0237, 0135, 0236, 0205, 0060, 0012, 0213, 0041, 
+  0104, 0163, 0106, 0013, 0030, 0342, 0265, 0310, 0066, 0042, 0352, 0125, 0231, 0372, 0303, 0360, 
+  0253, 0121, 0005, 0277, 0342, 0000, 0210, 0127, 0276, 0220, 0342, 0005, 0224, 0336, 0122, 0030, 
+  0047, 0323, 0063, 0265, 0127, 0162, 0016, 0315, 0033, 0206, 0142, 0040, 0332, 0202, 0147, 0073, 
+  0364, 0044, 0224, 0157, 0130, 0152, 0343, 0272, 0017, 0127, 0161, 0366, 0150, 0275, 0202, 0173, 
+  0365, 0102, 0044, 0245, 0300, 0116, 0255, 0345, 0032, 0315, 0262, 0225, 0113, 0144, 0165, 0024, 
+  0326, 0154, 0141, 0076, 0175, 0221, 0132, 0043, 0067, 0307, 0146, 0204, 0263, 0041, 0272, 0216, 
+  0322, 0104, 0352, 0134, 0125, 0302, 0152, 0275, 0025, 0352, 0271, 0153, 0061, 0222, 0052, 0005, 
+  0327, 0046, 0064, 0301, 0130, 0207, 0322, 0040, 0117, 0151, 0360, 0304, 0321, 0061, 0022, 0164, 
+  0163, 0201, 0265, 0127, 0236, 0227, 0171, 0341, 0125, 0154, 0001, 0226, 0014, 0134, 0074, 0170, 
+  0237, 0202, 0222, 0310, 0300, 0067, 0242, 0004, 0003, 0211, 0035, 0024, 0111, 0161, 0275, 0113, 
+  0240, 0130, 0026, 0311, 0370, 0122, 0044, 0043, 0217, 0013, 0225, 0202, 0376, 0116, 0147, 0026, 
+  0176, 0373, 0322, 0211, 0016, 0167, 0071, 0125, 0174, 0203, 0150, 0223, 0160, 0006, 0163, 0152, 
+  0066, 0254, 0054, 0300, 0160, 0064, 0365, 0303, 0070, 0167, 0203, 0115, 0263, 0114, 0275, 0025, 
+  0172, 0016, 0135, 0166, 0156, 0034, 0067, 0167, 0365, 0155, 0325, 0223, 0347, 0266, 0053, 0320, 
+  0044, 0007, 0233, 0122, 0001, 0247, 0104, 0320, 0051, 0034, 0170, 0022, 0202, 0317, 0316, 0000, 
+  0124, 0202, 0113, 0056, 0125, 0216, 0144, 0376, 0076, 0371, 0017, 0102, 0250, 0331, 0363, 0260, 
+  0261, 0053, 0300, 0211, 0041, 0344, 0021, 0120, 0263, 0315, 0024, 0074, 0164, 0246, 0122, 0342, 
+  0327, 0345, 0217, 0117, 0007, 0015, 0003, 0106, 0271, 0013, 0050, 0131, 0314, 0315, 0211, 0012, 
+  0132, 0212, 0071, 0017, 0360, 0063, 0327, 0247, 0375, 0237, 0207, 0372, 0324, 0154, 0170, 0143, 
+  0067, 0214, 0301, 0232, 0232, 0207, 0165, 0377, 0351, 0161, 0255, 0063, 0010, 0045, 0007, 0333, 
+  0372, 0044, 0322, 0154, 0175, 0134, 0217, 0316, 0043, 0023, 0222, 0324, 0337, 0326, 0146, 0332, 
+  0077, 0053, 0300, 0350, 0316, 0006, 0246, 0217, 0071, 0116, 0211, 0031, 0174, 0143, 0067, 0063, 
+  0062, 0176, 0136, 0354, 0314, 0212, 0150, 0114, 0344, 0303, 0164, 0122, 0314, 0153, 0346, 0222, 
+  0024, 0354, 0071, 0046, 0217, 0101, 0331, 0331, 0103, 0023, 0111, 0064, 0326, 0037, 0251, 0004, 
+  0374, 0176, 0142, 0115, 0343, 0165, 0143, 0315, 0262, 0350, 0101, 0177, 0224, 0213, 0270, 0105, 
+  0311, 0136, 0206, 0230, 0154, 0005, 0114, 0062, 0030, 0231, 0000, 0361, 0043, 0212, 0332, 0125, 
+  0015, 0126, 0202, 0115, 0025, 0370, 0124, 0122, 0045, 0226, 0007, 0073, 0066, 0033, 0210, 0261, 
+  0030, 0122, 0217, 0212, 0054, 0173, 0114, 0331, 0254, 0226, 0232, 0066, 0303, 0110, 0276, 0332, 
+  0332, 0113, 0312, 0235, 0225, 0031, 0261, 0052, 0103, 0226, 0316, 0251, 0005, 0212, 0325, 0060, 
+  0365, 0365, 0236, 0020, 0373, 0263, 0350, 0030, 0271, 0066, 0326, 0122, 0362, 0202, 0107, 0307, 
+  0302, 0143, 0216, 0111, 0016, 0103, 0252, 0255, 0366, 0246, 0131, 0263, 0011, 0116, 0312, 0026, 
+  0331, 0262, 0106, 0045, 0331, 0243, 0202, 0054, 0122, 0272, 0162, 0315, 0220, 0125, 0122, 0263, 
+  0113, 0105, 0024, 0305, 0242, 0147, 0017, 0350, 0231, 0147, 0353, 0374, 0073, 0240, 0171, 0357, 
+  0072, 0122, 0152, 0356, 0045, 0305, 0243, 0156, 0161, 0240, 0167, 0316, 0142, 0161, 0217, 0350, 
+  0035, 0254, 0142, 0334, 0003, 0305, 0137, 0234, 0342, 0267, 0301, 0372, 0321, 0333, 0167, 0246, 
+  0157, 0172, 0310, 0201, 0355, 0233, 0154, 0157, 0276, 0024, 0333, 0323, 0100, 0115, 0007, 0264, 
+  0064, 0230, 0045, 0201, 0054, 0125, 0021, 0245, 0000, 0230, 0010, 0136, 0311, 0345, 0345, 0141, 
+  0135, 0271, 0377, 0353, 0312, 0245, 0311, 0314, 0016, 0136, 0322, 0016, 0311, 0233, 0130, 0110, 
+  0346, 0003, 0075, 0033, 0146, 0361, 0270, 0135, 0030, 0017, 0217, 0137, 0217, 0133, 0151, 0322, 
+  0052, 0002, 0261, 0344, 0215, 0227, 0114, 0163, 0142, 0234, 0351, 0105, 0116, 0243, 0144, 0313, 
+  0143, 0331, 0163, 0131, 0122, 0010, 0056, 0253, 0144, 0020, 0211, 0313, 0112, 0311, 0275, 0104, 
+  0315, 0230, 0331, 0062, 0325, 0262, 0145, 0274, 0070, 0172, 0141, 0054, 0272, 0205, 0277, 0373, 
+  0266, 0330, 0133, 0364, 0344, 0002, 0067, 0252, 0212, 0001, 0034, 0017, 0162, 0307, 0224, 0304, 
+  0143, 0204, 0066, 0304, 0371, 0351, 0153, 0303, 0312, 0042, 0257, 0102, 0210, 0253, 0214, 0274, 
+  0273, 0344, 0075, 0006, 0147, 0256, 0171, 0210, 0020, 0057, 0150, 0121, 0130, 0120, 0146, 0123, 
+  0245, 0144, 0104, 0223, 0014, 0337, 0277, 0263, 0262, 0112, 0252, 0330, 0120, 0317, 0141, 0254, 
+  0304, 0224, 0331, 0054, 0044, 0055, 0027, 0330, 0251, 0067, 0243, 0374, 0053, 0121, 0115, 0053, 
+  0217, 0274, 0147, 0200, 0375, 0271, 0240, 0117, 0271, 0056, 0065, 0324, 0017, 0066, 0231, 0114, 
+  0370, 0242, 0230, 0354, 0254, 0111, 0267, 0130, 0002, 0256, 0174, 0161, 0371, 0014, 0213, 0315, 
+  0147, 0111, 0323, 0005, 0122, 0166, 0356, 0364, 0135, 0065, 0243, 0042, 0133, 0125, 0376, 0136, 
+  0112, 0343, 0344, 0375, 0311, 0217, 0104, 0252, 0204, 0015, 0244, 0350, 0175, 0206, 0252, 0206, 
+  0053, 0261, 0221, 0164, 0240, 0160, 0121, 0012, 0067, 0366, 0225, 0302, 0371, 0214, 0230, 0103, 
+  0170, 0166, 0301, 0031, 0205, 0276, 0334, 0062, 0055, 0177, 0275, 0135, 0215, 0053, 0125, 0342, 
+  0076, 0325, 0055, 0324, 0336, 0304, 0376, 0156, 0231, 0175, 0234, 0067, 0163, 0126, 0033, 0331, 
+  0276, 0211, 0036, 0312, 0175, 0047, 0107, 0070, 0145, 0246, 0123, 0160, 0333, 0347, 0160, 0120, 
+  0271, 0217, 0276, 0275, 0171, 0014, 0165, 0360, 0357, 0342, 0333, 0232, 0233, 0202, 0314, 0053, 
+  0327, 0063, 0254, 0042, 0163, 0274, 0352, 0167, 0070, 0351, 0173, 0243, 0047, 0175, 0105, 0117, 
+  0244, 0362, 0145, 0324, 0122, 0021, 0247, 0370, 0071, 0337, 0367, 0164, 0341, 0270, 0271, 0067, 
+  0057, 0067, 0050, 0115, 0364, 0124, 0275, 0235, 0367, 0032, 0166, 0257, 0231, 0157, 0070, 0045, 
+  0212, 0202, 0177, 0361, 0142, 0355, 0375, 0002, 0040, 0103, 0302, 0274, 0247, 0027, 0011, 0226, 
+  0267, 0366, 0143, 0356, 0150, 0254, 0156, 0356, 0007, 0357, 0033, 0274, 0370, 0375, 0375, 0177, 
+  0247, 0112, 0263, 0001, 0206, 0174, 0307, 0177, 0065, 0341, 0271, 0256, 0377, 0357, 0025, 0225, 
+  0212, 0340, 0264, 0142, 0322, 0273, 0252, 0231, 0364, 0352, 0057, 0153, 0346, 0175, 0211, 0361, 
+  0307, 0173, 0315, 0074, 0115, 0341, 0364, 0027, 0306, 0327, 0225, 0134, 0373, 0261, 0025, 0376, 
+  0107, 0115, 0160, 0105, 0152, 0371, 0232, 0335, 0372, 0143, 0220, 0124, 0115, 0204, 0247, 0160, 
+  0066, 0366, 0173, 0144, 0153, 0364, 0057, 0136, 0132, 0365, 0265, 0246, 0351, 0002, 0176, 0103, 
+  0001, 0261, 0377, 0202, 0021, 0053, 0151, 0343, 0241, 0132, 0373, 0103, 0043, 0023, 0321, 0302, 
+  0377, 0135, 0352, 0023, 0271, 0372, 0053, 0243, 0011, 0047, 0016, 0035, 0011, 0356, 0122, 0131, 
+  0337, 0322, 0171, 0005, 0106, 0253, 0036, 0371, 0147, 0260, 0377, 0003, 0241, 0153, 0106, 0016, 
+  0000, 0050, 0165, 0165, 0141, 0171, 0051, 0157, 0162, 0147, 0057, 0000, 0001, 0000, 0000, 0000, 
+  0155, 0143, 0143, 0057, 0000, 0000, 0000, 0000, 0057, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 
+  0155, 0141, 0164, 0145, 0055, 0141, 0142, 0157, 0165, 0164, 0055, 0155, 0145, 0055, 0146, 0151, 
+  0156, 0147, 0145, 0162, 0160, 0162, 0151, 0156, 0164, 0056, 0165, 0151, 0000, 0000, 0000, 0000, 
+  0332, 0071, 0000, 0000, 0001, 0000, 0000, 0000, 0170, 0332, 0355, 0133, 0335, 0163, 0332, 0070, 
+  0020, 0177, 0347, 0257, 0330, 0372, 0351, 0156, 0216, 0357, 0264, 0327, 0233, 0153, 0302, 0015, 
+  0115, 0223, 0066, 0063, 0351, 0307, 0000, 0231, 0116, 0236, 0030, 0141, 0313, 0240, 0213, 0054, 
+  0161, 0222, 0034, 0302, 0375, 0365, 0267, 0222, 0035, 0102, 0300, 0020, 0154, 0150, 0110, 0256, 
+  0171, 0303, 0142, 0167, 0265, 0037, 0277, 0135, 0111, 0053, 0373, 0360, 0257, 0233, 0210, 0303, 
+  0065, 0125, 0232, 0111, 0161, 0344, 0065, 0252, 0165, 0017, 0250, 0360, 0145, 0300, 0304, 0360, 
+  0310, 0273, 0350, 0235, 0126, 0376, 0360, 0376, 0152, 0225, 0016, 0137, 0125, 0052, 0360, 0221, 
+  0012, 0252, 0210, 0241, 0001, 0114, 0230, 0031, 0301, 0220, 0223, 0200, 0302, 0101, 0265, 0331, 
+  0254, 0326, 0113, 0245, 0010, 0377, 0250, 0220, 0201, 0214, 0115, 0045, 0242, 0225, 0020, 0331, 
+  0251, 0032, 0053, 0046, 0014, 0124, 0300, 0015, 0103, 0104, 0141, 0176, 0070, 0140, 0204, 0313, 
+  0041, 0212, 0022, 0201, 0234, 0224, 0216, 0345, 0170, 0252, 0330, 0160, 0144, 0340, 0227, 0343, 
+  0137, 0341, 0163, 0273, 0167, 0002, 0037, 0350, 0065, 0345, 0162, 0214, 0252, 0225, 0112, 0275, 
+  0021, 0323, 0060, 0126, 0162, 0250, 0110, 0004, 0370, 0063, 0124, 0224, 0202, 0226, 0241, 0231, 
+  0020, 0105, 0337, 0301, 0124, 0306, 0340, 0023, 0001, 0212, 0006, 0114, 0033, 0305, 0006, 0261, 
+  0241, 0300, 0014, 0020, 0021, 0324, 0244, 0052, 0105, 0150, 0116, 0070, 0265, 0003, 0261, 0010, 
+  0250, 0002, 0063, 0242, 0140, 0250, 0212, 0064, 0310, 0320, 0075, 0174, 0374, 0162, 0221, 0132, 
+  0307, 0341, 0133, 0074, 0340, 0314, 0207, 0163, 0346, 0123, 0241, 0151, 0211, 0340, 0274, 0166, 
+  0104, 0217, 0320, 0356, 0301, 0324, 0221, 0237, 0332, 0331, 0273, 0351, 0354, 0160, 0052, 0121, 
+  0052, 0061, 0350, 0277, 0167, 0100, 0321, 0061, 0070, 0101, 0352, 0117, 0150, 0226, 0322, 0011, 
+  0122, 0151, 0145, 0220, 0012, 0176, 0041, 0306, 0052, 0254, 0100, 0216, 0055, 0323, 0257, 0250, 
+  0345, 0024, 0070, 0272, 0157, 0306, 0127, 0135, 0066, 0370, 0316, 0256, 0000, 0230, 0160, 0062, 
+  0107, 0350, 0033, 0374, 0201, 0322, 0320, 0260, 0011, 0343, 0034, 0006, 0024, 0142, 0115, 0303, 
+  0230, 0227, 0113, 0110, 0011, 0337, 0317, 0172, 0237, 0276, 0136, 0364, 0240, 0375, 0345, 0022, 
+  0276, 0267, 0073, 0235, 0366, 0227, 0336, 0345, 0073, 0027, 0073, 0033, 0016, 0364, 0156, 0042, 
+  0207, 0105, 0143, 0316, 0154, 0120, 0211, 0122, 0104, 0230, 0051, 0072, 0245, 0364, 0371, 0244, 
+  0163, 0374, 0011, 0351, 0333, 0357, 0317, 0316, 0317, 0172, 0227, 0126, 0355, 0323, 0263, 0336, 
+  0227, 0223, 0156, 0027, 0116, 0277, 0166, 0240, 0015, 0337, 0332, 0235, 0336, 0331, 0361, 0305, 
+  0171, 0273, 0003, 0337, 0056, 0072, 0337, 0276, 0166, 0117, 0252, 0000, 0135, 0152, 0025, 0242, 
+  0245, 0325, 0356, 0204, 0020, 0045, 0105, 0022, 0275, 0026, 0120, 0103, 0030, 0327, 0150, 0352, 
+  0045, 0006, 0117, 0243, 0112, 0074, 0200, 0021, 0271, 0246, 0030, 0104, 0237, 0262, 0153, 0124, 
+  0210, 0200, 0217, 0250, 0330, 0044, 0106, 0134, 0212, 0141, 0002, 0112, 0063, 0347, 0267, 0167, 
+  0300, 0102, 0020, 0322, 0224, 0141, 0242, 0030, 0002, 0302, 0310, 0345, 0350, 0225, 0356, 0242, 
+  0127, 0206, 0063, 0341, 0127, 0313, 0360, 0246, 0201, 0044, 0104, 0134, 0161, 0364, 0163, 0327, 
+  0040, 0061, 0012, 0070, 0145, 0041, 0012, 0077, 0345, 0122, 0252, 0062, 0274, 0227, 0332, 0130, 
+  0362, 0317, 0155, 0200, 0172, 0263, 0321, 0250, 0127, 0032, 0007, 0365, 0106, 0031, 0056, 0272, 
+  0155, 0064, 0247, 0035, 0243, 0177, 0325, 0237, 0360, 0135, 0362, 0160, 0110, 0120, 0257, 0013, 
+  0076, 0120, 0314, 0037, 0225, 0112, 0225, 0012, 0046, 0022, 0102, 0237, 0252, 0220, 0370, 0264, 
+  0125, 0002, 0070, 0124, 0364, 0237, 0230, 0051, 0252, 0201, 0263, 0301, 0221, 0067, 0064, 0127, 
+  0277, 0171, 0167, 0311, 0150, 0123, 0313, 0253, 0071, 0072, 0233, 0176, 0063, 0316, 0012, 0117, 
+  0354, 0256, 0230, 0051, 0042, 0140, 0070, 0346, 0327, 0115, 0260, 0262, 0227, 0350, 0004, 0301, 
+  0234, 0133, 0223, 0230, 0131, 0074, 0001, 0325, 0276, 0142, 0016, 0231, 0033, 0344, 0155, 0266, 
+  0014, 0177, 0226, 0314, 0013, 0211, 0234, 0115, 0116, 0234, 0307, 0364, 0222, 0307, 0156, 0251, 
+  0345, 0340, 0157, 0352, 0033, 0360, 0071, 0321, 0372, 0310, 0373, 0150, 0256, 0316, 0061, 0031, 
+  0272, 0006, 0121, 0344, 0001, 0013, 0216, 0074, 0114, 0157, 0312, 0033, 0236, 0245, 0105, 0152, 
+  0137, 0362, 0070, 0022, 0072, 0171, 0112, 0347, 0112, 0306, 0022, 0177, 0014, 0375, 0021, 0121, 
+  0026, 0352, 0323, 0124, 0376, 0034, 0027, 0130, 0217, 0142, 0034, 0146, 0044, 0211, 0373, 0361, 
+  0377, 0332, 0075, 0261, 0207, 0210, 0030, 0062, 0343, 0125, 0162, 0162, 0373, 0073, 0221, 0344, 
+  0264, 0302, 0102, 0152, 0020, 0106, 0032, 0063, 0233, 0014, 0070, 0112, 0235, 0122, 0355, 0265, 
+  0316, 0151, 0150, 0020, 0205, 0161, 0064, 0160, 0042, 0147, 0062, 0152, 0163, 0102, 0362, 0013, 
+  0214, 0130, 0020, 0360, 0333, 0060, 0355, 0122, 0060, 0106, 0174, 0370, 0003, 0304, 0162, 0146, 
+  0314, 0256, 0365, 0355, 0070, 0300, 0355, 0322, 0265, 0211, 0304, 0037, 0341, 0333, 0104, 0362, 
+  0356, 0235, 0233, 0310, 0335, 0310, 0273, 0207, 0265, 0133, 0014, 0037, 0326, 0222, 0004, 0313, 
+  0316, 0265, 0266, 0326, 0230, 0155, 0270, 0056, 0044, 0271, 0106, 0146, 0217, 0251, 0030, 0254, 
+  0265, 0230, 0331, 0270, 0152, 0330, 0344, 0072, 0362, 0160, 0025, 0356, 0207, 0322, 0217, 0121, 
+  0231, 0123, 0302, 0065, 0075, 0254, 0335, 0022, 0144, 0323, 0017, 0244, 0302, 0025, 0271, 0077, 
+  0141, 0201, 0031, 0171, 0255, 0106, 0363, 0041, 0172, 0303, 0320, 0264, 0114, 0333, 0117, 0204, 
+  0175, 0300, 0112, 0175, 0127, 0252, 0316, 0345, 0220, 0211, 0045, 0211, 0376, 0210, 0341, 0122, 
+  0223, 0144, 0272, 0023, 0067, 0040, 0312, 0233, 0171, 0150, 0314, 0261, 0044, 0215, 0044, 0107, 
+  0255, 0356, 0162, 0337, 0162, 0314, 0163, 0027, 0244, 0136, 0162, 0356, 0173, 0171, 0223, 0270, 
+  0165, 0114, 0206, 0264, 0341, 0315, 0305, 0171, 0301, 0354, 0153, 0246, 0031, 0132, 0347, 0265, 
+  0172, 0052, 0136, 0362, 0151, 0221, 0070, 0024, 0211, 0105, 0026, 0217, 0124, 0214, 0012, 0343, 
+  0326, 0117, 0257, 0205, 0053, 0227, 0141, 0076, 0341, 0233, 0060, 0352, 0061, 0361, 0061, 0124, 
+  0053, 0347, 0271, 0347, 0271, 0007, 0274, 0067, 0032, 0310, 0233, 0267, 0257, 0275, 0171, 0352, 
+  0002, 0056, 0054, 0352, 0306, 0265, 0326, 0375, 0276, 0222, 0143, 0311, 0300, 0154, 0043, 0317, 
+  0042, 0204, 0106, 0142, 0046, 0163, 0077, 0027, 0131, 0012, 0132, 0272, 0215, 0265, 0131, 0274, 
+  0314, 0227, 0242, 0157, 0177, 0172, 0255, 0144, 0207, 0120, 0141, 0002, 0067, 0173, 0221, 0203, 
+  0106, 0156, 0101, 0232, 0375, 0113, 0327, 0070, 0357, 0176, 0321, 0272, 0057, 0215, 0370, 0127, 
+  0350, 0371, 0207, 0347, 0241, 0067, 0143, 0074, 0036, 0024, 0260, 0064, 0304, 0255, 0166, 0176, 
+  0337, 0216, 0245, 0146, 0111, 0226, 0324, 0327, 0131, 0225, 0251, 0376, 0275, 0232, 0222, 0027, 
+  0100, 0347, 0144, 0100, 0171, 0012, 0040, 0141, 0224, 0254, 0160, 0067, 0360, 0104, 0141, 0224, 
+  0052, 0327, 0223, 0170, 0012, 0165, 0365, 0174, 0176, 0353, 0311, 0155, 0075, 0057, 0273, 0323, 
+  0236, 0240, 0170, 0100, 0300, 0015, 0275, 0266, 0047, 0006, 0051, 0250, 0075, 0045, 0270, 0103, 
+  0325, 0034, 0275, 0056, 0343, 0161, 0310, 0256, 0261, 0166, 0327, 0337, 0366, 0043, 0173, 0124, 
+  0223, 0130, 0354, 0341, 0115, 0275, 0136, 0257, 0346, 0321, 0152, 0242, 0310, 0370, 0041, 0077, 
+  0354, 0035, 0221, 0271, 0331, 0356, 0040, 0331, 0330, 0005, 0044, 0263, 0034, 0220, 0155, 0174, 
+  0041, 0303, 0363, 0247, 0141, 0356, 0024, 0314, 0260, 0165, 0311, 0316, 0134, 0013, 0323, 0265, 
+  0135, 0230, 0352, 0117, 0151, 0141, 0332, 0170, 0275, 0316, 0123, 0142, 0072, 0044, 0140, 0362, 
+  0175, 0154, 0360, 0124, 0234, 0330, 0255, 0354, 0300, 0300, 0015, 0064, 0274, 0115, 0223, 0176, 
+  0365, 0206, 0026, 0217, 0232, 0364, 0146, 0266, 0237, 0335, 0034, 0340, 0273, 0250, 0140, 0171, 
+  0131, 0323, 0356, 0205, 0356, 0007, 0064, 0044, 0061, 0067, 0005, 0362, 0162, 0104, 0070, 0033, 
+  0142, 0170, 0160, 0237, 0255, 0114, 0036, 0306, 0130, 0323, 0276, 0353, 0160, 0161, 0046, 0012, 
+  0130, 0115, 0174, 0203, 0232, 0347, 0347, 0013, 0024, 0231, 0364, 0061, 0106, 0010, 0045, 0074, 
+  0224, 0377, 0237, 0353, 0344, 0043, 0057, 0335, 0353, 0362, 0252, 0271, 0125, 0136, 0271, 0123, 
+  0370, 0113, 0132, 0075, 0112, 0132, 0345, 0113, 0217, 0145, 0376, 0241, 0222, 0061, 0356, 0076, 
+  0346, 0153, 0352, 0313, 0056, 0144, 0007, 0331, 0165, 0377, 0370, 0370, 0366, 0311, 0354, 0210, 
+  0063, 0325, 0317, 0137, 0040, 0016, 0274, 0054, 0031, 0171, 0212, 0304, 0127, 0167, 0227, 0221, 
+  0324, 0207, 0077, 0141, 0235, 0316, 0133, 0071, 0153, 0313, 0112, 0261, 0243, 0152, 0261, 0125, 
+  0305, 0330, 0101, 0325, 0330, 0105, 0345, 0330, 0272, 0172, 0254, 0253, 0040, 0353, 0253, 0310, 
+  0126, 0225, 0144, 0213, 0152, 0122, 0170, 0275, 0136, 0123, 0125, 0126, 0126, 0226, 0274, 0351, 
+  0171, 0054, 0243, 0201, 0234, 0225, 0231, 0044, 0221, 0372, 0276, 0035, 0304, 0212, 0343, 0075, 
+  0102, 0032, 0151, 0052, 0254, 0053, 0354, 0246, 0256, 0220, 0047, 0363, 0324, 0255, 0314, 0004, 
+  0272, 0205, 0100, 0021, 0345, 0335, 0265, 0216, 0327, 0112, 0156, 0167, 0036, 0144, 0136, 0031, 
+  0226, 0025, 0241, 0241, 0234, 0167, 0250, 0115, 0117, 0252, 0172, 0364, 0046, 0355, 0156, 0253, 
+  0164, 0244, 0161, 0173, 0357, 0223, 0041, 0212, 0230, 0364, 0042, 0126, 0257, 0042, 0231, 0047, 
+  0272, 0155, 0133, 0333, 0051, 0054, 0034, 0147, 0177, 0254, 0224, 0137, 0173, 0150, 0202, 0225, 
+  0320, 0174, 0142, 0271, 0133, 0044, 0346, 0033, 0155, 0006, 0212, 0245, 0356, 0063, 0356, 0030, 
+  0066, 0177, 0262, 0366, 0114, 0243, 0150, 0173, 0146, 0321, 0306, 0145, 0373, 0066, 0277, 0117, 
+  0352, 0122, 0156, 0113, 0306, 0352, 0343, 0321, 0362, 0156, 0101, 0367, 0307, 0044, 0010, 0134, 
+  0337, 0177, 0205, 0257, 0026, 0114, 0050, 0176, 0131, 0324, 0334, 0367, 0145, 0321, 0346, 0027, 
+  0077, 0033, 0064, 0314, 0346, 0172, 0324, 0124, 0050, 0311, 0171, 0146, 0223, 0172, 0257, 0215, 
+  0263, 0124, 0241, 0063, 0001, 0356, 0226, 0154, 0326, 0173, 0316, 0150, 0072, 0337, 0353, 0117, 
+  0117, 0330, 0070, 0045, 0162, 0127, 0323, 0040, 0223, 0227, 0156, 0074, 0327, 0217, 0016, 0135, 
+  0077, 0332, 0203, 0200, 0136, 0063, 0237, 0126, 0067, 0325, 0345, 0241, 0166, 0364, 0136, 0122, 
+  0075, 0027, 0313, 0343, 0267, 0142, 0023, 0134, 0365, 0107, 0313, 0073, 0257, 0307, 0205, 0125, 
+  0366, 0332, 0264, 0174, 0217, 0274, 0223, 0043, 0356, 0342, 0345, 0141, 0343, 0031, 0334, 0036, 
+  0016, 0315, 0125, 0105, 0310, 0227, 0033, 0303, 0375, 0065, 0106, 0026, 0121, 0323, 0174, 0101, 
+  0315, 0117, 0273, 0153, 0054, 0216, 0232, 0203, 0027, 0324, 0074, 0107, 0324, 0034, 0354, 0027, 
+  0065, 0257, 0137, 0120, 0363, 0034, 0121, 0363, 0172, 0277, 0250, 0171, 0363, 0202, 0232, 0347, 
+  0210, 0232, 0067, 0077, 0024, 0065, 0271, 0366, 0324, 0077, 0103, 0167, 0044, 0367, 0131, 0134, 
+  0343, 0371, 0076, 0326, 0373, 0076, 0213, 0077, 0247, 0323, 0154, 0363, 0261, 0073, 0127, 0255, 
+  0256, 0153, 0060, 0044, 0015, 0010, 0333, 0134, 0120, 0224, 0004, 0117, 0243, 0137, 0065, 0007, 
+  0244, 0361, 0302, 0176, 0160, 0057, 0035, 0253, 0325, 0027, 0235, 0227, 0013, 0075, 0034, 0230, 
+  0020, 0015, 0072, 0366, 0175, 0252, 0165, 0030, 0163, 0076, 0165, 0255, 0236, 0240, 0012, 0163, 
+  0237, 0052, 0011, 0071, 0261, 0337, 0133, 0271, 0167, 0024, 0215, 0264, 0257, 0046, 0332, 0357, 
+  0262, 0222, 0367, 0015, 0027, 0173, 0102, 0151, 0120, 0252, 0233, 0150, 0271, 0256, 0267, 0223, 
+  0037, 0044, 0326, 0361, 0175, 0373, 0252, 0273, 0327, 0322, 0161, 0024, 0021, 0065, 0335, 0104, 
+  0207, 0325, 0115, 0321, 0017, 0122, 0320, 0127, 0217, 0007, 0256, 0355, 0336, 0322, 0117, 0076, 
+  0061, 0022, 0204, 0127, 0334, 0143, 0362, 0202, 0023, 0056, 0251, 0004, 0303, 0341, 0255, 0357, 
+  0263, 0156, 0203, 0274, 0374, 0121, 0332, 0316, 0131, 0167, 0363, 0035, 0326, 0346, 0276, 0056, 
+  0373, 0017, 0135, 0276, 0323, 0223, 0000, 0050, 0165, 0165, 0141, 0171, 0051, 0155, 0141, 0164, 
+  0145, 0055, 0141, 0142, 0157, 0165, 0164, 0055, 0155, 0145, 0055, 0144, 0151, 0141, 0154, 0157, 
+  0147, 0056, 0165, 0151, 0000, 0000, 0000, 0000, 0332, 0055, 0000, 0000, 0001, 0000, 0000, 0000, 
+  0170, 0332, 0355, 0132, 0335, 0163, 0332, 0070, 0020, 0177, 0367, 0137, 0261, 0347, 0247, 0166, 
+  0016, 0363, 0325, 0113, 0257, 0327, 0000, 0067, 0064, 0015, 0055, 0063, 0111, 0232, 0011, 0060, 
+  0235, 0074, 0171, 0204, 0055, 0333, 0272, 0010, 0213, 0223, 0104, 0010, 0377, 0375, 0255, 0154, 
+  0222, 0100, 0060, 0066, 0137, 0155, 0323, 0153, 0336, 0300, 0336, 0135, 0355, 0376, 0366, 0123, 
+  0262, 0032, 0177, 0337, 0215, 0070, 0334, 0122, 0251, 0230, 0210, 0233, 0166, 0255, 0134, 0265, 
+  0201, 0306, 0236, 0360, 0131, 0034, 0066, 0355, 0101, 0277, 0343, 0274, 0263, 0377, 0156, 0131, 
+  0215, 0337, 0034, 0007, 0076, 0321, 0230, 0112, 0242, 0251, 0017, 0123, 0246, 0043, 0010, 0071, 
+  0361, 0051, 0274, 0051, 0327, 0353, 0345, 0252, 0145, 0215, 0360, 0205, 0103, 0206, 0142, 0242, 
+  0235, 0021, 0165, 0174, 0106, 0270, 0010, 0301, 0201, 0344, 0011, 0214, 0050, 0314, 0237, 0114, 
+  0131, 0354, 0213, 0251, 0165, 0042, 0306, 0063, 0311, 0302, 0110, 0303, 0253, 0223, 0327, 0160, 
+  0336, 0356, 0237, 0302, 0107, 0172, 0113, 0271, 0030, 0243, 0046, 0226, 0325, 0217, 0230, 0202, 
+  0261, 0024, 0241, 0044, 0043, 0300, 0237, 0201, 0244, 0024, 0224, 0010, 0364, 0224, 0110, 0172, 
+  0014, 0063, 0061, 0001, 0217, 0304, 0040, 0251, 0317, 0224, 0226, 0154, 0070, 0321, 0024, 0230, 
+  0006, 0022, 0373, 0025, 0041, 0255, 0021, 0152, 0037, 0314, 0314, 0203, 0111, 0354, 0123, 0011, 
+  0072, 0242, 0240, 0251, 0034, 0051, 0020, 0101, 0362, 0347, 0323, 0305, 0140, 0156, 0014, 0207, 
+  0313, 0311, 0220, 0063, 0017, 0316, 0230, 0107, 0143, 0105, 0055, 0202, 0353, 0232, 0047, 0052, 
+  0102, 0063, 0207, 0263, 0204, 0274, 0143, 0126, 0357, 0315, 0127, 0207, 0216, 0100, 0251, 0104, 
+  0043, 0134, 0307, 0100, 0021, 0007, 0134, 0140, 0016, 0037, 0324, 0255, 0371, 0002, 0163, 0151, 
+  0045, 0020, 0022, 0136, 0021, 0155, 0024, 0226, 0040, 0306, 0206, 0351, 0065, 0152, 0071, 0003, 
+  0216, 0150, 0075, 0360, 0225, 0127, 0015, 0176, 0264, 0313, 0007, 0026, 0047, 0062, 0043, 0304, 
+  0006, 0177, 0240, 0064, 0064, 0154, 0312, 0070, 0207, 0041, 0205, 0211, 0242, 0301, 0204, 0227, 
+  0054, 0244, 0204, 0257, 0335, 0376, 0347, 0057, 0203, 0076, 0264, 0057, 0256, 0341, 0153, 0373, 
+  0352, 0252, 0175, 0321, 0277, 0076, 0116, 0134, 0145, 0134, 0200, 0350, 0246, 0162, 0330, 0150, 
+  0314, 0231, 0361, 0041, 0221, 0222, 0304, 0172, 0206, 0240, 0130, 0347, 0247, 0127, 0047, 0237, 
+  0221, 0276, 0375, 0241, 0173, 0326, 0355, 0137, 0033, 0265, 0073, 0335, 0376, 0305, 0151, 0257, 
+  0007, 0235, 0057, 0127, 0320, 0206, 0313, 0366, 0125, 0277, 0173, 0062, 0070, 0153, 0137, 0301, 
+  0345, 0340, 0352, 0362, 0113, 0357, 0264, 0014, 0320, 0243, 0106, 0041, 0152, 0255, 0207, 0023, 
+  0002, 0224, 0064, 0022, 0210, 0232, 0117, 0065, 0141, 0134, 0241, 0251, 0327, 0350, 0074, 0205, 
+  0052, 0161, 0037, 0042, 0162, 0113, 0321, 0211, 0036, 0145, 0267, 0250, 0020, 0001, 0017, 0243, 
+  0142, 0023, 0037, 0161, 0021, 0207, 0151, 0014, 0352, 0005, 0334, 0216, 0201, 0005, 0020, 0013, 
+  0135, 0202, 0251, 0144, 0030, 0020, 0132, 0254, 0172, 0317, 0172, 0364, 0136, 0011, 0272, 0261, 
+  0127, 0056, 0301, 0121, 0015, 0111, 0110, 0174, 0303, 0021, 0347, 0236, 0106, 0142, 0024, 0320, 
+  0141, 0001, 0012, 0357, 0160, 0041, 0144, 0011, 0076, 0010, 0245, 0015, 0371, 0171, 0033, 0240, 
+  0132, 0257, 0325, 0252, 0116, 0355, 0115, 0265, 0126, 0202, 0101, 0257, 0215, 0346, 0264, 0047, 
+  0210, 0257, 0174, 0017, 0137, 0005, 0017, 0102, 0202, 0172, 0015, 0370, 0120, 0062, 0057, 0262, 
+  0054, 0307, 0301, 0274, 0141, 0061, 0072, 0072, 0040, 0036, 0155, 0131, 0000, 0015, 0111, 0377, 
+  0235, 0060, 0111, 0025, 0160, 0066, 0154, 0332, 0241, 0276, 0371, 0335, 0176, 0314, 0075, 0223, 
+  0111, 0166, 0045, 0241, 0063, 0331, 0366, 0300, 0351, 0360, 0324, 0156, 0107, 0317, 0060, 0002, 
+  0302, 0061, 0277, 0255, 0203, 0221, 0275, 0102, 0027, 0023, 0314, 0263, 0354, 0074, 0314, 0042, 
+  0367, 0251, 0362, 0044, 0113, 0202, 0162, 0115, 0232, 0146, 0363, 0171, 0017, 0271, 0373, 0044, 
+  0157, 0263, 0311, 0111, 0002, 0220, 0132, 0001, 0350, 0236, 0132, 0014, 0377, 0241, 0236, 0006, 
+  0217, 0023, 0245, 0232, 0366, 0047, 0175, 0323, 0035, 0221, 0220, 0332, 0300, 0374, 0246, 0235, 
+  0252, 0341, 0172, 0134, 0050, 0352, 0142, 0214, 0243, 0037, 0134, 0066, 0012, 0155, 0303, 0210, 
+  0254, 0350, 0170, 0134, 0027, 0103, 0330, 0130, 0336, 0264, 0157, 0231, 0142, 0103, 0116, 0355, 
+  0126, 0137, 0116, 0150, 0243, 0162, 0377, 0066, 0233, 0030, 0353, 0207, 0033, 0010, 0157, 0242, 
+  0354, 0126, 0207, 0160, 0125, 0110, 0317, 0074, 0134, 0333, 0374, 0264, 0133, 0251, 0126, 0116, 
+  0242, 0325, 0062, 0133, 0243, 0222, 0132, 0223, 0155, 0330, 0307, 0004, 0333, 0324, 0262, 0047, 
+  0036, 0262, 0017, 0243, 0344, 0120, 0110, 0054, 0170, 0356, 0224, 0371, 0072, 0262, 0133, 0107, 
+  0105, 0344, 0232, 0151, 0204, 0013, 0064, 0206, 0277, 0302, 0212, 0104, 0020, 0274, 0246, 0075, 
+  0243, 0270, 0132, 0073, 0211, 0207, 0363, 0302, 0005, 0115, 0110, 0272, 0021, 0072, 0333, 0156, 
+  0245, 0206, 0254, 0060, 0170, 0021, 0343, 0176, 0032, 0016, 0061, 0341, 0116, 0362, 0027, 0135, 
+  0065, 0024, 0167, 0163, 0233, 0263, 0220, 0372, 0200, 0157, 0023, 0230, 0122, 0241, 0216, 0041, 
+  0257, 0077, 0320, 0157, 0351, 0371, 0135, 0200, 0315, 0342, 0021, 0222, 0321, 0130, 0047, 0265, 
+  0303, 0156, 0141, 0326, 0152, 0346, 0021, 0276, 0011, 0243, 0032, 0023, 0017, 0333, 0251, 0335, 
+  0252, 0147, 0122, 0147, 0043, 0104, 0074, 0263, 0220, 0213, 0065, 0213, 0054, 0030, 0236, 0011, 
+  0126, 0222, 0027, 0117, 0041, 0133, 0340, 0257, 0057, 0011, 0330, 0001, 0275, 0135, 0021, 0314, 
+  0342, 0343, 0004, 0233, 0241, 0166, 0225, 0236, 0231, 0025, 0151, 0354, 0257, 0145, 0114, 0200, 
+  0130, 0176, 0266, 0336, 0374, 0324, 0366, 0044, 0045, 0323, 0072, 0121, 0263, 0237, 0262, 0146, 
+  0351, 0062, 0244, 0074, 0063, 0376, 0335, 0223, 0325, 0344, 0316, 0227, 0265, 0021, 0210, 0005, 
+  0100, 0356, 0302, 0352, 0323, 0200, 0114, 0270, 0336, 0236, 0171, 0336, 0167, 0325, 0243, 0204, 
+  0134, 0077, 0146, 0326, 0304, 0244, 0122, 0267, 0326, 0124, 0351, 0155, 0044, 0341, 0034, 0343, 
+  0046, 0303, 0032, 0166, 0341, 0102, 0014, 0027, 0253, 0354, 0262, 0120, 0342, 0335, 0140, 0242, 
+  0025, 0057, 0107, 0357, 0306, 0070, 0053, 0356, 0140, 0161, 0200, 0163, 0327, 0016, 0154, 0143, 
+  0241, 0130, 0132, 0067, 0252, 0171, 0146, 0145, 0352, 0337, 0250, 0254, 0044, 0102, 0026, 0000, 
+  0331, 0306, 0357, 0144, 0170, 0266, 0321, 0333, 0024, 0007, 0243, 0213, 0153, 0172, 0103, 0176, 
+  0206, 0157, 0213, 0122, 0006, 0102, 0053, 0350, 0254, 0226, 0215, 0234, 0366, 0142, 0372, 0312, 
+  0321, 0321, 0163, 0052, 0217, 0005, 0035, 0174, 0357, 0336, 0224, 0333, 0237, 0152, 0365, 0275, 
+  0213, 0361, 0075, 0262, 0221, 0101, 0366, 0235, 0375, 0175, 0352, 0346, 0326, 0371, 0370, 0140, 
+  0361, 0037, 0357, 0162, 0331, 0062, 0255, 0336, 0304, 0362, 0277, 0354, 0054, 0256, 0075, 0254, 
+  0337, 0027, 0201, 0035, 0375, 0136, 0214, 0104, 0161, 0123, 0116, 0073, 0202, 0063, 0157, 0026, 
+  0153, 0104, 0254, 0152, 0227, 0244, 0200, 0153, 0166, 0114, 0124, 0141, 0163, 0252, 0125, 0253, 
+  0105, 0112, 0146, 0111, 0211, 0250, 0331, 0251, 0354, 0055, 0146, 0053, 0077, 0355, 0331, 0345, 
+  0017, 0330, 0260, 0327, 0211, 0322, 0102, 0160, 0315, 0306, 0256, 0246, 0167, 0072, 0163, 0376, 
+  0351, 0121, 0156, 0034, 0232, 0234, 0133, 0214, 0043, 0241, 0305, 0106, 0253, 0344, 0006, 0111, 
+  0252, 0007, 0307, 0055, 0141, 0044, 0070, 0326, 0270, 0112, 0216, 0240, 0112, 0176, 0270, 0255, 
+  0351, 0377, 0305, 0163, 0300, 0336, 0363, 0300, 0236, 0163, 0301, 0136, 0363, 0101, 0301, 0234, 
+  0260, 0021, 0170, 0333, 0346, 0361, 0131, 0072, 0041, 0233, 0064, 0016, 0046, 0234, 0247, 0373, 
+  0337, 0037, 0222, 0065, 0073, 0143, 0033, 0021, 0316, 0102, 0104, 0126, 0151, 0042, 0365, 0056, 
+  0002, 0326, 0357, 0022, 0072, 0010, 0011, 0134, 0040, 0321, 0046, 0116, 0373, 0377, 0306, 0154, 
+  0355, 0133, 0306, 0154, 0036, 0160, 0371, 0240, 0255, 0003, 0154, 0227, 0126, 0133, 0074, 0002, 
+  0357, 0235, 0332, 0071, 0020, 0255, 0205, 0147, 0247, 0001, 0045, 0355, 0307, 0312, 0135, 0072, 
+  0203, 0171, 0306, 0143, 0312, 0126, 0263, 0155, 0341, 0254, 0363, 0366, 0340, 0243, 0316, 0342, 
+  0340, 0367, 0266, 0372, 0263, 0225, 0307, 0055, 0206, 0300, 0015, 0173, 0174, 0136, 0023, 0111, 
+  0152, 0151, 0255, 0132, 0253, 0333, 0171, 0042, 0016, 0000, 0325, 0241, 0340, 0312, 0124, 0146, 
+  0333, 0216, 0262, 0135, 0127, 0031, 0050, 0052, 0023, 0242, 0367, 0233, 0311, 0056, 0152, 0055, 
+  0233, 0265, 0227, 0203, 0264, 0230, 0003, 0264, 0231, 0275, 0307, 0243, 0015, 0332, 0315, 0006, 
+  0063, 0346, 0376, 0221, 0056, 0102, 0026, 0377, 0142, 0121, 0376, 0355, 0043, 0161, 0037, 0140, 
+  0066, 0357, 0341, 0007, 0031, 0171, 0016, 0023, 0207, 0057, 0173, 0235, 0357, 0266, 0327, 0131, 
+  0074, 0263, 0030, 0343, 0303, 0251, 0220, 0276, 0175, 0210, 0155, 0302, 0111, 0104, 0342, 0220, 
+  0302, 0145, 0042, 0323, 0225, 0176, 0271, 0134, 0176, 0071, 0203, 0330, 0356, 0310, 0377, 0145, 
+  0033, 0365, 0103, 0323, 0201, 0306, 0046, 0234, 0335, 0000, 0127, 0246, 0162, 0054, 0131, 0254, 
+  0347, 0337, 0171, 0016, 0222, 0037, 0247, 0211, 0164, 0160, 0073, 0217, 0342, 0341, 0314, 0264, 
+  0317, 0035, 0023, 0345, 0045, 0316, 0237, 0165, 0234, 0327, 0237, 0157, 0234, 0373, 0114, 0175, 
+  0313, 0100, 0377, 0230, 0212, 0177, 0211, 0364, 0137, 0044, 0322, 0337, 0374, 0134, 0007, 0143, 
+  0073, 0235, 0316, 0034, 0342, 0144, 0254, 0166, 0350, 0223, 0261, 0137, 0376, 0206, 0300, 0332, 
+  0057, 0266, 0353, 0077, 0300, 0374, 0224, 0367, 0014, 0212, 0102, 0250, 0370, 0306, 0300, 0262, 
+  0215, 0113, 0057, 0033, 0351, 0035, 0052, 0147, 0312, 0374, 0220, 0152, 0365, 0300, 0261, 0364, 
+  0030, 0044, 0125, 0143, 0021, 0053, 0324, 0306, 0371, 0323, 0156, 0055, 0336, 0100, 0152, 0124, 
+  0226, 0050, 0357, 0127, 0310, 0222, 0072, 0277, 0004, 0146, 0256, 0114, 0314, 0257, 0345, 0015, 
+  0211, 0174, 0274, 0040, 0267, 0352, 0265, 0005, 0105, 0037, 0055, 0150, 0124, 0026, 0256, 0233, 
+  0376, 0007, 0347, 0212, 0270, 0131, 0000, 0050, 0165, 0165, 0141, 0171, 0051
+} };
+
+static GStaticResource static_resource = { about_me_resource_data.data, sizeof (about_me_resource_data.data) - 1 /* nul terminator */, NULL, NULL, NULL };
+
+G_MODULE_EXPORT
+GResource *about_me_get_resource (void);
+GResource *about_me_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(about_meresource_constructor)
+#endif
+G_DEFINE_CONSTRUCTOR(about_meresource_constructor)
+#ifdef G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA
+#pragma G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(about_meresource_destructor)
+#endif
+G_DEFINE_DESTRUCTOR(about_meresource_destructor)
+
+#else
+#warning "Constructor not supported on this compiler, linking in resources will not work"
+#endif
+
+static void about_meresource_constructor (void)
+{
+  g_static_resource_init (&static_resource);
+}
+
+static void about_meresource_destructor (void)
+{
+  g_static_resource_fini (&static_resource);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/50.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/50.html new file mode 100644 index 00000000..d8eb2908 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/50.html @@ -0,0 +1,3231 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
   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
/* Copyright 2006, 2007, 2008, Soren Sandmann <sandmann@daimi.au.dk>
+ *
+ * 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.
+ */
+
+#include <gdk/gdkprivate.h> /* For GDK_PARENT_RELATIVE_BG */<--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "scrollarea.h"
+#include "foo-marshal.h"
+
+G_DEFINE_TYPE_WITH_CODE (FooScrollArea, foo_scroll_area, GTK_TYPE_CONTAINER, G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE, NULL));
+
+static GtkWidgetClass *parent_class;
+
+typedef struct BackingStore BackingStore;
+
+typedef void (* ExposeFunc) (cairo_t *cr, cairo_region_t *region, gpointer data);
+
+typedef struct InputPath InputPath;
+typedef struct InputRegion InputRegion;
+typedef struct AutoScrollInfo AutoScrollInfo;
+
+struct InputPath
+{
+    gboolean			is_stroke;
+    cairo_fill_rule_t		fill_rule;
+    double			line_width;
+    cairo_path_t	       *path;		/* In canvas coordinates */
+
+    FooScrollAreaEventFunc	func;
+    gpointer			data;
+
+    InputPath		       *next;
+};
+
+/* InputRegions are mutually disjoint */
+struct InputRegion
+{
+    cairo_region_t *region;		/* the boundary of this area in canvas coordinates */
+    InputPath *paths;
+};
+
+struct AutoScrollInfo
+{
+    int                         dx;
+    int                         dy;
+    guint                       timeout_id;
+    int                         begin_x;<--- struct member 'AutoScrollInfo::begin_x' is never used.
+    int                         begin_y;<--- struct member 'AutoScrollInfo::begin_y' is never used.
+    double                      res_x;
+    double                      res_y;
+    GTimer                     *timer;
+};
+
+struct FooScrollAreaPrivate
+{
+    GdkWindow		       *input_window;
+
+    int				width;
+    int				height;
+
+    GtkAdjustment	       *hadj;
+    GtkAdjustment	       *vadj;
+
+    GtkScrollablePolicy hscroll_policy;
+    GtkScrollablePolicy vscroll_policy;
+
+    int			        x_offset;
+    int				y_offset;
+
+    int				min_width;
+    int				min_height;
+
+    GPtrArray		       *input_regions;
+
+    AutoScrollInfo	       *auto_scroll_info;
+
+    InputRegion		       *current_input;
+
+    gboolean			grabbed;
+    FooScrollAreaEventFunc	grab_func;
+    gpointer			grab_data;
+
+    cairo_surface_t	       *surface;
+    cairo_region_t		       *update_region;		/* In canvas coordinates */
+};
+
+enum
+{
+    VIEWPORT_CHANGED,
+    PAINT,
+    INPUT,
+    LAST_SIGNAL,
+};
+
+enum {
+    PROP_0,
+    PROP_VADJUSTMENT,
+    PROP_HADJUSTMENT,
+    PROP_HSCROLL_POLICY,
+    PROP_VSCROLL_POLICY
+};
+
+static guint signals [LAST_SIGNAL] = { 0 };
+
+static void foo_scroll_area_get_preferred_width (GtkWidget *widget,
+						 gint *minimum,
+						 gint *natural);
+static void foo_scroll_area_get_preferred_height (GtkWidget *widget,
+						 gint *minimum,
+						 gint *natural);
+static gboolean foo_scroll_area_draw (GtkWidget *widget,
+				      cairo_t *cr);
+static void foo_scroll_area_size_allocate (GtkWidget *widget,
+					   GtkAllocation *allocation);
+static void foo_scroll_area_set_hadjustment (FooScrollArea *scroll_area,
+					     GtkAdjustment *hadjustment);
+static void foo_scroll_area_set_vadjustment (FooScrollArea *scroll_area,
+					     GtkAdjustment *vadjustment);
+static void foo_scroll_area_realize (GtkWidget *widget);
+static void foo_scroll_area_unrealize (GtkWidget *widget);
+static void foo_scroll_area_map (GtkWidget *widget);
+static void foo_scroll_area_unmap (GtkWidget *widget);
+static gboolean foo_scroll_area_button_press (GtkWidget *widget,
+					      GdkEventButton *event);
+static gboolean foo_scroll_area_button_release (GtkWidget *widget,
+						GdkEventButton *event);
+static gboolean foo_scroll_area_motion (GtkWidget *widget,
+					GdkEventMotion *event);
+
+static void
+foo_scroll_area_map (GtkWidget *widget)
+{
+    FooScrollArea *area = FOO_SCROLL_AREA (widget);
+
+    GTK_WIDGET_CLASS (parent_class)->map (widget);
+
+    if (area->priv->input_window)
+	gdk_window_show (area->priv->input_window);
+}
+
+static void
+foo_scroll_area_unmap (GtkWidget *widget)
+{
+    FooScrollArea *area = FOO_SCROLL_AREA (widget);
+
+    if (area->priv->input_window)
+	gdk_window_hide (area->priv->input_window);
+
+    GTK_WIDGET_CLASS (parent_class)->unmap (widget);
+}
+
+static void
+foo_scroll_area_finalize (GObject *object)
+{
+    FooScrollArea *scroll_area = FOO_SCROLL_AREA (object);
+
+    g_object_unref (scroll_area->priv->hadj);
+    g_object_unref (scroll_area->priv->vadj);
+
+    g_ptr_array_free (scroll_area->priv->input_regions, TRUE);
+
+    g_free (scroll_area->priv);
+
+    G_OBJECT_CLASS (foo_scroll_area_parent_class)->finalize (object);
+}
+
+static void
+foo_scroll_area_get_property (GObject    *object,
+                              guint       property_id,
+                              GValue     *value,
+                              GParamSpec *pspec)
+{
+  FooScrollArea *scroll_area = FOO_SCROLL_AREA (object);
+
+  switch (property_id)
+    {
+    case PROP_VADJUSTMENT:
+      g_value_set_object (value, &scroll_area->priv->vadj);
+      break;
+    case PROP_HADJUSTMENT:
+      g_value_set_object (value, &scroll_area->priv->hadj);
+      break;
+    case PROP_HSCROLL_POLICY:
+      g_value_set_enum (value, scroll_area->priv->hscroll_policy);
+      break;
+    case PROP_VSCROLL_POLICY:
+      g_value_set_enum (value, scroll_area->priv->vscroll_policy);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+    }
+}
+
+static void
+foo_scroll_area_set_property (GObject      *object,
+			      guint         property_id,
+			      const GValue *value,
+			      GParamSpec   *pspec)
+{
+    FooScrollArea *scroll_area = FOO_SCROLL_AREA (object);
+    switch (property_id) {
+    case PROP_VADJUSTMENT:
+      foo_scroll_area_set_vadjustment (FOO_SCROLL_AREA (object), g_value_get_object (value));
+      break;
+    case PROP_HADJUSTMENT:
+      foo_scroll_area_set_hadjustment (FOO_SCROLL_AREA (object), g_value_get_object (value));
+      break;
+    case PROP_HSCROLL_POLICY:
+      scroll_area->priv->hscroll_policy = g_value_get_enum (value);
+      break;
+    case PROP_VSCROLL_POLICY:
+      scroll_area->priv->vscroll_policy = g_value_get_enum (value);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+    }
+}
+
+static void
+foo_scroll_area_class_init (FooScrollAreaClass *class)
+{
+    GObjectClass *object_class = G_OBJECT_CLASS (class);
+    GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
+
+    object_class->finalize = foo_scroll_area_finalize;
+    object_class->set_property = foo_scroll_area_set_property;
+    object_class->get_property = foo_scroll_area_get_property;
+    widget_class->draw = foo_scroll_area_draw;
+    widget_class->get_preferred_width = foo_scroll_area_get_preferred_width;
+    widget_class->get_preferred_height = foo_scroll_area_get_preferred_height;
+    widget_class->size_allocate = foo_scroll_area_size_allocate;
+    widget_class->realize = foo_scroll_area_realize;
+    widget_class->unrealize = foo_scroll_area_unrealize;
+    widget_class->button_press_event = foo_scroll_area_button_press;
+    widget_class->button_release_event = foo_scroll_area_button_release;
+    widget_class->motion_notify_event = foo_scroll_area_motion;
+    widget_class->map = foo_scroll_area_map;
+    widget_class->unmap = foo_scroll_area_unmap;
+
+    gtk_widget_class_set_css_name (widget_class, "foo-scroll-area");
+
+    parent_class = g_type_class_peek_parent (class);
+
+    /* Scrollable interface properties */
+    g_object_class_override_property (object_class, PROP_HADJUSTMENT, "hadjustment");
+    g_object_class_override_property (object_class, PROP_VADJUSTMENT, "vadjustment");
+    g_object_class_override_property (object_class, PROP_HSCROLL_POLICY, "hscroll-policy");
+    g_object_class_override_property (object_class, PROP_VSCROLL_POLICY, "vscroll-policy");
+
+    signals[VIEWPORT_CHANGED] =
+	g_signal_new ("viewport_changed",
+		      G_OBJECT_CLASS_TYPE (object_class),
+		      G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+		      G_STRUCT_OFFSET (FooScrollAreaClass,
+				       viewport_changed),
+		      NULL, NULL,
+		      foo_marshal_VOID__BOXED_BOXED,
+		      G_TYPE_NONE, 2,
+		      GDK_TYPE_RECTANGLE,
+		      GDK_TYPE_RECTANGLE);
+
+    signals[PAINT] =
+	g_signal_new ("paint",
+		      G_OBJECT_CLASS_TYPE (object_class),
+		      G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+		      G_STRUCT_OFFSET (FooScrollAreaClass,
+				       paint),
+		      NULL, NULL,
+		      g_cclosure_marshal_VOID__POINTER,
+		      G_TYPE_NONE,
+                      1,
+		      G_TYPE_POINTER);
+}
+
+static GtkAdjustment *
+new_adjustment (void)
+{
+    return GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
+}
+
+static void
+foo_scroll_area_init (FooScrollArea *scroll_area)
+{
+    GtkWidget *widget;
+
+    widget = GTK_WIDGET (scroll_area);
+
+    gtk_widget_set_has_window (widget, FALSE);
+    gtk_widget_set_redraw_on_allocate (widget, FALSE);
+
+    scroll_area->priv = g_new0 (FooScrollAreaPrivate, 1);
+    scroll_area->priv->width = 0;
+    scroll_area->priv->height = 0;
+    scroll_area->priv->hadj = g_object_ref_sink (new_adjustment());
+    scroll_area->priv->vadj = g_object_ref_sink (new_adjustment());
+    scroll_area->priv->x_offset = 0.0;
+    scroll_area->priv->y_offset = 0.0;
+    scroll_area->priv->min_width = 0;
+    scroll_area->priv->min_height = 0;
+    scroll_area->priv->auto_scroll_info = NULL;
+    scroll_area->priv->input_regions = g_ptr_array_new ();
+    scroll_area->priv->surface = NULL;
+    scroll_area->priv->update_region = cairo_region_create ();
+}
+
+typedef void (* PathForeachFunc) (double  *x,
+				  double  *y,
+				  gpointer data);
+
+static void
+path_foreach_point (cairo_path_t     *path,
+		    PathForeachFunc   func,
+		    gpointer	      user_data)
+{
+    int i;
+
+    for (i = 0; i < path->num_data; i += path->data[i].header.length)
+    {
+	cairo_path_data_t *data = &(path->data[i]);
+
+	switch (data->header.type)
+	{
+	case CAIRO_PATH_MOVE_TO:
+	case CAIRO_PATH_LINE_TO:
+	    func (&(data[1].point.x), &(data[1].point.y), user_data);
+	    break;
+
+	case CAIRO_PATH_CURVE_TO:
+	    func (&(data[1].point.x), &(data[1].point.y), user_data);
+	    func (&(data[2].point.x), &(data[2].point.y), user_data);
+	    func (&(data[3].point.x), &(data[3].point.y), user_data);
+	    break;
+
+	case CAIRO_PATH_CLOSE_PATH:
+	    break;
+	}
+    }
+}
+
+typedef struct
+{
+    double x1, y1, x2, y2;<--- struct member 'Box::x1' is never used.<--- struct member 'Box::y1' is never used.<--- struct member 'Box::x2' is never used.<--- struct member 'Box::y2' is never used.
+} Box;
+
+static void
+input_path_free_list (InputPath *paths)
+{
+    if (!paths)
+	return;
+
+    input_path_free_list (paths->next);
+    cairo_path_destroy (paths->path);
+    g_free (paths);
+}
+
+static void
+input_region_free (InputRegion *region)
+{
+    input_path_free_list (region->paths);
+    cairo_region_destroy (region->region);
+
+    g_free (region);
+}
+
+static void
+get_viewport (FooScrollArea *scroll_area,
+	      GdkRectangle  *viewport)
+{
+    GtkAllocation allocation;
+    GtkWidget *widget = GTK_WIDGET (scroll_area);
+
+    gtk_widget_get_allocation (widget, &allocation);
+
+    viewport->x = scroll_area->priv->x_offset;
+    viewport->y = scroll_area->priv->y_offset;
+    viewport->width = allocation.width;
+    viewport->height = allocation.height;
+}
+
+static void
+allocation_to_canvas (FooScrollArea *area,
+		      int           *x,
+		      int           *y)
+{
+    *x += area->priv->x_offset;
+    *y += area->priv->y_offset;
+}
+
+static void
+clear_exposed_input_region (FooScrollArea *area,
+			    cairo_region_t *exposed)	/* in canvas coordinates */
+{
+    guint i;
+    cairo_region_t *viewport;
+    GdkRectangle allocation;
+
+    gtk_widget_get_allocation (GTK_WIDGET (area), &allocation);
+    allocation.x = 0;
+    allocation.y = 0;
+    allocation_to_canvas (area, &allocation.x, &allocation.y);
+    viewport = cairo_region_create_rectangle (&allocation);
+    cairo_region_subtract (viewport, exposed);
+
+    for (i = 0; i < area->priv->input_regions->len; ++i)
+    {
+	InputRegion *region = area->priv->input_regions->pdata[i];
+
+	cairo_region_intersect (region->region, viewport);
+
+	if (cairo_region_is_empty (region->region))
+	{
+	    input_region_free (region);
+	    g_ptr_array_remove_index_fast (area->priv->input_regions, i--);
+	}
+    }
+
+    cairo_region_destroy (viewport);
+}
+
+static void
+setup_background_cr (GtkWidget *widget,
+		     cairo_t   *cr,
+		     int        x_offset,
+		     int        y_offset)
+{
+    GdkWindow *window = gtk_widget_get_window (widget);
+    GtkWidget *parent = gtk_widget_get_parent (widget);
+    GtkStyleContext *context;
+    GdkRGBA         *pattern_rgba = NULL;
+    GtkStateFlags    state;
+
+    context = gtk_widget_get_style_context (widget);
+    state = gtk_style_context_get_state (context);
+
+    gtk_style_context_get (context, state, GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &pattern_rgba, NULL);
+
+    if (parent)
+    {
+      gint window_x, window_y;
+
+      gdk_window_get_position (window, &window_x, &window_y);
+      setup_background_cr (parent, cr, x_offset + window_x, y_offset + window_y);
+    }
+    else if (pattern_rgba)
+    {
+      cairo_translate (cr, - x_offset, - y_offset);
+      gdk_cairo_set_source_rgba (cr, pattern_rgba);
+      cairo_translate (cr, x_offset, y_offset);
+      gdk_rgba_free (pattern_rgba);
+    }
+}
+
+static void
+initialize_background (GtkWidget *widget,
+		       cairo_t   *cr)
+{
+    setup_background_cr (widget, cr, 0, 0);
+
+    cairo_paint (cr);
+}
+
+static gboolean
+foo_scroll_area_draw (GtkWidget *widget,
+                      cairo_t *widget_cr)
+{
+    FooScrollArea *scroll_area = FOO_SCROLL_AREA (widget);
+    cairo_t *cr;
+    cairo_region_t *region;
+    GtkAllocation widget_allocation;
+
+    /* Setup input areas */
+    clear_exposed_input_region (scroll_area, scroll_area->priv->update_region);
+
+    scroll_area->priv->current_input = g_new0 (InputRegion, 1);
+    scroll_area->priv->current_input->region = cairo_region_copy (scroll_area->priv->update_region);
+    scroll_area->priv->current_input->paths = NULL;
+    g_ptr_array_add (scroll_area->priv->input_regions,
+		     scroll_area->priv->current_input);
+
+    region = scroll_area->priv->update_region;
+    scroll_area->priv->update_region = cairo_region_create ();
+
+    /* Create cairo context */
+    cr = cairo_create (scroll_area->priv->surface);
+    initialize_background (widget, cr);
+
+    g_signal_emit (widget, signals[PAINT], 0, cr);
+
+    /* Destroy stuff */
+    cairo_destroy (cr);
+
+    scroll_area->priv->current_input = NULL;
+
+    /* Finally draw the backing pixmap */
+    gtk_widget_get_allocation (widget, &widget_allocation);
+    cairo_set_source_surface (widget_cr, scroll_area->priv->surface, widget_allocation.x, widget_allocation.y);
+    cairo_paint (widget_cr);
+
+    cairo_region_destroy (region);
+
+    return TRUE;
+}
+
+void
+foo_scroll_area_get_viewport (FooScrollArea *scroll_area,
+			      GdkRectangle  *viewport)
+{
+    g_return_if_fail (FOO_IS_SCROLL_AREA (scroll_area));
+
+    if (!viewport)
+	return;
+
+    get_viewport (scroll_area, viewport);
+}
+
+static void
+process_event (FooScrollArea	       *scroll_area,
+	       FooScrollAreaEventType	input_type,
+	       int			x,
+	       int			y);
+
+static void
+emit_viewport_changed (FooScrollArea *scroll_area,
+		       GdkRectangle  *new_viewport,
+		       GdkRectangle  *old_viewport)
+{
+    GdkDisplay *display;
+    GdkSeat *seat;
+    GdkDevice *pointer;
+
+    int px, py;
+    g_signal_emit (scroll_area, signals[VIEWPORT_CHANGED], 0,
+		   new_viewport, old_viewport);
+
+    if (scroll_area->priv->input_window == NULL)
+	return;
+
+    display = gdk_window_get_display (scroll_area->priv->input_window);
+    seat = gdk_display_get_default_seat (display);
+    pointer = gdk_seat_get_pointer (seat);
+    gdk_window_get_device_position (scroll_area->priv->input_window,
+                                    pointer,
+                                    &px,
+                                    &py,
+                                    NULL);
+
+    process_event (scroll_area, FOO_MOTION, px, py);
+}
+
+static void
+clamp_adjustment (GtkAdjustment *adj)
+{
+    if (gtk_adjustment_get_upper (adj) >= gtk_adjustment_get_page_size (adj))
+	gtk_adjustment_set_value (adj, CLAMP (gtk_adjustment_get_value (adj), 0.0,
+					      gtk_adjustment_get_upper (adj)
+					       - gtk_adjustment_get_page_size (adj)));
+    else
+	gtk_adjustment_set_value (adj, 0.0);
+}
+
+static gboolean
+set_adjustment_values (FooScrollArea *scroll_area)
+{
+    GtkAllocation allocation;
+
+    GtkAdjustment *hadj = scroll_area->priv->hadj;
+    GtkAdjustment *vadj = scroll_area->priv->vadj;
+
+    /* Horizontal */
+    gtk_widget_get_allocation (GTK_WIDGET (scroll_area), &allocation);
+    g_object_freeze_notify (G_OBJECT (hadj));
+    gtk_adjustment_set_page_size (hadj, allocation.width);
+    gtk_adjustment_set_step_increment (hadj, 0.1 * allocation.width);
+    gtk_adjustment_set_page_increment (hadj, 0.9 * allocation.width);
+    gtk_adjustment_set_lower (hadj, 0.0);
+    gtk_adjustment_set_upper (hadj, scroll_area->priv->width);
+    g_object_thaw_notify (G_OBJECT (hadj));
+
+    /* Vertical */
+    g_object_freeze_notify (G_OBJECT (vadj));
+    gtk_adjustment_set_page_size (vadj, allocation.height);
+    gtk_adjustment_set_step_increment (vadj, 0.1 * allocation.height);
+    gtk_adjustment_set_page_increment (vadj, 0.9 * allocation.height);
+    gtk_adjustment_set_lower (vadj, 0.0);
+    gtk_adjustment_set_upper (vadj, scroll_area->priv->height);
+    g_object_thaw_notify (G_OBJECT (vadj));
+
+    clamp_adjustment (hadj);
+    clamp_adjustment (vadj);
+
+    return TRUE;
+}
+
+static void
+foo_scroll_area_realize (GtkWidget *widget)
+{
+    FooScrollArea *area = FOO_SCROLL_AREA (widget);
+    GdkWindowAttr attributes;
+    GtkAllocation widget_allocation;
+    GdkWindow *window;
+    gint attributes_mask;
+    GdkDrawingContext *gdc;
+    cairo_region_t    *cairo_region;
+    cairo_t *cr;
+
+    gtk_widget_get_allocation (widget, &widget_allocation);
+    gtk_widget_set_realized (widget, TRUE);
+
+    attributes.window_type = GDK_WINDOW_CHILD;
+    attributes.x = widget_allocation.x;
+    attributes.y = widget_allocation.y;
+    attributes.width = widget_allocation.width;
+    attributes.height = widget_allocation.height;
+    attributes.wclass = GDK_INPUT_ONLY;
+    attributes.event_mask = gtk_widget_get_events (widget);
+    attributes.event_mask |= (GDK_BUTTON_PRESS_MASK |
+			      GDK_BUTTON_RELEASE_MASK |
+			      GDK_BUTTON1_MOTION_MASK |
+			      GDK_BUTTON2_MOTION_MASK |
+			      GDK_BUTTON3_MOTION_MASK |
+			      GDK_POINTER_MOTION_MASK |
+			      GDK_ENTER_NOTIFY_MASK |
+			      GDK_LEAVE_NOTIFY_MASK);
+
+    attributes_mask = GDK_WA_X | GDK_WA_Y;
+
+    window = gtk_widget_get_parent_window (widget);
+    gtk_widget_set_window (widget, window);
+    g_object_ref (window);
+
+    area->priv->input_window = gdk_window_new (window,
+					       &attributes, attributes_mask);
+
+    cairo_region = cairo_region_create ();
+    gdc = gdk_window_begin_draw_frame (gtk_widget_get_window (widget), cairo_region);
+    cr = gdk_drawing_context_get_cairo_context (gdc);
+
+    area->priv->surface = cairo_surface_create_similar (cairo_get_target (cr), CAIRO_CONTENT_COLOR,
+							widget_allocation.width, widget_allocation.height);
+
+    gdk_window_end_draw_frame (gtk_widget_get_window (widget), gdc);
+    cairo_region_destroy (cairo_region);
+
+    gdk_window_set_user_data (area->priv->input_window, area);
+}
+
+static void
+foo_scroll_area_unrealize (GtkWidget *widget)
+{
+    FooScrollArea *area = FOO_SCROLL_AREA (widget);
+
+    if (area->priv->input_window)
+    {
+	gdk_window_set_user_data (area->priv->input_window, NULL);
+	gdk_window_destroy (area->priv->input_window);
+	area->priv->input_window = NULL;
+    }
+
+    GTK_WIDGET_CLASS (parent_class)->unrealize (widget);
+}
+
+static cairo_surface_t *
+create_new_surface (GtkWidget *widget,
+                    cairo_surface_t *old)
+{
+    GtkAllocation widget_allocation;
+    GdkDrawingContext *gdc;
+    cairo_region_t    *cairo_region;
+    cairo_t *cr;
+    cairo_surface_t *new;
+
+    gtk_widget_get_allocation (widget, &widget_allocation);
+
+    cairo_region = cairo_region_create ();
+    gdc = gdk_window_begin_draw_frame (gtk_widget_get_window (widget), cairo_region);
+    cr = gdk_drawing_context_get_cairo_context (gdc);
+    new = cairo_surface_create_similar (cairo_get_target (cr),
+					CAIRO_CONTENT_COLOR,
+					widget_allocation.width,
+					widget_allocation.height);
+    gdk_window_end_draw_frame (gtk_widget_get_window (widget), gdc);
+    cairo_region_destroy (cairo_region);
+
+    /* Unfortunately we don't know in which direction we were resized,
+     * so we just assume we were dragged from the south-east corner.
+     *
+     * Although, maybe we could get the root coordinates of the input-window?
+     * That might just work, actually. We need to make sure marco uses
+     * static gravity for the window before this will be useful.
+     */
+
+    cr = cairo_create (new);
+    cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
+    cairo_set_source_surface (cr, old, 0, 0);
+
+    cairo_paint (cr);
+    cairo_destroy (cr);
+
+    return new;
+}
+
+static void
+allocation_to_canvas_region (FooScrollArea *area,
+			     cairo_region_t *region)
+{
+    cairo_region_translate (region, area->priv->x_offset, area->priv->y_offset);
+}
+
+static void
+_cairo_region_xor (cairo_region_t *dst, const cairo_region_t *src)
+{
+    cairo_region_t *trb;
+
+    trb = cairo_region_copy (src);
+
+    cairo_region_subtract (trb, dst);
+    cairo_region_subtract (dst, src);
+    cairo_region_union (dst, trb);
+    cairo_region_destroy (trb);
+}
+
+static void
+foo_scroll_area_size_allocate (GtkWidget     *widget,
+			       GtkAllocation *allocation)
+{
+    FooScrollArea *scroll_area = FOO_SCROLL_AREA (widget);
+    GdkRectangle new_viewport;
+    GdkRectangle old_viewport;
+    cairo_region_t *old_allocation;
+    cairo_region_t *invalid;
+    GtkAllocation widget_allocation;
+
+    get_viewport (scroll_area, &old_viewport);
+
+    gtk_widget_get_allocation (widget, &widget_allocation);
+    old_allocation = cairo_region_create_rectangle (&widget_allocation);
+    cairo_region_translate (old_allocation,
+		       -widget_allocation.x, -widget_allocation.y);
+    invalid = cairo_region_create_rectangle (allocation);
+    cairo_region_translate (invalid, -allocation->x, -allocation->y);
+    _cairo_region_xor (invalid, old_allocation);
+    allocation_to_canvas_region (scroll_area, invalid);
+    foo_scroll_area_invalidate_region (scroll_area, invalid);
+    cairo_region_destroy (old_allocation);
+    cairo_region_destroy (invalid);
+
+    gtk_widget_set_allocation (widget, allocation);
+
+    if (scroll_area->priv->input_window)
+    {
+	cairo_surface_t *new_surface;
+
+	gdk_window_move_resize (scroll_area->priv->input_window,
+				allocation->x, allocation->y,
+				allocation->width, allocation->height);
+
+	new_surface = create_new_surface (widget, scroll_area->priv->surface);
+	cairo_surface_destroy (scroll_area->priv->surface);
+	scroll_area->priv->surface = new_surface;
+    }
+
+    get_viewport (scroll_area, &new_viewport);
+
+    emit_viewport_changed (scroll_area, &new_viewport, &old_viewport);
+}
+
+static void
+emit_input (FooScrollArea *scroll_area,
+	    FooScrollAreaEventType type,
+	    int			   x,
+	    int			   y,
+	    FooScrollAreaEventFunc func,
+	    gpointer		data)
+{
+    FooScrollAreaEvent event;
+
+    if (!func)
+	return;
+
+    if (type != FOO_MOTION)
+	emit_input (scroll_area, FOO_MOTION, x, y, func, data);
+
+    event.type = type;
+    event.x = x;
+    event.y = y;
+
+    func (scroll_area, &event, data);
+}
+
+static void
+process_event (FooScrollArea	       *scroll_area,
+	       FooScrollAreaEventType	input_type,
+	       int			x,
+	       int			y)
+{
+    GtkWidget *widget = GTK_WIDGET (scroll_area);
+    guint i;
+
+    allocation_to_canvas (scroll_area, &x, &y);
+
+    if (scroll_area->priv->grabbed)
+    {
+	emit_input (scroll_area, input_type, x, y,
+		    scroll_area->priv->grab_func,
+		    scroll_area->priv->grab_data);
+	return;
+    }
+
+    for (i = 0; i < scroll_area->priv->input_regions->len; ++i)
+    {
+	InputRegion *region = scroll_area->priv->input_regions->pdata[i];
+
+	if (cairo_region_contains_point (region->region, x, y))
+	{
+	    InputPath *path;
+
+	    path = region->paths;
+	    while (path)
+	    {
+		cairo_t *cr;
+		gboolean inside;
+		GdkDrawingContext *gdc;
+		cairo_region_t    *cairo_region;
+
+		cairo_region = cairo_region_create ();
+		gdc = gdk_window_begin_draw_frame (gtk_widget_get_window (widget), cairo_region);
+		cr = gdk_drawing_context_get_cairo_context (gdc);
+		cairo_set_fill_rule (cr, path->fill_rule);
+		cairo_set_line_width (cr, path->line_width);
+		cairo_append_path (cr, path->path);
+
+		if (path->is_stroke)
+		    inside = cairo_in_stroke (cr, x, y);
+		else
+		    inside = cairo_in_fill (cr, x, y);
+		gdk_window_end_draw_frame (gtk_widget_get_window (widget), gdc);
+		cairo_region_destroy (cairo_region);
+
+
+		if (inside)
+		{
+		    emit_input (scroll_area, input_type,
+				x, y,
+				path->func,
+				path->data);
+		    return;
+		}
+
+		path = path->next;
+	    }
+
+	    /* Since the regions are all disjoint, no other region
+	     * can match. Of course we could be clever and try and
+	     * sort the regions, but so far I have been unable to
+	     * make this loop show up on a profile.
+	     */
+	    return;
+	}
+    }
+}
+
+static void
+process_gdk_event (FooScrollArea *scroll_area,
+		   int		  x,
+		   int	          y,
+		   GdkEvent      *event)<--- Parameter 'event' can be declared as pointer to const
+{
+    FooScrollAreaEventType input_type;
+
+    if (event->type == GDK_BUTTON_PRESS)
+	input_type = FOO_BUTTON_PRESS;
+    else if (event->type == GDK_BUTTON_RELEASE)
+	input_type = FOO_BUTTON_RELEASE;
+    else if (event->type == GDK_MOTION_NOTIFY)
+	input_type = FOO_MOTION;
+    else
+	return;
+
+    process_event (scroll_area, input_type, x, y);
+}
+
+static gboolean
+foo_scroll_area_button_press (GtkWidget *widget,
+			      GdkEventButton *event)
+{
+    FooScrollArea *area = FOO_SCROLL_AREA (widget);
+
+    process_gdk_event (area, (int) event->x, (int) event->y, (GdkEvent *)event);
+
+    return TRUE;
+}
+
+static gboolean
+foo_scroll_area_button_release (GtkWidget *widget,
+				GdkEventButton *event)
+{
+    FooScrollArea *area = FOO_SCROLL_AREA (widget);
+
+    process_gdk_event (area, (int) event->x, (int) event->y, (GdkEvent *)event);
+
+    return FALSE;
+}
+
+static gboolean
+foo_scroll_area_motion (GtkWidget *widget,
+			GdkEventMotion *event)
+{
+    FooScrollArea *area = FOO_SCROLL_AREA (widget);
+
+    process_gdk_event (area, (int) event->x, (int) event->y, (GdkEvent *)event);
+    return TRUE;
+}
+
+void
+foo_scroll_area_set_size_fixed_y (FooScrollArea	       *scroll_area,
+				  int			width,
+				  int			height,
+				  int			old_y,
+				  int			new_y)
+{
+    scroll_area->priv->width = width;
+    scroll_area->priv->height = height;
+
+    g_object_thaw_notify (G_OBJECT (scroll_area->priv->vadj));
+    gtk_adjustment_set_value (scroll_area->priv->vadj, new_y);
+
+    set_adjustment_values (scroll_area);
+    g_object_thaw_notify (G_OBJECT (scroll_area->priv->vadj));
+}
+
+void
+foo_scroll_area_set_size (FooScrollArea	       *scroll_area,
+			  int			width,
+			  int			height)
+{
+    g_return_if_fail (FOO_IS_SCROLL_AREA (scroll_area));
+
+    /* FIXME: Default scroll algorithm should probably be to
+     * keep the same *area* outside the screen as before.
+     *
+     * For wrapper widgets that will do something roughly
+     * right. For widgets that don't change size, it
+     * will do the right thing. Except for idle-layouting
+     * widgets.
+     *
+     * Maybe there should be some generic support for those
+     * widgets. Can that even be done?
+     *
+     * Should we have a version of this function using
+     * fixed points?
+     */
+
+    scroll_area->priv->width = width;
+    scroll_area->priv->height = height;
+
+    set_adjustment_values (scroll_area);
+}
+
+static void
+foo_scroll_area_get_preferred_width (GtkWidget *widget,
+                                     gint      *minimum,
+                                     gint      *natural)
+{
+    FooScrollArea *scroll_area = FOO_SCROLL_AREA (widget);
+
+    if (minimum != NULL) {
+        *minimum = scroll_area->priv->min_width;
+    }
+    if (natural != NULL) {
+        *natural = scroll_area->priv->min_width;
+    }
+}
+
+static void
+foo_scroll_area_get_preferred_height (GtkWidget *widget,
+                                      gint      *minimum,
+                                      gint      *natural)
+{
+    FooScrollArea *scroll_area = FOO_SCROLL_AREA (widget);
+
+    if (minimum != NULL) {
+        *minimum = scroll_area->priv->min_height;
+    }
+    if (natural != NULL) {
+        *natural = scroll_area->priv->min_height;
+    }
+}
+
+static void
+foo_scroll_area_scroll (FooScrollArea *area,
+			gint dx,
+			gint dy)
+{
+    GdkRectangle allocation;
+    GdkRectangle src_area;
+    GdkRectangle move_area;
+    cairo_region_t *invalid_region;
+
+    gtk_widget_get_allocation (GTK_WIDGET (area), &allocation);
+    allocation.x = 0;
+    allocation.y = 0;
+
+    src_area = allocation;
+    src_area.x -= dx;
+    src_area.y -= dy;
+
+    invalid_region = cairo_region_create_rectangle (&allocation);
+
+    if (gdk_rectangle_intersect (&allocation, &src_area, &move_area))
+    {
+	cairo_region_t *move_region;
+	cairo_t *cr;
+
+	cr = cairo_create (area->priv->surface);
+
+	/* Cairo doesn't allow self-copies, so we do this little trick instead:
+	* 1) Clip so the group size is small.
+	* 2) Call push_group() which creates a temporary pixmap as a workaround
+	*/
+	gdk_cairo_rectangle (cr, &move_area);
+	cairo_clip (cr);
+	cairo_push_group (cr);
+
+	cairo_set_source_surface (cr, area->priv->surface, dx, dy);
+	gdk_cairo_rectangle (cr, &move_area);
+	cairo_fill (cr);
+
+	cairo_pop_group_to_source (cr);
+	cairo_paint (cr);
+
+	cairo_destroy (cr);
+
+	gtk_widget_queue_draw (GTK_WIDGET (area));
+
+	move_region = cairo_region_create_rectangle (&move_area);
+	cairo_region_translate (move_region, dx, dy);
+	cairo_region_subtract (invalid_region, move_region);
+	cairo_region_destroy (move_region);
+    }
+
+    allocation_to_canvas_region (area, invalid_region);
+
+    foo_scroll_area_invalidate_region (area, invalid_region);
+
+    cairo_region_destroy (invalid_region);
+}
+
+static void
+foo_scrollbar_adjustment_changed (GtkAdjustment *adj,
+				  FooScrollArea *scroll_area)
+{
+    GtkWidget *widget = GTK_WIDGET (scroll_area);
+    gint dx = 0;
+    gint dy = 0;
+    GdkRectangle old_viewport, new_viewport;
+    gdouble aux;
+    int offset;
+
+    get_viewport (scroll_area, &old_viewport);
+
+    aux = gtk_adjustment_get_value (adj);
+    offset = (int) aux;
+    if (adj == scroll_area->priv->hadj)
+    {
+	dx = offset - scroll_area->priv->x_offset;
+	scroll_area->priv->x_offset = offset;
+    }
+    else if (adj == scroll_area->priv->vadj)
+    {
+	dy = offset - scroll_area->priv->y_offset;
+	scroll_area->priv->y_offset = offset;
+    }
+    else
+    {
+	g_assert_not_reached ();
+    }
+
+    if (gtk_widget_get_realized (widget))
+    {
+	foo_scroll_area_scroll (scroll_area, -dx, -dy);
+    }
+
+    get_viewport (scroll_area, &new_viewport);
+
+    emit_viewport_changed (scroll_area, &new_viewport, &old_viewport);
+}
+
+static void
+set_one_adjustment (FooScrollArea *scroll_area,
+		    GtkAdjustment *adjustment,
+		    GtkAdjustment **location)
+{
+    g_return_if_fail (location != NULL);
+
+    if (adjustment == *location)
+	return;
+
+    if (!adjustment)
+	adjustment = new_adjustment ();
+
+    g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
+
+    if (*location)
+    {
+	g_signal_handlers_disconnect_by_func (
+	    *location, foo_scrollbar_adjustment_changed, scroll_area);
+
+	g_object_unref (*location);
+    }
+
+    *location = adjustment;
+
+    g_object_ref_sink (*location);
+
+    g_signal_connect (*location, "value_changed",
+		      G_CALLBACK (foo_scrollbar_adjustment_changed),
+		      scroll_area);
+}
+
+static void
+foo_scroll_area_set_hadjustment (FooScrollArea *scroll_area,
+				 GtkAdjustment *hadjustment)
+{
+    set_one_adjustment (scroll_area, hadjustment, &scroll_area->priv->hadj);
+
+    set_adjustment_values (scroll_area);
+}
+
+static void
+foo_scroll_area_set_vadjustment (FooScrollArea *scroll_area,
+				 GtkAdjustment *vadjustment)
+{
+    set_one_adjustment (scroll_area, vadjustment, &scroll_area->priv->vadj);
+
+    set_adjustment_values (scroll_area);
+}
+
+FooScrollArea *
+foo_scroll_area_new (void)
+{
+    return g_object_new (FOO_TYPE_SCROLL_AREA, NULL);
+}
+
+void
+foo_scroll_area_set_min_size (FooScrollArea *scroll_area,
+			      int		   min_width,
+			      int            min_height)
+{
+    scroll_area->priv->min_width = min_width;
+    scroll_area->priv->min_height = min_height;
+
+    /* FIXME: think through invalidation.
+     *
+     * Goals: - no repainting everything on size_allocate(),
+     *        - make sure input boxes are invalidated when
+     *          needed
+     */
+    gtk_widget_queue_resize (GTK_WIDGET (scroll_area));
+}
+
+static void
+user_to_device (double *x, double *y,
+		gpointer data)
+{
+    cairo_t *cr = data;
+
+    cairo_user_to_device (cr, x, y);
+}
+
+static InputPath *
+make_path (FooScrollArea *area,
+	   cairo_t *cr,
+	   gboolean is_stroke,
+	   FooScrollAreaEventFunc func,
+	   gpointer data)
+{
+    InputPath *path = g_new0 (InputPath, 1);
+
+    path->is_stroke = is_stroke;
+    path->fill_rule = cairo_get_fill_rule (cr);
+    path->line_width = cairo_get_line_width (cr);
+    path->path = cairo_copy_path (cr);
+    path_foreach_point (path->path, user_to_device, cr);
+    path->func = func;
+    path->data = data;
+    path->next = area->priv->current_input->paths;
+    area->priv->current_input->paths = path;
+    return path;
+}
+
+/* FIXME: we probably really want a
+ *
+ *	foo_scroll_area_add_input_from_fill (area, cr, ...);
+ * and
+ *      foo_scroll_area_add_input_from_stroke (area, cr, ...);
+ * as well.
+ */
+void
+foo_scroll_area_add_input_from_fill (FooScrollArea           *scroll_area,
+				     cairo_t	             *cr,
+				     FooScrollAreaEventFunc   func,
+				     gpointer                 data)
+{
+    g_return_if_fail (FOO_IS_SCROLL_AREA (scroll_area));
+    g_return_if_fail (cr != NULL);
+    g_return_if_fail (scroll_area->priv->current_input);
+
+    make_path (scroll_area, cr, FALSE, func, data);
+}
+
+void
+foo_scroll_area_add_input_from_stroke (FooScrollArea           *scroll_area,
+				       cairo_t	                *cr,
+				       FooScrollAreaEventFunc   func,
+				       gpointer                 data)
+{
+    g_return_if_fail (FOO_IS_SCROLL_AREA (scroll_area));
+    g_return_if_fail (cr != NULL);
+    g_return_if_fail (scroll_area->priv->current_input);
+
+    make_path (scroll_area, cr, TRUE, func, data);
+}
+
+void
+foo_scroll_area_invalidate (FooScrollArea *scroll_area)
+{
+    GtkAllocation allocation;
+    GtkWidget *widget = GTK_WIDGET (scroll_area);
+
+    gtk_widget_get_allocation (widget, &allocation);
+    foo_scroll_area_invalidate_rect (scroll_area,
+				     scroll_area->priv->x_offset, scroll_area->priv->y_offset,
+				     allocation.width,
+				     allocation.height);
+}
+
+static void
+canvas_to_window (FooScrollArea *area,
+		  cairo_region_t *region)
+{
+    GtkAllocation allocation;
+    GtkWidget *widget = GTK_WIDGET (area);
+
+    gtk_widget_get_allocation (widget, &allocation);
+    cairo_region_translate (region,
+		       -area->priv->x_offset + allocation.x,
+		       -area->priv->y_offset + allocation.y);
+}
+
+static void
+window_to_canvas (FooScrollArea *area,
+		  cairo_region_t *region)
+{
+    GtkAllocation allocation;
+    GtkWidget *widget = GTK_WIDGET (area);
+
+    gtk_widget_get_allocation (widget, &allocation);
+    cairo_region_translate (region,
+		       area->priv->x_offset - allocation.x,
+		       area->priv->y_offset - allocation.y);
+}
+
+void
+foo_scroll_area_invalidate_region (FooScrollArea *area,
+				   cairo_region_t     *region)
+{
+    GtkWidget *widget;
+
+    g_return_if_fail (FOO_IS_SCROLL_AREA (area));
+
+    widget = GTK_WIDGET (area);
+
+    cairo_region_union (area->priv->update_region, region);
+
+    if (gtk_widget_get_realized (widget))
+    {
+	canvas_to_window (area, region);
+
+	gdk_window_invalidate_region (gtk_widget_get_window (widget),
+	                              region, TRUE);
+
+	window_to_canvas (area, region);
+    }
+}
+
+void
+foo_scroll_area_invalidate_rect (FooScrollArea *scroll_area,
+				 int	        x,
+				 int	        y,
+				 int	        width,
+				 int	        height)
+{
+    GdkRectangle rect = { x, y, width, height };
+    cairo_region_t *region;
+
+    g_return_if_fail (FOO_IS_SCROLL_AREA (scroll_area));
+
+    region = cairo_region_create_rectangle (&rect);
+
+    foo_scroll_area_invalidate_region (scroll_area, region);
+
+    cairo_region_destroy (region);
+}
+
+void
+foo_scroll_area_begin_grab (FooScrollArea *scroll_area,
+			    FooScrollAreaEventFunc func,
+			    gpointer       input_data)
+{
+    g_return_if_fail (FOO_IS_SCROLL_AREA (scroll_area));
+    g_return_if_fail (!scroll_area->priv->grabbed);
+
+    scroll_area->priv->grabbed = TRUE;
+    scroll_area->priv->grab_func = func;
+    scroll_area->priv->grab_data = input_data;
+
+    /* FIXME: we should probably take a server grab */
+    /* Also, maybe there should be support for setting the grab cursor */
+}
+
+void
+foo_scroll_area_end_grab (FooScrollArea *scroll_area)
+{
+    g_return_if_fail (FOO_IS_SCROLL_AREA (scroll_area));
+
+    scroll_area->priv->grabbed = FALSE;
+    scroll_area->priv->grab_func = NULL;
+    scroll_area->priv->grab_data = NULL;
+}
+
+gboolean
+foo_scroll_area_is_grabbed (FooScrollArea *scroll_area)
+{
+    return scroll_area->priv->grabbed;
+}
+
+void
+foo_scroll_area_set_viewport_pos (FooScrollArea  *scroll_area,
+				  int		  x,
+				  int		  y)
+{
+    g_object_freeze_notify (G_OBJECT (scroll_area->priv->hadj));
+    g_object_freeze_notify (G_OBJECT (scroll_area->priv->vadj));
+    gtk_adjustment_set_value (scroll_area->priv->hadj, x);
+    gtk_adjustment_set_value (scroll_area->priv->vadj, y);
+
+    set_adjustment_values (scroll_area);
+    g_object_thaw_notify (G_OBJECT (scroll_area->priv->hadj));
+    g_object_thaw_notify (G_OBJECT (scroll_area->priv->vadj));
+}
+
+static gboolean
+rect_contains (const GdkRectangle *rect, int x, int y)
+{
+    return (x >= rect->x		&&
+	    y >= rect->y		&&
+	    x  < rect->x + rect->width	&&
+	    y  < rect->y + rect->height);
+}
+
+static void
+stop_scrolling (FooScrollArea *area)
+{
+    if (area->priv->auto_scroll_info)
+    {
+	g_source_remove (area->priv->auto_scroll_info->timeout_id);
+	g_timer_destroy (area->priv->auto_scroll_info->timer);
+	g_free (area->priv->auto_scroll_info);
+
+	area->priv->auto_scroll_info = NULL;
+    }
+}
+
+static gboolean
+scroll_idle (gpointer data)
+{
+    GdkRectangle viewport, new_viewport;
+    FooScrollArea *area = data;
+    AutoScrollInfo *info = area->priv->auto_scroll_info;
+    int new_x, new_y;
+    double elapsed;
+
+    get_viewport (area, &viewport);
+
+    elapsed = g_timer_elapsed (info->timer, NULL);
+
+    info->res_x = elapsed * info->dx / 0.2;
+    info->res_y = elapsed * info->dy / 0.2;
+
+    new_x = viewport.x + (int) info->res_x;
+    new_y = viewport.y + (int) info->res_y;
+
+    foo_scroll_area_set_viewport_pos (area, new_x, new_y);
+
+    get_viewport (area, &new_viewport);
+
+    if (viewport.x == new_viewport.x		&&
+	viewport.y == new_viewport.y		&&
+	(info->res_x > 1.0			||
+	 info->res_y > 1.0			||
+	 info->res_x < -1.0			||
+	 info->res_y < -1.0))
+    {
+	stop_scrolling (area);
+
+	/* stop scrolling if it didn't have an effect */
+	return FALSE;
+    }
+
+    return TRUE;
+}
+
+static void
+ensure_scrolling (FooScrollArea *area,
+		  int		 dx,
+		  int		 dy)
+{
+    if (!area->priv->auto_scroll_info)
+    {
+	area->priv->auto_scroll_info = g_new0 (AutoScrollInfo, 1);
+	area->priv->auto_scroll_info->timeout_id =
+	    g_idle_add (scroll_idle, area);
+	area->priv->auto_scroll_info->timer = g_timer_new ();
+    }
+
+    area->priv->auto_scroll_info->dx = dx;
+    area->priv->auto_scroll_info->dy = dy;
+}
+
+void
+foo_scroll_area_auto_scroll (FooScrollArea *scroll_area,
+			     FooScrollAreaEvent *event)<--- Parameter 'event' can be declared as pointer to const
+{
+    GdkRectangle viewport;
+
+    get_viewport (scroll_area, &viewport);
+
+    if (rect_contains (&viewport, event->x, event->y))
+    {
+	stop_scrolling (scroll_area);
+    }
+    else
+    {
+	int dx, dy;
+
+	dx = dy = 0;
+
+	if (event->y < viewport.y)
+	{
+	    dy = event->y - viewport.y;
+	    dy = MIN (dy + 2, 0);
+	}
+	else if (event->y >= viewport.y + viewport.height)
+	{
+	    dy = event->y - (viewport.y + viewport.height - 1);
+	    dy = MAX (dy - 2, 0);
+	}
+
+	if (event->x < viewport.x)
+	{
+	    dx = event->x - viewport.x;
+	    dx = MIN (dx + 2, 0);
+	}
+	else if (event->x >= viewport.x + viewport.width)
+	{
+	    dx = event->x - (viewport.x + viewport.width - 1);
+	    dx = MAX (dx - 2, 0);
+	}
+
+	ensure_scrolling (scroll_area, dx, dy);
+    }
+}
+
+void
+foo_scroll_area_begin_auto_scroll (FooScrollArea *scroll_area)
+{
+    /* noop  for now */
+}
+
+void
+foo_scroll_area_end_auto_scroll (FooScrollArea *scroll_area)
+{
+    stop_scrolling (scroll_area);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/51.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/51.html new file mode 100644 index 00000000..f41e9434 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/51.html @@ -0,0 +1,497 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* Copyright 2006, 2007, 2008, Soren Sandmann <sandmann@daimi.au.dk>
+ *
+ * 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.
+ */
+
+#ifndef __SCROLLAREA_H__
+#define __SCROLLAREA_H__
+
+#include <cairo.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.
+
+#define FOO_TYPE_SCROLL_AREA            (foo_scroll_area_get_type ())
+#define FOO_SCROLL_AREA(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOO_TYPE_SCROLL_AREA, FooScrollArea))
+#define FOO_SCROLL_AREA_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  FOO_TYPE_SCROLL_AREA, FooScrollAreaClass))
+#define FOO_IS_SCROLL_AREA(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOO_TYPE_SCROLL_AREA))
+#define FOO_IS_SCROLL_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  FOO_TYPE_SCROLL_AREA))
+#define FOO_SCROLL_AREA_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  FOO_TYPE_SCROLL_AREA, FooScrollAreaClass))
+
+typedef struct FooScrollArea FooScrollArea;
+typedef struct FooScrollAreaClass FooScrollAreaClass;
+typedef struct FooScrollAreaPrivate FooScrollAreaPrivate;
+typedef struct FooScrollAreaEvent FooScrollAreaEvent;
+
+typedef enum
+{
+    FOO_BUTTON_PRESS,
+    FOO_BUTTON_RELEASE,
+    FOO_MOTION
+} FooScrollAreaEventType;
+
+struct FooScrollAreaEvent
+{
+    FooScrollAreaEventType	type;
+    int				x;
+    int				y;
+};
+
+typedef void (* FooScrollAreaEventFunc) (FooScrollArea      *area,
+					 FooScrollAreaEvent *event,
+					 gpointer            data);
+
+struct FooScrollArea
+{
+    GtkContainer parent_instance;
+
+    FooScrollAreaPrivate *priv;
+};
+
+struct FooScrollAreaClass
+{
+    GtkContainerClass parent_class;
+
+    void (*set_scroll_adjustments) (FooScrollArea *scroll_area,
+				    GtkAdjustment *hadjustment,
+				    GtkAdjustment *vadjustment);
+
+    void (*viewport_changed) (FooScrollArea *scroll_area,
+			      GdkRectangle  *old_viewport,
+			      GdkRectangle  *new_viewport);
+
+    void (*paint) (FooScrollArea *scroll_area,
+		   cairo_t       *cr,
+		   GdkRectangle  *extents,
+		   cairo_region_t *region);
+};
+
+GType foo_scroll_area_get_type (void);
+
+FooScrollArea *foo_scroll_area_new (void);
+
+/* Set the requisition for the widget. */
+void	      foo_scroll_area_set_min_size (FooScrollArea *scroll_area,
+					    int		   min_width,
+					    int            min_height);
+
+/* Set how much of the canvas can be scrolled into view */
+void	      foo_scroll_area_set_size (FooScrollArea	       *scroll_area,
+					int			width,
+					int			height);
+void	      foo_scroll_area_set_size_fixed_y (FooScrollArea  *scroll_area,
+						int		width,
+						int		height,
+						int		old_y,
+						int		new_y);
+void	      foo_scroll_area_set_viewport_pos (FooScrollArea  *scroll_area,
+						int		x,
+						int		y);
+void	      foo_scroll_area_get_viewport (FooScrollArea *scroll_area,
+					    GdkRectangle  *viewport);
+void          foo_scroll_area_add_input_from_stroke (FooScrollArea           *scroll_area,
+						     cairo_t	                *cr,
+						     FooScrollAreaEventFunc   func,
+						     gpointer                 data);
+void          foo_scroll_area_add_input_from_fill (FooScrollArea *scroll_area,
+						      cairo_t	      *cr,
+						      FooScrollAreaEventFunc func,
+						      gpointer       data);
+void          foo_scroll_area_invalidate_region (FooScrollArea *area,
+						 cairo_region_t *region);
+void	      foo_scroll_area_invalidate (FooScrollArea *scroll_area);
+void	      foo_scroll_area_invalidate_rect (FooScrollArea *scroll_area,
+					       int	      x,
+					       int	      y,
+					       int	      width,
+					       int	      height);
+void foo_scroll_area_begin_grab (FooScrollArea *scroll_area,
+				 FooScrollAreaEventFunc func,
+				 gpointer       input_data);
+void foo_scroll_area_end_grab (FooScrollArea *scroll_area);
+gboolean foo_scroll_area_is_grabbed (FooScrollArea *scroll_area);
+
+void foo_scroll_area_begin_auto_scroll (FooScrollArea *scroll_area);
+void foo_scroll_area_auto_scroll (FooScrollArea *scroll_area,
+				  FooScrollAreaEvent *event);
+void foo_scroll_area_end_auto_scroll (FooScrollArea *scroll_area);
+
+#endif /* __SCROLLAREA_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/52.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/52.html new file mode 100644 index 00000000..0bed0c79 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/52.html @@ -0,0 +1,911 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* 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:OBJECT,OBJECT (foo-marshal.list:1) */
+/* Prototype for -Wmissing-prototypes */
+G_BEGIN_DECLS
+extern
+void foo_marshal_VOID__OBJECT_OBJECT (GClosure     *closure,
+                                      GValue       *return_value,
+                                      guint         n_param_values,
+                                      const GValue *param_values,
+                                      gpointer      invocation_hint,
+                                      gpointer      marshal_data);
+G_END_DECLS
+void
+foo_marshal_VOID__OBJECT_OBJECT (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__OBJECT_OBJECT) (gpointer data1,
+                                                    gpointer arg1,
+                                                    gpointer arg2,
+                                                    gpointer data2);
+  GCClosure *cc = (GCClosure *) closure;
+  gpointer data1, data2;
+  GMarshalFunc_VOID__OBJECT_OBJECT 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__OBJECT_OBJECT) (marshal_data ? marshal_data : cc->callback);
+
+  callback (data1,
+            g_marshal_value_peek_object (param_values + 1),
+            g_marshal_value_peek_object (param_values + 2),
+            data2);
+}
+
+/* VOID:UINT,UINT,UINT,UINT (foo-marshal.list:2) */
+/* Prototype for -Wmissing-prototypes */
+G_BEGIN_DECLS
+extern
+void foo_marshal_VOID__UINT_UINT_UINT_UINT (GClosure     *closure,
+                                            GValue       *return_value,
+                                            guint         n_param_values,
+                                            const GValue *param_values,
+                                            gpointer      invocation_hint,
+                                            gpointer      marshal_data);
+G_END_DECLS
+void
+foo_marshal_VOID__UINT_UINT_UINT_UINT (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__UINT_UINT_UINT_UINT) (gpointer data1,
+                                                          guint arg1,
+                                                          guint arg2,
+                                                          guint arg3,
+                                                          guint arg4,
+                                                          gpointer data2);
+  GCClosure *cc = (GCClosure *) closure;
+  gpointer data1, data2;
+  GMarshalFunc_VOID__UINT_UINT_UINT_UINT callback;
+
+  g_return_if_fail (n_param_values == 5);
+
+  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__UINT_UINT_UINT_UINT) (marshal_data ? marshal_data : cc->callback);
+
+  callback (data1,
+            g_marshal_value_peek_uint (param_values + 1),
+            g_marshal_value_peek_uint (param_values + 2),
+            g_marshal_value_peek_uint (param_values + 3),
+            g_marshal_value_peek_uint (param_values + 4),
+            data2);
+}
+
+/* VOID:UINT,UINT (foo-marshal.list:3) */
+/* Prototype for -Wmissing-prototypes */
+G_BEGIN_DECLS
+extern
+void foo_marshal_VOID__UINT_UINT (GClosure     *closure,
+                                  GValue       *return_value,
+                                  guint         n_param_values,
+                                  const GValue *param_values,
+                                  gpointer      invocation_hint,
+                                  gpointer      marshal_data);
+G_END_DECLS
+void
+foo_marshal_VOID__UINT_UINT (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__UINT_UINT) (gpointer data1,
+                                                guint arg1,
+                                                guint arg2,
+                                                gpointer data2);
+  GCClosure *cc = (GCClosure *) closure;
+  gpointer data1, data2;
+  GMarshalFunc_VOID__UINT_UINT 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__UINT_UINT) (marshal_data ? marshal_data : cc->callback);
+
+  callback (data1,
+            g_marshal_value_peek_uint (param_values + 1),
+            g_marshal_value_peek_uint (param_values + 2),
+            data2);
+}
+
+/* VOID:BOXED,BOXED (foo-marshal.list:4) */
+/* Prototype for -Wmissing-prototypes */
+G_BEGIN_DECLS
+extern
+void foo_marshal_VOID__BOXED_BOXED (GClosure     *closure,
+                                    GValue       *return_value,
+                                    guint         n_param_values,
+                                    const GValue *param_values,
+                                    gpointer      invocation_hint,
+                                    gpointer      marshal_data);
+G_END_DECLS
+void
+foo_marshal_VOID__BOXED_BOXED (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__BOXED_BOXED) (gpointer data1,
+                                                  gpointer arg1,
+                                                  gpointer arg2,
+                                                  gpointer data2);
+  GCClosure *cc = (GCClosure *) closure;
+  gpointer data1, data2;
+  GMarshalFunc_VOID__BOXED_BOXED 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__BOXED_BOXED) (marshal_data ? marshal_data : cc->callback);
+
+  callback (data1,
+            g_marshal_value_peek_boxed (param_values + 1),
+            g_marshal_value_peek_boxed (param_values + 2),
+            data2);
+}
+
+/* VOID:POINTER,BOXED,POINTER (foo-marshal.list:5) */
+/* Prototype for -Wmissing-prototypes */
+G_BEGIN_DECLS
+extern
+void foo_marshal_VOID__POINTER_BOXED_POINTER (GClosure     *closure,
+                                              GValue       *return_value,
+                                              guint         n_param_values,
+                                              const GValue *param_values,
+                                              gpointer      invocation_hint,
+                                              gpointer      marshal_data);
+G_END_DECLS
+void
+foo_marshal_VOID__POINTER_BOXED_POINTER (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__POINTER_BOXED_POINTER) (gpointer data1,
+                                                            gpointer arg1,
+                                                            gpointer arg2,
+                                                            gpointer arg3,
+                                                            gpointer data2);
+  GCClosure *cc = (GCClosure *) closure;
+  gpointer data1, data2;
+  GMarshalFunc_VOID__POINTER_BOXED_POINTER callback;
+
+  g_return_if_fail (n_param_values == 4);
+
+  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__POINTER_BOXED_POINTER) (marshal_data ? marshal_data : cc->callback);
+
+  callback (data1,
+            g_marshal_value_peek_pointer (param_values + 1),
+            g_marshal_value_peek_boxed (param_values + 2),
+            g_marshal_value_peek_pointer (param_values + 3),
+            data2);
+}
+
+/* VOID:POINTER,POINTER (foo-marshal.list:6) */
+/* Prototype for -Wmissing-prototypes */
+G_BEGIN_DECLS
+extern
+void foo_marshal_VOID__POINTER_POINTER (GClosure     *closure,
+                                        GValue       *return_value,
+                                        guint         n_param_values,
+                                        const GValue *param_values,
+                                        gpointer      invocation_hint,
+                                        gpointer      marshal_data);
+G_END_DECLS
+void
+foo_marshal_VOID__POINTER_POINTER (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__POINTER_POINTER) (gpointer data1,
+                                                      gpointer arg1,
+                                                      gpointer arg2,
+                                                      gpointer data2);
+  GCClosure *cc = (GCClosure *) closure;
+  gpointer data1, data2;
+  GMarshalFunc_VOID__POINTER_POINTER 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__POINTER_POINTER) (marshal_data ? marshal_data : cc->callback);
+
+  callback (data1,
+            g_marshal_value_peek_pointer (param_values + 1),
+            g_marshal_value_peek_pointer (param_values + 2),
+            data2);
+}
+
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/53.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/53.html new file mode 100644 index 00000000..36b5efaa --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/53.html @@ -0,0 +1,5517 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
   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
/* Monitor Settings. A preference panel for configuring monitors
+ *
+ * Copyright (C) 2007, 2008  Red Hat, 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 St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * Author: Soren Sandmann <sandmann@redhat.com>
+ */
+
+#include <config.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 <stdlib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/wait.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 "scrollarea.h"
+#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.
+#include <libmate-desktop/mate-rr.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libmate-desktop/mate-rr-config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libmate-desktop/mate-rr-labeler.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 <X11/Xlib.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 "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+
+#define MATE_INTERFACE_SCHEMA                 "org.mate.interface"
+#define WINDOW_SCALE_KEY                      "window-scaling-factor"
+
+typedef struct App App;
+typedef struct GrabInfo GrabInfo;
+
+struct App
+{
+    MateRRScreen       *screen;
+    MateRRConfig  *current_configuration;
+    MateRRLabeler *labeler;
+    MateRROutputInfo         *current_output;
+
+    GtkWidget	   *dialog;
+    GtkWidget      *current_monitor_event_box;
+    GtkWidget      *current_monitor_label;
+    GtkWidget      *monitor_on_radio;
+    GtkWidget      *monitor_off_radio;
+    GtkListStore   *resolution_store;<--- struct member 'App::resolution_store' is never used.
+    GtkWidget	   *resolution_combo;
+    GtkWidget	   *refresh_combo;
+    GtkWidget	   *rotation_combo;
+    GtkWidget	   *panel_checkbox;
+    GtkWidget	   *scale_vbox;
+    GtkWidget	   *scale_bbox;
+    GtkWidget	   *clone_checkbox;
+    GtkWidget	   *show_icon_checkbox;
+    GtkWidget      *primary_button;
+
+    /* We store the event timestamp when the Apply button is clicked */
+    GtkWidget      *apply_button;
+    guint32         apply_button_clicked_timestamp;
+
+    GtkWidget      *area;
+    gboolean	    ignore_gui_changes;
+    GSettings	   *settings;
+    GSettings	   *scale_settings;
+
+    /* These are used while we are waiting for the ApplyConfiguration method to be executed over D-bus */
+    GDBusConnection *connection;
+    GDBusProxy *proxy;
+
+    enum {
+	APPLYING_VERSION_1,
+	APPLYING_VERSION_2
+    } apply_configuration_state;
+};
+
+/* Response codes for custom buttons in the main dialog */
+enum {
+    RESPONSE_MAKE_DEFAULT = 1
+};
+
+static void rebuild_gui (App *app);
+static void on_clone_changed (GtkWidget *box, gpointer data);
+static void on_rate_changed (GtkComboBox *box, gpointer data);
+static gboolean output_overlaps (MateRROutputInfo *output, MateRRConfig *config);
+static void select_current_output_from_dialog_position (App *app);
+static void monitor_on_off_toggled_cb (GtkToggleButton *toggle, gpointer data);
+static void apply_configuration_returned_cb (GObject *source_object, GAsyncResult *res, gpointer data);
+
+static void
+error_message (App *app, const char *primary_text, const char *secondary_text)
+{
+    GtkWidget *dialog;
+
+    dialog = gtk_message_dialog_new ((app && app->dialog) ? GTK_WINDOW (app->dialog) : NULL,
+				     GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+				     GTK_MESSAGE_ERROR,
+				     GTK_BUTTONS_CLOSE,
+				     "%s", primary_text);
+
+    if (secondary_text)
+	gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "%s", secondary_text);
+
+    gtk_dialog_run (GTK_DIALOG (dialog));
+    gtk_widget_destroy (dialog);
+}
+
+static gboolean
+do_free (gpointer data)
+{
+    g_free (data);
+    return FALSE;
+}
+
+static gchar *
+idle_free (gchar *s)
+{
+    g_idle_add (do_free, s);
+
+    return s;
+}
+
+static void
+on_screen_changed (MateRRScreen *scr,
+		   gpointer data)
+{
+    MateRRConfig *current;
+    App *app = data;
+
+    current = mate_rr_config_new_current (app->screen, NULL);
+
+    if (app->current_configuration)
+	g_object_unref (app->current_configuration);
+
+    app->current_configuration = current;
+    app->current_output = NULL;
+
+    if (app->labeler) {
+	mate_rr_labeler_hide (app->labeler);
+	g_object_unref (app->labeler);
+    }
+
+    app->labeler = mate_rr_labeler_new (app->current_configuration);
+
+    select_current_output_from_dialog_position (app);
+}
+
+static void
+on_viewport_changed (FooScrollArea *scroll_area,
+		     GdkRectangle  *old_viewport,
+		     GdkRectangle  *new_viewport)<--- Parameter 'new_viewport' can be declared as pointer to const
+{
+    foo_scroll_area_set_size (scroll_area,
+			      new_viewport->width,
+			      new_viewport->height);
+
+    foo_scroll_area_invalidate (scroll_area);
+}
+
+static void
+layout_set_font (PangoLayout *layout, const char *font)
+{
+    PangoFontDescription *desc =
+	pango_font_description_from_string (font);
+
+    if (desc)
+    {
+	pango_layout_set_font_description (layout, desc);
+
+	pango_font_description_free (desc);
+    }
+}
+
+static void
+clear_combo (GtkWidget *widget)
+{
+    GtkComboBox *box = GTK_COMBO_BOX (widget);
+    GtkTreeModel *model = gtk_combo_box_get_model (box);
+    GtkListStore *store = GTK_LIST_STORE (model);
+
+    gtk_list_store_clear (store);
+}
+
+typedef struct
+{
+    const char *text;
+    gboolean found;
+    GtkTreeIter iter;
+} ForeachInfo;
+
+static gboolean
+foreach (GtkTreeModel *model,
+	 GtkTreePath *path,
+	 GtkTreeIter *iter,
+	 gpointer data)
+{
+    ForeachInfo *info = data;
+    char *text = NULL;
+
+    gtk_tree_model_get (model, iter, 0, &text, -1);
+
+    g_assert (text != NULL);
+
+    if (strcmp (info->text, text) == 0)
+    {
+	info->found = TRUE;
+	info->iter = *iter;
+	return TRUE;
+    }
+
+    return FALSE;
+}
+
+static void
+add_key (GtkWidget       *widget,
+         const char      *text,
+         guint            width,
+         guint            height,
+         int              rate,
+         MateRRRotation   rotation)
+{
+    ForeachInfo info;
+    GtkComboBox *box = GTK_COMBO_BOX (widget);
+    GtkTreeModel *model = gtk_combo_box_get_model (box);
+    GtkListStore *store = GTK_LIST_STORE (model);
+
+    info.text = text;
+    info.found = FALSE;
+
+    gtk_tree_model_foreach (model, foreach, &info);
+
+    if (!info.found)
+    {
+        GtkTreeIter iter;
+        gtk_list_store_insert_with_values (store, &iter, -1,
+                                           0, text,
+                                           1, width,
+                                           2, height,
+                                           3, rate,
+                                           4, width * height,
+                                           5, rotation,
+                                           -1);
+    }
+}
+
+static gboolean
+combo_select (GtkWidget *widget, const char *text)
+{
+    GtkComboBox *box = GTK_COMBO_BOX (widget);
+    GtkTreeModel *model = gtk_combo_box_get_model (box);
+    ForeachInfo info;
+
+    info.text = text;
+    info.found = FALSE;
+
+    gtk_tree_model_foreach (model, foreach, &info);
+
+    if (!info.found)
+	return FALSE;
+
+    gtk_combo_box_set_active_iter (box, &info.iter);
+    return TRUE;
+}
+
+static MateRRMode **
+get_current_modes (App *app)
+{
+    MateRROutput *output;
+
+    if (mate_rr_config_get_clone (app->current_configuration))
+    {
+	return mate_rr_screen_list_clone_modes (app->screen);
+    }
+    else
+    {
+	if (!app->current_output)
+	    return NULL;
+
+	output = mate_rr_screen_get_output_by_name (app->screen,
+	    mate_rr_output_info_get_name (app->current_output));
+
+	if (!output)
+	    return NULL;
+
+	return mate_rr_output_list_modes (output);
+    }
+}
+
+static void
+rebuild_rotation_combo (App *app)
+{
+    typedef struct
+    {
+	MateRRRotation	rotation;
+	const char *	name;
+    } RotationInfo;
+    static const RotationInfo rotations[] = {
+	{ MATE_RR_ROTATION_0, N_("Normal") },
+	{ MATE_RR_ROTATION_90, N_("Left") },
+	{ MATE_RR_ROTATION_270, N_("Right") },
+	{ MATE_RR_ROTATION_180, N_("Upside Down") },
+    };
+    const char *selection;
+    MateRRRotation current;
+    unsigned int i;
+
+    clear_combo (app->rotation_combo);
+
+    gtk_widget_set_sensitive (app->rotation_combo,
+                              app->current_output && mate_rr_output_info_is_active (app->current_output));
+
+    if (!app->current_output)
+	return;
+
+    current = mate_rr_output_info_get_rotation (app->current_output);
+
+    selection = NULL;
+    for (i = 0; i < G_N_ELEMENTS (rotations); ++i)
+    {
+	const RotationInfo *info = &(rotations[i]);
+
+	mate_rr_output_info_set_rotation (app->current_output, info->rotation);
+
+	/* NULL-GError --- FIXME: we should say why this rotation is not available! */
+	if (mate_rr_config_applicable (app->current_configuration, app->screen, NULL))
+	{
+ 	    add_key (app->rotation_combo, _(info->name), 0, 0, 0, info->rotation);
+
+	    if (info->rotation == current)
+		selection = _(info->name);
+	}
+    }
+
+    mate_rr_output_info_set_rotation (app->current_output, current);
+
+    if (!(selection && combo_select (app->rotation_combo, selection)))
+	combo_select (app->rotation_combo, _("Normal"));
+}
+
+static char *
+make_rate_string (int hz)
+{
+    return g_strdup_printf (_("%d Hz"), hz);
+}
+
+static void
+rebuild_rate_combo (App *app)
+{
+    MateRRMode **modes;
+    int best;
+    int i;
+
+    clear_combo (app->refresh_combo);
+
+    gtk_widget_set_sensitive (
+	app->refresh_combo, app->current_output && mate_rr_output_info_is_active (app->current_output));
+
+    if (!app->current_output
+        || !(modes = get_current_modes (app)))
+	return;
+
+    best = -1;
+    for (i = 0; modes[i] != NULL; ++i)
+    {
+        MateRRMode *mode = modes[i];
+        guint width;
+        guint height;
+        int rate;
+        int output_width;
+        int output_height;
+
+        mate_rr_output_info_get_geometry (app->current_output, NULL, NULL,
+                                          &output_width,
+                                          &output_height);
+
+        width  = mate_rr_mode_get_width (mode);
+        height = mate_rr_mode_get_height (mode);
+        rate   = mate_rr_mode_get_freq (mode);
+
+        if ((width  == (guint) output_width) &&
+            (height == (guint) output_height))
+        {
+            add_key (app->refresh_combo,
+                     idle_free (make_rate_string (rate)),
+                     0, 0, rate, -1);
+
+            if (rate > best)
+                best = rate;
+        }
+    }
+
+    if (!combo_select (app->refresh_combo, idle_free (make_rate_string (mate_rr_output_info_get_refresh_rate (app->current_output)))))
+	combo_select (app->refresh_combo, idle_free (make_rate_string (best)));
+}
+
+static int
+count_active_outputs (App *app)
+{
+    int i, count = 0;
+    MateRROutputInfo **outputs = mate_rr_config_get_outputs (app->current_configuration);
+
+    for (i = 0; outputs[i] != NULL; ++i)
+    {
+	if (mate_rr_output_info_is_active (outputs[i]))
+	    count++;
+    }
+
+    return count;
+}
+
+/* FIXME: this function is copied from mate-settings-daemon/plugins/xrandr/gsd-xrandr-manager.c.
+ * Do we need to put this function in mate-desktop for public use?
+ */
+static gboolean
+get_clone_size (MateRRScreen *screen,
+                guint        *width,
+                guint        *height)
+{
+    MateRRMode **modes = mate_rr_screen_list_clone_modes (screen);
+    guint best_w = 0;
+    guint best_h = 0;
+    guint i;
+
+    for (i = 0; modes[i] != NULL; ++i) {
+        MateRRMode *mode = modes[i];
+        guint w, h;
+
+        w = mate_rr_mode_get_width (mode);
+        h = mate_rr_mode_get_height (mode);
+
+        if (w * h > best_w * best_h) {
+            best_w = w;
+            best_h = h;
+        }
+    }
+
+    if (best_w > 0 && best_h > 0) {
+        if (width)
+            *width = best_w;
+        if (height)
+            *height = best_h;
+
+        return TRUE;
+    }
+
+    return FALSE;
+}
+
+static gboolean
+output_info_supports_mode (App              *app,
+                           MateRROutputInfo *info,
+                           guint             width,
+                           guint             height)
+{
+    MateRROutput *output;
+    MateRRMode **modes;
+    guint i;
+
+    if (!mate_rr_output_info_is_connected (info))
+        return FALSE;
+
+    output = mate_rr_screen_get_output_by_name (app->screen, mate_rr_output_info_get_name (info));
+    if (!output)
+        return FALSE;
+
+    modes = mate_rr_output_list_modes (output);
+
+    for (i = 0; modes[i]; i++) {
+        if ((mate_rr_mode_get_width  (modes[i]) == width) &&
+            (mate_rr_mode_get_height (modes[i]) == height))
+        {
+            return TRUE;
+        }
+    }
+
+    return FALSE;
+}
+
+/* Computes whether "Mirror Screens" (clone mode) is supported based on these criteria:
+ *
+ * 1. There is an available size for cloning.
+ *
+ * 2. There are 2 or more connected outputs that support that size.
+ */
+static gboolean
+mirror_screens_is_supported (App *app)
+{
+    guint clone_width;
+    guint clone_height;
+    gboolean have_clone_size;
+    gboolean mirror_is_supported;
+
+    mirror_is_supported = FALSE;
+
+    have_clone_size = get_clone_size (app->screen, &clone_width, &clone_height);
+
+    if (have_clone_size) {
+	guint i;
+	guint num_outputs_with_clone_size = 0;
+	MateRROutputInfo **outputs = mate_rr_config_get_outputs (app->current_configuration);
+
+	for (i = 0; outputs[i] != NULL; i++)
+	{
+	    /* We count the connected outputs that support the clone size.  It
+	     * doesn't matter if those outputs aren't actually On currently; we
+	     * will turn them on in on_clone_changed().
+	     */
+	    if (mate_rr_output_info_is_connected (outputs[i]) &&
+                output_info_supports_mode (app, outputs[i], clone_width, clone_height))
+            {
+		num_outputs_with_clone_size++;
+            }
+	}
+
+	if (num_outputs_with_clone_size >= 2)
+	    mirror_is_supported = TRUE;
+    }
+
+    return mirror_is_supported;
+}
+
+static void
+on_scale_btn_active_changed_cb (GtkWidget *widget,
+                                App       *app)
+{
+    gint scale;
+
+    if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
+        return;
+
+    scale = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), "scale"));
+    g_settings_set_int (app->scale_settings, WINDOW_SCALE_KEY, scale);
+}
+
+static void
+rebuild_scale_window (App *app)
+{
+    GtkRadioButton *group = NULL;
+    gint32          scale;
+    int             i;
+    const char     *button_label[] = {_("auto detect"), _("100%"), _("200%"), NULL};
+
+    if (app->scale_bbox != NULL)
+        return;
+
+    app->scale_bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
+    gtk_container_set_border_width (GTK_CONTAINER (app->scale_bbox), 6);
+    gtk_container_add (GTK_CONTAINER (app->scale_vbox), app->scale_bbox);
+
+    scale = g_settings_get_int (app->scale_settings, WINDOW_SCALE_KEY);
+
+    for (i = 0; button_label[i] != NULL; i++)
+    {
+        GtkWidget      *scale_btn;
+        scale_btn = gtk_radio_button_new_with_label_from_widget (group, button_label[i]);
+        if (!group)
+            group = GTK_RADIO_BUTTON (scale_btn);
+        if (i == scale)
+            gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (scale_btn), TRUE);
+
+        g_object_set_data (G_OBJECT (scale_btn),
+                          "scale",
+                           GINT_TO_POINTER (i));
+
+        g_signal_connect (scale_btn,
+                         "toggled",
+                          G_CALLBACK (on_scale_btn_active_changed_cb),
+                          app);
+        gtk_container_add (GTK_CONTAINER (app->scale_bbox), scale_btn);
+    }
+    gtk_widget_show_all (app->scale_bbox);
+}
+
+static void
+rebuild_mirror_screens (App *app)
+{
+    gboolean mirror_is_active;
+    gboolean mirror_is_supported;
+
+    g_signal_handlers_block_by_func (app->clone_checkbox, G_CALLBACK (on_clone_changed), app);
+
+    mirror_is_active = app->current_configuration && mate_rr_config_get_clone (app->current_configuration);
+
+    /* If mirror_is_active, then it *must* be possible to turn mirroring off */
+    mirror_is_supported = mirror_is_active || mirror_screens_is_supported (app);
+
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->clone_checkbox), mirror_is_active);
+    gtk_widget_set_sensitive (app->clone_checkbox, mirror_is_supported);
+
+    g_signal_handlers_unblock_by_func (app->clone_checkbox, G_CALLBACK (on_clone_changed), app);
+}
+
+static void
+set_override_color (GtkWidget  *widget,
+                    const char *style,
+                    GdkRGBA    *rgba)
+{
+  gchar          *css;
+  GtkCssProvider *provider;
+
+  provider = gtk_css_provider_new ();
+
+  css = g_strdup_printf ("* { %s: %s;}",
+                         style,
+                         gdk_rgba_to_string (rgba));
+  gtk_css_provider_load_from_data (provider, css, -1, NULL);
+  g_free (css);
+
+  gtk_style_context_add_provider (gtk_widget_get_style_context (widget),
+                                  GTK_STYLE_PROVIDER (provider),
+                                  GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+  g_object_unref (provider);
+}
+
+static void
+rebuild_current_monitor_label (App *app)
+{
+	char *str, *tmp;
+	GdkRGBA color;
+	gboolean use_color;
+
+	if (app->current_output)
+	{
+	    if (mate_rr_config_get_clone (app->current_configuration))
+		tmp = g_strdup (_("Mirror Screens"));
+	    else
+		tmp = g_strdup_printf (_("Monitor: %s"), mate_rr_output_info_get_display_name (app->current_output));
+
+	    str = g_strdup_printf ("<b>%s</b>", tmp);
+	    mate_rr_labeler_get_rgba_for_output (app->labeler, app->current_output, &color);
+	    use_color = TRUE;
+	    g_free (tmp);
+	}
+	else
+	{
+	    str = g_strdup_printf ("<b>%s</b>", _("Monitor"));
+	    use_color = FALSE;
+	}
+
+	gtk_label_set_markup (GTK_LABEL (app->current_monitor_label), str);
+	g_free (str);
+
+	if (use_color)
+	{
+	    GdkRGBA black = { 0, 0, 0, 1.0 };
+
+	    set_override_color (app->current_monitor_event_box, "background-color", &color);
+	    set_override_color (app->current_monitor_label, "color", &black);
+	}
+
+	gtk_event_box_set_visible_window (GTK_EVENT_BOX (app->current_monitor_event_box), use_color);
+}
+
+static void
+rebuild_on_off_radios (App *app)
+{
+    gboolean sensitive;
+    gboolean on_active;
+    gboolean off_active;
+
+    g_signal_handlers_block_by_func (app->monitor_on_radio, G_CALLBACK (monitor_on_off_toggled_cb), app);
+    g_signal_handlers_block_by_func (app->monitor_off_radio, G_CALLBACK (monitor_on_off_toggled_cb), app);
+
+    sensitive = FALSE;
+    on_active = FALSE;
+    off_active = FALSE;
+
+    if (!mate_rr_config_get_clone (app->current_configuration) && app->current_output)
+    {
+	if (count_active_outputs (app) > 1 || !mate_rr_output_info_is_active (app->current_output))
+	    sensitive = TRUE;
+	else
+	    sensitive = FALSE;
+
+	on_active = mate_rr_output_info_is_active (app->current_output);
+	off_active = !on_active;
+    }
+
+    gtk_widget_set_sensitive (app->monitor_on_radio, sensitive);
+    gtk_widget_set_sensitive (app->monitor_off_radio, sensitive);
+
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->monitor_on_radio), on_active);
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->monitor_off_radio), off_active);
+
+    g_signal_handlers_unblock_by_func (app->monitor_on_radio, G_CALLBACK (monitor_on_off_toggled_cb), app);
+    g_signal_handlers_unblock_by_func (app->monitor_off_radio, G_CALLBACK (monitor_on_off_toggled_cb), app);
+}
+
+static char *
+make_resolution_string (guint width,
+                        guint height)
+{
+    return g_strdup_printf (_("%u x %u"), width, height);
+}
+
+static void
+find_best_mode (MateRRMode **modes,
+                guint       *out_width,
+                guint       *out_height)
+{
+    guint i;
+
+    *out_width = 0;
+    *out_height = 0;
+
+    for (i = 0; modes[i] != NULL; i++)
+    {
+        guint w, h;
+
+        w = mate_rr_mode_get_width (modes[i]);
+        h = mate_rr_mode_get_height (modes[i]);
+
+        if ((w * h) > ((*out_width) * (*out_height)))
+        {
+            *out_width = w;
+            *out_height = h;
+        }
+    }
+}
+
+static void
+rebuild_resolution_combo (App *app)
+{
+    guint i;
+    MateRRMode **modes;
+    const char *current;
+    int output_width, output_height;
+
+    clear_combo (app->resolution_combo);
+
+    if (!(modes = get_current_modes (app))
+	|| !app->current_output
+	|| !mate_rr_output_info_is_active (app->current_output))
+    {
+	gtk_widget_set_sensitive (app->resolution_combo, FALSE);
+	return;
+    }
+
+    g_assert (app->current_output != NULL);
+
+    mate_rr_output_info_get_geometry (app->current_output, NULL, NULL, &output_width, &output_height);
+    g_assert (output_width != 0 && output_height != 0);
+
+    gtk_widget_set_sensitive (app->resolution_combo, TRUE);
+
+    for (i = 0; modes[i] != NULL; ++i)
+    {
+        guint width, height;
+
+        width = mate_rr_mode_get_width (modes[i]);
+        height = mate_rr_mode_get_height (modes[i]);
+
+        add_key (app->resolution_combo,
+                 idle_free (make_resolution_string (width, height)),
+                 width, height, 0, -1);
+    }
+
+    current = idle_free (make_resolution_string ((guint) output_width, (guint) output_height));
+
+    if (!combo_select (app->resolution_combo, current))
+    {
+        guint best_w, best_h;
+
+        find_best_mode (modes, &best_w, &best_h);
+        combo_select (app->resolution_combo, idle_free (make_resolution_string (best_w, best_h)));
+    }
+}
+
+static void
+rebuild_gui (App *app)
+{
+    gboolean sensitive;
+
+    /* We would break spectacularly if we recursed, so
+     * just assert if that happens
+     */
+    g_assert (app->ignore_gui_changes == FALSE);
+
+    app->ignore_gui_changes = TRUE;
+
+    sensitive = app->current_output ? TRUE : FALSE;
+
+#if 0
+    g_debug ("rebuild gui, is on: %d", mate_rr_output_info_is_active (app->current_output));
+#endif
+
+    rebuild_mirror_screens (app);
+    rebuild_scale_window (app);
+    rebuild_current_monitor_label (app);
+    rebuild_on_off_radios (app);
+    rebuild_resolution_combo (app);
+    rebuild_rate_combo (app);
+    rebuild_rotation_combo (app);
+
+#if 0
+    g_debug ("sensitive: %d, on: %d", sensitive, mate_rr_output_info_is_active (app->current_output));
+#endif
+    gtk_widget_set_sensitive (app->panel_checkbox, sensitive);
+
+    gtk_widget_set_sensitive (app->primary_button, app->current_output && !mate_rr_output_info_get_primary(app->current_output));
+
+    app->ignore_gui_changes = FALSE;
+}
+
+static gboolean
+get_mode (GtkWidget *widget, int *width, int *height, int *freq, MateRRRotation *rot)
+{
+    GtkTreeIter iter;
+    GtkTreeModel *model;
+    GtkComboBox *box = GTK_COMBO_BOX (widget);
+    int dummy;
+
+    if (!gtk_combo_box_get_active_iter (box, &iter))
+	return FALSE;
+
+    if (!width)
+	width = &dummy;
+
+    if (!height)
+	height = &dummy;
+
+    if (!freq)
+	freq = &dummy;
+
+    if (!rot)
+	rot = (MateRRRotation *)&dummy;
+
+    model = gtk_combo_box_get_model (box);
+    gtk_tree_model_get (model, &iter,
+			1, width,
+			2, height,
+			3, freq,
+			5, rot,
+			-1);
+
+    return TRUE;
+
+}
+
+static void
+on_rotation_changed (GtkComboBox *box, gpointer data)
+{
+    App *app = data;
+    MateRRRotation rotation;
+
+    if (!app->current_output)
+	return;
+
+    if (get_mode (app->rotation_combo, NULL, NULL, NULL, &rotation))
+	mate_rr_output_info_set_rotation (app->current_output, rotation);
+
+    foo_scroll_area_invalidate (FOO_SCROLL_AREA (app->area));
+}
+
+static void
+on_rate_changed (GtkComboBox *box, gpointer data)
+{
+    App *app = data;
+    int rate;
+
+    if (!app->current_output)
+	return;
+
+    if (get_mode (app->refresh_combo, NULL, NULL, &rate, NULL))
+	mate_rr_output_info_set_refresh_rate (app->current_output, rate);
+
+    foo_scroll_area_invalidate (FOO_SCROLL_AREA (app->area));
+}
+
+static void
+select_resolution_for_current_output (App *app)
+{
+    MateRRMode **modes;
+    int width, height;
+    guint best_w, best_h;
+    int x, y;
+
+    mate_rr_output_info_get_geometry (app->current_output, &x, &y, NULL, NULL);
+
+    width = mate_rr_output_info_get_preferred_width (app->current_output);
+    height = mate_rr_output_info_get_preferred_height (app->current_output);
+
+    if (width != 0 && height != 0)
+    {
+	mate_rr_output_info_set_geometry (app->current_output, x, y, width, height);
+	return;
+    }
+
+    modes = get_current_modes (app);
+    if (!modes)
+	return;
+
+    find_best_mode (modes, &best_w, &best_h);
+    mate_rr_output_info_set_geometry (app->current_output, x, y, (int) best_w, (int) best_w);
+}
+
+static void
+monitor_on_off_toggled_cb (GtkToggleButton *toggle, gpointer data)
+{
+    App *app = data;
+    gboolean is_on;
+
+    if (!app->current_output)
+	return;
+
+    if (!gtk_toggle_button_get_active (toggle))
+	return;
+
+    if (GTK_WIDGET (toggle) == app->monitor_on_radio)
+	is_on = TRUE;
+    else if (GTK_WIDGET (toggle) == app->monitor_off_radio)
+	is_on = FALSE;
+    else
+    {
+	g_assert_not_reached ();
+	return;
+    }
+
+    mate_rr_output_info_set_active (app->current_output, is_on);
+
+    if (is_on)
+	select_resolution_for_current_output (app); /* The refresh rate will be picked in rebuild_rate_combo() */
+
+    rebuild_gui (app);
+    foo_scroll_area_invalidate (FOO_SCROLL_AREA (app->area));
+}
+
+static void
+realign_outputs_after_resolution_change (App *app, MateRROutputInfo *output_that_changed, int old_width, int old_height)
+{
+    /* We find the outputs that were below or to the right of the output that
+     * changed, and realign them; we also do that for outputs that shared the
+     * right/bottom edges with the output that changed.  The outputs that are
+     * above or to the left of that output don't need to change.
+     */
+
+    int i;
+    int old_right_edge, old_bottom_edge;
+    int dx, dy;
+    int x, y, width, height;
+    MateRROutputInfo **outputs;
+
+    g_assert (app->current_configuration != NULL);
+
+    mate_rr_output_info_get_geometry (output_that_changed, &x, &y, &width, &height);
+    if (width == old_width && height == old_height)
+	return;
+
+    old_right_edge = x + old_width;
+    old_bottom_edge = y + old_height;
+
+    dx = width - old_width;
+    dy = height - old_height;
+
+    outputs = mate_rr_config_get_outputs (app->current_configuration);
+
+    for (i = 0; outputs[i] != NULL; i++)
+      {
+        int output_x, output_y;
+	int output_width, output_height;
+
+	if (outputs[i] == output_that_changed || mate_rr_output_info_is_connected (outputs[i]))
+	  continue;
+
+	mate_rr_output_info_get_geometry (outputs[i], &output_x, &output_y, &output_width, &output_height);
+
+	if (output_x >= old_right_edge)
+	  output_x += dx;
+	else if (output_x + output_width == old_right_edge)
+	  output_x = x + width - output_width;
+
+	if (output_y >= old_bottom_edge)
+	    output_y += dy;
+	else if (output_y + output_height == old_bottom_edge)
+	    output_y = y + height - output_height;
+
+	mate_rr_output_info_set_geometry (outputs[i], output_x, output_y, output_width, output_height);
+    }
+}
+
+static void
+on_resolution_changed (GtkComboBox *box, gpointer data)
+{
+    App *app = data;
+    int old_width, old_height;
+    int x, y;
+    int width;
+    int height;
+
+    if (!app->current_output)
+	return;
+
+    mate_rr_output_info_get_geometry (app->current_output, &x, &y, &old_width, &old_height);
+
+    if (get_mode (app->resolution_combo, &width, &height, NULL, NULL))
+    {
+	mate_rr_output_info_set_geometry (app->current_output, x, y, width, height);
+
+	if (width == 0 || height == 0)
+	    mate_rr_output_info_set_active (app->current_output, FALSE);
+	else
+	    mate_rr_output_info_set_active (app->current_output, TRUE);
+    }
+
+    realign_outputs_after_resolution_change (app, app->current_output, old_width, old_height);
+
+    rebuild_rate_combo (app);
+    rebuild_rotation_combo (app);
+
+    foo_scroll_area_invalidate (FOO_SCROLL_AREA (app->area));
+}
+
+static void
+lay_out_outputs_horizontally (App *app)
+{
+    int i;
+    int x;
+    MateRROutputInfo **outputs;
+
+    /* Lay out all the monitors horizontally when "mirror screens" is turned
+     * off, to avoid having all of them overlapped initially.  We put the
+     * outputs turned off on the right-hand side.
+     */
+
+    x = 0;
+
+    /* First pass, all "on" outputs */
+    outputs = mate_rr_config_get_outputs (app->current_configuration);
+
+    for (i = 0; outputs[i]; ++i)
+    {
+	int width, height;
+	if (mate_rr_output_info_is_connected (outputs[i]) &&mate_rr_output_info_is_active (outputs[i]))
+	{
+	    mate_rr_output_info_get_geometry (outputs[i], NULL, NULL, &width, &height);
+	    mate_rr_output_info_set_geometry (outputs[i], x, 0, width, height);
+	    x += width;
+	}
+    }
+
+    /* Second pass, all the black screens */
+
+    for (i = 0; outputs[i]; ++i)
+    {
+	int width, height;
+	if (!(mate_rr_output_info_is_connected (outputs[i]) && mate_rr_output_info_is_active (outputs[i])))
+	  {
+	    mate_rr_output_info_get_geometry (outputs[i], NULL, NULL, &width, &height);
+	    mate_rr_output_info_set_geometry (outputs[i], x, 0, width, height);
+	    x += width;
+	}
+    }
+
+}
+
+static void
+on_clone_changed (GtkWidget *box, gpointer data)
+{
+    App *app = data;
+
+    mate_rr_config_set_clone (app->current_configuration, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (app->clone_checkbox)));
+
+    if (mate_rr_config_get_clone (app->current_configuration)) {
+        guint i;
+        guint width;
+        guint height;
+        MateRROutputInfo **outputs = mate_rr_config_get_outputs (app->current_configuration);
+
+        for (i = 0; outputs[i]; ++i) {
+            if (mate_rr_output_info_is_connected(outputs[i])) {
+                app->current_output = outputs[i];
+                break;
+            }
+        }
+
+        /* Turn on all the connected screens that support the best clone mode.
+         * The user may hit "Mirror Screens", but he shouldn't have to turn on
+         * all the required outputs as well.
+         */
+
+        get_clone_size (app->screen, &width, &height);
+
+        for (i = 0; outputs[i]; i++) {
+            int x, y;
+
+            if (output_info_supports_mode (app, outputs[i], width, height)) {
+                mate_rr_output_info_set_active (outputs[i], TRUE);
+                mate_rr_output_info_get_geometry (outputs[i], &x, &y, NULL, NULL);
+                mate_rr_output_info_set_geometry (outputs[i], x, y, (int) width, (int) height);
+            }
+	}
+    } else {
+	if (output_overlaps (app->current_output, app->current_configuration))
+            lay_out_outputs_horizontally (app);
+    }
+
+    rebuild_gui (app);
+}
+
+#define SPACE 15
+#define MARGIN  15
+
+static void
+get_geometry (MateRROutputInfo *output,
+              int              *w,
+              int              *h)
+{
+    MateRRRotation rotation;
+
+    if (mate_rr_output_info_is_active (output)) {
+        mate_rr_output_info_get_geometry (output, NULL, NULL, w, h);
+    } else {
+        *h = mate_rr_output_info_get_preferred_height (output);
+        *w = mate_rr_output_info_get_preferred_width (output);
+    }
+   rotation = mate_rr_output_info_get_rotation (output);
+   if ((rotation & MATE_RR_ROTATION_90) ||
+       (rotation & MATE_RR_ROTATION_270)) {
+        int tmp;
+        tmp = *h;
+        *h = *w;
+        *w = tmp;
+   }
+}
+
+static GList *
+list_connected_outputs (App   *app,
+                        int   *total_w,
+                        int   *total_h)
+{
+    guint i;
+    int dummy;
+    GList *result = NULL;
+    MateRROutputInfo **outputs;
+
+    if (!total_w)
+        total_w = &dummy;
+    if (!total_h)
+        total_h = &dummy;
+
+    *total_w = 0;
+    *total_h = 0;
+
+    outputs = mate_rr_config_get_outputs(app->current_configuration);
+    for (i = 0; outputs[i] != NULL; ++i) {
+        if (mate_rr_output_info_is_connected (outputs[i])) {
+            int w, h;
+
+            result = g_list_prepend (result, outputs[i]);
+
+            get_geometry (outputs[i], &w, &h);
+
+            *total_w += w;
+            *total_h += h;
+        }
+    }
+
+    return g_list_reverse (result);
+}
+
+static guint
+get_n_connected (App *app)
+{
+    GList *connected_outputs = list_connected_outputs (app, NULL, NULL);
+    guint n = g_list_length (connected_outputs);
+
+    g_list_free (connected_outputs);
+
+    return n;
+}
+
+static double
+compute_scale (App *app)
+{
+    int available_w, available_h;
+    int total_w, total_h;
+    guint n_monitors;
+    GdkRectangle viewport;
+    GList *connected_outputs;
+
+    foo_scroll_area_get_viewport (FOO_SCROLL_AREA (app->area), &viewport);
+
+    connected_outputs = list_connected_outputs (app, &total_w, &total_h);
+
+    n_monitors = g_list_length (connected_outputs);
+
+    g_list_free (connected_outputs);
+
+    available_w = viewport.width  - 2 * MARGIN - ((int) n_monitors - 1) * SPACE;
+    available_h = viewport.height - 2 * MARGIN - ((int) n_monitors - 1) * SPACE;
+
+    return MIN ((double)available_w / total_w, (double)available_h / total_h);
+}
+
+typedef struct Edge
+{
+    MateRROutputInfo *output;
+    int x1, y1;
+    int x2, y2;
+} Edge;
+
+typedef struct Snap
+{
+    Edge *snapper;		/* Edge that should be snapped */
+    Edge *snappee;
+    int dy, dx;
+} Snap;
+
+static void
+add_edge (MateRROutputInfo *output, int x1, int y1, int x2, int y2, GArray *edges)
+{
+    Edge e;
+
+    e.x1 = x1;
+    e.x2 = x2;
+    e.y1 = y1;
+    e.y2 = y2;
+    e.output = output;
+
+    g_array_append_val (edges, e);
+}
+
+static void
+list_edges_for_output (MateRROutputInfo *output, GArray *edges)
+{
+    int x, y, w, h;
+
+    mate_rr_output_info_get_geometry (output, &x, &y, &w, &h);
+    get_geometry (output, &w, &h); /* accounts for rotation */
+
+    /* Top, Bottom, Left, Right */
+    add_edge (output, x, y, x + w, y, edges);
+    add_edge (output, x, y + h, x + w, y + h, edges);
+    add_edge (output, x, y, x, y + h, edges);
+    add_edge (output, x + w, y, x + w, y + h, edges);
+}
+
+static void
+list_edges (MateRRConfig *config, GArray *edges)
+{
+    int i;
+    MateRROutputInfo **outputs = mate_rr_config_get_outputs (config);
+
+    for (i = 0; outputs[i]; ++i)
+    {
+	if (mate_rr_output_info_is_connected (outputs[i]))
+	    list_edges_for_output (outputs[i], edges);
+    }
+}
+
+static gboolean
+overlap (int s1, int e1, int s2, int e2)
+{
+    return (!(e1 < s2 || s1 >= e2));
+}
+
+static gboolean
+horizontal_overlap (Edge *snapper, Edge *snappee)<--- Parameter 'snapper' can be declared as pointer to const<--- Parameter 'snappee' can be declared as pointer to const
+{
+    if (snapper->y1 != snapper->y2 || snappee->y1 != snappee->y2)
+	return FALSE;
+
+    return overlap (snapper->x1, snapper->x2, snappee->x1, snappee->x2);
+}
+
+static gboolean
+vertical_overlap (Edge *snapper, Edge *snappee)<--- Parameter 'snapper' can be declared as pointer to const<--- Parameter 'snappee' can be declared as pointer to const
+{
+    if (snapper->x1 != snapper->x2 || snappee->x1 != snappee->x2)
+	return FALSE;
+
+    return overlap (snapper->y1, snapper->y2, snappee->y1, snappee->y2);
+}
+
+static void
+add_snap (GArray *snaps, Snap snap)
+{
+    if (ABS (snap.dx) <= 200 || ABS (snap.dy) <= 200)
+	g_array_append_val (snaps, snap);
+}
+
+static void
+add_edge_snaps (Edge *snapper, Edge *snappee, GArray *snaps)
+{
+    Snap snap;
+
+    snap.snapper = snapper;
+    snap.snappee = snappee;
+
+    if (horizontal_overlap (snapper, snappee))
+    {
+	snap.dx = 0;
+	snap.dy = snappee->y1 - snapper->y1;
+
+	add_snap (snaps, snap);
+    }
+    else if (vertical_overlap (snapper, snappee))
+    {
+	snap.dy = 0;
+	snap.dx = snappee->x1 - snapper->x1;
+
+	add_snap (snaps, snap);
+    }
+
+    /* Corner snaps */
+    /* 1->1 */
+    snap.dx = snappee->x1 - snapper->x1;
+    snap.dy = snappee->y1 - snapper->y1;
+
+    add_snap (snaps, snap);
+
+    /* 1->2 */
+    snap.dx = snappee->x2 - snapper->x1;
+    snap.dy = snappee->y2 - snapper->y1;
+
+    add_snap (snaps, snap);
+
+    /* 2->2 */
+    snap.dx = snappee->x2 - snapper->x2;
+    snap.dy = snappee->y2 - snapper->y2;
+
+    add_snap (snaps, snap);
+
+    /* 2->1 */
+    snap.dx = snappee->x1 - snapper->x2;
+    snap.dy = snappee->y1 - snapper->y2;
+
+    add_snap (snaps, snap);
+}
+
+static void
+list_snaps (MateRROutputInfo *output, GArray *edges, GArray *snaps)<--- Parameter 'output' can be declared as pointer to const
+{
+    guint i;
+
+    for (i = 0; i < edges->len; ++i) {
+        Edge *output_edge = &(g_array_index (edges, Edge, i));
+
+        if (output_edge->output == output) {
+            guint j;
+
+            for (j = 0; j < edges->len; ++j) {
+                Edge *edge = &(g_array_index (edges, Edge, j));
+
+                if (edge->output != output)
+		    add_edge_snaps (output_edge, edge, snaps);
+            }
+        }
+    }
+}
+
+#if 0
+static void
+print_edge (Edge *edge)
+{
+    g_debug ("(%d %d %d %d)", edge->x1, edge->y1, edge->x2, edge->y2);
+}
+#endif
+
+static gboolean
+corner_on_edge (int x, int y, Edge *e)<--- Parameter 'e' can be declared as pointer to const
+{
+    if (x == e->x1 && x == e->x2 && y >= e->y1 && y <= e->y2)
+	return TRUE;
+
+    if (y == e->y1 && y == e->y2 && x >= e->x1 && x <= e->x2)
+	return TRUE;
+
+    return FALSE;
+}
+
+static gboolean
+edges_align (Edge *e1, Edge *e2)
+{
+    if (corner_on_edge (e1->x1, e1->y1, e2))
+	return TRUE;
+
+    if (corner_on_edge (e2->x1, e2->y1, e1))
+	return TRUE;
+
+    return FALSE;
+}
+
+static gboolean
+output_is_aligned (MateRROutputInfo *output, GArray *edges)<--- Parameter 'output' can be declared as pointer to const
+{
+    gboolean result = FALSE;
+    guint i;
+
+    for (i = 0; i < edges->len; ++i) {
+        Edge *output_edge = &(g_array_index (edges, Edge, i));
+
+        if (output_edge->output == output) {
+            guint j;
+
+	    for (j = 0; j < edges->len; ++j) {
+                Edge *edge = &(g_array_index (edges, Edge, j));
+
+                /* We are aligned if an output edge matches
+                 * an edge of another output
+                 */
+                if ((edge->output != output_edge->output) &&
+                    edges_align (output_edge, edge)) {
+                    result = TRUE;
+                    goto done;
+                }
+            }
+        }
+    }
+done:
+
+    return result;
+}
+
+static void
+get_output_rect (MateRROutputInfo *output, GdkRectangle *rect)
+{
+    mate_rr_output_info_get_geometry (output, &rect->x, &rect->y, &rect->width, &rect->height);
+    get_geometry (output, &rect->width, &rect->height); /* accounts for rotation */
+}
+
+static gboolean
+output_overlaps (MateRROutputInfo *output, MateRRConfig *config)
+{
+    int i;
+    GdkRectangle output_rect;
+    MateRROutputInfo **outputs;
+
+    get_output_rect (output, &output_rect);
+
+    outputs = mate_rr_config_get_outputs (config);
+    for (i = 0; outputs[i]; ++i)
+    {
+	if (outputs[i] != output && mate_rr_output_info_is_connected (outputs[i]))
+	{
+	    GdkRectangle other_rect;
+
+	    get_output_rect (outputs[i], &other_rect);
+	    if (gdk_rectangle_intersect (&output_rect, &other_rect, NULL))
+		return TRUE;
+	}
+    }
+
+    return FALSE;
+}
+
+static gboolean
+mate_rr_config_is_aligned (MateRRConfig *config, GArray *edges)
+{
+    int i;
+    gboolean result = TRUE;
+    MateRROutputInfo **outputs;
+
+    outputs = mate_rr_config_get_outputs(config);
+    for (i = 0; outputs[i]; ++i)
+    {
+	if (mate_rr_output_info_is_connected (outputs[i]))
+	{
+	    if (!output_is_aligned (outputs[i], edges))
+		return FALSE;
+
+	    if (output_overlaps (outputs[i], config))
+		return FALSE;
+	}
+    }
+
+    return result;
+}
+
+struct GrabInfo
+{
+    int grab_x;
+    int grab_y;
+    int output_x;
+    int output_y;
+};
+
+static gboolean
+is_corner_snap (const Snap *s)
+{
+    return s->dx != 0 && s->dy != 0;
+}
+
+static int
+compare_snaps (gconstpointer v1, gconstpointer v2)
+{
+    const Snap *s1 = v1;
+    const Snap *s2 = v2;
+    int sv1 = MAX (ABS (s1->dx), ABS (s1->dy));
+    int sv2 = MAX (ABS (s2->dx), ABS (s2->dy));
+    int d;
+
+    d = sv1 - sv2;
+
+    /* This snapping algorithm is good enough for rock'n'roll, but
+     * this is probably a better:
+     *
+     *    First do a horizontal/vertical snap, then
+     *    with the new coordinates from that snap,
+     *    do a corner snap.
+     *
+     * Right now, it's confusing that corner snapping
+     * depends on the distance in an axis that you can't actually see.
+     *
+     */
+    if (d == 0)
+    {
+	if (is_corner_snap (s1) && !is_corner_snap (s2))
+	    return -1;
+	else if (is_corner_snap (s2) && !is_corner_snap (s1))
+	    return 1;
+	else
+	    return 0;
+    }
+    else
+    {
+	return d;
+    }
+}
+
+/* Sets a mouse cursor for a widget's window.  As a hack, you can pass
+ * GDK_BLANK_CURSOR to mean "set the cursor to NULL" (i.e. reset the widget's
+ * window's cursor to its default).
+ */
+static void
+set_cursor (GtkWidget *widget, GdkCursorType type)
+{
+	GdkCursor *cursor;
+	GdkWindow *window;
+
+	if (type == GDK_BLANK_CURSOR)
+	    cursor = NULL;
+	else
+	    cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget), type);
+
+	window = gtk_widget_get_window (widget);
+
+	if (window)
+	    gdk_window_set_cursor (window, cursor);
+
+	if (cursor)
+	    g_object_unref (cursor);
+}
+
+static void
+set_monitors_tooltip (App *app, gboolean is_dragging)
+{
+    const char *text;
+
+    if (is_dragging)
+	text = NULL;
+    else
+	text = _("Select a monitor to change its properties; drag it to rearrange its placement.");
+
+    gtk_widget_set_tooltip_text (app->area, text);
+}
+
+static void
+on_output_event (FooScrollArea      *area,
+                 FooScrollAreaEvent *event,<--- Parameter 'event' can be declared as pointer to const
+                 gpointer            data)
+{
+    MateRROutputInfo *output = data;
+    App *app = g_object_get_data (G_OBJECT (area), "app");
+
+    /* If the mouse is inside the outputs, set the cursor to "you can move me".  See
+     * on_canvas_event() for where we reset the cursor to the default if it
+     * exits the outputs' area.
+     */
+    if (!mate_rr_config_get_clone (app->current_configuration) && get_n_connected (app) > 1)
+	set_cursor (GTK_WIDGET (area), GDK_FLEUR);
+
+    if (event->type == FOO_BUTTON_PRESS)
+    {
+	GrabInfo *info;
+
+	app->current_output = output;
+
+	rebuild_gui (app);
+	set_monitors_tooltip (app, TRUE);
+
+	if (!mate_rr_config_get_clone (app->current_configuration) && get_n_connected (app) > 1)
+	{
+	    int output_x, output_y;
+	    mate_rr_output_info_get_geometry (output, &output_x, &output_y, NULL, NULL);
+
+	    foo_scroll_area_begin_grab (area, on_output_event, data);
+
+	    info = g_new0 (GrabInfo, 1);
+	    info->grab_x = event->x;
+	    info->grab_y = event->y;
+	    info->output_x = output_x;
+	    info->output_y = output_y;
+
+	    g_object_set_data (G_OBJECT (output), "grab-info", info);
+	}
+
+	foo_scroll_area_invalidate (area);
+    }
+    else
+    {
+	if (foo_scroll_area_is_grabbed (area))
+	{
+	    GrabInfo *info = g_object_get_data (G_OBJECT (output), "grab-info");
+	    double scale = compute_scale (app);
+	    int old_x, old_y;
+	    int width, height;
+	    int new_x, new_y;
+	    guint i;
+	    GArray *edges, *snaps, *new_edges;<--- Shadowed declaration
+
+	    mate_rr_output_info_get_geometry (output, &old_x, &old_y, &width, &height);
+	    new_x = info->output_x + (int) ((double)(event->x - info->grab_x) / scale);
+	    new_y = info->output_y + (int) ((double)(event->y - info->grab_y) / scale);
+
+	    mate_rr_output_info_set_geometry (output, new_x, new_y, width, height);
+
+	    edges = g_array_new (TRUE, TRUE, sizeof (Edge));
+	    snaps = g_array_new (TRUE, TRUE, sizeof (Snap));
+	    new_edges = g_array_new (TRUE, TRUE, sizeof (Edge));
+
+	    list_edges (app->current_configuration, edges);
+	    list_snaps (output, edges, snaps);
+
+	    g_array_sort (snaps, compare_snaps);
+
+	    mate_rr_output_info_set_geometry (output, new_x, new_y, width, height);
+
+	    for (i = 0; i < snaps->len; ++i)
+	    {
+		Snap *snap = &(g_array_index (snaps, Snap, i));<--- Variable 'snap' can be declared as pointer to const
+		GArray *new_edges = g_array_new (TRUE, TRUE, sizeof (Edge));<--- Shadow variable
+
+		mate_rr_output_info_set_geometry (output, new_x + snap->dx, new_y + snap->dy, width, height);
+
+		g_array_set_size (new_edges, 0);
+		list_edges (app->current_configuration, new_edges);
+
+		if (mate_rr_config_is_aligned (app->current_configuration, new_edges))
+		{
+		    g_array_free (new_edges, TRUE);
+		    break;
+		}
+		else
+		{
+		    mate_rr_output_info_set_geometry (output, info->output_x, info->output_y, width, height);
+		}
+	    }
+
+	    g_array_free (new_edges, TRUE);
+	    g_array_free (snaps, TRUE);
+	    g_array_free (edges, TRUE);
+
+	    if (event->type == FOO_BUTTON_RELEASE)
+	    {
+		foo_scroll_area_end_grab (area);
+		set_monitors_tooltip (app, FALSE);
+
+		g_free (g_object_get_data (G_OBJECT (output), "grab-info"));
+		g_object_set_data (G_OBJECT (output), "grab-info", NULL);
+
+#if 0
+		g_debug ("new position: %d %d %d %d", output->x, output->y, output->width, output->height);
+#endif
+	    }
+
+	    foo_scroll_area_invalidate (area);
+	}
+    }
+}
+
+static void
+on_canvas_event (FooScrollArea *area,
+		 FooScrollAreaEvent *event,
+		 gpointer data)
+{
+    /* If the mouse exits the outputs, reset the cursor to the default.  See
+     * on_output_event() for where we set the cursor to the movement cursor if
+     * it is over one of the outputs.
+     */
+    set_cursor (GTK_WIDGET (area), GDK_BLANK_CURSOR);
+}
+
+static PangoLayout *
+get_display_name (App *app,
+		  MateRROutputInfo *output)
+{
+    char *text;
+    PangoLayout * layout;
+
+    if (mate_rr_config_get_clone (app->current_configuration)) {
+    /* Translators:  this is the feature where what you see on your laptop's
+     * screen is the same as your external monitor.  Here, "Mirror" is being
+     * used as an adjective, not as a verb.  For example, the Spanish
+     * translation could be "Pantallas en Espejo", *not* "Espejar Pantallas".
+     */
+        text = g_strdup_printf (_("Mirror Screens"));
+    }
+    else {
+        text = g_strdup_printf ("<b>%s</b>\n<small>%s</small>", mate_rr_output_info_get_display_name (output), mate_rr_output_info_get_name (output));
+    }
+    layout = gtk_widget_create_pango_layout (GTK_WIDGET (app->area), text);
+    pango_layout_set_markup (layout, text, -1);
+    g_free (text);
+    pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER);
+    return layout;
+}
+
+static void
+paint_background (FooScrollArea *area,
+		  cairo_t       *cr)
+{
+    GdkRectangle viewport;
+    GtkWidget *widget;
+    GtkStyleContext *widget_style;
+    GdkRGBA *base_color = NULL;
+    GdkRGBA dark_color;
+
+    widget = GTK_WIDGET (area);
+
+    foo_scroll_area_get_viewport (area, &viewport);
+
+    widget_style = gtk_widget_get_style_context (widget);
+
+    gtk_style_context_save (widget_style);
+    gtk_style_context_set_state (widget_style, GTK_STATE_FLAG_SELECTED);
+    gtk_style_context_get (widget_style,
+                           gtk_style_context_get_state (widget_style),
+                           GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &base_color,
+                           NULL);
+    gtk_style_context_restore (widget_style);
+    gdk_cairo_set_source_rgba(cr, base_color);
+    gdk_rgba_free (base_color);
+
+    cairo_rectangle (cr,
+		     viewport.x, viewport.y,
+		     viewport.width, viewport.height);
+
+    cairo_fill_preserve (cr);
+
+    foo_scroll_area_add_input_from_fill (area, cr, on_canvas_event, NULL);
+
+    gtk_style_context_save (widget_style);
+    gtk_style_context_set_state (widget_style, GTK_STATE_FLAG_SELECTED);
+    mate_desktop_gtk_style_get_dark_color (widget_style,
+                                           gtk_style_context_get_state (widget_style),
+                                           &dark_color);
+    gtk_style_context_restore (widget_style);
+    gdk_cairo_set_source_rgba (cr, &dark_color);
+
+    cairo_stroke (cr);
+}
+
+static void
+paint_output (App     *app,
+              cairo_t *cr,
+              guint    i)
+{
+    int w, h;
+    double scale = compute_scale (app);
+    double x, y;
+    int output_x, output_y;
+    MateRRRotation rotation;
+    int total_w, total_h;
+    GList *connected_outputs = list_connected_outputs (app, &total_w, &total_h);
+    MateRROutputInfo *output = g_list_nth_data (connected_outputs, i);
+    PangoLayout *layout = get_display_name (app, output);
+    PangoRectangle ink_extent, log_extent;
+    GdkRectangle viewport;
+    GdkRGBA output_color;
+    double r, g, b;
+    double available_w;
+    double factor;
+
+    cairo_save (cr);
+
+    foo_scroll_area_get_viewport (FOO_SCROLL_AREA (app->area), &viewport);
+
+    get_geometry (output, &w, &h);
+
+#if 0
+    g_debug ("%s (%p) geometry %d %d %d", output->name, output,
+	     w, h, output->rate);
+#endif
+
+    viewport.height -= 2 * MARGIN;
+    viewport.width -= 2 * MARGIN;
+
+    mate_rr_output_info_get_geometry (output, &output_x, &output_y, NULL, NULL);
+    x = output_x * scale + MARGIN + (viewport.width - total_w * scale) / 2.0;
+    y = output_y * scale + MARGIN + (viewport.height - total_h * scale) / 2.0;
+
+#if 0
+    g_debug ("scaled: %f %f", x, y);
+
+    g_debug ("scale: %f", scale);
+
+    g_debug ("%f %f %f %f", x, y, w * scale + 0.5, h * scale + 0.5);
+#endif
+
+    cairo_translate (cr,
+		     x + (w * scale + 0.5) / 2,
+		     y + (h * scale + 0.5) / 2);
+
+    /* rotation is already applied in get_geometry */
+
+    rotation = mate_rr_output_info_get_rotation (output);
+    if (rotation & MATE_RR_REFLECT_X)
+	cairo_scale (cr, -1, 1);
+
+    if (rotation & MATE_RR_REFLECT_Y)
+	cairo_scale (cr, 1, -1);
+
+    cairo_translate (cr,
+		     - x - (w * scale + 0.5) / 2,
+		     - y - (h * scale + 0.5) / 2);
+
+    cairo_rectangle (cr, x, y, w * scale + 0.5, h * scale + 0.5);
+    cairo_clip_preserve (cr);
+
+    mate_rr_labeler_get_rgba_for_output (app->labeler, output, &output_color);
+    r = output_color.red;
+    g = output_color.green;
+    b = output_color.blue;
+
+    if (!mate_rr_output_info_is_active (output))
+    {
+	/* If the output is turned off, just darken the selected color */
+	r *= 0.2;
+	g *= 0.2;
+	b *= 0.2;
+    }
+
+    cairo_set_source_rgba (cr, r, g, b, 1.0);
+
+    foo_scroll_area_add_input_from_fill (FOO_SCROLL_AREA (app->area),
+					 cr, on_output_event, output);<--- You might need to cast the function pointer here
+    cairo_fill (cr);
+
+    if (output == app->current_output)
+    {
+	cairo_rectangle (cr, x + 2, y + 2, w * scale + 0.5 - 4, h * scale + 0.5 - 4);
+
+	cairo_set_line_width (cr, 4);
+	cairo_set_source_rgba (cr, 0.33, 0.43, 0.57, 1.0);
+	cairo_stroke (cr);
+    }
+
+    cairo_rectangle (cr, x + 0.5, y + 0.5, w * scale + 0.5 - 1, h * scale + 0.5 - 1);
+
+    cairo_set_line_width (cr, 1);
+    cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 1.0);
+
+    cairo_stroke (cr);
+    cairo_set_line_width (cr, 2);
+
+    layout_set_font (layout, "Sans 12");
+    pango_layout_get_pixel_extents (layout, &ink_extent, &log_extent);
+
+    available_w = w * scale + 0.5 - 6; /* Same as the inner rectangle's width, minus 1 pixel of padding on each side */
+    if (available_w < ink_extent.width)
+	factor = available_w / ink_extent.width;
+    else
+	factor = 1.0;
+
+    cairo_move_to (cr,
+		   x + ((w * scale + 0.5) - factor * log_extent.width) / 2,
+		   y + ((h * scale + 0.5) - factor * log_extent.height) / 2);
+
+    cairo_scale (cr, factor, factor);
+
+    if (mate_rr_output_info_is_active (output))
+	cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
+    else
+	cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
+
+    pango_cairo_show_layout (cr, layout);
+
+    cairo_restore (cr);
+
+    g_object_unref (layout);
+}
+
+static void
+on_area_paint (FooScrollArea *area,
+	       cairo_t	     *cr,
+	       gpointer	      data)
+{
+    App *app = data;
+    GList *connected_outputs = NULL;
+    GList *list;
+
+    paint_background (area, cr);
+
+    if (!app->current_configuration)
+	return;
+
+    connected_outputs = list_connected_outputs (app, NULL, NULL);
+
+#if 0
+    double scale;
+    scale = compute_scale (app);
+    g_debug ("scale: %f", scale);
+#endif
+
+    for (list = connected_outputs; list != NULL; list = list->next)
+    {
+        int pos;
+
+        if ((pos = g_list_position (connected_outputs, list)) != -1)
+            paint_output (app, cr, (guint) pos);
+
+        if (mate_rr_config_get_clone (app->current_configuration))
+            break;
+    }
+}
+
+static void
+make_text_combo (GtkWidget *widget, int sort_column)
+{
+    GtkComboBox *box = GTK_COMBO_BOX (widget);
+    GtkListStore *store = gtk_list_store_new (
+	6,
+	G_TYPE_STRING,		/* Text */
+	G_TYPE_INT,		/* Width */
+	G_TYPE_INT,		/* Height */
+	G_TYPE_INT,		/* Frequency */
+	G_TYPE_INT,		/* Width * Height */
+	G_TYPE_INT);		/* Rotation */
+
+    GtkCellRenderer *cell;
+
+    gtk_cell_layout_clear (GTK_CELL_LAYOUT (widget));
+
+    gtk_combo_box_set_model (box, GTK_TREE_MODEL (store));
+
+    cell = gtk_cell_renderer_text_new ();
+    gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (box), cell, TRUE);
+    gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (box), cell,
+				    "text", 0,
+				    NULL);
+
+    if (sort_column != -1)
+    {
+	gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store),
+					      sort_column,
+					      GTK_SORT_DESCENDING);
+    }
+}
+
+static void
+compute_virtual_size_for_configuration (MateRRConfig *config, int *ret_width, int *ret_height)
+{
+    int i;
+    int width, height;
+    int output_x, output_y, output_width, output_height;
+    MateRROutputInfo **outputs;
+
+    width = height = 0;
+
+    outputs = mate_rr_config_get_outputs (config);
+    for (i = 0; outputs[i] != NULL; i++)
+    {
+	if (mate_rr_output_info_is_active (outputs[i]))
+	{
+	    mate_rr_output_info_get_geometry (outputs[i], &output_x, &output_y, &output_width, &output_height);
+	    width = MAX (width, output_x + output_width);
+	    height = MAX (height, output_y + output_height);
+	}
+    }
+
+    *ret_width = width;
+    *ret_height = height;
+}
+
+static void
+check_required_virtual_size (App *app)
+{
+    int req_width, req_height;
+    int min_width, max_width;
+    int min_height, max_height;
+
+    compute_virtual_size_for_configuration (app->current_configuration, &req_width, &req_height);
+
+    mate_rr_screen_get_ranges (app->screen, &min_width, &max_width, &min_height, &max_height);
+
+#if 0
+    g_debug ("X Server supports:");
+    g_debug ("min_width = %d, max_width = %d", min_width, max_width);
+    g_debug ("min_height = %d, max_height = %d", min_height, max_height);
+
+    g_debug ("Requesting size of %dx%d", req_width, req_height);
+#endif
+
+    if (!(min_width <= req_width && req_width <= max_width
+	  && min_height <= req_height && req_height <= max_height))
+    {
+	/* FIXME: present a useful dialog, maybe even before the user tries to Apply */
+#if 0
+	g_debug ("Your X server needs a larger Virtual size!");
+#endif
+    }
+}
+
+static void
+begin_version2_apply_configuration (App *app, GdkWindow *parent_window, guint32 timestamp)
+{
+    XID parent_window_xid;
+    GError *error = NULL;
+
+    parent_window_xid = GDK_WINDOW_XID (parent_window);
+
+    app->proxy = g_dbus_proxy_new_sync (app->connection,
+                                        G_DBUS_PROXY_FLAGS_NONE,
+                                        NULL,
+                                        "org.mate.SettingsDaemon",
+                                        "/org/mate/SettingsDaemon/XRANDR",
+                                        "org.mate.SettingsDaemon.XRANDR_2",
+                                        NULL,
+                                        &error);
+    if (app->proxy == NULL) {
+        g_warning ("Failed to get dbus connection: %s", error->message);
+        g_error_free (error);
+    } else {
+        app->apply_configuration_state = APPLYING_VERSION_2;
+        g_dbus_proxy_call (app->proxy,
+                           "ApplyConfiguration",
+                           g_variant_new ("(xx)", parent_window_xid, timestamp),
+                           G_DBUS_CALL_FLAGS_NONE,
+                           -1,
+                           NULL,
+                           (GAsyncReadyCallback) apply_configuration_returned_cb,
+                           app);
+    }
+}
+
+static void
+begin_version1_apply_configuration (App *app)
+{
+    GError *error = NULL;
+
+    app->proxy = g_dbus_proxy_new_sync (app->connection,
+                                        G_DBUS_PROXY_FLAGS_NONE,
+                                        NULL,
+                                        "org.mate.SettingsDaemon",
+                                        "/org/mate/SettingsDaemon/XRANDR",
+                                        "org.mate.SettingsDaemon.XRANDR",
+                                        NULL,
+                                        &error);
+    if (app->proxy == NULL) {
+        g_warning ("Failed to get dbus connection: %s", error->message);
+        g_error_free (error);
+    } else {
+        app->apply_configuration_state = APPLYING_VERSION_1;
+        g_dbus_proxy_call (app->proxy,
+                           "ApplyConfiguration",
+                           g_variant_new ("()"),
+                           G_DBUS_CALL_FLAGS_NONE,
+                           -1,
+                           NULL,
+                           (GAsyncReadyCallback) apply_configuration_returned_cb,
+                           app);
+    }
+}
+
+static void
+ensure_current_configuration_is_saved (void)
+{
+        MateRRScreen *rr_screen;
+        MateRRConfig *rr_config;
+
+        /* Normally, mate_rr_config_save() creates a backup file based on the
+         * old monitors.xml.  However, if *that* file didn't exist, there is
+         * nothing from which to create a backup.  So, here we'll save the
+         * current/unchanged configuration and then let our caller call
+         * mate_rr_config_save() again with the new/changed configuration, so
+         * that there *will* be a backup file in the end.
+         */
+
+        rr_screen = mate_rr_screen_new (gdk_screen_get_default (), NULL); /* NULL-GError */
+        if (!rr_screen)
+                return;
+
+        rr_config = mate_rr_config_new_current (rr_screen, NULL);
+        mate_rr_config_save (rr_config, NULL); /* NULL-GError */
+
+        g_object_unref (rr_config);
+        g_object_unref (rr_screen);
+}
+
+/* Callback for g_dbus_proxy_call() */
+static void
+apply_configuration_returned_cb (GObject *source_object,
+                                 GAsyncResult *res,
+                                 gpointer data)
+{
+    GVariant *variant;<--- Variable 'variant' can be declared as pointer to const
+    GError *error;
+    App *app = data;
+
+    error = NULL;
+
+    if (app->proxy == NULL)
+        return;
+
+    variant = g_dbus_proxy_call_finish (app->proxy, res, &error);
+    if (variant == NULL) {
+        if (app->apply_configuration_state == APPLYING_VERSION_2
+                && g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD)) {
+            g_error_free (error);
+
+            g_object_unref (app->proxy);
+            app->proxy = NULL;
+
+            begin_version1_apply_configuration (app);
+            return;
+        } else {
+            /* We don't pop up an error message; mate-settings-daemon already does that
+             * in case the selected RANDR configuration could not be applied.
+             */
+            g_error_free (error);
+        }
+    }
+
+    g_object_unref (app->proxy);
+    app->proxy = NULL;
+
+    g_object_unref (app->connection);
+    app->connection = NULL;
+
+    gtk_widget_set_sensitive (app->dialog, TRUE);
+}
+
+static gboolean
+sanitize_and_save_configuration (App *app)
+{
+    GError *error;
+
+    mate_rr_config_sanitize (app->current_configuration);
+
+    check_required_virtual_size (app);
+
+    foo_scroll_area_invalidate (FOO_SCROLL_AREA (app->area));
+
+    ensure_current_configuration_is_saved ();
+
+    error = NULL;
+    if (!mate_rr_config_save (app->current_configuration, &error))
+    {
+	error_message (app, _("Could not save the monitor configuration"), error->message);
+	g_error_free (error);
+	return FALSE;
+    }
+
+    return TRUE;
+}
+
+static void
+apply (App *app)
+{
+    GError *error = NULL;
+
+    if (!sanitize_and_save_configuration (app))
+	return;
+
+    g_assert (app->connection == NULL);
+    g_assert (app->proxy == NULL);
+
+    app->connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
+    if (app->connection == NULL) {
+        error_message (app, _("Could not get session bus while applying display configuration"), error->message);
+        g_error_free (error);
+        return;
+    }
+
+    gtk_widget_set_sensitive (app->dialog, FALSE);
+
+    begin_version2_apply_configuration (app, gtk_widget_get_window (app->dialog), app->apply_button_clicked_timestamp);
+}
+
+static void
+on_detect_displays (GtkWidget *widget, gpointer data)
+{
+    App *app = data;
+    GError *error;
+
+    error = NULL;
+    if (!mate_rr_screen_refresh (app->screen, &error)) {
+	if (error) {
+	    error_message (app, _("Could not detect displays"), error->message);
+	    g_error_free (error);
+	}
+    }
+}
+
+static void
+set_primary (GtkWidget *widget, gpointer data)
+{
+    App *app = data;
+    int i;
+    MateRROutputInfo **outputs;
+
+    if (!app->current_output)
+        return;
+
+    outputs = mate_rr_config_get_outputs (app->current_configuration);
+    for (i=0; outputs[i]!=NULL; i++) {
+        mate_rr_output_info_set_primary (outputs[i], outputs[i] == app->current_output);
+    }
+
+    gtk_widget_set_sensitive (app->primary_button, !mate_rr_output_info_get_primary(app->current_output));
+}
+
+#define MSD_XRANDR_SCHEMA                 "org.mate.SettingsDaemon.plugins.xrandr"
+#define SHOW_ICON_KEY                     "show-notification-icon"
+#define DEFAULT_CONFIGURATION_FILE_KEY    "default-configuration-file"
+
+static void
+on_show_icon_toggled (GtkWidget *widget, gpointer data)
+{
+    GtkToggleButton *tb = GTK_TOGGLE_BUTTON (widget);
+    App *app = data;
+
+    g_settings_set_boolean (app->settings, SHOW_ICON_KEY,
+			   gtk_toggle_button_get_active (tb));
+}
+
+static MateRROutputInfo *
+get_nearest_output (MateRRConfig *configuration, int x, int y)
+{
+    int i;
+    int nearest_index;
+    int nearest_dist;
+    MateRROutputInfo **outputs;
+
+    nearest_index = -1;
+    nearest_dist = G_MAXINT;
+
+    outputs = mate_rr_config_get_outputs (configuration);
+    for (i = 0; outputs[i] != NULL; i++)
+    {
+	int dist_x, dist_y;
+	int output_x, output_y, output_width, output_height;
+
+	if (!(mate_rr_output_info_is_connected(outputs[i]) && mate_rr_output_info_is_active (outputs[i])))
+	    continue;
+
+	mate_rr_output_info_get_geometry (outputs[i], &output_x, &output_y, &output_width, &output_height);
+	if (x < output_x)
+	    dist_x = output_x - x;
+	else if (x >= output_x + output_width)
+	    dist_x = x - (output_x + output_width) + 1;
+	else
+	    dist_x = 0;
+
+	if (y < output_y)
+	    dist_y = output_y - y;
+	else if (y >= output_y + output_height)
+	    dist_y = y - (output_y + output_height) + 1;
+	else
+	    dist_y = 0;
+
+	if (MIN (dist_x, dist_y) < nearest_dist)
+	{
+	    nearest_dist = MIN (dist_x, dist_y);
+	    nearest_index = i;
+	}
+    }
+
+    if (nearest_index != -1)
+	return outputs[nearest_index];
+    else
+	return NULL;
+
+}
+
+/* Gets the output that contains the largest intersection with the window.
+ * Logic stolen from gdk_screen_get_monitor_at_window().
+ */
+static MateRROutputInfo *
+get_output_for_window (MateRRConfig *configuration, GdkWindow *window)
+{
+    GdkRectangle win_rect;
+    int i;
+    int largest_area;
+    int largest_index;
+    MateRROutputInfo **outputs;
+
+    gdk_window_get_geometry (window, &win_rect.x, &win_rect.y, &win_rect.width, &win_rect.height);
+    gdk_window_get_origin (window, &win_rect.x, &win_rect.y);
+
+    largest_area = 0;
+    largest_index = -1;
+
+    outputs = mate_rr_config_get_outputs (configuration);
+    for (i = 0; outputs[i] != NULL; i++)
+    {
+	GdkRectangle output_rect, intersection;
+
+	mate_rr_output_info_get_geometry (outputs[i], &output_rect.x, &output_rect.y, &output_rect.width, &output_rect.height);
+
+	if (mate_rr_output_info_is_connected (outputs[i]) && gdk_rectangle_intersect (&win_rect, &output_rect, &intersection))
+	{
+	    int area;
+
+	    area = intersection.width * intersection.height;
+	    if (area > largest_area)
+	    {
+		largest_area = area;
+		largest_index = i;
+	    }
+	}
+    }
+
+    if (largest_index != -1)
+	return outputs[largest_index];
+    else
+	return get_nearest_output (configuration,
+				   win_rect.x + win_rect.width / 2,
+				   win_rect.y + win_rect.height / 2);
+}
+
+/* We select the current output, i.e. select the one being edited, based on
+ * which output is showing the configuration dialog.
+ */
+static void
+select_current_output_from_dialog_position (App *app)
+{
+    if (gtk_widget_get_realized (app->dialog))
+	app->current_output = get_output_for_window (app->current_configuration, gtk_widget_get_window (app->dialog));
+    else
+	app->current_output = NULL;
+
+    rebuild_gui (app);
+}
+
+/* This is a GtkWidget::map-event handler.  We wait for the display-properties
+ * dialog to be mapped, and then we select the output which corresponds to the
+ * monitor on which the dialog is being shown.
+ */
+static gboolean
+dialog_map_event_cb (GtkWidget *widget, GdkEventAny *event, gpointer data)
+{
+    App *app = data;
+
+    select_current_output_from_dialog_position (app);
+    return FALSE;
+}
+
+static void
+apply_button_clicked_cb (GtkButton *button, gpointer data)
+{
+    App *app = data;
+
+    /* We simply store the timestamp at which the Apply button was clicked.
+     * We'll just wait for the dialog to return from gtk_dialog_run(), and
+     * *then* use the timestamp when applying the RANDR configuration.
+     */
+
+    app->apply_button_clicked_timestamp = gtk_get_current_event_time ();
+}
+
+static void
+success_dialog_for_make_default (App *app)
+{
+    GtkWidget *dialog;
+
+    dialog = gtk_message_dialog_new (GTK_WINDOW (app->dialog),
+				     GTK_DIALOG_MODAL,
+				     GTK_MESSAGE_INFO,
+				     GTK_BUTTONS_OK,
+				     _("The monitor configuration has been saved"));
+    gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+					      _("This configuration will be used the next time someone logs in."));
+
+    gtk_dialog_run (GTK_DIALOG (dialog));
+    gtk_widget_destroy (dialog);
+}
+
+static void
+error_dialog_for_make_default (App *app, const char *error_text)
+{
+    error_message (app, _("Could not set the default configuration for monitors"), error_text);
+}
+
+static void
+make_default (App *app)
+{
+    char *command_line;
+    char *source_filename;
+    char *dest_filename;
+    char *dest_basename;
+    char *std_error;
+    gint exit_status;
+    GError *error;
+
+    if (!sanitize_and_save_configuration (app))
+	return;
+
+    dest_filename = g_settings_get_string (app->settings, DEFAULT_CONFIGURATION_FILE_KEY);
+    if (!dest_filename)
+	return; /* FIXME: present an error? */
+
+    dest_basename = g_path_get_basename (dest_filename);
+
+    source_filename = mate_rr_config_get_intended_filename ();
+
+    command_line = g_strdup_printf ("pkexec %s/mate-display-properties-install-systemwide %s %s",
+				    SBINDIR,
+				    source_filename,
+				    dest_basename);
+
+    error = NULL;
+    if (!g_spawn_command_line_sync (command_line, NULL, &std_error, &exit_status, &error))
+    {
+	error_dialog_for_make_default (app, error->message);
+	g_error_free (error);
+    }
+    else if (!WIFEXITED (exit_status) || WEXITSTATUS (exit_status) != 0)
+    {
+	error_dialog_for_make_default (app, std_error);
+    }
+    else
+    {
+	success_dialog_for_make_default (app);
+    }
+
+    g_free (std_error);
+    g_free (dest_filename);
+    g_free (dest_basename);
+    g_free (source_filename);
+    g_free (command_line);
+}
+
+static GtkWidget*
+_gtk_builder_get_widget (GtkBuilder *builder, const gchar *name)
+{
+    return GTK_WIDGET (gtk_builder_get_object (builder, name));
+}
+
+static void
+run_application (App *app)
+{
+    GtkBuilder *builder;
+    GtkWidget *align;
+    GError *error = NULL;
+
+    builder = gtk_builder_new_from_resource ("/org/mate/mcc/display/display-capplet.ui");
+
+    app->screen = mate_rr_screen_new (gdk_screen_get_default (), &error);
+    g_signal_connect (app->screen, "changed", G_CALLBACK (on_screen_changed), app);
+    if (!app->screen)
+    {
+	error_message (NULL, _("Could not get screen information"), error->message);
+	g_error_free (error);
+	g_object_unref (builder);
+	return;
+    }
+
+    app->settings = g_settings_new (MSD_XRANDR_SCHEMA);
+    app->scale_settings = g_settings_new (MATE_INTERFACE_SCHEMA);
+
+    app->dialog = _gtk_builder_get_widget (builder, "dialog");
+    g_signal_connect_after (app->dialog, "map-event",
+			    G_CALLBACK (dialog_map_event_cb), app);
+
+    gtk_window_set_default_icon_name ("preferences-desktop-display");
+    gtk_window_set_icon_name (GTK_WINDOW (app->dialog),
+			      "preferences-desktop-display");
+
+    app->current_monitor_event_box = _gtk_builder_get_widget (builder,
+    						   "current_monitor_event_box");
+    app->current_monitor_label = _gtk_builder_get_widget (builder,
+    						       "current_monitor_label");
+
+    app->monitor_on_radio = _gtk_builder_get_widget (builder,
+    						     "monitor_on_radio");
+    app->monitor_off_radio = _gtk_builder_get_widget (builder,
+    						      "monitor_off_radio");
+    g_signal_connect (app->monitor_on_radio, "toggled",
+		      G_CALLBACK (monitor_on_off_toggled_cb), app);
+    g_signal_connect (app->monitor_off_radio, "toggled",
+		      G_CALLBACK (monitor_on_off_toggled_cb), app);
+
+    app->resolution_combo = _gtk_builder_get_widget (builder,
+    						     "resolution_combo");
+    g_signal_connect (app->resolution_combo, "changed",
+		      G_CALLBACK (on_resolution_changed), app);
+
+    app->refresh_combo = _gtk_builder_get_widget (builder, "refresh_combo");
+    g_signal_connect (app->refresh_combo, "changed",
+		      G_CALLBACK (on_rate_changed), app);
+
+    app->rotation_combo = _gtk_builder_get_widget (builder, "rotation_combo");
+    g_signal_connect (app->rotation_combo, "changed",
+		      G_CALLBACK (on_rotation_changed), app);
+
+    app->scale_vbox = _gtk_builder_get_widget (builder, "scale_vbox");
+
+    app->clone_checkbox = _gtk_builder_get_widget (builder, "clone_checkbox");
+    g_signal_connect (app->clone_checkbox, "toggled",
+		      G_CALLBACK (on_clone_changed), app);
+
+    g_signal_connect (_gtk_builder_get_widget (builder, "detect_displays_button"),
+		      "clicked", G_CALLBACK (on_detect_displays), app);
+
+    app->primary_button = _gtk_builder_get_widget (builder, "primary_button");
+
+    g_signal_connect (app->primary_button, "clicked", G_CALLBACK (set_primary), app);
+
+    app->show_icon_checkbox = _gtk_builder_get_widget (builder,
+						      "show_notification_icon");
+
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->show_icon_checkbox),
+				  g_settings_get_boolean (app->settings, SHOW_ICON_KEY));
+
+    g_signal_connect (app->show_icon_checkbox, "toggled", G_CALLBACK (on_show_icon_toggled), app);
+
+    app->panel_checkbox = _gtk_builder_get_widget (builder, "panel_checkbox");
+
+    make_text_combo (app->resolution_combo, 4);
+    make_text_combo (app->refresh_combo, 3);
+    make_text_combo (app->rotation_combo, -1);
+
+    g_assert (app->panel_checkbox);
+
+    /* Scroll Area */
+    app->area = (GtkWidget *)foo_scroll_area_new ();
+
+    g_object_set_data (G_OBJECT (app->area), "app", app);
+
+    set_monitors_tooltip (app, FALSE);
+
+    /* FIXME: this should be computed dynamically */
+    foo_scroll_area_set_min_size (FOO_SCROLL_AREA (app->area), -1, 200);
+    gtk_widget_show (app->area);
+    g_signal_connect (app->area, "paint",
+		      G_CALLBACK (on_area_paint), app);
+    g_signal_connect (app->area, "viewport_changed",
+		      G_CALLBACK (on_viewport_changed), app);<--- You might need to cast the function pointer here
+
+    align = _gtk_builder_get_widget (builder, "align");
+
+    gtk_container_add (GTK_CONTAINER (align), app->area);
+
+    app->apply_button = _gtk_builder_get_widget (builder, "apply_button");
+    g_signal_connect (app->apply_button, "clicked",
+		      G_CALLBACK (apply_button_clicked_cb), app);
+
+    on_screen_changed (app->screen, app);
+
+    g_object_unref (builder);
+
+restart:
+    switch (gtk_dialog_run (GTK_DIALOG (app->dialog)))
+    {
+    default:
+	/* Fall Through */
+    case GTK_RESPONSE_DELETE_EVENT:
+    case GTK_RESPONSE_CLOSE:
+#if 0
+	g_debug ("Close");
+#endif
+	break;
+
+    case GTK_RESPONSE_HELP:
+        gtk_show_uri_on_window (GTK_WINDOW (app->dialog),
+                                "help:mate-user-guide/goscustdesk-70",
+                                gtk_get_current_event_time (),
+                                &error);
+        if (error)
+        {
+            error_message (app, _("Could not open help content"), error->message);
+            g_error_free (error);
+        }
+	goto restart;
+	break;
+
+    case GTK_RESPONSE_APPLY:
+	apply (app);
+	goto restart;
+	break;
+
+    case RESPONSE_MAKE_DEFAULT:
+	make_default (app);
+	goto restart;
+	break;
+    }
+
+    gtk_widget_destroy (app->dialog);
+    g_object_unref (app->screen);
+    g_object_unref (app->settings);
+    g_object_unref (app->scale_settings);
+}
+
+int
+main (int argc, char **argv)
+{
+    App *app;
+
+    capplet_init (NULL, &argc, &argv);
+
+    app = g_new0 (App, 1);
+
+    run_application (app);
+
+    g_free (app);
+
+    return 0;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/54.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/54.html new file mode 100644 index 00000000..e7dbe2af --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/54.html @@ -0,0 +1,427 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/* eggaccelerators.h
+ * Copyright (C) 2002  Red Hat, Inc.
+ * Developed by Havoc Pennington
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library 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.
+ */
+
+#ifndef __EGG_ACCELERATORS_H__
+#define __EGG_ACCELERATORS_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 <gdk/gdk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+/* Where a value is also in GdkModifierType we coincide,
+ * otherwise we don't overlap.
+ */
+typedef enum
+{
+  EGG_VIRTUAL_SHIFT_MASK    = 1 << 0,
+  EGG_VIRTUAL_LOCK_MASK	    = 1 << 1,
+  EGG_VIRTUAL_CONTROL_MASK  = 1 << 2,
+
+  EGG_VIRTUAL_ALT_MASK      = 1 << 3, /* fixed as Mod1 */
+
+  EGG_VIRTUAL_MOD2_MASK	    = 1 << 4,
+  EGG_VIRTUAL_MOD3_MASK	    = 1 << 5,
+  EGG_VIRTUAL_MOD4_MASK	    = 1 << 6,
+  EGG_VIRTUAL_MOD5_MASK	    = 1 << 7,
+
+#if 0
+  GDK_BUTTON1_MASK  = 1 << 8,
+  GDK_BUTTON2_MASK  = 1 << 9,
+  GDK_BUTTON3_MASK  = 1 << 10,
+  GDK_BUTTON4_MASK  = 1 << 11,
+  GDK_BUTTON5_MASK  = 1 << 12,
+  /* 13, 14 are used by Xkb for the keyboard group */
+#endif
+
+  EGG_VIRTUAL_MODE_SWITCH_MASK = 1 << 23,
+  EGG_VIRTUAL_NUM_LOCK_MASK = 1 << 24,
+  EGG_VIRTUAL_SCROLL_LOCK_MASK = 1 << 25,
+
+  /* Also in GdkModifierType */
+  EGG_VIRTUAL_SUPER_MASK = 1 << 26,
+  EGG_VIRTUAL_HYPER_MASK = 1 << 27,
+  EGG_VIRTUAL_META_MASK = 1 << 28,
+
+  /* Also in GdkModifierType */
+  EGG_VIRTUAL_RELEASE_MASK  = 1 << 30,
+
+  /*     28-31 24-27 20-23 16-19 12-15 8-11 4-7 0-3
+   *       5     f     8     0     0    0    f   f
+   */
+  EGG_VIRTUAL_MODIFIER_MASK = 0x5f8000ff
+
+} EggVirtualModifierType;
+
+gboolean egg_accelerator_parse_virtual        (const gchar            *accelerator,
+                                               guint                  *accelerator_key,
+					       guint                  *keycode,
+                                               EggVirtualModifierType *accelerator_mods);
+void     egg_keymap_resolve_virtual_modifiers (GdkKeymap              *keymap,
+                                               EggVirtualModifierType  virtual_mods,
+                                               GdkModifierType        *concrete_mods);
+void     egg_keymap_virtualize_modifiers      (GdkKeymap              *keymap,
+                                               GdkModifierType         concrete_mods,
+                                               EggVirtualModifierType *virtual_mods);
+
+gchar* egg_virtual_accelerator_name (guint                  accelerator_key,
+				     guint		    keycode,
+                                     EggVirtualModifierType accelerator_mods);
+
+gchar* egg_virtual_accelerator_label (guint                  accelerator_key,
+				      guint		     keycode,
+				      EggVirtualModifierType accelerator_mods);
+
+G_END_DECLS
+
+#endif /* __EGG_ACCELERATORS_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/55.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/55.html new file mode 100644 index 00000000..03342af8 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/55.html @@ -0,0 +1,1511 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* eggaccelerators.c
+ * Copyright (C) 2002  Red Hat, Inc.; Copyright 1998, 2001 Tim Janik
+ * Developed by Havoc Pennington, Tim Janik
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library 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.
+ */
+
+#include "eggaccelerators.h"
+
+#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 <gdk/gdkx.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 <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+enum {
+	EGG_MODMAP_ENTRY_SHIFT   = 0,
+	EGG_MODMAP_ENTRY_LOCK    = 1,
+	EGG_MODMAP_ENTRY_CONTROL = 2,
+	EGG_MODMAP_ENTRY_MOD1    = 3,
+	EGG_MODMAP_ENTRY_MOD2    = 4,
+	EGG_MODMAP_ENTRY_MOD3    = 5,
+	EGG_MODMAP_ENTRY_MOD4    = 6,
+	EGG_MODMAP_ENTRY_MOD5    = 7,
+	EGG_MODMAP_ENTRY_LAST    = 8
+};
+
+#define MODMAP_ENTRY_TO_MODIFIER(x) (1 << (x))
+
+typedef struct {
+	EggVirtualModifierType mapping[EGG_MODMAP_ENTRY_LAST];
+} EggModmap;
+
+const EggModmap* egg_keymap_get_modmap(GdkKeymap* keymap);
+
+static inline gboolean is_alt(const gchar* string)
+{
+	return ((string[0] == '<') &&
+		(string[1] == 'a' || string[1] == 'A') &&
+		(string[2] == 'l' || string[2] == 'L') &&
+		(string[3] == 't' || string[3] == 'T') &&
+		(string[4] == '>'));
+}
+
+static inline gboolean is_ctl (const gchar* string)
+{
+	return ((string[0] == '<') &&
+		(string[1] == 'c' || string[1] == 'C') &&
+		(string[2] == 't' || string[2] == 'T') &&
+		(string[3] == 'l' || string[3] == 'L') &&
+		(string[4] == '>'));
+}
+
+static inline gboolean is_modx(const gchar* string)
+{
+	return ((string[0] == '<') &&
+		(string[1] == 'm' || string[1] == 'M') &&
+		(string[2] == 'o' || string[2] == 'O') &&
+		(string[3] == 'd' || string[3] == 'D') &&
+		(string[4] >= '1' && string[4] <= '5') &&
+		(string[5] == '>'));
+}
+
+static inline gboolean is_ctrl(const gchar* string)
+{
+	return ((string[0] == '<') &&
+		(string[1] == 'c' || string[1] == 'C') &&
+		(string[2] == 't' || string[2] == 'T') &&
+		(string[3] == 'r' || string[3] == 'R') &&
+		(string[4] == 'l' || string[4] == 'L') &&
+		(string[5] == '>'));
+}
+
+static inline gboolean is_shft (const gchar* string)
+{
+	return ((string[0] == '<') &&
+		(string[1] == 's' || string[1] == 'S') &&
+		(string[2] == 'h' || string[2] == 'H') &&
+		(string[3] == 'f' || string[3] == 'F') &&
+		(string[4] == 't' || string[4] == 'T') &&
+		(string[5] == '>'));
+}
+
+static inline gboolean is_shift(const gchar* string)
+{
+  return ((string[0] == '<') &&
+		(string[1] == 's' || string[1] == 'S') &&
+		(string[2] == 'h' || string[2] == 'H') &&
+		(string[3] == 'i' || string[3] == 'I') &&
+		(string[4] == 'f' || string[4] == 'F') &&
+		(string[5] == 't' || string[5] == 'T') &&
+		(string[6] == '>'));
+}
+
+static inline gboolean is_control(const gchar* string)
+{
+	return ((string[0] == '<') &&
+		(string[1] == 'c' || string[1] == 'C') &&
+		(string[2] == 'o' || string[2] == 'O') &&
+		(string[3] == 'n' || string[3] == 'N') &&
+		(string[4] == 't' || string[4] == 'T') &&
+		(string[5] == 'r' || string[5] == 'R') &&
+		(string[6] == 'o' || string[6] == 'O') &&
+		(string[7] == 'l' || string[7] == 'L') &&
+		(string[8] == '>'));
+}
+
+static inline gboolean is_release(const gchar* string)
+{
+	return ((string[0] == '<') &&
+		(string[1] == 'r' || string[1] == 'R') &&
+		(string[2] == 'e' || string[2] == 'E') &&
+		(string[3] == 'l' || string[3] == 'L') &&
+		(string[4] == 'e' || string[4] == 'E') &&
+		(string[5] == 'a' || string[5] == 'A') &&
+		(string[6] == 's' || string[6] == 'S') &&
+		(string[7] == 'e' || string[7] == 'E') &&
+		(string[8] == '>'));
+}
+
+static inline gboolean is_meta(const gchar* string)
+{
+	return ((string[0] == '<') &&
+		(string[1] == 'm' || string[1] == 'M') &&
+		(string[2] == 'e' || string[2] == 'E') &&
+		(string[3] == 't' || string[3] == 'T') &&
+		(string[4] == 'a' || string[4] == 'A') &&
+		(string[5] == '>'));
+}
+
+static inline gboolean is_super(const gchar* string)
+{
+	return ((string[0] == '<') &&
+		(string[1] == 's' || string[1] == 'S') &&
+		(string[2] == 'u' || string[2] == 'U') &&
+		(string[3] == 'p' || string[3] == 'P') &&
+		(string[4] == 'e' || string[4] == 'E') &&
+		(string[5] == 'r' || string[5] == 'R') &&
+		(string[6] == '>'));
+}
+
+static inline gboolean is_hyper(const gchar *string)
+{
+	return ((string[0] == '<') &&
+		(string[1] == 'h' || string[1] == 'H') &&
+		(string[2] == 'y' || string[2] == 'Y') &&
+		(string[3] == 'p' || string[3] == 'P') &&
+		(string[4] == 'e' || string[4] == 'E') &&
+		(string[5] == 'r' || string[5] == 'R') &&
+		(string[6] == '>'));
+}
+
+static inline gboolean is_primary(const gchar* string)
+{
+	return ((string[0] == '<') &&
+		(string[1] == 'p' || string[1] == 'P') &&
+		(string[2] == 'r' || string[2] == 'R') &&
+		(string[3] == 'i' || string[3] == 'I') &&
+		(string[4] == 'm' || string[4] == 'M') &&
+		(string[5] == 'a' || string[5] == 'A') &&
+		(string[6] == 'r' || string[6] == 'R') &&
+		(string[7] == 'y' || string[7] == 'Y') &&
+		(string[8] == '>'));
+}
+
+static inline gboolean is_keycode(const gchar *string)
+{
+	return ((string[0] == '0') &&
+		(string[1] == 'x'));
+}
+
+/**
+ * egg_accelerator_parse_virtual:
+ * @accelerator:      string representing an accelerator
+ * @accelerator_key:  return location for accelerator keyval
+ * @accelerator_mods: return location for accelerator modifier mask
+ *
+ * Parses a string representing a virtual accelerator. The format
+ * looks like "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1" or
+ * "&lt;Release&gt;z" (the last one is for key release).  The parser
+ * is fairly liberal and allows lower or upper case, and also
+ * abbreviations such as "&lt;Ctl&gt;" and "&lt;Ctrl&gt;".
+ *
+ * If the parse fails, @accelerator_key and @accelerator_mods will
+ * be set to 0 (zero) and %FALSE will be returned. If the string contains
+ * only modifiers, @accelerator_key will be set to 0 but %TRUE will be
+ * returned.
+ *
+ * The virtual vs. concrete accelerator distinction is a relic of
+ * how the X Window System works; there are modifiers Mod2-Mod5 that
+ * can represent various keyboard keys (numlock, meta, hyper, etc.),
+ * the virtual modifier represents the keyboard key, the concrete
+ * modifier the actual Mod2-Mod5 bits in the key press event.
+ *
+ * Returns: %TRUE on success.
+ */
+gboolean
+egg_accelerator_parse_virtual (const gchar            *accelerator,
+                               guint                  *accelerator_key,
+			       guint                  *keycode,
+                               EggVirtualModifierType *accelerator_mods)
+{
+  guint keyval;
+  GdkModifierType mods;
+  gint len;
+  gboolean bad_keyval;
+
+  if (accelerator_key)
+    *accelerator_key = 0;
+  if (accelerator_mods)
+    *accelerator_mods = 0;
+  if (keycode)
+    *keycode = 0;
+
+  g_return_val_if_fail (accelerator != NULL, FALSE);
+
+  bad_keyval = FALSE;
+
+  keyval = 0;
+  mods = 0;
+  len = strlen (accelerator);
+  while (len)
+    {
+      if (*accelerator == '<')
+	{
+	  if (len >= 9 && is_release (accelerator))
+	    {
+	      accelerator += 9;
+	      len -= 9;
+	      mods |= EGG_VIRTUAL_RELEASE_MASK;
+	    }
+	  else if (len >= 9 && is_control (accelerator))
+	    {
+	      accelerator += 9;
+	      len -= 9;
+	      mods |= EGG_VIRTUAL_CONTROL_MASK;
+	    }
+	  else if (len >= 9 && is_primary (accelerator))
+	    {
+	      accelerator += 9;
+	      len -= 9;
+	      mods |= EGG_VIRTUAL_CONTROL_MASK;
+	    }
+	  else if (len >= 7 && is_shift (accelerator))
+	    {
+	      accelerator += 7;
+	      len -= 7;
+	      mods |= EGG_VIRTUAL_SHIFT_MASK;
+	    }
+	  else if (len >= 6 && is_shft (accelerator))
+	    {
+	      accelerator += 6;
+	      len -= 6;
+	      mods |= EGG_VIRTUAL_SHIFT_MASK;
+	    }
+	  else if (len >= 6 && is_ctrl (accelerator))
+	    {
+	      accelerator += 6;
+	      len -= 6;
+	      mods |= EGG_VIRTUAL_CONTROL_MASK;
+	    }
+	  else if (len >= 6 && is_modx (accelerator))
+	    {
+	      static const guint mod_vals[] = {
+		EGG_VIRTUAL_ALT_MASK, EGG_VIRTUAL_MOD2_MASK, EGG_VIRTUAL_MOD3_MASK,
+		EGG_VIRTUAL_MOD4_MASK, EGG_VIRTUAL_MOD5_MASK
+	      };
+
+	      len -= 6;
+	      accelerator += 4;
+	      mods |= mod_vals[*accelerator - '1'];
+	      accelerator += 2;
+	    }
+	  else if (len >= 5 && is_ctl (accelerator))
+	    {
+	      accelerator += 5;
+	      len -= 5;
+	      mods |= EGG_VIRTUAL_CONTROL_MASK;
+	    }
+	  else if (len >= 5 && is_alt (accelerator))
+	    {
+	      accelerator += 5;
+	      len -= 5;
+	      mods |= EGG_VIRTUAL_ALT_MASK;
+	    }
+          else if (len >= 6 && is_meta (accelerator))
+	    {
+	      accelerator += 6;
+	      len -= 6;
+	      mods |= EGG_VIRTUAL_META_MASK;
+	    }
+          else if (len >= 7 && is_hyper (accelerator))
+	    {
+	      accelerator += 7;
+	      len -= 7;
+	      mods |= EGG_VIRTUAL_HYPER_MASK;
+	    }
+          else if (len >= 7 && is_super (accelerator))
+	    {
+	      accelerator += 7;
+	      len -= 7;
+	      mods |= EGG_VIRTUAL_SUPER_MASK;
+	    }
+	  else
+	    {
+	      gchar last_ch;
+
+	      last_ch = *accelerator;
+	      while (last_ch && last_ch != '>')
+		{
+		  last_ch = *accelerator;
+		  accelerator += 1;
+		  len -= 1;
+		}
+	    }
+	}
+      else
+	{
+          keyval = gdk_keyval_from_name (accelerator);
+
+          if (keyval == 0)
+	    {
+	      /* If keyval is 0, then maybe it's a keycode.  Check for 0x## */
+	      if (len >= 4 && is_keycode (accelerator))
+		{
+		  char keystring[5];
+		  gchar *endptr;
+		  gint tmp_keycode;
+
+		  memcpy (keystring, accelerator, 4);
+		  keystring [4] = '\000';
+
+		  tmp_keycode = strtol (keystring, &endptr, 16);
+
+		  if (endptr == NULL || *endptr != '\000')
+		    {
+		      bad_keyval = TRUE;
+		    }
+		  else if (keycode != NULL)
+		    {
+		      *keycode = tmp_keycode;
+		      /* 0x00 is an invalid keycode too. */
+		      if (*keycode == 0)
+			bad_keyval = TRUE;
+		    }
+		}
+	    }
+	  else if (keycode != NULL)
+	    {
+	      *keycode = XKeysymToKeycode (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), keyval);
+	      if (*keycode == 0)
+	 	bad_keyval = TRUE;
+	    }
+
+          accelerator += len;
+          len -= len;
+	}
+    }
+
+  if (accelerator_key)
+    *accelerator_key = gdk_keyval_to_lower (keyval);
+  if (accelerator_mods)
+    *accelerator_mods = mods;
+
+  return !bad_keyval;
+}
+
+/**
+ * egg_virtual_accelerator_name:
+ * @accelerator_key:  accelerator keyval
+ * @accelerator_mods: accelerator modifier mask
+ * @returns:          a newly-allocated accelerator name
+ *
+ * Converts an accelerator keyval and modifier mask
+ * into a string parseable by egg_accelerator_parse_virtual().
+ * For example, if you pass in #GDK_q and #EGG_VIRTUAL_CONTROL_MASK,
+ * this function returns "&lt;Control&gt;q".
+ *
+ * The caller of this function must free the returned string.
+ */
+gchar* egg_virtual_accelerator_name (guint accelerator_key, guint keycode, EggVirtualModifierType accelerator_mods)
+{
+	/* Acá esta el problema...
+	 * */
+	gchar* gtk_name;
+	GdkModifierType gdkmods = 0;
+
+	egg_keymap_resolve_virtual_modifiers(NULL, accelerator_mods, &gdkmods);
+
+	/* en la funcion gtk_accelerator_name, desde la modificacion del 16 de sep
+	 * del 2011 en GTK+, la tecla <Control> es tomada como <Primary> (?) */
+	gtk_name = gtk_accelerator_name(accelerator_key, gdkmods);
+
+	if (!accelerator_key)
+	{
+		gchar *name;
+		name = g_strdup_printf ("%s0x%02x", gtk_name, keycode);
+		g_free (gtk_name);
+		return name;
+	}
+
+	return gtk_name;
+}
+
+/**
+ * egg_virtual_accelerator_label:
+ * @accelerator_key:  accelerator keyval
+ * @accelerator_mods: accelerator modifier mask
+ * @returns:          a newly-allocated accelerator label
+ *
+ * Converts an accelerator keyval and modifier mask
+ * into a (possibly translated) string that can be displayed to
+ * a user.
+ * For example, if you pass in #GDK_q and #EGG_VIRTUAL_CONTROL_MASK,
+ * and you use a German locale, this function returns "Strg+Q".
+ *
+ * The caller of this function must free the returned string.
+ */
+gchar*
+egg_virtual_accelerator_label (guint                  accelerator_key,
+			       guint		      keycode,
+			       EggVirtualModifierType accelerator_mods)
+{
+	gchar *gtk_label;
+	GdkModifierType gdkmods = 0;
+
+	egg_keymap_resolve_virtual_modifiers (NULL, accelerator_mods, &gdkmods);
+	gtk_label = gtk_accelerator_get_label (accelerator_key, gdkmods);
+
+	if (!accelerator_key)
+	{
+		gchar *label;
+		label = g_strdup_printf ("%s0x%02x", gtk_label, keycode);
+		g_free (gtk_label);
+		return label;
+	}
+
+	return gtk_label;
+}
+
+void egg_keymap_resolve_virtual_modifiers (GdkKeymap* keymap, EggVirtualModifierType virtual_mods, GdkModifierType* concrete_mods)
+{
+	GdkModifierType concrete;
+	int i;
+	const EggModmap* modmap;
+
+	g_return_if_fail (concrete_mods != NULL);
+	g_return_if_fail (keymap == NULL || GDK_IS_KEYMAP (keymap));
+
+	modmap = egg_keymap_get_modmap(keymap);
+
+	/* Not so sure about this algorithm. */
+	concrete = 0;
+
+	for (i = 0; i < EGG_MODMAP_ENTRY_LAST; ++i)
+	{
+		if (modmap->mapping[i] & virtual_mods)
+		{
+			concrete |= MODMAP_ENTRY_TO_MODIFIER (i);
+		}
+	}
+
+	*concrete_mods = concrete;
+}
+
+void
+egg_keymap_virtualize_modifiers (GdkKeymap              *keymap,
+                                 GdkModifierType         concrete_mods,
+                                 EggVirtualModifierType *virtual_mods)
+{
+  GdkModifierType virtual;
+  int i;
+  const EggModmap *modmap;
+
+  g_return_if_fail (virtual_mods != NULL);
+  g_return_if_fail (keymap == NULL || GDK_IS_KEYMAP (keymap));
+
+  modmap = egg_keymap_get_modmap (keymap);
+
+  /* Not so sure about this algorithm. */
+
+  virtual = 0;
+  for (i = 0; i < EGG_MODMAP_ENTRY_LAST; ++i)
+    {
+      if (MODMAP_ENTRY_TO_MODIFIER (i) & concrete_mods)
+        {
+          EggVirtualModifierType cleaned;
+
+          cleaned = modmap->mapping[i] & ~(EGG_VIRTUAL_MOD2_MASK |
+                                           EGG_VIRTUAL_MOD3_MASK |
+                                           EGG_VIRTUAL_MOD4_MASK |
+                                           EGG_VIRTUAL_MOD5_MASK);
+
+          if (cleaned != 0)
+            {
+              virtual |= cleaned;
+            }
+          else
+            {
+              /* Rather than dropping mod2->mod5 if not bound,
+               * go ahead and use the concrete names
+               */
+              virtual |= modmap->mapping[i];
+            }
+        }
+    }
+
+  *virtual_mods = virtual;
+}
+
+static void
+reload_modmap (GdkKeymap *keymap,
+               EggModmap *modmap)
+{
+  XModifierKeymap *xmodmap;
+  int map_size;
+  int i;
+
+  /* FIXME multihead */
+  xmodmap = XGetModifierMapping (gdk_x11_get_default_xdisplay ());
+
+  memset (modmap->mapping, 0, sizeof (modmap->mapping));
+
+  /* there are 8 modifiers in the order shift, shift lock,
+   * control, mod1-5 with up to max_keypermod bindings each
+   */
+  map_size = 8 * xmodmap->max_keypermod;
+  for (i = 3 * xmodmap->max_keypermod; i < map_size; ++i)
+    {
+      /* get the key code at this point in the map,
+       * see if its keysym is one we're interested in
+       */
+      int keycode = xmodmap->modifiermap[i];
+      GdkKeymapKey *keys;
+      guint *keyvals;
+      int n_entries;
+      int j;
+      EggVirtualModifierType mask;
+
+      keys = NULL;
+      keyvals = NULL;
+      n_entries = 0;
+
+      gdk_keymap_get_entries_for_keycode (keymap,
+                                          keycode,
+                                          &keys, &keyvals, &n_entries);
+
+      mask = 0;
+      for (j = 0; j < n_entries; ++j)
+        {
+          if (keyvals[j] == GDK_KEY_Num_Lock)
+            mask |= EGG_VIRTUAL_NUM_LOCK_MASK;
+          else if (keyvals[j] == GDK_KEY_Scroll_Lock)
+            mask |= EGG_VIRTUAL_SCROLL_LOCK_MASK;
+          else if (keyvals[j] == GDK_KEY_Meta_L ||
+                   keyvals[j] == GDK_KEY_Meta_R)
+            mask |= EGG_VIRTUAL_META_MASK;
+          else if (keyvals[j] == GDK_KEY_Hyper_L ||
+                   keyvals[j] == GDK_KEY_Hyper_R)
+            mask |= EGG_VIRTUAL_HYPER_MASK;
+          else if (keyvals[j] == GDK_KEY_Super_L ||
+                   keyvals[j] == GDK_KEY_Super_R)
+            mask |= EGG_VIRTUAL_SUPER_MASK;
+          else if (keyvals[j] == GDK_KEY_Mode_switch)
+            mask |= EGG_VIRTUAL_MODE_SWITCH_MASK;
+        }
+
+      /* Mod1Mask is 1 << 3 for example, i.e. the
+       * fourth modifier, i / keyspermod is the modifier
+       * index
+       */
+      modmap->mapping[i/xmodmap->max_keypermod] |= mask;
+
+      g_free (keyvals);
+      g_free (keys);
+    }
+
+  /* Add in the not-really-virtual fixed entries */
+  modmap->mapping[EGG_MODMAP_ENTRY_SHIFT] |= EGG_VIRTUAL_SHIFT_MASK;
+  modmap->mapping[EGG_MODMAP_ENTRY_CONTROL] |= EGG_VIRTUAL_CONTROL_MASK;
+  modmap->mapping[EGG_MODMAP_ENTRY_LOCK] |= EGG_VIRTUAL_LOCK_MASK;
+  modmap->mapping[EGG_MODMAP_ENTRY_MOD1] |= EGG_VIRTUAL_ALT_MASK;
+  modmap->mapping[EGG_MODMAP_ENTRY_MOD2] |= EGG_VIRTUAL_MOD2_MASK;
+  modmap->mapping[EGG_MODMAP_ENTRY_MOD3] |= EGG_VIRTUAL_MOD3_MASK;
+  modmap->mapping[EGG_MODMAP_ENTRY_MOD4] |= EGG_VIRTUAL_MOD4_MASK;
+  modmap->mapping[EGG_MODMAP_ENTRY_MOD5] |= EGG_VIRTUAL_MOD5_MASK;
+
+  XFreeModifiermap (xmodmap);
+}
+
+const EggModmap*
+egg_keymap_get_modmap (GdkKeymap *keymap)
+{
+  EggModmap *modmap;
+
+  if (keymap == NULL)
+    keymap = gdk_keymap_get_for_display (gdk_display_get_default ());
+
+  /* This is all a hack, much simpler when we can just
+   * modify GDK directly.
+   */
+
+  modmap = g_object_get_data (G_OBJECT (keymap), "egg-modmap");
+
+  if (modmap == NULL)
+    {
+      modmap = g_new0 (EggModmap, 1);
+
+      /* FIXME modify keymap change events with an event filter
+       * and force a reload if we get one
+       */
+
+      reload_modmap (keymap, modmap);
+
+      g_object_set_data_full (G_OBJECT (keymap),
+                              "egg-modmap",
+                              modmap,
+                              g_free);
+    }
+
+  g_assert (modmap != NULL);
+
+  return modmap;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/56.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/56.html new file mode 100644 index 00000000..d1060658 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/56.html @@ -0,0 +1,1721 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
#include <config.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 <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.
+#include <gdk/gdkkeysyms.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "eggcellrendererkeys.h"
+#include "eggaccelerators.h"
+
+#define EGG_CELL_RENDERER_TEXT_PATH "egg-cell-renderer-text"
+
+#define TOOLTIP_TEXT _("New shortcut...")
+
+static void             egg_cell_renderer_keys_finalize      (GObject             *object);
+static void             egg_cell_renderer_keys_init          (EggCellRendererKeys *cell_keys);
+static void             egg_cell_renderer_keys_class_init    (EggCellRendererKeysClass *cell_keys_class);
+static GtkCellEditable *egg_cell_renderer_keys_start_editing (GtkCellRenderer          *cell,
+							      GdkEvent                 *event,
+							      GtkWidget                *widget,
+							      const gchar              *path,
+							      const GdkRectangle       *background_area,
+							      const GdkRectangle       *cell_area,
+							      GtkCellRendererState      flags);
+
+static void egg_cell_renderer_keys_get_property (GObject         *object,
+						 guint            param_id,
+						 GValue          *value,
+						 GParamSpec      *pspec);
+static void egg_cell_renderer_keys_set_property (GObject         *object,
+						 guint            param_id,
+						 const GValue    *value,
+						 GParamSpec      *pspec);
+static void egg_cell_renderer_keys_get_size	(GtkCellRenderer    *cell,
+						 GtkWidget          *widget,
+						 const GdkRectangle *cell_area,
+						 gint               *x_offset,
+						 gint               *y_offset,
+						 gint               *width,
+						 gint               *height);
+
+enum {
+  PROP_0,
+
+  PROP_ACCEL_KEY,
+  PROP_ACCEL_MASK,
+  PROP_KEYCODE,
+  PROP_ACCEL_MODE
+};
+
+static GtkCellRendererTextClass* parent_class = NULL;
+
+GType egg_cell_renderer_keys_get_type(void)
+{
+	static GType cell_keys_type = 0;
+
+	if (!cell_keys_type)
+	{
+		static const GTypeInfo cell_keys_info = {
+			sizeof (EggCellRendererKeysClass),
+			NULL,		/* base_init */
+			NULL,		/* base_finalize */
+			(GClassInitFunc)egg_cell_renderer_keys_class_init,
+			NULL,		/* class_finalize */
+			NULL,		/* class_data */
+			sizeof (EggCellRendererKeys),
+			0,              /* n_preallocs */
+			(GInstanceInitFunc) egg_cell_renderer_keys_init,
+			NULL
+		};
+
+	  cell_keys_type = g_type_register_static (GTK_TYPE_CELL_RENDERER_TEXT, "EggCellRendererKeys", &cell_keys_info, 0);
+	}
+
+	return cell_keys_type;
+}
+
+static void egg_cell_renderer_keys_init(EggCellRendererKeys* cell_keys)
+{
+	cell_keys->accel_mode = EGG_CELL_RENDERER_KEYS_MODE_GTK;
+}
+
+/* FIXME setup stuff to generate this */
+/* VOID:STRING,UINT,FLAGS,UINT */
+static void marshal_VOID__STRING_UINT_FLAGS_UINT(GClosure* closure, GValue* return_value, guint n_param_values, const GValue* param_values, gpointer invocation_hint, gpointer marshal_data)
+{
+	/* typedef inside a function? wow */
+	typedef void (*GMarshalFunc_VOID__STRING_UINT_FLAGS_UINT) (
+		gpointer data1,
+		const char* arg_1,
+		guint arg_2,
+		int arg_3,
+		guint arg_4,
+		gpointer data2);
+
+	register GMarshalFunc_VOID__STRING_UINT_FLAGS_UINT callback;
+	register GCClosure* cc = (GCClosure*) closure;
+	register gpointer data1, data2;
+
+	g_return_if_fail (n_param_values == 5);
+
+	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__STRING_UINT_FLAGS_UINT) (marshal_data ? marshal_data : cc->callback);
+
+	callback(data1,
+		g_value_get_string(param_values + 1),
+		g_value_get_uint(param_values + 2),
+		g_value_get_flags(param_values + 3),
+		g_value_get_uint(param_values + 4),
+		data2);
+}
+
+static void
+egg_cell_renderer_keys_class_init (EggCellRendererKeysClass *cell_keys_class)
+{
+  GObjectClass *object_class;
+  GtkCellRendererClass *cell_renderer_class;
+
+  object_class = G_OBJECT_CLASS (cell_keys_class);
+  cell_renderer_class = GTK_CELL_RENDERER_CLASS (cell_keys_class);
+  parent_class = g_type_class_peek_parent (object_class);
+
+  GTK_CELL_RENDERER_CLASS (cell_keys_class)->start_editing = egg_cell_renderer_keys_start_editing;
+
+  object_class->set_property = egg_cell_renderer_keys_set_property;
+  object_class->get_property = egg_cell_renderer_keys_get_property;
+  cell_renderer_class->get_size = egg_cell_renderer_keys_get_size;
+
+  object_class->finalize = egg_cell_renderer_keys_finalize;
+
+  /* FIXME if this gets moved to a real library, rename the properties
+   * to match whatever the GTK convention is
+   */
+
+  g_object_class_install_property (object_class,
+                                   PROP_ACCEL_KEY,
+                                   g_param_spec_uint ("accel_key",
+                                                     _("Accelerator key"),
+                                                     _("Accelerator key"),
+                                                      0,
+                                                      G_MAXINT,
+                                                      0,
+                                                      G_PARAM_READABLE | G_PARAM_WRITABLE));
+
+  g_object_class_install_property (object_class,
+                                   PROP_ACCEL_MASK,
+                                   g_param_spec_flags ("accel_mask",
+                                                       _("Accelerator modifiers"),
+                                                       _("Accelerator modifiers"),
+                                                       GDK_TYPE_MODIFIER_TYPE,
+                                                       0,
+                                                       G_PARAM_READABLE | G_PARAM_WRITABLE));
+
+  g_object_class_install_property (object_class,
+		  		   PROP_KEYCODE,
+				   g_param_spec_uint ("keycode",
+					   	      _("Accelerator keycode"),
+						      _("Accelerator keycode"),
+						      0,
+						      G_MAXINT,
+						      0,
+						      G_PARAM_READABLE | G_PARAM_WRITABLE));
+
+  /* FIXME: Register the enum when moving to GTK+ */
+  g_object_class_install_property (object_class,
+                                   PROP_ACCEL_MODE,
+                                   g_param_spec_int ("accel_mode",
+						     _("Accel Mode"),
+						     _("The type of accelerator."),
+						     0,
+						     2,
+						     0,
+						     G_PARAM_READABLE | G_PARAM_WRITABLE));
+
+  g_signal_new ("accel_edited",
+                EGG_TYPE_CELL_RENDERER_KEYS,
+                G_SIGNAL_RUN_LAST,
+                G_STRUCT_OFFSET (EggCellRendererKeysClass, accel_edited),
+                NULL, NULL,
+                marshal_VOID__STRING_UINT_FLAGS_UINT,
+                G_TYPE_NONE, 4,
+                G_TYPE_STRING,
+                G_TYPE_UINT,
+                GDK_TYPE_MODIFIER_TYPE,
+		G_TYPE_UINT);
+
+  g_signal_new ("accel_cleared",
+                EGG_TYPE_CELL_RENDERER_KEYS,
+                G_SIGNAL_RUN_LAST,
+                G_STRUCT_OFFSET (EggCellRendererKeysClass, accel_cleared),
+                NULL, NULL,
+                g_cclosure_marshal_VOID__STRING,
+                G_TYPE_NONE, 1,
+		G_TYPE_STRING);
+}
+
+GtkCellRenderer* egg_cell_renderer_keys_new(void)
+{
+	return GTK_CELL_RENDERER(g_object_new(EGG_TYPE_CELL_RENDERER_KEYS, NULL));
+}
+
+static void egg_cell_renderer_keys_finalize(GObject* object)
+{
+	(*G_OBJECT_CLASS(parent_class)->finalize)(object);
+}
+
+static gchar* convert_keysym_state_to_string(guint keysym, guint keycode, EggVirtualModifierType mask)
+{
+	if (keysym == 0 && keycode == 0)
+	{
+		return g_strdup (_("Disabled"));
+	}
+	else
+	{
+		return egg_virtual_accelerator_label(keysym, keycode, mask);
+	}
+}
+
+static void
+egg_cell_renderer_keys_get_property  (GObject                  *object,
+                                      guint                     param_id,
+                                      GValue                   *value,
+                                      GParamSpec               *pspec)
+{
+  EggCellRendererKeys *keys;
+
+  g_return_if_fail (EGG_IS_CELL_RENDERER_KEYS (object));
+
+  keys = EGG_CELL_RENDERER_KEYS (object);
+
+  switch (param_id)
+    {
+    case PROP_ACCEL_KEY:
+      g_value_set_uint (value, keys->accel_key);
+      break;
+
+    case PROP_ACCEL_MASK:
+      g_value_set_flags (value, keys->accel_mask);
+      break;
+
+    case PROP_ACCEL_MODE:
+      g_value_set_int (value, keys->accel_mode);
+      break;
+
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+    }
+}
+
+static void
+egg_cell_renderer_keys_set_property  (GObject                  *object,
+                                      guint                     param_id,
+                                      const GValue             *value,
+                                      GParamSpec               *pspec)
+{
+  EggCellRendererKeys *keys;
+
+  g_return_if_fail (EGG_IS_CELL_RENDERER_KEYS (object));
+
+  keys = EGG_CELL_RENDERER_KEYS (object);
+
+  switch (param_id)
+    {
+    case PROP_ACCEL_KEY:
+      egg_cell_renderer_keys_set_accelerator (keys,
+                                              g_value_get_uint (value),
+					      keys->keycode,
+                                              keys->accel_mask);
+      break;
+
+    case PROP_ACCEL_MASK:
+      egg_cell_renderer_keys_set_accelerator (keys,
+                                              keys->accel_key,
+					      keys->keycode,
+                                              g_value_get_flags (value));
+      break;
+    case PROP_KEYCODE:
+      egg_cell_renderer_keys_set_accelerator (keys,
+		      			      keys->accel_key,
+					      g_value_get_uint (value),
+					      keys->accel_mask);
+      break;
+
+    case PROP_ACCEL_MODE:
+      egg_cell_renderer_keys_set_accel_mode (keys, g_value_get_int (value));
+      break;
+
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+    }
+}
+
+static gboolean is_modifier(guint keycode)
+{
+	gint i;
+	gint map_size;
+	XModifierKeymap* mod_keymap;
+	gboolean retval = FALSE;
+
+	mod_keymap = XGetModifierMapping(gdk_x11_display_get_xdisplay(gdk_display_get_default()));
+
+	map_size = 8 * mod_keymap->max_keypermod;
+	i = 0;
+
+	while (i < map_size)
+	{
+		if (keycode == mod_keymap->modifiermap[i])
+		{
+			retval = TRUE;
+			break;
+		}
+
+		++i;
+	}
+
+	XFreeModifiermap(mod_keymap);
+
+	return retval;
+}
+
+static void
+egg_cell_renderer_keys_get_size(GtkCellRenderer    *cell,
+				 GtkWidget          *widget,
+				 const GdkRectangle *cell_area,
+				 gint               *x_offset,
+				 gint               *y_offset,
+				 gint               *width,
+				 gint               *height)
+{
+  EggCellRendererKeys *keys = (EggCellRendererKeys *) cell;
+  GtkRequisition requisition;
+
+  if (keys->sizing_label == NULL)
+    keys->sizing_label = gtk_label_new (TOOLTIP_TEXT);
+
+  gtk_widget_get_preferred_size (keys->sizing_label, &requisition, NULL);
+  (* GTK_CELL_RENDERER_CLASS (parent_class)->get_size) (cell, widget, cell_area, x_offset, y_offset, width, height);
+  /* FIXME: need to take the cell_area et al. into account */
+  if (width)
+    *width = MAX (*width, requisition.width);
+  if (height)
+    *height = MAX (*height, requisition.height);
+}
+
+/* FIXME: Currently we don't differentiate between a 'bogus' key (like tab in
+ * GTK mode) and a removed key.
+ */
+
+static gboolean grab_key_callback(GtkWidget* widget, GdkEventKey* event, void* data)
+{
+	GdkModifierType accel_mods = 0;
+	guint accel_keyval;
+	EggCellRendererKeys *keys;
+	char *path;
+	gboolean edited;
+	gboolean cleared;
+	GdkModifierType consumed_modifiers;
+	guint upper;
+	GdkModifierType ignored_modifiers;
+	GdkDisplay *display;
+	GdkSeat *seat;
+
+	keys = EGG_CELL_RENDERER_KEYS(data);
+
+	if (is_modifier(event->hardware_keycode))
+	{
+		return TRUE;
+	}
+
+	edited = FALSE;
+	cleared = FALSE;
+
+	consumed_modifiers = 0;
+	gdk_keymap_translate_keyboard_state (gdk_keymap_get_for_display (gdk_display_get_default ()),
+		event->hardware_keycode,
+		event->state,
+		event->group,
+		NULL, NULL, NULL, &consumed_modifiers);
+
+	upper = event->keyval;
+	accel_keyval = gdk_keyval_to_lower(upper);
+
+	if (accel_keyval == GDK_KEY_ISO_Left_Tab)
+	{
+		accel_keyval = GDK_KEY_Tab;
+	}
+
+	/* Put shift back if it changed the case of the key, not otherwise. */
+	if (upper != accel_keyval && (consumed_modifiers & GDK_SHIFT_MASK))
+	{
+		consumed_modifiers &= ~(GDK_SHIFT_MASK);
+	}
+
+	egg_keymap_resolve_virtual_modifiers (gdk_keymap_get_for_display (gdk_display_get_default ()),
+		EGG_VIRTUAL_NUM_LOCK_MASK |
+		EGG_VIRTUAL_SCROLL_LOCK_MASK |
+		EGG_VIRTUAL_LOCK_MASK,
+		&ignored_modifiers);
+
+	/* http://bugzilla.gnome.org/show_bug.cgi?id=139605
+	 * mouse keys should effect keybindings */
+	ignored_modifiers |= GDK_BUTTON1_MASK |
+		GDK_BUTTON2_MASK |
+		GDK_BUTTON3_MASK |
+		GDK_BUTTON4_MASK |
+		GDK_BUTTON5_MASK;
+
+	/* filter consumed/ignored modifiers */
+	if (keys->accel_mode == EGG_CELL_RENDERER_KEYS_MODE_GTK)
+	{
+		accel_mods = event->state & GDK_MODIFIER_MASK & ~(consumed_modifiers | ignored_modifiers);
+	}
+	else if (keys->accel_mode == EGG_CELL_RENDERER_KEYS_MODE_X)
+	{
+		accel_mods = event->state & GDK_MODIFIER_MASK & ~(ignored_modifiers);
+	}
+	else
+	{
+		g_assert_not_reached();
+	}
+
+	if (accel_mods == 0 && accel_keyval == GDK_KEY_Escape)
+	{
+		goto out; /* cancel */
+	}
+
+	/* clear the accelerator on Backspace */
+	if (accel_mods == 0 && accel_keyval == GDK_KEY_BackSpace)
+	{
+		cleared = TRUE;
+		goto out;
+	}
+
+	if (keys->accel_mode == EGG_CELL_RENDERER_KEYS_MODE_GTK)
+	{
+		if (!gtk_accelerator_valid (accel_keyval, accel_mods))
+		{
+			accel_keyval = 0;
+			accel_mods = 0;
+		}
+	}
+
+	edited = TRUE;
+
+	out:
+
+	display = gtk_widget_get_display (widget);
+	seat = gdk_display_get_default_seat (display);
+
+	gdk_seat_ungrab (seat);
+
+	path = g_strdup(g_object_get_data(G_OBJECT(keys->edit_widget), EGG_CELL_RENDERER_TEXT_PATH));
+
+	gtk_cell_editable_editing_done(GTK_CELL_EDITABLE(keys->edit_widget));
+	gtk_cell_editable_remove_widget(GTK_CELL_EDITABLE(keys->edit_widget));
+	keys->edit_widget = NULL;
+	keys->grab_widget = NULL;
+
+	if (edited)
+	{
+		g_signal_emit_by_name(G_OBJECT(keys), "accel_edited", path, accel_keyval, accel_mods, event->hardware_keycode);
+	}
+	else if (cleared)
+	{
+		g_signal_emit_by_name(G_OBJECT(keys), "accel_cleared", path);
+	}
+
+	g_free (path);
+	return TRUE;
+}
+
+static void ungrab_stuff(GtkWidget* widget, gpointer data)
+{
+	EggCellRendererKeys* keys = EGG_CELL_RENDERER_KEYS(data);
+	GdkDisplay *display;
+	GdkSeat *seat;
+
+	display = gtk_widget_get_display (widget);
+	seat = gdk_display_get_default_seat (display);
+
+	gdk_seat_ungrab (seat);
+
+	g_signal_handlers_disconnect_by_func(G_OBJECT(keys->grab_widget), G_CALLBACK(grab_key_callback), data);
+}
+
+static void pointless_eventbox_start_editing(GtkCellEditable* cell_editable, GdkEvent* event)
+{
+	/* do nothing, because we are pointless */
+}
+
+static void pointless_eventbox_cell_editable_init(GtkCellEditableIface* iface)
+{
+	iface->start_editing = pointless_eventbox_start_editing;
+}
+
+static GType
+pointless_eventbox_subclass_get_type (void)
+{
+  static GType eventbox_type = 0;
+
+  if (!eventbox_type)
+    {
+      static const GTypeInfo eventbox_info =
+      {
+        sizeof (GtkEventBoxClass),
+	NULL,		/* base_init */
+	NULL,		/* base_finalize */
+        NULL,
+	NULL,		/* class_finalize */
+	NULL,		/* class_data */
+        sizeof (GtkEventBox),
+	0,              /* n_preallocs */
+        (GInstanceInitFunc) NULL,
+        NULL
+      };
+
+      static const GInterfaceInfo cell_editable_info = {
+        (GInterfaceInitFunc) pointless_eventbox_cell_editable_init,
+        NULL, NULL };
+
+      eventbox_type = g_type_register_static (GTK_TYPE_EVENT_BOX, "EggCellEditableEventBox", &eventbox_info, 0);
+
+      g_type_add_interface_static (eventbox_type,
+				   GTK_TYPE_CELL_EDITABLE,
+				   &cell_editable_info);
+    }
+
+  return eventbox_type;
+}
+
+static void
+override_background_color (GtkWidget *widget,
+                           GdkRGBA   *rgba)
+{
+  gchar          *css;
+  GtkCssProvider *provider;
+
+  provider = gtk_css_provider_new ();
+
+  css = g_strdup_printf ("* { background-color: %s;}",
+                         gdk_rgba_to_string (rgba));
+  gtk_css_provider_load_from_data (provider, css, -1, NULL);
+  g_free (css);
+
+  gtk_style_context_add_provider (gtk_widget_get_style_context (widget),
+                                  GTK_STYLE_PROVIDER (provider),
+                                  GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+  g_object_unref (provider);
+}
+
+static void
+override_color (GtkWidget *widget,
+                GdkRGBA   *rgba)
+{
+  gchar          *css;
+  GtkCssProvider *provider;
+
+  provider = gtk_css_provider_new ();
+
+  css = g_strdup_printf ("* { color: %s;}",
+                         gdk_rgba_to_string (rgba));
+  gtk_css_provider_load_from_data (provider, css, -1, NULL);
+  g_free (css);
+
+  gtk_style_context_add_provider (gtk_widget_get_style_context (widget),
+                                  GTK_STYLE_PROVIDER (provider),
+                                  GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+  g_object_unref (provider);
+}
+
+static GtkCellEditable *
+egg_cell_renderer_keys_start_editing (GtkCellRenderer      *cell,
+				      GdkEvent             *event,
+				      GtkWidget            *widget,
+				      const gchar          *path,
+				      const GdkRectangle   *background_area,
+				      const GdkRectangle   *cell_area,
+				      GtkCellRendererState  flags)
+{
+  GtkCellRendererText *celltext;
+  EggCellRendererKeys *keys;
+  GdkDisplay *display;
+  GdkSeat *seat;
+  GtkWidget *label;
+  GtkWidget *eventbox;
+  GValue celltext_editable = {0};
+  GdkRGBA box_color;
+  GdkRGBA label_color;
+  GdkRGBA *c;
+
+  celltext = GTK_CELL_RENDERER_TEXT (cell);
+  keys = EGG_CELL_RENDERER_KEYS (cell);
+
+  /* If the cell isn't editable we return NULL. */
+  g_value_init (&celltext_editable, G_TYPE_BOOLEAN);
+  g_object_get_property (G_OBJECT (celltext), "editable", &celltext_editable);
+  if (g_value_get_boolean (&celltext_editable) == FALSE)
+    return NULL;
+  g_return_val_if_fail (gtk_widget_get_window (widget) != NULL, NULL);
+
+  display = gtk_widget_get_display (widget);
+  seat = gdk_display_get_default_seat (display);
+
+  if (gdk_seat_grab (seat,
+                     gtk_widget_get_window (widget),
+                     GDK_SEAT_CAPABILITY_ALL,
+                     FALSE,
+                     NULL,
+                     event,
+                     NULL,
+                     NULL) != GDK_GRAB_SUCCESS)
+    return NULL;
+
+  keys->grab_widget = widget;
+
+  g_signal_connect (widget, "key_press_event",
+                    G_CALLBACK (grab_key_callback),
+                    keys);
+
+  eventbox = g_object_new (pointless_eventbox_subclass_get_type (),
+                           NULL);
+  keys->edit_widget = eventbox;
+  g_object_add_weak_pointer (G_OBJECT (keys->edit_widget),
+                             (void**) &keys->edit_widget);
+
+  label = gtk_label_new (NULL);
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+
+  gtk_style_context_get (gtk_widget_get_style_context (widget), GTK_STATE_INSENSITIVE,
+                         GTK_STYLE_PROPERTY_BACKGROUND_COLOR,
+                         &c, NULL);
+  box_color = *c;
+  gdk_rgba_free (c);
+
+  override_background_color (eventbox, &box_color);
+
+  gtk_style_context_get_color (gtk_widget_get_style_context (widget),
+                               GTK_STATE_INSENSITIVE,
+                               &label_color);
+
+  override_color (label, &label_color);
+
+  gtk_label_set_text (GTK_LABEL (label),
+		  TOOLTIP_TEXT);
+
+  gtk_container_add (GTK_CONTAINER (eventbox), label);
+
+  g_object_set_data_full (G_OBJECT (keys->edit_widget), EGG_CELL_RENDERER_TEXT_PATH,
+                          g_strdup (path), g_free);
+
+  gtk_widget_show_all (keys->edit_widget);
+
+  g_signal_connect (keys->edit_widget, "unrealize",
+                    G_CALLBACK (ungrab_stuff),
+                    keys);
+
+  keys->edit_key = keys->accel_key;
+
+  return GTK_CELL_EDITABLE (keys->edit_widget);
+}
+
+void egg_cell_renderer_keys_set_accelerator(EggCellRendererKeys* keys, guint keyval, guint keycode, EggVirtualModifierType mask)
+{
+	char *text;
+	gboolean changed;
+
+	g_return_if_fail (EGG_IS_CELL_RENDERER_KEYS (keys));
+
+	g_object_freeze_notify (G_OBJECT (keys));
+
+	changed = FALSE;
+
+	if (keyval != keys->accel_key)
+	{
+		keys->accel_key = keyval;
+		g_object_notify (G_OBJECT (keys), "accel_key");
+		changed = TRUE;
+	}
+
+	if (mask != keys->accel_mask)
+	{
+		keys->accel_mask = mask;
+
+		g_object_notify (G_OBJECT (keys), "accel_mask");
+		changed = TRUE;
+	}
+
+	if (keycode != keys->keycode)
+	{
+		keys->keycode = keycode;
+
+		g_object_notify (G_OBJECT (keys), "keycode");
+		changed = TRUE;
+	}
+
+	g_object_thaw_notify (G_OBJECT (keys));
+
+	if (changed)
+	{
+		/* sync string to the key values */
+		text = convert_keysym_state_to_string (keys->accel_key, keys->keycode, keys->accel_mask);
+		g_object_set (keys, "text", text, NULL);
+		g_free (text);
+	}
+}
+
+void egg_cell_renderer_keys_get_accelerator(EggCellRendererKeys* keys, guint* keyval, EggVirtualModifierType* mask)
+{
+	g_return_if_fail(EGG_IS_CELL_RENDERER_KEYS(keys));
+
+	if (keyval)
+	{
+		*keyval = keys->accel_key;
+	}
+
+	if (mask)
+	{
+		*mask = keys->accel_mask;
+	}
+}
+
+void egg_cell_renderer_keys_set_accel_mode (EggCellRendererKeys* keys, EggCellRendererKeysMode accel_mode)
+{
+	g_return_if_fail(EGG_IS_CELL_RENDERER_KEYS(keys));
+	keys->accel_mode = accel_mode;
+	g_object_notify(G_OBJECT(keys), "accel_mode");
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/57.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/57.html new file mode 100644 index 00000000..7c479251 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/57.html @@ -0,0 +1,413 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/* gtkcellrendererkeybinding.h
+ * Copyright (C) 2000  Red Hat, Inc.,  Jonathan Blandford <jrb@redhat.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library 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.
+ */
+
+#ifndef __EGG_CELL_RENDERER_KEYS_H__
+#define __EGG_CELL_RENDERER_KEYS_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 "eggaccelerators.h"
+
+G_BEGIN_DECLS
+
+#define EGG_TYPE_CELL_RENDERER_KEYS		(egg_cell_renderer_keys_get_type ())
+#define EGG_CELL_RENDERER_KEYS(obj)		(G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_CELL_RENDERER_KEYS, EggCellRendererKeys))
+#define EGG_CELL_RENDERER_KEYS_CLASS(klass)	(G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_CELL_RENDERER_KEYS, EggCellRendererKeysClass))
+#define EGG_IS_CELL_RENDERER_KEYS(obj)		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_CELL_RENDERER_KEYS))
+#define EGG_IS_CELL_RENDERER_KEYS_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_CELL_RENDERER_KEYS))
+#define EGG_CELL_RENDERER_KEYS_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_CELL_RENDERER_KEYS, EggCellRendererKeysClass))
+
+typedef struct _EggCellRendererKeys      EggCellRendererKeys;
+typedef struct _EggCellRendererKeysClass EggCellRendererKeysClass;
+
+
+typedef enum
+{
+  EGG_CELL_RENDERER_KEYS_MODE_GTK,
+  EGG_CELL_RENDERER_KEYS_MODE_X
+} EggCellRendererKeysMode;
+
+struct _EggCellRendererKeys
+{
+  GtkCellRendererText parent;
+  guint accel_key;
+  guint keycode;
+  EggVirtualModifierType accel_mask;
+  GtkWidget *edit_widget;
+  GtkWidget *grab_widget;
+  guint edit_key;
+  GtkWidget *sizing_label;
+  EggCellRendererKeysMode accel_mode;
+};
+
+struct _EggCellRendererKeysClass
+{
+  GtkCellRendererTextClass parent_class;
+
+  void (* accel_edited) (EggCellRendererKeys    *keys,
+			 const char             *path_string,
+			 guint                   keyval,
+			 EggVirtualModifierType  mask,
+			 guint                   hardware_keycode);
+
+  void (* accel_cleared) (EggCellRendererKeys    *keys,
+			  const char             *path_string);
+};
+
+GType            egg_cell_renderer_keys_get_type        (void);
+GtkCellRenderer *egg_cell_renderer_keys_new             (void);
+
+void             egg_cell_renderer_keys_set_accelerator (EggCellRendererKeys     *keys,
+							 guint                    keyval,
+							 guint                    keycode,
+							 EggVirtualModifierType   mask);
+void             egg_cell_renderer_keys_get_accelerator (EggCellRendererKeys     *keys,
+							 guint                   *keyval,
+							 EggVirtualModifierType  *mask);
+void             egg_cell_renderer_keys_set_accel_mode  (EggCellRendererKeys     *keys,
+							 EggCellRendererKeysMode  accel_mode);
+
+G_END_DECLS
+
+#endif /* __GTK_CELL_RENDERER_KEYS_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/58.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/58.html new file mode 100644 index 00000000..da06f05e --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/58.html @@ -0,0 +1,903 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
#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.keybindings"), aligned (8)))
+#else
+# define SECTION
+#endif
+
+static const SECTION union { const guint8 data[2005]; const double alignment; void * const ptr;}  keybindings_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, 0310, 0000, 0000, 0000, 0000, 0000, 0000, 0050, 0006, 0000, 0000, 0000, 
+  0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0002, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 
+  0004, 0000, 0000, 0000, 0004, 0000, 0000, 0000, 0113, 0120, 0220, 0013, 0002, 0000, 0000, 0000, 
+  0310, 0000, 0000, 0000, 0004, 0000, 0114, 0000, 0314, 0000, 0000, 0000, 0320, 0000, 0000, 0000, 
+  0047, 0133, 0250, 0374, 0003, 0000, 0000, 0000, 0320, 0000, 0000, 0000, 0035, 0000, 0166, 0000, 
+  0360, 0000, 0000, 0000, 0253, 0007, 0000, 0000, 0324, 0265, 0002, 0000, 0377, 0377, 0377, 0377, 
+  0253, 0007, 0000, 0000, 0001, 0000, 0114, 0000, 0254, 0007, 0000, 0000, 0260, 0007, 0000, 0000, 
+  0351, 0040, 0131, 0215, 0005, 0000, 0000, 0000, 0260, 0007, 0000, 0000, 0014, 0000, 0114, 0000, 
+  0274, 0007, 0000, 0000, 0300, 0007, 0000, 0000, 0201, 0321, 0040, 0031, 0000, 0000, 0000, 0000, 
+  0300, 0007, 0000, 0000, 0005, 0000, 0114, 0000, 0310, 0007, 0000, 0000, 0314, 0007, 0000, 0000, 
+  0143, 0041, 0175, 0170, 0004, 0000, 0000, 0000, 0314, 0007, 0000, 0000, 0004, 0000, 0114, 0000, 
+  0320, 0007, 0000, 0000, 0324, 0007, 0000, 0000, 0157, 0162, 0147, 0057, 0004, 0000, 0000, 0000, 
+  0155, 0141, 0164, 0145, 0055, 0153, 0145, 0171, 0142, 0151, 0156, 0144, 0151, 0156, 0147, 0055, 
+  0160, 0162, 0157, 0160, 0145, 0162, 0164, 0151, 0145, 0163, 0056, 0165, 0151, 0000, 0000, 0000, 
+  0265, 0105, 0000, 0000, 0001, 0000, 0000, 0000, 0170, 0332, 0355, 0134, 0315, 0162, 0333, 0066, 
+  0020, 0276, 0347, 0051, 0120, 0034, 0323, 0120, 0262, 0344, 0044, 0355, 0164, 0144, 0146, 0362, 
+  0077, 0235, 0376, 0134, 0342, 0064, 0107, 0016, 0004, 0256, 0104, 0324, 0020, 0300, 0002, 0240, 
+  0144, 0365, 0324, 0147, 0351, 0243, 0365, 0111, 0012, 0220, 0262, 0254, 0037, 0220, 0024, 0051, 
+  0071, 0222, 0047, 0272, 0144, 0034, 0032, 0337, 0002, 0373, 0161, 0261, 0013, 0354, 0056, 0075, 
+  0170, 0165, 0073, 0341, 0150, 0012, 0112, 0063, 0051, 0256, 0160, 0257, 0163, 0201, 0021, 0010, 
+  0052, 0143, 0046, 0306, 0127, 0370, 0363, 0365, 0207, 0340, 0107, 0374, 0052, 0174, 0062, 0370, 
+  0056, 0010, 0320, 0107, 0020, 0240, 0210, 0201, 0030, 0315, 0230, 0111, 0320, 0230, 0223, 0030, 
+  0320, 0145, 0247, 0177, 0321, 0271, 0100, 0101, 0140, 0007, 0061, 0141, 0100, 0215, 0010, 0205, 
+  0360, 0011, 0102, 0003, 0005, 0177, 0145, 0114, 0201, 0106, 0234, 0015, 0257, 0360, 0330, 0334, 
+  0174, 0217, 0357, 0047, 0272, 0354, 0364, 0236, 0343, 0156, 0076, 0316, 0211, 0136, 0042, 0003, 
+  0316, 0050, 0010, 0015, 0201, 0231, 0247, 0200, 0306, 0051, 0237, 0366, 0163, 0331, 0133, 0343, 
+  0004, 0231, 0000, 0232, 0330, 0325, 0004, 0067, 0060, 0037, 0062, 0341, 0026, 0034, 0304, 0214, 
+  0160, 0071, 0356, 0144, 0314, 0217, 0211, 0101, 0123, 0305, 0122, 0143, 0127, 0200, 0362, 0241, 
+  0126, 0021, 0021, 0313, 0031, 0032, 0111, 0205, 0150, 0102, 0304, 0330, 0012, 0101, 0367, 0362, 
+  0264, 0137, 0014, 0225, 0351, 0134, 0261, 0161, 0142, 0320, 0157, 0257, 0257, 0337, 0243, 0167, 
+  0060, 0005, 0056, 0123, 0120, 0376, 0321, 0044, 0063, 0211, 0124, 0032, 0175, 0221, 0174, 0064, 
+  0266, 0123, 0240, 0317, 0174, 0250, 0030, 0115, 0356, 0106, 0313, 0341, 0237, 0100, 0015, 0242, 
+  0234, 0150, 0175, 0205, 0077, 0232, 0233, 0167, 0271, 0022, 0030, 0261, 0370, 0012, 0323, 0114, 
+  0033, 0071, 0011, 0264, 0225, 0140, 0150, 0146, 0026, 0012, 0142, 0007, 0264, 0320, 0124, 0271, 
+  0151, 0315, 0034, 0071, 0062, 0256, 0260, 0373, 0027, 0207, 0176, 0310, 0240, 0173, 0067, 0330, 
+  0217, 0245, 0104, 0104, 0043, 0151, 0261, 0070, 0374, 0100, 0270, 0206, 0272, 0361, 0206, 0031, 
+  0016, 0030, 0031, 0105, 0204, 0346, 0304, 0220, 0041, 0267, 0017, 0347, 0140, 0341, 0157, 0363, 
+  0371, 0321, 0247, 0305, 0374, 0265, 0202, 0354, 0173, 0216, 0022, 0113, 0027, 0016, 0113, 0126, 
+  0112, 0023, 0306, 0343, 0202, 0120, 0101, 0170, 0220, 0377, 0367, 0012, 0117, 0207, 0362, 0166, 
+  0301, 0203, 0217, 0304, 0067, 0366, 0267, 0071, 0203, 0205, 0320, 0300, 0015, 0357, 0055, 0307, 
+  0157, 0057, 0143, 0312, 0064, 0263, 0072, 0340, 0360, 0132, 0145, 0133, 0312, 0267, 0041, 0314, 
+  0207, 0221, 0212, 0201, 0060, 0304, 0331, 0037, 0016, 0355, 0126, 0060, 0214, 0022, 0356, 0005, 
+  0372, 0165, 0046, 0324, 0101, 0043, 0242, 0200, 0254, 0250, 0342, 0125, 0077, 0063, 0106, 0212, 
+  0115, 0022, 0126, 0360, 0375, 0065, 0001, 0055, 0370, 0150, 0313, 0211, 0017, 0307, 0311, 0134, 
+  0146, 0046, 0322, 0146, 0356, 0146, 0004, 0021, 0227, 0002, 0163, 0042, 0326, 0237, 0225, 0253, 
+  0277, 0330, 0102, 0104, 0120, 0340, 0303, 0374, 0111, 0017, 0157, 0142, 0175, 0213, 0031, 0002, 
+  0307, 0241, 0365, 0127, 0101, 0001, 0055, 0133, 0114, 0153, 0332, 0152, 0250, 0153, 0012, 0125, 
+  0100, 0201, 0115, 0101, 0107, 0061, 0214, 0110, 0306, 0115, 0015, 0371, 0076, 0021, 0231, 0006, 
+  0313, 0276, 0244, 0067, 0165, 0263, 0017, 0272, 0005, 0327, 0133, 0317, 0123, 0102, 0157, 0254, 
+  0307, 0254, 0237, 0012, 0156, 0123, 0042, 0342, 0026, 0153, 0034, 0061, 0316, 0133, 0300, 0122, 
+  0251, 0131, 0261, 0341, 0056, 0252, 0324, 0362, 0256, 0177, 0320, 0365, 0330, 0133, 0033, 0033, 
+  0224, 0067, 0255, 0354, 0217, 0244, 0051, 0237, 0237, 0272, 0371, 0071, 0350, 0322, 0362, 0316, 
+  0266, 0373, 0060, 0266, 0333, 0073, 0204, 0355, 0372, 0010, 0360, 0053, 0337, 0112, 0361, 0026, 
+  0112, 0157, 0051, 0154, 0027, 0023, 0271, 0023, 0101, 0165, 0024, 0150, 0272, 0305, 0075, 0024, 
+  0155, 0321, 0263, 0275, 0255, 0053, 0016, 0025, 0356, 0064, 0361, 0374, 0224, 0042, 0350, 0120, 
+  0252, 0030, 0124, 0064, 0143, 0261, 0111, 0160, 0370, 0142, 0127, 0330, 0316, 0007, 0022, 0037, 
+  0130, 0133, 0122, 0055, 0247, 0070, 0174, 0271, 0157, 0270, 0376, 0250, 0130, 0134, 0020, 0233, 
+  0037, 0044, 0167, 0361, 0222, 0207, 0360, 0164, 0215, 0367, 0243, 0222, 0263, 0250, 0136, 0153, 
+  0357, 0254, 0222, 0147, 0023, 0261, 0053, 0330, 0113, 0233, 0237, 0272, 0137, 0363, 0150, 0221, 
+  0163, 0227, 0007, 0216, 0336, 0045, 0366, 0001, 0367, 0040, 0160, 0137, 0022, 0175, 0370, 0204, 
+  0160, 0066, 0266, 0046, 0247, 0015, 0121, 0246, 0051, 0270, 0010, 0220, 0276, 0253, 0107, 0364, 
+  0273, 0035, 0360, 0123, 0123, 0171, 0056, 0200, 0144, 0302, 0156, 0037, 0316, 0104, 0113, 0076, 
+  0046, 0002, 0046, 0122, 0060, 0352, 0066, 0340, 0030, 0314, 0366, 0045, 0314, 0015, 0013, 0354, 
+  0126, 0123, 0363, 0152, 0321, 0145, 0061, 0252, 0072, 0116, 0171, 0131, 0202, 0221, 0211, 0210, 
+  0061, 0204, 0046, 0225, 0107, 0037, 0077, 0332, 0310, 0164, 0127, 0160, 0111, 0374, 0051, 0075, 
+  0077, 0065, 0265, 0360, 0367, 0216, 0065, 0377, 0155, 0370, 0236, 0325, 0257, 0154, 0364, 0155, 
+  0340, 0311, 0135, 0020, 0155, 0003, 0146, 0142, 0261, 0364, 0210, 0046, 0104, 0341, 0360, 0277, 
+  0177, 0376, 0155, 0052, 0302, 0135, 0376, 0246, 0304, 0254, 0236, 0265, 0352, 0127, 0362, 0100, 
+  0366, 0330, 0173, 0100, 0173, 0334, 0006, 0057, 0242, 0142, 0377, 0270, 0166, 0274, 0345, 0251, 
+  0237, 0177, 0303, 0236, 0372, 0155, 0044, 0047, 0023, 0273, 0033, 0116, 0322, 0131, 0323, 0142, 
+  0155, 0217, 0325, 0137, 0367, 0116, 0326, 0137, 0257, 0021, 0173, 0166, 0331, 0337, 0216, 0313, 
+  0076, 0262, 0111, 0256, 0245, 0003, 0113, 0154, 0262, 0110, 0320, 0340, 0275, 0217, 0240, 0157, 
+  0354, 0045, 0101, 0003, 0162, 0251, 0033, 0173, 0231, 0162, 0067, 0053, 0335, 0351, 0164, 0232, 
+  0222, 0167, 0114, 0253, 0337, 0316, 0311, 0264, 0221, 0322, 0330, 0121, 0077, 0220, 0335, 0366, 
+  0117, 0312, 0156, 0017, 0227, 0203, 0152, 0172, 0357, 0055, 0262, 0061, 0115, 0121, 0007, 0316, 
+  0236, 0036, 0045, 0003, 0325, 0044, 0377, 0122, 0233, 0161, 0253, 0117, 0045, 0255, 0353, 0270, 
+  0366, 0313, 0101, 0121, 0200, 0011, 0212, 0203, 0207, 0136, 0042, 0326, 0036, 0043, 0005, 0072, 
+  0265, 0136, 0303, 0256, 0046, 0170, 0151, 0017, 0047, 0253, 0345, 0213, 0101, 0167, 0155, 0150, 
+  0275, 0200, 0027, 0070, 0134, 0346, 0236, 0275, 0340, 0215, 0207, 0371, 0232, 0126, 0065, 0330, 
+  0166, 0246, 0257, 0323, 0364, 0155, 0042, 0245, 0006, 0125, 0125, 0250, 0134, 0361, 0177, 0325, 
+  0105, 0313, 0246, 0205, 0307, 0211, 0214, 0111, 0311, 0113, 0335, 0034, 0032, 0203, 0066, 0112, 
+  0316, 0043, 0127, 0255, 0216, 0122, 0242, 0100, 0230, 0335, 0200, 0365, 0065, 0311, 0115, 0200, 
+  0013, 0004, 0056, 0225, 0146, 0125, 0121, 0255, 0113, 0260, 0122, 0030, 0047, 0242, 0310, 0177, 
+  0076, 0355, 0076, 0075, 0134, 0045, 0364, 0130, 0145, 0314, 0262, 0214, 0141, 0377, 0201, 0213, 
+  0236, 0107, 0055, 0123, 0076, 0202, 0064, 0373, 0376, 0011, 0363, 0122, 0057, 0127, 0355, 0074, 
+  0126, 0135, 0206, 0277, 0171, 0243, 0262, 0267, 0301, 0017, 0071, 0164, 0157, 0103, 0115, 0062, 
+  0175, 0367, 0126, 0210, 0137, 0354, 0112, 0045, 0121, 0361, 0262, 0031, 0102, 0067, 0360, 0074, 
+  0102, 0252, 0311, 0366, 0266, 0332, 0263, 0033, 0342, 0316, 0045, 0105, 0153, 0144, 0227, 0023, 
+  0136, 0343, 0302, 0036, 0101, 0047, 0305, 0261, 0134, 0120, 0111, 0337, 0105, 0357, 0233, 0351, 
+  0273, 0110, 0200, 0247, 0255, 0252, 0336, 0016, 0170, 0056, 0172, 0237, 0213, 0336, 0307, 0154, 
+  0330, 0040, 0161, 0105, 0106, 0240, 0252, 0143, 0043, 0216, 0317, 0246, 0173, 0066, 0335, 0303, 
+  0364, 0153, 0264, 0063, 0135, 0005, 0023, 0071, 0205, 0126, 0326, 0133, 0100, 0277, 0212, 0001, 
+  0153, 0020, 0216, 0253, 0051, 0264, 0240, 0371, 0154, 0374, 0247, 0155, 0374, 0375, 0343, 0031, 
+  0177, 0273, 0066, 0117, 0056, 0065, 0234, 0335, 0366, 0331, 0162, 0303, 0313, 0163, 0233, 0335, 
+  0251, 0265, 0331, 0135, 0236, 0333, 0354, 0026, 0067, 0326, 0136, 0177, 0357, 0353, 0331, 0146, 
+  0032, 0100, 0107, 0153, 0211, 0203, 0023, 0153, 0267, 0153, 0104, 0133, 0273, 0016, 0305, 0246, 
+  0225, 0304, 0117, 0124, 0111, 0316, 0041, 0376, 0222, 0177, 0067, 0264, 0270, 0053, 0344, 0267, 
+  0173, 0035, 0351, 0342, 0143, 0242, 0307, 0120, 0327, 0326, 0271, 0032, 0103, 0242, 0242, 0124, 
+  0162, 0106, 0347, 0070, 0024, 0140, 0011, 0156, 0134, 0245, 0074, 0220, 0034, 0235, 0020, 0113, 
+  0334, 0302, 0043, 0061, 0121, 0013, 0057, 0175, 0141, 0376, 0227, 0166, 0255, 0000, 0376, 0140, 
+  0060, 0333, 0110, 0201, 0031, 0373, 0170, 0352, 0036, 0227, 0111, 0332, 0363, 0245, 0035, 0340, 
+  0305, 0171, 0143, 0171, 0306, 0155, 0040, 0057, 0162, 0204, 0073, 0313, 0360, 0347, 0265, 0064, 
+  0160, 0240, 0305, 0366, 0052, 0205, 0226, 0021, 0372, 0151, 0211, 0355, 0126, 0314, 0333, 0255, 
+  0176, 0125, 0025, 0045, 0337, 0112, 0360, 0341, 0152, 0305, 0373, 0164, 0170, 0354, 0126, 0122, 
+  0155, 0235, 0343, 0370, 0052, 0235, 0021, 0167, 0021, 0041, 0331, 0370, 0076, 0356, 0144, 0033, 
+  0322, 0326, 0103, 0360, 0313, 0306, 0256, 0246, 0076, 0232, 0266, 0165, 0063, 0077, 0117, 0310, 
+  0030, 0012, 0066, 0231, 0373, 0261, 0167, 0044, 0307, 0262, 0023, 0255, 0336, 0105, 0064, 0351, 
+  0365, 0363, 0222, 0133, 0334, 0017, 0334, 0235, 0152, 0221, 0371, 0146, 0142, 0044, 0333, 0110, 
+  0142, 0124, 0212, 0110, 0263, 0277, 0141, 0207, 0127, 0134, 0347, 0107, 0352, 0134, 0302, 0136, 
+  0127, 0220, 0075, 0257, 0042, 0173, 0073, 0210, 0032, 0047, 0121, 0353, 0204, 0233, 0032, 0371, 
+  0146, 0027, 0153, 0240, 0263, 0361, 0030, 0264, 0171, 0154, 0266, 0236, 0354, 0153, 0353, 0345, 
+  0055, 0140, 0327, 0022, 0101, 0314, 0014, 0042, 0350, 0356, 0250, 0341, 0076, 0051, 0177, 0206, 
+  0142, 0231, 0331, 0101, 0001, 0265, 0007, 0245, 0033, 0044, 0005, 0062, 0011, 0040, 0052, 0125, 
+  0321, 0255, 0341, 0312, 0231, 0110, 0311, 0031, 0262, 0146, 0207, 0362, 0157, 0337, 0011, 0022, 
+  0060, 0163, 0110, 0073, 0150, 0062, 0144, 0042, 0077, 0007, 0077, 0103, 0122, 0241, 0324, 0102, 
+  0064, 0032, 0332, 0167, 0356, 0274, 0031, 0040, 0043, 0355, 0013, 0002, 0242, 0072, 0155, 0364, 
+  0230, 0051, 0222, 0356, 0372, 0052, 0036, 0156, 0237, 0265, 0065, 0205, 0335, 0103, 0160, 0353, 
+  0174, 0355, 0376, 0273, 0354, 0360, 0247, 0225, 0126, 0221, 0363, 0020, 0307, 0225, 0163, 0103, 
+  0334, 0251, 0065, 0304, 0065, 0111, 0173, 0074, 0372, 0176, 0270, 0236, 0075, 0123, 0255, 0324, 
+  0225, 0233, 0266, 0303, 0135, 0340, 0360, 0276, 0260, 0327, 0024, 0154, 0247, 0136, 0053, 0255, 
+  0064, 0356, 0305, 0373, 0001, 0207, 0355, 0073, 0361, 0006, 0335, 0225, 0077, 0256, 0362, 0077, 
+  0242, 0033, 0025, 0270, 0000, 0050, 0165, 0165, 0141, 0171, 0051, 0057, 0000, 0000, 0000, 0000, 
+  0153, 0145, 0171, 0142, 0151, 0156, 0144, 0151, 0156, 0147, 0163, 0057, 0001, 0000, 0000, 0000, 
+  0155, 0141, 0164, 0145, 0057, 0000, 0000, 0000, 0005, 0000, 0000, 0000, 0155, 0143, 0143, 0057, 
+  0003, 0000, 0000, 0000
+} };
+
+static GStaticResource static_resource = { keybindings_resource_data.data, sizeof (keybindings_resource_data.data) - 1 /* nul terminator */, NULL, NULL, NULL };
+
+G_MODULE_EXPORT
+GResource *keybindings_get_resource (void);
+GResource *keybindings_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(keybindingsresource_constructor)
+#endif
+G_DEFINE_CONSTRUCTOR(keybindingsresource_constructor)
+#ifdef G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA
+#pragma G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(keybindingsresource_destructor)
+#endif
+G_DEFINE_DESTRUCTOR(keybindingsresource_destructor)
+
+#else
+#warning "Constructor not supported on this compiler, linking in resources will not work"
+#endif
+
+static void keybindingsresource_constructor (void)
+{
+  g_static_resource_init (&static_resource);
+}
+
+static void keybindingsresource_destructor (void)
+{
+  g_static_resource_fini (&static_resource);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/59.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/59.html new file mode 100644 index 00000000..e07200f7 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/59.html @@ -0,0 +1,4257 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
   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
/* This program was written with lots of love under the GPL by Jonathan
+ * Blandford <jrb@gnome.org>
+ */
+
+#include <config.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 <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 <gdk/gdkx.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.
+#include <glib/gi18n.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 "wm-common.h"<--- Include file: "wm-common.h" not found.
+#include "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+#include "eggcellrendererkeys.h"
+#include "activate-settings-daemon.h"<--- Include file: "activate-settings-daemon.h" not found.
+#include "dconf-util.h"<--- Include file: "dconf-util.h" not found.
+
+#define GSETTINGS_KEYBINDINGS_DIR "/org/mate/desktop/keybindings/"
+#define CUSTOM_KEYBINDING_SCHEMA "org.mate.control-center.keybinding"
+
+#define MAX_ELEMENTS_BEFORE_SCROLLING 10
+#define MAX_CUSTOM_SHORTCUTS 1000
+#define RESPONSE_ADD 0
+#define RESPONSE_REMOVE 1
+
+typedef struct {
+  /* The untranslated name, combine with ->package to translate */
+  char *name;
+  /* The gettext package to use to translate the section title */
+  char *package;
+  /* Name of the window manager the keys would apply to */
+  char *wm_name;
+  /* The GSettings schema for the whole file */
+  char *schema;
+  /* an array of KeyListEntry */
+  GArray *entries;
+} KeyList;
+
+typedef enum {
+  COMPARISON_NONE = 0,
+  COMPARISON_GT,
+  COMPARISON_LT,
+  COMPARISON_EQ
+} Comparison;
+
+typedef struct
+{
+  char *gsettings_path;
+  char *schema;
+  char *name;
+  int value;
+  char *value_schema; /* gsettings schema for key/value */
+  char *value_key;
+  char *description;
+  char *description_key;
+  char *cmd_key;
+  Comparison comparison;
+} KeyListEntry;
+
+enum
+{
+  DESCRIPTION_COLUMN,
+  KEYENTRY_COLUMN,
+  N_COLUMNS
+};
+
+typedef struct
+{
+  GSettings *settings;
+  char *gsettings_path;
+  char *gsettings_key;
+  guint keyval;
+  guint keycode;
+  EggVirtualModifierType mask;
+  gboolean editable;
+  GtkTreeModel *model;
+  char *description;
+  char *desc_gsettings_key;
+  gboolean desc_editable;
+  char *command;
+  char *cmd_gsettings_key;
+  gboolean cmd_editable;
+  gulong gsettings_cnxn;
+  gulong gsettings_cnxn_desc;
+  gulong gsettings_cnxn_cmd;
+} KeyEntry;
+
+static gboolean block_accels = FALSE;
+static GtkWidget *custom_shortcut_dialog = NULL;
+static GtkWidget *custom_shortcut_name_entry = NULL;
+static GtkWidget *custom_shortcut_command_entry = NULL;
+
+static GtkWidget* _gtk_builder_get_widget(GtkBuilder* builder, const gchar* name)
+{
+    return GTK_WIDGET (gtk_builder_get_object (builder, name));
+}
+
+static char* binding_name(guint keyval, guint keycode, EggVirtualModifierType mask, gboolean translate)
+{
+    if (keyval != 0 || keycode != 0)
+    {
+        if (translate)
+        {
+            return egg_virtual_accelerator_label (keyval, keycode, mask);
+        }
+        else
+        {
+            return egg_virtual_accelerator_name (keyval, keycode, mask);
+        }
+    }
+    else
+    {
+        return g_strdup (translate ? _("Disabled") : "");
+    }
+}
+
+static gboolean
+binding_from_string (const char             *str,
+                     guint                  *accelerator_key,
+             guint          *keycode,
+                     EggVirtualModifierType *accelerator_mods)
+{
+  g_return_val_if_fail (accelerator_key != NULL, FALSE);
+
+  if (str == NULL || strcmp (str, "disabled") == 0)
+    {
+      *accelerator_key = 0;
+      *keycode = 0;
+      *accelerator_mods = 0;
+      return TRUE;
+    }
+
+  egg_accelerator_parse_virtual (str, accelerator_key, keycode, accelerator_mods);
+
+  if (*accelerator_key == 0)
+    return FALSE;
+  else
+    return TRUE;
+}
+
+static void
+accel_set_func (GtkTreeViewColumn *tree_column,
+                GtkCellRenderer   *cell,
+                GtkTreeModel      *model,
+                GtkTreeIter       *iter,
+                gpointer           data)
+{
+  KeyEntry *key_entry;
+
+  gtk_tree_model_get (model, iter,
+                      KEYENTRY_COLUMN, &key_entry,
+                      -1);
+
+  if (key_entry == NULL)
+    g_object_set (cell,
+          "visible", FALSE,
+          NULL);
+  else if (! key_entry->editable)
+    g_object_set (cell,
+          "visible", TRUE,
+          "editable", FALSE,
+          "accel_key", key_entry->keyval,
+          "accel_mask", key_entry->mask,
+          "keycode", key_entry->keycode,
+          "style", PANGO_STYLE_ITALIC,
+          NULL);
+  else
+    g_object_set (cell,
+          "visible", TRUE,
+          "editable", TRUE,
+          "accel_key", key_entry->keyval,
+          "accel_mask", key_entry->mask,
+          "keycode", key_entry->keycode,
+          "style", PANGO_STYLE_NORMAL,
+          NULL);
+}
+
+static void
+description_set_func (GtkTreeViewColumn *tree_column,
+                      GtkCellRenderer   *cell,
+                      GtkTreeModel      *model,
+                      GtkTreeIter       *iter,
+                      gpointer           data)
+{
+  KeyEntry *key_entry;
+
+  gtk_tree_model_get (model, iter,
+                      KEYENTRY_COLUMN, &key_entry,
+                      -1);
+
+  if (key_entry != NULL)
+    g_object_set (cell,
+          "editable", FALSE,
+          "text", key_entry->description != NULL ?
+              key_entry->description : _("<Unknown Action>"),
+          NULL);
+  else
+    g_object_set (cell,
+          "editable", FALSE, NULL);
+}
+
+static gboolean
+keybinding_key_changed_foreach (GtkTreeModel *model,
+                GtkTreePath  *path,
+                GtkTreeIter  *iter,
+                gpointer      user_data)
+{
+  KeyEntry *key_entry;
+  KeyEntry *tmp_key_entry;
+
+  key_entry = (KeyEntry *)user_data;
+  gtk_tree_model_get (key_entry->model, iter,
+              KEYENTRY_COLUMN, &tmp_key_entry,
+              -1);
+
+  if (key_entry == tmp_key_entry)
+    {
+      gtk_tree_model_row_changed (key_entry->model, path, iter);
+      return TRUE;
+    }
+  return FALSE;
+}
+
+static void
+keybinding_key_changed (GSettings *settings,
+                        gchar     *key,
+                        KeyEntry  *key_entry)
+{
+  gchar *key_value;<--- Variable 'key_value' can be declared as pointer to const
+
+  key_value = g_settings_get_string (settings, key);
+
+  binding_from_string (key_value, &key_entry->keyval, &key_entry->keycode, &key_entry->mask);
+  key_entry->editable = g_settings_is_writable (settings, key);
+
+  /* update the model */
+  gtk_tree_model_foreach (key_entry->model, keybinding_key_changed_foreach, key_entry);
+}
+
+static void
+keybinding_description_changed (GSettings *settings,
+                                gchar     *key,
+                                KeyEntry  *key_entry)
+{
+  gchar *key_value;
+
+  key_value = g_settings_get_string (settings, key);
+
+  g_free (key_entry->description);
+  key_entry->description = key_value ? g_strdup (key_value) : NULL;
+  g_free (key_value);
+
+  key_entry->desc_editable = g_settings_is_writable (settings, key);
+
+  /* update the model */
+  gtk_tree_model_foreach (key_entry->model, keybinding_key_changed_foreach, key_entry);
+}
+
+static void
+keybinding_command_changed (GSettings *settings,
+                            gchar     *key,
+                            KeyEntry  *key_entry)
+{
+  gchar *key_value;
+
+  key_value = g_settings_get_string (settings, key);
+
+  g_free (key_entry->command);
+  key_entry->command = key_value ? g_strdup (key_value) : NULL;
+  key_entry->cmd_editable = g_settings_is_writable (settings, key);
+  g_free (key_value);
+
+  /* update the model */
+  gtk_tree_model_foreach (key_entry->model, keybinding_key_changed_foreach, key_entry);
+}
+
+static int
+keyentry_sort_func (GtkTreeModel *model,
+                    GtkTreeIter  *a,
+                    GtkTreeIter  *b,
+                    gpointer      user_data)
+{
+  KeyEntry *key_entry_a;
+  KeyEntry *key_entry_b;
+  int retval;
+
+  key_entry_a = NULL;
+  gtk_tree_model_get (model, a,
+                      KEYENTRY_COLUMN, &key_entry_a,
+                      -1);
+
+  key_entry_b = NULL;
+  gtk_tree_model_get (model, b,
+                      KEYENTRY_COLUMN, &key_entry_b,
+                      -1);
+
+  if (key_entry_a && key_entry_b)
+    {
+      if ((key_entry_a->keyval || key_entry_a->keycode) &&
+          (key_entry_b->keyval || key_entry_b->keycode))
+        {
+          gchar *name_a, *name_b;
+
+          name_a = binding_name (key_entry_a->keyval,
+                                 key_entry_a->keycode,
+                                 key_entry_a->mask,
+                                 TRUE);
+
+          name_b = binding_name (key_entry_b->keyval,
+                                 key_entry_b->keycode,
+                                 key_entry_b->mask,
+                                 TRUE);
+
+          retval = g_utf8_collate (name_a, name_b);
+
+          g_free (name_a);
+          g_free (name_b);
+        }
+      else if (key_entry_a->keyval || key_entry_a->keycode)
+        retval = -1;
+      else if (key_entry_b->keyval || key_entry_b->keycode)
+        retval = 1;
+      else
+        retval = 0;
+    }
+  else if (key_entry_a)
+    retval = -1;
+  else if (key_entry_b)
+    retval = 1;
+  else
+    retval = 0;
+
+  return retval;
+}
+
+static void
+clear_old_model (GtkBuilder *builder)
+{
+  GtkWidget *tree_view;
+  GtkWidget *actions_swindow;
+  GtkTreeModel *model;
+
+  tree_view = _gtk_builder_get_widget (builder, "shortcut_treeview");
+  model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view));
+
+  if (model == NULL)
+    {
+      /* create a new model */
+      model = (GtkTreeModel *) gtk_tree_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_POINTER);
+
+      gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (model),
+                                       KEYENTRY_COLUMN,
+                                       keyentry_sort_func,
+                                       NULL, NULL);
+
+      gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), model);
+
+      g_object_unref (model);
+    }
+  else
+    {
+      /* clear the existing model */
+      gboolean valid;
+      GtkTreeIter iter;
+      KeyEntry *key_entry;
+
+      for (valid = gtk_tree_model_get_iter_first (model, &iter);
+           valid;
+           valid = gtk_tree_model_iter_next (model, &iter))
+        {
+          gtk_tree_model_get (model, &iter,
+                              KEYENTRY_COLUMN, &key_entry,
+                              -1);
+
+          if (key_entry != NULL)
+            {
+              g_signal_handler_disconnect (key_entry->settings, key_entry->gsettings_cnxn);
+              if (key_entry->gsettings_cnxn_desc != 0)
+                g_signal_handler_disconnect (key_entry->settings, key_entry->gsettings_cnxn_desc);
+              if (key_entry->gsettings_cnxn_cmd != 0)
+                g_signal_handler_disconnect (key_entry->settings, key_entry->gsettings_cnxn_cmd);
+
+              g_object_unref (key_entry->settings);
+              if (key_entry->gsettings_path)
+                g_free (key_entry->gsettings_path);
+              g_free (key_entry->gsettings_key);
+              g_free (key_entry->description);
+              g_free (key_entry->desc_gsettings_key);
+              g_free (key_entry->command);
+              g_free (key_entry->cmd_gsettings_key);
+              g_free (key_entry);
+            }
+        }
+
+      gtk_tree_store_clear (GTK_TREE_STORE (model));
+    }
+
+  actions_swindow = _gtk_builder_get_widget (builder, "actions_swindow");
+  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (actions_swindow),
+                  GTK_POLICY_NEVER, GTK_POLICY_NEVER);
+  gtk_widget_set_size_request (actions_swindow, -1, -1);
+}
+
+typedef struct {
+  const char *key;
+  const char *path;
+  const char *schema;
+  gboolean found;
+} KeyMatchData;
+
+static gboolean
+key_match (GtkTreeModel *model,
+           GtkTreePath  *path,
+           GtkTreeIter  *iter,
+           gpointer      data)
+{
+    KeyMatchData *match_data = data;
+    KeyEntry *element;
+    gchar *element_schema = NULL;
+    gchar *element_path = NULL;
+    gboolean found = FALSE;
+
+    gtk_tree_model_get (model, iter,
+                        KEYENTRY_COLUMN, &element,
+                        -1);
+
+    if (!element)
+        return FALSE;
+
+    if (!element->settings || !G_IS_SETTINGS (element->settings))
+        return FALSE;
+
+    g_object_get (element->settings, "schema-id", &element_schema, NULL);
+    g_object_get (element->settings, "path", &element_path, NULL);
+
+    if ((g_strcmp0 (element->gsettings_key, match_data->key) == 0) &&
+        (g_strcmp0 (element_schema, match_data->schema) == 0) &&
+        (g_strcmp0 (element_path, match_data->path) == 0))
+    {
+        match_data->found = TRUE;
+        found = TRUE;
+    }
+
+    g_free (element_schema);
+    g_free (element_path);
+
+    return found;
+}
+
+static gboolean key_is_already_shown(GtkTreeModel* model, const KeyListEntry* entry)
+{
+    KeyMatchData data;
+
+    data.key = entry->name;
+    data.schema = entry->schema;
+    data.path = entry->gsettings_path;
+    data.found = FALSE;
+    gtk_tree_model_foreach(model, key_match, &data);
+
+    return data.found;
+}
+
+static gboolean should_show_key(const KeyListEntry* entry)
+{
+    GSettings *settings;
+    int value;
+
+    if (entry->comparison == COMPARISON_NONE)
+    {
+        return TRUE;
+    }
+
+    g_return_val_if_fail(entry->value_key != NULL, FALSE);
+    g_return_val_if_fail(entry->value_schema != NULL, FALSE);
+
+    settings = g_settings_new (entry->value_schema);
+    value = g_settings_get_int (settings, entry->value_key);
+    g_object_unref (settings);
+
+    switch (entry->comparison)
+    {
+        case COMPARISON_NONE:
+            /* For compiler warnings */
+            g_assert_not_reached ();
+            return FALSE;
+        case COMPARISON_GT:
+            if (value > entry->value)
+            {
+                return TRUE;
+            }
+            break;
+        case COMPARISON_LT:
+            if (value < entry->value)
+            {
+                return TRUE;
+            }
+            break;
+        case COMPARISON_EQ:
+            if (value == entry->value)
+            {
+                return TRUE;
+            }
+            break;
+    }
+
+    return FALSE;
+}
+
+static gboolean
+count_rows_foreach (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
+{
+  gint *rows = data;
+
+  (*rows)++;
+
+  return FALSE;
+}
+
+static void
+ensure_scrollbar (GtkBuilder *builder, int i)
+{
+  if (i == MAX_ELEMENTS_BEFORE_SCROLLING)
+    {
+      GtkRequisition rectangle;
+      GObject *actions_swindow = gtk_builder_get_object (builder,
+                                                         "actions_swindow");
+      GtkWidget *treeview = _gtk_builder_get_widget (builder,
+                                                     "shortcut_treeview");
+      gtk_widget_get_preferred_size (treeview, &rectangle, NULL);
+      gtk_widget_set_size_request (treeview, -1, rectangle.height);
+      gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (actions_swindow),
+                      GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+    }
+}
+
+static void
+find_section (GtkTreeModel *model,
+              GtkTreeIter  *iter,
+              const char   *title)
+{
+  GtkTreeStore *store;
+  gboolean success;
+
+  success = gtk_tree_model_get_iter_first (model, iter);
+  while (success)
+    {
+      char *description;
+      gint  res;
+
+      gtk_tree_model_get (model, iter,
+                          DESCRIPTION_COLUMN, &description,
+                          -1);
+      res = g_strcmp0 (description, title);
+      g_free (description);
+      if (res == 0)
+        return;
+      success = gtk_tree_model_iter_next (model, iter);
+    }
+  store = GTK_TREE_STORE (model);
+  gtk_tree_store_append (store, iter, NULL);
+  gtk_tree_store_set (store, iter,
+                      DESCRIPTION_COLUMN, title,
+                      -1);
+}
+
+static void
+append_keys_to_tree (GtkBuilder         *builder,
+                     const gchar        *title,
+                     const gchar        *schema,
+                     const gchar        *package,
+                     const KeyListEntry *keys_list)
+{
+  GtkTreeIter parent_iter, iter;
+  GtkTreeModel *model;
+  gint i, j;
+
+  model = gtk_tree_view_get_model (GTK_TREE_VIEW (gtk_builder_get_object (builder, "shortcut_treeview")));
+
+  /* Try to find a section parent iter, if it already exists */
+  find_section (model, &iter, title);
+  parent_iter = iter;
+
+  i = 0;
+  gtk_tree_model_foreach (model, count_rows_foreach, &i);
+
+  /* If the header we just added is the MAX_ELEMENTS_BEFORE_SCROLLING th,
+   * then we need to scroll now */
+  ensure_scrollbar (builder, i - 1);
+
+  for (j = 0; keys_list[j].name != NULL; j++)
+    {
+      GSettings *settings = NULL;
+      gchar *settings_path;
+      KeyEntry *key_entry;
+      const gchar *key_string;
+      gchar *key_value;
+      gchar *description;
+      gchar *command;
+
+      if (!should_show_key (&keys_list[j]))
+        continue;
+
+      if (key_is_already_shown (model, &keys_list[j]))
+        continue;
+
+      key_string = keys_list[j].name;
+
+      if (keys_list[j].gsettings_path != NULL)
+        {
+          settings = g_settings_new_with_path (schema, keys_list[j].gsettings_path);
+          settings_path = g_strdup(keys_list[j].gsettings_path);
+        }
+      else
+        {
+          settings = g_settings_new (schema);
+          settings_path = NULL;
+        }
+
+      if (keys_list[j].description_key != NULL)
+        {
+          /* it's a custom shortcut, so description is in gsettings */
+          description = g_settings_get_string (settings, keys_list[j].description_key);
+        }
+      else
+        {
+          /* it's from keyfile, so description need to be translated */
+          description = keys_list[j].description;
+          if (package)
+            {
+              bind_textdomain_codeset (package, "UTF-8");
+              description = dgettext (package, description);
+            }
+          else
+            {
+              description = _(description);
+            }
+        }
+
+      if (description == NULL)
+        {
+          /* Only print a warning for keys that should have a schema */
+          if (keys_list[j].description_key == NULL)
+            g_warning ("No description for key '%s'", key_string);
+        }
+
+      if (keys_list[j].cmd_key != NULL)
+        {
+          command = g_settings_get_string (settings, keys_list[j].cmd_key);
+        }
+      else
+        {
+          command = NULL;
+        }
+
+      key_entry = g_new0 (KeyEntry, 1);
+      key_entry->settings = settings;
+      key_entry->gsettings_path = settings_path;
+      key_entry->gsettings_key = g_strdup (key_string);
+      key_entry->editable = g_settings_is_writable (settings, key_string);
+      key_entry->model = model;
+      key_entry->description = description;
+      key_entry->command = command;
+      if (keys_list[j].description_key != NULL)
+        {
+          key_entry->desc_gsettings_key =  g_strdup (keys_list[j].description_key);
+          key_entry->desc_editable = g_settings_is_writable (settings, key_entry->desc_gsettings_key);
+          gchar *gsettings_signal = g_strconcat ("changed::", key_entry->desc_gsettings_key, NULL);
+          key_entry->gsettings_cnxn_desc = g_signal_connect (settings,
+                                                             gsettings_signal,
+                                                             G_CALLBACK (keybinding_description_changed),
+                                                             key_entry);
+          g_free (gsettings_signal);
+        }
+      if (keys_list[j].cmd_key != NULL)
+        {
+          key_entry->cmd_gsettings_key =  g_strdup (keys_list[j].cmd_key);
+          key_entry->cmd_editable = g_settings_is_writable (settings, key_entry->cmd_gsettings_key);
+          gchar *gsettings_signal = g_strconcat ("changed::", key_entry->cmd_gsettings_key, NULL);
+          key_entry->gsettings_cnxn_cmd = g_signal_connect (settings,
+                                                            gsettings_signal,
+                                                            G_CALLBACK (keybinding_command_changed),
+                                                            key_entry);
+          g_free (gsettings_signal);
+        }
+
+      gchar *gsettings_signal = g_strconcat ("changed::", key_string, NULL);
+      key_entry->gsettings_cnxn = g_signal_connect (settings,
+                                                    gsettings_signal,
+                                                    G_CALLBACK (keybinding_key_changed),
+                                                    key_entry);
+      g_free (gsettings_signal);
+
+      key_value = g_settings_get_string (settings, key_string);
+      binding_from_string (key_value, &key_entry->keyval, &key_entry->keycode, &key_entry->mask);
+      g_free (key_value);
+
+      ensure_scrollbar (builder, i);
+
+      ++i;
+      gtk_tree_store_append (GTK_TREE_STORE (model), &iter, &parent_iter);
+      /* we use the DESCRIPTION_COLUMN only for the section headers */
+      gtk_tree_store_set (GTK_TREE_STORE (model), &iter,
+              KEYENTRY_COLUMN, key_entry,
+              -1);
+      gtk_tree_view_expand_all (GTK_TREE_VIEW (gtk_builder_get_object (builder, "shortcut_treeview")));
+    }
+
+  /* Don't show an empty section */
+  if (gtk_tree_model_iter_n_children (model, &parent_iter) == 0)
+    gtk_tree_store_remove (GTK_TREE_STORE (model), &parent_iter);
+
+  if (i == 0)
+      gtk_widget_hide (_gtk_builder_get_widget (builder, "shortcuts_vbox"));
+  else
+      gtk_widget_show (_gtk_builder_get_widget (builder, "shortcuts_vbox"));
+}
+
+static void
+parse_start_tag (GMarkupParseContext *ctx,
+         const gchar         *element_name,
+         const gchar        **attr_names,
+         const gchar        **attr_values,
+         gpointer             user_data,
+         GError             **error)
+{
+  KeyList *keylist = (KeyList *) user_data;
+  KeyListEntry key;
+  const char *name, *value_key, *description, *value_schema;
+  int value;
+  Comparison comparison;
+  const char *schema = NULL;
+
+  name = NULL;
+
+  /* The top-level element, names the section in the tree */
+  if (g_str_equal (element_name, "KeyListEntries"))
+    {
+      const char *wm_name = NULL;
+      const char *package = NULL;
+
+      while (*attr_names && *attr_values)
+        {
+          if (g_str_equal (*attr_names, "name"))
+            {
+              if (**attr_values)
+                name = *attr_values;
+            }
+          else if (g_str_equal (*attr_names, "wm_name"))
+            {
+             if (**attr_values)
+                wm_name = *attr_values;
+            }
+          else if (g_str_equal (*attr_names, "package"))
+          {
+            if (**attr_values)
+                package = *attr_values;
+          }
+          else if (g_str_equal (*attr_names, "schema"))
+          {
+            if (**attr_values)
+                schema = *attr_values;
+          }
+          ++attr_names;
+          ++attr_values;
+        }
+
+      if (name)
+        {
+          if (keylist->name)
+            g_warning ("Duplicate section name");
+          g_free (keylist->name);
+          keylist->name = g_strdup (name);
+        }
+      if (wm_name)
+        {
+          if (keylist->wm_name)
+            g_warning ("Duplicate window manager name");
+          g_free (keylist->wm_name);
+          keylist->wm_name = g_strdup (wm_name);
+        }
+      if (package)
+        {
+          if (keylist->package)
+            g_warning ("Duplicate gettext package name");
+          g_free (keylist->package);
+          keylist->package = g_strdup (package);
+        }
+      if (schema)
+        {
+          if (keylist->schema)
+            g_warning ("Duplicate schema name");
+          g_free (keylist->schema);
+          keylist->schema = g_strdup (schema);
+        }
+      return;
+    }
+
+  if (!g_str_equal (element_name, "KeyListEntry")
+      || attr_names == NULL
+      || attr_values == NULL)
+    return;
+
+  value = 0;
+  comparison = COMPARISON_NONE;
+  value_key = NULL;
+  value_schema = NULL;
+  description = NULL;
+
+  while (*attr_names && *attr_values)
+    {
+      if (g_str_equal (*attr_names, "name"))
+        {
+      /* skip if empty */
+      if (**attr_values)
+        name = *attr_values;
+    } else if (g_str_equal (*attr_names, "value")) {
+      if (**attr_values) {
+        value = (int) g_ascii_strtoull (*attr_values, NULL, 0);
+      }
+    } else if (g_str_equal (*attr_names, "key")) {
+      if (**attr_values) {
+        value_key = *attr_values;
+      }
+    } else if (g_str_equal (*attr_names, "comparison")) {
+      if (**attr_values) {
+        if (g_str_equal (*attr_values, "gt")) {
+          comparison = COMPARISON_GT;
+        } else if (g_str_equal (*attr_values, "lt")) {
+          comparison = COMPARISON_LT;
+        } else if (g_str_equal (*attr_values, "eq")) {
+          comparison = COMPARISON_EQ;
+        }
+      }
+    } else if (g_str_equal (*attr_names, "description")) {
+      if (**attr_values) {
+        description = *attr_values;
+      }
+    } else if (g_str_equal (*attr_names, "schema")) {
+      if (**attr_values) {
+        value_schema = *attr_values;
+      }
+    }
+
+      ++attr_names;
+      ++attr_values;
+    }
+
+  if (name == NULL)
+    return;
+
+  key.name = g_strdup (name);
+  key.gsettings_path = NULL;
+  key.description_key = NULL;
+  key.description = g_strdup(description);
+  key.schema = g_strdup(schema);
+  key.value = value;
+  if (value_key) {
+    key.value_key = g_strdup (value_key);
+    key.value_schema = g_strdup (value_schema);
+  }
+  else {
+    key.value_key = NULL;
+    key.value_schema = NULL;
+  }
+  key.comparison = comparison;
+  key.cmd_key = NULL;
+  g_array_append_val (keylist->entries, key);
+}
+
+static gboolean
+strv_contains (char **strv,
+           char  *str)<--- Parameter 'str' can be declared as pointer to const
+{
+  char **p;
+
+  for (p = strv; *p; p++)
+    if (strcmp (*p, str) == 0)
+      return TRUE;
+
+  return FALSE;
+}
+
+static void
+append_keys_to_tree_from_file (GtkBuilder *builder,
+                   const char *filename,
+                   char      **wm_keybindings)
+{
+  GMarkupParseContext *ctx;
+  GMarkupParser parser = { parse_start_tag, NULL, NULL, NULL, NULL };
+  KeyList *keylist;
+  KeyListEntry key, *keys;
+  GError *err = NULL;
+  char *buf;
+  const char *title;
+  gsize buf_len;
+  guint i;
+
+  if (!g_file_get_contents (filename, &buf, &buf_len, &err))
+    return;
+
+  keylist = g_new0 (KeyList, 1);
+  keylist->entries = g_array_new (FALSE, TRUE, sizeof (KeyListEntry));
+  ctx = g_markup_parse_context_new (&parser, 0, keylist, NULL);
+
+  if (!g_markup_parse_context_parse (ctx, buf, buf_len, &err))
+    {
+      g_warning ("Failed to parse '%s': '%s'", filename, err->message);
+      g_error_free (err);
+      g_free (keylist->name);
+      g_free (keylist->package);
+      g_free (keylist->wm_name);
+      g_free (keylist->schema);
+      for (i = 0; i < keylist->entries->len; i++)
+        g_free (((KeyListEntry *) &(keylist->entries->data[i]))->name);
+      g_array_free (keylist->entries, TRUE);
+      g_free (keylist);
+      keylist = NULL;
+    }
+  g_markup_parse_context_free (ctx);
+  g_free (buf);
+
+  if (keylist == NULL)
+    return;
+
+  /* If there's no keys to add, or the settings apply to a window manager
+   * that's not the one we're running */
+  if (keylist->entries->len == 0
+      || (keylist->wm_name != NULL && !strv_contains (wm_keybindings, keylist->wm_name))
+      || keylist->name == NULL)
+    {
+      g_free (keylist->name);
+      g_free (keylist->package);
+      g_free (keylist->wm_name);
+      g_free (keylist->schema);
+      g_array_free (keylist->entries, TRUE);
+      g_free (keylist);
+      return;
+    }
+
+  /* Empty KeyListEntry to end the array */
+  key.name = NULL;
+  key.description_key = NULL;
+  key.value_key = NULL;
+  key.value = 0;
+  key.comparison = COMPARISON_NONE;
+  g_array_append_val (keylist->entries, key);
+
+  keys = (KeyListEntry *) g_array_free (keylist->entries, FALSE);
+  if (keylist->package)
+    {
+      bind_textdomain_codeset (keylist->package, "UTF-8");
+      title = dgettext (keylist->package, keylist->name);
+    } else {
+      title = _(keylist->name);
+    }
+
+  append_keys_to_tree (builder, title, keylist->schema, keylist->package, keys);
+
+  g_free (keylist->name);
+  g_free (keylist->package);
+  for (i = 0; keys[i].name != NULL; i++)
+    g_free (keys[i].name);
+  g_free (keylist);
+}
+
+static void
+append_keys_to_tree_from_gsettings (GtkBuilder *builder, const gchar *gsettings_path)
+{
+  gchar **custom_list;
+  GArray *entries;
+  KeyListEntry key;
+  gint i;<--- Shadowed declaration
+
+  /* load custom shortcuts from GSettings */
+  entries = g_array_new (FALSE, TRUE, sizeof (KeyListEntry));
+
+  key.value_key = NULL;
+  key.value = 0;
+  key.comparison = COMPARISON_NONE;
+
+  custom_list = dconf_util_list_subdirs (gsettings_path, FALSE);
+
+  if (custom_list != NULL)
+    {
+      for (i = 0; custom_list[i] != NULL; i++)
+        {
+          key.gsettings_path = g_strdup_printf("%s%s", gsettings_path, custom_list[i]);
+          key.name = g_strdup("binding");
+          key.cmd_key = g_strdup("action");
+          key.description_key = g_strdup("name");
+          key.schema = NULL;
+          g_array_append_val (entries, key);
+        }
+    }
+
+  g_strfreev (custom_list);
+
+  if (entries->len > 0)
+    {
+      KeyListEntry *keys;
+      int i;<--- Shadow variable
+
+      /* Empty KeyListEntry to end the array */
+      key.gsettings_path = NULL;
+      key.name = NULL;
+      key.description_key = NULL;
+      key.cmd_key = NULL;
+      g_array_append_val (entries, key);
+
+      keys = (KeyListEntry *) entries->data;
+      append_keys_to_tree (builder, _("Custom Shortcuts"), CUSTOM_KEYBINDING_SCHEMA, NULL, keys);
+      for (i = 0; i < entries->len; ++i)
+        {
+          g_free (keys[i].name);
+          g_free (keys[i].description_key);
+          g_free (keys[i].cmd_key);
+          g_free (keys[i].gsettings_path);
+        }
+    }
+
+  g_array_free (entries, TRUE);
+}
+
+static void
+reload_key_entries (GtkBuilder *builder)
+{
+  gchar **wm_keybindings;
+  GList *list, *l;
+  const gchar * const * data_dirs;
+  GHashTable *loaded_files;
+  guint i;
+
+  wm_keybindings = wm_common_get_current_keybindings();
+
+  clear_old_model (builder);
+
+  loaded_files = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
+  data_dirs = g_get_system_data_dirs ();
+  for (i = 0; data_dirs[i] != NULL; i++)
+    {
+      g_autofree gchar *dir_path = NULL;
+      GDir *dir;
+      const gchar *name;
+
+      dir_path = g_build_filename (data_dirs[i], "mate-control-center", "keybindings", NULL);
+      g_debug ("Keybinding dir: %s", dir_path);
+
+      dir = g_dir_open (dir_path, 0, NULL);
+      if (!dir)
+        continue;
+
+      for (name = g_dir_read_name (dir) ; name ; name = g_dir_read_name (dir))
+        {
+          if (g_str_has_suffix (name, ".xml") == FALSE)
+            continue;
+
+          if (g_hash_table_lookup (loaded_files, name) != NULL)
+            {
+              g_debug ("Not loading %s, it was already loaded from another directory", name);
+              continue;
+            }
+
+          g_hash_table_insert (loaded_files, g_strdup (name), g_strdup (dir_path));
+        }
+
+      g_dir_close (dir);
+    }
+  list = g_hash_table_get_keys (loaded_files);
+  list = g_list_sort(list, (GCompareFunc) g_str_equal);
+  for (l = list; l != NULL; l = l->next)
+    {
+      g_autofree gchar *path = NULL;
+      path = g_build_filename (g_hash_table_lookup (loaded_files, l->data), l->data, NULL);
+      g_debug ("Keybinding file: %s", path);
+      append_keys_to_tree_from_file (builder, path, wm_keybindings);
+    }
+  g_list_free (list);
+  g_hash_table_destroy (loaded_files);
+
+  /* Load custom shortcuts _after_ system-provided ones,
+   * since some of the custom shortcuts may also be listed
+   * in a file. Loading the custom shortcuts last makes
+   * such keys not show up in the custom section.
+   */
+  append_keys_to_tree_from_gsettings (builder, GSETTINGS_KEYBINDINGS_DIR);
+
+  g_strfreev (wm_keybindings);
+}
+
+static void
+key_entry_controlling_key_changed (GSettings *settings, gchar *key, gpointer user_data)
+{
+  reload_key_entries (user_data);
+}
+
+static gboolean cb_check_for_uniqueness(GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, KeyEntry* new_key)
+{
+    KeyEntry* element;
+
+    gtk_tree_model_get (new_key->model, iter,<--- Null pointer dereference
+        KEYENTRY_COLUMN, &element,
+        -1);
+
+    /* no conflict for : blanks, different modifiers, or ourselves */
+    if (element == NULL || new_key->mask != element->mask)
+    {
+        return FALSE;
+    }
+
+    gchar *new_key_schema = NULL;
+    gchar *element_schema = NULL;
+    gchar *new_key_path = NULL;
+    gchar *element_path = NULL;
+
+    if (new_key && new_key->settings)<--- Assuming that condition 'new_key' is not redundant
+    {
+            g_object_get (new_key->settings, "schema-id", &new_key_schema, NULL);
+        g_object_get (new_key->settings, "path", &new_key_path, NULL);
+    }
+
+    if (element->settings)
+    {
+            g_object_get (element->settings, "schema-id", &element_schema, NULL);
+        g_object_get (element->settings, "path", &element_path, NULL);
+    }
+
+    if (!g_strcmp0 (new_key->gsettings_key, element->gsettings_key) &&
+        !g_strcmp0 (new_key_schema, element_schema) &&
+        !g_strcmp0 (new_key_path, element_path))
+    {
+        return FALSE;
+    }
+
+    if (new_key->keyval != 0)
+    {
+        if (new_key->keyval != element->keyval)
+        {
+            return FALSE;
+        }
+    }
+    else if (element->keyval != 0 || new_key->keycode != element->keycode)
+    {
+        return FALSE;
+    }
+
+    new_key->editable = FALSE;
+    new_key->settings = element->settings;
+    new_key->gsettings_key = element->gsettings_key;
+    new_key->description = element->description;
+    new_key->desc_gsettings_key = element->desc_gsettings_key;
+    new_key->desc_editable = element->desc_editable;
+
+    return TRUE;
+}
+
+static const guint forbidden_keyvals[] = {
+    /* Navigation keys */
+    GDK_KEY_Home,
+    GDK_KEY_Left,
+    GDK_KEY_Up,
+    GDK_KEY_Right,
+    GDK_KEY_Down,
+    GDK_KEY_Page_Up,
+    GDK_KEY_Page_Down,
+    GDK_KEY_End,
+    GDK_KEY_Tab,
+
+    /* Return */
+    GDK_KEY_KP_Enter,
+    GDK_KEY_Return,
+
+    GDK_KEY_space,
+    GDK_KEY_Mode_switch
+};
+
+static gboolean keyval_is_forbidden(guint keyval)
+{
+    guint i;
+
+    for (i = 0; i < G_N_ELEMENTS(forbidden_keyvals); i++)
+    {
+        if (keyval == forbidden_keyvals[i])
+        {
+            return TRUE;
+        }
+    }
+
+    return FALSE;
+}
+
+static void show_error(GtkWindow* parent, GError* err)
+{
+  GtkWidget *dialog;
+
+  dialog = gtk_message_dialog_new (parent,
+                   GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,
+                   GTK_MESSAGE_WARNING,
+                   GTK_BUTTONS_OK,
+                   _("Error saving the new shortcut"));
+
+  gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+                                            "%s", err->message);
+  gtk_dialog_run (GTK_DIALOG (dialog));
+  gtk_widget_destroy (dialog);
+}
+
+static void accel_edited_callback(GtkCellRendererText* cell, const char* path_string, guint keyval, EggVirtualModifierType mask, guint keycode, gpointer data)
+{
+    GtkTreeView* view = (GtkTreeView*) data;
+    GtkTreeModel* model;
+    GtkTreePath* path = gtk_tree_path_new_from_string (path_string);
+    GtkTreeIter iter;
+    KeyEntry* key_entry, tmp_key;
+    char* str;
+
+    block_accels = FALSE;
+
+    model = gtk_tree_view_get_model (view);
+    gtk_tree_model_get_iter (model, &iter, path);
+    gtk_tree_path_free (path);
+    gtk_tree_model_get (model, &iter,
+                        KEYENTRY_COLUMN, &key_entry,
+                        -1);
+
+    /* sanity check */
+    if (key_entry == NULL)
+    {
+        return;
+    }
+
+    /* CapsLock isn't supported as a keybinding modifier, so keep it from confusing us */
+    mask &= ~EGG_VIRTUAL_LOCK_MASK;
+
+    tmp_key.model  = model;
+    tmp_key.keyval = keyval;
+    tmp_key.keycode = keycode;
+    tmp_key.mask   = mask;
+    tmp_key.settings = key_entry->settings;
+    tmp_key.gsettings_key = key_entry->gsettings_key;
+    tmp_key.description = NULL;
+    tmp_key.editable = TRUE; /* kludge to stuff in a return flag */
+
+    if (keyval != 0 || keycode != 0) /* any number of keys can be disabled */
+    {
+        gtk_tree_model_foreach(model, (GtkTreeModelForeachFunc) cb_check_for_uniqueness, &tmp_key);
+    }
+
+    /* Check for unmodified keys */
+    if (tmp_key.mask == 0 && tmp_key.keycode != 0)
+    {
+        if ((tmp_key.keyval >= GDK_KEY_a && tmp_key.keyval <= GDK_KEY_z)
+            || (tmp_key.keyval >= GDK_KEY_A && tmp_key.keyval <= GDK_KEY_Z)
+            || (tmp_key.keyval >= GDK_KEY_0 && tmp_key.keyval <= GDK_KEY_9)
+            || (tmp_key.keyval >= GDK_KEY_kana_fullstop && tmp_key.keyval <= GDK_KEY_semivoicedsound)
+            || (tmp_key.keyval >= GDK_KEY_Arabic_comma && tmp_key.keyval <= GDK_KEY_Arabic_sukun)
+            || (tmp_key.keyval >= GDK_KEY_Serbian_dje && tmp_key.keyval <= GDK_KEY_Cyrillic_HARDSIGN)
+            || (tmp_key.keyval >= GDK_KEY_Greek_ALPHAaccent && tmp_key.keyval <= GDK_KEY_Greek_omega)
+            || (tmp_key.keyval >= GDK_KEY_hebrew_doublelowline && tmp_key.keyval <= GDK_KEY_hebrew_taf)
+            || (tmp_key.keyval >= GDK_KEY_Thai_kokai && tmp_key.keyval <= GDK_KEY_Thai_lekkao)
+            || (tmp_key.keyval >= GDK_KEY_Hangul && tmp_key.keyval <= GDK_KEY_Hangul_Special)
+            || (tmp_key.keyval >= GDK_KEY_Hangul_Kiyeog && tmp_key.keyval <= GDK_KEY_Hangul_J_YeorinHieuh)
+            || keyval_is_forbidden (tmp_key.keyval))
+        {
+
+            GtkWidget *dialog;
+            char *name;
+
+            name = binding_name (keyval, keycode, mask, TRUE);
+
+            dialog = gtk_message_dialog_new (
+                GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (view))),
+                GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,
+                GTK_MESSAGE_WARNING,
+                GTK_BUTTONS_CANCEL,
+                _("The shortcut \"%s\" cannot be used because it will become impossible to type using this key.\n"
+                "Please try with a key such as Control, Alt or Shift at the same time."),
+                name);
+
+            g_free (name);
+            gtk_dialog_run (GTK_DIALOG (dialog));
+            gtk_widget_destroy (dialog);
+
+            /* set it back to its previous value. */
+            egg_cell_renderer_keys_set_accelerator(
+                EGG_CELL_RENDERER_KEYS(cell),
+                key_entry->keyval,
+                key_entry->keycode,
+                key_entry->mask);
+            return;
+        }
+    }
+
+    /* flag to see if the new accelerator was in use by something */
+    if (!tmp_key.editable)
+    {
+        GtkWidget* dialog;
+        char* name;
+        int response;
+
+        name = binding_name(keyval, keycode, mask, TRUE);
+
+        dialog = gtk_message_dialog_new(
+            GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(view))),
+            GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,
+            GTK_MESSAGE_WARNING,
+            GTK_BUTTONS_CANCEL,
+            _("The shortcut \"%s\" is already used for\n\"%s\""),
+            name,
+            tmp_key.description ? tmp_key.description : tmp_key.gsettings_key);
+            g_free (name);
+
+        gtk_message_dialog_format_secondary_text (
+            GTK_MESSAGE_DIALOG (dialog),
+            _("If you reassign the shortcut to \"%s\", the \"%s\" shortcut "
+            "will be disabled."),
+            key_entry->description ? key_entry->description : key_entry->gsettings_key,
+            tmp_key.description ? tmp_key.description : tmp_key.gsettings_key);
+
+        gtk_dialog_add_button(GTK_DIALOG (dialog), _("_Reassign"), GTK_RESPONSE_ACCEPT);
+
+        gtk_dialog_set_default_response(GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);
+
+        response = gtk_dialog_run (GTK_DIALOG (dialog));
+        gtk_widget_destroy (dialog);
+
+        if (response == GTK_RESPONSE_ACCEPT)
+        {
+            g_settings_set_string (tmp_key.settings, tmp_key.gsettings_key, "disabled");
+
+            str = binding_name (keyval, keycode, mask, FALSE);
+            g_settings_set_string (key_entry->settings, key_entry->gsettings_key, str);
+
+            g_free (str);
+        }
+        else
+        {
+            /* set it back to its previous value. */
+            egg_cell_renderer_keys_set_accelerator(
+                EGG_CELL_RENDERER_KEYS(cell),
+                key_entry->keyval,
+                key_entry->keycode,
+                key_entry->mask);
+        }
+
+        return;
+    }
+
+    str = binding_name (keyval, keycode, mask, FALSE);
+
+    g_settings_set_string(
+        key_entry->settings,
+        key_entry->gsettings_key,
+        str);
+
+    g_free (str);
+
+}
+
+static void
+accel_cleared_callback (GtkCellRendererText *cell,
+            const char          *path_string,
+            gpointer             data)
+{
+  GtkTreeView *view = (GtkTreeView *) data;
+  GtkTreePath *path = gtk_tree_path_new_from_string (path_string);
+  KeyEntry *key_entry;
+  GtkTreeIter iter;
+  GtkTreeModel *model;
+
+  block_accels = FALSE;
+
+  model = gtk_tree_view_get_model (view);
+  gtk_tree_model_get_iter (model, &iter, path);
+  gtk_tree_path_free (path);
+  gtk_tree_model_get (model, &iter,
+              KEYENTRY_COLUMN, &key_entry,
+              -1);
+
+  /* sanity check */
+  if (key_entry == NULL)
+    return;
+
+  /* Unset the key */
+  g_settings_set_string (key_entry->settings,
+                         key_entry->gsettings_key,
+                         "disabled");
+}
+
+static void
+description_edited_callback (GtkCellRendererText *renderer,
+                             gchar               *path_string,
+                             gchar               *new_text,
+                             gpointer             user_data)
+{
+  GtkTreeView *view = GTK_TREE_VIEW (user_data);
+  GtkTreeModel *model;
+  GtkTreePath *path = gtk_tree_path_new_from_string (path_string);
+  GtkTreeIter iter;
+  KeyEntry *key_entry;
+
+  model = gtk_tree_view_get_model (view);
+  gtk_tree_model_get_iter (model, &iter, path);
+  gtk_tree_path_free (path);
+
+  gtk_tree_model_get (model, &iter,
+              KEYENTRY_COLUMN, &key_entry,
+              -1);
+
+  /* sanity check */
+  if (key_entry == NULL || key_entry->desc_gsettings_key == NULL)
+    return;
+
+  if (!g_settings_set_string (key_entry->settings, key_entry->desc_gsettings_key, new_text))
+    key_entry->desc_editable = FALSE;
+}
+
+typedef struct
+{
+  GtkTreeView *tree_view;
+  GtkTreePath *path;
+  GtkTreeViewColumn *column;
+} IdleData;
+
+static gboolean
+real_start_editing_cb (IdleData *idle_data)
+{
+  gtk_widget_grab_focus (GTK_WIDGET (idle_data->tree_view));
+  gtk_tree_view_set_cursor (idle_data->tree_view,
+                idle_data->path,
+                idle_data->column,
+                TRUE);
+  gtk_tree_path_free (idle_data->path);
+  g_free (idle_data);
+  return FALSE;
+}
+
+static gboolean
+edit_custom_shortcut (KeyEntry *key)
+{
+  gint result;
+  const gchar *text;
+  gboolean ret;
+
+  gtk_entry_set_text (GTK_ENTRY (custom_shortcut_name_entry), key->description ? key->description : "");
+  gtk_widget_set_sensitive (custom_shortcut_name_entry, key->desc_editable);
+  gtk_widget_grab_focus (custom_shortcut_name_entry);
+  gtk_entry_set_text (GTK_ENTRY (custom_shortcut_command_entry), key->command ? key->command : "");
+  gtk_widget_set_sensitive (custom_shortcut_command_entry, key->cmd_editable);
+
+  gtk_window_present (GTK_WINDOW (custom_shortcut_dialog));
+  result = gtk_dialog_run (GTK_DIALOG (custom_shortcut_dialog));
+  switch (result)
+    {
+    case GTK_RESPONSE_OK:
+      text = gtk_entry_get_text (GTK_ENTRY (custom_shortcut_name_entry));
+      g_free (key->description);
+      key->description = g_strdup (text);
+      text = gtk_entry_get_text (GTK_ENTRY (custom_shortcut_command_entry));
+      g_free (key->command);
+      key->command = g_strdup (text);
+      ret = TRUE;
+      break;
+    default:
+      ret = FALSE;
+      break;
+    }
+
+  gtk_widget_hide (custom_shortcut_dialog);
+
+  return ret;
+}
+
+static gboolean
+remove_custom_shortcut (GtkTreeModel *model, GtkTreeIter *iter)
+{
+  GtkTreeIter parent;
+  KeyEntry *key;
+
+  gtk_tree_model_get (model, iter,
+                      KEYENTRY_COLUMN, &key,
+                      -1);
+
+  /* not a custom shortcut */
+  if (key->command == NULL)
+    return FALSE;
+
+  g_signal_handler_disconnect (key->settings, key->gsettings_cnxn);
+  if (key->gsettings_cnxn_desc != 0)
+    g_signal_handler_disconnect (key->settings, key->gsettings_cnxn_desc);
+  if (key->gsettings_cnxn_cmd != 0)
+    g_signal_handler_disconnect (key->settings, key->gsettings_cnxn_cmd);
+
+  dconf_util_recursive_reset (key->gsettings_path, NULL);
+  g_object_unref (key->settings);
+
+  g_free (key->gsettings_path);
+  g_free (key->gsettings_key);
+  g_free (key->description);
+  g_free (key->desc_gsettings_key);
+  g_free (key->command);
+  g_free (key->cmd_gsettings_key);
+  g_free (key);
+
+  gtk_tree_model_iter_parent (model, &parent, iter);
+  gtk_tree_store_remove (GTK_TREE_STORE (model), iter);
+  if (!gtk_tree_model_iter_has_child (model, &parent))
+    gtk_tree_store_remove (GTK_TREE_STORE (model), &parent);
+
+  return TRUE;
+}
+
+static void
+update_custom_shortcut (GtkTreeModel *model, GtkTreeIter *iter)
+{
+  KeyEntry *key;
+
+  gtk_tree_model_get (model, iter,
+                      KEYENTRY_COLUMN, &key,
+                      -1);
+
+  edit_custom_shortcut (key);
+  if (key->command == NULL || key->command[0] == '\0')
+    {
+      remove_custom_shortcut (model, iter);
+    }
+  else
+    {
+      gtk_tree_store_set (GTK_TREE_STORE (model), iter,
+              KEYENTRY_COLUMN, key, -1);
+      if (key->description != NULL)
+        g_settings_set_string (key->settings, key->desc_gsettings_key, key->description);
+      else
+        g_settings_reset (key->settings, key->desc_gsettings_key);
+      g_settings_set_string (key->settings, key->cmd_gsettings_key, key->command);
+    }
+}
+
+static gchar *
+find_free_gsettings_path (GError **error)
+{
+  gchar **existing_dirs;
+  gchar *dir = NULL;
+  gchar *fulldir = NULL;
+  int i;
+  int j;
+  gboolean found;
+
+  existing_dirs = dconf_util_list_subdirs (GSETTINGS_KEYBINDINGS_DIR, FALSE);
+
+  for (i = 0; i < MAX_CUSTOM_SHORTCUTS; i++)
+    {
+      found = TRUE;
+      dir = g_strdup_printf ("custom%d/", i);
+      for (j = 0; existing_dirs[j] != NULL; j++)
+        if (!g_strcmp0(dir, existing_dirs[j]))
+          {
+            found = FALSE;
+            g_free (dir);
+            break;
+          }
+      if (found)
+       break;
+    }
+    g_strfreev (existing_dirs);
+
+  if (i == MAX_CUSTOM_SHORTCUTS)
+    {
+      g_free (dir);
+      dir = NULL;
+      g_set_error_literal (error,
+                           g_quark_from_string ("Keyboard Shortcuts"),
+                           0,
+                           _("Too many custom shortcuts"));
+    }
+
+  fulldir = g_strdup_printf ("%s%s", GSETTINGS_KEYBINDINGS_DIR, dir);
+  g_free (dir);
+  return fulldir;
+}
+
+static void
+add_custom_shortcut (GtkTreeView  *tree_view,
+                     GtkTreeModel *model)
+{
+  KeyEntry *key_entry;
+  GtkTreeIter iter;
+  GtkTreeIter parent_iter;
+  GtkTreePath *path;
+  gchar *dir;
+  GError *error;
+
+  error = NULL;
+  dir = find_free_gsettings_path (&error);
+  if (dir == NULL)
+    {
+      show_error (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tree_view))), error);
+
+      g_error_free (error);
+      return;
+    }
+
+  key_entry = g_new0 (KeyEntry, 1);
+  key_entry->gsettings_path = g_strdup(dir);
+  key_entry->gsettings_key = g_strdup("binding");
+  key_entry->editable = TRUE;
+  key_entry->model = model;
+  key_entry->desc_gsettings_key = g_strdup("name");
+  key_entry->description = g_strdup ("");
+  key_entry->desc_editable = TRUE;
+  key_entry->cmd_gsettings_key = g_strdup("action");
+  key_entry->command = g_strdup ("");
+  key_entry->cmd_editable = TRUE;
+  g_free (dir);
+
+  if (edit_custom_shortcut (key_entry) &&
+      key_entry->command && key_entry->command[0])
+    {
+      find_section (model, &iter, _("Custom Shortcuts"));
+      parent_iter = iter;
+      gtk_tree_store_append (GTK_TREE_STORE (model), &iter, &parent_iter);
+      gtk_tree_store_set (GTK_TREE_STORE (model), &iter, KEYENTRY_COLUMN, key_entry, -1);
+
+      /* store in gsettings */
+      key_entry->settings = g_settings_new_with_path (CUSTOM_KEYBINDING_SCHEMA, key_entry->gsettings_path);
+      g_settings_set_string (key_entry->settings, key_entry->gsettings_key, "disabled");
+      g_settings_set_string (key_entry->settings, key_entry->desc_gsettings_key, key_entry->description);
+      g_settings_set_string (key_entry->settings, key_entry->cmd_gsettings_key, key_entry->command);
+
+      /* add gsettings watches */
+      key_entry->gsettings_cnxn_desc = g_signal_connect (key_entry->settings,
+                                                         "changed::name",
+                                                         G_CALLBACK (keybinding_description_changed),
+                                                         key_entry);
+      key_entry->gsettings_cnxn_cmd = g_signal_connect (key_entry->settings,
+                                                        "changed::action",
+                                                        G_CALLBACK (keybinding_command_changed),
+                                                        key_entry);
+      key_entry->gsettings_cnxn = g_signal_connect (key_entry->settings,
+                                                    "changed::binding",
+                                                    G_CALLBACK (keybinding_key_changed),
+                                                    key_entry);
+
+      /* make the new shortcut visible */
+      path = gtk_tree_model_get_path (model, &iter);
+      gtk_tree_view_expand_to_path (tree_view, path);
+      gtk_tree_view_scroll_to_cell (tree_view, path, NULL, FALSE, 0, 0);
+      gtk_tree_path_free (path);
+    }
+  else
+    {
+      g_free (key_entry->gsettings_path);
+      g_free (key_entry->gsettings_key);
+      g_free (key_entry->description);
+      g_free (key_entry->desc_gsettings_key);
+      g_free (key_entry->command);
+      g_free (key_entry->cmd_gsettings_key);
+      g_free (key_entry);
+    }
+}
+
+static void
+start_editing_kb_cb (GtkTreeView *treeview,
+              GtkTreePath *path,
+              GtkTreeViewColumn *column,<--- Parameter 'column' can be declared as pointer to const
+              gpointer user_data)
+{
+      GtkTreeModel *model;
+      GtkTreeIter iter;
+      KeyEntry *key;
+
+      model = gtk_tree_view_get_model (treeview);
+      gtk_tree_model_get_iter (model, &iter, path);
+      gtk_tree_model_get (model, &iter,
+                          KEYENTRY_COLUMN, &key,
+                         -1);
+
+      if (key == NULL)
+        {
+      /* This is a section heading - expand or collapse */
+      if (gtk_tree_view_row_expanded (treeview, path))
+        gtk_tree_view_collapse_row (treeview, path);
+      else
+        gtk_tree_view_expand_row (treeview, path, FALSE);
+          return;
+    }
+
+      /* if only the accel can be edited on the selected row
+       * always select the accel column */
+      if (key->desc_editable &&
+          column == gtk_tree_view_get_column (treeview, 0))
+        {
+          gtk_widget_grab_focus (GTK_WIDGET (treeview));
+          gtk_tree_view_set_cursor (treeview, path,
+                                    gtk_tree_view_get_column (treeview, 0),
+                                    FALSE);
+          update_custom_shortcut (model, &iter);
+        }
+      else
+        {
+          gtk_widget_grab_focus (GTK_WIDGET (treeview));
+          gtk_tree_view_set_cursor (treeview,
+                                    path,
+                                    gtk_tree_view_get_column (treeview, 1),
+                                    TRUE);
+        }
+}
+
+static gboolean
+start_editing_cb (GtkTreeView    *tree_view,
+          GdkEventButton *event,
+          gpointer        user_data)
+{
+  GtkTreePath *path;
+  GtkTreeViewColumn *column;
+
+  if ((event->window != gtk_tree_view_get_bin_window (tree_view)) ||
+      (event->type != GDK_2BUTTON_PRESS))
+    return FALSE;
+
+  if (gtk_tree_view_get_path_at_pos (tree_view,
+                     (gint) event->x,
+                     (gint) event->y,
+                     &path, &column,
+                     NULL, NULL))
+    {
+      IdleData *idle_data;
+      GtkTreeModel *model;
+      GtkTreeIter iter;
+      KeyEntry *key;
+
+      if (gtk_tree_path_get_depth (path) == 1)
+    {
+      gtk_tree_path_free (path);
+      return FALSE;
+    }
+
+      model = gtk_tree_view_get_model (tree_view);
+      gtk_tree_model_get_iter (model, &iter, path);
+      gtk_tree_model_get (model, &iter,
+                          KEYENTRY_COLUMN, &key,
+                         -1);
+
+      /* if only the accel can be edited on the selected row
+       * always select the accel column */
+      if (key->desc_editable &&
+          column == gtk_tree_view_get_column (tree_view, 0))
+        {
+          gtk_widget_grab_focus (GTK_WIDGET (tree_view));
+          gtk_tree_view_set_cursor (tree_view, path,
+                                    gtk_tree_view_get_column (tree_view, 0),
+                                    FALSE);
+          update_custom_shortcut (model, &iter);
+        }
+      else
+        {
+          idle_data = g_new (IdleData, 1);
+          idle_data->tree_view = tree_view;
+          idle_data->path = path;
+          idle_data->column = key->desc_editable ? column :
+                              gtk_tree_view_get_column (tree_view, 1);
+          g_idle_add ((GSourceFunc) real_start_editing_cb, idle_data);
+          block_accels = TRUE;
+        }
+      g_signal_stop_emission_by_name (tree_view, "button_press_event");
+    }
+  return TRUE;
+}
+
+/* this handler is used to keep accels from activating while the user
+ * is assigning a new shortcut so that he won't accidentally trigger one
+ * of the widgets */
+static gboolean maybe_block_accels(GtkWidget* widget, GdkEventKey* event, gpointer user_data)
+{
+    if (block_accels)
+    {
+        return gtk_window_propagate_key_event(GTK_WINDOW(widget), event);
+    }
+
+    return FALSE;
+}
+
+static void
+cb_dialog_response (GtkWidget *widget, gint response_id, gpointer data)
+{
+  GtkBuilder *builder = data;
+  GtkTreeView *treeview;
+  GtkTreeModel *model;
+  GtkTreeSelection *selection;
+  GtkTreeIter iter;
+
+  treeview = GTK_TREE_VIEW (gtk_builder_get_object (builder,
+                                                    "shortcut_treeview"));
+  model = gtk_tree_view_get_model (treeview);
+
+  if (response_id == GTK_RESPONSE_HELP)
+    {
+      capplet_help (GTK_WINDOW (widget),
+                    "goscustdesk-39");
+    }
+  else if (response_id == RESPONSE_ADD)
+    {
+      add_custom_shortcut (treeview, model);
+    }
+  else if (response_id == RESPONSE_REMOVE)
+    {
+      selection = gtk_tree_view_get_selection (treeview);
+      if (gtk_tree_selection_get_selected (selection, NULL, &iter))
+        {
+          remove_custom_shortcut (model, &iter);
+        }
+    }
+  else
+    {
+      clear_old_model (builder);
+      gtk_main_quit ();
+    }
+}
+
+static void
+selection_changed (GtkTreeSelection *selection, gpointer data)
+{
+  GtkWidget *button = data;
+  GtkTreeModel *model;
+  GtkTreeIter iter;
+  KeyEntry *key;
+  gboolean can_remove;
+
+  can_remove = FALSE;
+  if (gtk_tree_selection_get_selected (selection, &model, &iter))
+    {
+      gtk_tree_model_get (model, &iter, KEYENTRY_COLUMN, &key, -1);
+      if (key && key->command != NULL && key->editable)
+    can_remove = TRUE;
+    }
+
+  gtk_widget_set_sensitive (button, can_remove);
+}
+
+static void
+cb_app_dialog_response (GtkWidget *dialog, gint response_id, gpointer data)
+{
+  if (response_id == GTK_RESPONSE_OK)
+    {
+      GAppInfo *info;
+      const gchar *custom_name;
+
+      info = gtk_app_chooser_get_app_info (GTK_APP_CHOOSER (dialog));
+
+      gtk_entry_set_text (GTK_ENTRY (custom_shortcut_command_entry),
+                          g_app_info_get_executable (info));
+      /* if name isn't set yet, use the associated one */
+      custom_name = gtk_entry_get_text (GTK_ENTRY (custom_shortcut_name_entry));
+      if (! custom_name || custom_name[0] == '\0')
+        gtk_entry_set_text (GTK_ENTRY (custom_shortcut_name_entry),
+                            g_app_info_get_display_name (info));
+
+      g_object_unref (info);
+    }
+
+  gtk_widget_hide (dialog);
+}
+
+static void
+setup_dialog (GtkBuilder *builder, GSettings *marco_settings)
+{
+  GtkCellRenderer *renderer;
+  GtkTreeViewColumn *column;
+  GtkWidget *widget;
+  GtkTreeView *treeview;
+  GtkTreeSelection *selection;
+  GtkWidget *button;
+
+  treeview = GTK_TREE_VIEW (gtk_builder_get_object (builder,
+                                                    "shortcut_treeview"));
+
+  g_signal_connect (treeview, "button_press_event",
+            G_CALLBACK (start_editing_cb), builder);
+  g_signal_connect (treeview, "row-activated",
+            G_CALLBACK (start_editing_kb_cb), NULL);<--- You might need to cast the function pointer here
+
+  renderer = gtk_cell_renderer_text_new ();
+
+  g_signal_connect (renderer, "edited",
+                    G_CALLBACK (description_edited_callback),
+                    treeview);
+
+  column = gtk_tree_view_column_new_with_attributes (_("Action"),
+                             renderer,
+                             "text", DESCRIPTION_COLUMN,
+                             NULL);
+  gtk_tree_view_column_set_cell_data_func (column, renderer, description_set_func, NULL, NULL);
+  gtk_tree_view_column_set_resizable (column, FALSE);
+
+  gtk_tree_view_append_column (treeview, column);
+  gtk_tree_view_column_set_sort_column_id (column, DESCRIPTION_COLUMN);
+
+  renderer = (GtkCellRenderer *) g_object_new (EGG_TYPE_CELL_RENDERER_KEYS,
+                           "accel_mode", EGG_CELL_RENDERER_KEYS_MODE_X,
+                           NULL);
+
+  g_signal_connect (renderer, "accel_edited",
+                    G_CALLBACK (accel_edited_callback),
+                    treeview);
+
+  g_signal_connect (renderer, "accel_cleared",
+                    G_CALLBACK (accel_cleared_callback),
+                    treeview);
+
+  column = gtk_tree_view_column_new_with_attributes (_("Shortcut"), renderer, NULL);
+  gtk_tree_view_column_set_cell_data_func (column, renderer, accel_set_func, NULL, NULL);
+  gtk_tree_view_column_set_resizable (column, FALSE);
+
+  gtk_tree_view_append_column (treeview, column);
+  gtk_tree_view_column_set_sort_column_id (column, KEYENTRY_COLUMN);
+
+  g_signal_connect (marco_settings,
+                    "changed::num-workspaces",
+                    G_CALLBACK (key_entry_controlling_key_changed),
+                    builder);
+
+  /* set up the dialog */
+  reload_key_entries (builder);
+
+  widget = _gtk_builder_get_widget (builder, "mate-keybinding-dialog");
+  gtk_window_set_default_size (GTK_WINDOW (widget), 400, 500);
+  widget = _gtk_builder_get_widget (builder, "label-suggest");
+  gtk_label_set_line_wrap (GTK_LABEL (widget), TRUE);
+  gtk_label_set_max_width_chars (GTK_LABEL (widget), 60);
+
+  widget = _gtk_builder_get_widget (builder, "mate-keybinding-dialog");
+  capplet_set_icon (widget, "preferences-desktop-keyboard-shortcuts");
+  gtk_widget_show (widget);
+
+  g_signal_connect (widget, "key_press_event", G_CALLBACK (maybe_block_accels), NULL);
+  g_signal_connect (widget, "response", G_CALLBACK (cb_dialog_response), builder);
+
+  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
+  g_signal_connect (selection, "changed",
+                    G_CALLBACK (selection_changed),
+            _gtk_builder_get_widget (builder, "remove-button"));
+
+  /* setup the custom shortcut dialog */
+  custom_shortcut_dialog = _gtk_builder_get_widget (builder,
+                                                    "custom-shortcut-dialog");
+  custom_shortcut_name_entry = _gtk_builder_get_widget (builder,
+                                                        "custom-shortcut-name-entry");
+  custom_shortcut_command_entry = _gtk_builder_get_widget (builder,
+                                                           "custom-shortcut-command-entry");
+  gtk_dialog_set_default_response (GTK_DIALOG (custom_shortcut_dialog),
+                   GTK_RESPONSE_OK);
+  gtk_window_set_transient_for (GTK_WINDOW (custom_shortcut_dialog),
+                                GTK_WINDOW (widget));
+  button = _gtk_builder_get_widget (builder, "custom-shortcut-command-button");
+  widget = _gtk_builder_get_widget (builder, "custom-shortcut-application-dialog");
+  g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_dialog_run), widget);
+  g_signal_connect (widget, "response", G_CALLBACK (cb_app_dialog_response), NULL);
+  widget = gtk_app_chooser_dialog_get_widget (GTK_APP_CHOOSER_DIALOG (widget));
+  gtk_app_chooser_widget_set_show_all (GTK_APP_CHOOSER_WIDGET (widget), TRUE);
+}
+
+static void
+on_window_manager_change (const char *wm_name, GtkBuilder *builder)
+{
+  reload_key_entries (builder);
+}
+
+int
+main (int argc, char *argv[])
+{
+  GtkBuilder *builder;
+  GSettings *marco_settings;
+
+  capplet_init (NULL, &argc, &argv);
+
+  activate_settings_daemon ();
+
+  builder = gtk_builder_new_from_resource ("/org/mate/mcc/keybindings/mate-keybinding-properties.ui");
+
+  wm_common_register_window_manager_change ((GFunc) on_window_manager_change, builder);
+
+  marco_settings = g_settings_new ("org.mate.Marco.general");
+
+  setup_dialog (builder, marco_settings);
+
+  gtk_main ();
+
+  g_object_unref (marco_settings);
+  g_object_unref (builder);
+  return 0;
+}
+
+/*
+ * vim: sw=2 ts=8 cindent noai bs=2
+ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/6.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/6.html new file mode 100644 index 00000000..c1c16c06 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/6.html @@ -0,0 +1,1339 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* mate-about-me.c
+ * Copyright (C) 2002 Diego Gonzalez
+ *
+ * Written by: Diego Gonzalez <diego@pemas.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, 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/gstdio.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 <unistd.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#if HAVE_ACCOUNTSSERVICE
+#include <act/act.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-thumbnail.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "e-image-chooser.h"
+#include "mate-about-me-password.h"
+#include "mate-about-me-fingerprint.h"
+
+#include "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+
+#define MAX_HEIGHT 100
+#define MAX_WIDTH  100
+
+typedef struct {
+
+	GtkBuilder 	*dialog;
+	GtkWidget	*enable_fingerprint_button;
+	GtkWidget	*disable_fingerprint_button;
+	GtkWidget   	*image_chooser;
+	GdkPixbuf       *image;
+#if HAVE_ACCOUNTSSERVICE
+	ActUser         *user;
+#endif
+
+	GdkScreen    	*screen;
+	GtkIconTheme 	*theme;
+	MateDesktopThumbnailFactory *thumbs;
+
+	gboolean      	 have_image;
+	gboolean      	 image_changed;
+	gboolean      	 create_self;
+
+	gchar        	*person;
+	gchar 		*login;
+	gchar 		*username;
+
+	guint	      	 commit_timeout_id;
+} MateAboutMe;
+
+static MateAboutMe *me = NULL;
+
+static void
+about_me_destroy (void)
+{
+	if (me->dialog)
+		g_object_unref (me->dialog);
+	if (me->image)
+		g_object_unref (me->image);
+
+	g_free (me->person);
+	g_free (me->login);
+	g_free (me->username);
+	g_free (me);
+	me = NULL;
+}
+
+static void
+about_me_load_photo (MateAboutMe *me)
+{
+	gchar         *file = NULL;<--- Assignment 'file=NULL', assigned value is 0
+	GError        *error = NULL;
+#if HAVE_ACCOUNTSSERVICE
+	const gchar   *act_file;
+
+	if (act_user_is_loaded (me->user)) {
+		act_file = act_user_get_icon_file (me->user);
+		if ( act_file != NULL && strlen (act_file) > 1) {
+			file = g_strdup (act_file);
+		}
+	}
+#endif
+	if (file == NULL) {<--- Condition 'file==NULL' is always true
+		file = g_build_filename (g_get_home_dir (), ".face", NULL);
+	}
+
+	me->image = gdk_pixbuf_new_from_file(file, &error);
+
+	if (me->image != NULL) {
+		e_image_chooser_set_from_file (E_IMAGE_CHOOSER (me->image_chooser), file);
+		me->have_image = TRUE;
+	} else {
+		me->have_image = FALSE;
+		g_warning ("Could not load %s: %s", file, error->message);
+		e_image_chooser_set_from_file (E_IMAGE_CHOOSER (me->image_chooser), me->person);
+		g_error_free (error);
+	}
+	g_free (file);
+}
+
+static void
+about_me_update_photo (MateAboutMe *me)
+{
+	gchar         *file;
+	GError        *error = NULL;
+
+	guchar 	      *data;
+	gsize 	       length;
+
+	if (me->image_changed && me->have_image) {
+		GdkPixbufLoader *loader = gdk_pixbuf_loader_new ();
+		GdkPixbuf *pixbuf = NULL, *scaled = NULL;
+		int height, width;
+		gboolean do_scale = FALSE;
+		float scale = 1.0;
+		float scalex = 1.0, scaley = 1.0;<--- Variable 'scalex' is assigned a value that is never used.<--- Variable 'scaley' is assigned a value that is never used.
+
+		e_image_chooser_get_image_data (E_IMAGE_CHOOSER (me->image_chooser), (char **) &data, &length);
+
+		/* Before updating the image in EDS scale it to a reasonable size
+		   so that the user doesn't get an application that does not respond
+		   or that takes 100% CPU */
+		gdk_pixbuf_loader_write (loader, data, length, NULL);
+		gdk_pixbuf_loader_close (loader, NULL);
+
+		pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
+
+		if (pixbuf)
+			g_object_ref (pixbuf);
+
+		g_object_unref (loader);
+
+		height = gdk_pixbuf_get_height (pixbuf);
+		width = gdk_pixbuf_get_width (pixbuf);
+
+		if (width > MAX_WIDTH) {
+			scalex = (float)MAX_WIDTH/width;
+			if (scalex < scale) {
+				scale = scalex;
+			}
+			do_scale = TRUE;
+		}
+
+		if (height > MAX_HEIGHT) {
+			scaley = (float)MAX_HEIGHT/height;
+			if (scaley < scale) {
+				scale = scaley;
+			}
+			do_scale = TRUE;
+		}
+
+		if (do_scale) {
+			char *scaled_data = NULL;
+			gsize scaled_length;
+
+			scaled = gdk_pixbuf_scale_simple (pixbuf, width*scale, height*scale, GDK_INTERP_BILINEAR);
+			gdk_pixbuf_save_to_buffer (scaled, &scaled_data, &scaled_length, "png", NULL,
+						   "compression", "9", NULL);
+
+			g_free (data);
+			data = (guchar *) scaled_data;
+			length = scaled_length;
+		}
+
+		/* Save the image for MDM */
+		/* FIXME: I would have to read the default used by the mdmgreeter program */
+		error = NULL;
+		file = g_build_filename (g_get_home_dir (), ".face", NULL);
+		if (g_file_set_contents (file, (gchar *)data, length, &error) == TRUE) {
+			g_chmod (file, 0644);
+#if HAVE_ACCOUNTSSERVICE
+			act_user_set_icon_file (me->user, file);
+#endif
+		} else {
+			g_warning ("Could not create %s: %s", file, error->message);
+			g_error_free (error);
+		}
+
+		g_free (file);
+		g_object_unref (pixbuf);
+		g_free (data);
+	} else if (me->image_changed && !me->have_image) {
+		/* Update the image in the card */
+		file = g_build_filename (g_get_home_dir (), ".face", NULL);
+
+		g_unlink (file);
+
+		g_free (file);
+#if HAVE_ACCOUNTSSERVICE
+		act_user_set_icon_file (me->user, "");
+#endif
+	}
+}
+
+static void
+about_me_load_info (MateAboutMe *me)
+{
+	set_fingerprint_label (me->enable_fingerprint_button,
+			       me->disable_fingerprint_button);
+}
+
+static void
+about_me_update_preview (GtkFileChooser *chooser,
+			 MateAboutMe   *me)
+{
+	gchar *uri;
+
+	uri = gtk_file_chooser_get_preview_uri (chooser);
+
+	if (uri) {
+		GtkWidget *image;
+		GdkPixbuf *pixbuf = NULL;
+		GFile *file;
+		GFileInfo *file_info;
+
+		if (!me->thumbs)
+			me->thumbs = mate_desktop_thumbnail_factory_new (MATE_DESKTOP_THUMBNAIL_SIZE_NORMAL);
+
+		file = g_file_new_for_uri (uri);
+		file_info = g_file_query_info (file,
+					       G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+					       G_FILE_QUERY_INFO_NONE,
+					       NULL, NULL);
+		g_object_unref (file);
+
+		if (file_info != NULL) {
+			const gchar *content_type;
+
+			content_type = g_file_info_get_content_type (file_info);
+			if (content_type) {
+				gchar *mime_type;
+
+				mime_type = g_content_type_get_mime_type (content_type);
+
+				pixbuf = mate_desktop_thumbnail_factory_generate_thumbnail (me->thumbs,
+										     uri,
+										     mime_type);
+				g_free (mime_type);
+			}
+			g_object_unref (file_info);
+		}
+
+		image = gtk_file_chooser_get_preview_widget (chooser);
+
+		if (pixbuf != NULL) {
+			gtk_image_set_from_pixbuf (GTK_IMAGE (image), pixbuf);
+			g_object_unref (pixbuf);
+		} else {
+			gtk_image_set_from_icon_name (GTK_IMAGE (image),
+						  "dialog-question",
+						  GTK_ICON_SIZE_DIALOG);
+		}
+	}
+	gtk_file_chooser_set_preview_widget_active (chooser, TRUE);
+}
+
+static void
+about_me_image_clicked_cb (GtkWidget *button, MateAboutMe *me)
+{
+	GtkFileChooser *chooser_dialog;
+	gint response;
+	GtkBuilder *dialog;
+	GtkWidget  *image;
+	const gchar *chooser_dir = DATADIR"/pixmaps/faces";
+	const gchar *pics_dir;
+	GtkFileFilter *filter;
+
+	dialog = me->dialog;
+
+	chooser_dialog =
+		GTK_FILE_CHOOSER (
+			gtk_file_chooser_dialog_new (_("Select Image"),
+			GTK_WINDOW (gtk_builder_get_object (dialog, "about-me-dialog")),
+			GTK_FILE_CHOOSER_ACTION_OPEN,
+			_("No Image"), GTK_RESPONSE_NO,
+			"gtk-cancel", GTK_RESPONSE_CANCEL,
+			"gtk-open", GTK_RESPONSE_ACCEPT,
+			NULL));
+	gtk_window_set_modal (GTK_WINDOW (chooser_dialog), TRUE);
+	gtk_dialog_set_default_response (GTK_DIALOG (chooser_dialog), GTK_RESPONSE_ACCEPT);
+
+	gtk_file_chooser_add_shortcut_folder (chooser_dialog, chooser_dir, NULL);
+	pics_dir = g_get_user_special_dir (G_USER_DIRECTORY_PICTURES);
+	if (pics_dir != NULL)
+		gtk_file_chooser_add_shortcut_folder (chooser_dialog, pics_dir, NULL);
+
+	if (!g_file_test (chooser_dir, G_FILE_TEST_IS_DIR))
+		chooser_dir = g_get_home_dir ();
+
+	gtk_file_chooser_set_current_folder (chooser_dialog, chooser_dir);
+	gtk_file_chooser_set_use_preview_label (chooser_dialog,	FALSE);
+
+	image = gtk_image_new ();
+	gtk_file_chooser_set_preview_widget (chooser_dialog, image);
+	gtk_widget_set_size_request (image, 128, -1);
+
+	gtk_widget_show (image);
+
+	g_signal_connect (chooser_dialog, "update-preview",
+			  G_CALLBACK (about_me_update_preview), me);
+
+	filter = gtk_file_filter_new ();
+	gtk_file_filter_set_name (filter, _("Images"));
+	gtk_file_filter_add_pixbuf_formats (filter);
+	gtk_file_chooser_add_filter (chooser_dialog, filter);
+	filter = gtk_file_filter_new ();
+	gtk_file_filter_set_name (filter, _("All Files"));
+	gtk_file_filter_add_pattern(filter, "*");
+	gtk_file_chooser_add_filter (chooser_dialog, filter);
+
+	response = gtk_dialog_run (GTK_DIALOG (chooser_dialog));
+
+	if (response == GTK_RESPONSE_ACCEPT) {
+		gchar* filename;
+
+		filename = gtk_file_chooser_get_filename (chooser_dialog);
+		me->have_image = TRUE;
+		me->image_changed = TRUE;
+
+		e_image_chooser_set_from_file (E_IMAGE_CHOOSER (me->image_chooser), filename);
+		g_free (filename);
+		about_me_update_photo (me);
+	} else if (response == GTK_RESPONSE_NO) {
+		me->have_image = FALSE;
+		me->image_changed = TRUE;
+		e_image_chooser_set_from_file (E_IMAGE_CHOOSER (me->image_chooser), me->person);
+		about_me_update_photo (me);
+	}
+
+	gtk_widget_destroy (GTK_WIDGET (chooser_dialog));
+}
+
+static void
+about_me_image_changed_cb (GtkWidget *widget, MateAboutMe *me)
+{
+	me->have_image = TRUE;
+	me->image_changed = TRUE;
+	about_me_update_photo (me);
+}
+
+/* About Me Dialog Callbacks */
+
+static void
+about_me_icon_theme_changed (GtkWindow    *window,
+			     GtkIconTheme *theme)
+{
+	GtkIconInfo *icon;
+
+	icon = gtk_icon_theme_lookup_icon (me->theme, "avatar-default", 80, 0);
+	if (icon != NULL) {
+		g_free (me->person);
+		me->person = g_strdup (gtk_icon_info_get_filename (icon));
+		g_object_unref (icon);
+	}
+
+	if (me->have_image) {
+#if HAVE_ACCOUNTSSERVICE
+		act_user_set_icon_file (me->user, me->person);
+#endif
+		e_image_chooser_set_from_file (E_IMAGE_CHOOSER (me->image_chooser), me->person);
+	}
+}
+
+static void
+about_me_button_clicked_cb (GtkDialog *dialog, gint response_id, MateAboutMe *me)
+{
+	if (me->commit_timeout_id) {
+		g_source_remove (me->commit_timeout_id);
+	}
+
+	about_me_destroy ();
+	gtk_main_quit ();
+}
+
+static void
+about_me_passwd_clicked_cb (GtkWidget *button, MateAboutMe *me)
+{
+	GtkBuilder *dialog;
+
+	dialog = me->dialog;
+	mate_about_me_password (GTK_WINDOW (gtk_builder_get_object (dialog, "about-me-dialog")));
+}
+
+static void
+about_me_fingerprint_button_clicked_cb (GtkWidget *button, MateAboutMe *me)
+{
+	fingerprint_button_clicked (me->dialog,
+				    me->enable_fingerprint_button,
+				    me->disable_fingerprint_button);
+}
+
+#if HAVE_ACCOUNTSSERVICE
+static void on_user_is_loaded_changed (ActUser *user, GParamSpec *pspec, MateAboutMe* me)
+{
+	if (act_user_is_loaded (user)) {
+		about_me_load_photo (me);
+		g_signal_handlers_disconnect_by_func (G_OBJECT (user),
+				G_CALLBACK (on_user_is_loaded_changed),
+				me);
+	}
+}
+#endif
+
+static gint
+about_me_setup_dialog (void)
+{
+	GtkWidget    *widget;
+	GtkWidget    *main_dialog;
+	GtkIconInfo  *icon;
+	GtkBuilder   *dialog;
+	GError       *error = NULL;
+	gchar        *str;
+#if HAVE_ACCOUNTSSERVICE
+	ActUserManager* manager;
+#endif
+
+	me = g_new0 (MateAboutMe, 1);
+	me->image = NULL;
+
+	dialog = gtk_builder_new ();
+	if (gtk_builder_add_from_resource (dialog, "/org/mate/mcc/am/mate-about-me-dialog.ui", &error) == 0)
+        {
+                g_warning ("Could not parse UI definition: %s", error->message);
+                g_error_free (error);
+        }
+
+	me->image_chooser = e_image_chooser_new_with_size (MAX_WIDTH, MAX_HEIGHT);
+	gtk_container_add (GTK_CONTAINER (gtk_builder_get_object (dialog, "button-image")), me->image_chooser);
+
+	if (dialog == NULL) {
+		about_me_destroy ();
+		return -1;
+	}
+
+	me->dialog = dialog;
+
+	/* Connect the close button signal */
+	main_dialog = WID ("about-me-dialog");
+	g_signal_connect (main_dialog, "response",
+			  G_CALLBACK (about_me_button_clicked_cb), me);
+
+	gtk_window_set_resizable (GTK_WINDOW (main_dialog), FALSE);
+	capplet_set_icon (main_dialog, "user-info");
+
+	/* Setup theme details */
+	me->screen = gtk_window_get_screen (GTK_WINDOW (main_dialog));
+	me->theme = gtk_icon_theme_get_for_screen (me->screen);
+
+	icon = gtk_icon_theme_lookup_icon (me->theme, "avatar-default", 80, 0);
+	if (icon != NULL) {
+		me->person = g_strdup (gtk_icon_info_get_filename (icon));
+		g_object_unref (icon);
+	}
+
+	g_signal_connect_object (me->theme, "changed",
+				 G_CALLBACK (about_me_icon_theme_changed),
+				 main_dialog,
+				 G_CONNECT_SWAPPED);
+
+	me->login = g_strdup (g_get_user_name ());
+	me->username = g_strdup (g_get_real_name ());
+
+#if HAVE_ACCOUNTSSERVICE
+	manager = act_user_manager_get_default ();
+	me->user = act_user_manager_get_user (manager, me->login);
+	g_signal_connect (me->user, "notify::is-loaded", G_CALLBACK (on_user_is_loaded_changed), me);
+#endif
+	/* Contact Tab */
+	about_me_load_photo (me);
+
+	widget = WID ("fullname");
+	str = g_strdup_printf ("<b><span size=\"xx-large\">%s</span></b>", me->username);
+
+	gtk_label_set_markup (GTK_LABEL (widget), str);
+	g_free (str);
+
+	widget = WID ("login");
+	gtk_label_set_text (GTK_LABEL (widget), me->login);
+
+	str = g_strdup_printf (_("About %s"), me->username);
+	gtk_window_set_title (GTK_WINDOW (main_dialog), str);
+	g_free (str);
+
+	widget = WID ("password");
+	g_signal_connect (widget, "clicked",
+			  G_CALLBACK (about_me_passwd_clicked_cb), me);
+
+	widget = WID ("button-image");
+	g_signal_connect (widget, "clicked",
+			  G_CALLBACK (about_me_image_clicked_cb), me);
+
+	me->enable_fingerprint_button = WID ("enable_fingerprint_button");
+	me->disable_fingerprint_button = WID ("disable_fingerprint_button");
+
+	g_signal_connect (me->enable_fingerprint_button, "clicked",
+			  G_CALLBACK (about_me_fingerprint_button_clicked_cb), me);
+	g_signal_connect (me->disable_fingerprint_button, "clicked",
+			  G_CALLBACK (about_me_fingerprint_button_clicked_cb), me);
+
+	g_signal_connect (me->image_chooser, "changed",
+			  G_CALLBACK (about_me_image_changed_cb), me);
+
+	about_me_load_info (me);
+
+	gtk_widget_show_all (main_dialog);
+
+	return 0;
+}
+
+int
+main (int argc, char **argv)
+{
+	int rc = 0;
+
+	capplet_init (NULL, &argc, &argv);
+
+	rc = about_me_setup_dialog ();
+
+	if (rc != -1) {
+		gtk_main ();
+	}
+
+	return rc;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/60.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/60.html new file mode 100644 index 00000000..ea1998e1 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/60.html @@ -0,0 +1,301 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/* -*- mode: c; style: linux -*- */
+
+/* accessibility-keyboard.c
+ * Copyright (C) 2002 Ximian, Inc.
+ *
+ * Written by: Jody Goldberg <jody@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, 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 __MATE_KEYBOARD_PROPERTY_A11Y_H
+#define __MATE_KEYBOARD_PROPERTY_A11Y_H
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+extern void setup_a11y_tabs (GtkBuilder * dialog);
+extern void finalize_a11y_tabs (void);
+
+#endif /* __MATE_KEYBOARD_PROPERTY_A11Y_H */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/61.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/61.html new file mode 100644 index 00000000..cbc4b186 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/61.html @@ -0,0 +1,881 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- mode: c; style: linux -*- */
+
+/*
+ * Copyright (C) 2007 The GNOME Foundation
+ * Written by Denis Washington <denisw@svn.gnome.org>
+ * All Rights Reserved
+ *
+ * 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 "mate-keyboard-properties-a11y.h"
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+
+#define NWID(s) GTK_WIDGET (gtk_builder_get_object (notifications_dialog, s))
+#define GET_TOGGLE_BUTTON(s) GTK_TOGGLE_BUTTON (gtk_builder_get_object (notifications_dialog, s))
+#define GET_RANGE(s) GTK_RANGE (gtk_builder_get_object (dialog, s))
+
+#define A11Y_SCHEMA "org.mate.accessibility-keyboard"
+#define MARCO_SCHEMA "org.mate.Marco.general"
+
+static GtkBuilder *notifications_dialog = NULL;
+static GSettings *a11y_settings = NULL;
+
+enum
+{
+	VISUAL_BELL_TYPE_INVALID,
+	VISUAL_BELL_TYPE_FULLSCREEN,
+	VISUAL_BELL_TYPE_FRAME_FLASH
+};
+
+static void
+stickykeys_enable_toggled_cb (GtkWidget *w, GtkBuilder *dialog)
+{
+	gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
+
+	gtk_widget_set_sensitive (WID ("stickykeys_latch_to_lock"), active);
+	gtk_widget_set_sensitive (WID ("stickykeys_two_key_off"), active);
+	if (notifications_dialog)
+		gtk_widget_set_sensitive (NWID ("stickykeys_notifications_box"), active);
+}
+
+static void
+slowkeys_enable_toggled_cb (GtkWidget *w, GtkBuilder *dialog)
+{
+	gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
+
+	gtk_widget_set_sensitive (WID ("slowkeys_delay_box"), active);
+	if (notifications_dialog)
+		gtk_widget_set_sensitive (NWID ("slowkeys_notifications_box"), active);
+}
+
+static void
+bouncekeys_enable_toggled_cb (GtkWidget *w, GtkBuilder *dialog)
+{
+	gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
+
+	gtk_widget_set_sensitive (WID ("bouncekeys_delay_box"), active);
+	if (notifications_dialog)
+		gtk_widget_set_sensitive (NWID ("bouncekeys_notifications_box"), active);
+}
+
+static void
+visual_bell_enable_toggled_cb (GtkWidget *w, GtkBuilder *dialog)
+{
+	gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
+
+	if (notifications_dialog) {
+		gtk_widget_set_sensitive (NWID ("visual_bell_titlebar"), active);
+		gtk_widget_set_sensitive (NWID ("visual_bell_fullscreen"), active);
+	}
+}
+
+static void
+bell_flash_gsettings_changed (GSettings *settings, gchar *key, GtkBuilder *dialog)
+{
+	int bell_flash_type = g_settings_get_enum (settings, key);
+	if (bell_flash_type == VISUAL_BELL_TYPE_FULLSCREEN)
+	{
+		gtk_toggle_button_set_active (GET_TOGGLE_BUTTON ("visual_bell_fullscreen"), TRUE);
+	}
+	else if (bell_flash_type == VISUAL_BELL_TYPE_FRAME_FLASH)
+	{
+		gtk_toggle_button_set_active (GET_TOGGLE_BUTTON ("visual_bell_titlebar"), TRUE);
+	}
+}
+
+static void
+bell_flash_radio_changed (GtkWidget *widget, GtkBuilder *builder)
+{
+	GSettings *marco_settings;
+	marco_settings = g_settings_new (MARCO_SCHEMA);
+	int old_bell_flash_type = g_settings_get_enum (marco_settings, "visual-bell-type");
+	int new_bell_flash_type = VISUAL_BELL_TYPE_INVALID;
+
+	if (gtk_toggle_button_get_active (GET_TOGGLE_BUTTON ("visual_bell_fullscreen")))
+		new_bell_flash_type = VISUAL_BELL_TYPE_FULLSCREEN;
+	else if (gtk_toggle_button_get_active (GET_TOGGLE_BUTTON ("visual_bell_titlebar")))
+		new_bell_flash_type = VISUAL_BELL_TYPE_FRAME_FLASH;
+
+	if (old_bell_flash_type != new_bell_flash_type)
+		g_settings_set_enum (marco_settings, "visual-bell-type", new_bell_flash_type);
+
+	g_object_unref (marco_settings);
+}
+
+static void
+a11y_notifications_dialog_response_cb (GtkWidget *w, gint response)
+{
+	if (response == GTK_RESPONSE_HELP) {
+		capplet_help (GTK_WINDOW (w),
+		              "prefs-keyboard#goscustdesk-TBL-86");
+	}
+	else {
+		gtk_widget_destroy (w);
+	}
+}
+static void
+notifications_button_clicked_cb (GtkWidget *button, GtkBuilder *dialog)
+{
+	GtkWidget *w;
+
+	notifications_dialog = gtk_builder_new ();
+	gtk_builder_add_from_resource (notifications_dialog,
+	                               "/org/mate/mcc/keyboard/mate-keyboard-properties-a11y-notifications.ui",
+	                               NULL);
+
+	stickykeys_enable_toggled_cb (WID ("stickykeys_enable"), dialog);
+	slowkeys_enable_toggled_cb (WID ("slowkeys_enable"), dialog);
+	bouncekeys_enable_toggled_cb (WID ("bouncekeys_enable"), dialog);
+
+	g_settings_bind (a11y_settings, "feature-state-change-beep",
+	                 gtk_builder_get_object (notifications_dialog, "feature_state_change_beep"), "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	g_settings_bind (a11y_settings, "togglekeys-enable",
+	                 gtk_builder_get_object (notifications_dialog, "togglekeys_enable"), "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	g_settings_bind (a11y_settings, "capslock-beep-enable",
+	                 gtk_builder_get_object (notifications_dialog, "capslock_beep_enable"), "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	g_settings_bind (a11y_settings, "stickykeys-modifier-beep",
+	                 gtk_builder_get_object (notifications_dialog, "stickykeys_modifier_beep"), "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	g_settings_bind (a11y_settings, "slowkeys-beep-press",
+	                 gtk_builder_get_object (notifications_dialog, "stickykeys_modifier_beep"), "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	g_settings_bind (a11y_settings, "slowkeys-beep-accept",
+	                 gtk_builder_get_object (notifications_dialog, "slowkeys_beep_accept"), "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	g_settings_bind (a11y_settings, "slowkeys-beep-reject",
+	                 gtk_builder_get_object (notifications_dialog, "slowkeys_beep_reject"), "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	g_settings_bind (a11y_settings, "bouncekeys-beep-reject",
+	                 gtk_builder_get_object (notifications_dialog, "bouncekeys_beep_reject"), "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	GSettings *marco_settings = g_settings_new (MARCO_SCHEMA);
+	w = NWID ("visual_bell_enable");
+	g_settings_bind (marco_settings, "visual-bell", w, "active", G_SETTINGS_BIND_DEFAULT);
+	g_signal_connect (w, "toggled",
+	                  G_CALLBACK (visual_bell_enable_toggled_cb),
+	                  dialog);
+	visual_bell_enable_toggled_cb (w, dialog);
+
+	bell_flash_gsettings_changed (marco_settings, "visual-bell-type", NULL);
+	g_signal_connect (gtk_builder_get_object (notifications_dialog, "visual_bell_titlebar"), "clicked",
+	                  G_CALLBACK(bell_flash_radio_changed),
+	                  notifications_dialog);
+	g_signal_connect (gtk_builder_get_object (notifications_dialog, "visual_bell_fullscreen"), "clicked",
+	                  G_CALLBACK(bell_flash_radio_changed),
+	                  notifications_dialog);
+	g_signal_connect (marco_settings, "changed::visual-bell-type",
+	                  G_CALLBACK (bell_flash_gsettings_changed),
+	                  notifications_dialog);
+
+	w = NWID ("a11y_notifications_dialog");
+	gtk_window_set_transient_for (GTK_WINDOW (w),
+	                              GTK_WINDOW (gtk_builder_get_object (notifications_dialog, "keyboard_dialog")));
+	g_signal_connect (w, "response",
+	                  G_CALLBACK (a11y_notifications_dialog_response_cb),
+	                  NULL);
+
+	gtk_dialog_run (GTK_DIALOG (w));
+
+	g_object_unref (marco_settings);
+	g_object_unref (notifications_dialog);
+	notifications_dialog = NULL;
+}
+
+static void
+mousekeys_enable_toggled_cb (GtkWidget *w, GtkBuilder *dialog)
+{
+	gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
+	gtk_widget_set_sensitive (WID ("mousekeys_table"), active);
+}
+
+void
+finalize_a11y_tabs (void)
+{
+	g_object_unref (a11y_settings);
+}
+
+void
+setup_a11y_tabs (GtkBuilder *dialog)
+{
+	GtkWidget *w;
+
+	a11y_settings = g_settings_new (A11Y_SCHEMA);
+
+	/* Accessibility tab */
+	g_settings_bind (a11y_settings, "enable",
+	                 gtk_builder_get_object (dialog, "master_enable"), "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	w = WID ("stickykeys_enable");
+	g_settings_bind (a11y_settings, "stickykeys-enable",
+	                 w, "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+	g_signal_connect (w, "toggled",
+	                  G_CALLBACK (stickykeys_enable_toggled_cb),
+	                  dialog);
+	stickykeys_enable_toggled_cb (w, dialog);
+
+	g_settings_bind (a11y_settings, "stickykeys-latch-to-lock",
+	                 gtk_builder_get_object (dialog, "stickykeys_latch_to_lock"), "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	g_settings_bind (a11y_settings, "stickykeys-two-key-off",
+	                 gtk_builder_get_object (dialog, "stickykeys_two_key_off"), "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	w = WID ("slowkeys_enable");
+	g_settings_bind (a11y_settings, "slowkeys-enable",
+	                 w, "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+	g_signal_connect (w, "toggled",
+	                  G_CALLBACK (slowkeys_enable_toggled_cb),
+	                  dialog);
+	slowkeys_enable_toggled_cb (w, dialog);
+
+	w = WID ("bouncekeys_enable");
+	g_settings_bind (a11y_settings, "bouncekeys-enable",
+	                 w, "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+	g_signal_connect (w, "toggled",
+	                  G_CALLBACK (bouncekeys_enable_toggled_cb),
+	                  dialog);
+	bouncekeys_enable_toggled_cb (w, dialog);
+
+	g_settings_bind (a11y_settings, "slowkeys-delay",
+	                 gtk_range_get_adjustment (GET_RANGE ("slowkeys_delay_slide")), "value",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	g_settings_bind (a11y_settings, "bouncekeys-delay",
+	                 gtk_range_get_adjustment (GET_RANGE ("bouncekeys_delay_slide")), "value",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	g_signal_connect (gtk_builder_get_object (dialog, "notifications_button"), "clicked",
+	                  G_CALLBACK (notifications_button_clicked_cb),
+	                  dialog);
+
+	/* Mouse Keys tab */
+
+	w = WID ("mousekeys_enable");
+	g_settings_bind (a11y_settings, "mousekeys-enable",
+	                 w, "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+	g_signal_connect (w, "toggled",
+			  G_CALLBACK (mousekeys_enable_toggled_cb), dialog);
+	mousekeys_enable_toggled_cb (w, dialog);
+
+	g_settings_bind (a11y_settings, "slowkeys-delay",
+	                 gtk_range_get_adjustment (GET_RANGE ("slowkeys_delay_slide")), "value",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	g_settings_bind (a11y_settings, "bouncekeys-delay",
+	                 gtk_range_get_adjustment (GET_RANGE ("bouncekeys_delay_slide")), "value",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	g_settings_bind (a11y_settings, "slowkeys-delay",
+	                 gtk_range_get_adjustment (GET_RANGE ("slowkeys_delay_slide")), "value",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	g_settings_bind (a11y_settings, "bouncekeys-delay",
+	                 gtk_range_get_adjustment (GET_RANGE ("bouncekeys_delay_slide")), "value",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	g_settings_bind (a11y_settings, "mousekeys-accel-time",
+	                 gtk_range_get_adjustment (GET_RANGE ("mousekeys_accel_time_slide")), "value",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	g_settings_bind (a11y_settings, "mousekeys-max-speed",
+	                 gtk_range_get_adjustment (GET_RANGE ("mousekeys_max_speed_slide")), "value",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	g_settings_bind (a11y_settings, "mousekeys-init-delay",
+	                 gtk_range_get_adjustment (GET_RANGE ("mousekeys_init_delay_slide")), "value",
+	                 G_SETTINGS_BIND_DEFAULT);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/62.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/62.html new file mode 100644 index 00000000..985125d4 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/62.html @@ -0,0 +1,2153 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
#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.keyboard"), aligned (8)))
+#else
+# define SECTION
+#endif
+
+static const SECTION union { const guint8 data[12010]; const double alignment; void * const ptr;}  keyboard_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, 0070, 0001, 0000, 0000, 0000, 0000, 0000, 0050, 0012, 0000, 0000, 0000, 
+  0000, 0000, 0000, 0000, 0002, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 
+  0004, 0000, 0000, 0000, 0004, 0000, 0000, 0000, 0006, 0000, 0000, 0000, 0006, 0000, 0000, 0000, 
+  0007, 0000, 0000, 0000, 0011, 0000, 0000, 0000, 0324, 0265, 0002, 0000, 0377, 0377, 0377, 0377, 
+  0070, 0001, 0000, 0000, 0001, 0000, 0114, 0000, 0074, 0001, 0000, 0000, 0100, 0001, 0000, 0000, 
+  0244, 0321, 0250, 0167, 0002, 0000, 0000, 0000, 0100, 0001, 0000, 0000, 0052, 0000, 0166, 0000, 
+  0160, 0001, 0000, 0000, 0057, 0005, 0000, 0000, 0203, 0240, 0324, 0166, 0006, 0000, 0000, 0000, 
+  0057, 0005, 0000, 0000, 0011, 0000, 0114, 0000, 0070, 0005, 0000, 0000, 0114, 0005, 0000, 0000, 
+  0253, 0125, 0231, 0307, 0002, 0000, 0000, 0000, 0114, 0005, 0000, 0000, 0042, 0000, 0166, 0000, 
+  0160, 0005, 0000, 0000, 0002, 0036, 0000, 0000, 0113, 0120, 0220, 0013, 0000, 0000, 0000, 0000, 
+  0002, 0036, 0000, 0000, 0004, 0000, 0114, 0000, 0010, 0036, 0000, 0000, 0014, 0036, 0000, 0000, 
+  0201, 0321, 0040, 0031, 0004, 0000, 0000, 0000, 0014, 0036, 0000, 0000, 0005, 0000, 0114, 0000, 
+  0024, 0036, 0000, 0000, 0030, 0036, 0000, 0000, 0143, 0041, 0175, 0170, 0005, 0000, 0000, 0000, 
+  0030, 0036, 0000, 0000, 0004, 0000, 0114, 0000, 0034, 0036, 0000, 0000, 0040, 0036, 0000, 0000, 
+  0276, 0370, 0376, 0037, 0002, 0000, 0000, 0000, 0040, 0036, 0000, 0000, 0056, 0000, 0166, 0000, 
+  0120, 0036, 0000, 0000, 0352, 0044, 0000, 0000, 0214, 0365, 0205, 0264, 0002, 0000, 0000, 0000, 
+  0352, 0044, 0000, 0000, 0051, 0000, 0166, 0000, 0030, 0045, 0000, 0000, 0026, 0051, 0000, 0000, 
+  0331, 0053, 0205, 0241, 0002, 0000, 0000, 0000, 0026, 0051, 0000, 0000, 0052, 0000, 0166, 0000, 
+  0100, 0051, 0000, 0000, 0351, 0056, 0000, 0000, 0057, 0000, 0000, 0000, 0004, 0000, 0000, 0000, 
+  0155, 0141, 0164, 0145, 0055, 0153, 0145, 0171, 0142, 0157, 0141, 0162, 0144, 0055, 0160, 0162, 
+  0157, 0160, 0145, 0162, 0164, 0151, 0145, 0163, 0055, 0157, 0160, 0164, 0151, 0157, 0156, 0163, 
+  0055, 0144, 0151, 0141, 0154, 0157, 0147, 0056, 0165, 0151, 0000, 0000, 0000, 0000, 0000, 0000, 
+  0165, 0024, 0000, 0000, 0001, 0000, 0000, 0000, 0170, 0332, 0355, 0130, 0113, 0157, 0333, 0070, 
+  0020, 0276, 0367, 0127, 0260, 0274, 0026, 0214, 0037, 0111, 0321, 0075, 0310, 0052, 0122, 0304, 
+  0315, 0026, 0151, 0232, 0042, 0166, 0266, 0107, 0201, 0242, 0306, 0022, 0153, 0206, 0324, 0222, 
+  0264, 0035, 0003, 0373, 0343, 0227, 0222, 0154, 0047, 0216, 0350, 0050, 0122, 0272, 0213, 0034, 
+  0172, 0223, 0310, 0371, 0106, 0337, 0074, 0311, 0121, 0360, 0361, 0356, 0126, 0240, 0045, 0150, 
+  0303, 0225, 0034, 0341, 0301, 0121, 0037, 0043, 0220, 0114, 0045, 0134, 0246, 0043, 0174, 0063, 
+  0375, 0114, 0376, 0300, 0037, 0303, 0067, 0301, 0133, 0102, 0320, 0071, 0110, 0320, 0324, 0102, 
+  0202, 0126, 0334, 0146, 0050, 0025, 0064, 0001, 0164, 0174, 0064, 0354, 0037, 0365, 0021, 0041, 
+  0116, 0210, 0113, 0013, 0172, 0106, 0031, 0204, 0157, 0020, 0012, 0064, 0374, 0275, 0340, 0032, 
+  0014, 0022, 0074, 0036, 0341, 0324, 0316, 0337, 0341, 0373, 0017, 0035, 0037, 0015, 0116, 0160, 
+  0257, 0224, 0053, 0124, 0357, 0220, 0104, 0160, 0006, 0322, 0000, 0261, 0353, 0034, 0120, 0232, 
+  0213, 0345, 0260, 0324, 0135, 0223, 0223, 0364, 0026, 0320, 0255, 0143, 0103, 0346, 0260, 0216, 
+  0025, 0325, 0011, 0311, 0265, 0312, 0101, 0133, 0016, 0206, 0250, 0334, 0272, 0317, 0030, 0222, 
+  0160, 0052, 0124, 0352, 0327, 0220, 0200, 0141, 0232, 0227, 0202, 0150, 0253, 0003, 0155, 0200, 
+  0150, 0003, 0134, 0161, 0231, 0250, 0225, 0037, 0317, 0124, 0276, 0326, 0074, 0315, 0054, 0272, 
+  0074, 0235, 0216, 0321, 0031, 0054, 0101, 0024, 0004, 0214, 0137, 0234, 0056, 0154, 0246, 0334, 
+  0346, 0017, 0045, 0146, 0051, 0225, 0051, 0272, 0021, 0261, 0346, 0054, 0333, 0112, 0253, 0370, 
+  0047, 0060, 0213, 0230, 0240, 0306, 0214, 0360, 0271, 0235, 0237, 0225, 0024, 0060, 0342, 0311, 
+  0010, 0337, 0315, 0343, 0150, 0103, 0055, 0252, 0250, 0341, 0002, 0344, 0140, 0033, 0243, 0327, 
+  0250, 0160, 0310, 0010, 0063, 0052, 0243, 0231, 0142, 0013, 0203, 0303, 0317, 0124, 0030, 0010, 
+  0172, 0133, 0001, 0277, 0274, 0043, 0055, 0255, 0023, 0076, 0077, 0273, 0210, 0276, 0137, 0175, 
+  0371, 0066, 0035, 0137, 0107, 0227, 0127, 0323, 0057, 0127, 0337, 0242, 0313, 0323, 0311, 0005, 
+  0372, 0007, 0171, 0166, 0376, 0164, 0157, 0017, 0267, 0077, 0335, 0114, 0247, 0156, 0371, 0373, 
+  0365, 0170, 0062, 0361, 0254, 0137, 0217, 0277, 0216, 0117, 0047, 0343, 0162, 0247, 0211, 0117, 
+  0254, 0164, 0002, 0072, 0132, 0361, 0304, 0146, 0070, 0174, 0337, 0044, 0156, 0271, 0025, 0200, 
+  0221, 0325, 0124, 0032, 0101, 0055, 0215, 0205, 0133, 0134, 0203, 0063, 0350, 0142, 0033, 0321, 
+  0257, 0164, 0255, 0026, 0026, 0135, 0125, 0336, 0153, 0122, 0130, 0005, 0074, 0312, 0225, 0341, 
+  0205, 0074, 0016, 0135, 0066, 0272, 0010, 0022, 0045, 0111, 0116, 0265, 0173, 0156, 0122, 0220, 
+  0300, 0214, 0056, 0204, 0335, 0131, 0360, 0276, 0377, 0134, 0104, 0006, 0105, 0062, 0341, 0360, 
+  0244, 0337, 0010, 0051, 0212, 0043, 0312, 0134, 0156, 0341, 0260, 0312, 0206, 0032, 0200, 0145, 
+  0134, 0044, 0125, 0366, 0111, 0052, 0110, 0371, 0072, 0302, 0313, 0130, 0335, 0155, 0022, 0307, 
+  0227, 0161, 0237, 0334, 0156, 0231, 0156, 0225, 0122, 0122, 0210, 0237, 0354, 0344, 0353, 0064, 
+  0226, 0334, 0160, 0347, 0161, 0034, 0116, 0365, 0242, 0226, 0151, 0135, 0262, 0363, 0065, 0146, 
+  0250, 0217, 0223, 0322, 0334, 0221, 0242, 0125, 0206, 0054, 0213, 0236, 0303, 0250, 0170, 0016, 
+  0320, 0344, 0224, 0271, 0316, 0212, 0303, 0241, 0127, 0332, 0037, 0065, 0312, 0212, 0017, 0105, 
+  0056, 0375, 0350, 0203, 0140, 0170, 0003, 0270, 0260, 0126, 0311, 0307, 0141, 0174, 0200, 0077, 
+  0331, 0123, 0320, 0041, 0242, 0135, 0243, 0372, 0132, 0043, 0353, 0343, 0045, 0312, 0216, 0021, 
+  0031, 0273, 0056, 0074, 0001, 0062, 0071, 0010, 0054, 0003, 0264, 0277, 0166, 0070, 0054, 0125, 
+  0114, 0342, 0362, 0371, 0030, 0077, 0106, 0371, 0150, 0304, 0040, 0160, 0350, 0016, 0116, 0222, 
+  0201, 0310, 0017, 0221, 0350, 0034, 0306, 0206, 0120, 0266, 0205, 0152, 0140, 0300, 0227, 0340, 
+  0316, 0247, 0252, 0237, 0265, 0327, 0360, 0132, 0362, 0301, 0307, 0155, 0141, 0300, 0045, 0204, 
+  0142, 0363, 0046, 0263, 0202, 0136, 0025, 0376, 0332, 0272, 0253, 0374, 0271, 0053, 0375, 0147, 
+  0270, 0341, 0056, 0247, 0062, 0151, 0250, 0045, 0037, 0160, 0306, 0205, 0350, 0000, 0273, 0077, 
+  0353, 0372, 0117, 0231, 0345, 0345, 0037, 0364, 0074, 0045, 0320, 0275, 0054, 0206, 0355, 0312, 
+  0202, 0011, 0325, 0316, 0324, 0337, 0165, 0361, 0273, 0056, 0072, 0324, 0305, 0340, 0127, 0324, 
+  0205, 0317, 0001, 0176, 0343, 0073, 0031, 0336, 0301, 0350, 0232, 0301, 0216, 0114, 0124, 0134, 
+  0055, 0237, 0076, 0364, 0332, 0266, 0017, 0217, 0213, 0152, 0356, 0251, 0267, 0214, 0172, 0273, 
+  0230, 0060, 0255, 0204, 0200, 0344, 0107, 0171, 0105, 0257, 0332, 0306, 0166, 0046, 0062, 0345, 
+  0136, 0303, 0345, 0246, 0272, 0140, 0107, 0305, 0134, 0012, 0306, 0325, 0341, 0161, 0277, 0377, 
+  0134, 0043, 0137, 0172, 0057, 0152, 0003, 0153, 0030, 0201, 0016, 0136, 0055, 0063, 0132, 0114, 
+  0056, 0125, 0374, 0334, 0375, 0345, 0245, 0227, 0226, 0277, 0070, 0254, 0162, 0245, 0155, 0345, 
+  0350, 0345, 0346, 0155, 0200, 0377, 0237, 0056, 0333, 0272, 0132, 0367, 0314, 0227, 0112, 0076, 
+  0015, 0366, 0372, 0240, 0141, 0050, 0332, 0346, 0332, 0336, 0020, 0365, 0213, 0074, 0361, 0122, 
+  0157, 0274, 0150, 0110, 0151, 0156, 0322, 0007, 0016, 0372, 0162, 0243, 0274, 0046, 0173, 0225, 
+  0225, 0076, 0334, 0171, 0002, 0126, 0325, 0377, 0236, 0307, 0172, 0275, 0170, 0077, 0221, 0377, 
+  0244, 0253, 0266, 0051, 0315, 0252, 0251, 0266, 0101, 0064, 0036, 0042, 0315, 0335, 0161, 0337, 
+  0304, 0275, 0315, 0240, 0032, 0355, 0210, 0353, 0025, 0051, 0130, 0263, 0103, 0354, 0055, 0043, 
+  0015, 0046, 0167, 0211, 0353, 0330, 0220, 0201, 0253, 0337, 0315, 0004, 0022, 0364, 0366, 0244, 
+  0232, 0261, 0037, 0266, 0320, 0241, 0027, 0372, 0150, 0261, 0044, 0163, 0117, 0075, 0350, 0075, 
+  0370, 0071, 0370, 0057, 0015, 0065, 0037, 0163, 0000, 0050, 0165, 0165, 0141, 0171, 0051, 0153, 
+  0145, 0171, 0142, 0157, 0141, 0162, 0144, 0057, 0007, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 
+  0011, 0000, 0000, 0000, 0010, 0000, 0000, 0000, 0001, 0000, 0000, 0000, 0155, 0141, 0164, 0145, 
+  0055, 0153, 0145, 0171, 0142, 0157, 0141, 0162, 0144, 0055, 0160, 0162, 0157, 0160, 0145, 0162, 
+  0164, 0151, 0145, 0163, 0055, 0144, 0151, 0141, 0154, 0157, 0147, 0056, 0165, 0151, 0000, 0000, 
+  0311, 0056, 0002, 0000, 0001, 0000, 0000, 0000, 0170, 0332, 0355, 0135, 0113, 0163, 0333, 0270, 
+  0226, 0336, 0367, 0257, 0300, 0325, 0146, 0026, 0123, 0164, 0364, 0360, 0063, 0345, 0370, 0226, 
+  0323, 0166, 0322, 0251, 0074, 0053, 0166, 0246, 0227, 0054, 0210, 0204, 0044, 0264, 0050, 0102, 
+  0103, 0100, 0126, 0064, 0165, 0177, 0374, 0000, 0044, 0155, 0113, 0026, 0045, 0022, 0040, 0050, 
+  0223, 0322, 0311, 0052, 0266, 0111, 0020, 0070, 0000, 0276, 0363, 0300, 0071, 0037, 0056, 0377, 
+  0375, 0173, 0022, 0240, 0007, 0022, 0161, 0312, 0302, 0167, 0255, 0316, 0121, 0273, 0205, 0110, 
+  0350, 0061, 0237, 0206, 0303, 0167, 0255, 0137, 0367, 0037, 0234, 0363, 0326, 0277, 0257, 0376, 
+  0270, 0374, 0227, 0343, 0240, 0217, 0044, 0044, 0021, 0026, 0304, 0107, 0163, 0052, 0106, 0150, 
+  0030, 0140, 0237, 0240, 0336, 0121, 0357, 0374, 0250, 0203, 0034, 0107, 0076, 0104, 0103, 0101, 
+  0242, 0001, 0366, 0310, 0325, 0037, 0010, 0135, 0106, 0344, 0177, 0147, 0064, 0042, 0034, 0005, 
+  0264, 0377, 0256, 0065, 0024, 0343, 0377, 0156, 0075, 0177, 0250, 0167, 0324, 0071, 0156, 0275, 
+  0211, 0237, 0123, 0115, 0077, 0275, 0351, 0004, 0324, 0043, 0041, 0047, 0216, 0130, 0114, 0011, 
+  0032, 0116, 0203, 0207, 0156, 0334, 0366, 0332, 0163, 0041, 0236, 0020, 0064, 0221, 0275, 0161, 
+  0306, 0144, 0321, 0147, 0070, 0362, 0235, 0151, 0304, 0246, 0044, 0022, 0224, 0160, 0307, 0247, 
+  0070, 0140, 0303, 0354, 0067, 0175, 0302, 0275, 0210, 0116, 0205, 0354, 0007, 0172, 0174, 0027, 
+  0075, 0277, 0213, 0322, 0167, 0347, 0064, 0364, 0331, 0074, 0273, 0011, 0217, 0115, 0027, 0021, 
+  0035, 0216, 0004, 0372, 0172, 0175, 0177, 0213, 0156, 0310, 0003, 0011, 0324, 0373, 0074, 0373, 
+  0161, 0074, 0023, 0043, 0046, 0377, 0370, 0067, 0013, 0006, 0103, 0034, 0016, 0321, 0257, 0240, 
+  0037, 0121, 0157, 0364, 0370, 0064, 0353, 0377, 0103, 0074, 0201, 0274, 0000, 0163, 0376, 0256, 
+  0365, 0121, 0214, 0257, 0375, 0177, 0146, 0134, 0114, 0110, 0050, 0132, 0210, 0372, 0357, 0132, 
+  0370, 0351, 0347, 0116, 0113, 0275, 0041, 0337, 0111, 0073, 0274, 0100, 0112, 0020, 0357, 0132, 
+  0001, 0233, 0223, 0250, 0165, 0325, 0151, 0267, 0057, 0337, 0074, 0376, 0051, 0373, 0311, 0331, 
+  0164, 0252, 0236, 0354, 0266, 0363, 0037, 0175, 0300, 0301, 0214, 0264, 0256, 0116, 0362, 0237, 
+  0344, 0202, 0114, 0035, 0032, 0172, 0021, 0211, 0073, 0055, 0373, 0221, 0367, 0306, 0024, 0017, 
+  0311, 0266, 0067, 0056, 0337, 0044, 0122, 0321, 0026, 0120, 0073, 0107, 0102, 0005, 0345, 0043, 
+  0045, 0131, 0134, 0102, 0035, 0155, 0371, 0274, 0226, 0170, 0272, 0171, 0353, 0247, 0250, 0170, 
+  0072, 0105, 0145, 0323, 0153, 0320, 0342, 0351, 0131, 0333, 0135, 0047, 0305, 0327, 0116, 0133, 
+  0177, 0173, 0165, 0333, 0332, 0042, 0132, 0173, 0305, 0124, 0106, 0307, 0255, 0255, 0043, 0057, 
+  0076, 0360, 0366, 0321, 0111, 0163, 0126, 0306, 0311, 0366, 0121, 0137, 0354, 0347, 0250, 0117, 
+  0267, 0217, 0272, 0247, 0201, 0220, 0347, 0115, 0122, 0042, 0147, 0266, 0120, 0262, 0270, 0200, 
+  0172, 0115, 0222, 0317, 0271, 0045, 0371, 0164, 0367, 0124, 0076, 0027, 0140, 0203, 0214, 0077, 
+  0115, 0344, 0353, 0211, 0140, 0274, 0200, 0161, 0342, 0366, 0147, 0102, 0260, 0320, 0245, 0223, 
+  0341, 0006, 0351, 0074, 0120, 0116, 0373, 0201, 0034, 0312, 0175, 0064, 0043, 0171, 0235, 0363, 
+  0160, 0350, 0014, 0230, 0067, 0343, 0255, 0253, 0017, 0070, 0340, 0271, 0317, 0123, 0217, 0205, 
+  0261, 0323, 0320, 0272, 0112, 0054, 0173, 0047, 0356, 0225, 0341, 0210, 0106, 0044, 0230, 0326, 
+  0147, 0100, 0252, 0067, 0116, 0077, 0142, 0163, 0116, 0042, 0303, 0001, 0375, 0036, 0367, 0335, 
+  0000, 0057, 0330, 0114, 0160, 0027, 0373, 0176, 0015, 0006, 0025, 0120, 0056, 0034, 0331, 0025, 
+  0013, 0003, 0222, 0013, 0230, 0075, 0220, 0272, 0214, 0051, 0351, 0115, 0211, 0141, 0111, 0237, 
+  0232, 0010, 0127, 0060, 0327, 0047, 0003, 0074, 0013, 0344, 0000, 0137, 0177, 0144, 0017, 0224, 
+  0314, 0345, 0310, 0006, 0262, 0157, 0043, 0235, 0241, 0335, 0304, 0316, 0166, 0062, 0266, 0107, 
+  0147, 0334, 0115, 0074, 0360, 0015, 0043, 0112, 0276, 0267, 0352, 0371, 0047, 0057, 0330, 0036, 
+  0136, 0237, 0105, 0076, 0211, 0234, 0071, 0365, 0305, 0110, 0032, 0266, 0171, 0217, 0013, 0052, 
+  0244, 0240, 0221, 0210, 0160, 0310, 0003, 0054, 0260, 0024, 0373, 0273, 0326, 0202, 0310, 0257, 
+  0175, 0176, 0214, 0062, 0374, 0220, 0022, 0042, 0021, 0011, 0075, 0302, 0363, 0132, 0113, 0347, 
+  0366, 0361, 0353, 0307, 0047, 0355, 0242, 0157, 0214, 0210, 0212, 0114, 0310, 0127, 0362, 0075, 
+  0057, 0025, 0144, 0161, 0106, 0124, 0201, 0373, 0006, 0021, 0172, 0043, 0032, 0370, 0111, 0050, 
+  0043, 0304, 0201, 0023, 0377, 0050, 0127, 0125, 0237, 0375, 0116, 0247, 0047, 0153, 0122, 0337, 
+  0313, 0277, 0306, 0063, 0232, 0064, 0352, 0250, 0307, 0073, 0117, 0317, 0153, 0056, 0122, 0223, 
+  0231, 0314, 0172, 0207, 0105, 0124, 0152, 0061, 0254, 0302, 0076, 0162, 0271, 0252, 0130, 0217, 
+  0207, 0203, 0042, 0057, 0362, 0051, 0366, 0150, 0050, 0227, 0143, 0067, 0363, 0351, 0154, 0011, 
+  0141, 0117, 0175, 0310, 0305, 0021, 0301, 0113, 0003, 0317, 0024, 0126, 0254, 0105, 0236, 0104, 
+  0066, 0112, 0264, 0312, 0013, 0211, 0031, 0111, 0315, 0124, 0162, 0231, 0226, 0113, 0014, 0245, 
+  0016, 0027, 0013, 0365, 0105, 0022, 0372, 0033, 0137, 0214, 0005, 0260, 0372, 0273, 0315, 0303, 
+  0136, 0323, 0246, 0255, 0227, 0157, 0146, 0165, 0245, 0117, 0202, 0314, 0175, 0346, 0376, 0045, 
+  0033, 0332, 0324, 0061, 0143, 0021, 0346, 0210, 0321, 0344, 0325, 0164, 0253, 0352, 0277, 0034, 
+  0021, 0217, 0320, 0007, 0025, 0340, 0174, 0154, 0141, 0353, 0054, 0146, 0202, 0166, 0254, 0114, 
+  0256, 0136, 0130, 0060, 0072, 0055, 0314, 0070, 0161, 0146, 0241, 0204, 0306, 0200, 0206, 0006, 
+  0262, 0303, 0301, 0034, 0057, 0270, 0303, 0107, 0322, 0006, 0113, 0073, 0263, 0275, 0211, 0145, 
+  0015, 0262, 0332, 0060, 0366, 0306, 0162, 0147, 0346, 0177, 0222, 0374, 0236, 0342, 0320, 0067, 
+  0020, 0326, 0200, 0006, 0201, 0301, 0153, 0123, 0306, 0151, 0002, 0064, 0355, 0155, 0303, 0312, 
+  0354, 0377, 0345, 0233, 0214, 0035, 0144, 0262, 0253, 0226, 0255, 0356, 0162, 0333, 0352, 0317, 
+  0165, 0113, 0271, 0176, 0373, 0152, 0204, 0371, 0253, 0154, 0111, 0365, 0335, 0032, 0354, 0347, 
+  0227, 0076, 0026, 0154, 0350, 0152, 0066, 0164, 0307, 0306, 0206, 0316, 0022, 0100, 0366, 0340, 
+  0215, 0006, 0156, 0060, 0350, 0165, 0337, 0337, 0033, 0307, 0147, 0160, 0333, 0225, 0275, 0056, 
+  0356, 0145, 0210, 0150, 0115, 0074, 0353, 0130, 0267, 0305, 0302, 0174, 0250, 0233, 0241, 0104, 
+  0036, 0244, 0225, 0051, 0137, 0372, 0170, 0363, 0331, 0375, 0361, 0375, 0323, 0267, 0373, 0333, 
+  0237, 0356, 0327, 0357, 0367, 0237, 0276, 0177, 0163, 0277, 0136, 0337, 0175, 0106, 0377, 0101, 
+  0031, 0177, 0371, 0113, 0376, 0264, 0374, 0347, 0367, 0277, 0356, 0357, 0345, 0257, 0177, 0374, 
+  0274, 0275, 0273, 0313, 0370, 0375, 0317, 0333, 0057, 0267, 0327, 0167, 0267, 0361, 0137, 0212, 
+  0366, 0053, 0307, 0231, 0051, 0155, 0065, 0157, 0265, 0234, 0073, 0335, 0262, 0346, 0342, 0067, 
+  0046, 0110, 0237, 0261, 0361, 0013, 0117, 0061, 0174, 0374, 0165, 0115, 0164, 0122, 0346, 0150, 
+  0012, 0054, 0341, 0156, 0053, 0353, 0245, 0022, 0203, 0050, 0263, 0244, 0213, 0055, 0241, 0315, 
+  0163, 0152, 0145, 0055, 0345, 0257, 0251, 0363, 0334, 0127, 0067, 0316, 0106, 0221, 0031, 0331, 
+  0064, 0045, 0245, 0247, 0305, 0306, 0324, 0130, 0023, 0357, 0126, 0021, 0237, 0026, 0172, 0173, 
+  0253, 0224, 0263, 0045, 0375, 0045, 0261, 0065, 0225, 0254, 0143, 0263, 0263, 0323, 0332, 0366, 
+  0276, 0005, 0171, 0333, 0222, 0171, 0266, 0001, 0030, 0320, 0241, 0024, 0071, 0027, 0070, 0022, 
+  0246, 0215, 0154, 0266, 0276, 0177, 0222, 0051, 0301, 0002, 0175, 0046, 0013, 0136, 0270, 0161, 
+  0054, 0104, 0104, 0245, 0055, 0110, 0370, 0366, 0007, 0227, 0037, 0115, 0073, 0062, 0117, 0242, 
+  0107, 0050, 0076, 0125, 0120, 0173, 0076, 0360, 0223, 0074, 0235, 0055, 0155, 0274, 0051, 0366, 
+  0275, 0115, 0146, 0137, 0061, 0023, 0320, 0212, 0071, 0150, 0301, 0064, 0054, 0355, 0367, 0025, 
+  0060, 0031, 0163, 0375, 0301, 0262, 0033, 0160, 0051, 0334, 0044, 0355, 0247, 0213, 0106, 0155, 
+  0277, 0334, 0341, 0026, 0303, 0234, 0343, 0136, 0053, 0257, 0021, 0113, 0043, 0267, 0071, 0372, 
+  0315, 0330, 0161, 0225, 0256, 0247, 0202, 0315, 0024, 0331, 0214, 0305, 0067, 0244, 0265, 0115, 
+  0151, 0151, 0143, 0132, 0331, 0234, 0005, 0067, 0150, 0241, 0115, 0132, 0146, 0345, 0256, 0330, 
+  0045, 0173, 0263, 0152, 0215, 0315, 0025, 0073, 0146, 0213, 0336, 0244, 0144, 0117, 0314, 0237, 
+  0043, 0342, 0255, 0204, 0334, 0242, 0130, 0127, 0273, 0202, 0015, 0207, 0112, 0334, 0005, 0032, 
+  0325, 0261, 0004, 0244, 0011, 0200, 0246, 0021, 0341, 0234, 0160, 0344, 0046, 0237, 0102, 0363, 
+  0021, 0211, 0263, 0130, 0021, 0345, 0150, 0104, 0002, 0037, 0371, 0154, 0036, 0352, 0214, 0337, 
+  0352, 0172, 0051, 0351, 0076, 0025, 0151, 0316, 0040, 0142, 0126, 0231, 0021, 0147, 0051, 0236, 
+  0126, 0244, 0111, 0077, 0302, 0163, 0207, 0206, 0276, 0334, 0044, 0202, 0105, 0046, 0155, 0026, 
+  0005, 0174, 0075, 0320, 0267, 0012, 0374, 0026, 0301, 0337, 0232, 0002, 0320, 0120, 0002, 0205, 
+  0025, 0101, 0131, 0334, 0171, 0122, 0010, 0217, 0170, 0203, 0373, 0306, 0160, 0123, 0325, 0136, 
+  0267, 0062, 0143, 0005, 0002, 0110, 0345, 0345, 0133, 0044, 0030, 0160, 0334, 0052, 0332, 0222, 
+  0145, 0011, 0127, 0041, 0345, 0112, 0264, 0261, 0135, 0255, 0154, 0066, 0213, 0271, 0206, 0177, 
+  0272, 0137, 0174, 0022, 0340, 0205, 0233, 0232, 0315, 0032, 0155, 0127, 0060, 0267, 0125, 0315, 
+  0257, 0165, 0035, 0147, 0160, 0154, 0170, 0243, 0304, 0374, 0326, 0326, 0207, 0054, 0050, 0325, 
+  0115, 0115, 0253, 0264, 0115, 0072, 0130, 0264, 0256, 0074, 0242, 0322, 0070, 0154, 0065, 0073, 
+  0011, 0311, 0204, 0205, 0324, 0123, 0021, 0323, 0041, 0221, 0226, 0312, 0312, 0362, 0343, 0162, 
+  0203, 0031, 0216, 0100, 0107, 0225, 0233, 0251, 0364, 0074, 0325, 0156, 0123, 0372, 0211, 0206, 
+  0267, 0331, 0242, 0261, 0242, 0067, 0120, 0370, 0332, 0212, 0277, 0132, 0150, 0343, 0123, 0102, 
+  0174, 0200, 0266, 0252, 0241, 0355, 0116, 0211, 0031, 0240, 0155, 0015, 0332, 0222, 0345, 0007, 
+  0320, 0266, 0003, 0150, 0353, 0324, 0025, 0332, 0164, 0247, 0120, 0177, 0372, 0254, 0072, 0234, 
+  0226, 0235, 0116, 0353, 0372, 0110, 0163, 0302, 0264, 0046, 0313, 0256, 0223, 0164, 0002, 0116, 
+  0322, 0076, 0070, 0111, 0251, 0171, 0072, 0142, 0221, 0070, 0134, 0103, 0142, 0113, 0322, 0223, 
+  0266, 0256, 0304, 0321, 0220, 0206, 0116, 0100, 0006, 0231, 0065, 0151, 0045, 0233, 0215, 0222, 
+  0144, 0177, 0173, 0355, 0156, 0266, 0172, 0356, 0324, 0222, 0060, 0376, 0114, 0361, 0063, 0351, 
+  0334, 0063, 0352, 0044, 0013, 0375, 0361, 0210, 0232, 0012, 0071, 0147, 0136, 0336, 0041, 0165, 
+  0221, 0146, 0225, 0331, 0362, 0324, 0154, 0373, 0350, 0274, 0173, 0261, 0362, 0357, 0124, 0367, 
+  0033, 0105, 0017, 0306, 0301, 0010, 0002, 0377, 0256, 0250, 0177, 0027, 0260, 0071, 0240, 0062, 
+  0240, 0362, 0022, 0052, 0313, 0025, 0001, 0240, 0014, 0240, 0014, 0236, 0051, 0170, 0246, 0273, 
+  0235, 0264, 0346, 0170, 0246, 0247, 0340, 0231, 0066, 0326, 0063, 0275, 0113, 0024, 0300, 0332, 
+  0361, 0135, 0242, 0030, 0352, 0155, 0004, 0331, 0154, 0366, 0231, 0135, 0244, 0165, 0265, 0104, 
+  0167, 0146, 0253, 0371, 0070, 0301, 0044, 0245, 0022, 0051, 0141, 0273, 0201, 0226, 0004, 0327, 
+  0145, 0303, 0266, 0135, 0072, 0033, 0070, 0370, 0155, 0333, 0255, 0331, 0266, 0335, 0302, 0143, 
+  0340, 0021, 0236, 0112, 0133, 0327, 0224, 0137, 0135, 0023, 0327, 0142, 0374, 0075, 0376, 0305, 
+  0246, 0105, 0341, 0140, 0061, 0116, 0136, 0321, 0376, 0324, 0272, 0134, 0236, 0276, 0366, 0366, 
+  0355, 0363, 0020, 0226, 0251, 0077, 0267, 0325, 0132, 0214, 0311, 0202, 0243, 0270, 0147, 0246, 
+  0322, 0064, 0003, 0102, 0203, 0255, 0012, 0210, 0013, 0176, 0311, 0053, 0114, 0235, 0335, 0151, 
+  0333, 0074, 0145, 0335, 0175, 0366, 0112, 0316, 0300, 0053, 0331, 0237, 0363, 0262, 0200, 0205, 
+  0103, 0310, 0273, 0251, 0070, 0326, 0371, 0105, 0012, 0031, 0142, 0235, 0020, 0353, 0004, 0057, 
+  0356, 0325, 0016, 0240, 0006, 0230, 0013, 0300, 0271, 0212, 0161, 0356, 0203, 0024, 0062, 0340, 
+  0034, 0340, 0034, 0370, 0116, 0160, 0246, 0123, 0142, 0322, 0172, 0165, 0362, 0236, 0032, 0135, 
+  0177, 0150, 0243, 0070, 0316, 0170, 0063, 0331, 0057, 0077, 0334, 0135, 0361, 0177, 0331, 0212, 
+  0163, 0063, 0361, 0133, 0021, 0275, 0275, 0322, 0377, 0352, 0211, 0117, 0312, 0020, 0161, 0350, 
+  0213, 0270, 0264, 0170, 0313, 0323, 0236, 0344, 0211, 0064, 0137, 0234, 0245, 0121, 0243, 0234, 
+  0034, 0113, 0271, 0024, 0071, 0362, 0333, 0052, 0273, 0162, 0254, 0130, 0075, 0140, 0305, 0332, 
+  0031, 0053, 0326, 0011, 0260, 0142, 0155, 0364, 0220, 0376, 0234, 0105, 0234, 0105, 0350, 0175, 
+  0100, 0103, 0265, 0017, 0200, 0031, 0313, 0246, 0055, 0004, 0314, 0130, 0051, 0063, 0126, 0267, 
+  0175, 0220, 0314, 0130, 0307, 0300, 0214, 0005, 0314, 0130, 0215, 0142, 0306, 0362, 0142, 0165, 
+  0340, 0256, 0334, 0113, 0321, 0360, 0265, 0273, 0217, 0374, 0130, 0351, 0064, 0125, 0304, 0217, 
+  0225, 0332, 0004, 0156, 0137, 0031, 0005, 0034, 0321, 0020, 0011, 0362, 0133, 0240, 0001, 0045, 
+  0201, 0317, 0201, 0023, 0153, 0267, 0101, 0157, 0340, 0304, 0002, 0116, 0054, 0335, 0040, 0241, 
+  0025, 0116, 0254, 0024, 0143, 0106, 0305, 0124, 0301, 0056, 0267, 0172, 0323, 0051, 0261, 0226, 
+  0354, 0304, 0124, 0310, 0146, 0154, 0043, 0215, 0314, 0145, 0051, 0175, 0002, 0250, 0121, 0321, 
+  0345, 0032, 0263, 0213, 0124, 0304, 0054, 0122, 0001, 0253, 0110, 0056, 0243, 0110, 0272, 0304, 
+  0142, 0145, 0356, 0012, 0072, 0041, 0246, 0264, 0042, 0160, 0102, 0164, 0170, 0174, 0024, 0243, 
+  0203, 0340, 0243, 0250, 0125, 0032, 0134, 0262, 0121, 0017, 0073, 0075, 0004, 0352, 0223, 0041, 
+  0227, 0345, 0160, 0163, 0131, 0254, 0156, 0251, 0222, 0052, 0317, 0272, 0332, 0063, 0120, 0175, 
+  0332, 0352, 0317, 0026, 0052, 0057, 0325, 0136, 0155, 0260, 0242, 0016, 0276, 0000, 0253, 0167, 
+  0360, 0005, 0130, 0033, 0126, 0106, 0015, 0252, 0260, 0322, 0070, 0136, 0032, 0306, 0203, 0072, 
+  0254, 0242, 0370, 0013, 0271, 0204, 0265, 0100, 0337, 0065, 0233, 0370, 0260, 0071, 0173, 0166, 
+  0224, 0062, 0015, 0064, 0070, 0140, 0146, 0326, 0315, 0314, 0354, 0102, 0322, 0164, 0323, 0012, 
+  0116, 0073, 0207, 0235, 0062, 0155, 0343, 0304, 0003, 0062, 0246, 0041, 0143, 0032, 0062, 0246, 
+  0055, 0213, 0027, 0062, 0246, 0313, 0311, 0320, 0074, 0143, 0172, 0263, 0334, 0066, 0276, 0224, 
+  0272, 0362, 0352, 0372, 0364, 0167, 0055, 0151, 0244, 0266, 0212, 0335, 0010, 0375, 0062, 0017, 
+  0257, 0021, 0227, 0102, 0157, 0266, 0310, 0077, 0222, 0220, 0104, 0372, 0027, 0074, 0153, 0235, 
+  0055, 0156, 0133, 0324, 0333, 0027, 0364, 0313, 0317, 0312, 0236, 0073, 0205, 0215, 0301, 0055, 
+  0253, 0051, 0147, 0121, 0030, 0334, 0015, 0336, 0353, 0301, 0345, 0340, 0332, 0227, 0203, 0167, 
+  0053, 0275, 0034, 0274, 0167, 0014, 0145, 0020, 0225, 0225, 0101, 0334, 0171, 0021, 0013, 0002, 
+  0342, 0377, 0115, 0103, 0237, 0315, 0023, 0241, 0363, 0364, 0167, 0363, 0370, 0167, 0257, 0175, 
+  0135, 0170, 0231, 0146, 0370, 0010, 0313, 0021, 0070, 0112, 0067, 0264, 0256, 0150, 0130, 0165, 
+  0156, 0367, 0175, 0104, 0310, 0377, 0120, 0222, 0212, 0361, 0367, 0270, 0357, 0006, 0170, 0301, 
+  0146, 0202, 0273, 0234, 0004, 0362, 0121, 0342, 0327, 0044, 0137, 0266, 0154, 0123, 0202, 0261, 
+  0100, 0320, 0251, 0243, 0122, 0076, 0263, 0271, 0103, 0050, 0027, 0210, 0015, 0024, 0271, 0127, 
+  0237, 0341, 0310, 0107, 0251, 0040, 0320, 0243, 0040, 0320, 0200, 0105, 0150, 0306, 0361, 0260, 
+  0124, 0077, 0106, 0004, 0113, 0034, 0344, 0316, 0223, 0214, 0364, 0023, 0201, 0263, 0017, 0002, 
+  0222, 0156, 0306, 0373, 0327, 0050, 0101, 0116, 0255, 0204, 0273, 0247, 0066, 0336, 0354, 0330, 
+  0063, 0002, 0233, 0277, 0251, 0045, 0060, 0115, 0056, 0102, 0323, 0117, 0220, 0131, 0333, 0316, 
+  0154, 0302, 0206, 0322, 0220, 0145, 0332, 0270, 0157, 0343, 0262, 0357, 0143, 0050, 0146, 0260, 
+  0066, 0263, 0126, 0147, 0127, 0357, 0254, 0050, 0143, 0226, 0227, 0212, 0042, 0226, 0225, 0062, 
+  0366, 0175, 0353, 0145, 0021, 0356, 0265, 0357, 0037, 0035, 0035, 0035, 0126, 0001, 0204, 0215, 
+  0126, 0163, 0115, 0212, 0104, 0235, 0042, 0374, 0322, 0246, 0100, 0202, 0241, 0076, 0101, 0162, 
+  0062, 0245, 0125, 0041, 0377, 0057, 0106, 0004, 0005, 0224, 0227, 0256, 0241, 0240, 0023, 0151, 
+  0234, 0264, 0256, 0136, 0054, 0030, 0227, 0116, 0206, 0065, 0254, 0316, 0300, 0301, 0034, 0057, 
+  0270, 0303, 0107, 0322, 0332, 0115, 0073, 0336, 0204, 0002, 0215, 0272, 0106, 0300, 0233, 0136, 
+  0236, 0261, 0001, 0360, 0042, 0062, 0141, 0017, 0366, 0113, 0301, 0334, 0237, 0161, 0273, 0200, 
+  0171, 0326, 0061, 0057, 0021, 0154, 0014, 0151, 0117, 0216, 0323, 0113, 0370, 0033, 0104, 0154, 
+  0122, 0045, 0350, 0045, 0213, 0006, 0160, 0017, 0116, 0376, 0340, 0344, 0257, 0302, 0223, 0277, 
+  0246, 0026, 0203, 0053, 0317, 0351, 0004, 0074, 0247, 0303, 0362, 0234, 0142, 0215, 0060, 0233, 
+  0132, 0267, 0044, 0276, 0052, 0155, 0347, 0376, 0232, 0202, 0051, 0141, 0335, 0224, 0370, 0232, 
+  0153, 0110, 0314, 0246, 0161, 0025, 0277, 0045, 0113, 0242, 0264, 0262, 0007, 0255, 0274, 0347, 
+  0336, 0110, 0014, 0042, 0076, 0233, 0207, 0025, 0301, 0310, 0215, 0154, 0032, 0200, 0344, 0025, 
+  0200, 0104, 0315, 0051, 0100, 0011, 0030, 0370, 0140, 0340, 0277, 0172, 0152, 0237, 0045, 0003, 
+  0377, 0024, 0014, 0374, 0303, 0062, 0360, 0125, 0100, 0305, 0176, 0234, 0360, 0116, 0266, 0012, 
+  0207, 0043, 0125, 0050, 0345, 0037, 0021, 0015, 0325, 0331, 0210, 0117, 0361, 0060, 0302, 0023, 
+  0225, 0172, 0261, 0115, 0105, 0203, 0106, 0006, 0343, 0336, 0016, 0200, 0274, 0114, 0243, 0355, 
+  0065, 0237, 0006, 0012, 0326, 0046, 0130, 0213, 0257, 0156, 0055, 0166, 0367, 0263, 0020, 0244, 
+  0076, 0314, 0310, 0235, 0172, 0247, 0205, 0255, 0263, 0171, 0216, 0306, 0056, 0047, 0123, 0034, 
+  0141, 0101, 0334, 0141, 0304, 0146, 0123, 0127, 0166, 0336, 0115, 0162, 0164, 0133, 0266, 0230, 
+  0276, 0335, 0273, 0364, 0023, 0117, 0247, 0213, 0054, 0102, 0004, 0173, 0043, 0224, 0174, 0310, 
+  0124, 0356, 0165, 0112, 0012, 0056, 0111, 0340, 0131, 0011, 0367, 0172, 0011, 0203, 0312, 0036, 
+  0121, 0347, 0041, 0155, 0377, 0156, 0003, 0267, 0177, 0110, 0346, 0351, 0176, 0347, 0056, 0015, 
+  0107, 0044, 0242, 0042, 0165, 0330, 0254, 0355, 0377, 0157, 0144, 0236, 0356, 0164, 0216, 0146, 
+  0022, 0157, 0020, 0366, 0204, 0334, 0053, 0351, 0357, 0376, 0213, 0153, 0372, 0017, 0000, 0003, 
+  0000, 0003, 0265, 0206, 0201, 0136, 0363, 0013, 0102, 0115, 0013, 0235, 0366, 0375, 0006, 0035, 
+  0025, 0316, 0232, 0060, 0237, 0004, 0334, 0335, 0316, 0116, 0134, 0313, 0022, 0062, 0115, 0346, 
+  0141, 0033, 0067, 0340, 0034, 0237, 0303, 0025, 0070, 0033, 0025, 0343, 0347, 0307, 0000, 0132, 
+  0262, 0246, 0336, 0326, 0000, 0341, 0327, 0110, 0174, 0237, 0126, 0274, 0073, 0245, 0336, 0030, 
+  0300, 0276, 0151, 0225, 0100, 0057, 0142, 0361, 0317, 0123, 0331, 0002, 0053, 0253, 0354, 0366, 
+  0001, 0216, 0213, 0006, 0231, 0064, 0045, 0071, 0056, 0214, 0137, 0337, 0021, 0311, 0205, 0201, 
+  0121, 0023, 0103, 0303, 0122, 0251, 0140, 0374, 0163, 0116, 0301, 0140, 0275, 0355, 0232, 0123, 
+  0223, 0267, 0023, 0357, 0323, 0111, 0150, 0337, 0212, 0022, 0100, 0333, 0300, 0342, 0344, 0303, 
+  0056, 0213, 0171, 0064, 0271, 0275, 0160, 0333, 0367, 0244, 0101, 0215, 0103, 0321, 0146, 0201, 
+  0175, 0231, 0326, 0310, 0003, 0011, 0205, 0242, 0066, 0271, 0371, 0354, 0376, 0370, 0376, 0351, 
+  0333, 0375, 0355, 0117, 0367, 0353, 0367, 0373, 0117, 0337, 0277, 0271, 0137, 0257, 0357, 0076, 
+  0243, 0377, 0240, 0214, 0277, 0374, 0045, 0177, 0132, 0376, 0363, 0373, 0137, 0367, 0367, 0362, 
+  0327, 0077, 0176, 0336, 0336, 0335, 0145, 0374, 0376, 0347, 0355, 0227, 0333, 0353, 0273, 0333, 
+  0370, 0057, 0246, 0375, 0314, 0075, 0234, 0125, 0224, 0000, 0110, 0002, 0033, 0042, 0076, 0025, 
+  0153, 0331, 0122, 0351, 0232, 0332, 0103, 0215, 0010, 0226, 0237, 0041, 0332, 0104, 0204, 0023, 
+  0341, 0012, 0346, 0246, 0373, 0310, 0036, 0340, 0374, 0124, 0055, 0253, 0052, 0311, 0033, 0342, 
+  0046, 0115, 0003, 0356, 0030, 0124, 0145, 0115, 0003, 0354, 0045, 0111, 0220, 0336, 0054, 0212, 
+  0044, 0114, 0255, 0355, 0152, 0051, 0146, 0041, 0027, 0022, 0107, 0163, 0052, 0106, 0352, 0311, 
+  0077, 0322, 0276, 0075, 0375, 0305, 0264, 0173, 0113, 0045, 0132, 0153, 0353, 0104, 0247, 0112, 
+  0253, 0102, 0317, 0264, 0124, 0125, 0326, 0001, 0340, 0222, 0354, 0174, 0312, 0111, 0243, 0161, 
+  0207, 0005, 0130, 0374, 0225, 0132, 0374, 0335, 0327, 0241, 0265, 0323, 0145, 0116, 0053, 0074, 
+  0353, 0346, 0254, 0151, 0245, 0251, 0364, 0216, 0117, 0233, 0315, 0245, 0367, 0045, 0111, 0202, 
+  0334, 0025, 0031, 0236, 0306, 0106, 0156, 0016, 0217, 0336, 0331, 0131, 0023, 0326, 0100, 0335, 
+  0134, 0214, 0232, 0363, 0374, 0235, 0127, 0312, 0363, 0167, 0166, 0336, 0264, 0140, 0106, 0035, 
+  0075, 0324, 0006, 0163, 0021, 0256, 0120, 0141, 0365, 0056, 0232, 0174, 0032, 0125, 0333, 0330, 
+  0205, 0215, 0152, 0220, 0263, 0213, 0175, 0051, 0007, 0251, 0353, 0064, 0131, 0335, 0310, 0166, 
+  0066, 0264, 0336, 0012, 0052, 0230, 0325, 0064, 0301, 0134, 0220, 0310, 0045, 0041, 0356, 0127, 
+  0160, 0105, 0271, 0173, 0235, 0136, 0203, 0104, 0003, 0052, 0037, 0037, 0020, 0054, 0146, 0322, 
+  0145, 0106, 0162, 0005, 0051, 0306, 0250, 0344, 0142, 0164, 0077, 0361, 0320, 0237, 0374, 0167, 
+  0351, 0264, 0106, 0302, 0233, 0011, 0270, 0303, 0134, 0277, 0331, 0072, 0157, 0047, 0153, 0071, 
+  0003, 0025, 0304, 0117, 0354, 0347, 0160, 0351, 0004, 0123, 0364, 0202, 0052, 0126, 0203, 0053, 
+  0366, 0316, 0103, 0255, 0305, 0200, 0065, 0242, 0045, 0205, 0143, 0302, 0172, 0163, 0001, 0245, 
+  0257, 0160, 0253, 0005, 0304, 0377, 0040, 0213, 0361, 0311, 0336, 0076, 0157, 0203, 0143, 0174, 
+  0320, 0216, 0361, 0313, 0000, 0353, 0131, 0017, 0174, 0343, 0352, 0317, 0365, 0053, 0316, 0050, 
+  0275, 0223, 0013, 0156, 0274, 0100, 0237, 0311, 0242, 0370, 0121, 0140, 0361, 0133, 0004, 0327, 
+  0356, 0064, 0234, 0223, 0370, 0026, 0362, 0307, 0113, 0015, 0373, 0054, 0360, 0363, 0170, 0351, 
+  0213, 0336, 0132, 0010, 0134, 0362, 0165, 0311, 0043, 0130, 0016, 0240, 0035, 0267, 0001, 0044, 
+  0352, 0023, 0100, 0133, 0203, 0360, 0143, 0210, 0241, 0355, 0076, 0206, 0226, 0336, 0013, 0234, 
+  0356, 0321, 0302, 0056, 0311, 0256, 0374, 0266, 0322, 0163, 0001, 0244, 0244, 0113, 0126, 0163, 
+  0007, 0166, 0030, 0104, 0251, 0155, 0104, 0251, 0171, 0154, 0251, 0215, 0245, 0241, 0126, 0131, 
+  0244, 0372, 0216, 0116, 0146, 0201, 0052, 0273, 0347, 0352, 0077, 0002, 0307, 0124, 0120, 0052, 
+  0050, 0075, 0215, 0010, 0347, 0004, 0202, 0321, 0020, 0214, 0206, 0140, 0164, 0365, 0201, 0320, 
+  0203, 0211, 0105, 0127, 0207, 0220, 0142, 0316, 0134, 0371, 0037, 0227, 0015, 0006, 0326, 0141, 
+  0362, 0206, 0162, 0354, 0312, 0037, 0121, 0362, 0075, 0205, 0217, 0034, 0321, 0001, 0222, 0337, 
+  0114, 0376, 0217, 0043, 0202, 0022, 0304, 0124, 0127, 0301, 0014, 0211, 0030, 0345, 0335, 0151, 
+  0012, 0320, 0011, 0320, 0011, 0320, 0011, 0234, 0144, 0165, 0200, 0116, 0011, 0166, 0336, 0110, 
+  0245, 0363, 0007, 0054, 0267, 0346, 0327, 0300, 0306, 0374, 0242, 0232, 0107, 0023, 0346, 0323, 
+  0001, 0045, 0021, 0107, 0363, 0021, 0011, 0237, 0321, 0162, 0116, 0075, 0002, 0120, 0011, 0120, 
+  0011, 0120, 0271, 0067, 0120, 0331, 0205, 0214, 0007, 0310, 0170, 0200, 0214, 0007, 0310, 0170, 
+  0150, 0004, 0305, 0301, 0112, 0354, 0266, 0013, 0031, 0017, 0220, 0361, 0260, 0174, 0134, 0166, 
+  0002, 0207, 0231, 0315, 0317, 0170, 0010, 0330, 0034, 0362, 0035, 0040, 0337, 0241, 0242, 0174, 
+  0207, 0016, 0100, 0104, 0215, 0363, 0035, 0116, 0341, 0064, 0026, 0362, 0035, 0040, 0337, 0241, 
+  0302, 0174, 0207, 0036, 0354, 0060, 0310, 0167, 0260, 0022, 0222, 0226, 0166, 0132, 0245, 0331, 
+  0016, 0337, 0303, 0140, 0201, 0260, 0347, 0221, 0251, 0100, 0001, 0013, 0207, 0220, 0350, 0000, 
+  0041, 0150, 0010, 0101, 0227, 0011, 0101, 0103, 0325, 0135, 0065, 0330, 0370, 0244, 0141, 0237, 
+  0060, 0321, 0047, 0001, 0136, 0344, 0060, 0212, 0277, 0006, 0100, 0131, 0131, 0001, 0232, 0254, 
+  0343, 0146, 0122, 0316, 0165, 0030, 0136, 0310, 0072, 0065, 0142, 0013, 0266, 0154, 0131, 0342, 
+  0125, 0110, 0335, 0072, 0050, 0152, 0252, 0337, 0033, 0045, 0326, 0267, 0066, 0076, 0142, 0001, 
+  0175, 0263, 0232, 0375, 0147, 0306, 0005, 0035, 0054, 0132, 0127, 0236, 0324, 0154, 0372, 0031, 
+  0074, 0131, 0115, 0256, 0221, 0245, 0277, 0130, 0144, 0074, 0240, 0276, 0101, 0337, 0165, 0220, 
+  0136, 0037, 0355, 0255, 0043, 0376, 0146, 0324, 0267, 0326, 0234, 0061, 0364, 0153, 0302, 0277, 
+  0226, 0012, 0260, 0001, 0120, 0253, 0301, 0246, 0356, 0276, 0003, 0222, 0231, 0037, 0142, 0046, 
+  0354, 0342, 0032, 0101, 0375, 0107, 0133, 0041, 0124, 0062, 0007, 0125, 0315, 0303, 0066, 0345, 
+  0240, 0301, 0026, 0231, 0213, 0207, 0070, 0032, 0322, 0320, 0011, 0310, 0100, 0142, 0141, 0247, 
+  0155, 0271, 0331, 0050, 0216, 0275, 0133, 0154, 0167, 0313, 0241, 0202, 0342, 0153, 0061, 0376, 
+  0114, 0361, 0003, 0206, 0334, 0003, 0207, 0204, 0224, 0374, 0361, 0274, 0201, 0012, 0071, 0147, 
+  0136, 0336, 0211, 0103, 0221, 0146, 0075, 0274, 0324, 0154, 0373, 0350, 0274, 0173, 0261, 0362, 
+  0357, 0124, 0367, 0033, 0105, 0117, 0071, 0312, 0252, 0072, 0063, 0165, 0127, 0211, 0312, 0253, 
+  0100, 0355, 0131, 0127, 0175, 0006, 0352, 0117, 0133, 0005, 0332, 0102, 0346, 0273, 0144, 0115, 
+  0146, 0330, 0352, 0261, 0031, 0125, 0163, 0150, 0266, 0331, 0054, 0366, 0225, 0255, 0072, 0221, 
+  0146, 0152, 0353, 0352, 0371, 0377, 0307, 0266, 0232, 0217, 0103, 0021, 0361, 0326, 0057, 0273, 
+  0124, 0023, 0146, 0127, 0252, 0314, 0351, 0020, 0007, 0116, 0374, 0243, 0354, 0176, 0112, 0220, 
+  0025, 0350, 0316, 0331, 0332, 0252, 0270, 0026, 0343, 0357, 0361, 0057, 0066, 0057, 0013, 0007, 
+  0213, 0161, 0362, 0222, 0366, 0307, 0326, 0045, 0363, 0364, 0275, 0267, 0157, 0237, 0007, 0341, 
+  0370, 0204, 0173, 0021, 0215, 0011, 0365, 0063, 0225, 0305, 0237, 0263, 0210, 0263, 0010, 0365, 
+  0245, 0273, 0062, 0346, 0210, 0117, 0011, 0061, 0126, 0250, 0146, 0200, 0150, 0260, 0141, 0353, 
+  0200, 0274, 0066, 0267, 0214, 0171, 0224, 0051, 0037, 0167, 0073, 0373, 0215, 0273, 0131, 0026, 
+  0261, 0212, 0237, 0037, 0256, 0105, 0154, 0034, 0056, 0321, 0063, 0062, 0277, 0110, 0041, 0203, 
+  0215, 0011, 0066, 0146, 0235, 0154, 0314, 0156, 0135, 0261, 0356, 0365, 0142, 0142, 0266, 0342, 
+  0051, 0345, 0124, 0224, 0125, 0365, 0124, 0135, 0104, 0014, 0352, 0044, 0152, 0123, 0122, 0006, 
+  0165, 0022, 0120, 0047, 0001, 0165, 0022, 0065, 0255, 0223, 0350, 0326, 0271, 0116, 0342, 0030, 
+  0352, 0044, 0240, 0116, 0142, 0071, 0315, 0366, 0014, 0222, 0240, 0033, 0137, 0047, 0361, 0236, 
+  0315, 0102, 0217, 0100, 0245, 0104, 0223, 0064, 0155, 0243, 0052, 0045, 0200, 0076, 0266, 0316, 
+  0225, 0022, 0347, 0220, 0307, 0015, 0225, 0022, 0120, 0051, 0141, 0165, 0223, 0255, 0132, 0315, 
+  0047, 0260, 0303, 0240, 0122, 0302, 0340, 0374, 0145, 0255, 0122, 0242, 0037, 0133, 0152, 0225, 
+  0326, 0112, 0174, 0032, 0206, 0054, 0042, 0150, 0200, 0271, 0100, 0376, 0154, 0032, 0250, 0254, 
+  0164, 0002, 0005, 0023, 0120, 0060, 0001, 0005, 0023, 0373, 0030, 0213, 0336, 0227, 0172, 0211, 
+  0045, 0144, 0204, 0212, 0011, 0033, 0031, 0001, 0133, 0035, 0207, 0065, 0151, 0103, 0315, 0204, 
+  0135, 0065, 0174, 0343, 0102, 0315, 0104, 0353, 0152, 0155, 0231, 0101, 0325, 0004, 0124, 0115, 
+  0350, 0004, 0236, 0216, 0241, 0152, 0302, 0236, 0260, 0165, 0264, 0102, 0174, 0253, 0051, 0024, 
+  0116, 0100, 0341, 0004, 0024, 0116, 0100, 0122, 0033, 0024, 0116, 0240, 0327, 0057, 0234, 0310, 
+  0266, 0245, 0016, 0276, 0164, 0342, 0344, 0340, 0113, 0047, 0262, 0027, 0006, 0024, 0117, 0030, 
+  0155, 0132, 0050, 0236, 0050, 0216, 0275, 0207, 0123, 0074, 0261, 0264, 0305, 0240, 0174, 0002, 
+  0312, 0047, 0300, 0322, 0204, 0362, 0211, 0372, 0240, 0035, 0224, 0117, 0100, 0371, 0004, 0224, 
+  0117, 0350, 0114, 0007, 0224, 0117, 0100, 0371, 0004, 0224, 0117, 0324, 0264, 0174, 0242, 0127, 
+  0263, 0362, 0211, 0070, 0173, 0147, 0351, 0124, 0042, 0376, 0271, 0317, 0176, 0237, 0101, 0045, 
+  0205, 0375, 0112, 0212, 0000, 0057, 0330, 0114, 0070, 0211, 0335, 0135, 0064, 0012, 0157, 0224, 
+  0337, 0274, 0224, 0224, 0025, 0062, 0101, 0007, 0052, 0027, 0105, 0256, 0077, 0356, 0046, 0023, 
+  0334, 0262, 0225, 0233, 0177, 0075, 0363, 0051, 0103, 0356, 0007, 0102, 0374, 0276, 0134, 0264, 
+  0107, 0107, 0107, 0246, 0060, 0143, 0073, 0251, 0272, 0114, 0063, 0353, 0211, 0126, 0145, 0132, 
+  0153, 0112, 0031, 0207, 0361, 0111, 0174, 0365, 0032, 0260, 0124, 0206, 0274, 0201, 0337, 0124, 
+  0203, 0302, 0206, 0075, 0326, 0201, 0307, 0125, 0352, 0300, 0155, 0162, 0333, 0056, 0063, 0143, 
+  0347, 0170, 0113, 0147, 0067, 0166, 0064, 0015, 0243, 0213, 0305, 0124, 0176, 0111, 0042, 0152, 
+  0046, 0042, 0347, 0127, 0107, 0154, 0272, 0106, 0242, 0024, 0272, 0226, 0125, 0317, 0165, 0007, 
+  0100, 0015, 0365, 0226, 0036, 0007, 0320, 0200, 0212, 0105, 0336, 0042, 0330, 0371, 0272, 0133, 
+  0177, 0125, 0366, 0335, 0051, 0014, 0167, 0346, 0313, 0266, 0330, 0132, 0135, 0055, 0062, 0270, 
+  0200, 0225, 0132, 0176, 0245, 0366, 0131, 0044, 0365, 0263, 0112, 0100, 0023, 0243, 0042, 0071, 
+  0226, 0126, 0212, 0016, 0112, 0225, 0144, 0137, 0264, 0301, 0221, 0070, 0350, 0222, 0354, 0265, 
+  0042, 0221, 0011, 0223, 0206, 0146, 0361, 0032, 0021, 0215, 0332, 0220, 0037, 0054, 0076, 0225, 
+  0106, 0162, 0025, 0240, 0076, 0101, 0036, 0013, 0105, 0304, 0202, 0200, 0370, 0150, 0306, 0345, 
+  0040, 0221, 0030, 0045, 0225, 0042, 0330, 0337, 0117, 0047, 0005, 0212, 0315, 0053, 0167, 0165, 
+  0154, 0126, 0173, 0100, 0065, 0270, 0165, 0247, 0311, 0106, 0065, 0370, 0051, 0124, 0203, 0327, 
+  0267, 0032, 0374, 0274, 0015, 0265, 0252, 0120, 0015, 0016, 0325, 0340, 0126, 0067, 0331, 0252, 
+  0301, 0336, 0201, 0035, 0006, 0325, 0340, 0371, 0307, 0326, 0377, 0162, 0034, 0024, 0072, 0036, 
+  0013, 0146, 0223, 0220, 0277, 0073, 0226, 0377, 0217, 0330, 0234, 0277, 0353, 0041, 0307, 0061, 
+  0253, 0225, 0374, 0030, 0121, 0377, 0245, 0207, 0040, 0112, 0024, 0221, 0327, 0272, 0116, 0122, 
+  0312, 0312, 0061, 0057, 0216, 0131, 0353, 0135, 0074, 0013, 0116, 0075, 0212, 0057, 0237, 0147, 
+  0357, 0371, 0166, 0222, 0356, 0241, 0324, 0136, 0032, 0126, 0326, 0350, 0135, 0032, 0136, 0227, 
+  0372, 0110, 0303, 0254, 0074, 0373, 0151, 0210, 0325, 0246, 0040, 0232, 0244, 0037, 0356, 0076, 
+  0153, 0115, 0125, 0140, 0071, 0262, 0243, 0330, 0033, 0031, 0346, 0056, 0257, 0005, 0223, 0331, 
+  0264, 0114, 0203, 0165, 0056, 0303, 0314, 0204, 0053, 0305, 0051, 0162, 0130, 0225, 0342, 0225, 
+  0243, 0325, 0007, 0051, 0122, 0100, 0053, 0100, 0253, 0035, 0243, 0325, 0236, 0025, 0215, 0057, 
+  0225, 0311, 0075, 0243, 0225, 0252, 0124, 0012, 0134, 0101, 0047, 0104, 0273, 0124, 0156, 0227, 
+  0230, 0145, 0253, 0311, 0221, 0355, 0254, 0354, 0354, 0172, 0273, 0123, 0033, 0115, 0133, 0251, 
+  0265, 0133, 0233, 0044, 0325, 0236, 0063, 0145, 0122, 0246, 0161, 0125, 0164, 0023, 0150, 0046, 
+  0126, 0166, 0171, 0027, 0166, 0271, 0376, 0056, 0237, 0340, 0337, 0156, 0134, 0132, 0010, 0233, 
+  0334, 0336, 0046, 0077, 0263, 0262, 0311, 0351, 0220, 0252, 0350, 0122, 0273, 0046, 0210, 0261, 
+  0157, 0273, 0373, 0260, 0074, 0216, 0056, 0220, 0123, 0201, 0323, 0001, 0116, 0307, 0016, 0001, 
+  0253, 0007, 0200, 0125, 0046, 0242, 0013, 0170, 0005, 0041, 0135, 0300, 0253, 0046, 0343, 0125, 
+  0373, 0020, 0360, 0312, 0210, 0347, 0015, 0142, 0272, 0225, 0020, 0245, 0001, 0136, 0101, 0120, 
+  0267, 0004, 0136, 0165, 0017, 0040, 0334, 0103, 0103, 0052, 0014, 0371, 0317, 0040, 0336, 0263, 
+  0061, 0336, 0163, 0016, 0361, 0236, 0372, 0307, 0173, 0272, 0007, 0140, 0216, 0030, 0261, 0153, 
+  0201, 0373, 0124, 0015, 0233, 0026, 0230, 0043, 0340, 0076, 0001, 0136, 0155, 0305, 0253, 0370, 
+  0214, 0231, 0104, 0161, 0132, 0052, 0340, 0226, 0145, 0334, 0162, 0257, 0227, 0244, 0173, 0350, 
+  0127, 0051, 0154, 0316, 0153, 0150, 0234, 0145, 0324, 0206, 0100, 0215, 0101, 0240, 0046, 0076, 
+  0343, 0006, 0210, 0261, 0014, 0061, 0167, 0112, 0254, 0200, 0055, 0033, 0262, 0051, 0000, 0132, 
+  0016, 0341, 0314, 0012, 0156, 0200, 0252, 0004, 0132, 0156, 0340, 0006, 0250, 0145, 0150, 0171, 
+  0031, 0271, 0003, 0154, 0351, 0002, 0075, 0055, 0334, 0250, 0130, 0142, 0052, 0200, 0236, 0026, 
+  0350, 0151, 0253, 0020, 0057, 0120, 0363, 0225, 0103, 0207, 0172, 0121, 0363, 0365, 0152, 0113, 
+  0315, 0167, 0016, 0204, 0147, 0125, 0122, 0363, 0175, 0125, 0246, 0027, 0372, 0054, 0155, 0257, 
+  0335, 0363, 0362, 0365, 0366, 0207, 0227, 0257, 0163, 0334, 0204, 0145, 0152, 0306, 0133, 0147, 
+  0176, 0067, 0161, 0051, 0312, 0273, 0316, 0171, 0323, 0050, 0357, 0164, 0151, 0005, 0255, 0115, 
+  0321, 0366, 0151, 0072, 0257, 0214, 0036, 0173, 0171, 0272, 0272, 0347, 0115, 0046, 0174, 0052, 
+  0105, 0034, 0122, 0236, 0064, 0304, 0224, 0162, 0146, 0215, 0025, 0260, 0037, 0021, 0074, 0116, 
+  0031, 0001, 0175, 0127, 0260, 0341, 0260, 0020, 0361, 0207, 0106, 0300, 0342, 0013, 0363, 0306, 
+  0210, 0173, 0021, 0041, 0041, 0022, 0014, 0221, 0160, 0300, 0042, 0217, 0050, 0065, 0257, 0270, 
+  0001, 0343, 0357, 0227, 0061, 0363, 0253, 0240, 0300, 0051, 0333, 0124, 0111, 0212, 0300, 0154, 
+  0017, 0237, 0005, 0202, 0116, 0035, 0101, 0176, 0213, 0015, 0307, 0361, 0317, 0142, 0306, 0003, 
+  0105, 0307, 0210, 0221, 0047, 0033, 0300, 0064, 0104, 0376, 0054, 0071, 0355, 0122, 0362, 0037, 
+  0221, 0140, 0212, 0246, 0121, 0154, 0200, 0240, 0210, 0114, 0211, 0220, 0312, 0365, 0041, 0046, 
+  0150, 0354, 0063, 0034, 0051, 0316, 0106, 0202, 0150, 0370, 0317, 0114, 0056, 0160, 0136, 0246, 
+  0307, 0306, 0101, 0061, 0313, 0161, 0052, 0173, 0304, 0201, 0273, 0365, 0242, 0055, 0261, 0153, 
+  0225, 0156, 0246, 0371, 0364, 0132, 0212, 0136, 0260, 0173, 0332, 0130, 0172, 0255, 0342, 0301, 
+  0266, 0134, 0337, 0350, 0370, 0144, 0037, 0111, 0235, 0214, 0150, 0362, 0136, 0047, 0072, 0151, 
+  0145, 0274, 0045, 0056, 0244, 0253, 0161, 0174, 0262, 0334, 0112, 0177, 0332, 0354, 0211, 0101, 
+  0343, 0023, 0251, 0370, 0202, 0075, 0046, 0062, 0053, 0115, 0134, 0147, 0307, 0016, 0265, 0165, 
+  0202, 0270, 0212, 0325, 0147, 0373, 0176, 0140, 0130, 0202, 0061, 0116, 0137, 0332, 0005, 0174, 
+  0261, 0136, 0373, 0220, 0256, 0235, 0265, 0262, 0167, 0354, 0357, 0041, 0363, 0331, 0055, 0246, 
+  0374, 0173, 0147, 0026, 0356, 0354, 0266, 0062, 0321, 0125, 0116, 0166, 0045, 0347, 0363, 0006, 
+  0156, 0357, 0337, 0054, 0032, 0047, 0267, 0265, 0077, 0340, 0000, 0311, 0111, 0021, 0374, 0255, 
+  0315, 0117, 0133, 0072, 0275, 0057, 0174, 0344, 0276, 0032, 0050, 0340, 0322, 0171, 0337, 0365, 
+  0255, 0353, 0246, 0227, 0004, 0333, 0076, 0055, 0256, 0346, 0344, 0270, 0022, 0053, 0255, 0304, 
+  0041, 0277, 0301, 0141, 0377, 0016, 0040, 0254, 0015, 0020, 0266, 0073, 0010, 0173, 0257, 0266, 
+  0374, 0376, 0141, 0330, 0343, 0200, 0000, 0304, 0136, 0011, 0304, 0072, 0115, 0000, 0061, 0270, 
+  0304, 0276, 0162, 0255, 0124, 0375, 0045, 0366, 0226, 0135, 0245, 0121, 0221, 0143, 0253, 0275, 
+  0162, 0225, 0352, 0343, 0315, 0254, 0372, 0253, 0235, 0103, 0265, 0003, 0254, 0372, 0256, 0325, 
+  0314, 0270, 0371, 0254, 0147, 0317, 0374, 0235, 0124, 0323, 0233, 0217, 0054, 0225, 0022, 0157, 
+  0231, 0174, 0250, 0302, 0005, 0141, 0371, 0170, 0321, 0312, 0371, 0340, 0315, 0343, 0031, 0040, 
+  0033, 0240, 0271, 0362, 0115, 0373, 0144, 0300, 0042, 0202, 0324, 0151, 0254, 0072, 0210, 0305, 
+  0372, 0107, 0261, 0105, 0372, 0225, 0315, 0014, 0160, 0141, 0135, 0272, 0001, 0235, 0364, 0035, 
+  0071, 0102, 0122, 0312, 0274, 0050, 0143, 0327, 0225, 0263, 0355, 0252, 0264, 0357, 0252, 0263, 
+  0361, 0052, 0163, 0126, 0113, 0330, 0172, 0306, 0116, 0353, 0156, 0160, 0153, 0305, 0373, 0000, 
+  0340, 0322, 0003, 0056, 0165, 0223, 0144, 0054, 0106, 0064, 0037, 0251, 0164, 0222, 0044, 0207, 
+  0204, 0162, 0344, 0123, 0216, 0203, 0200, 0315, 0211, 0277, 0033, 0000, 0353, 0264, 0001, 0301, 
+  0016, 0000, 0301, 0072, 0115, 0103, 0060, 0010, 0112, 0100, 0144, 0325, 0300, 0235, 0352, 0202, 
+  0073, 0165, 0060, 0356, 0324, 0132, 0114, 0375, 0242, 0141, 0126, 0110, 0351, 0105, 0120, 0151, 
+  0174, 0135, 0057, 0306, 0076, 0241, 0241, 0042, 0363, 0001, 0175, 0017, 0036, 0113, 0015, 0074, 
+  0226, 0065, 0150, 0350, 0000, 0064, 0000, 0064, 0000, 0064, 0200, 0053, 0160, 0120, 0256, 0000, 
+  0234, 0117, 0026, 0232, 0326, 0346, 0234, 0117, 0166, 0352, 0172, 0076, 0271, 0173, 0356, 0021, 
+  0333, 0314, 0277, 0345, 0366, 0242, 0125, 0113, 0254, 0316, 0014, 0111, 0033, 0352, 0356, 0344, 
+  0170, 0305, 0224, 0205, 0104, 0205, 0024, 0213, 0027, 0337, 0351, 0333, 0022, 0327, 0101, 0340, 
+  0262, 0071, 0112, 0077, 0247, 0142, 0246, 0154, 0220, 0004, 0122, 0271, 0225, 0073, 0362, 0032, 
+  0300, 0171, 0155, 0241, 0046, 0317, 0070, 0204, 0035, 0317, 0076, 0242, 0217, 0042, 0107, 0070, 
+  0042, 0050, 0015, 0127, 0253, 0222, 0274, 0076, 0171, 0234, 0031, 0342, 0327, 0222, 0216, 0252, 
+  0042, 0246, 0250, 0162, 0225, 0170, 0257, 0217, 0241, 0326, 0026, 0120, 0111, 0345, 0147, 0125, 
+  0361, 0001, 0027, 0124, 0365, 0134, 0120, 0235, 0303, 0341, 0202, 0252, 0137, 0025, 0053, 0260, 
+  0101, 0125, 0312, 0006, 0325, 0156, 0076, 0033, 0224, 0051, 0045, 0310, 0301, 0222, 0101, 0035, 
+  0327, 0226, 0014, 0252, 0333, 0156, 0002, 0315, 0316, 0146, 0303, 0375, 0076, 0311, 0160, 0170, 
+  0237, 0237, 0232, 0365, 0012, 0363, 0272, 0163, 0276, 0245, 0115, 0143, 0334, 0074, 0076, 0323, 
+  0055, 0156, 0266, 0265, 0215, 0266, 0364, 0006, 0061, 0144, 0212, 0040, 0333, 0015, 0315, 0313, 
+  0130, 0316, 0212, 0342, 0033, 0257, 0377, 0062, 0153, 0337, 0260, 0014, 0126, 0207, 0144, 0153, 
+  0215, 0361, 0240, 0333, 0154, 0000, 0160, 0045, 0002, 0020, 0345, 0044, 0012, 0302, 0005, 0342, 
+  0104, 0010, 0051, 0260, 0374, 0052, 0034, 0013, 0036, 0134, 0156, 0065, 0215, 0352, 0221, 0113, 
+  0102, 0021, 0055, 0166, 0205, 0114, 0132, 0106, 0145, 0011, 0103, 0322, 0130, 0065, 0127, 0115, 
+  0041, 0167, 0253, 0244, 0235, 0254, 0356, 0147, 0351, 0357, 0170, 0201, 0033, 0255, 0035, 0374, 
+  0333, 0011, 0110, 0070, 0124, 0064, 0147, 0335, 0223, 0323, 0135, 0257, 0027, 0223, 0056, 0027, 
+  0067, 0346, 0214, 0135, 0215, 0327, 0124, 0200, 0332, 0130, 0135, 0126, 0003, 0166, 0154, 0150, 
+  0300, 0254, 0361, 0147, 0217, 0335, 0144, 0051, 0350, 0017, 0131, 0173, 0270, 0031, 0103, 0175, 
+  0061, 0314, 0325, 0041, 0256, 0374, 0361, 0022, 0173, 0252, 0361, 0024, 0200, 0237, 0156, 0200, 
+  0132, 0375, 0065, 0212, 0010, 0237, 0262, 0220, 0313, 0336, 0070, 0035, 0251, 0371, 0025, 0337, 
+  0227, 0333, 0217, 0043, 0317, 0227, 0157, 0126, 0236, 0054, 0360, 0176, 0353, 0312, 0013, 0030, 
+  0047, 0333, 0336, 0177, 0361, 0313, 0270, 0127, 0313, 0143, 0310, 0310, 0213, 0246, 0377, 0107, 
+  0076, 0106, 0154, 0066, 0115, 0201, 0353, 0362, 0345, 0170, 0322, 0216, 0244, 0101, 0302, 0204, 
+  0333, 0175, 0351, 0102, 0331, 0067, 0331, 0017, 0052, 0056, 0063, 0054, 0226, 0257, 0312, 0336, 
+  0360, 0140, 0137, 0352, 0300, 0161, 0306, 0163, 0227, 0157, 0052, 0035, 0302, 0322, 0045, 0164, 
+  0333, 0107, 0060, 0300, 0134, 0024, 0031, 0301, 0372, 0163, 0225, 0215, 0040, 0355, 0131, 0072, 
+  0027, 0361, 0225, 0146, 0071, 0263, 0220, 0334, 0366, 0261, 0355, 0111, 0157, 0026, 0161, 0026, 
+  0271, 0311, 0130, 0222, 0173, 0207, 0226, 0037, 0337, 0060, 0226, 0313, 0067, 0161, 0002, 0375, 
+  0000, 0173, 0344, 0352, 0217, 0377, 0007, 0053, 0033, 0065, 0327, 0000, 0050, 0165, 0165, 0141, 
+  0171, 0051, 0157, 0162, 0147, 0057, 0000, 0000, 0005, 0000, 0000, 0000, 0155, 0141, 0164, 0145, 
+  0057, 0000, 0000, 0000, 0006, 0000, 0000, 0000, 0155, 0143, 0143, 0057, 0002, 0000, 0000, 0000, 
+  0155, 0141, 0164, 0145, 0055, 0153, 0145, 0171, 0142, 0157, 0141, 0162, 0144, 0055, 0160, 0162, 
+  0157, 0160, 0145, 0162, 0164, 0151, 0145, 0163, 0055, 0141, 0061, 0061, 0171, 0055, 0156, 0157, 
+  0164, 0151, 0146, 0151, 0143, 0141, 0164, 0151, 0157, 0156, 0163, 0056, 0165, 0151, 0000, 0000, 
+  0112, 0141, 0000, 0000, 0001, 0000, 0000, 0000, 0170, 0332, 0355, 0135, 0337, 0163, 0332, 0070, 
+  0020, 0176, 0357, 0137, 0241, 0363, 0353, 0215, 0223, 0102, 0333, 0273, 0076, 0020, 0072, 0111, 
+  0233, 0364, 0072, 0351, 0257, 0111, 0322, 0273, 0107, 0217, 0154, 0057, 0130, 0207, 0042, 0371, 
+  0044, 0031, 0302, 0314, 0375, 0361, 0267, 0262, 0041, 0015, 0105, 0140, 0014, 0246, 0241, 0075, 
+  0275, 0144, 0300, 0326, 0256, 0244, 0325, 0356, 0247, 0157, 0127, 0306, 0351, 0275, 0272, 0273, 
+  0345, 0144, 0014, 0112, 0063, 0051, 0116, 0202, 0316, 0321, 0323, 0200, 0200, 0110, 0144, 0312, 
+  0304, 0360, 0044, 0370, 0162, 0163, 0021, 0276, 0014, 0136, 0365, 0237, 0364, 0176, 0011, 0103, 
+  0362, 0026, 0004, 0050, 0152, 0040, 0045, 0023, 0146, 0062, 0062, 0344, 0064, 0005, 0362, 0354, 
+  0250, 0333, 0075, 0352, 0222, 0060, 0304, 0106, 0114, 0030, 0120, 0003, 0232, 0100, 0377, 0011, 
+  0041, 0075, 0005, 0377, 0024, 0114, 0201, 0046, 0234, 0305, 0047, 0301, 0320, 0214, 0176, 0015, 
+  0276, 0166, 0364, 0354, 0250, 0363, 0074, 0070, 0056, 0333, 0131, 0325, 0367, 0222, 0041, 0147, 
+  0011, 0010, 0015, 0241, 0231, 0346, 0100, 0206, 0071, 0037, 0127, 0272, 0227, 0332, 0011, 0172, 
+  0013, 0344, 0026, 0107, 0023, 0216, 0140, 0032, 0113, 0252, 0322, 0060, 0127, 0062, 0007, 0145, 
+  0030, 0350, 0220, 0166, 0072, 0323, 0120, 0110, 0303, 0006, 0054, 0241, 0006, 0173, 0324, 0107, 
+  0005, 0163, 0053, 0112, 0101, 0047, 0212, 0345, 0266, 0021, 0261, 0142, 0144, 0256, 0217, 0054, 
+  0310, 0223, 0224, 0121, 0056, 0207, 0070, 0165, 0221, 0312, 0211, 0133, 0125, 0042, 0363, 0251, 
+  0142, 0303, 0314, 0220, 0017, 0247, 0067, 0347, 0344, 0015, 0214, 0201, 0333, 0041, 0271, 0133, 
+  0323, 0302, 0144, 0122, 0151, 0362, 0227, 0344, 0203, 0041, 0025, 0103, 0362, 0205, 0307, 0212, 
+  0045, 0331, 0274, 0265, 0214, 0377, 0206, 0304, 0220, 0204, 0123, 0255, 0117, 0202, 0267, 0146, 
+  0364, 0246, 0034, 0101, 0100, 0130, 0172, 0022, 0330, 0221, 0106, 0013, 0003, 0214, 0252, 0001, 
+  0006, 0126, 0026, 0245, 0147, 0306, 0230, 0022, 0153, 0250, 0223, 0300, 0376, 0015, 0372, 0313, 
+  0146, 0011, 0053, 0251, 0336, 0361, 0274, 0275, 0133, 0074, 0241, 0042, 0032, 0310, 0244, 0320, 
+  0101, 0377, 0202, 0162, 0015, 0165, 0355, 0143, 0251, 0122, 0120, 0321, 0204, 0245, 0046, 0013, 
+  0372, 0057, 0352, 0232, 0033, 0146, 0070, 0004, 0304, 0050, 0052, 0064, 0247, 0206, 0306, 0034, 
+  0057, 0116, 0001, 0173, 0273, 0234, 0057, 0306, 0151, 0222, 0200, 0326, 0054, 0146, 0234, 0241, 
+  0330, 0151, 0221, 0062, 0111, 0056, 0000, 0322, 0230, 0046, 0243, 0072, 0365, 0325, 0232, 0105, 
+  0271, 0324, 0314, 0116, 0072, 0350, 0243, 0213, 0341, 0052, 0204, 0122, 0204, 0071, 0125, 0370, 
+  0271, 0166, 0174, 0350, 0214, 0121, 0206, 0113, 0027, 0364, 0127, 0330, 0053, 0311, 0030, 0117, 
+  0253, 0305, 0025, 0224, 0207, 0345, 0327, 0223, 0140, 0034, 0313, 0273, 0331, 0202, 0270, 0026, 
+  0364, 0354, 0301, 0335, 0345, 0116, 0307, 0014, 0247, 0213, 0146, 0351, 0337, 0250, 0142, 0311, 
+  0340, 0333, 0054, 0222, 0113, 0106, 0052, 0206, 0363, 0247, 0225, 0131, 0306, 0066, 0172, 0022, 
+  0312, 0067, 0021, 0324, 0071, 0115, 0020, 0043, 0202, 0176, 0327, 0331, 0332, 0155, 0017, 0232, 
+  0330, 0216, 0042, 0264, 0071, 0175, 0060, 0161, 0247, 0151, 0012, 0143, 0244, 0130, 0064, 0320, 
+  0126, 0106, 0332, 0326, 0120, 0056, 0071, 0116, 0247, 0262, 0060, 0221, 0066, 0123, 0333, 0043, 
+  0210, 0164, 0245, 0140, 0071, 0337, 0305, 0153, 0253, 0147, 0131, 0105, 0164, 0134, 0176, 0356, 
+  0004, 0337, 0112, 0271, 0206, 0021, 0003, 0017, 0372, 0210, 0250, 0141, 0006, 0074, 0137, 0065, 
+  0210, 0255, 0315, 0125, 0143, 0262, 0246, 0242, 0012, 0022, 0140, 0143, 0100, 0200, 0202, 0001, 
+  0055, 0270, 0151, 0256, 0241, 0320, 0200, 0106, 0227, 0311, 0250, 0116, 0264, 0167, 0134, 0231, 
+  0170, 0351, 0072, 0072, 0353, 0010, 0275, 0265, 0276, 0053, 0270, 0313, 0251, 0110, 0153, 0374, 
+  0302, 0045, 0070, 0140, 0234, 0157, 0041, 0366, 0025, 0223, 0236, 0256, 0233, 0226, 0163, 0374, 
+  0275, 0143, 0207, 0233, 0155, 0357, 0172, 0335, 0146, 0256, 0227, 0160, 0331, 0154, 0252, 0336, 
+  0367, 0016, 0326, 0367, 0072, 0155, 0370, 0236, 0313, 0000, 0356, 0311, 0157, 0065, 0361, 0055, 
+  0046, 0275, 0064, 0141, 0034, 0114, 0144, 0367, 0362, 0365, 0340, 0335, 0064, 0104, 0035, 0046, 
+  0132, 0062, 0317, 0162, 0130, 0326, 0321, 0201, 0107, 0337, 0355, 0152, 0070, 0334, 0316, 0214, 
+  0142, 0055, 0253, 0350, 0274, 0334, 0165, 0157, 0275, 0120, 0045, 0345, 0375, 0056, 0260, 0324, 
+  0070, 0364, 0112, 0034, 0215, 0356, 0050, 0147, 0303, 0365, 0320, 0357, 0060, 0121, 0106, 0055, 
+  0231, 0255, 0334, 0130, 0110, 0261, 0276, 0137, 0247, 0261, 0066, 0165, 0277, 0235, 0115, 0266, 
+  0253, 0331, 0134, 0362, 0267, 0124, 0015, 0231, 0210, 0070, 0014, 0020, 0315, 0073, 0335, 0246, 
+  0342, 0215, 0334, 0263, 0326, 0115, 0177, 0253, 0225, 0134, 0271, 0000, 0356, 0105, 0170, 0235, 
+  0101, 0262, 0260, 0067, 0017, 0200, 0232, 0102, 0331, 0075, 0010, 0163, 0335, 0050, 0311, 0060, 
+  0121, 0204, 0050, 0006, 0310, 0203, 0125, 0112, 0127, 0355, 0332, 0256, 0364, 0352, 0014, 0025, 
+  0221, 0111, 0006, 0202, 0104, 0164, 0041, 0301, 0232, 0165, 0253, 0011, 0162, 0165, 0202, 0237, 
+  0004, 0146, 0375, 0230, 0040, 0113, 0105, 0344, 0140, 0120, 0067, 0351, 0235, 0175, 0146, 0107, 
+  0026, 0260, 0071, 0033, 0330, 0310, 0003, 0135, 0252, 0262, 0131, 0350, 0342, 0262, 0050, 0263, 
+  0215, 0002, 0313, 0053, 0012, 0201, 0000, 0313, 0231, 0330, 0301, 0052, 0251, 0242, 0223, 0010, 
+  0323, 0133, 0233, 0317, 0113, 0265, 0251, 0236, 0125, 0134, 0245, 0236, 0263, 0354, 0314, 0135, 
+  0326, 0157, 0347, 0333, 0232, 0141, 0043, 0032, 0135, 0103, 0151, 0326, 0322, 0352, 0326, 0342, 
+  0331, 0310, 0341, 0220, 0303, 0010, 0246, 0072, 0002, 0101, 0313, 0210, 0150, 0065, 0216, 0051, 
+  0211, 0252, 0056, 0154, 0035, 0213, 0060, 0115, 0162, 0214, 0142, 0015, 0251, 0217, 0131, 0037, 
+  0263, 0207, 0032, 0263, 0235, 0175, 0306, 0354, 0152, 0273, 0255, 0024, 0232, 0125, 0257, 0054, 
+  0305, 0272, 0117, 0171, 0067, 0242, 0120, 0357, 0127, 0266, 0075, 0060, 0022, 0325, 0050, 0024, 
+  0066, 0207, 0241, 0352, 0204, 0240, 0236, 0116, 0121, 0143, 0024, 0213, 0013, 0003, 0172, 0345, 
+  0172, 0337, 0067, 0231, 0327, 0160, 0301, 0026, 0326, 0003, 0062, 0246, 0274, 0050, 0223, 0023, 
+  0236, 0126, 0347, 0007, 0256, 0025, 0137, 0257, 0277, 0261, 0107, 0074, 0172, 0152, 0337, 0064, 
+  0065, 0171, 0264, 0252, 0122, 0225, 0164, 0225, 0033, 0235, 0106, 0146, 0075, 0232, 0226, 0033, 
+  0335, 0342, 0071, 0105, 0354, 0314, 0063, 0174, 0132, 0366, 0143, 0247, 0145, 0060, 0306, 0264, 
+  0312, 0102, 0300, 0233, 0313, 0350, 0363, 0247, 0167, 0037, 0157, 0316, 0257, 0242, 0017, 0237, 
+  0156, 0336, 0175, 0372, 0030, 0175, 0070, 0275, 0276, 0044, 0377, 0022, 0307, 0235, 0077, 0360, 
+  0333, 0303, 0333, 0147, 0137, 0156, 0156, 0360, 0362, 0347, 0253, 0363, 0353, 0153, 0307, 0365, 
+  0253, 0363, 0367, 0347, 0247, 0327, 0347, 0345, 0035, 0237, 0066, 0256, 0245, 0231, 0017, 0242, 
+  0357, 0126, 0246, 0030, 0175, 0240, 0366, 0221, 0065, 0042, 0333, 0234, 0253, 0367, 0174, 0323, 
+  0363, 0115, 0237, 0043, 0172, 0276, 0371, 0075, 0371, 0346, 0165, 0211, 0162, 0344, 0022, 0141, 
+  0316, 0163, 0316, 0203, 0341, 0234, 0235, 0307, 0343, 0234, 0123, 0155, 0340, 0026, 0067, 0072, 
+  0316, 0075, 0315, 0364, 0325, 0377, 0037, 0237, 0306, 0241, 0255, 0013, 0312, 0053, 0207, 0156, 
+  0261, 0134, 0170, 0235, 0311, 0011, 0211, 0052, 0345, 0144, 0060, 0173, 0212, 0212, 0014, 0244, 
+  0042, 0046, 0003, 0102, 0071, 0052, 0041, 0132, 0026, 0302, 0263, 0070, 0317, 0342, 0174, 0245, 
+  0177, 0263, 0330, 0135, 0015, 0240, 0373, 0016, 0222, 0255, 0127, 0242, 0041, 0230, 0266, 0006, 
+  0250, 0273, 0201, 0152, 0375, 0342, 0270, 0027, 0350, 0212, 0246, 0114, 0256, 0002, 0327, 0362, 
+  0011, 0324, 0230, 0252, 0140, 0235, 0316, 0046, 0020, 0173, 0201, 0375, 0146, 0044, 0232, 0075, 
+  0056, 0074, 0127, 0277, 0311, 0334, 0132, 0161, 0227, 0226, 0160, 0265, 0145, 0154, 0155, 0005, 
+  0137, 0133, 0304, 0130, 0227, 0052, 0373, 0214, 0352, 0170, 0107, 0035, 0333, 0141, 0365, 0046, 
+  0170, 0275, 0031, 0146, 0267, 0202, 0333, 0273, 0143, 0367, 0316, 0370, 0275, 0001, 0206, 0327, 
+  0342, 0370, 0136, 0340, 0142, 0120, 0160, 0256, 0023, 0005, 0040, 0132, 0006, 0014, 0004, 0123, 
+  0246, 0200, 0104, 0225, 0162, 0017, 0027, 0007, 0017, 0027, 0333, 0207, 0372, 0262, 0256, 0241, 
+  0222, 0105, 0216, 0333, 0250, 0143, 0137, 0362, 0350, 0321, 0374, 0314, 0270, 0035, 0364, 0360, 
+  0347, 0356, 0276, 0016, 0172, 0350, 0165, 0320, 0077, 0253, 0114, 0076, 0051, 0100, 0227, 0131, 
+  0174, 0231, 0273, 0373, 0222, 0350, 0341, 0224, 0104, 0273, 0217, 0127, 0022, 0345, 0162, 0342, 
+  0017, 0341, 0175, 0165, 0364, 0247, 0074, 0344, 0236, 0373, 0266, 0075, 0331, 0216, 0312, 0203, 
+  0347, 0326, 0317, 0267, 0357, 0117, 0265, 0043, 0177, 0254, 0355, 0013, 0242, 0276, 0040, 0332, 
+  0132, 0270, 0332, 0337, 0033, 0344, 0246, 0345, 0170, 0235, 0105, 0353, 0114, 0271, 0017, 0127, 
+  0037, 0256, 0377, 0323, 0354, 0253, 0365, 0160, 0125, 0140, 0333, 0357, 0051, 0134, 0053, 0345, 
+  0076, 0134, 0175, 0270, 0036, 0156, 0270, 0166, 0175, 0261, 0344, 0047, 0171, 0150, 0014, 0161, 
+  0315, 0077, 0062, 0166, 0130, 0365, 0221, 0147, 0217, 0126, 0037, 0211, 0145, 0041, 0022, 0360, 
+  0025, 0022, 0137, 0041, 0371, 0031, 0053, 0044, 0017, 0274, 0173, 0177, 0054, 0356, 0276, 0110, 
+  0142, 0265, 0107, 0236, 0307, 0171, 0036, 0107, 0374, 0303, 0377, 0236, 0307, 0355, 0233, 0307, 
+  0235, 0225, 0330, 0346, 0231, 0334, 0141, 0061, 0271, 0347, 0217, 0301, 0344, 0074, 0117, 0363, 
+  0077, 0047, 0365, 0077, 0047, 0335, 0043, 0217, 0114, 0150, 0256, 0271, 0114, 0106, 0025, 0213, 
+  0334, 0313, 0213, 0113, 0312, 0343, 0073, 0234, 0316, 0214, 0116, 0116, 0160, 0304, 0100, 0136, 
+  0143, 0277, 0321, 0173, 0354, 0330, 0322, 0313, 0352, 0311, 0114, 0317, 0055, 0017, 0056, 0070, 
+  0074, 0377, 0365, 0374, 0327, 0363, 0337, 0357, 0315, 0177, 0055, 0066, 0022, 0213, 0215, 0236, 
+  0375, 0036, 0014, 0373, 0175, 0361, 0303, 0276, 0110, 0265, 0311, 0033, 0105, 0153, 0317, 0060, 
+  0353, 0337, 0210, 0272, 0070, 0307, 0205, 0233, 0275, 0352, 0055, 0341, 0341, 0204, 0245, 0103, 
+  0060, 0367, 0056, 0265, 0170, 0231, 0040, 0133, 0310, 0245, 0320, 0070, 0232, 0260, 0323, 0011, 
+  0372, 0263, 0267, 0147, 0243, 0057, 0076, 0154, 0125, 0057, 0373, 0373, 0134, 0264, 0353, 0024, 
+  0375, 0346, 0142, 0071, 0230, 0257, 0103, 0357, 0035, 0077, 0370, 0217, 0007, 0377, 0001, 0215, 
+  0177, 0302, 0105, 0000, 0050, 0165, 0165, 0141, 0171, 0051, 0155, 0141, 0164, 0145, 0055, 0153, 
+  0145, 0171, 0142, 0157, 0141, 0162, 0144, 0055, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0151, 
+  0145, 0163, 0055, 0155, 0157, 0144, 0145, 0154, 0055, 0143, 0150, 0157, 0157, 0163, 0145, 0162, 
+  0056, 0165, 0151, 0000, 0000, 0000, 0000, 0000, 0060, 0035, 0000, 0000, 0001, 0000, 0000, 0000, 
+  0170, 0332, 0355, 0131, 0115, 0163, 0333, 0066, 0020, 0275, 0347, 0127, 0240, 0270, 0166, 0150, 
+  0175, 0305, 0151, 0246, 0103, 0061, 0323, 0066, 0115, 0016, 0155, 0246, 0207, 0070, 0311, 0221, 
+  0003, 0202, 0053, 0022, 0025, 0014, 0260, 0000, 0050, 0133, 0377, 0076, 0000, 0050, 0311, 0246, 
+  0005, 0211, 0046, 0255, 0151, 0074, 0211, 0056, 0236, 0061, 0270, 0157, 0261, 0373, 0166, 0027, 
+  0213, 0205, 0342, 0067, 0267, 0327, 0034, 0255, 0100, 0151, 0046, 0305, 0034, 0117, 0056, 0306, 
+  0030, 0201, 0240, 0062, 0147, 0242, 0230, 0343, 0117, 0127, 0357, 0242, 0327, 0370, 0115, 0362, 
+  0042, 0376, 0051, 0212, 0320, 0173, 0020, 0240, 0210, 0201, 0034, 0335, 0060, 0123, 0242, 0202, 
+  0223, 0034, 0320, 0354, 0142, 0072, 0276, 0030, 0243, 0050, 0262, 0102, 0114, 0030, 0120, 0013, 
+  0102, 0041, 0171, 0201, 0120, 0254, 0340, 0277, 0232, 0051, 0320, 0210, 0263, 0154, 0216, 0013, 
+  0263, 0374, 0031, 0337, 0155, 0064, 0273, 0230, 0274, 0304, 0043, 0057, 0347, 0124, 0357, 0220, 
+  0021, 0147, 0024, 0204, 0206, 0310, 0254, 0053, 0100, 0105, 0305, 0127, 0123, 0257, 0173, 0117, 
+  0116, 0220, 0153, 0100, 0327, 0326, 0232, 0150, 0011, 0353, 0114, 0022, 0225, 0107, 0225, 0222, 
+  0025, 0050, 0303, 0100, 0107, 0327, 0062, 0007, 0036, 0321, 0122, 0112, 0015, 0052, 0254, 0040, 
+  0007, 0115, 0025, 0253, 0214, 0065, 0007, 0155, 0125, 0040, 0217, 0103, 0133, 0134, 0316, 0010, 
+  0227, 0205, 0365, 0126, 0344, 0362, 0046, 0254, 0205, 0312, 0152, 0255, 0130, 0121, 0032, 0364, 
+  0341, 0267, 0253, 0077, 0321, 0133, 0130, 0001, 0167, 0126, 0204, 0245, 0111, 0155, 0112, 0251, 
+  0064, 0372, 0042, 0371, 0242, 0040, 0242, 0100, 0237, 0170, 0246, 0030, 0055, 0267, 0322, 0062, 
+  0373, 0027, 0250, 0101, 0224, 0023, 0255, 0347, 0370, 0275, 0131, 0276, 0365, 0026, 0140, 0304, 
+  0362, 0071, 0276, 0135, 0146, 0251, 0267, 0057, 0335, 0330, 0207, 0035, 0306, 0242, 0066, 0176, 
+  0257, 0221, 0343, 0144, 0216, 0335, 0137, 0234, 0130, 0351, 0066, 0013, 0361, 0150, 0053, 0027, 
+  0206, 0255, 0230, 0146, 0031, 0267, 0310, 0053, 0125, 0103, 0227, 0060, 0045, 0042, 0135, 0110, 
+  0132, 0153, 0234, 0274, 0043, 0134, 0167, 0312, 0147, 0122, 0345, 0240, 0322, 0033, 0226, 0233, 
+  0022, 0047, 0227, 0135, 0342, 0206, 0031, 0153, 0011, 0062, 0212, 0010, 0315, 0211, 0041, 0326, 
+  0256, 0071, 0136, 0203, 0335, 0355, 0017, 0357, 0014, 0042, 0350, 0257, 0155, 0310, 0076, 0070, 
+  0047, 0273, 0024, 0132, 0046, 0010, 0177, 0234, 0153, 0071, 0054, 0110, 0315, 0315, 0326, 0326, 
+  0227, 0227, 0343, 0307, 0042, 0112, 0160, 0211, 0200, 0223, 0331, 0353, 0116, 0210, 0313, 0356, 
+  0264, 0264, 0211, 0201, 0223, 0046, 0311, 0366, 0000, 0264, 0144, 0074, 0157, 0122, 0107, 0020, 
+  0027, 0104, 0373, 0257, 0015, 0122, 0046, 0157, 0067, 0141, 0017, 0245, 0313, 0357, 0366, 0253, 
+  0317, 0225, 0106, 0151, 0344, 0304, 0247, 0073, 0371, 0236, 0061, 0037, 0022, 0367, 0020, 0106, 
+  0052, 0006, 0302, 0020, 0127, 0150, 0070, 0131, 0271, 0002, 0245, 0204, 0077, 0006, 0250, 0053, 
+  0102, 0355, 0061, 0204, 0223, 0151, 0120, 0072, 0314, 0020, 0241, 0156, 0243, 0224, 0050, 0040, 
+  0367, 0034, 0017, 0222, 0125, 0033, 0043, 0305, 0103, 0312, 0356, 0341, 0047, 0055, 0005, 0003, 
+  0330, 0033, 0312, 0140, 0010, 0307, 0311, 0132, 0326, 0046, 0325, 0146, 0355, 0166, 0004, 0221, 
+  0037, 0004, 0172, 0042, 0332, 0153, 0207, 0335, 0157, 0174, 0267, 0106, 0121, 0340, 0231, 0137, 
+  0171, 0350, 0165, 0330, 0230, 0014, 0154, 0071, 0331, 0063, 0075, 0152, 0240, 0207, 0214, 0031, 
+  0114, 0133, 0007, 0165, 0103, 0240, 0233, 0062, 0355, 0017, 0126, 0100, 0201, 0255, 0100, 0337, 
+  0151, 0070, 0032, 0271, 0220, 0212, 0132, 0203, 0015, 0235, 0244, 0313, 0256, 0335, 0343, 0121, 
+  0023, 0250, 0275, 0165, 0133, 0013, 0113, 0133, 0014, 0335, 0133, 0301, 0155, 0105, 0104, 0076, 
+  0300, 0306, 0005, 0343, 0174, 0000, 0254, 0222, 0232, 0065, 0265, 0075, 0076, 0346, 0126, 0320, 
+  0376, 0170, 0024, 0110, 0326, 0041, 0011, 0234, 0031, 0361, 0317, 0262, 0137, 0342, 0312, 0345, 
+  0071, 0151, 0317, 0111, 0233, 0114, 0116, 0221, 0264, 0041, 0002, 0302, 0316, 0017, 0162, 0174, 
+  0200, 0323, 0173, 0016, 0133, 0143, 0122, 0167, 0353, 0070, 0336, 0073, 0372, 0326, 0166, 0200, 
+  0242, 0075, 0172, 0366, 0353, 0371, 0310, 0305, 0145, 0357, 0222, 0233, 0132, 0176, 0340, 0071, 
+  0065, 0342, 0216, 0253, 0354, 0223, 0157, 0101, 0107, 0157, 0102, 0257, 0236, 0332, 0365, 0377, 
+  0366, 0007, 0240, 0247, 0172, 0145, 0023, 0301, 0016, 0043, 0351, 0346, 0114, 0374, 0137, 0216, 
+  0300, 0336, 0205, 0132, 0022, 0316, 0012, 0313, 0230, 0066, 0104, 0231, 0076, 0300, 0306, 0253, 
+  0320, 0010, 0221, 0176, 0156, 0034, 0377, 0265, 0357, 0131, 0130, 0013, 0033, 0170, 0316, 0004, 
+  0234, 0233, 0370, 0311, 0232, 0370, 0107, 0252, 0044, 0347, 0220, 0177, 0361, 0063, 0166, 0073, 
+  0061, 0365, 0346, 0133, 0063, 0177, 0077, 0042, 0103, 0233, 0001, 0054, 0165, 0017, 0017, 0240, 
+  0155, 0307, 0233, 0314, 0306, 0317, 0275, 0307, 0353, 0222, 0130, 0337, 0066, 0047, 0063, 0023, 
+  0107, 0241, 0101, 0112, 0303, 0264, 0136, 0051, 0200, 0317, 0014, 0036, 0020, 0312, 0231, 0143, 
+  0045, 0240, 0340, 0011, 0134, 0074, 0221, 0217, 0160, 0030, 0211, 0055, 0064, 0235, 0356, 0154, 
+  0350, 0114, 0347, 0043, 0363, 0240, 0006, 0016, 0264, 0111, 0355, 0040, 0354, 0020, 0173, 0037, 
+  0167, 0270, 0321, 0201, 0375, 0106, 0207, 0343, 0161, 0240, 0376, 0017, 0202, 0116, 0167, 0140, 
+  0364, 0315, 0277, 0346, 0274, 0350, 0213, 0072, 0361, 0365, 0151, 0120, 0373, 0362, 0007, 0374, 
+  0057, 0077, 0122, 0337, 0362, 0057, 0135, 0347, 0266, 0025, 0314, 0303, 0351, 0267, 0157, 0133, 
+  0355, 0166, 0065, 0373, 0076, 0373, 0125, 0331, 0170, 0231, 0021, 0173, 0061, 0227, 0234, 0321, 
+  0065, 0116, 0004, 0254, 0366, 0137, 0227, 0277, 0171, 0317, 0363, 0103, 0304, 0271, 0345, 0235, 
+  0133, 0336, 0311, 0133, 0336, 0354, 0171, 0274, 0030, 0364, 0231, 0165, 0273, 0135, 0356, 0335, 
+  0341, 0273, 0047, 0377, 0266, 0213, 0255, 0217, 0161, 0363, 0312, 0036, 0331, 0041, 0272, 0000, 
+  0243, 0167, 0210, 0326, 0062, 0122, 0240, 0053, 0051, 0264, 0265, 0046, 0172, 0205, 0223, 0326, 
+  0033, 0165, 0074, 0152, 0211, 0166, 0053, 0270, 0304, 0211, 0177, 0043, 0014, 0002, 0037, 0054, 
+  0172, 0173, 0356, 0254, 0217, 0107, 0367, 0176, 0327, 0374, 0012, 0210, 0261, 0212, 0126, 0000, 
+  0050, 0165, 0165, 0141, 0171, 0051, 0155, 0141, 0164, 0145, 0055, 0153, 0145, 0171, 0142, 0157, 
+  0141, 0162, 0144, 0055, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0151, 0145, 0163, 0055, 0154, 
+  0141, 0171, 0157, 0165, 0164, 0055, 0143, 0150, 0157, 0157, 0163, 0145, 0162, 0056, 0165, 0151, 
+  0234, 0100, 0000, 0000, 0001, 0000, 0000, 0000, 0170, 0332, 0355, 0134, 0113, 0163, 0333, 0066, 
+  0020, 0276, 0347, 0127, 0240, 0270, 0166, 0150, 0275, 0354, 0114, 0323, 0221, 0230, 0111, 0234, 
+  0332, 0227, 0264, 0311, 0301, 0151, 0217, 0034, 0220, 0204, 0104, 0124, 0020, 0300, 0002, 0220, 
+  0144, 0375, 0373, 0202, 0240, 0144, 0131, 0026, 0370, 0000, 0151, 0271, 0226, 0313, 0213, 0147, 
+  0104, 0141, 0027, 0330, 0335, 0157, 0301, 0157, 0127, 0200, 0307, 0037, 0357, 0027, 0024, 0254, 
+  0260, 0220, 0204, 0263, 0011, 0034, 0134, 0364, 0041, 0300, 0054, 0342, 0061, 0141, 0263, 0011, 
+  0374, 0161, 0167, 0343, 0375, 0002, 0077, 0372, 0357, 0306, 0077, 0171, 0036, 0270, 0305, 0014, 
+  0013, 0244, 0160, 0014, 0326, 0104, 0045, 0140, 0106, 0121, 0214, 0301, 0350, 0142, 0330, 0277, 
+  0350, 0003, 0317, 0323, 0203, 0010, 0123, 0130, 0114, 0121, 0204, 0375, 0167, 0000, 0214, 0005, 
+  0376, 0147, 0111, 0004, 0226, 0200, 0222, 0160, 0002, 0147, 0152, 0376, 0063, 0334, 0117, 0064, 
+  0272, 0030, 0134, 0302, 0236, 0031, 0227, 0251, 0176, 0220, 0364, 0050, 0211, 0060, 0223, 0330, 
+  0123, 0233, 0024, 0203, 0131, 0112, 0127, 0103, 0243, 0373, 0150, 0034, 0103, 0013, 0014, 0026, 
+  0172, 0065, 0336, 0034, 0157, 0102, 0216, 0104, 0354, 0245, 0202, 0247, 0130, 0050, 0202, 0245, 
+  0107, 0321, 0206, 0057, 0225, 0027, 0045, 0234, 0113, 0054, 0354, 0032, 0142, 0054, 0043, 0101, 
+  0122, 0245, 0327, 0003, 0166, 0072, 0300, 0136, 0007, 0310, 0165, 0200, 0230, 0040, 0312, 0147, 
+  0332, 0144, 0026, 0363, 0265, 0135, 0123, 0304, 0323, 0215, 0040, 0263, 0104, 0201, 0337, 0077, 
+  0335, 0375, 0006, 0276, 0340, 0025, 0246, 0231, 0032, 0373, 0150, 0264, 0124, 0011, 0027, 0022, 
+  0374, 0305, 0351, 0164, 0206, 0330, 0014, 0374, 0240, 0241, 0040, 0121, 0262, 0033, 0315, 0303, 
+  0277, 0161, 0244, 0100, 0104, 0221, 0224, 0023, 0170, 0253, 0346, 0137, 0314, 0012, 0040, 0040, 
+  0361, 0004, 0336, 0317, 0303, 0040, 0137, 0130, 0260, 0065, 0016, 0146, 0102, 0132, 0154, 0273, 
+  0362, 0015, 0310, 0074, 0063, 0201, 0331, 0137, 0350, 0353, 0341, 0117, 0174, 0061, 0356, 0355, 
+  0006, 0332, 0345, 0126, 0104, 0222, 0220, 0152, 0321, 0073, 0261, 0304, 0125, 0203, 0043, 0304, 
+  0202, 0051, 0217, 0226, 0022, 0372, 0067, 0210, 0312, 0312, 0361, 0041, 0027, 0061, 0026, 0301, 
+  0232, 0304, 0052, 0201, 0376, 0125, 0325, 0160, 0105, 0224, 0136, 0011, 0120, 0002, 0061, 0111, 
+  0221, 0102, 0172, 0135, 0023, 0270, 0301, 0172, 0266, 0153, 0143, 0014, 0100, 0340, 0253, 0061, 
+  0256, 0112, 0121, 0214, 0247, 0150, 0111, 0325, 0156, 0342, 0017, 0375, 0176, 0135, 0211, 0004, 
+  0147, 0161, 0205, 0376, 0350, 0252, 0122, 0044, 0103, 0154, 0220, 0350, 0070, 0103, 0077, 0307, 
+  0314, 0221, 0100, 0224, 0020, 0032, 0347, 0110, 0140, 0210, 0172, 0346, 0243, 0366, 0170, 0310, 
+  0357, 0267, 0101, 0264, 0105, 0377, 0263, 0376, 0326, 0204, 0076, 0127, 0352, 0145, 0303, 0107, 
+  0017, 0343, 0035, 0003, 0330, 0044, 0210, 0066, 0031, 0056, 0010, 0146, 0012, 0145, 0271, 0003, 
+  0375, 0125, 0226, 0060, 0021, 0242, 0165, 0004, 0145, 0212, 0042, 0275, 0265, 0100, 0177, 0150, 
+  0035, 0155, 0367, 0020, 0212, 0262, 0211, 0002, 0044, 0060, 0172, 0144, 0270, 0325, 0131, 0113, 
+  0245, 0070, 0173, 0160, 0131, 0022, 0052, 0363, 0341, 0261, 0120, 0003, 0217, 0065, 0365, 0232, 
+  0115, 0156, 0233, 0274, 0122, 0155, 0262, 0031, 0061, 0213, 0013, 0005, 0215, 0361, 0207, 0317, 
+  0212, 0115, 0316, 0355, 0325, 0346, 0176, 0027, 0006, 0201, 0117, 0304, 0154, 0353, 0010, 0061, 
+  0205, 0276, 0336, 0226, 0365, 0276, 0251, 0105, 0212, 0226, 0321, 0330, 0141, 0025, 0116, 0153, 
+  0042, 0272, 0115, 0112, 0167, 0141, 0201, 0043, 0114, 0126, 0130, 0356, 0065, 0224, 0306, 0314, 
+  0246, 0142, 0051, 0261, 0016, 0032, 0217, 0346, 0125, 0263, 0217, 0173, 0171, 0210, 0216, 0236, 
+  0153, 0344, 0317, 0065, 0364, 0253, 0247, 0302, 0367, 0051, 0142, 0161, 0203, 0065, 0116, 0011, 
+  0245, 0015, 0304, 0122, 0056, 0111, 0236, 0311, 0175, 0027, 0061, 0211, 0043, 0316, 0142, 0044, 
+  0066, 0325, 0036, 0261, 0232, 0076, 0356, 0131, 0020, 0336, 0004, 0365, 0032, 0032, 0021, 0246, 
+  0241, 0171, 0062, 0164, 0203, 0176, 0056, 0332, 0141, 0277, 0303, 0276, 0077, 0370, 0357, 0000, 
+  0254, 0267, 0355, 0157, 0363, 0201, 0033, 0162, 0121, 0034, 0167, 0260, 0355, 0140, 0153, 0347, 
+  0121, 0256, 0260, 0265, 0071, 0300, 0156, 0174, 0043, 0303, 0033, 0030, 0175, 0144, 0260, 0136, 
+  0114, 0220, 0061, 0354, 0162, 0316, 0344, 0372, 0146, 0263, 0270, 0350, 0310, 0075, 0307, 0031, 
+  0135, 0102, 0322, 0063, 0166, 0176, 0331, 0177, 0115, 0204, 0263, 0242, 0346, 0152, 0315, 0360, 
+  0113, 0131, 0376, 0373, 0266, 0354, 0366, 0017, 0256, 0160, 0310, 0371, 0174, 0373, 0246, 0317, 
+  0153, 0130, 0031, 0260, 0020, 0276, 0222, 0075, 0317, 0152, 0207, 0335, 0226, 0117, 0224, 0314, 
+  0330, 0102, 0173, 0065, 0067, 0006, 0355, 0076, 0332, 0166, 0376, 0126, 0366, 0264, 0201, 0117, 
+  0221, 0274, 0342, 0151, 0220, 0352, 0227, 0116, 0171, 0130, 0213, 0101, 0250, 0337, 0166, 0213, 
+  0026, 0012, 0050, 0236, 0252, 0275, 0370, 0240, 0357, 0052, 0157, 0332, 0063, 0056, 0363, 0027, 
+  0306, 0325, 0036, 0333, 0133, 0101, 0342, 0074, 0254, 0246, 0115, 0121, 0024, 0322, 0326, 0141, 
+  0175, 0216, 0320, 0132, 0375, 0303, 0327, 0101, 0165, 0326, 0226, 0256, 0202, 0323, 0345, 0202, 
+  0355, 0225, 0014, 0206, 0265, 0264, 0224, 0372, 0331, 0356, 0353, 0153, 0276, 0010, 0371, 0303, 
+  0216, 0233, 0165, 0304, 0042, 0276, 0144, 0112, 0154, 0202, 0025, 0022, 0004, 0061, 0045, 0003, 
+  0264, 0102, 0204, 0042, 0343, 0325, 0022, 0325, 0317, 0020, 0213, 0347, 0212, 0107, 0061, 0011, 
+  0251, 0107, 0110, 0052, 0163, 0007, 0051, 0205, 0242, 0244, 0224, 0346, 0126, 0157, 0000, 0216, 
+  0112, 0012, 0010, 0110, 0045, 0207, 0076, 0025, 0100, 0010, 0356, 0220, 0161, 0142, 0144, 0364, 
+  0137, 0067, 0062, 0276, 0232, 0002, 0312, 0300, 0302, 0324, 0122, 0243, 0363, 0101, 0301, 0261, 
+  0236, 0304, 0060, 0010, 0350, 0113, 0205, 0204, 0152, 0252, 0044, 0057, 0051, 0155, 0075, 0366, 
+  0340, 0072, 0337, 0125, 0177, 0155, 0252, 0072, 0253, 0277, 0226, 0114, 0223, 0117, 0112, 0130, 
+  0113, 0227, 0055, 0030, 0136, 0160, 0106, 0242, 0214, 0306, 0316, 0260, 0062, 0077, 0154, 0330, 
+  0222, 0372, 0125, 0045, 0124, 0377, 0177, 0230, 0120, 0227, 0135, 0102, 0025, 0047, 0324, 0237, 
+  0133, 0172, 0362, 0312, 0063, 0312, 0306, 0243, 0336, 0136, 0142, 0275, 0030, 0207, 0051, 0167, 
+  0112, 0211, 0160, 0261, 0140, 0241, 0320, 0366, 0007, 0264, 0254, 0121, 0142, 0052, 0021, 0130, 
+  0257, 0062, 0175, 0232, 0305, 0303, 0341, 0071, 0224, 0244, 0305, 0231, 0366, 0171, 0003, 0166, 
+  0130, 0166, 0125, 0352, 0234, 0142, 0145, 0341, 0055, 0307, 0372, 0021, 0072, 0121, 0030, 0324, 
+  0354, 0007, 0226, 0342, 0262, 0002, 0035, 0355, 0232, 0025, 0303, 0256, 0131, 0361, 0326, 0232, 
+  0025, 0243, 0256, 0131, 0361, 0222, 0315, 0012, 0212, 0330, 0154, 0211, 0146, 0270, 0353, 0126, 
+  0164, 0335, 0212, 0162, 0204, 0164, 0310, 0350, 0272, 0025, 0217, 0151, 0331, 0140, 0330, 0125, 
+  0127, 0305, 0325, 0325, 0327, 0155, 0326, 0164, 0375, 0212, 0256, 0137, 0121, 0077, 0245, 0272, 
+  0016, 0140, 0327, 0260, 0350, 0032, 0026, 0247, 0156, 0130, 0270, 0226, 0302, 0265, 0216, 0145, 
+  0265, 0053, 0203, 0133, 0067, 0111, 0076, 0234, 0177, 0217, 0144, 0107, 0064, 0317, 0250, 0111, 
+  0122, 0033, 0031, 0057, 0336, 0137, 0171, 0243, 0007, 0177, 0117, 0162, 0370, 0361, 0361, 0161, 
+  0251, 0357, 0002, 0257, 0010, 0136, 0327, 0070, 0320, 0143, 0316, 0060, 0005, 0331, 0275, 0042, 
+  0054, 0225, 0365, 0032, 0107, 0351, 0313, 0322, 0134, 0345, 0330, 0213, 0137, 0272, 0211, 0077, 
+  0307, 0151, 0042, 0347, 0010, 0071, 0235, 0302, 0152, 0166, 0022, 0313, 0265, 0061, 0370, 0350, 
+  0162, 0005, 0277, 0077, 0213, 0243, 0113, 0365, 0133, 0105, 0256, 0215, 0264, 0043, 0066, 0331, 
+  0077, 0267, 0126, 0232, 0063, 0203, 0254, 0377, 0202, 0331, 0346, 0165, 0015, 0356, 0130, 0305, 
+  0302, 0252, 0031, 0130, 0343, 0235, 0264, 0345, 0216, 0332, 0152, 0147, 0255, 0311, 0330, 0136, 
+  0204, 0160, 0071, 0071, 0254, 0205, 0263, 0032, 0073, 0352, 0324, 0277, 0167, 0334, 0210, 0354, 
+  0302, 0244, 0111, 0345, 0064, 0007, 0156, 0376, 0344, 0134, 0070, 0136, 0160, 0277, 0315, 0144, 
+  0347, 0137, 0033, 0144, 0202, 0142, 0276, 0336, 0036, 0256, 0046, 0254, 0345, 0036, 0231, 0122, 
+  0024, 0341, 0204, 0123, 0115, 0016, 0173, 0257, 0000, 0317, 0115, 0342, 0221, 0303, 0271, 0211, 
+  0344, 0011, 0313, 0226, 0347, 0143, 0227, 0256, 0374, 0245, 0236, 0073, 0116, 0174, 0261, 0246, 
+  0375, 0015, 0005, 0227, 0263, 0366, 0325, 0046, 0073, 0233, 0133, 0175, 0323, 0340, 0320, 0304, 
+  0203, 0057, 0307, 0371, 0015, 0130, 0057, 0157, 0175, 0310, 0007, 0211, 0203, 0307, 0100, 0140, 
+  0231, 0162, 0046, 0365, 0152, 0064, 0055, 0333, 0135, 0005, 0035, 0367, 0016, 0006, 0125, 0212, 
+  0172, 0357, 0241, 0177, 0160, 0241, 0316, 0131, 0301, 0225, 0231, 0374, 0333, 0174, 0140, 0225, 
+  0174, 0362, 0320, 0330, 0262, 0267, 0174, 0334, 0173, 0364, 0077, 0004, 0376, 0005, 0017, 0130, 
+  0204, 0032, 0000, 0050, 0165, 0165, 0141, 0171, 0051
+} };
+
+static GStaticResource static_resource = { keyboard_resource_data.data, sizeof (keyboard_resource_data.data) - 1 /* nul terminator */, NULL, NULL, NULL };
+
+G_MODULE_EXPORT
+GResource *keyboard_get_resource (void);
+GResource *keyboard_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(keyboardresource_constructor)
+#endif
+G_DEFINE_CONSTRUCTOR(keyboardresource_constructor)
+#ifdef G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA
+#pragma G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(keyboardresource_destructor)
+#endif
+G_DEFINE_DESTRUCTOR(keyboardresource_destructor)
+
+#else
+#warning "Constructor not supported on this compiler, linking in resources will not work"
+#endif
+
+static void keyboardresource_constructor (void)
+{
+  g_static_resource_init (&static_resource);
+}
+
+static void keyboardresource_destructor (void)
+{
+  g_static_resource_fini (&static_resource);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/63.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/63.html new file mode 100644 index 00000000..167e7d77 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/63.html @@ -0,0 +1,799 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- mode: c; style: linux -*- */
+
+/* mate-keyboard-properties-xkb.c
+ * Copyright (C) 2003-2007 Sergey V. Udaltsov
+ *
+ * Written by: Sergey V. Udaltsov <svu@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, 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 <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.
+
+#include "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+
+#include "mate-keyboard-properties-xkb.h"
+
+#include <libmatekbd/matekbd-desktop-config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define XKB_GENERAL_SCHEMA "org.mate.peripherals-keyboard-xkb.general"
+#define XKB_KBD_SCHEMA "org.mate.peripherals-keyboard-xkb.kbd"
+
+XklEngine *engine;
+XklConfigRegistry *config_registry;
+
+MatekbdKeyboardConfig initial_config;
+MatekbdDesktopConfig desktop_config;
+
+GSettings *xkb_general_settings;
+GSettings *xkb_kbd_settings;
+
+char *
+xci_desc_to_utf8 (XklConfigItem * ci)
+{
+	char *sd = g_strstrip (ci->description);
+	return sd[0] == 0 ? g_strdup (ci->name) : g_strdup (sd);
+}
+
+static void
+set_model_text (GtkWidget * picker, gchar * value)
+{
+	XklConfigItem *ci = xkl_config_item_new ();
+	char *model = NULL;
+
+	if (value != NULL && value[0] != '\0') {
+		model = g_strdup(value);
+	}
+
+	if (model == NULL) {
+		model = g_strdup(initial_config.model);
+		if (model == NULL)
+			model = g_strdup("");
+	}
+
+	g_snprintf (ci->name, sizeof (ci->name), "%s", model);
+
+	if (xkl_config_registry_find_model (config_registry, ci)) {
+		char *d;
+
+		d = xci_desc_to_utf8 (ci);
+		gtk_button_set_label (GTK_BUTTON (picker), d);
+		g_free (d);
+	} else {
+		gtk_button_set_label (GTK_BUTTON (picker), _("Unknown"));
+	}
+	g_object_unref (G_OBJECT (ci));
+	g_free (model);
+}
+
+static void
+model_key_changed (GSettings * settings, gchar * key, GtkBuilder * dialog)
+{
+	set_model_text (WID ("xkb_model_pick"),
+			g_settings_get_string (settings, key));
+
+	enable_disable_restoring (dialog);
+}
+
+static void
+setup_model_entry (GtkBuilder * dialog)
+{
+	gchar *value;
+
+	value = g_settings_get_string (xkb_kbd_settings, "model");
+	set_model_text (WID ("xkb_model_pick"), value);
+	if (value != NULL)
+		g_free (value);
+
+	g_signal_connect (xkb_kbd_settings,
+					  "changed::model",
+					  G_CALLBACK (model_key_changed),
+					  dialog);
+}
+
+static void
+cleanup_xkb_tabs (GtkBuilder * dialog)
+{
+	matekbd_desktop_config_term (&desktop_config);
+	matekbd_keyboard_config_term (&initial_config);
+	g_object_unref (G_OBJECT (config_registry));
+	config_registry = NULL;
+	g_object_unref (G_OBJECT (engine));
+	engine = NULL;
+	g_object_unref (G_OBJECT (xkb_kbd_settings));
+	xkb_kbd_settings = NULL;
+	g_object_unref (G_OBJECT (xkb_general_settings));
+	xkb_general_settings = NULL;
+}
+
+static void
+reset_to_defaults (GtkWidget * button, GtkBuilder * dialog)
+{
+	MatekbdKeyboardConfig empty_kbd_config;
+
+	matekbd_keyboard_config_init (&empty_kbd_config, engine);
+	matekbd_keyboard_config_save_to_gsettings (&empty_kbd_config);
+	matekbd_keyboard_config_term (&empty_kbd_config);
+
+	g_settings_reset (xkb_general_settings, "default-group");
+
+	/* all the rest is g-s-d's business */
+}
+
+static void
+chk_separate_group_per_window_toggled (GSettings * settings,
+				       gchar * key,
+				       GtkBuilder * dialog)
+{
+	gtk_widget_set_sensitive (WID ("chk_new_windows_inherit_layout"),
+				  g_settings_get_boolean (settings, key));
+}
+
+static void
+chk_new_windows_inherit_layout_toggled (GtkWidget *
+					chk_new_windows_inherit_layout,
+					GtkBuilder * dialog)
+{
+	xkb_save_default_group (gtk_toggle_button_get_active
+				(GTK_TOGGLE_BUTTON
+				 (chk_new_windows_inherit_layout)) ? -1 :
+				0);
+}
+
+void
+setup_xkb_tabs (GtkBuilder * dialog)
+{
+	GtkWidget *chk_new_windows_inherit_layout =
+	    WID ("chk_new_windows_inherit_layout");
+
+	xkb_general_settings = g_settings_new (XKB_GENERAL_SCHEMA);
+	xkb_kbd_settings = g_settings_new (XKB_KBD_SCHEMA);
+
+	engine = xkl_engine_get_instance (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()));
+	config_registry = xkl_config_registry_get_instance (engine);
+
+	matekbd_desktop_config_init (&desktop_config, engine);
+	matekbd_desktop_config_load_from_gsettings (&desktop_config);
+
+	xkl_config_registry_load (config_registry, desktop_config.load_extra_items);
+
+	matekbd_keyboard_config_init (&initial_config, engine);
+	matekbd_keyboard_config_load_from_x_initial (&initial_config, NULL);
+
+	setup_model_entry (dialog);
+
+	g_settings_bind (xkb_general_settings,
+					 "group-per-window",
+					 WID ("chk_separate_group_per_window"),
+					 "active",
+					 G_SETTINGS_BIND_DEFAULT);
+
+	g_signal_connect (xkb_general_settings,
+					 "changed::group-per-window",
+					 G_CALLBACK (chk_separate_group_per_window_toggled),
+					 dialog);
+
+#ifdef HAVE_X11_EXTENSIONS_XKB_H
+	if (strcmp (xkl_engine_get_backend_name (engine), "XKB"))
+#endif
+		gtk_widget_hide (WID ("xkb_layouts_print"));
+
+	xkb_layouts_prepare_selected_tree (dialog);
+	xkb_layouts_fill_selected_tree (dialog);
+
+	gtk_widget_set_sensitive (chk_new_windows_inherit_layout,
+				  gtk_toggle_button_get_active
+				  (GTK_TOGGLE_BUTTON
+				   (WID
+				    ("chk_separate_group_per_window"))));
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
+				      (chk_new_windows_inherit_layout),
+				      xkb_get_default_group () < 0);
+
+	xkb_layouts_register_buttons_handlers (dialog);
+	g_signal_connect (gtk_builder_get_object (dialog, "xkb_reset_to_defaults"), "clicked",
+	                  G_CALLBACK (reset_to_defaults),
+	                  dialog);
+
+	g_signal_connect (chk_new_windows_inherit_layout, "toggled",
+	                  (GCallback) chk_new_windows_inherit_layout_toggled,
+	                  dialog);
+
+	g_signal_connect_swapped (gtk_builder_get_object (dialog, "xkb_layout_options"), "clicked",
+	                          G_CALLBACK (xkb_options_popup_dialog),
+	                          dialog);
+
+	g_signal_connect_swapped (gtk_builder_get_object (dialog, "xkb_model_pick"), "clicked",
+	                          G_CALLBACK (choose_model),
+	                          dialog);
+
+	xkb_layouts_register_gsettings_listener (dialog);
+	xkb_options_register_gsettings_listener (dialog);
+
+	g_signal_connect (gtk_builder_get_object (dialog, "keyboard_dialog"), "destroy",
+	                  G_CALLBACK (cleanup_xkb_tabs),
+	                  dialog);
+
+	enable_disable_restoring (dialog);
+}
+
+void
+enable_disable_restoring (GtkBuilder * dialog)
+{
+	MatekbdKeyboardConfig gswic;
+	gboolean enable;
+
+	matekbd_keyboard_config_init (&gswic, engine);
+	matekbd_keyboard_config_load_from_gsettings (&gswic, NULL);
+
+	enable = !matekbd_keyboard_config_equals (&gswic, &initial_config);
+
+	matekbd_keyboard_config_term (&gswic);
+	gtk_widget_set_sensitive (WID ("xkb_reset_to_defaults"), enable);
+}
+
+static void
+xkb_save_gslist_as_strv (gchar *schema, gchar *key, GSList *list)
+{
+	GSettings *settings;
+	GArray *array;
+	GSList *l;
+	array = g_array_new (TRUE, TRUE, sizeof (gchar *));
+	for (l = list; l; l = l->next) {
+		array = g_array_append_val (array, l->data);
+	}
+	settings = g_settings_new (schema);
+	g_settings_set_strv (settings, key, (const gchar **) array->data);
+	g_array_free (array, TRUE);
+	g_object_unref (settings);
+}
+
+void
+xkb_layouts_set_selected_list(GSList *list)
+{
+	xkb_save_gslist_as_strv (XKB_KBD_SCHEMA, "layouts", list);
+}
+
+void
+xkb_options_set_selected_list(GSList *list)
+{
+	xkb_save_gslist_as_strv (XKB_KBD_SCHEMA, "options", list);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/64.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/64.html new file mode 100644 index 00000000..b9cbc02d --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/64.html @@ -0,0 +1,429 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/* -*- mode: c; style: linux -*- */
+
+/* mate-keyboard-properties-xkb.h
+ * Copyright (C) 2003-2007 Sergey V Udaltsov
+ *
+ * Written by Sergey V. Udaltsov <svu@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, 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 __MATE_KEYBOARD_PROPERTY_XKB_H
+#define __MATE_KEYBOARD_PROPERTY_XKB_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 "libmatekbd/matekbd-keyboard-config.h"<--- Include file: "libmatekbd/matekbd-keyboard-config.h" not found.
+
+G_BEGIN_DECLS
+
+#define CWID(s) GTK_WIDGET (gtk_builder_get_object (chooser_dialog, s))
+extern XklEngine *engine;
+extern XklConfigRegistry *config_registry;
+extern GSettings *xkb_kbd_settings;
+extern GSettings *xkb_general_settings;
+extern MatekbdKeyboardConfig initial_config;
+
+extern void setup_xkb_tabs (GtkBuilder * dialog);
+
+extern void xkb_layouts_fill_selected_tree (GtkBuilder * dialog);
+
+extern void xkb_layouts_register_buttons_handlers (GtkBuilder * dialog);
+
+extern void xkb_layouts_register_gsettings_listener (GtkBuilder * dialog);
+
+extern void xkb_options_register_gsettings_listener (GtkBuilder * dialog);
+
+extern void xkb_layouts_prepare_selected_tree (GtkBuilder * dialog);
+
+extern void xkb_options_load_options (GtkBuilder * dialog);
+
+extern void xkb_options_popup_dialog (GtkBuilder * dialog);
+
+extern void clear_xkb_elements_list (GSList * list);
+
+extern char *xci_desc_to_utf8 (XklConfigItem * ci);
+
+extern gchar *xkb_layout_description_utf8 (const gchar * visible);
+
+extern void enable_disable_restoring (GtkBuilder * dialog);
+
+extern void preview_toggled (GtkBuilder * dialog, GtkWidget * button);
+
+extern void choose_model (GtkBuilder * dialog);
+
+extern void xkb_layout_choose (GtkBuilder * dialog);
+
+extern GSList *xkb_layouts_get_selected_list (void);
+
+extern GSList *xkb_options_get_selected_list (void);
+
+extern void xkb_layouts_set_selected_list(GSList *list);
+
+extern void xkb_options_set_selected_list(GSList *list);
+
+extern GtkWidget *xkb_layout_preview_create_widget (GtkBuilder *
+						    chooser_dialog);
+
+extern void xkb_layout_preview_update (GtkBuilder * chooser_dialog);
+
+extern void xkb_layout_preview_set_drawing_layout (GtkWidget * kbdraw,
+						   const gchar * id);
+
+extern gchar *xkb_layout_chooser_get_selected_id (GtkBuilder *
+						  chooser_dialog);
+
+extern void xkb_save_default_group (gint group_no);
+
+extern gint xkb_get_default_group (void);
+
+G_END_DECLS
+
+#endif /* __MATE_KEYBOARD_PROPERTY_XKB_H */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/65.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/65.html new file mode 100644 index 00000000..b166c02c --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/65.html @@ -0,0 +1,1175 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- mode: c; style: linux -*- */
+
+/* mate-keyboard-properties-xkblt.c
+ * Copyright (C) 2003-2007 Sergey V. Udaltsov
+ *
+ * Written by: Sergey V. Udaltsov <svu@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, 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/gdkx.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.
+
+#include <libmatekbd/matekbd-desktop-config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libmatekbd/matekbd-keyboard-drawing.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+#include "mate-keyboard-properties-xkb.h"
+
+#define SEL_LAYOUT_TREE_COL_DESCRIPTION 0
+#define SEL_LAYOUT_TREE_COL_ID 1
+#define SEL_LAYOUT_TREE_COL_ENABLED 2
+
+static int idx2select = -1;
+static int max_selected_layouts = -1;
+static int default_group = -1;
+
+static GtkCellRenderer *text_renderer;
+
+static gboolean disable_buttons_sensibility_update = FALSE;
+
+void
+clear_xkb_elements_list (GSList * list)
+{
+	while (list != NULL) {
+		GSList *p = list;
+		list = list->next;
+		g_free (p->data);
+		g_slist_free_1 (p);
+	}
+}
+
+static gint
+find_selected_layout_idx (GtkBuilder * dialog)
+{
+	GtkTreeSelection *selection =
+	    gtk_tree_view_get_selection (GTK_TREE_VIEW
+					 (WID ("xkb_layouts_selected")));
+	GtkTreeIter selected_iter;
+	GtkTreeModel *model;
+	GtkTreePath *path;
+	gint *indices;<--- Variable 'indices' can be declared as pointer to const
+	gint rv;
+
+	if (!gtk_tree_selection_get_selected
+	    (selection, &model, &selected_iter))
+		return -1;
+
+	path = gtk_tree_model_get_path (model, &selected_iter);
+	if (path == NULL)
+		return -1;
+
+	indices = gtk_tree_path_get_indices (path);
+	rv = indices[0];
+	gtk_tree_path_free (path);
+	return rv;
+}
+
+GSList *
+xkb_layouts_get_selected_list (void)
+{
+	gchar **array;
+	GSList *retval = NULL;
+	gint i;
+	array = g_settings_get_strv (xkb_kbd_settings, "layouts");
+	if (array != NULL) {
+		for (i = 0; array[i]; i++) {
+			retval = g_slist_append (retval, g_strdup (array[i]));
+		}
+	}
+	g_strfreev (array);
+
+	if (retval == NULL) {
+		if (initial_config.layouts_variants != NULL) {
+			for (i = 0; initial_config.layouts_variants[i] != NULL; i++)
+				retval =
+				    g_slist_prepend (retval, g_strdup (initial_config.layouts_variants[i]));
+		}
+		retval = g_slist_reverse (retval);
+	}
+
+	return retval;
+}
+
+gint
+xkb_get_default_group ()
+{
+	return g_settings_get_int (xkb_general_settings, "default-group");
+}
+
+void
+xkb_save_default_group (gint default_group)
+{
+	if (default_group != xkb_get_default_group ())
+		g_settings_set_int (xkb_general_settings, "default-group", default_group);
+}
+
+static void
+xkb_layouts_enable_disable_buttons (GtkBuilder * dialog)
+{
+	GtkWidget *add_layout_btn = WID ("xkb_layouts_add");
+	GtkWidget *show_layout_btn = WID ("xkb_layouts_show");
+	GtkWidget *del_layout_btn = WID ("xkb_layouts_remove");
+	GtkWidget *selected_layouts_tree = WID ("xkb_layouts_selected");
+	GtkWidget *move_up_layout_btn = WID ("xkb_layouts_move_up");
+	GtkWidget *move_down_layout_btn = WID ("xkb_layouts_move_down");
+
+	GtkTreeSelection *s_selection =
+	    gtk_tree_view_get_selection (GTK_TREE_VIEW
+					 (selected_layouts_tree));
+	const int n_selected_selected_layouts =
+	    gtk_tree_selection_count_selected_rows (s_selection);
+	GtkTreeModel *selected_layouts_model = gtk_tree_view_get_model
+	    (GTK_TREE_VIEW (selected_layouts_tree));
+	const int n_selected_layouts =
+	    gtk_tree_model_iter_n_children (selected_layouts_model,
+					    NULL);
+	gint sidx = find_selected_layout_idx (dialog);
+
+	if (disable_buttons_sensibility_update)
+		return;
+
+	gtk_widget_set_sensitive (add_layout_btn,
+				  (n_selected_layouts <
+				   max_selected_layouts
+				   || max_selected_layouts == 0));
+	gtk_widget_set_sensitive (del_layout_btn, (n_selected_layouts > 1)
+				  && (n_selected_selected_layouts > 0));
+	gtk_widget_set_sensitive (show_layout_btn,
+				  (n_selected_selected_layouts > 0));
+	gtk_widget_set_sensitive (move_up_layout_btn, sidx > 0);
+	gtk_widget_set_sensitive (move_down_layout_btn, sidx >= 0
+				  && sidx < (n_selected_layouts - 1));
+}
+
+static void
+xkb_layouts_dnd_data_get (GtkWidget * widget, GdkDragContext * dc,
+			  GtkSelectionData * selection_data, guint info,
+			  guint t, GtkBuilder * dialog)
+{
+	/* Storing the value into selection -
+	 * while it is actually not used
+	 */
+	gint idx = find_selected_layout_idx (dialog);
+	gtk_selection_data_set (selection_data,
+				GDK_SELECTION_TYPE_INTEGER, 32,
+				(guchar *) & idx, sizeof (idx));
+}
+
+static void
+xkb_layouts_dnd_data_received (GtkWidget * widget, GdkDragContext * dc,
+			       gint x, gint y,
+			       GtkSelectionData * selection_data,
+			       guint info, guint t, GtkBuilder * dialog)
+{
+	gint sidx = find_selected_layout_idx (dialog);
+	GtkWidget *tree_view = WID ("xkb_layouts_selected");
+	GtkTreePath *path = NULL;
+	GtkTreeViewDropPosition pos;
+	gint didx;
+	gchar *id;
+	GSList *layouts_list;
+	GSList *node2Remove;
+
+	if (sidx == -1)
+		return;
+
+	layouts_list = xkb_layouts_get_selected_list ();
+	node2Remove = g_slist_nth (layouts_list, sidx);
+
+	id = (gchar *) node2Remove->data;
+	layouts_list = g_slist_delete_link (layouts_list, node2Remove);
+
+	if (!gtk_tree_view_get_dest_row_at_pos
+	    (GTK_TREE_VIEW (tree_view), x, y, &path, &pos)) {
+		/* Move to the very end */
+		layouts_list =
+		    g_slist_append (layouts_list, g_strdup (id));
+		xkb_layouts_set_selected_list (layouts_list);
+	} else if (path != NULL) {
+		gint *indices = gtk_tree_path_get_indices (path);<--- Variable 'indices' can be declared as pointer to const
+		didx = indices[0];
+		gtk_tree_path_free (path);
+		/* Move to the new position */
+		if (sidx != didx) {
+			layouts_list =
+			    g_slist_insert (layouts_list, g_strdup (id),
+					    didx);
+			xkb_layouts_set_selected_list (layouts_list);
+		}
+	}
+	g_free (id);
+	clear_xkb_elements_list (layouts_list);
+}
+
+void
+xkb_layouts_prepare_selected_tree (GtkBuilder * dialog)
+{
+	GtkListStore *list_store =
+	    gtk_list_store_new (3, G_TYPE_STRING, G_TYPE_STRING,
+				G_TYPE_BOOLEAN);
+	GtkWidget *tree_view = WID ("xkb_layouts_selected");
+	GtkTreeSelection *selection;
+	GtkTargetEntry self_drag_target =
+	    { "xkb_layouts_selected", GTK_TARGET_SAME_WIDGET, 0 };
+	GtkTreeViewColumn *desc_column;
+
+	text_renderer = GTK_CELL_RENDERER (gtk_cell_renderer_text_new ());
+
+	desc_column =
+	    gtk_tree_view_column_new_with_attributes (_("Layout"),
+						      text_renderer,
+						      "text",
+						      SEL_LAYOUT_TREE_COL_DESCRIPTION,
+						      "sensitive",
+						      SEL_LAYOUT_TREE_COL_ENABLED,
+						      NULL);
+	selection =
+	    gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
+
+	gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view),
+				 GTK_TREE_MODEL (list_store));
+
+	gtk_tree_view_column_set_sizing (desc_column,
+					 GTK_TREE_VIEW_COLUMN_AUTOSIZE);
+	gtk_tree_view_column_set_resizable (desc_column, TRUE);
+	gtk_tree_view_column_set_expand (desc_column, TRUE);
+
+	gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view),
+				     desc_column);
+
+	g_signal_connect_swapped (selection, "changed",
+	                          G_CALLBACK(xkb_layouts_enable_disable_buttons),
+	                          dialog);
+	max_selected_layouts = xkl_engine_get_max_num_groups (engine);
+
+	/* Setting up DnD */
+	gtk_drag_source_set (tree_view, GDK_BUTTON1_MASK,
+			     &self_drag_target, 1, GDK_ACTION_MOVE);
+	gtk_drag_source_set_icon_name (tree_view, "input-keyboard");
+	gtk_drag_dest_set (tree_view, GTK_DEST_DEFAULT_ALL,
+			   &self_drag_target, 1, GDK_ACTION_MOVE);
+
+	g_signal_connect (tree_view, "drag_data_get",
+	                  G_CALLBACK (xkb_layouts_dnd_data_get),
+	                  dialog);
+	g_signal_connect (tree_view, "drag_data_received",
+	                  G_CALLBACK (xkb_layouts_dnd_data_received),
+	                  dialog);
+}
+
+gchar *
+xkb_layout_description_utf8 (const gchar * visible)
+{
+	char *l, *sl, *v, *sv;
+	if (matekbd_keyboard_config_get_descriptions
+	    (config_registry, visible, &sl, &l, &sv, &v))
+		visible = matekbd_keyboard_config_format_full_layout (l, v);
+	return g_strstrip (g_strdup (visible));
+}
+
+void
+xkb_layouts_fill_selected_tree (GtkBuilder * dialog)
+{
+	GSList *layouts = xkb_layouts_get_selected_list ();
+	GSList *cur_layout;
+	GtkListStore *list_store =
+	    GTK_LIST_STORE (gtk_tree_view_get_model
+			    (GTK_TREE_VIEW
+			     (WID ("xkb_layouts_selected"))));
+	int counter = 0;
+
+	/* temporarily disable the buttons' status update */
+	disable_buttons_sensibility_update = TRUE;
+
+	gtk_list_store_clear (list_store);
+
+	for (cur_layout = layouts; cur_layout != NULL;
+	     cur_layout = cur_layout->next, counter++) {
+		GtkTreeIter iter;
+		const char *visible = (char *) cur_layout->data;
+		gchar *utf_visible = xkb_layout_description_utf8 (visible);
+		gtk_list_store_append (list_store, &iter);
+		gtk_list_store_set (list_store, &iter,
+				    SEL_LAYOUT_TREE_COL_DESCRIPTION,
+				    utf_visible,
+				    SEL_LAYOUT_TREE_COL_ID,
+				    cur_layout->data,
+				    SEL_LAYOUT_TREE_COL_ENABLED,
+				    counter < max_selected_layouts, -1);
+		g_free (utf_visible);
+	}
+
+	clear_xkb_elements_list (layouts);
+
+	/* enable the buttons' status update */
+	disable_buttons_sensibility_update = FALSE;
+
+	if (idx2select != -1) {
+		GtkTreeSelection *selection =
+		    gtk_tree_view_get_selection ((GTK_TREE_VIEW
+						  (WID
+						   ("xkb_layouts_selected"))));
+		GtkTreePath *path =
+		    gtk_tree_path_new_from_indices (idx2select, -1);
+		gtk_tree_selection_select_path (selection, path);
+		gtk_tree_path_free (path);
+		idx2select = -1;
+	} else {
+		/* if there is nothing to select - just enable/disable the buttons,
+		   otherwise it would be done by the selection change */
+		xkb_layouts_enable_disable_buttons (dialog);
+	}
+}
+
+static void
+add_selected_layout (GtkWidget * button, GtkBuilder * dialog)
+{
+	xkb_layout_choose (dialog);
+}
+
+static void
+show_selected_layout (GtkWidget * button, GtkBuilder * dialog)
+{
+	gint idx = find_selected_layout_idx (dialog);
+
+	if (idx != -1) {
+		GSList *layouts_list = xkb_layouts_get_selected_list ();
+		const gchar *id = g_slist_nth_data (layouts_list, idx);
+		char *descr = xkb_layout_description_utf8 (id);
+		matekbd_keyboard_drawing_new_dialog (idx, descr);
+		clear_xkb_elements_list (layouts_list);
+		g_free (descr);
+	}
+}
+
+static void
+remove_selected_layout (GtkWidget * button, GtkBuilder * dialog)
+{
+	gint idx = find_selected_layout_idx (dialog);
+
+	if (idx != -1) {
+		GSList *layouts_list = xkb_layouts_get_selected_list ();
+		char *id = NULL;
+		GSList *node2Remove = g_slist_nth (layouts_list, idx);
+
+		layouts_list =
+		    g_slist_remove_link (layouts_list, node2Remove);
+
+		id = (char *) node2Remove->data;
+		g_slist_free_1 (node2Remove);
+		g_free (id);
+
+		if (default_group > idx)
+			xkb_save_default_group (default_group - 1);
+		else if (default_group == idx)
+			xkb_save_default_group (-1);
+
+		xkb_layouts_set_selected_list (layouts_list);
+		clear_xkb_elements_list (layouts_list);
+	}
+}
+
+static void
+move_up_selected_layout (GtkWidget * button, GtkBuilder * dialog)
+{
+	gint idx = find_selected_layout_idx (dialog);
+
+	if (idx != -1) {
+		GSList *layouts_list = xkb_layouts_get_selected_list ();
+		GSList *node2Remove = g_slist_nth (layouts_list, idx);
+
+		layouts_list =
+		    g_slist_remove_link (layouts_list, node2Remove);
+		layouts_list =
+		    g_slist_insert (layouts_list, node2Remove->data,
+				    idx - 1);
+		g_slist_free_1 (node2Remove);
+
+		idx2select = idx - 1;
+		xkb_layouts_set_selected_list (layouts_list);
+		clear_xkb_elements_list (layouts_list);
+	}
+}
+
+static void
+move_down_selected_layout (GtkWidget * button, GtkBuilder * dialog)
+{
+	gint idx = find_selected_layout_idx (dialog);
+
+	if (idx != -1) {
+		GSList *layouts_list = xkb_layouts_get_selected_list ();
+		GSList *node2Remove = g_slist_nth (layouts_list, idx);
+
+		layouts_list =
+		    g_slist_remove_link (layouts_list, node2Remove);
+		layouts_list =
+		    g_slist_insert (layouts_list, node2Remove->data,
+				    idx + 1);
+		g_slist_free_1 (node2Remove);
+
+		idx2select = idx + 1;
+		xkb_layouts_set_selected_list (layouts_list);
+		clear_xkb_elements_list (layouts_list);
+	}
+}
+
+void
+xkb_layouts_register_buttons_handlers (GtkBuilder * dialog)
+{
+	g_signal_connect (gtk_builder_get_object (dialog, "xkb_layouts_add"), "clicked",
+	                  G_CALLBACK (add_selected_layout),
+	                  dialog);
+	g_signal_connect (gtk_builder_get_object (dialog, "xkb_layouts_show"), "clicked",
+	                  G_CALLBACK (show_selected_layout),
+	                  dialog);
+	g_signal_connect (gtk_builder_get_object (dialog, "xkb_layouts_remove"), "clicked",
+	                  G_CALLBACK (remove_selected_layout),
+	                  dialog);
+	g_signal_connect (gtk_builder_get_object (dialog, "xkb_layouts_move_up"), "clicked",
+	                  G_CALLBACK (move_up_selected_layout),
+	                  dialog);
+	g_signal_connect (gtk_builder_get_object (dialog, "xkb_layouts_move_down"), "clicked",
+	                  G_CALLBACK (move_down_selected_layout),
+	                  dialog);
+}
+
+static void
+xkb_layouts_update_list (GSettings * settings, gchar * key, GtkBuilder * dialog)
+{
+	xkb_layouts_fill_selected_tree (dialog);
+	enable_disable_restoring (dialog);
+}
+
+void
+xkb_layouts_register_gsettings_listener (GtkBuilder * dialog)
+{
+	g_signal_connect (xkb_kbd_settings, "changed::layouts",
+	                  G_CALLBACK (xkb_layouts_update_list),
+	                  dialog);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/66.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/66.html new file mode 100644 index 00000000..c5c105d5 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/66.html @@ -0,0 +1,1335 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- mode: c; style: linux -*- */
+
+/* mate-keyboard-properties-xkbltadd.c
+ * Copyright (C) 2007 Sergey V. Udaltsov
+ *
+ * Written by: Sergey V. Udaltsov <svu@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, 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 <libmatekbd/matekbd-keyboard-drawing.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libmatekbd/matekbd-util.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+#include "mate-keyboard-properties-xkb.h"
+
+enum {
+	COMBO_BOX_MODEL_COL_SORT,
+	COMBO_BOX_MODEL_COL_VISIBLE,
+	COMBO_BOX_MODEL_COL_XKB_ID,
+	COMBO_BOX_MODEL_COL_REAL_ID
+};
+
+typedef void (*LayoutIterFunc) (XklConfigRegistry * config,
+				ConfigItemProcessFunc func, gpointer data);
+
+typedef struct {
+	GtkListStore *list_store;
+	const gchar *lang_id;
+} AddVariantData;
+
+static void
+xkb_layout_chooser_available_layouts_fill (GtkBuilder * chooser_dialog,
+					   const gchar cblid[],
+					   const gchar cbvid[],
+					   LayoutIterFunc layout_iterator,
+					   ConfigItemProcessFunc
+					   layout_handler,
+					   GCallback combo_changed_notify);
+
+static void
+xkb_layout_chooser_available_language_variants_fill (GtkBuilder *
+						     chooser_dialog);
+
+static void
+xkb_layout_chooser_available_country_variants_fill (GtkBuilder *
+						    chooser_dialog);
+
+static void
+ xkb_layout_chooser_add_variant_to_available_country_variants
+    (XklConfigRegistry * config_registry,
+     XklConfigItem * parent_config_item, XklConfigItem * config_item,
+     AddVariantData * data) {
+	gchar *utf_variant_name = config_item ?
+	    xkb_layout_description_utf8 (matekbd_keyboard_config_merge_items
+					 (parent_config_item->name,
+					  config_item->name)) :
+	    xci_desc_to_utf8 (parent_config_item);
+	GtkTreeIter iter;
+	const gchar *xkb_id =
+	    config_item ?
+	    matekbd_keyboard_config_merge_items (parent_config_item->name,
+					      config_item->name) :
+	    parent_config_item->name;
+
+	if (config_item && g_object_get_data
+	    (G_OBJECT (config_item), XCI_PROP_EXTRA_ITEM)) {
+		gchar *buf =
+		    g_strdup_printf ("<i>%s</i>", utf_variant_name);
+		gtk_list_store_insert_with_values (data->list_store, &iter,
+						   -1,
+						   COMBO_BOX_MODEL_COL_SORT,
+						   utf_variant_name,
+						   COMBO_BOX_MODEL_COL_VISIBLE,
+						   buf,
+						   COMBO_BOX_MODEL_COL_XKB_ID,
+						   xkb_id, -1);
+		g_free (buf);
+	} else
+		gtk_list_store_insert_with_values (data->list_store, &iter,
+						   -1,
+						   COMBO_BOX_MODEL_COL_SORT,
+						   utf_variant_name,
+						   COMBO_BOX_MODEL_COL_VISIBLE,
+						   utf_variant_name,
+						   COMBO_BOX_MODEL_COL_XKB_ID,
+						   xkb_id, -1);
+	g_free (utf_variant_name);
+}
+
+static void
+ xkb_layout_chooser_add_variant_to_available_language_variants
+    (XklConfigRegistry * config_registry,
+     XklConfigItem * parent_config_item, XklConfigItem * config_item,
+     AddVariantData * data) {
+	xkb_layout_chooser_add_variant_to_available_country_variants
+	    (config_registry, parent_config_item, config_item, data);
+}
+
+static void
+xkb_layout_chooser_add_language_to_available_languages (XklConfigRegistry *
+							config_registry,
+							XklConfigItem *
+							config_item,
+							GtkListStore *
+							list_store)
+{
+	gtk_list_store_insert_with_values (list_store, NULL, -1,
+					   COMBO_BOX_MODEL_COL_SORT,
+					   config_item->description,
+					   COMBO_BOX_MODEL_COL_VISIBLE,
+					   config_item->description,
+					   COMBO_BOX_MODEL_COL_REAL_ID,
+					   config_item->name, -1);
+}
+
+static void
+xkb_layout_chooser_add_country_to_available_countries (XklConfigRegistry *
+						       config_registry,
+						       XklConfigItem *
+						       config_item,
+						       GtkListStore *
+						       list_store)
+{
+	gtk_list_store_insert_with_values (list_store, NULL, -1,
+					   COMBO_BOX_MODEL_COL_SORT,
+					   config_item->description,
+					   COMBO_BOX_MODEL_COL_VISIBLE,
+					   config_item->description,
+					   COMBO_BOX_MODEL_COL_REAL_ID,
+					   config_item->name, -1);
+}
+
+static void
+xkb_layout_chooser_enable_disable_buttons (GtkBuilder * chooser_dialog)
+{
+	GtkWidget *cbv =
+	    CWID (gtk_notebook_get_current_page
+		  (GTK_NOTEBOOK (gtk_builder_get_object (chooser_dialog, "choosers_nb"))) ?
+		  "xkb_language_variants_available" :
+		  "xkb_country_variants_available");
+	GtkTreeIter viter;
+	gboolean enable_ok =
+	    gtk_combo_box_get_active_iter (GTK_COMBO_BOX (cbv),
+					   &viter);
+
+	gtk_dialog_set_response_sensitive (GTK_DIALOG
+					   (CWID
+					    ("xkb_layout_chooser")),
+					   GTK_RESPONSE_OK, enable_ok);
+	gtk_widget_set_sensitive (CWID ("btnPrint"), enable_ok);
+}
+
+static void
+xkb_layout_chooser_available_variant_changed (GtkBuilder * chooser_dialog)
+{
+	xkb_layout_preview_update (chooser_dialog);
+	xkb_layout_chooser_enable_disable_buttons (chooser_dialog);
+}
+
+static void
+xkb_layout_chooser_available_language_changed (GtkBuilder * chooser_dialog)
+{
+	xkb_layout_chooser_available_language_variants_fill
+	    (chooser_dialog);
+	xkb_layout_chooser_available_variant_changed (chooser_dialog);
+}
+
+static void
+xkb_layout_chooser_available_country_changed (GtkBuilder * chooser_dialog)
+{
+	xkb_layout_chooser_available_country_variants_fill
+	    (chooser_dialog);
+	xkb_layout_chooser_available_variant_changed (chooser_dialog);
+}
+
+static void
+xkb_layout_chooser_page_changed (GtkWidget * notebook, GtkWidget * page,
+				 gint page_num,
+				 GtkBuilder * chooser_dialog)
+{
+	xkb_layout_chooser_available_variant_changed (chooser_dialog);
+}
+
+static void
+xkb_layout_chooser_available_language_variants_fill (GtkBuilder *
+						     chooser_dialog)
+{
+	GtkWidget *cbl = CWID ("xkb_languages_available");
+	GtkWidget *cbv = CWID ("xkb_language_variants_available");
+	GtkListStore *list_store;
+	GtkTreeIter liter;
+
+	list_store = gtk_list_store_new
+	    (4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
+	     G_TYPE_STRING);
+
+	if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (cbl), &liter)) {
+		GtkTreeModel *lm =
+		    gtk_combo_box_get_model (GTK_COMBO_BOX (cbl));
+		gchar *lang_id;
+		AddVariantData data = { list_store, 0 };
+
+		/* Now the variants of the selected layout */
+		gtk_tree_model_get (lm, &liter,
+				    COMBO_BOX_MODEL_COL_REAL_ID,
+				    &lang_id, -1);
+		data.lang_id = lang_id;
+
+		xkl_config_registry_foreach_language_variant
+		    (config_registry, lang_id, (TwoConfigItemsProcessFunc)
+		     xkb_layout_chooser_add_variant_to_available_language_variants,
+		     &data);
+		g_free (lang_id);
+	}
+
+	/* Turn on sorting after filling the store, since that's faster */
+	gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE
+					      (list_store),
+					      COMBO_BOX_MODEL_COL_SORT,
+					      GTK_SORT_ASCENDING);
+
+	gtk_combo_box_set_model (GTK_COMBO_BOX (cbv),
+				 GTK_TREE_MODEL (list_store));
+	gtk_combo_box_set_active (GTK_COMBO_BOX (cbv), 0);
+}
+
+static void
+xkb_layout_chooser_available_country_variants_fill (GtkBuilder *
+						    chooser_dialog)
+{
+	GtkWidget *cbl = CWID ("xkb_countries_available");
+	GtkWidget *cbv = CWID ("xkb_country_variants_available");
+	GtkListStore *list_store;
+	GtkTreeIter liter;
+
+	list_store = gtk_list_store_new
+	    (4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
+	     G_TYPE_STRING);
+
+	if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (cbl), &liter)) {
+		GtkTreeModel *lm =
+		    gtk_combo_box_get_model (GTK_COMBO_BOX (cbl));
+		gchar *country_id;
+		AddVariantData data = { list_store, 0 };
+
+		/* Now the variants of the selected layout */
+		gtk_tree_model_get (lm, &liter,
+				    COMBO_BOX_MODEL_COL_REAL_ID,
+				    &country_id, -1);
+		xkl_config_registry_foreach_country_variant
+		    (config_registry, country_id,
+		     (TwoConfigItemsProcessFunc)
+		     xkb_layout_chooser_add_variant_to_available_country_variants,
+		     &data);
+		g_free (country_id);
+	}
+
+	/* Turn on sorting after filling the store, since that's faster */
+	gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE
+					      (list_store),
+					      COMBO_BOX_MODEL_COL_SORT,
+					      GTK_SORT_ASCENDING);
+
+	gtk_combo_box_set_model (GTK_COMBO_BOX (cbv),
+				 GTK_TREE_MODEL (list_store));
+	gtk_combo_box_set_active (GTK_COMBO_BOX (cbv), 0);
+}
+
+static void
+xkb_layout_chooser_available_layouts_fill (GtkBuilder *
+					   chooser_dialog,
+					   const gchar cblid[],
+					   const gchar cbvid[],
+					   LayoutIterFunc layout_iterator,
+					   ConfigItemProcessFunc
+					   layout_handler,
+					   GCallback combo_changed_notify)
+{
+	GtkWidget *cbl = CWID (cblid);
+	GtkWidget *cbev = CWID (cbvid);
+	GtkCellRenderer *renderer;
+	GtkListStore *list_store;
+
+	list_store = gtk_list_store_new
+	    (4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
+	     G_TYPE_STRING);
+
+	gtk_combo_box_set_model (GTK_COMBO_BOX (cbl),
+				 GTK_TREE_MODEL (list_store));
+
+	renderer = gtk_cell_renderer_text_new ();
+	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (cbl), renderer, TRUE);
+	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (cbl),
+					renderer, "markup",
+					COMBO_BOX_MODEL_COL_VISIBLE, NULL);
+
+	layout_iterator (config_registry, layout_handler, list_store);
+
+	/* Turn on sorting after filling the model since that's faster */
+	gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE
+					      (list_store),
+					      COMBO_BOX_MODEL_COL_SORT,
+					      GTK_SORT_ASCENDING);
+
+	g_signal_connect_swapped (cbl, "changed",
+	                          G_CALLBACK (combo_changed_notify),
+	                          chooser_dialog);
+
+	/* Setup the variants combo */
+	renderer = gtk_cell_renderer_text_new ();
+	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (cbev),
+				    renderer, TRUE);
+	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (cbev),
+					renderer, "markup",
+					COMBO_BOX_MODEL_COL_VISIBLE, NULL);
+
+	g_signal_connect_swapped (cbev, "changed",
+	                          G_CALLBACK(xkb_layout_chooser_available_variant_changed),
+	                          chooser_dialog);
+}
+
+static gchar **
+xkb_layout_strv_from_gslist (GSList *list)
+{
+    GArray *array;
+    GSList *l;
+    array = g_array_new (TRUE, TRUE, sizeof (gchar *));
+    for (l = list; l; l = l->next) {
+        array = g_array_append_val (array, l->data);
+    }
+    return (gchar **) array->data;
+}
+
+static void
+xkl_layout_chooser_add_default_switcher_if_necessary (GSList *
+						      layouts_list)
+{
+	GSList *options_list = xkb_options_get_selected_list ();
+	gboolean was_appended;
+
+	gchar **layouts_list_strv = xkb_layout_strv_from_gslist (layouts_list);
+	gchar **options_list_strv = xkb_layout_strv_from_gslist (options_list);
+
+	options_list_strv =
+	    matekbd_keyboard_config_add_default_switch_option_if_necessary
+		(layouts_list_strv, options_list_strv, &was_appended);
+	if (was_appended) {
+		xkb_options_set_selected_list (options_list);
+
+	}
+	clear_xkb_elements_list (options_list);
+}
+
+static void
+xkb_layout_chooser_print (GtkBuilder * chooser_dialog)
+{
+	GtkWidget *chooser = CWID ("xkb_layout_chooser");
+	GtkWidget *kbdraw =
+	    GTK_WIDGET (g_object_get_data (G_OBJECT (chooser), "kbdraw"));
+	const char *id =
+	    xkb_layout_chooser_get_selected_id (chooser_dialog);
+	char *descr = xkb_layout_description_utf8 (id);
+	matekbd_keyboard_drawing_print (MATEKBD_KEYBOARD_DRAWING
+				     (kbdraw),
+				     GTK_WINDOW (CWID
+						 ("xkb_layout_chooser")),
+				     descr);
+	g_free (descr);
+}
+
+static void
+xkb_layout_chooser_response (GtkDialog * dialog,
+			     gint response, GtkBuilder * chooser_dialog)
+{
+	GdkRectangle rect;
+
+	if (response == GTK_RESPONSE_OK) {
+		gchar *selected_id = (gchar *)
+		    xkb_layout_chooser_get_selected_id (chooser_dialog);
+
+		if (selected_id != NULL) {
+			GSList *layouts_list =
+			    xkb_layouts_get_selected_list ();
+
+			selected_id = g_strdup (selected_id);
+
+			layouts_list =
+			    g_slist_append (layouts_list, selected_id);
+			xkb_layouts_set_selected_list (layouts_list);
+
+			xkl_layout_chooser_add_default_switcher_if_necessary
+			    (layouts_list);
+
+			clear_xkb_elements_list (layouts_list);
+		}
+	} else if (response == gtk_dialog_get_response_for_widget
+		   (dialog, CWID ("btnPrint"))) {
+		xkb_layout_chooser_print (chooser_dialog);
+		g_signal_stop_emission_by_name (dialog, "response");
+		return;
+	}
+
+	gtk_window_get_position (GTK_WINDOW (dialog), &rect.x, &rect.y);
+	gtk_window_get_size (GTK_WINDOW (dialog), &rect.width,
+			     &rect.height);
+	matekbd_preview_save_position (&rect);
+}
+
+void
+xkb_layout_choose (GtkBuilder * dialog)
+{
+	GtkBuilder *chooser_dialog;
+
+	chooser_dialog = gtk_builder_new ();
+	gtk_builder_add_from_resource (chooser_dialog,
+				       "/org/mate/mcc/keyboard/mate-keyboard-properties-layout-chooser.ui",
+				       NULL);
+	GtkWidget *chooser = CWID ("xkb_layout_chooser");
+	GtkWidget *lang_chooser = CWID ("xkb_languages_available");
+	GtkWidget *notebook = CWID ("choosers_nb");
+	GtkWidget *kbdraw = NULL;<--- Variable 'kbdraw' can be declared as pointer to const<--- Variable 'kbdraw' is assigned a value that is never used.
+	GtkWidget *toplevel = NULL;
+
+	gtk_window_set_transient_for (GTK_WINDOW (chooser),
+				      GTK_WINDOW (WID
+						  ("keyboard_dialog")));
+
+	xkb_layout_chooser_available_layouts_fill (chooser_dialog,
+						   "xkb_countries_available",
+						   "xkb_country_variants_available",
+						   xkl_config_registry_foreach_country,
+						   (ConfigItemProcessFunc)
+						   xkb_layout_chooser_add_country_to_available_countries,
+						   G_CALLBACK
+						   (xkb_layout_chooser_available_country_changed));
+	xkb_layout_chooser_available_layouts_fill (chooser_dialog,
+						   "xkb_languages_available",
+						   "xkb_language_variants_available",
+						   xkl_config_registry_foreach_language,
+						   (ConfigItemProcessFunc)
+						   xkb_layout_chooser_add_language_to_available_languages,
+						   G_CALLBACK
+						   (xkb_layout_chooser_available_language_changed));
+
+	g_signal_connect_after (notebook, "switch_page",
+	                        G_CALLBACK(xkb_layout_chooser_page_changed),
+	                        chooser_dialog);
+
+	gtk_combo_box_set_active (GTK_COMBO_BOX
+				  (CWID ("xkb_countries_available")),
+				  FALSE);
+
+	if (gtk_tree_model_iter_n_children
+	    (gtk_combo_box_get_model (GTK_COMBO_BOX (lang_chooser)),
+	     NULL)) {
+		gtk_combo_box_set_active (GTK_COMBO_BOX
+					  (CWID
+					   ("xkb_languages_available")),
+					  FALSE);
+	} else {
+		/* If language info is not available - remove the corresponding tab,
+		   pretend there is no notebook at all */
+		gtk_notebook_remove_page (GTK_NOTEBOOK (notebook), 1);
+		gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook),
+					    FALSE);
+		gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook),
+					      FALSE);
+	}
+
+#ifdef HAVE_X11_EXTENSIONS_XKB_H
+	if (!strcmp (xkl_engine_get_backend_name (engine), "XKB")) {
+		kbdraw = xkb_layout_preview_create_widget (chooser_dialog);
+		g_object_set_data (G_OBJECT (chooser), "kbdraw", kbdraw);
+		gtk_container_add (GTK_CONTAINER
+				   (CWID ("previewFrame")), kbdraw);
+		gtk_widget_show_all (kbdraw);
+		gtk_button_box_set_child_secondary (GTK_BUTTON_BOX
+						    (CWID
+						     ("hbtnBox")),
+						    CWID
+						    ("btnPrint"), TRUE);
+	} else
+#endif
+	{
+		gtk_widget_hide (CWID ("vboxPreview"));
+		gtk_widget_hide (CWID ("btnPrint"));
+	}
+
+	g_signal_connect (chooser, "response",
+	                  G_CALLBACK (xkb_layout_chooser_response),
+	                  chooser_dialog);
+
+	toplevel = gtk_widget_get_toplevel (chooser);
+	if (gtk_widget_is_toplevel (toplevel)) {
+		GdkRectangle *rect = matekbd_preview_load_position ();
+		if (rect != NULL) {
+			gtk_window_move (GTK_WINDOW (toplevel),
+					 rect->x, rect->y);
+			gtk_window_resize (GTK_WINDOW (toplevel),
+					   rect->width, rect->height);
+			g_free (rect);
+		}
+	}
+
+	xkb_layout_preview_update (chooser_dialog);
+	gtk_dialog_run (GTK_DIALOG (chooser));
+	gtk_widget_destroy (chooser);
+}
+
+gchar *
+xkb_layout_chooser_get_selected_id (GtkBuilder * chooser_dialog)
+{
+	GtkWidget *cbv =
+	    CWID (gtk_notebook_get_current_page
+		  (GTK_NOTEBOOK (gtk_builder_get_object (chooser_dialog, "choosers_nb"))) ?
+		  "xkb_language_variants_available" :
+		  "xkb_country_variants_available");
+	GtkTreeModel *vm = gtk_combo_box_get_model (GTK_COMBO_BOX (cbv));
+	GtkTreeIter viter;
+	gchar *v_id;
+
+	if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (cbv), &viter))
+		return NULL;
+
+	gtk_tree_model_get (vm, &viter,
+			    COMBO_BOX_MODEL_COL_XKB_ID, &v_id, -1);
+
+	return v_id;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/67.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/67.html new file mode 100644 index 00000000..7e1b0b7a --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/67.html @@ -0,0 +1,947 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- mode: c; style: linux -*- */
+
+/* mate-keyboard-properties-xkbmc.c
+ * Copyright (C) 2003-2007 Sergey V. Udaltsov
+ *
+ * Written by: Sergey V. Udaltsov <svu@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, 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/gdkx.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.
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+
+#include "mate-keyboard-properties-xkb.h"
+
+static gchar *current_model_name = NULL;
+static gchar *current_vendor_name = NULL;
+
+static void fill_models_list (GtkBuilder * chooser_dialog);
+
+static gboolean fill_vendors_list (GtkBuilder * chooser_dialog);
+
+static GtkTreePath *
+gtk_list_store_find_entry (GtkListStore   *list_store,
+                           GtkTreeIter    *iter,
+                           gchar          *name,
+                           int             column_id)
+{
+	GtkTreeModel *tree_model = GTK_TREE_MODEL (list_store);
+
+	if (!gtk_tree_model_get_iter_first (tree_model, iter))
+		return NULL;
+
+	do {
+		char *current_name;
+		gint  res;
+
+		gtk_tree_model_get (tree_model, iter,
+		                    column_id, &current_name,
+		                    -1);
+		res = g_ascii_strcasecmp (name, current_name);
+		g_free (current_name);
+		if (res == 0) {
+			return gtk_tree_model_get_path (tree_model, iter);
+		}
+	} while (gtk_tree_model_iter_next (tree_model, iter));
+
+	return NULL;
+}
+
+static void
+add_vendor_to_list (XklConfigRegistry * config_registry,
+		    XklConfigItem * config_item,
+		    GtkTreeView * vendors_list)
+{
+	GtkTreeIter iter;
+	GtkTreePath *found_existing;
+	GtkListStore *list_store;
+
+	gchar *vendor_name =
+	    (gchar *) g_object_get_data (G_OBJECT (config_item),
+					 XCI_PROP_VENDOR);
+
+	if (vendor_name == NULL)
+		return;
+
+	list_store =
+	    GTK_LIST_STORE (gtk_tree_view_get_model (vendors_list));
+
+	if (!g_ascii_strcasecmp (config_item->name, current_model_name)) {
+		current_vendor_name = g_strdup (vendor_name);
+	}
+
+	found_existing =
+	    gtk_list_store_find_entry (list_store, &iter, vendor_name, 0);
+	/* This vendor is already there */
+	if (found_existing != NULL) {
+		gtk_tree_path_free (found_existing);
+		return;
+	}
+
+	gtk_list_store_append (list_store, &iter);
+	gtk_list_store_set (list_store, &iter, 0, vendor_name, -1);
+}
+
+static void
+add_model_to_list (XklConfigRegistry * config_registry,
+		   XklConfigItem * config_item, GtkTreeView * models_list)
+{
+	GtkTreeIter iter;
+	GtkListStore *list_store =
+	    GTK_LIST_STORE (gtk_tree_view_get_model (models_list));
+	char *utf_model_name;
+	if (current_vendor_name != NULL) {
+		gchar *vendor_name =
+		    (gchar *) g_object_get_data (G_OBJECT (config_item),
+						 XCI_PROP_VENDOR);
+		if (vendor_name == NULL)
+			return;
+
+		if (g_ascii_strcasecmp (vendor_name, current_vendor_name))
+			return;
+	}
+	utf_model_name = xci_desc_to_utf8 (config_item);
+	gtk_list_store_append (list_store, &iter);
+	gtk_list_store_set (list_store, &iter,
+			    0, utf_model_name, 1, config_item->name, -1);
+
+	g_free (utf_model_name);
+}
+
+static void
+xkb_model_chooser_change_vendor_sel (GtkTreeSelection * selection,
+				     GtkBuilder * chooser_dialog)
+{
+	GtkTreeIter iter;
+	GtkTreeModel *list_store = NULL;
+	if (gtk_tree_selection_get_selected
+	    (selection, &list_store, &iter)) {
+		gchar *vendor_name = NULL;
+		gtk_tree_model_get (list_store, &iter,
+				    0, &vendor_name, -1);
+
+		current_vendor_name = vendor_name;
+		fill_models_list (chooser_dialog);
+		g_free (vendor_name);
+	} else {
+		current_vendor_name = NULL;
+		fill_models_list (chooser_dialog);
+	}
+
+}
+
+static void
+xkb_model_chooser_change_model_sel (GtkTreeSelection * selection,
+				    GtkBuilder * chooser_dialog)
+{
+	gboolean anysel =
+	    gtk_tree_selection_get_selected (selection, NULL, NULL);
+	gtk_dialog_set_response_sensitive (GTK_DIALOG
+					   (CWID ("xkb_model_chooser")),
+					   GTK_RESPONSE_OK, anysel);
+}
+
+static void
+prepare_vendors_list (GtkBuilder * chooser_dialog)
+{
+	GtkWidget *vendors_list = CWID ("vendors_list");
+	GtkCellRenderer *renderer = gtk_cell_renderer_text_new ();
+	GtkTreeViewColumn *vendor_col =
+	    gtk_tree_view_column_new_with_attributes (_("Vendors"),
+						      renderer,
+						      "text", 0,
+						      NULL);
+	gtk_tree_view_column_set_visible (vendor_col, TRUE);
+	gtk_tree_view_append_column (GTK_TREE_VIEW (vendors_list),
+				     vendor_col);
+}
+
+static gboolean
+fill_vendors_list (GtkBuilder * chooser_dialog)
+{
+	GtkWidget *vendors_list = CWID ("vendors_list");
+	GtkListStore *list_store = gtk_list_store_new (1, G_TYPE_STRING);
+	GtkTreeIter iter;
+	GtkTreePath *path;
+
+	gtk_tree_view_set_model (GTK_TREE_VIEW (vendors_list),
+				 GTK_TREE_MODEL (list_store));
+
+	gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE
+					      (list_store), 0,
+					      GTK_SORT_ASCENDING);
+
+	current_vendor_name = NULL;
+
+	xkl_config_registry_foreach_model (config_registry,
+					   (ConfigItemProcessFunc)
+					   add_vendor_to_list,
+					   vendors_list);
+
+	if (current_vendor_name != NULL) {
+		path = gtk_list_store_find_entry (list_store,
+						  &iter,
+						  current_vendor_name, 0);
+		if (path != NULL) {
+			gtk_tree_selection_select_iter
+			    (gtk_tree_view_get_selection
+			     (GTK_TREE_VIEW (vendors_list)), &iter);
+			gtk_tree_view_scroll_to_cell
+			    (GTK_TREE_VIEW (vendors_list),
+			     path, NULL, TRUE, 0.5, 0);
+			gtk_tree_path_free (path);
+		}
+		fill_models_list (chooser_dialog);
+		g_free (current_vendor_name);
+	} else {
+		fill_models_list (chooser_dialog);
+	}
+
+	g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (vendors_list)), "changed",
+	                  G_CALLBACK (xkb_model_chooser_change_vendor_sel),
+	                  chooser_dialog);
+
+	return gtk_tree_model_get_iter_first (GTK_TREE_MODEL (list_store),
+					      &iter);
+}
+
+static void
+prepare_models_list (GtkBuilder * chooser_dialog)
+{
+	GtkWidget *models_list = CWID ("models_list");
+	GtkCellRenderer *renderer = gtk_cell_renderer_text_new ();
+	GtkTreeViewColumn *description_col =
+	    gtk_tree_view_column_new_with_attributes (_("Models"),
+						      renderer,
+						      "text", 0,
+						      NULL);
+	gtk_tree_view_column_set_visible (description_col, TRUE);
+	gtk_tree_view_append_column (GTK_TREE_VIEW (models_list),
+				     description_col);
+}
+
+static void
+fill_models_list (GtkBuilder * chooser_dialog)
+{
+	GtkWidget *models_list = CWID ("models_list");
+	GtkTreeIter iter;
+	GtkTreePath *path;
+
+	GtkListStore *list_store =
+	    gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
+
+	gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE
+					      (list_store), 0,
+					      GTK_SORT_ASCENDING);
+
+	gtk_tree_view_set_model (GTK_TREE_VIEW (models_list),
+				 GTK_TREE_MODEL (list_store));
+
+	xkl_config_registry_foreach_model (config_registry,
+					   (ConfigItemProcessFunc)
+					   add_model_to_list, models_list);
+
+	if (current_model_name != NULL) {
+		path = gtk_list_store_find_entry (list_store,
+						  &iter,
+						  current_model_name, 1);
+		if (path != NULL) {
+			gtk_tree_selection_select_iter
+			    (gtk_tree_view_get_selection
+			     (GTK_TREE_VIEW (models_list)), &iter);
+			gtk_tree_view_scroll_to_cell
+			    (GTK_TREE_VIEW (models_list),
+			     path, NULL, TRUE, 0.5, 0);
+			gtk_tree_path_free (path);
+		}
+	}
+
+	g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (models_list)), "changed",
+	                  G_CALLBACK (xkb_model_chooser_change_model_sel),
+	                  chooser_dialog);
+}
+
+static void
+xkb_model_chooser_response (GtkDialog * dialog,
+			    gint response, GtkBuilder * chooser_dialog)
+{
+	if (response == GTK_RESPONSE_OK) {
+		GtkWidget *models_list = CWID ("models_list");
+		GtkTreeSelection *selection =
+		    gtk_tree_view_get_selection (GTK_TREE_VIEW
+						 (models_list));
+		GtkTreeIter iter;
+		GtkTreeModel *list_store = NULL;
+		if (gtk_tree_selection_get_selected
+		    (selection, &list_store, &iter)) {
+			gchar *model_name = NULL;
+			gtk_tree_model_get (list_store, &iter,
+					    1, &model_name, -1);
+
+			g_settings_set_string (xkb_kbd_settings, "model", model_name);
+			g_free (model_name);
+		}
+	}
+}
+
+void
+choose_model (GtkBuilder * dialog)
+{
+	GtkBuilder *chooser_dialog;
+	GtkWidget *chooser;
+
+	chooser_dialog = gtk_builder_new ();
+	gtk_builder_add_from_resource (chooser_dialog,
+	                               "/org/mate/mcc/keyboard/mate-keyboard-properties-model-chooser.ui",
+	                               NULL);
+	chooser = CWID ("xkb_model_chooser");
+	gtk_window_set_transient_for (GTK_WINDOW (chooser),
+				      GTK_WINDOW (WID
+						  ("keyboard_dialog")));
+	current_model_name =
+	    g_settings_get_string (xkb_kbd_settings, "model");
+
+	prepare_vendors_list (chooser_dialog);
+	prepare_models_list (chooser_dialog);
+
+	if (!fill_vendors_list (chooser_dialog)) {
+		gtk_widget_hide (CWID ("vendors_label"));
+		gtk_widget_hide (CWID ("vendors_scrolledwindow"));
+		current_vendor_name = NULL;
+		fill_models_list (chooser_dialog);
+	}
+
+	g_signal_connect (chooser, "response",
+	                  G_CALLBACK (xkb_model_chooser_response),
+	                  chooser_dialog);
+	gtk_dialog_run (GTK_DIALOG (chooser));
+	gtk_widget_destroy (chooser);
+	g_free (current_model_name);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/68.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/68.html new file mode 100644 index 00000000..6011f700 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/68.html @@ -0,0 +1,1299 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- mode: c; style: linux -*- */
+
+/* mate-keyboard-properties-xkbot.c
+ * Copyright (C) 2003-2007 Sergey V. Udaltsov
+ *
+ * Written by: Sergey V. Udaltsov <svu@gnome.org>
+ *             John Spray <spray_john@users.sourceforge.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, 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 <string.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 "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+
+#include "mate-keyboard-properties-xkb.h"
+
+static GtkBuilder *chooser_dialog = NULL;
+static const char *current1st_level_id = NULL;
+static GSList *option_checks_list = NULL;
+static GtkWidget *current_none_radio = NULL;
+static GtkWidget *current_expander = NULL;
+static gboolean current_multi_select = FALSE;
+static GSList *current_radio_group = NULL;
+
+#define OPTION_ID_PROP "optionID"
+#define SELCOUNTER_PROP "selectionCounter"
+#define EXPANDERS_PROP "expandersList"
+
+GSList *
+xkb_options_get_selected_list (void)
+{
+	gchar **array;
+	GSList *retval = NULL;
+	gint i;
+	array = g_settings_get_strv (xkb_kbd_settings, "options");
+	if (array != NULL) {
+		for (i = 0; array[i]; i++) {
+			retval = g_slist_append (retval, g_strdup (array[i]));
+		}
+	}
+	g_strfreev (array);
+
+	if (retval == NULL) {
+		if (initial_config.options != NULL) {
+			for (i = 0; initial_config.options[i] != NULL; i++)
+				retval =
+				    g_slist_prepend (retval, g_strdup (initial_config.options[i]));
+		}
+		retval = g_slist_reverse (retval);
+	}
+
+	return retval;
+}
+
+/* Returns the selection counter of the expander (static current_expander) */
+static int
+xkb_options_expander_selcounter_get (void)
+{
+	return
+	    GPOINTER_TO_INT (g_object_get_data
+			     (G_OBJECT (current_expander),
+			      SELCOUNTER_PROP));
+}
+
+/* Increments the selection counter in the expander (static current_expander)
+   using the value (can be 0)*/
+static void
+xkb_options_expander_selcounter_add (int value)
+{
+	g_object_set_data (G_OBJECT (current_expander), SELCOUNTER_PROP,
+			   GINT_TO_POINTER
+			   (xkb_options_expander_selcounter_get ()
+			    + value));
+}
+
+/* Resets the seletion counter in the expander (static current_expander) */
+static void
+xkb_options_expander_selcounter_reset (void)
+{
+	g_object_set_data (G_OBJECT (current_expander), SELCOUNTER_PROP,
+			   GINT_TO_POINTER (0));
+}
+
+/* Formats the expander (static current_expander), based on the selection counter */
+static void
+xkb_options_expander_highlight (void)
+{
+	char *utf_group_name =
+	    g_object_get_data (G_OBJECT (current_expander),
+			       "utfGroupName");
+	int counter = xkb_options_expander_selcounter_get ();
+	if (utf_group_name != NULL) {
+		gchar *titlemarkup =
+		    g_strconcat (counter >
+				 0 ? "<span weight=\"bold\">" : "<span>",
+				 utf_group_name, "</span>", NULL);
+		gtk_expander_set_label (GTK_EXPANDER (current_expander),
+					titlemarkup);
+		g_free (titlemarkup);
+	}
+}
+
+/* Add optionname from the backend's selection list if it's not
+   already in there. */
+static void
+xkb_options_select (gchar * optionname)
+{
+	gboolean already_selected = FALSE;
+	GSList *options_list = xkb_options_get_selected_list ();
+	GSList *option;<--- Variable 'option' can be declared as pointer to const
+	for (option = options_list; option != NULL; option = option->next)
+		if (!strcmp ((gchar *) option->data, optionname))
+			already_selected = TRUE;
+
+	if (!already_selected)
+		options_list =
+		    g_slist_append (options_list, g_strdup (optionname));
+	xkb_options_set_selected_list (options_list);
+
+	clear_xkb_elements_list (options_list);
+}
+
+/* Remove all occurences of optionname from the backend's selection list */
+static void
+xkb_options_deselect (gchar * optionname)<--- Parameter 'optionname' can be declared as pointer to const
+{
+	GSList *options_list = xkb_options_get_selected_list ();
+	GSList *nodetmp;
+	GSList *option = options_list;
+	while (option != NULL) {
+		gchar *id = (char *) option->data;
+		if (!strcmp (id, optionname)) {
+			nodetmp = option->next;
+			g_free (id);
+			options_list =
+			    g_slist_remove_link (options_list, option);
+			g_slist_free_1 (option);
+			option = nodetmp;
+		} else
+			option = option->next;
+	}
+	xkb_options_set_selected_list (options_list);
+	clear_xkb_elements_list (options_list);
+}
+
+/* Return true if optionname describes a string already in the backend's
+   list of selected options */
+static gboolean
+xkb_options_is_selected (gchar * optionname)<--- Parameter 'optionname' can be declared as pointer to const
+{
+	gboolean retval = FALSE;
+	GSList *options_list = xkb_options_get_selected_list ();
+	GSList *option;<--- Variable 'option' can be declared as pointer to const
+	for (option = options_list; option != NULL; option = option->next) {
+		if (!strcmp ((gchar *) option->data, optionname))
+			retval = TRUE;
+	}
+	clear_xkb_elements_list (options_list);
+	return retval;
+}
+
+/* Make sure selected options stay visible when navigating with the keyboard */
+static gboolean
+option_focused_cb (GtkWidget * widget, GdkEventFocus * event,
+		   gpointer data)
+{
+	GtkScrolledWindow *win = GTK_SCROLLED_WINDOW (data);
+	GtkAllocation alloc;
+	GtkAdjustment *adj;
+
+	gtk_widget_get_allocation (widget, &alloc);
+	adj = gtk_scrolled_window_get_vadjustment (win);
+	gtk_adjustment_clamp_page (adj, alloc.y,
+				   alloc.y + alloc.height);
+
+	return FALSE;
+}
+
+/* Update xkb backend to reflect the new UI state */
+static void
+option_toggled_cb (GtkWidget * checkbutton, gpointer data)
+{
+	gpointer optionID =
+	    g_object_get_data (G_OBJECT (checkbutton), OPTION_ID_PROP);
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbutton)))
+		xkb_options_select (optionID);
+	else
+		xkb_options_deselect (optionID);
+}
+
+/* Add a check_button or radio_button to control a particular option
+   This function makes particular use of the current... variables at
+   the top of this file. */
+static void
+xkb_options_add_option (XklConfigRegistry * config_registry,
+			XklConfigItem * config_item, GtkBuilder * dialog)
+{
+	GtkWidget *option_check;
+	gchar *utf_option_name = xci_desc_to_utf8 (config_item);
+	/* Copy this out because we'll load it into the widget with set_data */
+	gchar *full_option_name =
+	    g_strdup (matekbd_keyboard_config_merge_items
+		      (current1st_level_id, config_item->name));
+	gboolean initial_state;
+
+	if (current_multi_select)
+		option_check =
+		    gtk_check_button_new_with_label (utf_option_name);
+	else {
+		if (current_radio_group == NULL) {
+			/* The first radio in a group is to be "Default", meaning none of
+			   the below options are to be included in the selected list.
+			   This is a HIG-compliant alternative to allowing no
+			   selection in the group. */
+			option_check =
+			    gtk_radio_button_new_with_label
+			    (current_radio_group, _("Default"));
+			gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
+						      (option_check),
+						      TRUE);
+			/* Make option name underscore -
+			   to enforce its first position in the list */
+			g_object_set_data_full (G_OBJECT (option_check),
+						"utfOptionName",
+						g_strdup (" "), g_free);
+			option_checks_list =
+			    g_slist_append (option_checks_list,
+					    option_check);
+			current_radio_group =
+			    gtk_radio_button_get_group (GTK_RADIO_BUTTON
+							(option_check));
+			current_none_radio = option_check;
+
+			g_signal_connect (option_check, "focus-in-event",
+					  G_CALLBACK (option_focused_cb),
+					  WID ("options_scroll"));
+		}
+		option_check =
+		    gtk_radio_button_new_with_label (current_radio_group,
+						     utf_option_name);
+		current_radio_group =
+		    gtk_radio_button_get_group (GTK_RADIO_BUTTON
+						(option_check));
+		g_object_set_data (G_OBJECT (option_check), "NoneRadio",
+				   current_none_radio);
+	}
+
+	initial_state = xkb_options_is_selected (full_option_name);
+
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (option_check),
+				      initial_state);
+
+	g_object_set_data_full (G_OBJECT (option_check), OPTION_ID_PROP,
+				full_option_name, g_free);
+	g_object_set_data_full (G_OBJECT (option_check), "utfOptionName",
+				utf_option_name, g_free);
+
+	g_signal_connect (option_check, "toggled",
+			  G_CALLBACK (option_toggled_cb), NULL);
+
+	option_checks_list =
+	    g_slist_append (option_checks_list, option_check);
+
+	g_signal_connect (option_check, "focus-in-event",
+			  G_CALLBACK (option_focused_cb),
+			  WID ("options_scroll"));
+
+	xkb_options_expander_selcounter_add (initial_state);
+}
+
+static gint
+xkb_option_checks_compare (GtkWidget * chk1, GtkWidget * chk2)
+{
+	const gchar *t1 =
+	    g_object_get_data (G_OBJECT (chk1), "utfOptionName");
+	const gchar *t2 =
+	    g_object_get_data (G_OBJECT (chk2), "utfOptionName");
+	return g_utf8_collate (t1, t2);
+}
+
+/* Add a group of options: create title and layout widgets and then
+   add widgets for all the options in the group. */
+static void
+xkb_options_add_group (XklConfigRegistry * config_registry,
+		       XklConfigItem * config_item, GtkBuilder * dialog)
+{
+	GtkWidget *vbox, *option_check;
+	gboolean allow_multiple_selection =
+	    GPOINTER_TO_INT (g_object_get_data (G_OBJECT (config_item),
+						XCI_PROP_ALLOW_MULTIPLE_SELECTION));
+
+	GSList *expanders_list =
+	    g_object_get_data (G_OBJECT (dialog), EXPANDERS_PROP);
+
+	gchar *utf_group_name = xci_desc_to_utf8 (config_item);
+	gchar *titlemarkup =
+	    g_strconcat ("<span>", utf_group_name, "</span>", NULL);
+
+	current_expander = gtk_expander_new (titlemarkup);
+	gtk_expander_set_use_markup (GTK_EXPANDER (current_expander),
+				     TRUE);
+	g_object_set_data_full (G_OBJECT (current_expander),
+				"utfGroupName", utf_group_name, g_free);
+	g_object_set_data_full (G_OBJECT (current_expander), "groupId",
+				g_strdup (config_item->name), g_free);
+
+	g_free (titlemarkup);
+	vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+	gtk_widget_set_halign (vbox, GTK_ALIGN_FILL);
+	gtk_widget_set_valign (vbox, GTK_ALIGN_START);
+	gtk_widget_set_hexpand (vbox, TRUE);
+	gtk_widget_set_vexpand (vbox, TRUE);
+	gtk_widget_set_margin_top (vbox, 6);
+	gtk_widget_set_margin_bottom (vbox, 12);
+	gtk_widget_set_margin_start (vbox, 12);
+	gtk_container_add (GTK_CONTAINER (current_expander), vbox);
+
+	current_multi_select = (gboolean) allow_multiple_selection;
+	current_radio_group = NULL;
+	current1st_level_id = config_item->name;
+
+	option_checks_list = NULL;
+
+	xkl_config_registry_foreach_option (config_registry,
+					    config_item->name,
+					    (ConfigItemProcessFunc)
+					    xkb_options_add_option,
+					    dialog);
+	/* sort it */
+	option_checks_list =
+	    g_slist_sort (option_checks_list,
+			  (GCompareFunc) xkb_option_checks_compare);
+	while (option_checks_list) {
+		option_check = GTK_WIDGET (option_checks_list->data);
+		gtk_box_pack_start (GTK_BOX (vbox), option_check, TRUE, TRUE, 0);
+		option_checks_list = option_checks_list->next;
+	}
+	/* free it */
+	g_slist_free (option_checks_list);
+	option_checks_list = NULL;
+
+	xkb_options_expander_highlight ();
+
+	expanders_list = g_slist_append (expanders_list, current_expander);
+	g_object_set_data (G_OBJECT (dialog), EXPANDERS_PROP,
+			   expanders_list);
+
+	g_signal_connect (current_expander, "focus-in-event",
+			  G_CALLBACK (option_focused_cb),
+			  WID ("options_scroll"));
+}
+
+static gint
+xkb_options_expanders_compare (GtkWidget * expander1,
+			       GtkWidget * expander2)
+{
+	const gchar *t1 =
+	    g_object_get_data (G_OBJECT (expander1), "utfGroupName");
+	const gchar *t2 =
+	    g_object_get_data (G_OBJECT (expander2), "utfGroupName");
+	return g_utf8_collate (t1, t2);
+}
+
+/* Create widgets to represent the options made available by the backend */
+void
+xkb_options_load_options (GtkBuilder * dialog)
+{
+	GtkWidget *opts_vbox = WID ("options_vbox");
+	GSList *expanders_list;
+	GtkWidget *expander;
+
+	current1st_level_id = NULL;
+	current_none_radio = NULL;
+	current_multi_select = FALSE;
+	current_radio_group = NULL;
+
+	/* fill the list */
+	xkl_config_registry_foreach_option_group (config_registry,
+						  (ConfigItemProcessFunc)
+						  xkb_options_add_group,
+						  dialog);
+	/* sort it */
+	expanders_list =
+	    g_object_get_data (G_OBJECT (dialog), EXPANDERS_PROP);
+	expanders_list =
+	    g_slist_sort (expanders_list,
+			  (GCompareFunc) xkb_options_expanders_compare);
+	g_object_set_data (G_OBJECT (dialog), EXPANDERS_PROP,
+			   expanders_list);
+	while (expanders_list) {
+		expander = GTK_WIDGET (expanders_list->data);
+		gtk_box_pack_start (GTK_BOX (opts_vbox), expander, FALSE,
+				    FALSE, 0);
+		expanders_list = expanders_list->next;
+	}
+
+	gtk_widget_show_all (opts_vbox);
+}
+
+static void
+chooser_response_cb (GtkDialog * dialog, gint response, gpointer data)
+{
+	switch (response) {
+	case GTK_RESPONSE_HELP:
+		capplet_help (GTK_WINDOW (dialog),
+			      "prefs-keyboard#prefs-keyboard-layoutoptions");
+		break;
+	case GTK_RESPONSE_CLOSE:{
+			/* just cleanup */
+			GSList *expanders_list =
+			    g_object_get_data (G_OBJECT (dialog),
+					       EXPANDERS_PROP);
+			g_object_set_data (G_OBJECT (dialog),
+					   EXPANDERS_PROP, NULL);
+			g_slist_free (expanders_list);
+
+			gtk_widget_destroy (GTK_WIDGET (dialog));
+			chooser_dialog = NULL;
+		}
+		break;
+	}
+}
+
+/* Create popup dialog */
+void
+xkb_options_popup_dialog (GtkBuilder * dialog)
+{
+	GtkWidget *chooser;
+
+	chooser_dialog = gtk_builder_new ();
+	gtk_builder_add_from_resource (chooser_dialog,
+	                               "/org/mate/mcc/keyboard/mate-keyboard-properties-options-dialog.ui",
+	                               NULL);
+
+	chooser = CWID ("xkb_options_dialog");
+	gtk_window_set_transient_for (GTK_WINDOW (chooser),
+				      GTK_WINDOW (WID
+						  ("keyboard_dialog")));
+	xkb_options_load_options (chooser_dialog);
+
+	g_signal_connect (chooser, "response",
+			  G_CALLBACK (chooser_response_cb), dialog);
+
+	gtk_dialog_run (GTK_DIALOG (chooser));
+}
+
+/* Update selected option counters for a group-bound expander */
+static void
+xkb_options_update_option_counters (XklConfigRegistry * config_registry,
+				    XklConfigItem * config_item)
+{
+	gchar *full_option_name =
+	    g_strdup (matekbd_keyboard_config_merge_items
+		      (current1st_level_id, config_item->name));
+	gboolean current_state =
+	    xkb_options_is_selected (full_option_name);
+	xkb_options_expander_selcounter_add (current_state);
+}
+
+/* Respond to a change in the xkb gsettings settings */
+static void
+xkb_options_update (GSettings * settings, gchar * key, GtkBuilder * dialog)
+{
+	/* Updating options is handled by gsettings notifies for each widget
+	   This is here to avoid calling it N_OPTIONS times for each gsettings
+	   change. */
+	enable_disable_restoring (dialog);
+
+	if (chooser_dialog != NULL) {
+		GSList *expanders_list =
+		    g_object_get_data (G_OBJECT (chooser_dialog),
+				       EXPANDERS_PROP);
+		while (expanders_list) {
+			current_expander =
+			    GTK_WIDGET (expanders_list->data);
+			gchar *group_id =
+			    g_object_get_data (G_OBJECT (current_expander),
+					       "groupId");
+			current1st_level_id = group_id;
+			xkb_options_expander_selcounter_reset ();
+			xkl_config_registry_foreach_option
+			    (config_registry, group_id,
+			     (ConfigItemProcessFunc)
+			     xkb_options_update_option_counters,
+			     current_expander);
+			xkb_options_expander_highlight ();
+			expanders_list = expanders_list->next;
+		}
+	}
+}
+
+void
+xkb_options_register_gsettings_listener (GtkBuilder * dialog)
+{
+	g_signal_connect (xkb_kbd_settings,
+			  "changed::options",
+			  G_CALLBACK (xkb_options_update),
+			  dialog);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/69.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/69.html new file mode 100644 index 00000000..6b001374 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/69.html @@ -0,0 +1,521 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- mode: c; style: linux -*- */
+
+/* mate-keyboard-properties-xkbpv.c
+ * Copyright (C) 2003-2007 Sergey V. Udaltsov
+ *
+ * Written by: Sergey V. Udaltsov <svu@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, 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 <libmatekbd/matekbd-keyboard-drawing.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+#include "mate-keyboard-properties-xkb.h"
+
+#ifdef HAVE_X11_EXTENSIONS_XKB_H
+#include "X11/XKBlib.h"<--- Include file: "X11/XKBlib.h" not found.
+/**
+ * BAD STYLE: Taken from xklavier_private_xkb.h
+ * Any ideas on architectural improvements are WELCOME
+ */
+extern gboolean xkl_xkb_config_native_prepare (XklEngine * engine,
+					       const XklConfigRec * data,
+					       XkbComponentNamesPtr
+					       component_names);
+
+extern void xkl_xkb_config_native_cleanup (XklEngine * engine,
+					   XkbComponentNamesPtr
+					   component_names);
+
+/* */
+#endif
+
+static MatekbdKeyboardDrawingGroupLevel groupsLevels[] =
+    { {0, 1}, {0, 3}, {0, 0}, {0, 2} };
+static MatekbdKeyboardDrawingGroupLevel *pGroupsLevels[] = {
+	groupsLevels, groupsLevels + 1, groupsLevels + 2, groupsLevels + 3
+};
+
+GtkWidget *
+xkb_layout_preview_create_widget (GtkBuilder * chooserDialog)
+{
+	GtkWidget *kbdraw = matekbd_keyboard_drawing_new ();
+
+	matekbd_keyboard_drawing_set_groups_levels (MATEKBD_KEYBOARD_DRAWING
+						 (kbdraw), pGroupsLevels);
+	return kbdraw;
+}
+
+void
+xkb_layout_preview_update (GtkBuilder * chooser_dialog)
+{
+#ifdef HAVE_X11_EXTENSIONS_XKB_H
+	GtkWidget *chooser = CWID ("xkb_layout_chooser");
+	GtkWidget *kbdraw =
+	    GTK_WIDGET (g_object_get_data (G_OBJECT (chooser), "kbdraw"));
+	gchar *id = xkb_layout_chooser_get_selected_id (chooser_dialog);
+	xkb_layout_preview_set_drawing_layout (kbdraw, id);
+	g_free (id);
+#endif
+}
+
+void
+xkb_layout_preview_set_drawing_layout (GtkWidget * kbdraw,
+				       const gchar * id)
+{
+#ifdef HAVE_X11_EXTENSIONS_XKB_H
+	if (kbdraw != NULL) {
+		if (id != NULL) {
+			XklConfigRec *data;
+			char **p, *layout, *variant;
+			XkbComponentNamesRec component_names;
+
+			data = xkl_config_rec_new ();
+			if (xkl_config_rec_get_from_server (data, engine)) {
+				if ((p = data->layouts) != NULL)
+					g_strfreev (data->layouts);
+
+				if ((p = data->variants) != NULL)<--- Variable 'p' is assigned a value that is never used.
+					g_strfreev (data->variants);
+
+				data->layouts = g_new0 (char *, 2);
+				data->variants = g_new0 (char *, 2);
+				if (matekbd_keyboard_config_split_items
+				    (id, &layout, &variant)
+				    && variant != NULL) {
+					data->layouts[0] =
+					    (layout ==
+					     NULL) ? NULL :
+					    g_strdup (layout);
+					data->variants[0] =
+					    (variant ==<--- Condition 'variant==NULL' is always false
+					     NULL) ? NULL :
+					    g_strdup (variant);
+				} else {
+					data->layouts[0] =
+					    (id ==
+					     NULL) ? NULL : g_strdup (id);
+					data->variants[0] = NULL;
+				}
+
+				if (xkl_xkb_config_native_prepare
+				    (engine, data, &component_names)) {
+					matekbd_keyboard_drawing_set_keyboard
+					    (MATEKBD_KEYBOARD_DRAWING
+					     (kbdraw), &component_names);
+
+					xkl_xkb_config_native_cleanup
+					    (engine, &component_names);
+				}
+			}
+			g_object_unref (G_OBJECT (data));
+		} else
+			matekbd_keyboard_drawing_set_keyboard
+			    (MATEKBD_KEYBOARD_DRAWING (kbdraw), NULL);
+
+	}
+#endif
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/7.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/7.html new file mode 100644 index 00000000..724449de --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/7.html @@ -0,0 +1,299 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/* mate-about-me-fingerprint.h
+ * Copyright (C) 2008 Bastien Nocera <hadess@hadess.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, 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 __MATE_ABOUT_ME_FINGERPRINT_H__
+#define __MATE_ABOUT_ME_FINGERPRINT_H__
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+void set_fingerprint_label (GtkWidget *enable,
+			    GtkWidget *disable);
+void fingerprint_button_clicked (GtkBuilder *dialog,
+				 GtkWidget *enable,
+				 GtkWidget *disable);
+
+#endif /* __MATE_ABOUT_ME_FINGERPRINT_H__ */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/70.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/70.html new file mode 100644 index 00000000..fee2a2f8 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/70.html @@ -0,0 +1,643 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- mode: c; style: linux -*- */
+
+/* keyboard-properties.c
+ * Copyright (C) 2000-2001 Ximian, Inc.
+ * Copyright (C) 2001 Jonathan Blandford
+ *
+ * Written by: Bradford Hovinen <hovinen@ximian.com>
+ *             Rachel Hestilow <hestilow@ximian.com>
+ *	       Jonathan Blandford <jrb@redhat.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, 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 <stdlib.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 "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+#include "activate-settings-daemon.h"<--- Include file: "activate-settings-daemon.h" not found.
+
+#include "mate-keyboard-properties-a11y.h"
+#include "mate-keyboard-properties-xkb.h"
+
+#define KEYBOARD_SCHEMA "org.mate.peripherals-keyboard"
+#define INTERFACE_SCHEMA "org.mate.interface"
+#define TYPING_BREAK_SCHEMA "org.mate.typing-break"
+
+#define GET_RANGE(s) GTK_RANGE (gtk_builder_get_object (dialog, s))
+
+enum {
+	RESPONSE_APPLY = 1,
+	RESPONSE_CLOSE
+};
+
+static GSettings * keyboard_settings = NULL;
+static GSettings * interface_settings = NULL;
+static GSettings * typing_break_settings = NULL;
+
+static void
+dialog_response (GtkWidget * widget,
+		 gint response_id, guint data)
+{
+	if (response_id == GTK_RESPONSE_HELP)
+		capplet_help (GTK_WINDOW (widget), "goscustperiph-2");
+	else
+		gtk_main_quit ();
+}
+
+static void
+setup_dialog (GtkBuilder * dialog)
+{
+	gchar *monitor;
+
+	g_settings_bind (keyboard_settings, "repeat",
+	                 gtk_builder_get_object (dialog, "repeat_toggle"), "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+	g_settings_bind (keyboard_settings, "repeat",
+	                 gtk_builder_get_object (dialog, "repeat_table"), "sensitive",
+	                 G_SETTINGS_BIND_DEFAULT);
+	g_settings_bind (keyboard_settings, "delay",
+	                 gtk_range_get_adjustment (GET_RANGE ("repeat_delay_scale")), "value",
+	                 G_SETTINGS_BIND_DEFAULT);
+	g_settings_bind (keyboard_settings, "rate",
+	                 gtk_range_get_adjustment (GET_RANGE ("repeat_speed_scale")), "value",
+	                 G_SETTINGS_BIND_DEFAULT);
+	g_settings_bind (interface_settings, "cursor-blink",
+	                 gtk_builder_get_object (dialog, "cursor_toggle"), "active",
+	                 G_SETTINGS_BIND_DEFAULT);
+	g_settings_bind (interface_settings, "cursor-blink",
+	                 gtk_builder_get_object (dialog, "cursor_hbox"), "sensitive",
+	                 G_SETTINGS_BIND_DEFAULT);
+	g_settings_bind (interface_settings, "cursor-blink-time",
+	                 gtk_range_get_adjustment (GET_RANGE ("cursor_blink_time_scale")), "value",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	/* Ergonomics */
+	monitor = g_find_program_in_path ("mate-typing-monitor");
+	if (monitor != NULL) {
+		g_free (monitor);
+
+		g_settings_bind (typing_break_settings, "enabled",
+		                 gtk_builder_get_object (dialog, "break_enabled_toggle"), "active",
+		                 G_SETTINGS_BIND_DEFAULT);
+		g_settings_bind (typing_break_settings, "enabled",
+		                 gtk_builder_get_object (dialog, "break_details_table"), "sensitive",
+		                 G_SETTINGS_BIND_DEFAULT);
+		g_settings_bind (typing_break_settings, "type-time",
+		                 gtk_builder_get_object (dialog, "break_enabled_spin"), "value",
+		                 G_SETTINGS_BIND_DEFAULT);
+		g_settings_bind (typing_break_settings, "break-time",
+		                 gtk_builder_get_object (dialog, "break_interval_spin"), "value",
+		                 G_SETTINGS_BIND_DEFAULT);
+		g_settings_bind (typing_break_settings, "allow-postpone",
+		                 gtk_builder_get_object (dialog, "break_postponement_toggle"), "active",
+		                 G_SETTINGS_BIND_DEFAULT);
+
+	} else {
+		/* don't show the typing break tab if the daemon is not available */
+		GtkNotebook *nb = GTK_NOTEBOOK (gtk_builder_get_object (dialog, "keyboard_notebook"));
+		gint tb_page = gtk_notebook_page_num (nb, WID ("break_enabled_toggle"));
+		gtk_notebook_remove_page (nb, tb_page);
+	}
+
+	g_signal_connect (gtk_builder_get_object (dialog, "keyboard_dialog"), "response",
+	                  (GCallback) dialog_response,
+	                  NULL);
+
+	setup_xkb_tabs (dialog);
+	setup_a11y_tabs (dialog);
+}
+
+int
+main (int argc, char **argv)
+{
+	GtkBuilder *dialog;
+	GOptionContext *context;
+
+	static gboolean apply_only = FALSE;
+	static gboolean switch_to_typing_break_page = FALSE;
+	static gboolean switch_to_a11y_page = FALSE;
+
+	static GOptionEntry cap_options[] = {
+		{"apply", 0, 0, G_OPTION_ARG_NONE, &apply_only,
+		 N_
+		 ("Just apply settings and quit (compatibility only; now handled by daemon)"),
+		 NULL},
+		{"init-session-settings", 0, 0, G_OPTION_ARG_NONE,
+		 &apply_only,
+		 N_
+		 ("Just apply settings and quit (compatibility only; now handled by daemon)"),
+		 NULL},
+		{"typing-break", 0, 0, G_OPTION_ARG_NONE,
+		 &switch_to_typing_break_page,
+		 N_
+		 ("Start the page with the typing break settings showing"),
+		 NULL},
+		{"a11y", 0, 0, G_OPTION_ARG_NONE,
+		 &switch_to_a11y_page,
+		 N_
+		 ("Start the page with the accessibility settings showing"),
+		 NULL},
+		{ NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
+	};
+
+	context = g_option_context_new (_("- MATE Keyboard Preferences"));
+	g_option_context_add_main_entries (context, cap_options,
+					   GETTEXT_PACKAGE);
+
+	capplet_init (context, &argc, &argv);
+	g_option_context_free (context);
+
+	activate_settings_daemon ();
+
+	keyboard_settings = g_settings_new (KEYBOARD_SCHEMA);
+	interface_settings = g_settings_new (INTERFACE_SCHEMA);
+	typing_break_settings = g_settings_new (TYPING_BREAK_SCHEMA);
+
+	dialog = gtk_builder_new_from_resource ("/org/mate/mcc/keyboard/mate-keyboard-properties-dialog.ui");
+
+	setup_dialog (dialog);
+
+        GtkNotebook* nb = GTK_NOTEBOOK (gtk_builder_get_object (dialog, "keyboard_notebook"));
+        gtk_widget_add_events (GTK_WIDGET (nb), GDK_SCROLL_MASK);
+        g_signal_connect (nb, "scroll-event",
+                          G_CALLBACK (capplet_notebook_scroll_event_cb),
+                          NULL);
+
+	if (switch_to_typing_break_page) {
+		gtk_notebook_set_current_page (nb, 4);
+	}
+	else if (switch_to_a11y_page) {
+		gtk_notebook_set_current_page (nb, 2);
+
+	}
+
+	capplet_set_icon (WID ("keyboard_dialog"),
+			  "input-keyboard");
+	gtk_widget_show (WID ("keyboard_dialog"));
+	gtk_main ();
+
+	finalize_a11y_tabs ();
+	g_object_unref (keyboard_settings);
+	g_object_unref (interface_settings);
+	g_object_unref (typing_break_settings);
+
+	return 0;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/71.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/71.html new file mode 100644 index 00000000..3be24db1 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/71.html @@ -0,0 +1,2107 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
#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.mouse"), aligned (8)))
+#else
+# define SECTION
+#endif
+
+static const SECTION union { const guint8 data[11645]; const double alignment; void * const ptr;}  mouse_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, 0034, 0001, 0000, 0000, 0000, 0000, 0000, 0050, 0011, 0000, 0000, 0000, 
+  0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0002, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 
+  0003, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 0006, 0000, 0000, 0000, 0007, 0000, 0000, 0000, 
+  0007, 0000, 0000, 0000, 0333, 0152, 0064, 0057, 0002, 0000, 0000, 0000, 0034, 0001, 0000, 0000, 
+  0006, 0000, 0114, 0000, 0044, 0001, 0000, 0000, 0064, 0001, 0000, 0000, 0113, 0120, 0220, 0013, 
+  0003, 0000, 0000, 0000, 0064, 0001, 0000, 0000, 0004, 0000, 0114, 0000, 0070, 0001, 0000, 0000, 
+  0074, 0001, 0000, 0000, 0143, 0041, 0175, 0170, 0010, 0000, 0000, 0000, 0074, 0001, 0000, 0000, 
+  0004, 0000, 0114, 0000, 0100, 0001, 0000, 0000, 0104, 0001, 0000, 0000, 0324, 0265, 0002, 0000, 
+  0377, 0377, 0377, 0377, 0104, 0001, 0000, 0000, 0001, 0000, 0114, 0000, 0110, 0001, 0000, 0000, 
+  0114, 0001, 0000, 0000, 0242, 0377, 0133, 0037, 0000, 0000, 0000, 0000, 0114, 0001, 0000, 0000, 
+  0026, 0000, 0166, 0000, 0150, 0001, 0000, 0000, 0222, 0011, 0000, 0000, 0357, 0136, 0120, 0341, 
+  0000, 0000, 0000, 0000, 0222, 0011, 0000, 0000, 0024, 0000, 0166, 0000, 0250, 0011, 0000, 0000, 
+  0123, 0016, 0000, 0000, 0061, 0342, 0155, 0242, 0000, 0000, 0000, 0000, 0123, 0016, 0000, 0000, 
+  0023, 0000, 0166, 0000, 0150, 0016, 0000, 0000, 0121, 0031, 0000, 0000, 0236, 0004, 0225, 0074, 
+  0000, 0000, 0000, 0000, 0121, 0031, 0000, 0000, 0030, 0000, 0166, 0000, 0160, 0031, 0000, 0000, 
+  0161, 0055, 0000, 0000, 0201, 0321, 0040, 0031, 0001, 0000, 0000, 0000, 0161, 0055, 0000, 0000, 
+  0005, 0000, 0114, 0000, 0170, 0055, 0000, 0000, 0174, 0055, 0000, 0000, 0155, 0157, 0165, 0163, 
+  0145, 0057, 0000, 0000, 0004, 0000, 0000, 0000, 0005, 0000, 0000, 0000, 0006, 0000, 0000, 0000, 
+  0007, 0000, 0000, 0000, 0157, 0162, 0147, 0057, 0010, 0000, 0000, 0000, 0155, 0143, 0143, 0057, 
+  0000, 0000, 0000, 0000, 0057, 0000, 0000, 0000, 0001, 0000, 0000, 0000, 0144, 0157, 0165, 0142, 
+  0154, 0145, 0055, 0143, 0154, 0151, 0143, 0153, 0055, 0155, 0141, 0171, 0142, 0145, 0056, 0163, 
+  0166, 0147, 0000, 0000, 0000, 0000, 0000, 0000, 0112, 0036, 0000, 0000, 0001, 0000, 0000, 0000, 
+  0170, 0332, 0355, 0131, 0333, 0162, 0343, 0306, 0021, 0175, 0327, 0127, 0040, 0330, 0227, 0165, 
+  0205, 0000, 0346, 0176, 0241, 0105, 0271, 0222, 0154, 0071, 0345, 0252, 0344, 0305, 0166, 0222, 
+  0147, 0010, 0030, 0121, 0310, 0222, 0000, 0013, 0000, 0105, 0151, 0277, 0336, 0147, 0100, 0000, 
+  0044, 0105, 0220, 0273, 0166, 0326, 0233, 0332, 0124, 0250, 0122, 0011, 0230, 0356, 0231, 0351, 
+  0236, 0356, 0163, 0272, 0107, 0274, 0375, 0356, 0171, 0275, 0012, 0236, 0134, 0335, 0024, 0125, 
+  0271, 0010, 0151, 0114, 0302, 0300, 0225, 0131, 0225, 0027, 0345, 0162, 0021, 0376, 0343, 0347, 
+  0357, 0043, 0023, 0006, 0115, 0233, 0226, 0171, 0272, 0252, 0112, 0267, 0010, 0313, 0052, 0374, 
+  0356, 0356, 0346, 0366, 0017, 0121, 0024, 0374, 0245, 0166, 0151, 0353, 0362, 0140, 0127, 0264, 
+  0217, 0301, 0017, 0345, 0373, 0046, 0113, 0067, 0056, 0170, 0373, 0330, 0266, 0233, 0171, 0222, 
+  0354, 0166, 0273, 0270, 0350, 0007, 0343, 0252, 0136, 0046, 0337, 0004, 0121, 0164, 0167, 0163, 
+  0163, 0333, 0074, 0055, 0157, 0202, 0040, 0300, 0276, 0145, 0063, 0317, 0263, 0105, 0330, 0117, 
+  0330, 0154, 0353, 0125, 0247, 0230, 0147, 0211, 0133, 0271, 0265, 0053, 0333, 0046, 0241, 0061, 
+  0115, 0302, 0203, 0172, 0166, 0120, 0317, 0374, 0356, 0305, 0223, 0313, 0252, 0365, 0272, 0052, 
+  0233, 0156, 0146, 0331, 0274, 0071, 0122, 0256, 0363, 0207, 0121, 0333, 0133, 0263, 0343, 0235, 
+  0022, 0265, 0326, 0046, 0204, 0045, 0214, 0105, 0320, 0210, 0232, 0227, 0262, 0115, 0237, 0243, 
+  0323, 0251, 0260, 0161, 0152, 0052, 0043, 0204, 0044, 0220, 0035, 0064, 0077, 0115, 0153, 0336, 
+  0340, 0100, 0067, 0370, 0035, 0325, 0207, 0201, 0270, 0251, 0266, 0165, 0346, 0036, 0060, 0317, 
+  0305, 0245, 0153, 0223, 0167, 0077, 0277, 0033, 0205, 0021, 0211, 0363, 0066, 0077, 0132, 0146, 
+  0070, 0317, 0223, 0135, 0117, 0016, 0271, 0114, 0327, 0256, 0331, 0244, 0231, 0153, 0222, 0141, 
+  0274, 0233, 0277, 0053, 0362, 0366, 0021, 0361, 0045, 0144, 0363, 0334, 0015, 0074, 0272, 0142, 
+  0371, 0330, 0036, 0217, 0074, 0025, 0156, 0367, 0347, 0352, 0171, 0021, 0222, 0200, 0004, 0030, 
+  0366, 0277, 0173, 0301, 0041, 0073, 0150, 0067, 0120, 0344, 0213, 0360, 0247, 0177, 0376, 0365, 
+  0307, 0252, 0152, 0367, 0357, 0375, 0116, 0363, 0121, 0223, 0304, 0226, 0305, 0074, 0170, 0313, 
+  0004, 0221, 0122, 0250, 0131, 0300, 0010, 0065, 0021, 0341, 0021, 0245, 0337, 0164, 0123, 0006, 
+  0027, 0347, 0171, 0225, 0171, 0233, 0221, 0130, 0156, 0267, 0106, 0072, 0255, 0252, 0145, 0105, 
+  0263, 0242, 0316, 0126, 0056, 0036, 0316, 0160, 0134, 0337, 0075, 0157, 0252, 0272, 0215, 0036, 
+  0212, 0225, 0333, 0117, 0112, 0036, 0253, 0265, 0113, 0232, 0254, 0332, 0045, 0367, 0105, 0273, 
+  0116, 0067, 0361, 0246, 0234, 0236, 0363, 0234, 0157, 0160, 0372, 0124, 0231, 0230, 0163, 0241, 
+  0364, 0244, 0316, 0313, 0053, 0235, 0073, 0050, 0335, 0216, 0226, 0372, 0035, 0163, 0177, 0110, 
+  0176, 0352, 0376, 0020, 0356, 0323, 0146, 0177, 0274, 0101, 0260, 0111, 0227, 0110, 0305, 0125, 
+  0125, 0057, 0302, 0067, 0017, 0335, 0247, 0027, 0334, 0127, 0165, 0356, 0352, 0101, 0244, 0272, 
+  0317, 0211, 0250, 0102, 0270, 0212, 0366, 0145, 0017, 0276, 0176, 0355, 0301, 0060, 0277, 0352, 
+  0050, 0047, 0323, 0362, 0346, 0061, 0315, 0253, 0335, 0042, 0144, 0257, 0205, 0037, 0252, 0152, 
+  0275, 0010, 0105, 0054, 0214, 0021, 0102, 0230, 0327, 0342, 0014, 0241, 0026, 0064, 0146, 0232, 
+  0051, 0173, 0066, 0067, 0303, 0176, 0112, 0304, 0334, 0120, 0252, 0316, 0204, 0210, 0331, 0326, 
+  0303, 0063, 0332, 0226, 0105, 0013, 0010, 0364, 0011, 0164, 0074, 0175, 0133, 0327, 0136, 0141, 
+  0225, 0276, 0070, 0270, 0335, 0375, 0241, 0275, 0122, 0363, 0130, 0355, 0226, 0265, 0077, 0276, 
+  0207, 0164, 0065, 0236, 0337, 0070, 0165, 0127, 0224, 0160, 0047, 0032, 0022, 0226, 0031, 0162, 
+  0101, 0143, 0310, 0140, 0053, 0354, 0005, 0015, 0237, 0313, 0027, 0104, 0160, 0217, 0311, 0013, 
+  0262, 0165, 0372, 0134, 0254, 0213, 0017, 0016, 0026, 0322, 0060, 0110, 0272, 0054, 0310, 0335, 
+  0103, 0163, 0210, 0273, 0177, 0243, 0070, 0233, 0101, 0272, 0166, 0155, 0232, 0247, 0155, 0172, 
+  0320, 0030, 0106, 0240, 0045, 0272, 0074, 0202, 0026, 0330, 0146, 0376, 0343, 0273, 0357, 0367, 
+  0157, 0170, 0317, 0262, 0371, 0277, 0252, 0372, 0175, 0377, 0212, 0217, 0127, 0110, 0357, 0253, 
+  0055, 0234, 0012, 0357, 0306, 0341, 0333, 0074, 0233, 0203, 0037, 0000, 0216, 0273, 0142, 0215, 
+  0170, 0173, 0152, 0371, 0043, 0370, 0340, 0066, 0071, 0010, 0116, 0224, 0333, 0227, 0215, 0073, 
+  0054, 0272, 0137, 0266, 0166, 0173, 0242, 0231, 0144, 0333, 0074, 0133, 0027, 0176, 0122, 0362, 
+  0123, 0133, 0254, 0126, 0077, 0370, 0115, 0172, 0317, 0216, 0026, 0055, 0332, 0225, 0273, 0353, 
+  0366, 0334, 0077, 0016, 0136, 0044, 0275, 0033, 0275, 0223, 0311, 0221, 0227, 0267, 0311, 0160, 
+  0014, 0335, 0333, 0362, 0160, 0074, 0047, 0011, 0061, 0236, 0377, 0262, 0256, 0266, 0233, 0165, 
+  0225, 0273, 0136, 0341, 0265, 0174, 0225, 0336, 0273, 0325, 0042, 0374, 0233, 0227, 0005, 0164, 
+  0070, 0326, 0115, 0332, 0076, 0016, 0246, 0216, 0140, 0365, 0356, 0054, 0102, 0024, 0256, 0141, 
+  0021, 0310, 0332, 0227, 0025, 0306, 0172, 0070, 0315, 0351, 0267, 0240, 0221, 0325, 0374, 0215, 
+  0321, 0251, 0224, 0252, 0173, 0211, 0116, 0145, 0121, 0275, 0135, 0271, 0171, 0131, 0225, 0037, 
+  0000, 0322, 0157, 0233, 0266, 0256, 0336, 0273, 0371, 0033, 0233, 0336, 0063, 0115, 0373, 0327, 
+  0175, 0232, 0316, 0151, 0254, 0045, 0343, 0226, 0030, 0065, 0214, 0257, 0212, 0322, 0375, 0273, 
+  0052, 0312, 0071, 0116, 0326, 0325, 0303, 0150, 0367, 0262, 0102, 0162, 0265, 0163, 0061, 0214, 
+  0345, 0051, 0000, 0134, 0327, 0351, 0213, 0337, 0311, 0015, 0243, 0243, 0045, 0243, 0371, 0376, 
+  0330, 0274, 0253, 0102, 0112, 0036, 0236, 0371, 0333, 0024, 0271, 0003, 0022, 0047, 0044, 0036, 
+  0346, 0232, 0304, 0122, 0132, 0052, 0351, 0204, 0330, 0023, 0017, 0067, 0261, 0326, 0112, 0210, 
+  0163, 0161, 0115, 0075, 0120, 0142, 0245, 0270, 0020, 0023, 0213, 0327, 0314, 0103, 0064, 0066, 
+  0234, 0152, 0066, 0261, 0170, 0132, 0057, 0351, 0001, 0203, 0247, 0002, 0326, 0021, 0236, 0320, 
+  0324, 0152, 0165, 0160, 0162, 0010, 0365, 0303, 0052, 0155, 0275, 0117, 0257, 0130, 0342, 0110, 
+  0003, 0271, 0122, 0166, 0162, 0062, 0041, 0103, 0277, 0122, 0365, 0020, 0076, 0210, 0075, 0054, 
+  0003, 0253, 0142, 0306, 0230, 0264, 0174, 0066, 0172, 0035, 0104, 0324, 0306, 0114, 0150, 0151, 
+  0330, 0214, 0242, 0306, 0121, 0246, 0246, 0206, 0310, 0054, 0142, 0014, 0223, 0045, 0073, 0074, 
+  0122, 0033, 0014, 0212, 0174, 0124, 0374, 0160, 0156, 0120, 0013, 0213, 0032, 0217, 0325, 0050, 
+  0003, 0055, 0272, 0332, 0123, 0123, 0104, 0375, 0271, 0021, 0302, 0355, 0250, 0077, 0252, 0301, 
+  0322, 0264, 0255, 0213, 0347, 0267, 0070, 0042, 0155, 0024, 0047, 0164, 0106, 0360, 0343, 0067, 
+  0060, 0034, 0046, 0317, 0042, 0251, 0142, 0205, 0200, 0232, 0131, 0104, 0211, 0214, 0245, 0246, 
+  0103, 0145, 0275, 0276, 0157, 0127, 0146, 0070, 0323, 0234, 0021, 0351, 0042, 0042, 0107, 0234, 
+  0377, 0207, 0060, 0352, 0162, 0367, 0223, 0061, 0044, 0123, 0145, 0005, 0177, 0215, 0041, 0251, 
+  0064, 0352, 0224, 0374, 0102, 0030, 0212, 0310, 0377, 0121, 0364, 0277, 0200, 0042, 0006, 0367, 
+  0045, 0261, 0346, 0072, 0212, 0030, 0316, 0110, 0130, 0323, 0243, 0010, 0133, 0112, 0252, 0364, 
+  0054, 0122, 0062, 0146, 0334, 0150, 0316, 0001, 0043, 0046, 0260, 0222, 0225, 0374, 0023, 0141, 
+  0144, 0143, 0113, 0021, 0057, 0306, 0000, 0043, 0365, 0021, 0030, 0125, 0033, 0207, 0246, 0270, 
+  0255, 0267, 0356, 0212, 0221, 0350, 0366, 0025, 0112, 0210, 0124, 0002, 0326, 0220, 0030, 0113, 
+  0133, 0113, 0275, 0311, 0376, 0221, 0121, 0155, 0351, 0254, 0123, 0241, 0112, 0111, 0345, 0035, 
+  0371, 0346, 0070, 0046, 0177, 0017, 0042, 0337, 0314, 0111, 0056, 0205, 0127, 0063, 0150, 0274, 
+  0215, 0046, 0062, 0370, 0123, 0300, 0261, 0000, 0050, 0304, 0250, 0131, 0367, 0044, 0214, 0242, 
+  0101, 0327, 0342, 0007, 0221, 0324, 0261, 0041, 0022, 0173, 0170, 0011, 0241, 0102, 0322, 0153, 
+  0332, 0226, 0373, 0114, 0263, 0212, 0315, 0220, 0313, 0222, 0150, 0302, 0344, 0125, 0165, 0033, 
+  0153, 0213, 0310, 0300, 0033, 0033, 0013, 0364, 0230, 0224, 0210, 0153, 0372, 0312, 0306, 0304, 
+  0267, 0113, 0240, 0064, 0246, 0143, 0156, 0215, 0122, 0023, 0140, 0160, 0145, 0356, 0173, 0132, 
+  0203, 0373, 0204, 0126, 0166, 0002, 0302, 0340, 0052, 0364, 0117, 0052, 0246, 0302, 0012, 0243, 
+  0047, 0064, 0152, 0004, 0157, 0334, 0174, 0102, 0374, 0334, 0213, 0275, 0225, 0323, 0110, 0347, 
+  0061, 0363, 0224, 0154, 0350, 0064, 0117, 0104, 0032, 0375, 0200, 0002, 0067, 0263, 0360, 0002, 
+  0241, 0246, 0165, 0166, 0306, 0111, 0106, 0330, 0057, 0300, 0261, 0226, 0011, 0145, 0230, 0374, 
+  0374, 0024, 0073, 0015, 0200, 0317, 0340, 0307, 0164, 0277, 0365, 0273, 0371, 0161, 0026, 0226, 
+  0051, 0272, 0077, 0217, 0342, 0131, 0002, 0030, 0015, 0174, 0330, 0113, 0371, 0303, 0015, 0047, 
+  0302, 0360, 0351, 0354, 0143, 0000, 0202, 0061, 0204, 0253, 0351, 0334, 0355, 0304, 0112, 0150, 
+  0166, 0055, 0371, 0271, 0345, 0132, 0361, 0313, 0360, 0301, 0275, 0212, 0036, 0325, 0232, 0236, 
+  0100, 0000, 0160, 0143, 0231, 0352, 0210, 0106, 0033, 0211, 0142, 0054, 0070, 0030, 0144, 0064, 
+  0150, 0066, 0356, 0075, 0062, 0210, 0101, 0331, 0146, 0234, 0062, 0057, 0142, 0002, 0365, 0115, 
+  0135, 0123, 0267, 0210, 0034, 0262, 0322, 0210, 0031, 0330, 0226, 0243, 0226, 0152, 0173, 0125, 
+  0335, 0304, 0014, 0034, 0250, 0141, 0020, 0252, 0214, 0125, 0006, 0335, 0322, 0065, 0175, 0334, 
+  0334, 0255, 0042, 0310, 0013, 0120, 0010, 0050, 0112, 0052, 0163, 0204, 0321, 0213, 0214, 0313, 
+  0270, 0347, 0034, 0117, 0263, 0234, 0340, 0131, 0355, 0031, 0227, 0172, 0002, 0030, 0030, 0327, 
+  0032, 0311, 0116, 0051, 0167, 0212, 0333, 0077, 0133, 0021, 0320, 0160, 0141, 0064, 0111, 0061, 
+  0120, 0372, 0336, 0044, 0270, 0052, 0173, 0223, 0264, 0217, 0360, 0144, 0025, 0020, 0135, 0133, 
+  0251, 0044, 0346, 0060, 0245, 0255, 0326, 0224, 0371, 0030, 0202, 0122, 0045, 0043, 0012, 0047, 
+  0357, 0237, 0010, 0342, 0064, 0204, 0320, 0306, 0306, 0050, 0053, 0355, 0214, 0231, 0230, 0160, 
+  0046, 0121, 0232, 0057, 0153, 0043, 0202, 0304, 0160, 0256, 0240, 0215, 0154, 0261, 0104, 0152, 
+  0165, 0115, 0133, 0041, 0325, 0054, 0154, 0235, 0105, 0032, 0241, 0321, 0010, 0233, 0270, 0242, 
+  0216, 0022, 0200, 0004, 0222, 0026, 0045, 0014, 0253, 0153, 0246, 0210, 0225, 0127, 0112, 0200, 
+  0224, 0202, 0360, 0153, 0050, 0120, 0102, 0242, 0253, 0270, 0000, 0243, 0176, 0357, 0013, 0030, 
+  0034, 0154, 0274, 0204, 0140, 0011, 0317, 0315, 0144, 0201, 0350, 0011, 0300, 0042, 0214, 0226, 
+  0376, 0252, 0012, 0160, 0174, 0261, 0373, 0014, 0314, 0331, 0337, 0154, 0277, 0372, 0012, 0360, 
+  0205, 0053, 0331, 0171, 0130, 0344, 0157, 0250, 0000, 0054, 0246, 0340, 0377, 0251, 0156, 0177, 
+  0237, 0077, 0212, 0151, 0051, 0215, 0274, 0220, 0175, 0270, 0053, 0120, 0305, 0004, 0275, 0220, 
+  0272, 0136, 0054, 0244, 0061, 0127, 0333, 0037, 0054, 0140, 0331, 0025, 0364, 0340, 0342, 0051, 
+  0136, 0163, 0207, 0212, 0265, 0300, 0054, 0317, 0067, 0350, 0305, 0064, 0350, 0337, 0172, 0356, 
+  0030, 0314, 0231, 0215, 0073, 0217, 0210, 0045, 0061, 0107, 0333, 0150, 0100, 0007, 0012, 0125, 
+  0115, 0110, 0114, 0270, 0242, 0156, 0320, 0023, 0062, 0201, 0226, 0320, 0067, 0376, 0150, 0220, 
+  0030, 0273, 0246, 0155, 0145, 0214, 0127, 0112, 0100, 0205, 0340, 0021, 0213, 0066, 0137, 0134, 
+  0135, 0035, 0364, 0201, 0162, 0055, 0072, 0372, 0100, 0005, 0106, 0367, 0107, 0330, 0307, 0271, 
+  0026, 0214, 0117, 0173, 0256, 0305, 0126, 0174, 0240, 0177, 0370, 0057, 0006, 0256, 0065, 0232, 
+  0331, 0337, 0110, 0377, 0207, 0177, 0211, 0126, 0145, 0351, 0262, 0266, 0252, 0243, 0154, 0133, 
+  0077, 0245, 0355, 0266, 0166, 0047, 0267, 0256, 0061, 0333, 0354, 0351, 0125, 0013, 0347, 0152, 
+  0265, 0277, 0244, 0314, 0340, 0036, 0045, 0226, 0031, 0021, 0340, 0250, 0265, 0026, 0004, 0254, 
+  0012, 0226, 0064, 0314, 0252, 0063, 0342, 0170, 0005, 0263, 0016, 0127, 0356, 0311, 0225, 0125, 
+  0236, 0137, 0305, 0025, 0001, 0113, 0243, 0006, 0242, 0015, 0070, 0006, 0026, 0034, 0230, 0337, 
+  0157, 0333, 0366, 0313, 0222, 0306, 0327, 0342, 0303, 0151, 0270, 0174, 0235, 0003, 0262, 0251, 
+  0017, 0227, 0324, 0234, 0240, 0232, 0042, 0117, 0255, 0301, 0305, 0316, 0207, 0213, 0343, 0212, 
+  0163, 0204, 0273, 0061, 0354, 0107, 0127, 0221, 0217, 0245, 0314, 0347, 0311, 0063, 0055, 0317, 
+  0014, 0047, 0026, 0245, 0132, 0372, 0266, 0012, 0127, 0133, 0052, 0014, 0362, 0014, 0167, 0120, 
+  0215, 0074, 0023, 0061, 0272, 0105, 0146, 0303, 0257, 0074, 0102, 0207, 0357, 0162, 0252, 0334, 
+  0171, 0012, 0157, 0026, 0141, 0226, 0375, 0256, 0111, 0250, 0365, 0177, 0047, 0011, 0225, 0345, 
+  0350, 0215, 0175, 0054, 0005, 0332, 0057, 0145, 0003, 0137, 0022, 0210, 0340, 0164, 0346, 0153, 
+  0017, 0045, 0107, 0341, 0077, 0244, 0204, 0376, 0225, 0071, 0170, 0233, 0054, 0357, 0156, 0156, 
+  0375, 0027, 0022, 0167, 0067, 0277, 0000, 0040, 0061, 0201, 0204, 0000, 0050, 0165, 0165, 0141, 
+  0171, 0051, 0144, 0157, 0165, 0142, 0154, 0145, 0055, 0143, 0154, 0151, 0143, 0153, 0055, 0157, 
+  0146, 0146, 0056, 0163, 0166, 0147, 0000, 0000, 0132, 0015, 0000, 0000, 0001, 0000, 0000, 0000, 
+  0170, 0332, 0355, 0127, 0115, 0217, 0333, 0066, 0020, 0275, 0357, 0257, 0120, 0265, 0227, 0024, 
+  0065, 0051, 0222, 0022, 0365, 0025, 0333, 0001, 0332, 0040, 0105, 0200, 0236, 0222, 0264, 0075, 
+  0163, 0045, 0332, 0146, 0043, 0211, 0002, 0105, 0257, 0355, 0375, 0365, 0035, 0312, 0372, 0260, 
+  0167, 0275, 0101, 0200, 0002, 0075, 0024, 0365, 0302, 0260, 0071, 0357, 0015, 0071, 0063, 0234, 
+  0067, 0362, 0056, 0337, 0035, 0353, 0312, 0173, 0224, 0246, 0123, 0272, 0131, 0371, 0024, 0023, 
+  0337, 0223, 0115, 0241, 0113, 0325, 0154, 0127, 0376, 0357, 0137, 0076, 0240, 0324, 0367, 0072, 
+  0053, 0232, 0122, 0124, 0272, 0221, 0053, 0277, 0321, 0376, 0273, 0365, 0335, 0362, 0007, 0204, 
+  0274, 0137, 0214, 0024, 0126, 0226, 0336, 0101, 0331, 0235, 0367, 0261, 0371, 0332, 0025, 0242, 
+  0225, 0336, 0233, 0235, 0265, 0155, 0036, 0004, 0207, 0303, 0001, 0253, 0301, 0210, 0265, 0331, 
+  0006, 0077, 0172, 0010, 0255, 0357, 0356, 0226, 0335, 0343, 0366, 0316, 0363, 0074, 0070, 0267, 
+  0351, 0362, 0262, 0130, 0371, 0203, 0103, 0273, 0067, 0125, 0117, 0054, 0213, 0100, 0126, 0262, 
+  0226, 0215, 0355, 0002, 0212, 0151, 0340, 0317, 0364, 0142, 0246, 0027, 0356, 0164, 0365, 0050, 
+  0013, 0135, 0327, 0272, 0351, 0172, 0317, 0246, 0273, 0277, 0040, 0233, 0162, 0063, 0261, 0135, 
+  0064, 0207, 0260, 0047, 0321, 0054, 0313, 0002, 0302, 0002, 0306, 0020, 0060, 0120, 0167, 0152, 
+  0254, 0070, 0242, 0153, 0127, 0210, 0361, 0226, 0053, 0043, 0204, 0004, 0200, 0315, 0314, 0357, 
+  0143, 0345, 0035, 0024, 0264, 0205, 0367, 0104, 0037, 0015, 0270, 0323, 0173, 0123, 0310, 0015, 
+  0370, 0111, 0334, 0110, 0033, 0274, 0377, 0362, 0176, 0002, 0021, 0301, 0245, 0055, 0057, 0266, 
+  0031, 0353, 0171, 0165, 0352, 0125, 0221, 0033, 0121, 0313, 0256, 0025, 0205, 0354, 0202, 0321, 
+  0336, 0373, 0037, 0124, 0151, 0167, 0160, 0277, 0204, 0264, 0307, 0336, 0260, 0223, 0152, 0273, 
+  0263, 0227, 0226, 0107, 0045, 0017, 0077, 0353, 0343, 0312, 0047, 0036, 0361, 0300, 0354, 0336, 
+  0147, 0140, 0356, 0016, 0332, 0033, 0124, 0271, 0362, 0077, 0377, 0361, 0353, 0047, 0255, 0355, 
+  0171, 0075, 0234, 0224, 0117, 0114, 0202, 0063, 0206, 0103, 0357, 0015, 0213, 0010, 0347, 0121, 
+  0274, 0360, 0030, 0241, 0051, 0042, 0041, 0242, 0364, 0307, 0336, 0145, 0114, 0061, 0057, 0165, 
+  0341, 0142, 0206, 0306, 0222, 0207, 0032, 0332, 0251, 0322, 0133, 0115, 0012, 0145, 0212, 0112, 
+  0342, 0261, 0206, 0323, 0376, 0362, 0330, 0152, 0143, 0321, 0106, 0125, 0362, 0354, 0024, 0354, 
+  0164, 0055, 0203, 0256, 0320, 0207, 0340, 0101, 0331, 0132, 0264, 0270, 0155, 0156, 0373, 0034, 
+  0313, 0026, 0252, 0117, 0343, 0024, 0207, 0141, 0024, 0047, 0067, 0071, 0247, 0147, 0234, 0065, 
+  0220, 0226, 0123, 0244, 0356, 0304, 0322, 0025, 0311, 0271, 0236, 0213, 0360, 0040, 0272, 0163, 
+  0171, 0075, 0257, 0025, 0133, 0150, 0305, 0112, 0233, 0225, 0177, 0277, 0351, 0137, 0003, 0360, 
+  0240, 0115, 0051, 0315, 0010, 0305, 0375, 0353, 0012, 0322, 0160, 0135, 0312, 0236, 0316, 0342, 
+  0033, 0366, 0036, 0003, 0163, 0273, 0116, 0070, 0271, 0215, 0167, 0073, 0121, 0352, 0303, 0312, 
+  0147, 0317, 0301, 0047, 0255, 0353, 0225, 0037, 0341, 0050, 0115, 0243, 0050, 0112, 0237, 0303, 
+  0005, 0134, 0165, 0104, 0061, 0113, 0130, 0234, 0275, 0360, 0055, 0340, 0274, 0070, 0302, 0141, 
+  0112, 0151, 0374, 0002, 0204, 0073, 0333, 0073, 0171, 0242, 0175, 0243, 0054, 0110, 0140, 0150, 
+  0240, 0113, 0367, 0275, 0061, 0216, 0120, 0211, 0223, 0204, 0264, 0373, 0017, 0072, 0220, 0272, 
+  0235, 0076, 0154, 0215, 0053, 0337, 0106, 0124, 0123, 0375, 0046, 0327, 0203, 0152, 0040, 0035, 
+  0064, 0066, 0054, 0113, 0311, 0053, 0214, 0261, 0203, 0263, 0050, 0173, 0205, 0341, 0172, 0371, 
+  0025, 0010, 0322, 0143, 0374, 0025, 0254, 0026, 0107, 0125, 0253, 0047, 0011, 0021, 0122, 0337, 
+  0013, 0372, 0056, 0050, 0345, 0246, 0233, 0357, 0335, 0255, 0050, 0324, 0146, 0104, 0153, 0151, 
+  0105, 0051, 0254, 0230, 0031, 0243, 0005, 0130, 0121, 0337, 0107, 0300, 0202, 0151, 0223, 0177, 
+  0172, 0377, 0341, 0274, 0202, 0165, 0121, 0344, 0177, 0152, 0363, 0165, 0130, 0302, 0313, 0021, 
+  0304, 0203, 0336, 0103, 0122, 0376, 0172, 0062, 0057, 0313, 0042, 0207, 0371, 0000, 0342, 0130, 
+  0253, 0032, 0356, 0333, 0215, 0226, 0237, 0140, 0036, 0054, 0203, 0031, 0270, 0042, 0333, 0123, 
+  0053, 0347, 0115, 0317, 0333, 0032, 0171, 0036, 0064, 0067, 0247, 0155, 0131, 0324, 0312, 0071, 
+  0005, 0237, 0255, 0252, 0252, 0217, 0356, 0220, 0041, 0263, 0213, 0115, 0225, 0255, 0344, 0272, 
+  0077, 0363, 0374, 0165, 0314, 0042, 0030, 0322, 0030, 0222, 0014, 0056, 0262, 0134, 0006, 0143, 
+  0031, 0372, 0325, 0166, 0056, 0317, 0125, 0103, 0114, 0365, 0337, 0032, 0275, 0157, 0153, 0135, 
+  0312, 0201, 0360, 0034, 0257, 0304, 0203, 0254, 0126, 0376, 0157, 0016, 0363, 0350, 0130, 0326, 
+  0126, 0330, 0335, 0030, 0352, 0044, 0126, 0227, 0316, 0312, 0207, 0007, 0327, 0270, 0011, 0140, 
+  0366, 0124, 0201, 0155, 0220, 0123, 0116, 0337, 0302, 0030, 0251, 0362, 0373, 0064, 0021, 0234, 
+  0307, 0375, 0002, 0135, 0143, 0310, 0354, 0053, 0231, 0067, 0272, 0171, 0002, 0221, 0276, 0355, 
+  0254, 0321, 0137, 0145, 0176, 0237, 0211, 0007, 0226, 0320, 0141, 0171, 0156, 0323, 0234, 0342, 
+  0204, 0263, 0060, 0043, 0151, 0074, 0332, 0053, 0325, 0310, 0277, 0264, 0152, 0162, 0250, 0254, 
+  0064, 0243, 0265, 0137, 0124, 0320, 0134, 0066, 0217, 0106, 0133, 0051, 0100, 0300, 0306, 0210, 
+  0223, 0073, 0111, 0216, 0326, 0051, 0222, 0051, 0174, 0127, 0066, 0227, 0152, 0304, 0171, 0350, 
+  0277, 0310, 0267, 0123, 0245, 0004, 0045, 0336, 0100, 0234, 0314, 0023, 0202, 0071, 0317, 0050, 
+  0247, 0067, 0140, 0067, 0170, 0302, 0024, 0047, 0111, 0034, 0105, 0057, 0141, 0103, 0235, 0120, 
+  0160, 0034, 0207, 0121, 0164, 0143, 0163, 0303, 0234, 0104, 0161, 0032, 0322, 0204, 0335, 0330, 
+  0134, 0230, 0055, 0235, 0065, 0170, 0015, 0260, 0176, 0340, 0105, 0011, 0315, 0222, 0170, 0116, 
+  0162, 0274, 0352, 0115, 0045, 0254, 0313, 0351, 0331, 0224, 0270, 0140, 0100, 0257, 0064, 0075, 
+  0116, 0156, 0140, 0360, 0173, 0105, 0017, 0022, 0236, 0141, 0047, 0113, 0057, 0213, 0061, 0143, 
+  0214, 0147, 0341, 0142, 0312, 0332, 0103, 0064, 0303, 0054, 0112, 0170, 0312, 0026, 0024, 0236, 
+  0161, 0224, 0305, 0267, 0114, 0144, 0201, 0030, 0003, 0147, 0316, 0346, 0257, 0064, 0363, 0106, 
+  0142, 0070, 0021, 0237, 0136, 0006, 0144, 0041, 0242, 0316, 0151, 0025, 0025, 0060, 0026, 0245, 
+  0161, 0243, 0011, 0121, 0127, 0067, 0102, 0302, 0154, 0342, 0117, 0064, 0210, 0124, 0130, 0243, 
+  0216, 0157, 0240, 0104, 0111, 0032, 0207, 0204, 0056, 0010, 0374, 0271, 0003, 0322, 0020, 0102, 
+  0136, 0040, 0036, 0343, 0030, 0056, 0064, 0135, 0040, 0112, 0070, 0346, 0011, 0035, 0237, 0254, 
+  0337, 0076, 0267, 0177, 0314, 0204, 0054, 0011, 0031, 0341, 0022, 0021, 0076, 0351, 0374, 0037, 
+  0312, 0250, 0357, 0335, 0357, 0326, 0020, 0027, 0161, 0026, 0205, 0317, 0065, 0304, 0343, 0004, 
+  0236, 0123, 0374, 0137, 0322, 0020, 0042, 0377, 0253, 0350, 0277, 0240, 0042, 0006, 0351, 0163, 
+  0222, 0245, 0337, 0126, 0021, 0203, 0032, 0105, 0131, 0072, 0250, 0010, 0216, 0344, 0064, 0116, 
+  0026, 0050, 0346, 0230, 0205, 0151, 0022, 0206, 0040, 0043, 0026, 0301, 0116, 0031, 0017, 0277, 
+  0123, 0106, 0031, 0316, 0050, 0334, 0027, 0143, 0040, 0243, 0170, 0374, 0041, 0020, 0154, 0341, 
+  0177, 0043, 0367, 0200, 0136, 0337, 0375, 0015, 0245, 0041, 0334, 0014, 0000, 0050, 0165, 0165, 
+  0141, 0171, 0051, 0144, 0157, 0165, 0142, 0154, 0145, 0055, 0143, 0154, 0151, 0143, 0153, 0055, 
+  0157, 0156, 0056, 0163, 0166, 0147, 0000, 0000, 0345, 0056, 0000, 0000, 0001, 0000, 0000, 0000, 
+  0170, 0332, 0355, 0132, 0333, 0162, 0333, 0310, 0021, 0175, 0367, 0127, 0040, 0364, 0213, 0135, 
+  0001, 0206, 0163, 0277, 0160, 0105, 0155, 0045, 0161, 0155, 0152, 0253, 0222, 0227, 0335, 0115, 
+  0362, 0014, 0021, 0220, 0204, 0230, 0004, 0130, 0040, 0044, 0112, 0376, 0372, 0075, 0003, 0002, 
+  0340, 0015, 0200, 0055, 0257, 0045, 0227, 0135, 0053, 0227, 0155, 0142, 0272, 0201, 0351, 0231, 
+  0351, 0163, 0372, 0064, 0250, 0213, 0037, 0037, 0126, 0313, 0340, 0076, 0055, 0067, 0131, 0221, 
+  0317, 0047, 0214, 0320, 0111, 0220, 0346, 0213, 0042, 0311, 0362, 0233, 0371, 0344, 0077, 0277, 
+  0375, 0024, 0331, 0111, 0260, 0251, 0342, 0074, 0211, 0227, 0105, 0236, 0316, 0047, 0171, 0061, 
+  0371, 0361, 0362, 0325, 0305, 0137, 0242, 0050, 0370, 0107, 0231, 0306, 0125, 0232, 0004, 0333, 
+  0254, 0272, 0015, 0176, 0316, 0337, 0157, 0026, 0361, 0072, 0015, 0336, 0334, 0126, 0325, 0172, 
+  0066, 0235, 0156, 0267, 0133, 0222, 0065, 0203, 0244, 0050, 0157, 0246, 0157, 0203, 0050, 0272, 
+  0174, 0365, 0352, 0142, 0163, 0177, 0363, 0052, 0010, 0002, 0314, 0233, 0157, 0146, 0311, 0142, 
+  0076, 0151, 0156, 0130, 0337, 0225, 0313, 0332, 0061, 0131, 0114, 0323, 0145, 0272, 0112, 0363, 
+  0152, 0063, 0145, 0204, 0115, 0047, 0173, 0367, 0305, 0336, 0175, 0341, 0147, 0317, 0356, 0323, 
+  0105, 0261, 0132, 0025, 0371, 0246, 0276, 0063, 0337, 0274, 0076, 0160, 0056, 0223, 0353, 0316, 
+  0333, 0107, 0263, 0025, 0265, 0023, 0163, 0316, 0115, 0051, 0237, 0162, 0036, 0301, 0043, 0332, 
+  0074, 0346, 0125, 0374, 0020, 0035, 0337, 0212, 0030, 0373, 0156, 0345, 0224, 0322, 0051, 0154, 
+  0173, 0317, 0117, 0363, 0232, 0155, 0260, 0241, 0153, 0374, 0355, 0334, 0333, 0001, 0262, 0051, 
+  0356, 0312, 0105, 0172, 0215, 0373, 0122, 0222, 0247, 0325, 0364, 0335, 0157, 0357, 0072, 0143, 
+  0104, 0111, 0122, 0045, 0007, 0217, 0151, 0367, 0363, 0150, 0326, 0243, 0115, 0316, 0343, 0125, 
+  0272, 0131, 0307, 0213, 0164, 0063, 0155, 0307, 0353, 0373, 0267, 0131, 0122, 0335, 0342, 0174, 
+  0051, 0135, 0077, 0324, 0003, 0267, 0151, 0166, 0163, 0133, 0035, 0216, 0334, 0147, 0351, 0366, 
+  0357, 0305, 0303, 0174, 0102, 0003, 0032, 0140, 0330, 0377, 0335, 0031, 0366, 0331, 0301, 0352, 
+  0201, 0054, 0231, 0117, 0176, 0375, 0357, 0077, 0177, 0051, 0212, 0152, 0167, 0335, 0314, 0064, 
+  0353, 0074, 0051, 0161, 0234, 0210, 0340, 0015, 0227, 0124, 0051, 0251, 0303, 0200, 0123, 0146, 
+  0043, 0052, 0042, 0306, 0336, 0326, 0267, 0264, 0113, 0234, 0045, 0305, 0302, 0307, 0214, 0304, 
+  0112, 0267, 0053, 0244, 0323, 0262, 0270, 0051, 0110, 0273, 0171, 0335, 0203, 0323, 0207, 0165, 
+  0121, 0126, 0321, 0165, 0266, 0114, 0167, 0336, 0323, 0333, 0142, 0225, 0116, 0067, 0213, 0142, 
+  0073, 0275, 0312, 0252, 0125, 0274, 0046, 0353, 0274, 0377, 0236, 0207, 0144, 0215, 0155, 0147, 
+  0332, 0022, 0041, 0244, 0066, 0275, 0076, 0217, 0047, 0076, 0227, 0160, 0272, 0350, 0102, 0364, 
+  0063, 0046, 0176, 0167, 0374, 0255, 0273, 0325, 0137, 0305, 0233, 0335, 0276, 0006, 0301, 0072, 
+  0276, 0101, 0016, 0056, 0213, 0162, 0076, 0171, 0175, 0135, 0377, 0064, 0206, 0253, 0242, 0114, 
+  0322, 0262, 0065, 0351, 0372, 0347, 0310, 0124, 0340, 0234, 0262, 0352, 0161, 0207, 0272, 0346, 
+  0331, 0155, 0140, 0376, 0251, 0235, 0235, 0366, 0333, 0067, 0267, 0161, 0122, 0154, 0347, 0023, 
+  0176, 0152, 0374, 0120, 0024, 0253, 0371, 0104, 0022, 0151, 0255, 0224, 0322, 0236, 0232, 0027, 
+  0070, 0143, 0211, 0071, 0245, 0263, 0356, 0334, 0210, 0371, 0264, 0040, 0116, 0050, 0145, 0344, 
+  0251, 0021, 0207, 0165, 0347, 0161, 0031, 0335, 0345, 0131, 0205, 0334, 0157, 0062, 0347, 0360, 
+  0366, 0273, 0262, 0364, 0016, 0313, 0370, 0061, 0305, 0262, 0353, 0377, 0130, 0343, 0264, 0271, 
+  0055, 0266, 0067, 0245, 0337, 0276, 0353, 0170, 0331, 0355, 0137, 0167, 0353, 0066, 0313, 0261, 
+  0234, 0250, 0315, 0124, 0156, 0351, 0200, 0107, 0233, 0272, 0116, 0272, 0001, 0017, 0237, 0304, 
+  0003, 0046, 0054, 0217, 0253, 0001, 0333, 0052, 0176, 0310, 0126, 0331, 0207, 0024, 0021, 0262, 
+  0111, 0060, 0255, 0263, 0040, 0111, 0257, 0067, 0373, 0163, 0367, 0127, 0114, 0330, 0316, 0272, 
+  0112, 0253, 0070, 0211, 0253, 0170, 0357, 0321, 0216, 0300, 0113, 0326, 0171, 0004, 0057, 0320, 
+  0314, 0354, 0227, 0167, 0077, 0355, 0256, 0160, 0275, 0130, 0314, 0376, 0127, 0224, 0357, 0233, 
+  0113, 0374, 0170, 0207, 0370, 0252, 0270, 0303, 0242, 0046, 0227, 0335, 0360, 0105, 0262, 0230, 
+  0201, 0030, 0200, 0212, 0313, 0154, 0205, 0363, 0366, 0234, 0362, 0127, 0020, 0301, 0305, 0164, 
+  0157, 0070, 0162, 0256, 0036, 0327, 0351, 0376, 0241, 0273, 0307, 0226, 0351, 0216, 0141, 0172, 
+  0151, 0066, 0131, 0254, 0062, 0177, 0323, 0364, 0327, 0052, 0133, 0056, 0177, 0366, 0223, 0064, 
+  0053, 0073, 0170, 0150, 0126, 0055, 0323, 0313, 0172, 0316, 0335, 0307, 0166, 0025, 0323, 0146, 
+  0031, 0315, 0042, 0247, 0007, 0253, 0274, 0230, 0266, 0333, 0120, 0137, 0335, 0354, 0267, 0347, 
+  0050, 0041, 0272, 0375, 0277, 0051, 0213, 0273, 0365, 0252, 0110, 0322, 0306, 0341, 0324, 0276, 
+  0214, 0257, 0322, 0345, 0174, 0362, 0057, 0157, 0013, 0130, 0273, 0255, 0353, 0270, 0272, 0155, 
+  0103, 0355, 0300, 0352, 0227, 0063, 0237, 0240, 0142, 0265, 0017, 0201, 0255, 0172, 0134, 0142, 
+  0254, 0201, 0323, 0214, 0375, 0000, 0032, 0131, 0316, 0136, 0133, 0023, 0053, 0245, 0353, 0213, 
+  0350, 0330, 0026, 0225, 0167, 0313, 0164, 0226, 0027, 0371, 0007, 0200, 0364, 0207, 0115, 0125, 
+  0026, 0357, 0323, 0331, 0153, 0027, 0137, 0161, 0303, 0232, 0313, 0135, 0232, 0316, 0030, 0061, 
+  0212, 0013, 0107, 0255, 0156, 0307, 0227, 0131, 0236, 0376, 0277, 0310, 0362, 0031, 0166, 0066, 
+  0055, 0333, 0321, 0372, 0142, 0211, 0344, 0252, 0146, 0262, 0035, 0113, 0142, 0000, 0270, 0054, 
+  0343, 0107, 0077, 0123, 0332, 0216, 0166, 0221, 0164, 0341, 0373, 0155, 0363, 0113, 0225, 0112, 
+  0211, 0311, 0331, 0172, 0067, 0131, 0222, 0002, 0211, 0075, 0026, 0017, 0163, 0103, 0211, 0122, 
+  0216, 0051, 0326, 0143, 0366, 0304, 0043, 0054, 0061, 0106, 0113, 0171, 0156, 0056, 0231, 0007, 
+  0012, 0321, 0132, 0110, 0331, 0363, 0360, 0222, 0173, 0210, 0022, 0053, 0230, 0341, 0075, 0017, 
+  0217, 0313, 0033, 0266, 0307, 0340, 0261, 0201, 0327, 0204, 0047, 0015, 0163, 0106, 0357, 0027, 
+  0331, 0036, 0365, 0365, 0062, 0256, 0374, 0232, 0116, 0130, 0342, 0300, 0003, 0271, 0222, 0327, 
+  0166, 0332, 0143, 0203, 0120, 0051, 0032, 0010, 0357, 0315, 0036, 0226, 0201, 0323, 0204, 0163, 
+  0256, 0234, 0010, 0273, 0125, 0007, 0021, 0163, 0204, 0113, 0243, 0054, 0017, 0031, 0212, 0033, 
+  0343, 0272, 0157, 0210, 0206, 0021, 0347, 0270, 0131, 0361, 0375, 0107, 0346, 0202, 0326, 0121, 
+  0164, 0216, 0037, 0316, 0003, 0252, 0020, 0321, 0306, 0143, 0065, 0132, 0200, 0026, 0323, 0322, 
+  0123, 0123, 0304, 0374, 0276, 0121, 0052, 0134, 0347, 0337, 0271, 0041, 0322, 0270, 0052, 0263, 
+  0207, 0067, 0330, 0042, 0143, 0265, 0240, 0054, 0244, 0370, 0343, 0047, 0260, 0002, 0041, 0207, 
+  0221, 0322, 0104, 0343, 0100, 0155, 0030, 0061, 0252, 0210, 0062, 0254, 0055, 0251, 0343, 0363, 
+  0326, 0145, 0106, 0160, 0043, 0070, 0125, 0151, 0104, 0125, 0207, 0363, 0077, 0010, 0243, 0072, 
+  0167, 0077, 0031, 0103, 0052, 0326, 0116, 0212, 0123, 0014, 0051, 0155, 0120, 0247, 0324, 0013, 
+  0141, 0050, 0242, 0177, 0242, 0350, 0173, 0100, 0021, 0307, 0362, 0025, 0205, 0206, 0031, 0105, 
+  0021, 0307, 0036, 0101, 0350, 0064, 0050, 0302, 0224, 0212, 0151, 0023, 0106, 0132, 0021, 0056, 
+  0254, 0021, 0002, 0060, 0342, 0322, 0153, 0041, 0045, 0076, 0021, 0106, 0216, 0070, 0206, 0363, 
+  0342, 0034, 0060, 0322, 0003, 0060, 0172, 0066, 0250, 0070, 0056, 0265, 0145, 0306, 0276, 0000, 
+  0124, 0254, 0121, 0223, 0001, 0136, 0210, 0313, 0105, 0077, 0122, 0042, 0017, 0025, 0353, 0070, 
+  0025, 0003, 0120, 0041, 0316, 0171, 0250, 0367, 0141, 0301, 0253, 0122, 0103, 0264, 0242, 0324, 
+  0231, 0036, 0363, 0143, 0153, 0146, 0312, 0366, 0000, 0030, 0114, 0005, 0365, 0244, 0221, 0102, 
+  0024, 0133, 0244, 0317, 0075, 0322, 0074, 0361, 0232, 0330, 0002, 0211, 0316, 0270, 0343, 0254, 
+  0216, 0270, 0040, 0032, 0131, 0142, 0175, 0146, 0040, 0145, 0220, 0126, 0132, 0007, 0161, 0320, 
+  0305, 0023, 0166, 0123, 0007, 0165, 0167, 0204, 0073, 0040, 0257, 0205, 0002, 0053, 0207, 0212, 
+  0342, 0016, 0152, 0050, 0325, 0143, 0376, 0112, 0241, 0267, 0240, 0306, 0251, 0060, 0062, 0104, 
+  0152, 0314, 0341, 0306, 0334, 0031, 0036, 0252, 0205, 0206, 0267, 0102, 0314, 0226, 0162, 0063, 
+  0342, 0055, 0055, 0261, 0310, 0025, 0240, 0112, 0023, 0247, 0044, 0052, 0305, 0010, 0044, 0320, 
+  0124, 0152, 0307, 0240, 0144, 0054, 0036, 0116, 0211, 0361, 0150, 0226, 0306, 0205, 0365, 0107, 
+  0124, 0026, 0041, 0303, 0306, 0105, 0121, 0241, 0075, 0156, 0336, 0236, 0157, 0146, 0261, 0116, 
+  0321, 0345, 0125, 0345, 0135, 0372, 0221, 0072, 0162, 0340, 0330, 0023, 0122, 0131, 0124, 0150, 
+  0371, 0336, 0104, 0114, 0010, 0142, 0004, 0245, 0374, 0355, 0351, 0271, 0240, 0302, 0121, 0113, 
+  0065, 0326, 0346, 0153, 0035, 0272, 0022, 0147, 0374, 0271, 0050, 0142, 0245, 0146, 0322, 0205, 
+  0335, 0247, 0356, 0134, 0160, 0222, 0006, 0204, 0012, 0223, 0045, 0014, 0004, 0305, 0250, 0031, 
+  0363, 0127, 0002, 0136, 0116, 0013, 0353, 0317, 0105, 0160, 0115, 0225, 0034, 0163, 0167, 0304, 
+  0150, 0247, 0021, 0015, 0047, 0306, 0142, 0253, 0305, 0210, 0063, 0216, 0211, 0012, 0351, 0260, 
+  0237, 0130, 0006, 0270, 0306, 0061, 0061, 0226, 0226, 0330, 0161, 0075, 0232, 0330, 0050, 0136, 
+  0003, 0270, 0150, 0047, 0036, 0100, 0325, 0260, 0331, 0143, 0222, 0343, 0321, 0112, 0160, 0053, 
+  0206, 0041, 0155, 0250, 0347, 0312, 0117, 0141, 0203, 0075, 0173, 0070, 0376, 0105, 0225, 0103, 
+  0277, 0372, 0336, 0321, 0241, 0222, 0137, 0236, 0016, 0237, 0215, 0327, 0233, 0266, 0343, 0053, 
+  0362, 0272, 0323, 0237, 0305, 0353, 0226, 0131, 0047, 0006, 0163, 0210, 0013, 0304, 0117, 0371, 
+  0100, 0006, 0242, 0302, 0162, 0015, 0034, 0017, 0344, 0157, 0155, 0106, 0061, 0176, 0172, 0372, 
+  0167, 0360, 0161, 0102, 0060, 0171, 0312, 0036, 0140, 0132, 0246, 0165, 0315, 0242, 0204, 0051, 
+  0024, 0177, 0316, 0075, 0173, 0264, 0321, 0204, 0335, 0304, 0035, 0173, 0170, 0130, 0063, 0020, 
+  0157, 0050, 0121, 0007, 0254, 0225, 0320, 0313, 0143, 0376, 0012, 0032, 0314, 0151, 0124, 0074, 
+  0317, 0036, 0140, 0114, 0141, 0314, 0230, 0273, 0327, 0072, 0326, 0023, 0002, 0152, 0206, 0121, 
+  0250, 0036, 0154, 0304, 0033, 0260, 0345, 0316, 0032, 0315, 0103, 0137, 0154, 0100, 0310, 0114, 
+  0262, 0217, 0363, 0272, 0264, 0134, 0066, 0274, 0256, 0231, 0021, 0046, 0154, 0050, 0236, 0233, 
+  0216, 0327, 0301, 0104, 0356, 0171, 0171, 0375, 0070, 0044, 0341, 0114, 0133, 0152, 0064, 0127, 
+  0252, 0211, 0010, 0224, 0044, 0332, 0210, 0020, 0263, 0071, 0216, 0250, 0071, 0100, 0107, 0230, 
+  0225, 0226, 0326, 0364, 0117, 0215, 0144, 0322, 0326, 0145, 0231, 0023, 0141, 0255, 0325, 0330, 
+  0263, 0372, 0223, 0321, 0335, 0371, 0241, 0041, 0107, 0255, 0124, 0322, 0357, 0246, 0301, 0362, 
+  0061, 0313, 0210, 0273, 0164, 0104, 0120, 0141, 0374, 0363, 0321, 0125, 0071, 0043, 0265, 0033, 
+  0361, 0266, 0304, 0031, 0056, 0131, 0030, 0241, 0262, 0070, 0111, 0215, 0140, 0303, 0316, 0022, 
+  0005, 0215, 0063, 0121, 0037, 0036, 0076, 0242, 0137, 0323, 0146, 0070, 0173, 0045, 0163, 0332, 
+  0361, 0261, 0354, 0307, 0154, 0224, 0271, 0001, 0370, 0064, 0123, 0017, 0140, 0257, 0015, 0161, 
+  0010, 0271, 0102, 0162, 0207, 0124, 0034, 0006, 0276, 0103, 0217, 0101, 0355, 0023, 0331, 0337, 
+  0116, 0276, 0145, 0061, 0374, 0245, 0222, 0237, 0132, 0245, 0245, 0150, 0222, 0337, 0141, 0043, 
+  0355, 0056, 0373, 0071, 0064, 0007, 0153, 0262, 0037, 0374, 0244, 0317, 0222, 0377, 0337, 0110, 
+  0116, 0337, 0256, 0010, 0125, 0303, 0326, 0112, 0252, 0254, 0241, 0052, 0370, 0133, 0040, 0360, 
+  0000, 0013, 0275, 0242, 0303, 0372, 0023, 0020, 0301, 0072, 0066, 0062, 0304, 0102, 0127, 0332, 
+  0332, 0102, 0101, 0230, 0154, 0314, 0333, 0011, 0337, 0077, 0072, 0244, 0150, 0255, 0262, 0200, 
+  0033, 0065, 0352, 0016, 0351, 0343, 0040, 0214, 0261, 0032, 0007, 0001, 0353, 0070, 0243, 0162, 
+  0314, 0137, 0073, 0102, 0375, 0113, 0120, 0010, 0053, 0360, 0260, 0160, 0310, 0100, 0066, 0214, 
+  0000, 0312, 0220, 0300, 0156, 0014, 0001, 0020, 0122, 0326, 0014, 0040, 0240, 0233, 0274, 0037, 
+  0002, 0135, 0224, 0375, 0020, 0020, 0136, 0152, 0043, 0200, 0101, 0010, 0200, 0124, 0064, 0020, 
+  0314, 0237, 0002, 0001, 0173, 0050, 0267, 0236, 0027, 0001, 0134, 0175, 0103, 0362, 0147, 0104, 
+  0307, 0075, 0307, 0072, 0316, 0216, 0245, 0357, 0045, 0316, 0107, 0305, 0017, 0203, 0174, 0007, 
+  0076, 0334, 0120, 0376, 0010, 0053, 0250, 0264, 0003, 0115, 0055, 0212, 0030, 0105, 0007, 0047, 
+  0006, 0304, 0117, 0155, 0326, 0322, 0214, 0322, 0077, 0344, 0215, 0321, 0043, 0335, 0003, 0112, 
+  0050, 0073, 0170, 0203, 0324, 0020, 0010, 0000, 0016, 0031, 0256, 0153, 0242, 0361, 0335, 0212, 
+  0124, 0122, 0200, 0101, 0272, 0200, 0302, 0156, 0356, 0216, 0101, 0054, 0121, 0232, 0013, 0306, 
+  0275, 0211, 0113, 0364, 0312, 0172, 0314, 0335, 0325, 0375, 0074, 0100, 0036, 0102, 0241, 0240, 
+  0277, 0101, 0207, 0066, 0352, 0156, 0241, 0150, 0120, 0114, 0020, 0220, 0005, 0231, 0100, 0365, 
+  0120, 0061, 0346, 0257, 0121, 0147, 0065, 0105, 0136, 0324, 0035, 0024, 0124, 0263, 0265, 0354, 
+  0343, 0214, 0313, 0205, 0347, 0034, 0117, 0263, 0202, 0342, 0263, 0336, 0061, 0056, 0263, 0165, 
+  0217, 0267, 0143, 0134, 0147, 0025, 0177, 0071, 0005, 0104, 0015, 0226, 0320, 0205, 0004, 0011, 
+  0044, 0233, 0220, 0260, 0124, 0325, 0204, 0144, 0374, 0011, 0367, 0126, 0001, 0131, 0277, 0054, 
+  0326, 0136, 0066, 0101, 0035, 0072, 0143, 0030, 0367, 0147, 0010, 0112, 0125, 0234, 0152, 0354, 
+  0274, 0377, 0104, 0145, 0247, 0122, 0224, 0043, 0250, 0366, 0116, 0271, 0220, 0133, 0364, 0237, 
+  0020, 0134, 0174, 0304, 0033, 0047, 0110, 0255, 0020, 0032, 0336, 0310, 0026, 0107, 0025, 0024, 
+  0314, 0210, 0267, 0106, 0252, 0071, 0304, 0352, 0345, 0256, 0103, 0237, 0215, 0376, 0166, 0304, 
+  0035, 0045, 0000, 0011, 0244, 0352, 0016, 0330, 0353, 0041, 0115, 0335, 0210, 0204, 0367, 0337, 
+  0024, 0323, 0321, 0026, 0100, 0113, 0005, 0241, 0070, 0000, 0243, 0146, 0356, 0001, 0014, 0266, 
+  0061, 0016, 0041, 0130, 0141, 0345, 0266, 0267, 0100, 0064, 0004, 0340, 0160, 0214, 0216, 0075, 
+  0251, 0002, 0034, 0276, 0345, 0172, 0336, 0306, 0361, 0233, 0252, 0000, 0057, 0134, 0311, 0316, 
+  0217, 0345, 0163, 0136, 0153, 0162, 0110, 0160, 0356, 0244, 0030, 0312, 0037, 0215, 0246, 0103, 
+  0131, 0065, 0220, 0175, 0212, 0150, 0246, 0271, 0144, 0003, 0251, 0353, 0315, 0122, 0331, 0321, 
+  0327, 0232, 0150, 0144, 0171, 0137, 0213, 0320, 0241, 0207, 0012, 0047, 0117, 0271, 0103, 0023, 
+  0003, 0161, 0317, 0075, 0337, 0100, 0213, 0241, 0055, 0022, 0316, 0163, 0107, 0033, 0116, 0330, 
+  0315, 0334, 0041, 0226, 0242, 0035, 0200, 0324, 0001, 0035, 0150, 0124, 0065, 0251, 0160, 0303, 
+  0210, 0273, 0205, 0046, 0344, 0022, 0222, 0320, 0277, 0316, 0207, 0100, 0102, 0173, 0075, 0342, 
+  0355, 0024, 0301, 0045, 0243, 0326, 0167, 0133, 0150, 0203, 0001, 0327, 0321, 0247, 0203, 0076, 
+  0120, 0256, 0167, 0057, 0320, 0120, 0201, 0241, 0376, 0016, 0336, 0057, 0014, 0162, 0055, 0030, 
+  0237, 0065, 0134, 0213, 0251, 0104, 0113, 0377, 0130, 0177, 0333, 0000, 0033, 0153, 0370, 0347, 
+  0066, 0300, 0373, 0137, 0164, 0050, 0362, 0074, 0135, 0124, 0105, 0031, 0055, 0356, 0312, 0373, 
+  0270, 0272, 0053, 0323, 0243, 0357, 0122, 0272, 0154, 0073, 0171, 0325, 0354, 0137, 0321, 0032, 
+  0377, 0325, 0103, 0210, 0345, 0061, 0352, 0270, 0225, 0001, 0266, 0332, 0030, 0111, 0301, 0252, 
+  0140, 0111, 0313, 0235, 0076, 0043, 0216, 0023, 0230, 0325, 0270, 0112, 0357, 0323, 0274, 0110, 
+  0222, 0121, 0134, 0241, 0171, 0103, 0071, 0227, 0220, 0001, 0207, 0300, 0302, 0002, 0146, 0127, 
+  0167, 0125, 0365, 0262, 0244, 0361, 0255, 0254, 0341, 0370, 0270, 0174, 0235, 0003, 0262, 0231, 
+  0077, 0056, 0205, 0046, 0034, 0325, 0024, 0171, 0352, 0054, 0032, 0073, 0177, 0134, 0002, 0055, 
+  0316, 0001, 0356, 0272, 0143, 0077, 0150, 0105, 0076, 0226, 0062, 0337, 0335, 0236, 0371, 0057, 
+  0362, 0100, 0226, 0306, 0204, 0306, 0022, 0241, 0241, 0000, 0004, 0122, 0134, 0032, 0055, 0031, 
+  0363, 0173, 0206, 0226, 0035, 0245, 0276, 0147, 0317, 0314, 0037, 0333, 0263, 0047, 0143, 0123, 
+  0273, 0263, 0300, 0015, 0032, 0134, 0350, 0104, 0003, 0154, 0062, 0246, 0255, 0102, 0340, 0350, 
+  0114, 0251, 0364, 0161, 0153, 0164, 0201, 0207, 0002, 0346, 0117, 0150, 0176, 0335, 0064, 0303, 
+  0354, 0100, 0244, 0177, 0177, 0001, 0021, 0253, 0274, 0330, 0307, 0151, 0101, 0310, 0371, 0267, 
+  0054, 0302, 0253, 0346, 0303, 0227, 0136, 0335, 0241, 0033, 0366, 0302, 0131, 0166, 0360, 0305, 
+  0111, 0227, 0145, 0116, 0101, 0013, 0207, 0234, 0022, 0110, 0136, 0112, 0015, 0342, 0306, 0277, 
+  0034, 0052, 0134, 0020, 0014, 0034, 0152, 0334, 0357, 0040, 0311, 0236, 0276, 0143, 0352, 0214, 
+  0204, 0251, 0103, 0333, 0241, 0174, 0213, 0350, 0000, 0114, 0151, 0261, 0143, 0034, 0103, 0330, 
+  0104, 0111, 0320, 0371, 0162, 0067, 0371, 0306, 0123, 0172, 0377, 0333, 0246, 0105, 0222, 0172, 
+  0071, 0272, 0231, 0117, 0026, 0213, 0147, 0105, 0255, 0061, 0137, 0247, 0240, 0152, 0047, 0320, 
+  0347, 0373, 0263, 0224, 0150, 0045, 0265, 0363, 0034, 0053, 0251, 0024, 0054, 0364, 0072, 0232, 
+  0321, 0203, 0343, 0337, 0247, 0304, 0123, 0153, 0303, 0305, 0364, 0346, 0362, 0325, 0205, 0377, 
+  0225, 0311, 0313, 0127, 0277, 0003, 0375, 0012, 0022, 0103, 0000, 0050, 0165, 0165, 0141, 0171, 
+  0051, 0155, 0141, 0164, 0145, 0055, 0155, 0157, 0165, 0163, 0145, 0055, 0160, 0162, 0157, 0160, 
+  0145, 0162, 0164, 0151, 0145, 0163, 0056, 0165, 0151, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 
+  0373, 0203, 0001, 0000, 0001, 0000, 0000, 0000, 0170, 0332, 0355, 0135, 0133, 0163, 0333, 0270, 
+  0025, 0176, 0367, 0257, 0100, 0365, 0264, 0235, 0206, 0266, 0050, 0071, 0316, 0145, 0155, 0355, 
+  0070, 0216, 0235, 0170, 0352, 0044, 0036, 0313, 0351, 0316, 0076, 0161, 0040, 0022, 0022, 0121, 
+  0123, 0204, 0112, 0100, 0126, 0324, 0351, 0217, 0057, 0000, 0122, 0167, 0112, 0274, 0312, 0026, 
+  0245, 0223, 0207, 0214, 0105, 0002, 0207, 0300, 0001, 0316, 0025, 0037, 0200, 0363, 0077, 0176, 
+  0365, 0075, 0364, 0114, 0002, 0116, 0231, 0177, 0121, 0063, 0217, 0353, 0065, 0104, 0174, 0233, 
+  0071, 0324, 0357, 0135, 0324, 0176, 0076, 0336, 0030, 0357, 0153, 0177, 0264, 0216, 0316, 0377, 
+  0146, 0030, 0350, 0013, 0361, 0111, 0200, 0005, 0161, 0320, 0210, 0012, 0027, 0365, 0074, 0354, 
+  0020, 0324, 0074, 0156, 0276, 0077, 0066, 0321, 0321, 0121, 0137, 0276, 0061, 0372, 0154, 0310, 
+  0211, 0061, 0010, 0330, 0200, 0004, 0202, 0022, 0216, 0014, 0244, 0037, 0241, 0271, 0107, 0016, 
+  0305, 0036, 0353, 0111, 0032, 0276, 0303, 0106, 0107, 0127, 0154, 0060, 0016, 0150, 0317, 0025, 
+  0350, 0267, 0253, 0277, 0243, 0157, 0227, 0217, 0327, 0350, 0063, 0171, 0046, 0236, 0052, 0316, 
+  0217, 0216, 0036, 0135, 0312, 0125, 0345, 0136, 0200, 0373, 0110, 0376, 0331, 0015, 0010, 0101, 
+  0234, 0165, 0305, 0010, 0007, 0344, 0167, 0064, 0146, 0103, 0144, 0143, 0037, 0005, 0304, 0241, 
+  0134, 0004, 0264, 0063, 0024, 0004, 0121, 0201, 0260, 0357, 0234, 0260, 0340, 0250, 0057, 0373, 
+  0321, 0035, 0253, 0007, 0103, 0337, 0041, 0001, 0022, 0056, 0101, 0202, 0004, 0175, 0216, 0130, 
+  0127, 0377, 0370, 0362, 0375, 0147, 0324, 0055, 0017, 0335, 0017, 0073, 0036, 0265, 0321, 0035, 
+  0265, 0211, 0317, 0311, 0021, 0226, 0337, 0125, 0117, 0270, 0053, 0073, 0334, 0031, 0353, 0342, 
+  0067, 0352, 0353, 0355, 0350, 0353, 0350, 0206, 0111, 0252, 0130, 0110, 0306, 0375, 0216, 0210, 
+  0344, 0210, 0374, 0100, 0304, 0110, 0324, 0070, 0212, 0076, 0020, 0121, 0173, 0203, 0130, 0200, 
+  0176, 0303, 0102, 0065, 0070, 0100, 0154, 0240, 0052, 0375, 0135, 0266, 0162, 0214, 0074, 0311, 
+  0266, 0151, 0275, 0343, 0325, 0016, 0317, 0372, 0345, 0040, 0352, 0153, 0232, 0256, 0344, 0215, 
+  0374, 0103, 0122, 0223, 0035, 0033, 0121, 0317, 0103, 0035, 0202, 0044, 0223, 0273, 0103, 0357, 
+  0315, 0221, 0054, 0211, 0376, 0274, 0175, 0374, 0372, 0343, 0347, 0043, 0272, 0374, 0376, 0027, 
+  0372, 0363, 0362, 0341, 0341, 0362, 0373, 0343, 0137, 0277, 0353, 0101, 0143, 0362, 0255, 0344, 
+  0156, 0110, 0207, 0366, 0007, 0036, 0125, 0243, 0211, 0203, 0000, 0373, 0142, 0054, 0231, 0162, 
+  0364, 0355, 0372, 0341, 0352, 0253, 0054, 0177, 0371, 0351, 0366, 0356, 0366, 0361, 0057, 0325, 
+  0354, 0233, 0333, 0307, 0357, 0327, 0355, 0066, 0272, 0371, 0361, 0200, 0056, 0321, 0375, 0345, 
+  0303, 0343, 0355, 0325, 0317, 0273, 0313, 0007, 0164, 0377, 0363, 0341, 0376, 0107, 0373, 0372, 
+  0030, 0241, 0066, 0121, 0015, 0042, 0107, 0353, 0331, 0211, 0272, 0222, 0122, 0237, 0111, 0256, 
+  0071, 0104, 0140, 0352, 0161, 0331, 0325, 0277, 0344, 0340, 0161, 0331, 0044, 0317, 0101, 0056, 
+  0176, 0046, 0162, 0020, 0155, 0102, 0237, 0145, 0203, 0060, 0262, 0345, 0254, 0110, 0063, 0106, 
+  0036, 0363, 0173, 0341, 0154, 0024, 0163, 0174, 0373, 0035, 0321, 0056, 0362, 0231, 0170, 0203, 
+  0106, 0001, 0225, 0023, 0102, 0260, 0325, 0321, 0073, 0232, 0215, 0336, 0033, 0164, 0353, 0333, 
+  0307, 0157, 0320, 0133, 0123, 0026, 0301, 0376, 0223, 0047, 0371, 0334, 0026, 0262, 0260, 0044, 
+  0160, 0103, 0273, 0222, 0370, 0215, 0307, 0130, 0360, 0006, 0175, 0142, 0134, 0250, 0342, 0337, 
+  0056, 0021, 0252, 0067, 0114, 0263, 0156, 0230, 0315, 0272, 0371, 0006, 0375, 0154, 0137, 0312, 
+  0356, 0134, 0016, 0045, 0177, 0203, 0217, 0350, 0117, 0346, 0165, 0173, 0130, 0266, 0353, 0247, 
+  0327, 0011, 0250, 0355, 0036, 0035, 0031, 0206, 0224, 0040, 0352, 0313, 0201, 0356, 0142, 0233, 
+  0264, 0216, 0020, 0072, 0017, 0310, 0177, 0206, 0064, 0220, 0322, 0340, 0321, 0316, 0105, 0255, 
+  0047, 0236, 0376, 0121, 0233, 0111, 0141, 0363, 0270, 0321, 0250, 0235, 0350, 0162, 0112, 0356, 
+  0246, 0065, 0015, 0057, 0354, 0267, 0041, 0306, 0162, 0006, 0364, 0006, 0336, 0163, 0003, 0051, 
+  0332, 0053, 0345, 0174, 0334, 0047, 0150, 0215, 0100, 0306, 0225, 0167, 0010, 0267, 0003, 0252, 
+  0147, 0145, 0202, 0274, 0306, 0327, 0267, 0247, 0102, 0274, 0044, 0300, 0361, 0305, 0261, 0346, 
+  0024, 0137, 0341, 0324, 0244, 0064, 0353, 0374, 0233, 0330, 0002, 0331, 0036, 0346, 0374, 0242, 
+  0366, 0105, 0074, 0135, 0072, 0377, 0036, 0162, 0321, 0047, 0276, 0250, 0041, 0352, 0134, 0324, 
+  0360, 0364, 0267, 0131, 0123, 0065, 0144, 0235, 0250, 0301, 0143, 0244, 0372, 0176, 0121, 0363, 
+  0330, 0210, 0004, 0265, 0226, 0171, 0176, 0062, 0171, 0021, 0137, 0156, 0070, 0030, 0350, 0162, 
+  0365, 0244, 0202, 0317, 0330, 0033, 0222, 0132, 0353, 0054, 0251, 0034, 0027, 0144, 0140, 0120, 
+  0337, 0016, 0210, 0156, 0156, 0162, 0013, 0006, 0270, 0107, 0066, 0124, 0070, 0077, 0011, 0271, 
+  0221, 0231, 0061, 0300, 0231, 0065, 0234, 0151, 0274, 0060, 0143, 0314, 0312, 0060, 0006, 0070, 
+  0263, 0206, 0063, 0115, 0140, 0114, 0074, 0143, 0116, 0023, 0030, 0123, 0257, 0247, 0146, 0115, 
+  0075, 0055, 0163, 0116, 0223, 0113, 0256, 0260, 0047, 0271, 0312, 0012, 0203, 0226, 0253, 0344, 
+  0145, 0321, 0333, 0315, 0054, 0252, 0037, 0277, 0115, 0311, 0242, 0146, 0332, 0311, 0163, 0334, 
+  0310, 0312, 0237, 0372, 0161, 0346, 0011, 0264, 0122, 0045, 0057, 0177, 0316, 0222, 0370, 0323, 
+  0070, 0154, 0376, 0274, 0253, 0155, 0356, 0165, 0152, 0235, 0362, 0166, 0267, 0224, 0312, 0155, 
+  0137, 0326, 0016, 0073, 0353, 0022, 0157, 0140, 0311, 0300, 0105, 0072, 0327, 0026, 0355, 0367, 
+  0326, 0164, 0370, 0231, 0162, 0332, 0361, 0144, 0117, 0036, 0203, 0041, 0111, 0152, 0232, 0014, 
+  0012, 0215, 0056, 0263, 0207, 0274, 0326, 0272, 0301, 0036, 0117, 0054, 0117, 0155, 0346, 0153, 
+  0267, 0271, 0326, 0122, 0255, 0061, 0072, 0001, 0033, 0161, 0022, 0344, 0354, 0120, 0350, 0053, 
+  0133, 0266, 0307, 0070, 0331, 0235, 0216, 0205, 0255, 0062, 0164, 0253, 0262, 0164, 0354, 0263, 
+  0016, 0000, 0302, 0236, 0351, 0350, 0300, 0232, 0105, 0007, 0126, 0030, 0035, 0254, 0351, 0131, 
+  0370, 0335, 0345, 0030, 0244, 0354, 0056, 0166, 0130, 0040, 0203, 0173, 0143, 0104, 0035, 0341, 
+  0326, 0132, 0211, 0323, 0134, 0120, 0041, 0231, 0215, 0204, 0014, 0365, 0270, 0214, 0276, 0261, 
+  0144, 0375, 0105, 0155, 0114, 0344, 0327, 0276, 0351, 0320, 0347, 0076, 0040, 0135, 0022, 0020, 
+  0337, 0116, 0156, 0251, 0103, 0272, 0170, 0350, 0211, 0351, 0247, 0223, 0315, 0314, 0244, 0206, 
+  0113, 0124, 0270, 0044, 0253, 0274, 0115, 0254, 0242, 0202, 0075, 0303, 0245, 0112, 0300, 0102, 
+  0146, 0257, 0124, 0260, 0135, 0352, 0071, 0141, 0174, 0345, 0143, 0317, 0320, 0077, 0345, 0264, 
+  0352, 0260, 0137, 0321, 0270, 0304, 0215, 0352, 0047, 0371, 0126, 0017, 0151, 0110, 0324, 0120, 
+  0305, 0315, 0151, 0371, 0214, 0263, 0064, 0317, 0060, 0306, 0325, 0141, 0001, 0225, 0232, 0104, 
+  0107, 0345, 0265, 0326, 0263, 0232, 0056, 0066, 0366, 0322, 0124, 0344, 0003, 0154, 0123, 0137, 
+  0316, 0303, 0106, 0154, 0351, 0170, 0016, 0141, 0133, 0175, 0310, 0302, 0001, 0301, 0163, 0035, 
+  0217, 0145, 0226, 0226, 0341, 0145, 0226, 0315, 0325, 0067, 0027, 0010, 0344, 0340, 0136, 0136, 
+  0016, 0306, 0232, 0116, 0074, 0146, 0103, 0141, 0160, 0061, 0126, 0137, 0044, 0276, 0263, 0266, 
+  0242, 0146, 0304, 0342, 0263, 0365, 0335, 0237, 0051, 0353, 0120, 0245, 0055, 0367, 0071, 0276, 
+  0051, 0035, 0342, 0305, 0012, 0233, 0365, 0125, 0022, 0132, 0327, 0260, 0334, 0054, 0114, 0140, 
+  0143, 0236, 0252, 0221, 0310, 0146, 0257, 0034, 0345, 0263, 0370, 0214, 0302, 0306, 0121, 0214, 
+  0325, 0336, 0332, 0246, 0264, 0226, 0014, 0144, 0026, 0012, 0112, 0365, 0352, 0344, 0247, 0107, 
+  0375, 0104, 0336, 0315, 0333, 0201, 0105, 0242, 0330, 0176, 0222, 0342, 0225, 0374, 0071, 0362, 
+  0153, 0200, 0175, 0047, 0107, 0117, 0273, 0324, 0363, 0162, 0124, 0033, 0060, 0116, 0103, 0155, 
+  0121, 0337, 0324, 0255, 0330, 0366, 0237, 0237, 0304, 0114, 0377, 0074, 0042, 0241, 0055, 0152, 
+  0051, 0062, 0161, 0265, 0152, 0233, 0101, 0050, 0326, 0010, 0305, 0032, 0047, 0013, 0204, 0043, 
+  0106, 0070, 0314, 0062, 0204, 0043, 0216, 0001, 0361, 0235, 0317, 0325, 0361, 0370, 0116, 0147, 
+  0261, 0227, 0252, 0055, 0072, 0067, 0276, 0331, 0350, 0145, 0125, 0041, 0061, 0034, 0132, 0341, 
+  0316, 0252, 0332, 0130, 0125, 0031, 0337, 0231, 0040, 0035, 0306, 0236, 0102, 0245, 0061, 0220, 
+  0156, 0046, 0267, 0244, 0347, 0330, 0043, 0142, 0313, 0316, 0103, 0226, 0152, 0011, 0316, 0164, 
+  0146, 0065, 0071, 0161, 0231, 0172, 0341, 0012, 0216, 0265, 0340, 0225, 0156, 0127, 0257, 0145, 
+  0226, 0027, 0265, 0062, 0046, 0144, 0305, 0057, 0237, 0377, 0151, 0335, 0377, 0270, 0375, 0376, 
+  0170, 0375, 0140, 0175, 0373, 0361, 0170, 0373, 0343, 0273, 0365, 0355, 0262, 0375, 0117, 0364, 
+  0077, 0024, 0363, 0346, 0253, 0374, 0065, 0377, 0372, 0323, 0317, 0307, 0107, 0371, 0370, 0376, 
+  0341, 0272, 0335, 0216, 0171, 0376, 0160, 0175, 0167, 0175, 0331, 0276, 0326, 0157, 0262, 0264, 
+  0155, 0161, 0134, 0314, 0106, 0226, 0272, 0251, 0275, 0352, 0104, 0357, 0332, 0174, 0277, 0261, 
+  0132, 0354, 0244, 0110, 0230, 0030, 0163, 0215, 0133, 0067, 0071, 0012, 0115, 0220, 0242, 0223, 
+  0144, 0327, 0047, 0112, 0051, 0003, 0276, 0171, 0364, 0342, 0107, 0360, 0056, 0164, 0143, 0324, 
+  0030, 0152, 0217, 0246, 0361, 0256, 0266, 0256, 0162, 0301, 0341, 0053, 0143, 0010, 0253, 0060, 
+  0214, 0161, 0155, 0164, 0261, 0107, 0173, 0162, 0024, 0271, 0300, 0201, 0310, 0103, 0140, 0275, 
+  0267, 0031, 0246, 0073, 0176, 0314, 0346, 0112, 0052, 0362, 0130, 0104, 0170, 0004, 0276, 0276, 
+  0320, 0174, 0261, 0250, 0031, 0243, 0060, 0341, 0201, 0164, 0066, 0122, 0251, 0063, 0317, 0011, 
+  0227, 0270, 0327, 0324, 0077, 0111, 0376, 0316, 0072, 0207, 0054, 0331, 0061, 0113, 0362, 0123, 
+  0362, 0116, 0312, 0144, 0227, 0245, 0160, 0054, 0223, 0340, 0266, 0155, 0214, 0155, 0362, 0112, 
+  0372, 0245, 0232, 0202, 0163, 0271, 0351, 0311, 0117, 0023, 0004, 0276, 0174, 0201, 0027, 0154, 
+  0140, 0014, 0260, 0343, 0150, 0173, 0173, 0226, 0113, 0342, 0111, 0127, 0314, 0110, 0154, 0166, 
+  0025, 0322, 0115, 0211, 0004, 0023, 0256, 0314, 0166, 0343, 0103, 0155, 0123, 0355, 0022, 0046, 
+  0104, 0131, 0223, 0242, 0052, 0023, 0243, 0064, 0303, 0236, 0350, 0325, 0235, 0245, 0246, 0220, 
+  0070, 0113, 0342, 0147, 0312, 0003, 0166, 0050, 0233, 0317, 0230, 0150, 0260, 0220, 0345, 0112, 
+  0145, 0113, 0034, 0053, 0120, 0157, 0153, 0111, 0124, 0063, 0345, 0121, 0036, 0024, 0175, 0043, 
+  0244, 0237, 0266, 0163, 0245, 0115, 0322, 0202, 0351, 0226, 0055, 0144, 0120, 0252, 0072, 0375, 
+  0113, 0161, 0210, 0112, 0111, 0376, 0044, 0223, 0123, 0213, 0001, 0317, 0045, 0320, 0161, 0002, 
+  0074, 0062, 0250, 0357, 0110, 0311, 0026, 0054, 0310, 0112, 0057, 0311, 0047, 0112, 0357, 0033, 
+  0225, 0345, 0043, 0225, 0343, 0053, 0225, 0342, 0063, 0245, 0364, 0235, 0122, 0371, 0120, 0245, 
+  0253, 0104, 0145, 0265, 0267, 0250, 0021, 0357, 0224, 0123, 0000, 0012, 0021, 0024, 0342, 0201, 
+  0051, 0304, 0125, 0172, 0275, 0200, 0015, 0007, 0265, 0326, 0252, 0013, 0002, 0132, 0266, 0320, 
+  0102, 0302, 0366, 0264, 0154, 0062, 0273, 0023, 0210, 0354, 0157, 0246, 0300, 0334, 0146, 0246, 
+  0140, 0023, 0333, 0066, 0263, 0054, 0367, 0312, 0127, 0061, 0136, 0345, 0366, 0016, 0066, 0360, 
+  0150, 0055, 0177, 0162, 0145, 0273, 0075, 0046, 0265, 0030, 0261, 0006, 0114, 0143, 0121, 0040, 
+  0341, 0135, 0345, 0204, 0367, 0133, 0110, 0177, 0125, 0052, 0337, 0035, 0155, 0042, 0203, 0054, 
+  0067, 0144, 0271, 0263, 0144, 0271, 0117, 0101, 0314, 0017, 0071, 0313, 0175, 0345, 0022, 0173, 
+  0001, 0355, 0265, 0144, 0302, 0005, 0353, 0365, 0324, 0210, 0147, 0112, 0275, 0256, 0127, 0122, 
+  0155, 0327, 0142, 0043, 0064, 0021, 0022, 0265, 0007, 0066, 0372, 0020, 0032, 0271, 0321, 0276, 
+  0335, 0053, 0346, 0213, 0200, 0171, 0350, 0211, 0214, 0221, 0336, 0364, 0112, 0070, 0117, 0037, 
+  0325, 0157, 0073, 0017, 0137, 0204, 0114, 0301, 0110, 0276, 0252, 0131, 0375, 0134, 0021, 0174, 
+  0211, 0321, 0173, 0171, 0021, 0067, 0104, 0152, 0257, 0023, 0251, 0225, 0270, 0246, 0373, 0241, 
+  0152, 0346, 0256, 0302, 0246, 0244, 0117, 0035, 0307, 0233, 0202, 0127, 0111, 0177, 0350, 0205, 
+  0070, 0250, 0222, 0155, 0312, 0265, 0046, 0114, 0120, 0370, 0071, 0024, 0176, 0116, 0232, 0222, 
+  0200, 0015, 0173, 0056, 0342, 0124, 0276, 0026, 0330, 0047, 0154, 0310, 0221, 0142, 0205, 0072, 
+  0075, 0003, 0205, 0333, 0371, 0155, 0217, 0332, 0117, 0140, 0131, 0300, 0262, 0224, 0144, 0131, 
+  0362, 0344, 0204, 0017, 0302, 0072, 0345, 0326, 0176, 0145, 0231, 0247, 0106, 0065, 0314, 0123, 
+  0243, 0016, 0346, 0351, 0225, 0314, 0323, 0000, 0163, 0031, 0366, 0224, 0155, 0232, 0174, 0365, 
+  0043, 0262, 0114, 0321, 0321, 0063, 0352, 0073, 0140, 0163, 0300, 0346, 0200, 0315, 0331, 0163, 
+  0233, 0323, 0204, 0305, 0253, 0062, 0102, 0307, 0027, 0133, 0274, 0232, 0244, 0274, 0370, 0200, 
+  0020, 0007, 0326, 0256, 0052, 0275, 0131, 0343, 0003, 0144, 0265, 0053, 0265, 0170, 0165, 0037, 
+  0145, 0201, 0333, 0112, 0366, 0140, 0011, 0013, 0226, 0260, 0262, 0104, 0115, 0260, 0122, 0175, 
+  0110, 0113, 0130, 0352, 0260, 0115, 0337, 0260, 0231, 0067, 0354, 0373, 0374, 0242, 0041, 0377, 
+  0126, 0207, 0031, 0135, 0064, 0243, 0343, 0065, 0323, 0007, 0204, 0137, 0002, 0352, 0204, 0063, 
+  0111, 0153, 0242, 0106, 0225, 0167, 0170, 0110, 0026, 0030, 0071, 0066, 0074, 0054, 0267, 0106, 
+  0063, 0165, 0106, 0050, 0335, 0230, 0025, 0301, 0011, 0317, 0031, 0156, 0154, 0333, 0304, 0123, 
+  0047, 0060, 0253, 0024, 0161, 0150, 0051, 0166, 0003, 0300, 0133, 0030, 0156, 0273, 0001, 0267, 
+  0174, 0071, 0327, 0351, 0217, 0073, 0204, 0156, 0125, 0307, 0263, 0321, 0356, 0270, 0326, 0262, 
+  0211, 0262, 0313, 0105, 0110, 0365, 0175, 0322, 0147, 0076, 0265, 0215, 0311, 0141, 0000, 0172, 
+  0240, 0055, 0056, 0335, 0300, 0102, 0115, 0374, 0025, 0171, 0043, 0365, 0135, 0002, 0266, 0152, 
+  0235, 0047, 0135, 0006, 0154, 0273, 0231, 0132, 0026, 0257, 0177, 0163, 0020, 0332, 0005, 0360, 
+  0377, 0064, 0242, 0162, 0227, 0016, 0335, 0252, 0264, 0024, 0127, 0012, 0064, 0137, 0026, 0300, 
+  0072, 0273, 0115, 0111, 0077, 0161, 0262, 0131, 0004, 0356, 0261, 0121, 0152, 0263, 0120, 0352, 
+  0244, 0052, 0173, 0142, 0145, 0062, 0021, 0310, 0146, 0175, 0345, 0343, 0112, 0346, 0050, 0016, 
+  0240, 0171, 0236, 0324, 0132, 0155, 0371, 0250, 0350, 0247, 0013, 0250, 0372, 0115, 0152, 0331, 
+  0314, 0114, 0050, 0135, 0104, 0267, 0061, 0272, 0013, 0317, 0204, 0233, 0004, 0167, 0124, 0310, 
+  0266, 0330, 0233, 0302, 0273, 0044, 0162, 0312, 0106, 0115, 0311, 0325, 0217, 0337, 0067, 0076, 
+  0054, 0374, 0073, 0113, 0113, 0073, 0115, 0030, 0231, 0307, 0120, 0145, 0063, 0126, 0245, 0144, 
+  0113, 0313, 0213, 0073, 0113, 0213, 0101, 0163, 0330, 0277, 0324, 0066, 0260, 0250, 0072, 0153, 
+  0207, 0123, 0150, 0252, 0316, 0102, 0277, 0147, 0307, 0124, 0130, 0031, 0344, 0146, 0107, 0372, 
+  0112, 0017, 0157, 0166, 0116, 0177, 0121, 0262, 0172, 0151, 0042, 0072, 0343, 0267, 0224, 0071, 
+  0252, 0151, 0031, 0162, 0176, 0105, 0173, 0244, 0262, 0116, 0257, 0227, 0026, 0314, 0062, 0306, 
+  0146, 0033, 0162, 0151, 0126, 0133, 0056, 0327, 0271, 0031, 0135, 0314, 0305, 0141, 0273, 0031, 
+  0212, 0003, 0113, 0156, 0306, 0215, 0174, 0264, 0243, 0156, 0106, 0035, 0334, 0014, 0160, 0063, 
+  0112, 0120, 0147, 0215, 0327, 0126, 0147, 0057, 0234, 0233, 0060, 0041, 0067, 0301, 0176, 0065, 
+  0041, 0067, 0001, 0271, 0211, 0174, 0116, 0003, 0047, 0276, 0122, 0035, 0317, 0124, 0214, 0255, 
+  0203, 0317, 0114, 0250, 0304, 0304, 0034, 0103, 0152, 0255, 0073, 0110, 0113, 0200, 0277, 0000, 
+  0151, 0211, 0112, 0244, 0045, 0346, 0065, 0331, 0141, 0045, 0047, 0032, 0205, 0223, 0023, 0264, 
+  0107, 0225, 0331, 0255, 0277, 0162, 0226, 0003, 0262, 0022, 0373, 0227, 0225, 0230, 0027, 0113, 
+  0227, 0366, 0334, 0303, 0366, 0060, 0024, 0007, 0026, 0135, 0214, 0257, 0362, 0011, 0344, 0044, 
+  0300, 0307, 0200, 0234, 0004, 0344, 0044, 0226, 0163, 0022, 0146, 0265, 0162, 0022, 0353, 0302, 
+  0312, 0003, 0301, 0100, 0265, 0147, 0175, 0076, 0024, 0010, 0324, 0212, 0317, 0015, 0100, 0250, 
+  0075, 0027, 0354, 0360, 0146, 0311, 0160, 0011, 0130, 0166, 0101, 0232, 0013, 0162, 0050, 0002, 
+  0076, 0217, 0161, 0104, 0326, 0175, 0330, 0371, 0103, 0221, 0364, 0230, 0161, 0007, 0131, 0117, 
+  0045, 0353, 0215, 0152, 0311, 0372, 0025, 0353, 0167, 0330, 0047, 0366, 0353, 0221, 0374, 0022, 
+  0153, 0105, 0176, 0137, 0204, 0075, 0377, 0241, 0274, 0124, 0220, 0176, 0272, 0070, 0100, 0225, 
+  0014, 0257, 0043, 0215, 0366, 0027, 0307, 0351, 0226, 0317, 0341, 0273, 0363, 0023, 0125, 0072, 
+  0033, 0131, 0354, 0340, 0201, 0336, 0072, 0033, 0253, 0263, 0242, 0227, 0171, 0010, 0167, 0045, 
+  0251, 0130, 0242, 0067, 0362, 0147, 0132, 0202, 0141, 0071, 0276, 0257, 0036, 0172, 0003, 0016, 
+  0332, 0205, 0203, 0166, 0223, 0131, 0266, 0163, 0173, 0225, 0033, 0073, 0262, 0127, 0331, 0361, 
+  0141, 0207, 0162, 0245, 0167, 0050, 0277, 0207, 0075, 0213, 0225, 0332, 0240, 0374, 0071, 0300, 
+  0075, 0175, 0162, 0330, 0147, 0131, 0003, 0066, 0050, 0303, 0006, 0345, 0054, 0033, 0224, 0317, 
+  0100, 0330, 0341, 0046, 0271, 0350, 0046, 0271, 0167, 0160, 0221, 0134, 0125, 0057, 0222, 0333, 
+  0376, 0166, 0350, 0351, 0114, 0261, 0207, 0001, 0147, 0201, 0245, 0100, 0212, 0215, 0175, 0111, 
+  0032, 0344, 0340, 0143, 0211, 0353, 0351, 0302, 0015, 0010, 0167, 0245, 0065, 0075, 0300, 0205, 
+  0364, 0326, 0243, 0033, 0130, 0141, 0357, 0077, 0026, 0375, 0110, 0301, 0334, 0353, 0013, 0054, 
+  0303, 0257, 0344, 0140, 0035, 0351, 0273, 0131, 0263, 0361, 0317, 0274, 0340, 0122, 0342, 0132, 
+  0177, 0245, 0127, 0267, 0113, 0041, 0265, 0067, 0020, 0272, 0005, 0044, 0371, 0207, 0175, 0324, 
+  0047, 0371, 0000, 0326, 0331, 0370, 0232, 0101, 0157, 0363, 0076, 0366, 0274, 0114, 0332, 0273, 
+  0164, 0216, 0157, 0203, 0353, 0171, 0041, 0121, 0232, 0035, 0150, 0312, 0236, 0132, 0253, 0255, 
+  0036, 0224, 0361, 0365, 0202, 0372, 0170, 0223, 0272, 0064, 0163, 0021, 0313, 0016, 0217, 0332, 
+  0002, 0104, 0152, 0273, 0060, 0251, 0074, 0120, 0251, 0254, 0006, 0045, 0273, 0121, 0051, 0335, 
+  0260, 0224, 0154, 0134, 0112, 0065, 0060, 0031, 0215, 0114, 0046, 0103, 0123, 0206, 0122, 0234, 
+  0303, 0154, 0307, 0171, 0064, 0073, 0252, 0023, 0313, 0042, 0031, 0017, 0341, 0156, 0226, 0101, 
+  0072, 0067, 0214, 0073, 0226, 0130, 0321, 0015, 0353, 0263, 0251, 0202, 0364, 0231, 0210, 0076, 
+  0366, 0014, 0375, 0063, 0334, 0251, 0314, 0243, 0241, 0312, 0242, 0265, 0026, 0247, 0322, 0245, 
+  0170, 0372, 0241, 0037, 0254, 0237, 0113, 0006, 0026, 0117, 0141, 0245, 0114, 0037, 0132, 0345, 
+  0306, 0364, 0133, 0037, 0077, 0316, 0032, 0157, 0070, 0204, 0333, 0001, 0035, 0150, 0051, 0215, 
+  0013, 0127, 0256, 0164, 0364, 0213, 0072, 0062, 0304, 0170, 0342, 0210, 0247, 0075, 0023, 0262, 
+  0270, 0166, 0314, 0050, 0321, 0257, 0251, 0176, 0313, 0222, 0253, 0374, 0300, 0325, 0302, 0053, 
+  0212, 0125, 0122, 0276, 0153, 0062, 0011, 0101, 0217, 0200, 0107, 0072, 0335, 0006, 0250, 0330, 
+  0061, 0357, 0221, 0336, 0251, 0007, 0145, 0272, 0217, 0165, 0160, 0037, 0301, 0175, 0174, 0051, 
+  0367, 0261, 0261, 0113, 0032, 0014, 0266, 0170, 0355, 0314, 0026, 0257, 0303, 0275, 0036, 0275, 
+  0016, 0250, 0055, 0100, 0155, 0045, 0263, 0154, 0347, 0120, 0133, 0315, 0135, 0101, 0155, 0261, 
+  0241, 0364, 0233, 0054, 0175, 0355, 0234, 0045, 0150, 0237, 0260, 0241, 0000, 0030, 0127, 0225, 
+  0141, 0134, 0115, 0023, 0240, 0035, 0325, 0302, 0161, 0151, 0021, 0064, 0256, 0224, 0010, 0242, 
+  0307, 0120, 0004, 0001, 0316, 0005, 0160, 0256, 0054, 0160, 0256, 0167, 0040, 0363, 0000, 0347, 
+  0212, 0340, 0134, 0315, 0006, 0340, 0271, 0000, 0317, 0225, 0070, 0125, 0346, 0360, 0134, 0247, 
+  0200, 0347, 0052, 0005, 0317, 0025, 0271, 0317, 0007, 0210, 0346, 0262, 0042, 0277, 0345, 0040, 
+  0261, 0134, 0304, 0303, 0143, 0200, 0160, 0275, 0150, 0232, 0364, 0060, 0040, 0134, 0015, 0023, 
+  0060, 0134, 0333, 0132, 0061, 0213, 0164, 0065, 0167, 0131, 0040, 0016, 0174, 0275, 0254, 0325, 
+  0126, 0114, 0000, 0114, 0025, 0054, 0212, 0001, 0246, 0352, 0365, 0227, 0365, 0347, 0061, 0125, 
+  0063, 0317, 0342, 0040, 0241, 0124, 0247, 0207, 0211, 0176, 0232, 0215, 0072, 0200, 0236, 0000, 
+  0364, 0124, 0120, 0073, 0356, 0061, 0350, 0151, 0022, 0156, 0063, 0277, 0167, 0350, 0036, 0334, 
+  0235, 0344, 0001, 0240, 0232, 0300, 0201, 0003, 0124, 0123, 0121, 0025, 0005, 0250, 0046, 0100, 
+  0065, 0035, 0046, 0252, 0251, 0244, 0033, 0154, 0032, 0015, 0270, 0302, 0346, 0345, 0257, 0260, 
+  0171, 0335, 0225, 0217, 0020, 0170, 0322, 0314, 0231, 0255, 0034, 0121, 0107, 0270, 0106, 0100, 
+  0376, 0063, 0044, 0134, 0006, 0072, 0346, 0373, 0302, 0227, 0027, 0354, 0164, 0376, 0163, 0227, 
+  0247, 0125, 0134, 0173, 0163, 0237, 0254, 0230, 0315, 0205, 0175, 0144, 0110, 0372, 0123, 0002, 
+  0215, 0331, 0060, 0100, 0041, 0054, 0315, 0320, 0260, 0064, 0304, 0211, 0020, 0162, 0156, 0363, 
+  0067, 0262, 0332, 0030, 0011, 0266, 0370, 0226, 0371, 0110, 0270, 0104, 0276, 0242, 0330, 0357, 
+  0171, 0104, 0237, 0210, 0044, 0151, 0240, 0376, 0120, 0022, 0343, 0204, 0350, 0267, 0175, 0054, 
+  0135, 0101, 0031, 0356, 0076, 0011, 0066, 0100, 0036, 0353, 0061, 0064, 0242, 0302, 0105, 0035, 
+  0046, 0377, 0013, 0024, 0155, 0304, 0135, 0066, 0222, 0177, 0034, 0027, 0355, 0340, 0050, 0300, 
+  0203, 0234, 0363, 0356, 0225, 0217, 0334, 0337, 0375, 0143, 0361, 0167, 0325, 0123, 0252, 0370, 
+  0232, 0323, 0265, 0122, 0110, 0361, 0210, 0120, 0255, 0253, 0326, 0243, 0101, 0101, 0017, 0277, 
+  0240, 0036, 0216, 0230, 0151, 0110, 0065, 0345, 0260, 0121, 0136, 0046, 0024, 0314, 0277, 0334, 
+  0366, 0161, 0217, 0304, 0114, 0024, 0252, 0237, 0357, 0171, 0376, 0145, 0327, 0147, 0114, 0134, 
+  0233, 0251, 0315, 0174, 0103, 0375, 0131, 0153, 0351, 0061, 0062, 0372, 0224, 0163, 0232, 0047, 
+  0133, 0224, 0055, 0205, 0001, 0041, 0067, 0204, 0334, 0125, 0012, 0271, 0115, 0330, 0110, 0004, 
+  0033, 0211, 0222, 0131, 0266, 0163, 0033, 0211, 0116, 0313, 0336, 0110, 0024, 0317, 0233, 0330, 
+  0302, 0321, 0252, 0250, 0030, 0017, 0024, 0132, 0032, 0167, 0126, 0354, 0177, 0162, 0322, 0040, 
+  0016, 0341, 0224, 0333, 0067, 0050, 0342, 0003, 0244, 0017, 0124, 0277, 0251, 0113, 0024, 0262, 
+  0220, 0112, 0015, 0100, 0134, 0067, 0055, 0327, 0117, 0311, 0025, 0310, 0072, 0356, 0030, 0251, 
+  0362, 0364, 0153, 0346, 0305, 0206, 0141, 0116, 0036, 0333, 0105, 0024, 0372, 0256, 0016, 0354, 
+  0056, 0071, 0161, 0313, 0155, 0353, 0260, 0300, 0041, 0201, 0241, 0023, 0142, 0111, 0251, 0274, 
+  0302, 0200, 0364, 0365, 0051, 0304, 0367, 0033, 0253, 0145, 0330, 0146, 0170, 0345, 0022, 0373, 
+  0351, 0323, 0120, 0010, 0005, 0060, 0320, 0153, 0266, 0154, 0150, 0273, 0003, 0354, 0130, 0304, 
+  0307, 0353, 0121, 0023, 0351, 0145, 0361, 0132, 0223, 0101, 0326, 0204, 0156, 0126, 0075, 0132, 
+  0326, 0366, 0305, 0074, 0325, 0003, 0142, 0023, 0372, 0114, 0270, 0061, 0271, 0115, 0144, 0077, 
+  0067, 0101, 0146, 0112, 0037, 0226, 0000, 0007, 0217, 0305, 0377, 0310, 0220, 0131, 0212, 0203, 
+  0140, 0101, 0032, 0032, 0073, 0345, 0035, 0344, 0252, 0232, 0072, 0065, 0365, 0142, 0373, 0214, 
+  0225, 0111, 0230, 0112, 0251, 0325, 0043, 0076, 0011, 0260, 0007, 0173, 0214, 0053, 0272, 0307, 
+  0330, 0204, 0273, 0042, 0166, 0161, 0217, 0361, 0363, 0366, 0066, 0051, 0177, 0011, 0045, 0026, 
+  0366, 0045, 0147, 0105, 0325, 0024, 0104, 0321, 0124, 0176, 0147, 0262, 0131, 0007, 0125, 0161, 
+  0310, 0133, 0223, 0127, 0102, 0000, 0207, 0162, 0245, 0127, 0254, 0221, 0045, 0306, 0003, 0371, 
+  0161, 0351, 0025, 0364, 0172, 0211, 0000, 0352, 0014, 0307, 0051, 0204, 0364, 0321, 0304, 0331, 
+  0100, 0326, 0110, 0266, 0232, 0240, 0360, 0153, 0171, 0167, 0350, 0226, 0275, 0107, 0272, 0010, 
+  0231, 0234, 0201, 0103, 0325, 0126, 0065, 0112, 0301, 0041, 0224, 0270, 0277, 0164, 0145, 0317, 
+  0202, 0255, 0357, 0152, 0054, 0104, 0043, 0173, 0160, 0002, 0251, 0343, 0327, 0115, 0035, 0227, 
+  0150, 0031, 0341, 0240, 0036, 0260, 0214, 0013, 0311, 0061, 0074, 0220, 0306, 0160, 0162, 0026, 
+  0127, 0271, 0126, 0161, 0222, 0050, 0323, 0067, 0000, 0043, 0375, 0011, 0036, 0142, 0240, 0322, 
+  0246, 0316, 0300, 0062, 0202, 0145, 0004, 0313, 0130, 0155, 0313, 0330, 0250, 0210, 0145, 0154, 
+  0200, 0145, 0074, 0040, 0313, 0370, 0067, 0303, 0100, 0276, 0141, 0063, 0157, 0330, 0367, 0371, 
+  0105, 0123, 0376, 0035, 0260, 0221, 0372, 0303, 0060, 0262, 0131, 0324, 0057, 0001, 0165, 0046, 
+  0246, 0124, 0116, 0011, 0263, 0312, 0347, 0140, 0111, 0026, 0030, 0323, 0025, 0271, 0146, 0356, 
+  0326, 0150, 0246, 0346, 0041, 0224, 0163, 0053, 0310, 0162, 0246, 0370, 0154, 0137, 0066, 0203, 
+  0344, 0106, 0301, 0147, 0100, 0300, 0217, 0230, 0321, 0225, 0303, 0104, 0202, 0320, 0101, 0103, 
+  0244, 0077, 0364, 0164, 0146, 0377, 0143, 0026, 0160, 0322, 0266, 0021, 0134, 0132, 0013, 0140, 
+  0041, 0260, 0355, 0146, 0204, 0076, 0307, 0151, 0244, 0034, 0204, 0166, 0156, 0313, 0223, 0276, 
+  0253, 0204, 0130, 0341, 0330, 0205, 0376, 0373, 0336, 0114, 0373, 0334, 0170, 0275, 0364, 0360, 
+  0317, 0201, 0207, 0155, 0242, 0256, 0147, 0040, 0301, 0111, 0205, 0220, 0214, 0013, 0162, 0140, 
+  0226, 0045, 0007, 0146, 0245, 0345, 0140, 0304, 0100, 0012, 0100, 0012, 0016, 0316, 0032, 0054, 
+  0173, 0075, 0037, 0300, 0353, 0311, 0162, 0021, 0060, 0041, 0207, 0353, 0367, 0354, 0266, 0276, 
+  0117, 0257, 0224, 0340, 0253, 0007, 0373, 0125, 0110, 0270, 0345, 0275, 0346, 0343, 0245, 0023, 
+  0156, 0163, 0166, 0112, 0252, 0130, 0101, 0047, 0316, 0332, 0010, 0007, 0276, 0316, 0017, 0124, 
+  0053, 0353, 0126, 0030, 0060, 0325, 0307, 0101, 0217, 0372, 0206, 0256, 0237, 0072, 0241, 0025, 
+  0117, 0103, 0352, 0364, 0132, 0353, 0155, 0256, 0136, 0024, 0235, 0254, 0353, 0155, 0353, 0237, 
+  0341, 0270, 0176, 0104, 0172, 0264, 0047, 0106, 0166, 0152, 0136, 0121, 0037, 0217, 0121, 0204, 
+  0307, 0100, 0234, 0165, 0205, 0234, 0007, 0004, 0165, 0364, 0222, 0024, 0337, 0046, 0324, 0053, 
+  0353, 0066, 0365, 0112, 0143, 0275, 0212, 0153, 0221, 0323, 0203, 0331, 0013, 0125, 0020, 0355, 
+  0154, 0356, 0044, 0332, 0231, 0333, 0001, 0363, 0274, 0365, 0372, 0025, 0360, 0316, 0073, 0177, 
+  0247, 0322, 0051, 0054, 0110, 0035, 0026, 0336, 0271, 0075, 0221, 0131, 0100, 0074, 0003, 0342, 
+  0071, 0343, 0352, 0165, 0023, 0224, 0005, 0340, 0272, 0346, 0160, 0135, 0312, 0112, 0131, 0304, 
+  0351, 0221, 0310, 0023, 0050, 0033, 0333, 0145, 0375, 0053, 0062, 0203, 0110, 0175, 0004, 0361, 
+  0054, 0252, 0013, 0020, 0135, 0200, 0350, 0002, 0064, 0026, 0340, 0224, 0067, 0331, 0063, 0160, 
+  0176, 0301, 0236, 0315, 0333, 0063, 0127, 0306, 0140, 0377, 0335, 0246, 0101, 0373, 0152, 0251, 
+  0057, 0060, 0031, 0346, 0201, 0111, 0003, 0223, 0006, 0046, 0255, 0072, 0046, 0255, 0052, 0000, 
+  0343, 0267, 0140, 0322, 0300, 0244, 0055, 0207, 0150, 0142, 0304, 0242, 0365, 0260, 0355, 0230, 
+  0265, 0177, 0131, 0223, 0070, 0115, 0314, 0220, 0236, 0140, 0332, 0300, 0264, 0201, 0151, 0203, 
+  0245, 0374, 0322, 0114, 0333, 0031, 0230, 0066, 0060, 0155, 0053, 0321, 0332, 0266, 0155, 0333, 
+  0127, 0026, 0130, 0223, 0220, 0015, 0254, 0033, 0130, 0067, 0260, 0156, 0325, 0262, 0156, 0247, 
+  0025, 0261, 0156, 0357, 0300, 0272, 0201, 0165, 0233, 0263, 0156, 0076, 0026, 0303, 0000, 0173, 
+  0133, 0262, 0152, 0223, 0123, 0023, 0242, 0257, 0200, 0071, 0003, 0163, 0006, 0346, 0254, 0012, 
+  0346, 0354, 0055, 0040, 0046, 0113, 0111, 0330, 0276, 0022, 0142, 0162, 0300, 0364, 0115, 0333, 
+  0226, 0276, 0162, 0032, 0120, 0223, 0025, 0105, 0115, 0236, 0302, 0321, 0217, 0273, 0210, 0232, 
+  0134, 0357, 0356, 0334, 0207, 0142, 0207, 0332, 0151, 0157, 0172, 0077, 0010, 0340, 0343, 0153, 
+  0333, 0262, 0252, 0300, 0036, 0341, 0114, 0150, 0070, 0264, 0247, 0370, 0241, 0075, 0315, 0275, 
+  0071, 0264, 0347, 0254, 0254, 0103, 0173, 0322, 0137, 0351, 0133, 0302, 0376, 0365, 0251, 0017, 
+  0206, 0155, 0233, 0170, 0044, 0320, 0076, 0203, 0025, 0332, 0214, 0075, 0331, 0324, 0276, 0001, 
+  0111, 0173, 0071, 0327, 0351, 0217, 0105, 0276, 0121, 0040, 0100, 0214, 0043, 0227, 0372, 0012, 
+  0241, 0144, 0122, 0175, 0237, 0364, 0231, 0117, 0155, 0165, 0313, 0114, 0217, 0310, 0250, 0177, 
+  0161, 0304, 0055, 0056, 0075, 0303, 0102, 0155, 0375, 0025, 0071, 0050, 0165, 0070, 0264, 0050, 
+  0275, 0211, 0116, 0031, 0261, 0027, 0023, 0363, 0205, 0303, 0132, 0232, 0165, 0270, 0247, 0375, 
+  0345, 0357, 0151, 0167, 0313, 0272, 0377, 0060, 0273, 0231, 0111, 0077, 0163, 0162, 0032, 0011, 
+  0356, 0261, 0121, 0152, 0113, 0121, 0352, 0354, 0052, 0173, 0206, 0145, 0262, 0032, 0310, 0146, 
+  0175, 0345, 0000, 0113, 0056, 0051, 0016, 0240, 0171, 0236, 0324, 0132, 0155, 0371, 0250, 0350, 
+  0247, 0013, 0150, 0377, 0115, 0012, 0332, 0254, 0332, 0015, 0345, 0161, 0344, 0224, 0265, 0232, 
+  0222, 0253, 0037, 0277, 0157, 0174, 0130, 0370, 0167, 0266, 0077, 0267, 0237, 0227, 0062, 0213, 
+  0341, 0372, 0363, 0025, 0275, 0326, 0016, 0247, 0320, 0252, 0136, 0013, 0135, 0241, 0035, 0323, 
+  0145, 0145, 0220, 0303, 0216, 0322, 0050, 0072, 0206, 0157, 0315, 0376, 0066, 0315, 0242, 0164, 
+  0365, 0122, 0206, 0026, 0305, 0222, 0146, 0253, 0246, 0145, 0310, 0231, 0126, 0153, 0005, 0052, 
+  0143, 0224, 0165, 0242, 0301, 0275, 0322, 0073, 0162, 0257, 0364, 0226, 0075, 0217, 0056, 0346, 
+  0342, 0260, 0075, 0017, 0305, 0201, 0045, 0317, 0343, 0106, 0076, 0332, 0121, 0317, 0243, 0016, 
+  0236, 0007, 0170, 0036, 0045, 0350, 0265, 0306, 0153, 0353, 0065, 0070, 0137, 0363, 0025, 0022, 
+  0027, 0046, 0044, 0056, 0040, 0161, 0121, 0320, 0175, 0340, 0304, 0127, 0112, 0344, 0231, 0212, 
+  0261, 0165, 0360, 0151, 0013, 0225, 0265, 0230, 0143, 0110, 0255, 0165, 0007, 0071, 0013, 0360, 
+  0034, 0040, 0147, 0121, 0255, 0234, 0305, 0274, 0112, 0073, 0254, 0314, 0105, 0243, 0121, 0070, 
+  0163, 0101, 0173, 0124, 0131, 0342, 0372, 0053, 0247, 0100, 0040, 0145, 0261, 0307, 0051, 0213, 
+  0171, 0001, 0165, 0151, 0317, 0075, 0154, 0247, 0103, 0161, 0140, 0321, 0353, 0370, 0052, 0237, 
+  0100, 0302, 0002, 0334, 0016, 0110, 0130, 0100, 0302, 0242, 0342, 0327, 0342, 0044, 0206, 0234, 
+  0007, 0202, 0247, 0152, 0317, 0372, 0174, 0160, 0160, 0252, 0025, 0177, 0034, 0100, 0125, 0173, 
+  0040, 0352, 0160, 0113, 0010, 0174, 0025, 0156, 0104, 0331, 0321, 0103, 0057, 0167, 0152, 0147, 
+  0136, 0236, 0175, 0150, 0251, 0217, 0233, 0311, 0276, 0061, 0157, 0035, 0157, 0326, 0363, 0045, 
+  0327, 0040, 0256, 0151, 0130, 0154, 0243, 0102, 0321, 0104, 0142, 0074, 0040, 0032, 0375, 0277, 
+  0342, 0020, 0245, 0330, 0143, 0126, 0113, 0156, 0167, 0152, 0247, 0251, 0210, 0223, 0224, 0341, 
+  0302, 0263, 0310, 0101, 0310, 0102, 0055, 0265, 0303, 0122, 0346, 0050, 0067, 0262, 0264, 0120, 
+  0366, 0320, 0110, 0265, 0043, 0065, 0375, 0004, 0211, 0353, 0113, 0174, 0077, 0362, 0050, 0273, 
+  0354, 0102, 0233, 0131, 0036, 0142, 0272, 0272, 0324, 0315, 0305, 0056, 0056, 0274, 0074, 0307, 
+  0266, 0042, 0036, 0371, 0225, 0323, 0100, 0173, 0361, 0061, 0012, 0010, 0037, 0060, 0237, 0313, 
+  0326, 0030, 0246, 0131, 0153, 0271, 0304, 0033, 0204, 0367, 0367, 0310, 0046, 0055, 0224, 0114, 
+  0254, 0337, 0220, 0223, 0313, 0143, 0234, 0154, 0252, 0276, 0364, 0120, 0067, 0152, 0276, 0013, 
+  0061, 0211, 0152, 0372, 0137, 0362, 0045, 0140, 0303, 0101, 0044, 0247, 0347, 0313, 0335, 0211, 
+  0332, 0021, 0245, 0167, 0127, 0367, 0234, 0234, 0304, 0227, 0134, 0015, 0246, 0326, 0024, 0354, 
+  0063, 0031, 0073, 0104, 0170, 0076, 0071, 0106, 0162, 0224, 0311, 0346, 0012, 0352, 0056, 0137, 
+  0256, 0034, 0201, 0204, 0142, 0264, 0117, 0330, 0120, 0054, 0026, 0072, 0077, 0171, 0011, 0306, 
+  0314, 0241, 0235, 0122, 0160, 0147, 0056, 0323, 0230, 0242, 0307, 0101, 0217, 0244, 0354, 0067, 
+  0363, 0173, 0257, 0321, 0371, 0071, 0220, 0171, 0232, 0251, 0221, 0124, 0170, 0326, 0167, 0336, 
+  0307, 0236, 0227, 0256, 0357, 0262, 0102, 0220, 0156, 0344, 0317, 0117, 0364, 0216, 0332, 0256, 
+  0364, 0055, 0133, 0107, 0377, 0007, 0036, 0111, 0152, 0047, 0000, 0050, 0165, 0165, 0141, 0171, 
+  0051, 0155, 0141, 0164, 0145, 0057, 0000, 0000, 0002, 0000, 0000, 0000
+} };
+
+static GStaticResource static_resource = { mouse_resource_data.data, sizeof (mouse_resource_data.data) - 1 /* nul terminator */, NULL, NULL, NULL };
+
+G_MODULE_EXPORT
+GResource *mouse_get_resource (void);
+GResource *mouse_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(mouseresource_constructor)
+#endif
+G_DEFINE_CONSTRUCTOR(mouseresource_constructor)
+#ifdef G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA
+#pragma G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(mouseresource_destructor)
+#endif
+G_DEFINE_DESTRUCTOR(mouseresource_destructor)
+
+#else
+#warning "Constructor not supported on this compiler, linking in resources will not work"
+#endif
+
+static void mouseresource_constructor (void)
+{
+  g_static_resource_init (&static_resource);
+}
+
+static void mouseresource_destructor (void)
+{
+  g_static_resource_fini (&static_resource);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/72.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/72.html new file mode 100644 index 00000000..b6d53e72 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/72.html @@ -0,0 +1,1191 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- mode: c; style: linux -*- */
+
+/* mouse-properties-capplet.c
+ * Copyright (C) 2001 Red Hat, Inc.
+ * Copyright (C) 2001 Ximian, Inc.
+ *
+ * Written by: Jonathon Blandford <jrb@redhat.com>,
+ *             Bradford Hovinen <hovinen@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, 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 <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.
+#include <gio/gio.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 <math.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+#include "activate-settings-daemon.h"<--- Include file: "activate-settings-daemon.h" not found.
+#include "msd-input-helper.h"
+
+#include <X11/Xatom.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <X11/extensions/XInput.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+enum
+{
+	DOUBLE_CLICK_TEST_OFF,
+	DOUBLE_CLICK_TEST_MAYBE,
+	DOUBLE_CLICK_TEST_ON
+};
+
+typedef enum {
+	ACCEL_PROFILE_DEFAULT,
+	ACCEL_PROFILE_ADAPTIVE,
+	ACCEL_PROFILE_FLAT
+} AccelProfile;
+
+#define MOUSE_SCHEMA "org.mate.peripherals-mouse"
+#define INTERFACE_SCHEMA "org.mate.interface"
+#define DOUBLE_CLICK_KEY "double-click"
+
+#define TOUCHPAD_SCHEMA "org.mate.peripherals-touchpad"
+
+/* State in testing the double-click speed. Global for a great deal of
+ * convenience
+ */
+static gint double_click_state = DOUBLE_CLICK_TEST_OFF;
+
+static GSettings *mouse_settings = NULL;
+static GSettings *interface_settings = NULL;
+static GSettings *touchpad_settings = NULL;
+
+/* Double Click handling */
+
+struct test_data_t
+{
+	gint *timeout_id;
+	GtkWidget *image;
+};
+
+/* Timeout for the double click test */
+
+static gboolean
+test_maybe_timeout (struct test_data_t *data)
+{
+	double_click_state = DOUBLE_CLICK_TEST_OFF;
+
+	gtk_image_set_from_resource (GTK_IMAGE (data->image), "/org/mate/mcc/mouse/double-click-off.svg");
+
+	*data->timeout_id = 0;
+
+	return FALSE;
+}
+
+/* Callback issued when the user clicks the double click testing area. */
+
+static gboolean
+event_box_button_press_event (GtkWidget   *widget,
+			      GdkEventButton *event,<--- Parameter 'event' can be declared as pointer to const
+			      gpointer user_data)
+{
+	gint                       double_click_time;
+	static struct test_data_t  data;
+	static gint                test_on_timeout_id     = 0;
+	static gint                test_maybe_timeout_id  = 0;
+	static guint32             double_click_timestamp = 0;
+	GtkWidget                 *image;
+
+	if (event->type != GDK_BUTTON_PRESS)
+		return FALSE;
+
+	image = g_object_get_data (G_OBJECT (widget), "image");
+
+	double_click_time = g_settings_get_int (mouse_settings, DOUBLE_CLICK_KEY);
+
+	if (test_maybe_timeout_id != 0) {
+		g_source_remove  (test_maybe_timeout_id);
+		test_maybe_timeout_id = 0;
+	}
+	if (test_on_timeout_id != 0) {
+		g_source_remove (test_on_timeout_id);
+		test_on_timeout_id = 0;
+	}
+
+	switch (double_click_state) {
+	case DOUBLE_CLICK_TEST_OFF:
+		double_click_state = DOUBLE_CLICK_TEST_MAYBE;
+		data.image = image;
+		data.timeout_id = &test_maybe_timeout_id;
+		test_maybe_timeout_id = g_timeout_add (double_click_time, (GSourceFunc) test_maybe_timeout, &data);
+		break;
+	case DOUBLE_CLICK_TEST_MAYBE:
+		if (event->time - double_click_timestamp < double_click_time) {
+			double_click_state = DOUBLE_CLICK_TEST_ON;
+			data.image = image;
+			data.timeout_id = &test_on_timeout_id;
+			test_on_timeout_id = g_timeout_add (2500, (GSourceFunc) test_maybe_timeout, &data);
+		}
+		break;
+	case DOUBLE_CLICK_TEST_ON:
+		double_click_state = DOUBLE_CLICK_TEST_OFF;
+		break;
+	}
+
+	double_click_timestamp = event->time;
+
+	switch (double_click_state) {
+	case DOUBLE_CLICK_TEST_ON:
+		gtk_image_set_from_resource (GTK_IMAGE (image), "/org/mate/mcc/mouse/double-click-on.svg");
+		break;
+	case DOUBLE_CLICK_TEST_MAYBE:
+		gtk_image_set_from_resource (GTK_IMAGE (image), "/org/mate/mcc/mouse/double-click-maybe.svg");
+		break;
+	case DOUBLE_CLICK_TEST_OFF:
+		gtk_image_set_from_resource (GTK_IMAGE (image), "/org/mate/mcc/mouse/double-click-off.svg");
+		break;
+	}
+
+	return TRUE;
+}
+
+static void
+orientation_radio_button_release_event (GtkWidget   *widget,
+				        GdkEventButton *event)
+{
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
+}
+
+static void
+orientation_radio_button_toggled (GtkToggleButton *togglebutton,
+				        GtkBuilder *dialog)
+{
+	gboolean left_handed;
+	left_handed = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (dialog, "left_handed_radio")));
+	g_settings_set_boolean (mouse_settings, "left-handed", left_handed);
+}
+
+static void
+synaptics_check_capabilities (GtkBuilder *dialog)
+{
+	GdkDisplay *display;
+	int numdevices, i;
+	XDeviceInfo *devicelist;
+	Atom realtype, prop;
+	int realformat;
+	unsigned long nitems, bytes_after;
+	unsigned char *data;
+
+	display = gdk_display_get_default ();
+	prop = XInternAtom (GDK_DISPLAY_XDISPLAY(display), "Synaptics Capabilities", True);
+	if (!prop)
+		return;
+
+	devicelist = XListInputDevices (GDK_DISPLAY_XDISPLAY(display), &numdevices);
+	for (i = 0; i < numdevices; i++) {
+		if (devicelist[i].use != IsXExtensionPointer)
+			continue;
+
+		gdk_x11_display_error_trap_push (display);
+		XDevice *device = XOpenDevice (GDK_DISPLAY_XDISPLAY(display),
+					       devicelist[i].id);
+		if (gdk_x11_display_error_trap_pop (display))
+			continue;
+
+		gdk_x11_display_error_trap_push (display);
+		if ((XGetDeviceProperty (GDK_DISPLAY_XDISPLAY(display), device, prop, 0, 2, False,
+					 XA_INTEGER, &realtype, &realformat, &nitems,
+					 &bytes_after, &data) == Success) && (realtype != None)) {
+			/* Property data is booleans for has_left, has_middle,
+			 * has_right, has_double, has_triple */
+			if (!data[0]) {
+				gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (dialog, "tap_to_click_toggle")), TRUE);
+				gtk_widget_set_sensitive (WID ("tap_to_click_toggle"), FALSE);
+			}
+
+			XFree (data);
+		}
+
+		gdk_x11_display_error_trap_pop_ignored (display);
+
+		XCloseDevice (GDK_DISPLAY_XDISPLAY(display), device);
+	}
+	XFreeDeviceList (devicelist);
+}
+
+static void
+accel_profile_combobox_changed_callback (GtkWidget *combobox, void *data)
+{
+	AccelProfile value = gtk_combo_box_get_active (GTK_COMBO_BOX (combobox));
+	g_settings_set_enum (mouse_settings, (const gchar *) "accel-profile", value);
+}
+
+static void
+comboxbox_changed (GtkWidget *combobox, GtkBuilder *dialog, const char *key)
+{
+	gint value = gtk_combo_box_get_active (GTK_COMBO_BOX (combobox));
+	gint value2, value3;
+	GtkLabel *warn = GTK_LABEL (gtk_builder_get_object (dialog, "multi_finger_warning"));
+
+	g_settings_set_int (touchpad_settings, (const gchar *) key, value);
+
+	/* Show warning if some multi-finger click emulation is enabled. */
+	value2 = g_settings_get_int (touchpad_settings, "two-finger-click");
+	value3 = g_settings_get_int (touchpad_settings, "three-finger-click");
+	gtk_widget_set_opacity (GTK_WIDGET (warn), (value2 || value3)?  1.0: 0.0);
+}
+
+static void
+comboxbox_two_finger_changed_callback (GtkWidget *combobox, void *data)
+{
+	comboxbox_changed (combobox, GTK_BUILDER (data), "two-finger-click");
+}
+
+static void
+comboxbox_three_finger_changed_callback (GtkWidget *combobox, void *data)
+{
+	comboxbox_changed (combobox, GTK_BUILDER (data), "three-finger-click");
+}
+
+/* Set up the property editors in the dialog. */
+static void
+setup_dialog (GtkBuilder *dialog)
+{
+	GtkRadioButton    *radio;
+
+	/* Orientation radio buttons */
+	radio = GTK_RADIO_BUTTON (gtk_builder_get_object (dialog, "left_handed_radio"));
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(radio),
+		g_settings_get_boolean(mouse_settings, "left-handed"));
+	/* explicitly connect to button-release so that you can change orientation with either button */
+	g_signal_connect (WID ("right_handed_radio"), "button_release_event",
+		G_CALLBACK (orientation_radio_button_release_event), NULL);
+	g_signal_connect (WID ("left_handed_radio"), "button_release_event",
+		G_CALLBACK (orientation_radio_button_release_event), NULL);
+	g_signal_connect (WID ("left_handed_radio"), "toggled",
+		G_CALLBACK (orientation_radio_button_toggled), dialog);
+
+	/* Locate pointer toggle */
+	g_settings_bind (mouse_settings, "locate-pointer", WID ("locate_pointer_toggle"),
+		"active", G_SETTINGS_BIND_DEFAULT);
+
+	/* Middle Button Emulation */
+	g_settings_bind (mouse_settings, "middle-button-enabled", WID ("middle_button_emulation_toggle"),
+		"active", G_SETTINGS_BIND_DEFAULT);
+
+	/* Middle Button Paste */
+	g_settings_bind (interface_settings, "gtk-enable-primary-paste", WID ("middle_button_paste_toggle"),
+		"active", G_SETTINGS_BIND_DEFAULT);
+
+	/* Double-click time */
+	g_settings_bind (mouse_settings, DOUBLE_CLICK_KEY,
+		gtk_range_get_adjustment (GTK_RANGE (gtk_builder_get_object (dialog, "delay_scale"))), "value",
+		G_SETTINGS_BIND_DEFAULT);
+
+	gtk_image_set_from_resource (GTK_IMAGE (gtk_builder_get_object (dialog, "double_click_image")),
+	                             "/org/mate/mcc/mouse/double-click-off.svg");
+	g_object_set_data (gtk_builder_get_object (dialog, "double_click_eventbox"),
+	                   "image", WID ("double_click_image"));
+	g_signal_connect (gtk_builder_get_object (dialog, "double_click_eventbox"), "button_press_event",
+	                  G_CALLBACK (event_box_button_press_event),<--- You might need to cast the function pointer here
+	                  NULL);
+
+	/* speed */
+	g_settings_bind (mouse_settings, "motion-acceleration",
+	                 gtk_range_get_adjustment (GTK_RANGE (gtk_builder_get_object (dialog, "accel_scale"))), "value",
+	                 G_SETTINGS_BIND_DEFAULT);
+	g_settings_bind (mouse_settings, "motion-threshold",
+	                 gtk_range_get_adjustment (GTK_RANGE (gtk_builder_get_object (dialog, "sensitivity_scale"))), "value",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	g_signal_connect (WID ("mouse_accel_profile"), "changed",
+			  G_CALLBACK (accel_profile_combobox_changed_callback),
+	                  NULL);
+	gtk_combo_box_set_active (GTK_COMBO_BOX (gtk_builder_get_object (dialog, "mouse_accel_profile")),
+				  g_settings_get_enum (mouse_settings, "accel-profile"));
+
+	/* DnD threshold */
+	g_settings_bind (mouse_settings, "drag-threshold",
+	                 gtk_range_get_adjustment (GTK_RANGE (gtk_builder_get_object (dialog, "drag_threshold_scale"))), "value",
+	                 G_SETTINGS_BIND_DEFAULT);
+
+	/* Trackpad page */
+	if (touchpad_is_present () == FALSE)
+		gtk_notebook_remove_page (GTK_NOTEBOOK (gtk_builder_get_object (dialog, "prefs_widget")), -1);
+	else {
+		g_settings_bind (touchpad_settings, "touchpad-enabled",
+		                 gtk_builder_get_object (dialog, "touchpad_enable"), "active",
+		                 G_SETTINGS_BIND_DEFAULT);
+		g_settings_bind (touchpad_settings, "touchpad-enabled",
+		                 gtk_builder_get_object (dialog, "vbox_touchpad_general"), "sensitive",
+		                 G_SETTINGS_BIND_DEFAULT);
+		g_settings_bind (touchpad_settings, "touchpad-enabled",
+		                 gtk_builder_get_object (dialog, "vbox_touchpad_scrolling"), "sensitive",
+		                 G_SETTINGS_BIND_DEFAULT);
+		g_settings_bind (touchpad_settings, "touchpad-enabled",
+		                 gtk_builder_get_object (dialog, "vbox_touchpad_pointer_speed"), "sensitive",
+		                 G_SETTINGS_BIND_DEFAULT);
+		g_settings_bind (touchpad_settings, "disable-while-typing",
+		                 gtk_builder_get_object (dialog, "disable_w_typing_toggle"), "active",
+		                 G_SETTINGS_BIND_DEFAULT);
+		g_settings_bind (touchpad_settings, "tap-to-click",
+		                 gtk_builder_get_object (dialog, "tap_to_click_toggle"), "active",
+		                 G_SETTINGS_BIND_DEFAULT);
+		g_settings_bind (touchpad_settings, "vertical-edge-scrolling",
+		                 gtk_builder_get_object (dialog, "vert_edge_scroll_toggle"), "active",
+		                 G_SETTINGS_BIND_DEFAULT);
+		g_settings_bind (touchpad_settings, "horizontal-edge-scrolling",
+		                 gtk_builder_get_object (dialog, "horiz_edge_scroll_toggle"), "active",
+		                 G_SETTINGS_BIND_DEFAULT);
+		g_settings_bind (touchpad_settings, "vertical-two-finger-scrolling",
+		                 gtk_builder_get_object (dialog, "vert_twofinger_scroll_toggle"), "active",
+		                 G_SETTINGS_BIND_DEFAULT);
+		g_settings_bind (touchpad_settings, "horizontal-two-finger-scrolling",
+		                 gtk_builder_get_object (dialog, "horiz_twofinger_scroll_toggle"), "active",
+		                 G_SETTINGS_BIND_DEFAULT);
+		g_settings_bind (touchpad_settings, "natural-scroll",
+		                 gtk_builder_get_object (dialog, "natural_scroll_toggle"), "active",
+		                 G_SETTINGS_BIND_DEFAULT);
+
+		char * emulation_values[] = { _("Disabled"), _("Left button"), _("Middle button"), _("Right button") };
+
+		GtkWidget *two_click_comboxbox = gtk_combo_box_text_new ();
+		GtkWidget *three_click_comboxbox = gtk_combo_box_text_new ();
+		gtk_box_pack_start (GTK_BOX (gtk_builder_get_object (dialog, "hbox_two_finger_click")), two_click_comboxbox, FALSE, FALSE, 6);
+		gtk_box_pack_start (GTK_BOX (gtk_builder_get_object (dialog, "hbox_three_finger_click")), three_click_comboxbox, FALSE, FALSE, 6);
+		int i;
+		for (i=0; i<4; i++) {
+			gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (two_click_comboxbox), emulation_values[i]);
+			gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (three_click_comboxbox), emulation_values[i]);
+		}
+
+		g_signal_connect (two_click_comboxbox, "changed", G_CALLBACK (comboxbox_two_finger_changed_callback), dialog);
+		g_signal_connect (three_click_comboxbox, "changed", G_CALLBACK (comboxbox_three_finger_changed_callback), dialog);
+		gtk_combo_box_set_active (GTK_COMBO_BOX (two_click_comboxbox), g_settings_get_int (touchpad_settings, "two-finger-click"));
+		gtk_combo_box_set_active (GTK_COMBO_BOX (three_click_comboxbox), g_settings_get_int (touchpad_settings, "three-finger-click"));
+		gtk_widget_show (two_click_comboxbox);
+		gtk_widget_show (three_click_comboxbox);
+
+		/* speed */
+		g_settings_bind (touchpad_settings, "motion-acceleration",
+		                 gtk_range_get_adjustment (GTK_RANGE (gtk_builder_get_object (dialog, "touchpad_accel_scale"))), "value",
+		                 G_SETTINGS_BIND_DEFAULT);
+		g_settings_bind (touchpad_settings, "motion-threshold",
+		                 gtk_range_get_adjustment (GTK_RANGE (gtk_builder_get_object (dialog, "touchpad_sensitivity_scale"))), "value",
+		                 G_SETTINGS_BIND_DEFAULT);
+
+		synaptics_check_capabilities (dialog);
+	}
+
+}
+
+/* Callback issued when a button is clicked on the dialog */
+
+static void
+dialog_response_cb (GtkDialog *dialog, gint response_id, gpointer data)
+{
+	if (response_id == GTK_RESPONSE_HELP)
+		capplet_help (GTK_WINDOW (dialog),
+			      "goscustperiph-5");
+	else
+		gtk_main_quit ();
+}
+
+int
+main (int argc, char **argv)
+{
+	GtkBuilder     *dialog;
+	GtkWidget      *dialog_win, *w;
+	gchar *start_page = NULL;
+
+	GOptionContext *context;
+	GOptionEntry cap_options[] = {
+		{"show-page", 'p', G_OPTION_FLAG_IN_MAIN,
+		 G_OPTION_ARG_STRING,
+		 &start_page,
+		 /* TRANSLATORS: don't translate the terms in brackets */
+		 N_("Specify the name of the page to show (general)"),
+		 N_("page") },
+		{ NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
+	};
+
+	context = g_option_context_new (_("- MATE Mouse Preferences"));
+	g_option_context_add_main_entries (context, cap_options, GETTEXT_PACKAGE);
+	capplet_init (context, &argc, &argv);
+	g_option_context_free (context);
+
+	activate_settings_daemon ();
+
+	mouse_settings = g_settings_new (MOUSE_SCHEMA);
+	interface_settings = g_settings_new (INTERFACE_SCHEMA);
+	touchpad_settings = g_settings_new (TOUCHPAD_SCHEMA);
+
+	dialog = gtk_builder_new_from_resource ("/org/mate/mcc/mouse/mate-mouse-properties.ui");
+
+	setup_dialog (dialog);
+
+	dialog_win = WID ("mouse_properties_dialog");
+	g_signal_connect (dialog_win, "response",
+			  G_CALLBACK (dialog_response_cb), NULL);
+
+	GtkNotebook* nb = GTK_NOTEBOOK (gtk_builder_get_object (dialog, "prefs_widget"));
+	gtk_widget_add_events (GTK_WIDGET (nb), GDK_SCROLL_MASK);
+	g_signal_connect (nb, "scroll-event",
+	                  G_CALLBACK (capplet_notebook_scroll_event_cb),
+	                  NULL);
+
+	if (start_page != NULL) {
+		gchar *page_name;
+
+		page_name = g_strconcat (start_page, "_vbox", NULL);
+		g_free (start_page);
+
+		w = WID (page_name);
+		if (w != NULL) {
+			gint pindex;
+
+			pindex = gtk_notebook_page_num (nb, w);
+			if (pindex != -1)
+				gtk_notebook_set_current_page (nb, pindex);
+		}
+		g_free (page_name);
+	}
+
+	capplet_set_icon (dialog_win, "input-mouse");
+	gtk_widget_show (dialog_win);
+
+	gtk_main ();
+
+	g_object_unref (dialog);
+	g_object_unref (mouse_settings);
+	g_object_unref (interface_settings);
+	g_object_unref (touchpad_settings);
+
+	return 0;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/73.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/73.html new file mode 100644 index 00000000..5617084e --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/73.html @@ -0,0 +1,309 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2010 Bastien Nocera <hadess@hadess.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __MSD_INPUT_HELPER_H
+#define __MSD_INPUT_HELPER_H
+
+G_BEGIN_DECLS
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <X11/extensions/XInput.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <X11/extensions/XIproto.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+gboolean  supports_xinput_devices (void);
+XDevice  *device_is_touchpad      (XDeviceInfo *deviceinfo);
+gboolean  touchpad_is_present     (void);
+
+G_END_DECLS
+
+#endif /* __MSD_INPUT_HELPER_H */
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/74.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/74.html new file mode 100644 index 00000000..7172b669 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/74.html @@ -0,0 +1,487 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2010 Bastien Nocera <hadess@hadess.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include "config.h"<--- Include file: "config.h" not found.
+
+#include <gdk/gdk.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 <sys/types.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.
+
+#include "msd-input-helper.h"
+
+gboolean
+supports_xinput_devices (void)
+{
+        gint op_code, event, error;
+
+        return XQueryExtension (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
+                                "XInputExtension",
+                                &op_code,
+                                &event,
+                                &error);
+}
+
+static gboolean
+device_has_property (XDevice    *device,
+                     const char *property_name)
+{
+        GdkDisplay *display;
+        Atom realtype, prop;
+        int realformat;
+        unsigned long nitems, bytes_after;
+        unsigned char *data;
+
+        display = gdk_display_get_default ();
+        prop = XInternAtom (GDK_DISPLAY_XDISPLAY (display), property_name, True);
+        if (!prop)
+                return FALSE;
+
+        gdk_x11_display_error_trap_push (display);
+        if ((XGetDeviceProperty (GDK_DISPLAY_XDISPLAY (display), device, prop, 0, 1, False,
+                                XA_INTEGER, &realtype, &realformat, &nitems,
+                                &bytes_after, &data) == Success) && (realtype != None)) {
+                gdk_x11_display_error_trap_pop_ignored (display);
+                XFree (data);
+                return TRUE;
+        }
+
+        gdk_x11_display_error_trap_pop_ignored (display);
+        return FALSE;
+}
+
+XDevice*
+device_is_touchpad (XDeviceInfo *deviceinfo)
+{
+        GdkDisplay *display;
+        XDevice *device;
+
+        display = gdk_display_get_default ();
+        if (deviceinfo->type != XInternAtom (GDK_DISPLAY_XDISPLAY (display), XI_TOUCHPAD, True))
+                return NULL;
+
+        gdk_x11_display_error_trap_push (display);
+        device = XOpenDevice (GDK_DISPLAY_XDISPLAY (display), deviceinfo->id);
+        if (gdk_x11_display_error_trap_pop (display) || (device == NULL))
+                return NULL;
+
+        if (device_has_property (device, "libinput Tapping Enabled") ||
+            device_has_property (device, "Synaptics Off")) {
+                return device;
+        }
+
+        XCloseDevice (GDK_DISPLAY_XDISPLAY (display), device);
+        return NULL;
+}
+
+gboolean
+touchpad_is_present (void)
+{
+        XDeviceInfo *device_info;
+        gint n_devices;
+        guint i;
+        gboolean retval;
+
+        if (supports_xinput_devices () == FALSE)
+                return TRUE;
+
+        retval = FALSE;
+
+        device_info = XListInputDevices (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &n_devices);
+        if (device_info == NULL)
+                return FALSE;
+
+        for (i = 0; i < n_devices; i++) {
+                XDevice *device;<--- Variable 'device' can be declared as pointer to const
+
+                device = device_is_touchpad (&device_info[i]);
+                if (device != NULL) {
+                        retval = TRUE;
+                        break;
+                }
+        }
+        if (device_info != NULL)<--- Condition 'device_info!=NULL' is always true
+                XFreeDeviceList (device_info);
+
+        return retval;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/75.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/75.html new file mode 100644 index 00000000..86e65734 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/75.html @@ -0,0 +1,1073 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
#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.network"), aligned (8)))
+#else
+# define SECTION
+#endif
+
+static const SECTION union { const guint8 data[3377]; const double alignment; void * const ptr;}  network_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, 0310, 0000, 0000, 0000, 0000, 0000, 0000, 0050, 0006, 0000, 0000, 0000, 
+  0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0001, 0000, 0000, 0000, 0004, 0000, 0000, 0000, 
+  0004, 0000, 0000, 0000, 0004, 0000, 0000, 0000, 0113, 0120, 0220, 0013, 0002, 0000, 0000, 0000, 
+  0310, 0000, 0000, 0000, 0004, 0000, 0114, 0000, 0314, 0000, 0000, 0000, 0320, 0000, 0000, 0000, 
+  0034, 0343, 0157, 0266, 0005, 0000, 0000, 0000, 0320, 0000, 0000, 0000, 0010, 0000, 0114, 0000, 
+  0330, 0000, 0000, 0000, 0334, 0000, 0000, 0000, 0324, 0265, 0002, 0000, 0377, 0377, 0377, 0377, 
+  0334, 0000, 0000, 0000, 0001, 0000, 0114, 0000, 0340, 0000, 0000, 0000, 0344, 0000, 0000, 0000, 
+  0000, 0171, 0272, 0023, 0001, 0000, 0000, 0000, 0344, 0000, 0000, 0000, 0032, 0000, 0166, 0000, 
+  0000, 0001, 0000, 0000, 0037, 0015, 0000, 0000, 0201, 0321, 0040, 0031, 0000, 0000, 0000, 0000, 
+  0037, 0015, 0000, 0000, 0005, 0000, 0114, 0000, 0044, 0015, 0000, 0000, 0050, 0015, 0000, 0000, 
+  0143, 0041, 0175, 0170, 0004, 0000, 0000, 0000, 0050, 0015, 0000, 0000, 0004, 0000, 0114, 0000, 
+  0054, 0015, 0000, 0000, 0060, 0015, 0000, 0000, 0157, 0162, 0147, 0057, 0004, 0000, 0000, 0000, 
+  0156, 0145, 0164, 0167, 0157, 0162, 0153, 0057, 0003, 0000, 0000, 0000, 0057, 0000, 0000, 0000, 
+  0000, 0000, 0000, 0000, 0155, 0141, 0164, 0145, 0055, 0156, 0145, 0164, 0167, 0157, 0162, 0153, 
+  0055, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0151, 0145, 0163, 0056, 0165, 0151, 0000, 0000, 
+  0376, 0314, 0000, 0000, 0001, 0000, 0000, 0000, 0170, 0332, 0355, 0135, 0133, 0163, 0333, 0266, 
+  0022, 0176, 0317, 0257, 0340, 0341, 0103, 0137, 0316, 0050, 0062, 0245, 0070, 0111, 0123, 0133, 
+  0235, 0234, 0246, 0111, 0072, 0223, 0166, 0062, 0215, 0163, 0372, 0310, 0201, 0110, 0110, 0104, 
+  0015, 0021, 0072, 0040, 0050, 0133, 0375, 0365, 0007, 0040, 0151, 0131, 0027, 0336, 0160, 0221, 
+  0055, 0122, 0170, 0361, 0214, 0150, 0142, 0011, 0054, 0366, 0333, 0135, 0054, 0026, 0213, 0253, 
+  0237, 0357, 0027, 0330, 0131, 0101, 0232, 0040, 0022, 0137, 0273, 0336, 0313, 0013, 0327, 0201, 
+  0161, 0100, 0102, 0024, 0317, 0257, 0335, 0357, 0067, 0037, 0007, 0157, 0335, 0237, 0047, 0057, 
+  0256, 0376, 0065, 0030, 0070, 0237, 0140, 0014, 0051, 0140, 0060, 0164, 0356, 0020, 0213, 0234, 
+  0071, 0006, 0041, 0164, 0306, 0057, 0107, 0027, 0057, 0057, 0234, 0301, 0200, 0277, 0204, 0142, 
+  0006, 0351, 0014, 0004, 0160, 0362, 0302, 0161, 0256, 0050, 0374, 0137, 0212, 0050, 0114, 0034, 
+  0214, 0246, 0327, 0356, 0234, 0335, 0376, 0333, 0175, 0374, 0320, 0370, 0245, 0367, 0312, 0035, 
+  0146, 0357, 0011, 0322, 0233, 0226, 0003, 0214, 0002, 0030, 0047, 0160, 0300, 0326, 0113, 0350, 
+  0314, 0227, 0170, 0065, 0312, 0150, 0037, 0274, 0027, 0203, 0005, 0164, 0026, 0274, 0067, 0203, 
+  0030, 0262, 0073, 0102, 0157, 0007, 0113, 0112, 0226, 0220, 0062, 0304, 0277, 0130, 0332, 0042, 
+  0204, 0111, 0100, 0321, 0222, 0361, 0357, 0073, 0105, 0033, 0147, 0253, 0115, 0210, 0000, 0046, 
+  0163, 0076, 0264, 0070, 0044, 0167, 0345, 0024, 0002, 0262, 0134, 0123, 0064, 0217, 0230, 0363, 
+  0373, 0373, 0233, 0137, 0235, 0017, 0160, 0005, 0261, 0150, 0137, 0376, 0066, 0110, 0131, 0104, 
+  0150, 0342, 0374, 0105, 0360, 0154, 0016, 0342, 0271, 0363, 0035, 0117, 0051, 0012, 0242, 0207, 
+  0267, 0311, 0364, 0157, 0030, 0060, 0047, 0300, 0040, 0111, 0256, 0335, 0117, 0354, 0366, 0175, 
+  0370, 0167, 0232, 0260, 0005, 0214, 0231, 0353, 0240, 0360, 0332, 0005, 0233, 0337, 0236, 0053, 
+  0132, 0360, 0066, 0105, 0177, 0327, 0216, 0030, 0376, 0265, 0233, 0056, 0371, 0057, 0167, 0362, 
+  0372, 0362, 0162, 0174, 0171, 0065, 0174, 0370, 0147, 0371, 0273, 0011, 0203, 0113, 0037, 0305, 
+  0001, 0205, 0331, 0027, 0046, 0136, 0123, 0203, 0045, 0230, 0303, 0235, 0006, 0027, 0273, 0055, 
+  0256, 0206, 0371, 0010, 0144, 0007, 0063, 0352, 0323, 0140, 0306, 0175, 0032, 0314, 0253, 0356, 
+  0015, 0346, 0103, 0206, 0332, 0174, 0040, 0005, 0250, 0375, 0034, 0311, 0025, 0143, 0021, 0177, 
+  0335, 0311, 0216, 0342, 0310, 0337, 0157, 0352, 0147, 0000, 0142, 0177, 0106, 0202, 0064, 0161, 
+  0047, 0037, 0001, 0116, 0140, 0323, 0373, 0123, 0102, 0103, 0110, 0375, 0073, 0024, 0262, 0310, 
+  0235, 0064, 0362, 0215, 0041, 0206, 0241, 0353, 0060, 0012, 0342, 0004, 0003, 0006, 0246, 0230, 
+  0077, 0134, 0103, 0376, 0265, 0077, 0012, 0135, 0365, 0225, 0222, 0373, 0065, 0377, 0013, 0147, 
+  0220, 0162, 0025, 0015, 0223, 0046, 0222, 0134, 0367, 0242, 0177, 0004, 0241, 0226, 0075, 0026, 
+  0052, 0327, 0217, 0220, 0230, 0204, 0012, 0226, 0004, 0021, 0302, 0141, 0256, 0342, 0142, 0200, 
+  0007, 0331, 0317, 0153, 0167, 0065, 0045, 0367, 0005, 0267, 0313, 0246, 0350, 0077, 0374, 0277, 
+  0331, 0374, 0344, 0104, 0007, 0342, 0165, 0157, 0363, 0376, 0141, 0067, 0126, 0050, 0101, 0131, 
+  0247, 0157, 0150, 0172, 0320, 0147, 0225, 0231, 0051, 0153, 0103, 0050, 0342, 0322, 0006, 0204, 
+  0061, 0160, 0047, 0053, 0141, 0002, 0002, 0200, 0333, 0064, 0114, 0226, 0040, 0340, 0266, 0321, 
+  0235, 0214, 0112, 0337, 0056, 0347, 0020, 0010, 0304, 0207, 0174, 0100, 0041, 0330, 0032, 0170, 
+  0051, 0263, 0122, 0306, 0110, 0274, 0317, 0262, 0255, 0366, 0336, 0016, 0001, 0005, 0356, 0251, 
+  0162, 0260, 0254, 0035, 0006, 0153, 0222, 0062, 0077, 0141, 0153, 0361, 0105, 0030, 0207, 0225, 
+  0015, 0063, 0106, 0354, 0076, 0253, 0036, 0176, 0076, 0366, 0010, 0342, 0345, 0064, 0373, 0275, 
+  0077, 0346, 0362, 0256, 0114, 0041, 0166, 0047, 0334, 0315, 0030, 0210, 0206, 0125, 0035, 0121, 
+  0146, 0131, 0003, 0333, 0124, 0232, 0206, 0160, 0006, 0122, 0314, 0344, 0033, 0123, 0030, 0100, 
+  0264, 0202, 0311, 0043, 0205, 0332, 0131, 0053, 0125, 0351, 0011, 0344, 0323, 0106, 0202, 0333, 
+  0246, 0257, 0157, 0253, 0337, 0135, 0202, 0040, 0270, 0345, 0100, 0150, 0376, 0024, 0274, 0137, 
+  0202, 0070, 0124, 0350, 0343, 0014, 0141, 0254, 0320, 0154, 0111, 0022, 0224, 0343, 0372, 0242, 
+  0156, 0130, 0245, 0375, 0277, 0032, 0226, 0010, 0152, 0205, 0360, 0056, 0061, 0367, 0362, 0042, 
+  0202, 0271, 0226, 0037, 0252, 0123, 0251, 0205, 0100, 0200, 0111, 0002, 0225, 0060, 0220, 0265, 
+  0264, 0040, 0260, 0040, 0050, 0267, 0123, 0262, 0040, 0050, 0143, 0100, 0371, 0340, 0225, 0006, 
+  0136, 0076, 0150, 0031, 0013, 0046, 0372, 0342, 0013, 0007, 0246, 0336, 0014, 0125, 0162, 0311, 
+  0053, 0157, 0122, 0302, 0241, 0003, 0356, 0034, 0002, 0373, 0020, 0324, 0177, 0020, 0006, 0247, 
+  0204, 0334, 0026, 0216, 0152, 0361, 0353, 0330, 0266, 0134, 0246, 0131, 0203, 0273, 0052, 0255, 
+  0305, 0036, 0074, 0230, 0175, 0157, 0357, 0230, 0372, 0107, 0032, 0045, 0273, 0203, 0366, 0106, 
+  0062, 0155, 0133, 0173, 0220, 0215, 0236, 0244, 0367, 0266, 0266, 0131, 0051, 0307, 0313, 0271, 
+  0376, 0047, 0010, 0021, 0331, 0066, 0040, 0061, 0211, 0241, 0117, 0305, 0323, 0334, 0212, 0270, 
+  0145, 0164, 0064, 0046, 0103, 0323, 0040, 0030, 0322, 0353, 0145, 0144, 0042, 0200, 0321, 0234, 
+  0217, 0067, 0141, 0200, 0062, 0331, 0306, 0302, 0060, 0244, 0061, 0027, 0015, 0214, 0142, 0105, 
+  0056, 0204, 0024, 0334, 0361, 0145, 0155, 0310, 0245, 0202, 0021, 0332, 0222, 0106, 0345, 0124, 
+  0227, 0117, 0367, 0227, 0314, 0336, 0147, 0023, 0235, 0231, 0376, 0127, 0156, 0125, 0133, 0315, 
+  0051, 0326, 0305, 0135, 0275, 0303, 0122, 0266, 0350, 0375, 0001, 0263, 0237, 0246, 0077, 0314, 
+  0331, 0117, 0037, 0220, 0117, 0305, 0250, 0363, 0045, 0025, 0344, 0303, 0047, 0161, 0014, 0263, 
+  0365, 0220, 0170, 0147, 0230, 0275, 0244, 0362, 0155, 0061, 0307, 0013, 0100, 0157, 0323, 0245, 
+  0072, 0017, 0024, 0344, 0244, 0332, 0231, 0250, 0361, 0035, 0233, 0033, 0126, 0173, 0042, 0132, 
+  0336, 0210, 0206, 0107, 0242, 0354, 0232, 0327, 0170, 0046, 0265, 0014, 0222, 0121, 0224, 0033, 
+  0363, 0024, 0023, 0077, 0104, 0102, 0300, 0374, 0235, 0050, 0306, 0323, 0250, 0107, 0045, 0036, 
+  0112, 0333, 0035, 0015, 0333, 0243, 0242, 0224, 0066, 0254, 0135, 0200, 0070, 0005, 0270, 0216, 
+  0257, 0047, 0253, 0227, 0224, 0170, 0134, 0313, 0347, 0327, 0255, 0132, 0327, 0262, 0272, 0245, 
+  0311, 0057, 0330, 0336, 0154, 0364, 0215, 0315, 0200, 0001, 0047, 0300, 0260, 0063, 0140, 0304, 
+  0051, 0060, 0252, 0364, 0315, 0071, 0011, 0125, 0264, 0346, 0224, 0010, 0123, 0266, 0357, 0361, 
+  0265, 0046, 0327, 0050, 0173, 0355, 0174, 0220, 0261, 0333, 0104, 0303, 0220, 0304, 0231, 0302, 
+  0276, 0206, 0157, 0342, 0377, 0236, 0141, 0115, 0354, 0042, 0336, 0257, 0205, 0143, 0062, 0103, 
+  0363, 0224, 0002, 0171, 0337, 0304, 0244, 0217, 0162, 0004, 0261, 0155, 0362, 0131, 0132, 0370, 
+  0056, 0062, 0204, 0352, 0175, 0031, 0043, 0076, 0215, 0001, 0337, 0106, 0333, 0307, 0151, 0341, 
+  0353, 0264, 0146, 0254, 0212, 0345, 0330, 0067, 0324, 0365, 0166, 0372, 0150, 0226, 0042, 0201, 
+  0261, 0140, 0330, 0012, 0152, 0362, 0135, 0025, 0373, 0246, 0024, 0337, 0250, 0137, 0212, 0157, 
+  0262, 0021, 0116, 0243, 0052, 0242, 0055, 0272, 0215, 0041, 0334, 0020, 0312, 0215, 0040, 0275, 
+  0045, 0332, 0133, 0252, 0122, 0165, 0321, 0375, 0104, 0121, 0270, 0003, 0175, 0226, 0357, 0022, 
+  0367, 0103, 0176, 0051, 0271, 0363, 0345, 0374, 0356, 0312, 0136, 0021, 0234, 0056, 0342, 0107, 
+  0142, 0365, 0001, 0102, 0265, 0331, 0051, 0237, 0241, 0137, 0143, 0106, 0327, 0305, 0066, 0050, 
+  0143, 0113, 0077, 0042, 0011, 0363, 0141, 0366, 0260, 0015, 0101, 0203, 0063, 0145, 0320, 0271, 
+  0257, 0304, 0021, 0105, 0334, 0311, 0131, 0373, 0050, 0020, 0173, 0334, 0001, 0267, 0005, 0200, 
+  0325, 0244, 0055, 0310, 0222, 0117, 0040, 0247, 0033, 0032, 0373, 0100, 0133, 0075, 0047, 0247, 
+  0353, 0112, 0025, 0061, 0234, 0061, 0037, 0060, 0006, 0202, 0250, 0162, 0203, 0242, 0075, 0065, 
+  0106, 0226, 0033, 0142, 0027, 0262, 0103, 0156, 0257, 0263, 0207, 0055, 0245, 0336, 0020, 0072, 
+  0370, 0344, 0246, 0024, 0132, 0174, 0130, 0174, 0230, 0304, 0207, 0327, 0033, 0174, 0314, 0254, 
+  0361, 0260, 0340, 0060, 0013, 0216, 0121, 0177, 0214, 0007, 0011, 0156, 0023, 0013, 0017, 0013, 
+  0017, 0223, 0360, 0030, 0167, 0033, 0036, 0373, 0141, 0015, 0357, 0342, 0304, 0120, 0141, 0104, 
+  0156, 0225, 0066, 0002, 0344, 0043, 0305, 0137, 0011, 0145, 0357, 0244, 0311, 0203, 0040, 0200, 
+  0011, 0147, 0036, 0302, 0250, 0155, 0233, 0354, 0270, 0015, 0316, 0042, 0317, 0216, 0310, 0202, 
+  0052, 0072, 0065, 0230, 0021, 0312, 0073, 0006, 0350, 0034, 0262, 0142, 0045, 0271, 0344, 0135, 
+  0342, 0053, 0132, 0024, 0027, 0173, 0103, 0303, 0226, 0235, 0032, 0112, 0367, 0352, 0231, 0300, 
+  0074, 0262, 0013, 0245, 0152, 0060, 0173, 0026, 0314, 0075, 0001, 0163, 0261, 0360, 0265, 0160, 
+  0076, 0243, 0165, 0335, 0001, 0234, 0107, 0026, 0316, 0075, 0201, 0363, 0314, 0232, 0346, 0363, 
+  0132, 0206, 0036, 0140, 0171, 0154, 0261, 0334, 0027, 0323, 0234, 0205, 0025, 0054, 0232, 0317, 
+  0150, 0325, 0374, 0215, 0317, 0363, 0316, 0331, 0305, 0262, 0245, 0226, 0215, 0056, 0075, 0157, 
+  0164, 0351, 0360, 0003, 0217, 0107, 0337, 0335, 0311, 0326, 0061, 0170, 0155, 0056, 0143, 0264, 
+  0230, 0372, 0242, 0124, 0206, 0112, 0154, 0311, 0234, 0132, 0302, 0060, 0034, 0114, 0327, 0217, 
+  0212, 0351, 0041, 0240, 0323, 0073, 0125, 0064, 0266, 0153, 0376, 0112, 0125, 0124, 0261, 0120, 
+  0264, 0312, 0250, 0033, 0312, 0150, 0334, 0157, 0145, 0344, 0131, 0145, 0324, 0347, 0210, 0305, 
+  0276, 0062, 0232, 0131, 0267, 0250, 0263, 0232, 0150, 0324, 0157, 0115, 0064, 0262, 0232, 0250, 
+  0317, 0361, 0226, 0003, 0267, 0250, 0164, 0221, 0156, 0165, 0121, 0067, 0164, 0221, 0327, 0157, 
+  0135, 0064, 0266, 0272, 0250, 0317, 0321, 0242, 0155, 0075, 0024, 0102, 0006, 0020, 0116, 0174, 
+  0055, 0005, 0124, 0035, 0031, 0365, 0077, 0344, 0364, 0165, 0271, 0177, 0312, 0052, 0116, 0363, 
+  0220, 0150, 0025, 0131, 0255, 0003, 0163, 0317, 0210, 0264, 0127, 0066, 0030, 0122, 0271, 0313, 
+  0362, 0332, 0156, 0262, 0050, 0253, 0222, 0317, 0376, 0315, 0315, 0327, 0374, 0254, 0353, 0273, 
+  0147, 0307, 0326, 0041, 0311, 0105, 0014, 0027, 0044, 0106, 0201, 0250, 0346, 0303, 0115, 0251, 
+  0073, 0331, 0073, 0070, 0323, 0011, 0354, 0136, 0130, 0354, 0126, 0142, 0367, 0215, 0305, 0256, 
+  0272, 0033, 0360, 0055, 0213, 0002, 0073, 0237, 0273, 0005, 0341, 0203, 0323, 0075, 0347, 0007, 
+  0342, 0236, 0245, 0054, 0275, 0265, 0040, 0126, 0007, 0361, 0307, 0116, 0201, 0167, 0166, 0346, 
+  0346, 0267, 0147, 0011, 0112, 0077, 0132, 0344, 0052, 0043, 0367, 0233, 0057, 0242, 0215, 0216, 
+  0100, 0103, 0067, 0354, 0356, 0336, 0301, 0250, 0363, 0003, 0157, 0267, 0042, 0114, 0325, 0245, 
+  0250, 0155, 0017, 0264, 0172, 0360, 0164, 0105, 0115, 0164, 0053, 0150, 0064, 0227, 0114, 0156, 
+  0265, 0133, 0320, 0124, 0020, 0131, 0103, 0370, 0117, 0242, 0072, 0224, 0116, 0245, 0042, 0171, 
+  0026, 0053, 0125, 0345, 0226, 0144, 0155, 0003, 0133, 0233, 0130, 0332, 0314, 0116, 0135, 0126, 
+  0352, 0261, 0121, 0253, 0350, 0116, 0003, 0373, 0152, 0131, 0247, 0134, 0367, 0122, 0024, 0274, 
+  0034, 0331, 0212, 0227, 0117, 0127, 0361, 0022, 0244, 0214, 0330, 0172, 0227, 0306, 0334, 0133, 
+  0133, 0357, 0122, 0146, 0131, 0164, 0171, 0116, 0365, 0056, 0337, 0163, 0244, 0055, 0270, 0222, 
+  0010, 0154, 0311, 0313, 0123, 0162, 0152, 0154, 0311, 0113, 0131, 0033, 0035, 0125, 0334, 0112, 
+  0361, 0224, 0166, 0342, 0131, 0252, 0124, 0172, 0157, 0154, 0231, 0112, 0133, 0246, 0262, 0033, 
+  0145, 0052, 0067, 0150, 0315, 0034, 0274, 0346, 0362, 0264, 0107, 0025, 0135, 0325, 0062, 0265, 
+  0307, 0206, 0301, 0063, 0024, 0247, 0074, 0320, 0051, 0275, 0334, 0324, 0251, 0366, 0207, 0204, 
+  0027, 0264, 0343, 0371, 0070, 0376, 0367, 0077, 0277, 0164, 0042, 0260, 0013, 0066, 0135, 0077, 
+  0355, 0300, 0256, 0262, 0016, 0065, 0250, 0107, 0215, 0351, 0322, 0123, 0334, 0335, 0331, 0252, 
+  0202, 0266, 0057, 0023, 0066, 0011, 0132, 0336, 0066, 0164, 0264, 0012, 0232, 0152, 0360, 0331, 
+  0134, 0000, 0332, 0130, 0020, 0372, 0070, 0040, 0263, 0361, 0177, 0033, 0377, 0077, 0112, 0374, 
+  0337, 0353, 0176, 0374, 0137, 0071, 0326, 0054, 0151, 0217, 0265, 0230, 0250, 0276, 0003, 0140, 
+  0376, 0266, 0065, 0225, 0333, 0302, 0332, 0313, 0234, 0062, 0233, 0344, 0357, 0132, 0053, 0147, 
+  0115, 0315, 0255, 0307, 0305, 0211, 0027, 0156, 0022, 0335, 0346, 0253, 0103, 0017, 0056, 0326, 
+  0270, 0070, 0325, 0353, 0103, 0153, 0012, 0322, 0144, 0341, 0321, 0137, 0266, 0027, 0011, 0307, 
+  0274, 0135, 0230, 0177, 0332, 0157, 0205, 0052, 0003, 0327, 0136, 0327, 0157, 0174, 0275, 0262, 
+  0127, 0275, 0052, 0157, 0212, 0311, 0134, 0140, 0270, 0017, 0022, 0037, 0315, 0143, 0122, 0244, 
+  0312, 0166, 0341, 0026, 0103, 0255, 0353, 0131, 0253, 0161, 0367, 0133, 0306, 0005, 0347, 0063, 
+  0347, 0202, 0363, 0005, 0045, 0315, 0224, 0001, 0143, 0024, 0115, 0123, 0006, 0223, 0112, 0013, 
+  0262, 0171, 0245, 0370, 0372, 0035, 0104, 0363, 0210, 0271, 0316, 0012, 0340, 0064, 0023, 0054, 
+  0034, 0126, 0035, 0327, 0273, 0032, 0326, 0323, 0267, 0067, 0172, 0326, 0032, 0141, 0245, 0033, 
+  0075, 0243, 0012, 0055, 0364, 0374, 0020, 0320, 0274, 0335, 0167, 0064, 0352, 0346, 0365, 0276, 
+  0255, 0103, 0364, 0175, 0166, 0125, 0117, 0054, 0131, 0345, 0361, 0006, 0250, 0114, 0173, 0172, 
+  0135, 0223, 0054, 0371, 0073, 0236, 0314, 0334, 0355, 0244, 0262, 0351, 0270, 0025, 0152, 0313, 
+  0342, 0153, 0176, 0112, 0161, 0207, 0123, 0124, 0042, 0023, 0113, 0151, 0103, 0001, 0271, 0043, 
+  0005, 0342, 0216, 0027, 0206, 0120, 0113, 0130, 0066, 0160, 0310, 0357, 0331, 0166, 0334, 0267, 
+  0362, 0264, 0362, 0004, 0035, 0037, 0204, 0241, 0002, 0004, 0012, 0133, 0062, 0147, 0267, 0003, 
+  0116, 0100, 0225, 0163, 0075, 0316, 0365, 0022, 0333, 0107, 0011, 0043, 0301, 0255, 0114, 0257, 
+  0236, 0110, 0322, 0275, 0063, 0220, 0364, 0367, 0142, 0101, 0223, 0325, 0051, 0311, 0167, 0125, 
+  0036, 0176, 0216, 0072, 0225, 0146, 0262, 0107, 0347, 0276, 0130, 0246, 0051, 0253, 0252, 0265, 
+  0066, 0201, 0204, 0257, 0265, 0241, 0014, 0001, 0335, 0154, 0203, 0250, 0041, 0177, 0367, 0264, 
+  0263, 0144, 0014, 0225, 0045, 0051, 0164, 0065, 0205, 0013, 0262, 0202, 0055, 0324, 0165, 0013, 
+  0265, 0235, 0323, 0262, 0205, 0110, 0224, 0022, 0003, 0244, 0065, 0273, 0335, 0114, 0074, 0271, 
+  0035, 0373, 0016, 0144, 0224, 0232, 0267, 0332, 0336, 0151, 0133, 0355, 0157, 0001, 0045, 0242, 
+  0010, 0327, 0137, 0050, 0016, 0311, 0135, 0121, 0032, 0256, 0170, 0166, 0227, 0075, 0363, 0316, 
+  0175, 0255, 0266, 0062, 0101, 0044, 0211, 0000, 0347, 0245, 0057, 0366, 0201, 0334, 0011, 0072, 
+  0172, 0226, 0376, 0015, 0205, 0360, 0277, 0010, 0026, 0023, 0312, 0370, 0257, 0025, 0377, 0325, 
+  0042, 0110, 0376, 0324, 0006, 0136, 0227, 0124, 0004, 0101, 0010, 0151, 0342, 0157, 0372, 0246, 
+  0350, 0061, 0070, 0050, 0146, 0220, 0306, 0000, 0017, 0262, 0237, 0142, 0051, 0215, 0071, 0113, 
+  0121, 0313, 0222, 0144, 0345, 0063, 0360, 0155, 0103, 0143, 0170, 0266, 0112, 0364, 0242, 0123, 
+  0112, 0264, 0277, 0247, 0005, 0155, 0256, 0300, 0051, 0345, 0012, 0310, 0154, 0156, 0267, 0352, 
+  0234, 0374, 0306, 0266, 0136, 0116, 0202, 0327, 0275, 0234, 0204, 0174, 0157, 0064, 0314, 0066, 
+  0107, 0223, 0143, 0146, 0043, 0264, 0224, 0246, 0047, 0110, 0142, 0050, 0033, 0113, 0371, 0070, 
+  0124, 0160, 0050, 0217, 0077, 0351, 0305, 0111, 0311, 0120, 0017, 0206, 0171, 0350, 0043, 0125, 
+  0324, 0102, 0330, 0153, 0271, 0313, 0234, 0235, 0177, 0136, 0201, 0314, 0154, 0017, 0362, 0264, 
+  0361, 0315, 0326, 0365, 0356, 0143, 0207, 0302, 0144, 0111, 0342, 0204, 0217, 0143, 0040, 0056, 
+  0226, 0214, 0040, 0136, 0346, 0141, 0003, 0117, 0224, 0245, 0335, 0172, 0263, 0271, 0375, 0033, 
+  0167, 0022, 0140, 0222, 0300, 0272, 0366, 0173, 0017, 0263, 0136, 0155, 0217, 0341, 0020, 0265, 
+  0037, 0020, 0300, 0144, 0276, 0133, 0147, 0065, 0314, 0237, 0025, 0044, 0367, 0346, 0103, 0374, 
+  0165, 0047, 0305, 0253, 0203, 0374, 0325, 0375, 0211, 0221, 0005, 0153, 0175, 0042, 0312, 0145, 
+  0323, 0353, 0014, 0061, 0256, 0102, 0112, 0353, 0061, 0212, 0132, 0156, 0171, 0242, 0121, 0105, 
+  0221, 0327, 0303, 0370, 0104, 0202, 0376, 0251, 0331, 0015, 0071, 0370, 0066, 0327, 0220, 0176, 
+  0204, 0104, 0351, 0345, 0012, 0136, 0224, 0373, 0216, 0253, 0355, 0263, 0072, 0065, 0221, 0266, 
+  0234, 0350, 0140, 0377, 0300, 0274, 0264, 0036, 0125, 0321, 0237, 0312, 0071, 0076, 0225, 0271, 
+  0075, 0245, 0033, 0210, 0025, 0034, 0312, 0045, 0331, 0007, 0024, 0202, 0035, 0103, 0122, 0025, 
+  0224, 0333, 0147, 0331, 0126, 0373, 0375, 0120, 0245, 0222, 0025, 0122, 0265, 0100, 0207, 0326, 
+  0147, 0115, 0122, 0346, 0047, 0154, 0055, 0276, 0010, 0343, 0312, 0215, 0232, 0326, 0311, 0145, 
+  0333, 0227, 0152, 0155, 0024, 0314, 0310, 0155, 0153, 0010, 0263, 0310, 0243, 0150, 0050, 0143, 
+  0211, 0114, 0030, 0156, 0225, 0246, 0233, 0260, 0241, 0154, 0143, 0205, 0300, 0243, 0162, 0220, 
+  0121, 0337, 0077, 0150, 0235, 0225, 0241, 0230, 0215, 0241, 0024, 0002, 0074, 0112, 0146, 0344, 
+  0226, 0360, 0156, 0231, 0067, 0111, 0351, 0315, 0132, 0132, 0361, 0265, 0342, 0153, 0146, 0375, 
+  0243, 0357, 0023, 0113, 0131, 0004, 0005, 0247, 0230, 0367, 0245, 0010, 0024, 0326, 0031, 0220, 
+  0047, 0162, 0245, 0353, 0323, 0235, 0307, 0247, 0144, 0174, 0033, 0074, 0113, 0043, 0331, 0315, 
+  0362, 0231, 0315, 0155, 0225, 0345, 0057, 0021, 0014, 0166, 0064, 0246, 0200, 0064, 0110, 0131, 
+  0344, 0007, 0342, 0077, 0225, 0245, 0175, 0116, 0101, 0373, 0031, 0120, 0140, 0255, 0023, 0242, 
+  0065, 0217, 0015, 0353, 0226, 0344, 0321, 0111, 0122, 0367, 0272, 0220, 0231, 0336, 0246, 0016, 
+  0316, 0367, 0004, 0072, 0102, 0064, 0071, 0156, 0004, 0337, 0244, 0212, 0337, 0350, 0026, 0274, 
+  0321, 0076, 0066, 0136, 0035, 0254, 0074, 0132, 0010, 0357, 0174, 0074, 0276, 0355, 0044, 0222, 
+  0361, 0311, 0304, 0010, 0165, 0060, 0373, 0143, 0167, 0100, 0333, 0052, 0323, 0334, 0236, 0271, 
+  0250, 0335, 0314, 0220, 0221, 0225, 0307, 0054, 0362, 0314, 0116, 0027, 0211, 0266, 0307, 0227, 
+  0026, 0331, 0132, 0054, 0246, 0245, 0115, 0056, 0373, 0134, 0077, 0363, 0134, 0367, 0344, 0210, 
+  0167, 0331, 0265, 0374, 0176, 0351, 0302, 0205, 0355, 0255, 0370, 0167, 0077, 0021, 0241, 0270, 
+  0005, 0174, 0247, 0102, 0127, 0261, 0110, 0113, 0143, 0141, 0226, 0264, 0350, 0124, 0333, 0262, 
+  0054, 0346, 0067, 0152, 0345, 0167, 0255, 0065, 0223, 0165, 0237, 0362, 0274, 0313, 0326, 0031, 
+  0214, 0045, 0177, 0166, 0307, 0127, 0112, 0215, 0305, 0116, 0216, 0011, 0014, 0125, 0022, 0131, 
+  0037, 0262, 0253, 0376, 0164, 0116, 0045, 0351, 0037, 0276, 0070, 0302, 0301, 0213, 0043, 0113, 
+  0264, 0247, 0053, 0321, 0336, 0311, 0112, 0364, 0256, 0356, 0350, 0230, 0104, 0133, 0141, 0354, 
+  0201, 0172, 0075, 0160, 0070, 0136, 0133, 0207, 0343, 0361, 0332, 0236, 0257, 0205, 0305, 0071, 
+  0051, 0207, 0143, 0327, 0014, 0166, 0337, 0341, 0260, 0371, 0135, 0135, 0315, 0357, 0152, 0313, 
+  0022, 0065, 0166, 0234, 0374, 0156, 0312, 0123, 0145, 0030, 0171, 0252, 0333, 0042, 0307, 0313, 
+  0023, 0032, 0151, 0346, 0011, 0215, 0024, 0362, 0204, 0256, 0206, 0131, 0056, 0306, 0014, 0004, 
+  0160, 0362, 0342, 0377, 0234, 0174, 0230, 0055, 0000, 0050, 0165, 0165, 0141, 0171, 0051, 0155, 
+  0141, 0164, 0145, 0057, 0005, 0000, 0000, 0000, 0155, 0143, 0143, 0057, 0001, 0000, 0000, 0000
+} };
+
+static GStaticResource static_resource = { network_resource_data.data, sizeof (network_resource_data.data) - 1 /* nul terminator */, NULL, NULL, NULL };
+
+G_MODULE_EXPORT
+GResource *network_get_resource (void);
+GResource *network_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(networkresource_constructor)
+#endif
+G_DEFINE_CONSTRUCTOR(networkresource_constructor)
+#ifdef G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA
+#pragma G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(networkresource_destructor)
+#endif
+G_DEFINE_DESTRUCTOR(networkresource_destructor)
+
+#else
+#warning "Constructor not supported on this compiler, linking in resources will not work"
+#endif
+
+static void networkresource_constructor (void)
+{
+  g_static_resource_init (&static_resource);
+}
+
+static void networkresource_destructor (void)
+{
+  g_static_resource_fini (&static_resource);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/76.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/76.html new file mode 100644 index 00000000..29cdcf51 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/76.html @@ -0,0 +1,1239 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* mate-network-properties.c: network preferences capplet
+ *
+ * Copyright (C) 2002 Sun Microsystems Inc.
+ * Copyright (C) 2012 Stefano Karapetsas
+ * Copyright (C) 2012-2021 MATE Developers
+ *
+ * Written by: Mark McLoughlin <mark@skynet.ie>
+ *             Stefano Karapetsas <stefano@karapetsas.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, 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 <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 <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.
+
+#include "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+
+/* With GSettings migration, MATE is going to share proxy settings with
+ * GNOME3 (in gsettings-desktop-schemas package).
+ * GSettings schemas is http://git.gnome.org/browse/gsettings-desktop-schemas/tree/
+ * schemas/org.gnome.system.proxy.gschema.xml.in.in
+ * Sharing the same schema, we lose the locations feature.
+ */
+
+/*
+ * use enum from gsettings-desktop-schema
+ * http://git.gnome.org/browse/gsettings-desktop-schemas/tree/headers/gdesktop-enums.h#n26
+ */
+enum GDesktopProxyMode
+{
+	G_DESKTOP_PROXY_MODE_NONE,
+	G_DESKTOP_PROXY_MODE_MANUAL,
+	G_DESKTOP_PROXY_MODE_AUTO
+};
+
+enum {
+	COL_NAME,
+	COL_STYLE
+};
+
+#define PROXY_SCHEMA              "org.gnome.system.proxy"
+#define PROXY_MODE_KEY            "mode"
+#define PROXY_AUTOCONFIG_URL_KEY  "autoconfig-url"
+#define IGNORE_HOSTS_KEY          "ignore-hosts"
+
+#define HTTP_PROXY_SCHEMA         "org.gnome.system.proxy.http"
+#define HTTP_PROXY_HOST_KEY       "host"
+#define HTTP_PROXY_PORT_KEY       "port"
+#define HTTP_USE_AUTH_KEY         "use-authentication"
+#define HTTP_AUTH_USER_KEY        "authentication-user"
+#define HTTP_AUTH_PASSWD_KEY      "authentication-password"
+
+#define HTTPS_PROXY_SCHEMA        "org.gnome.system.proxy.https"
+#define SECURE_PROXY_HOST_KEY     "host"
+#define SECURE_PROXY_PORT_KEY     "port"
+
+#define FTP_PROXY_SCHEMA          "org.gnome.system.proxy.ftp"
+#define FTP_PROXY_HOST_KEY        "host"
+#define FTP_PROXY_PORT_KEY        "port"
+
+#define SOCKS_PROXY_SCHEMA        "org.gnome.system.proxy.socks"
+#define SOCKS_PROXY_HOST_KEY      "host"
+#define SOCKS_PROXY_PORT_KEY      "port"
+
+static GtkWidget *details_dialog = NULL;
+static GSList *ignore_hosts = NULL;
+static GtkTreeModel *model = NULL;
+
+static GSettings *proxy_settings = NULL;
+static GSettings *http_proxy_settings = NULL;
+static GSettings *https_proxy_settings = NULL;
+static GSettings *ftp_proxy_settings = NULL;
+static GSettings *socks_proxy_settings = NULL;
+
+static GtkTreeModel *
+create_listmodel(void)
+{
+	GtkListStore *store;
+
+	store = gtk_list_store_new(1, G_TYPE_STRING);
+
+	return GTK_TREE_MODEL(store);
+}
+
+static GtkTreeModel *
+populate_listmodel(GtkListStore *store, GSList *list)
+{
+	GtkTreeIter iter;
+	GSList *pointer;
+
+	gtk_list_store_clear(store);
+
+	pointer = list;
+	while(pointer)
+	{
+		gtk_list_store_append(store, &iter);
+		gtk_list_store_set(store, &iter, 0, (char *) pointer->data, -1);
+		pointer = g_slist_next(pointer);
+	}
+
+	return GTK_TREE_MODEL(store);
+}
+
+static GtkWidget *
+config_treeview(GtkTreeView *tree, GtkTreeModel *model)
+{
+	GtkCellRenderer *renderer;
+
+	renderer = gtk_cell_renderer_text_new();
+	gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(tree),
+												-1, "Hosts", renderer,
+												"text", 0, NULL);
+
+	gtk_tree_view_set_model(GTK_TREE_VIEW(tree), model);
+
+	return GTK_WIDGET(tree);
+}
+
+static GtkWidget*
+_gtk_builder_get_widget (GtkBuilder *builder, const gchar *name)
+{
+	return GTK_WIDGET (gtk_builder_get_object (builder, name));
+}
+
+static void
+read_ignore_hosts_from_gsettings (void)
+{
+	gchar **array;
+	ignore_hosts = NULL;
+	gint i;
+	array = g_settings_get_strv (proxy_settings, IGNORE_HOSTS_KEY);
+	if (array != NULL)
+	{
+		for (i = 0; array[i]; i++)
+		{
+			ignore_hosts = g_slist_append (ignore_hosts, g_strdup (array[i]));
+		}
+	}
+	g_strfreev (array);
+}
+
+static void
+save_ignore_hosts_to_gsettings (void)
+{
+	GArray *array;
+	GSList *l;
+	array = g_array_new (TRUE, TRUE, sizeof (gchar *));
+	for (l = ignore_hosts; l; l = l->next) {
+		array = g_array_append_val (array, l->data);
+	}
+	g_settings_set_strv (proxy_settings, IGNORE_HOSTS_KEY, (const gchar **) array->data);
+	g_array_free (array, TRUE);
+}
+
+static void
+cb_add_url (GtkButton *button, gpointer data)
+{
+	GtkBuilder *builder = GTK_BUILDER (data);
+
+	const gchar *entry_text = gtk_entry_get_text (GTK_ENTRY (gtk_builder_get_object (builder, "entry_url")));
+	if (entry_text == NULL || strlen (entry_text) == 0) {
+		return;
+	}
+
+	ignore_hosts = g_slist_append(ignore_hosts, g_strdup (entry_text));
+	populate_listmodel(GTK_LIST_STORE(model), ignore_hosts);
+	gtk_entry_set_text(GTK_ENTRY (gtk_builder_get_object (builder,
+							     "entry_url")), "");
+
+	save_ignore_hosts_to_gsettings ();
+}
+
+static void
+cb_remove_url (GtkButton *button, gpointer data)
+{
+	GtkBuilder *builder = GTK_BUILDER (data);
+	GtkTreeSelection *selection;
+	GtkTreeIter       iter;
+
+	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (gtk_builder_get_object (builder, "treeview_ignore_host")));
+	if (gtk_tree_selection_get_selected(selection, &model, &iter))
+	{
+		gchar *url;
+		GSList *pointer;
+
+		gtk_tree_model_get (model, &iter, 0, &url, -1);
+
+		pointer = ignore_hosts;
+		while(pointer)
+		{
+			if(strcmp(url, (char *) pointer->data) == 0)
+			{
+				g_free (pointer->data);
+				ignore_hosts = g_slist_delete_link(ignore_hosts, pointer);
+				break;
+			}
+			pointer = g_slist_next(pointer);
+		}
+
+		g_free(url);
+		populate_listmodel(GTK_LIST_STORE(model), ignore_hosts);
+
+		save_ignore_hosts_to_gsettings ();
+	}
+}
+
+static void
+cb_dialog_response (GtkDialog *dialog, gint response_id)
+{
+	if (response_id == GTK_RESPONSE_HELP)
+		capplet_help (GTK_WINDOW (dialog),
+			"goscustdesk-50");
+	else if (response_id == GTK_RESPONSE_CLOSE || response_id == GTK_RESPONSE_DELETE_EVENT)
+	{
+		if (ignore_hosts) {
+			g_slist_free_full (ignore_hosts, g_free);
+		}
+
+		gtk_main_quit ();
+	}
+}
+
+static void
+cb_details_dialog_response (GtkDialog *dialog, gint response_id)
+{
+	if (response_id == GTK_RESPONSE_HELP)
+		capplet_help (GTK_WINDOW (dialog),
+			      "goscustdesk-50");
+	else {
+		gtk_widget_destroy (GTK_WIDGET (dialog));
+		details_dialog = NULL;
+	}
+}
+
+static void
+cb_use_auth_toggled (GtkToggleButton *toggle,
+		     GtkWidget *table)
+{
+	gtk_widget_set_sensitive (table, gtk_toggle_button_get_active (toggle));
+}
+
+static void
+cb_http_details_button_clicked (GtkWidget *button,
+			        GtkWidget *parent)
+{
+	GtkBuilder *builder;
+	gchar *builder_widgets[] = { "details_dialog", NULL };
+	GError *error = NULL;
+	GtkWidget *widget;
+
+	if (details_dialog != NULL) {
+		gtk_window_present (GTK_WINDOW (details_dialog));
+		gtk_widget_grab_focus (details_dialog);
+		return;
+	}
+
+	builder = gtk_builder_new ();
+	if (gtk_builder_add_objects_from_resource (builder, "/org/mate/mcc/network/mate-network-properties.ui",
+					           builder_widgets, &error) == 0) {
+		g_warning ("Could not load details dialog: %s", error->message);
+		g_error_free (error);
+		g_object_unref (builder);
+		return;
+	}
+
+	details_dialog = widget = _gtk_builder_get_widget (builder,
+							   "details_dialog");
+
+	gtk_window_set_transient_for (GTK_WINDOW (widget), GTK_WINDOW (parent));
+
+	g_signal_connect (gtk_builder_get_object (builder, "use_auth_checkbutton"),
+			  "toggled",
+			  G_CALLBACK (cb_use_auth_toggled),
+			  _gtk_builder_get_widget (builder, "auth_table"));
+
+	g_settings_bind (http_proxy_settings, HTTP_USE_AUTH_KEY,
+			gtk_builder_get_object (builder, "use_auth_checkbutton"), "active",
+			G_SETTINGS_BIND_DEFAULT);
+	g_settings_bind (http_proxy_settings, HTTP_AUTH_USER_KEY,
+			gtk_builder_get_object (builder, "username_entry"), "text",
+			G_SETTINGS_BIND_DEFAULT);
+	g_settings_bind (http_proxy_settings, HTTP_AUTH_PASSWD_KEY,
+			gtk_builder_get_object (builder, "password_entry"), "text",
+			G_SETTINGS_BIND_DEFAULT);
+
+	g_signal_connect (widget, "response",
+			  G_CALLBACK (cb_details_dialog_response), NULL);
+
+	capplet_set_icon (widget, "network-server");
+
+	gtk_widget_show_all (widget);
+}
+
+static void
+proxy_mode_gsettings_changed (GSettings *settings,
+				   gchar *key,
+				   GtkBuilder *builder)
+{
+	int mode;
+	mode = g_settings_get_enum (settings, PROXY_MODE_KEY);
+	if (mode == G_DESKTOP_PROXY_MODE_NONE)
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object(builder, "none_radiobutton")), TRUE);
+	else if (mode == G_DESKTOP_PROXY_MODE_AUTO)
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object(builder, "auto_radiobutton")), TRUE);
+	else if (mode == G_DESKTOP_PROXY_MODE_MANUAL)
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object(builder, "manual_radiobutton")), TRUE);
+	gtk_widget_set_sensitive (_gtk_builder_get_widget (builder, "manual_box"),
+				  mode == G_DESKTOP_PROXY_MODE_MANUAL);
+	gtk_widget_set_sensitive (_gtk_builder_get_widget (builder, "auto_box"),
+				  mode == G_DESKTOP_PROXY_MODE_AUTO);
+}
+
+static void
+proxy_mode_radiobutton_clicked_cb (GtkWidget *widget,
+				   GtkBuilder *builder)
+{
+	GSList *mode_group;
+	int mode;
+	int old_mode;
+
+	if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(widget)))
+		return;
+
+	mode_group = g_slist_copy (gtk_radio_button_get_group
+		(GTK_RADIO_BUTTON (gtk_builder_get_object (builder, "none_radiobutton"))));
+	mode_group = g_slist_reverse (mode_group);
+	mode = g_slist_index (mode_group, widget);
+	g_slist_free (mode_group);
+
+	old_mode = g_settings_get_enum (proxy_settings, PROXY_MODE_KEY);
+
+	if (mode == old_mode)
+		return;
+
+	g_settings_set_enum (proxy_settings, PROXY_MODE_KEY, mode);
+}
+
+static void
+connect_sensitivity_signals (GtkBuilder *builder, GSList *mode_group)
+{
+	for (; mode_group != NULL; mode_group = mode_group->next)
+	{
+		g_signal_connect (mode_group->data, "clicked",
+		                  G_CALLBACK(proxy_mode_radiobutton_clicked_cb),
+		                  builder);
+	}
+}
+
+static void
+cb_ignore_hosts_gsettings_changed (GSettings *settings, gchar *key, gpointer user_data)
+{
+	g_slist_free_full (ignore_hosts, g_free);
+
+	read_ignore_hosts_from_gsettings ();
+
+	populate_listmodel (GTK_LIST_STORE (model), ignore_hosts);
+}
+
+static void
+setup_dialog (GtkBuilder *builder)
+{
+	GSList *mode_group;
+
+	g_signal_connect (proxy_settings, "changed::" IGNORE_HOSTS_KEY,
+			G_CALLBACK (cb_ignore_hosts_gsettings_changed), NULL);
+
+	/* Mode */
+	proxy_mode_gsettings_changed (proxy_settings, PROXY_MODE_KEY, builder);
+	mode_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (gtk_builder_get_object (builder, "none_radiobutton")));
+	connect_sensitivity_signals (builder, mode_group);
+	g_signal_connect (proxy_settings, "changed::" PROXY_MODE_KEY,
+					  G_CALLBACK (proxy_mode_gsettings_changed), builder);
+
+	/* Http */
+	g_settings_bind (http_proxy_settings, HTTP_PROXY_PORT_KEY,
+			gtk_builder_get_object (builder, "http_port_spinbutton"), "value",
+			G_SETTINGS_BIND_DEFAULT);
+	g_settings_bind (http_proxy_settings, HTTP_PROXY_HOST_KEY,
+			gtk_builder_get_object (builder, "http_host_entry"), "text",
+			G_SETTINGS_BIND_DEFAULT);
+	g_signal_connect (gtk_builder_get_object (builder, "details_button"),
+			  "clicked",
+			  G_CALLBACK (cb_http_details_button_clicked),
+			  _gtk_builder_get_widget (builder, "network_dialog"));
+
+	/* Secure */
+	g_settings_bind (https_proxy_settings, SECURE_PROXY_PORT_KEY,
+			gtk_builder_get_object (builder, "secure_port_spinbutton"), "value",
+			G_SETTINGS_BIND_DEFAULT);
+	g_settings_bind (https_proxy_settings, SECURE_PROXY_HOST_KEY,
+			gtk_builder_get_object (builder, "secure_host_entry"), "text",
+			G_SETTINGS_BIND_DEFAULT);
+
+	/* Ftp */
+	g_settings_bind (ftp_proxy_settings, FTP_PROXY_PORT_KEY,
+			gtk_builder_get_object (builder, "ftp_port_spinbutton"), "value",
+			G_SETTINGS_BIND_DEFAULT);
+	g_settings_bind (ftp_proxy_settings, FTP_PROXY_HOST_KEY,
+			gtk_builder_get_object (builder, "ftp_host_entry"), "text",
+			G_SETTINGS_BIND_DEFAULT);
+
+	/* Socks */
+	g_settings_bind (socks_proxy_settings, SOCKS_PROXY_PORT_KEY,
+			gtk_builder_get_object (builder, "socks_port_spinbutton"), "value",
+			G_SETTINGS_BIND_DEFAULT);
+	g_settings_bind (socks_proxy_settings, SOCKS_PROXY_HOST_KEY,
+			gtk_builder_get_object (builder, "socks_host_entry"), "text",
+			G_SETTINGS_BIND_DEFAULT);
+
+	/* Autoconfiguration */
+	g_settings_bind (proxy_settings, PROXY_AUTOCONFIG_URL_KEY,
+			gtk_builder_get_object (builder, "autoconfig_entry"), "text",
+			G_SETTINGS_BIND_DEFAULT);
+
+	g_signal_connect (gtk_builder_get_object (builder, "network_dialog"),
+			"response", G_CALLBACK (cb_dialog_response), NULL);
+
+	read_ignore_hosts_from_gsettings ();
+
+	model = create_listmodel();
+	populate_listmodel(GTK_LIST_STORE(model), ignore_hosts);
+	config_treeview(GTK_TREE_VIEW(gtk_builder_get_object (builder, "treeview_ignore_host")), model);
+
+	g_signal_connect (gtk_builder_get_object (builder, "button_add_url"),
+			  "clicked", G_CALLBACK (cb_add_url), builder);
+	g_signal_connect (gtk_builder_get_object (builder, "entry_url"),
+			  "activate", G_CALLBACK (cb_add_url), builder);
+	g_signal_connect (gtk_builder_get_object (builder, "button_remove_url"),
+			  "clicked", G_CALLBACK (cb_remove_url), builder);
+}
+
+int
+main (int argc, char **argv)
+{
+	GtkBuilder  *builder;
+	GError *error = NULL;
+	gchar *builder_widgets[] = {"network_dialog", "adjustment1",
+				    "adjustment2", "adjustment3", "adjustment4",
+				    "delete_button_img", NULL};
+	GtkWidget   *widget;
+
+	capplet_init (NULL, &argc, &argv);
+
+	builder = gtk_builder_new ();
+	if (gtk_builder_add_objects_from_resource (builder, "/org/mate/mcc/network/mate-network-properties.ui",
+					           builder_widgets, &error) == 0) {
+		g_warning ("Could not load main dialog: %s",
+			   error->message);
+		g_error_free (error);
+		g_object_unref (builder);
+		return (EXIT_FAILURE);
+	}
+
+	proxy_settings = g_settings_new (PROXY_SCHEMA);
+	http_proxy_settings = g_settings_new (HTTP_PROXY_SCHEMA);
+	https_proxy_settings = g_settings_new (HTTPS_PROXY_SCHEMA);
+	ftp_proxy_settings = g_settings_new (FTP_PROXY_SCHEMA);
+	socks_proxy_settings = g_settings_new (SOCKS_PROXY_SCHEMA);
+
+	setup_dialog (builder);
+	widget = _gtk_builder_get_widget (builder, "network_dialog");
+
+        GtkNotebook* nb = GTK_NOTEBOOK (_gtk_builder_get_widget (builder, "notebook1"));
+        gtk_widget_add_events (GTK_WIDGET (nb), GDK_SCROLL_MASK);
+        g_signal_connect (GTK_WIDGET (nb),
+                          "scroll-event",
+                          G_CALLBACK (capplet_notebook_scroll_event_cb),
+                          NULL);
+
+	capplet_set_icon (widget, "network-server");
+	gtk_widget_show_all (widget);
+	gtk_main ();
+
+	g_object_unref (builder);
+	g_object_unref (proxy_settings);
+	g_object_unref (http_proxy_settings);
+	g_object_unref (https_proxy_settings);
+	g_object_unref (ftp_proxy_settings);
+	g_object_unref (socks_proxy_settings);
+
+	return 0;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/77.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/77.html new file mode 100644 index 00000000..3771727c --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/77.html @@ -0,0 +1,503 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
+ *
+ * Copyright (C) 2010 Red Hat, Inc
+ * Copyright (C) 2008 William Jon McCann <jmccann@redhat.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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "info-cleanup.h"
+
+typedef struct
+{
+  char *regex;
+  char *replacement;
+} ReplaceStrings;
+
+static char *
+prettify_info (const char *info)
+{
+  g_autofree char *escaped = NULL;
+  g_autofree gchar *pretty = NULL;
+  int   i;
+  static const ReplaceStrings rs[] = {
+    { "Mesa DRI ", ""},
+    { "Mesa Intel", "Intel"},
+    { "[(]R[)]", "\302\256"},
+    { "[(](tm|TM)[)]", "\342\204\242"},
+    { "(ATI|EPYC|AMD FX|Radeon|Ryzen|Threadripper|GeForce RTX) ", "\\1\342\204\242 "},
+    { "Gallium \\d+\\.\\d+ on (.*)", "\\1"},
+    { " CPU| Processor| \\S+-Core| @ \\d+\\.\\d+GHz", ""},
+    { " x86|/MMX|/SSE2|/PCIe", ""},
+    { " [(][^)]*(DRM|MESA|LLVM)[^)]*[)]?", ""},
+    { "Graphics Controller", "Graphics"},
+    { ".*llvmpipe.*", "Software Rendering"},
+    { "(AMD .*) [(].*", "\\1"},
+    { "(AMD [A-Z])(.*)", "\\1\\L\\2\\E"},
+    { "AMD", "AMD<sup>\302\256</sup>"},
+
+  };
+
+  if (*info == '\0')
+    return NULL;
+
+  escaped = g_markup_escape_text (info, -1);
+  pretty = g_strdup (g_strstrip (escaped));
+
+  for (i = 0; i < G_N_ELEMENTS (rs); i++)
+    {
+      g_autoptr(GError) error = NULL;
+      g_autoptr(GRegex) re = NULL;
+      g_autofree gchar *new = NULL;
+
+      re = g_regex_new (rs[i].regex, 0, 0, &error);
+      if (re == NULL)
+        {
+          g_warning ("Error building regex: %s", error->message);
+          continue;
+        }
+
+      new = g_regex_replace (re,
+                             pretty,
+                             -1,
+                             0,
+                             rs[i].replacement,
+                             0,
+                             &error);
+
+      if (error != NULL)
+        {
+          g_warning ("Error replacing %s: %s", rs[i].regex, error->message);
+          continue;
+        }
+
+      g_free (pretty);
+      pretty = g_steal_pointer (&new);
+    }
+
+  return g_steal_pointer (&pretty);
+}
+
+static char *
+remove_duplicate_whitespace (const char *old)
+{
+  g_autofree gchar *new = NULL;
+  g_autoptr(GRegex) re = NULL;
+  g_autoptr(GError) error = NULL;
+
+  if (old == NULL)
+    return NULL;
+
+  re = g_regex_new ("[ \t\n\r]+", G_REGEX_MULTILINE, 0, &error);
+  if (re == NULL)
+    {
+      g_warning ("Error building regex: %s", error->message);
+      return g_strdup (old);
+    }
+  new = g_regex_replace (re,
+                         old,
+                         -1,
+                         0,
+                         " ",
+                         0,
+                         &error);
+  if (new == NULL)
+    {
+      g_warning ("Error replacing string: %s", error->message);
+      return g_strdup (old);
+    }
+
+  return g_steal_pointer (&new);
+}
+
+char *
+info_cleanup (const char *input)
+{
+  g_autofree char *pretty = NULL;
+
+  pretty = prettify_info (input);
+  return remove_duplicate_whitespace (pretty);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/78.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/78.html new file mode 100644 index 00000000..23cc88d3 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/78.html @@ -0,0 +1,283 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
+ *
+ * Copyright (C) 2010 Red Hat, Inc
+ * Copyright (C) 2008 William Jon McCann <jmccann@redhat.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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+char *info_cleanup (const char *input);
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/79.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/79.html new file mode 100644 index 00000000..c2a44011 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/79.html @@ -0,0 +1,319 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/* 
+ * Copyright (C) 2023 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, 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 <fcntl.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libintl.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <locale.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.
+
+#ifndef __MATE_SYSTEM_INFO_H__
+#define __MATE_SYSTEM_INFO_H__  1
+
+G_BEGIN_DECLS
+
+#define MATE_TYPE_SYSTEM_INFO (mate_system_info_get_type ())
+G_DECLARE_FINAL_TYPE (MateSystemInfo, mate_system_info, MATE, SYSTEM_INFO, GtkDialog)
+
+GtkWidget *mate_system_info_new   (void);
+
+void       mate_system_info_setup (MateSystemInfo *info);
+
+G_END_DECLS
+
+#endif
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/8.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/8.html new file mode 100644 index 00000000..68246489 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/8.html @@ -0,0 +1,555 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* vi: set sw=4 ts=4 wrap ai: */
+/*
+ * dm-util.c: This file is part of mate-control-center.
+ *
+ * Copyright (C) 2019 Wu Xiaotian <yetist@gmail.com>
+ * Copyright (C) 2019-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, see <http://www.gnu.org/licenses/>.
+ * */
+
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "dm-util.h"
+
+static GDBusProxy *get_sys_proxy (void)
+{
+    GError     *error = NULL;
+    GDBusProxy *proxy = NULL;
+
+    proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
+                                           G_DBUS_PROXY_FLAGS_NONE,
+                                           NULL,
+                                           "org.freedesktop.DBus",
+                                           "/org/freedesktop/DBus",
+                                           "org.freedesktop.DBus",
+                                           NULL,
+                                           &error);
+    if (proxy == NULL) {
+        g_warning ("Couldn't connect to system bus: %s", error->message);
+        g_error_free (error);
+    }
+    return proxy;
+}
+
+static gboolean dm_is_running (void)
+{
+    GDBusProxy *proxy;
+    GError *error = NULL;
+    GVariant *ret;
+    gboolean running = FALSE;
+
+    proxy = get_sys_proxy ();
+    if (proxy == NULL)
+        return FALSE;
+
+    ret = g_dbus_proxy_call_sync (proxy,
+                                  "NameHasOwner",
+                                  g_variant_new ("(s)", "org.freedesktop.DisplayManager"),
+                                  G_DBUS_CALL_FLAGS_NONE,
+                                  -1,
+                                  NULL,
+                                  &error);
+    if (ret == NULL) {
+        g_warning ("Couldn't call dbus method: %s", error->message);
+        g_error_free (error);
+    } else {
+        g_variant_get (ret, "(b)", &running);
+        g_variant_unref (ret);
+    }
+
+    if (proxy)
+        g_object_unref (proxy);
+
+    return running;
+}
+
+static gint
+dm_get_pid (GError **err)
+{
+    GDBusProxy *proxy;
+    GError *error = NULL;
+    GVariant *ret;
+    guint32 pid = 0;
+
+    proxy = get_sys_proxy ();
+    if (proxy == NULL)
+        return FALSE;
+
+    ret = g_dbus_proxy_call_sync (proxy,
+                                  "GetConnectionUnixProcessID",
+                                  g_variant_new ("(s)", "org.freedesktop.DisplayManager"),
+                                  G_DBUS_CALL_FLAGS_NONE,
+                                  -1,
+                                  NULL,
+                                  &error);
+    if (ret == NULL) {
+        g_propagate_error (err, error);
+    } else {
+        g_variant_get (ret, "(u)", &pid);
+        g_variant_unref (ret);
+    }
+
+    if (proxy)
+        g_object_unref (proxy);
+
+    return pid;
+}
+
+static gchar* get_cmdline_from_pid (gint pid)
+{
+    gchar path[255];
+    gchar *text = NULL;
+    gchar *cmdline = NULL;
+    GError *error = NULL;
+
+    g_snprintf(path, sizeof(path), "/proc/%d/cmdline", pid);
+    if (!g_file_get_contents (path, &text, NULL, &error)) {
+        g_warning ("get cmdline error: %s\n", error->message);
+        g_error_free (error);
+        return NULL;
+    } else {
+        cmdline = g_path_get_basename (text);
+        g_free (text);
+    }
+    return cmdline;
+}
+
+DMType dm_get_type(void)
+{
+    gint pid;
+    gchar *cmdline;
+
+    DMType dmtype = DM_TYPE_UNKNOWN;
+
+    if (!dm_is_running()) {
+        goto ret;
+    }
+
+    pid = dm_get_pid (NULL);
+    if (pid <= 1) {
+        goto ret;
+    }
+
+    cmdline = get_cmdline_from_pid (pid);
+    if (cmdline == NULL) {
+        goto ret;
+    }
+
+    if (g_strcmp0(cmdline, "lightdm") == 0) {
+        dmtype = DM_TYPE_LIGHTDM;
+    } else if (g_strcmp0(cmdline, "mdm") == 0) {
+        dmtype = DM_TYPE_MDM;
+    } else if (g_strcmp0(cmdline, "gdm") == 0) {
+        dmtype = DM_TYPE_GDM;
+    }
+    g_free (cmdline);
+ret:
+    return dmtype;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/80.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/80.html new file mode 100644 index 00000000..d4a2ba80 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/80.html @@ -0,0 +1,307 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/*************************************************************************
+ File Name: main.c
+ Copyright (C) 2023  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 3 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, see <https://www.gnu.org/licenses/>.
+
+************************************************************************/
+#include "mate-system-info.h"
+#include "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+
+int main (int argc, char *argv[])
+{
+    GtkWidget *dialog;
+
+    capplet_init (NULL, &argc, &argv);
+
+    dialog = mate_system_info_new ();
+    mate_system_info_setup (MATE_SYSTEM_INFO (dialog));
+    g_signal_connect (dialog, "response", G_CALLBACK (gtk_main_quit), NULL);
+    gtk_widget_show (dialog);
+
+    gtk_main ();
+
+    return 0;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/81.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/81.html new file mode 100644 index 00000000..067aba47 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/81.html @@ -0,0 +1,1123 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
#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.mate_system_info"), aligned (8)))
+#else
+# define SECTION
+#endif
+
+static const SECTION union { const guint8 data[3765]; const double alignment; void * const ptr;}  mate_system_info_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, 0310, 0000, 0000, 0000, 0000, 0000, 0000, 0050, 0006, 0000, 0000, 0000, 
+  0000, 0000, 0000, 0000, 0001, 0000, 0000, 0000, 0002, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 
+  0003, 0000, 0000, 0000, 0004, 0000, 0000, 0000, 0314, 0026, 0327, 0223, 0005, 0000, 0000, 0000, 
+  0310, 0000, 0000, 0000, 0014, 0000, 0114, 0000, 0324, 0000, 0000, 0000, 0330, 0000, 0000, 0000, 
+  0113, 0120, 0220, 0013, 0002, 0000, 0000, 0000, 0330, 0000, 0000, 0000, 0004, 0000, 0114, 0000, 
+  0334, 0000, 0000, 0000, 0340, 0000, 0000, 0000, 0324, 0265, 0002, 0000, 0377, 0377, 0377, 0377, 
+  0340, 0000, 0000, 0000, 0001, 0000, 0114, 0000, 0344, 0000, 0000, 0000, 0350, 0000, 0000, 0000, 
+  0352, 0175, 0317, 0046, 0000, 0000, 0000, 0000, 0350, 0000, 0000, 0000, 0023, 0000, 0166, 0000, 
+  0000, 0001, 0000, 0000, 0226, 0016, 0000, 0000, 0201, 0321, 0040, 0031, 0001, 0000, 0000, 0000, 
+  0226, 0016, 0000, 0000, 0005, 0000, 0114, 0000, 0234, 0016, 0000, 0000, 0240, 0016, 0000, 0000, 
+  0177, 0275, 0277, 0346, 0004, 0000, 0000, 0000, 0240, 0016, 0000, 0000, 0017, 0000, 0114, 0000, 
+  0260, 0016, 0000, 0000, 0264, 0016, 0000, 0000, 0163, 0171, 0163, 0164, 0145, 0155, 0055, 0151, 
+  0156, 0146, 0157, 0057, 0003, 0000, 0000, 0000, 0157, 0162, 0147, 0057, 0004, 0000, 0000, 0000, 
+  0057, 0000, 0000, 0000, 0001, 0000, 0000, 0000, 0155, 0141, 0164, 0145, 0055, 0163, 0171, 0163, 
+  0164, 0145, 0155, 0055, 0151, 0156, 0146, 0157, 0056, 0165, 0151, 0000, 0000, 0000, 0000, 0000, 
+  0206, 0015, 0000, 0000, 0000, 0000, 0000, 0000, 0074, 0077, 0170, 0155, 0154, 0040, 0166, 0145, 
+  0162, 0163, 0151, 0157, 0156, 0075, 0042, 0061, 0056, 0060, 0042, 0040, 0145, 0156, 0143, 0157, 
+  0144, 0151, 0156, 0147, 0075, 0042, 0125, 0124, 0106, 0055, 0070, 0042, 0077, 0076, 0012, 0074, 
+  0151, 0156, 0164, 0145, 0162, 0146, 0141, 0143, 0145, 0076, 0074, 0041, 0055, 0055, 0040, 0151, 
+  0156, 0164, 0145, 0162, 0146, 0141, 0143, 0145, 0055, 0162, 0145, 0161, 0165, 0151, 0162, 0145, 
+  0163, 0040, 0147, 0164, 0153, 0053, 0040, 0063, 0056, 0060, 0040, 0055, 0055, 0076, 0074, 0164, 
+  0145, 0155, 0160, 0154, 0141, 0164, 0145, 0040, 0143, 0154, 0141, 0163, 0163, 0075, 0042, 0115, 
+  0141, 0164, 0145, 0123, 0171, 0163, 0164, 0145, 0155, 0111, 0156, 0146, 0157, 0042, 0040, 0160, 
+  0141, 0162, 0145, 0156, 0164, 0075, 0042, 0107, 0164, 0153, 0104, 0151, 0141, 0154, 0157, 0147, 
+  0042, 0076, 0074, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 
+  0075, 0042, 0143, 0141, 0156, 0055, 0146, 0157, 0143, 0165, 0163, 0042, 0076, 0106, 0141, 0154, 
+  0163, 0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 0074, 0160, 0162, 
+  0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 0042, 0151, 0143, 0157, 
+  0156, 0055, 0156, 0141, 0155, 0145, 0042, 0076, 0155, 0141, 0164, 0145, 0055, 0144, 0145, 0163, 
+  0153, 0164, 0157, 0160, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 0074, 
+  0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 0042, 0164, 
+  0171, 0160, 0145, 0137, 0150, 0151, 0156, 0164, 0042, 0076, 0144, 0151, 0141, 0154, 0157, 0147, 
+  0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 0074, 0143, 0150, 0151, 0154, 
+  0144, 0040, 0151, 0156, 0164, 0145, 0162, 0156, 0141, 0154, 0055, 0143, 0150, 0151, 0154, 0144, 
+  0075, 0042, 0166, 0142, 0157, 0170, 0042, 0076, 0074, 0157, 0142, 0152, 0145, 0143, 0164, 0040, 
+  0143, 0154, 0141, 0163, 0163, 0075, 0042, 0107, 0164, 0153, 0102, 0157, 0170, 0042, 0076, 0074, 
+  0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 0042, 0166, 
+  0151, 0163, 0151, 0142, 0154, 0145, 0042, 0076, 0124, 0162, 0165, 0145, 0074, 0057, 0160, 0162, 
+  0157, 0160, 0145, 0162, 0164, 0171, 0076, 0074, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 
+  0040, 0156, 0141, 0155, 0145, 0075, 0042, 0143, 0141, 0156, 0137, 0146, 0157, 0143, 0165, 0163, 
+  0042, 0076, 0106, 0141, 0154, 0163, 0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 
+  0171, 0076, 0074, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 
+  0075, 0042, 0166, 0141, 0154, 0151, 0147, 0156, 0042, 0076, 0143, 0145, 0156, 0164, 0145, 0162, 
+  0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 0074, 0160, 0162, 0157, 0160, 
+  0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 0042, 0163, 0160, 0141, 0143, 0151, 
+  0156, 0147, 0042, 0076, 0063, 0060, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 
+  0076, 0074, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 
+  0042, 0157, 0162, 0151, 0145, 0156, 0164, 0141, 0164, 0151, 0157, 0156, 0042, 0076, 0166, 0145, 
+  0162, 0164, 0151, 0143, 0141, 0154, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 
+  0076, 0074, 0143, 0150, 0151, 0154, 0144, 0076, 0074, 0157, 0142, 0152, 0145, 0143, 0164, 0040, 
+  0143, 0154, 0141, 0163, 0163, 0075, 0042, 0107, 0164, 0153, 0111, 0155, 0141, 0147, 0145, 0042, 
+  0040, 0151, 0144, 0075, 0042, 0154, 0157, 0147, 0157, 0137, 0151, 0155, 0141, 0147, 0145, 0042, 
+  0076, 0074, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 
+  0042, 0166, 0151, 0163, 0151, 0142, 0154, 0145, 0042, 0076, 0124, 0162, 0165, 0145, 0074, 0057, 
+  0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 0074, 0160, 0162, 0157, 0160, 0145, 0162, 
+  0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 0042, 0143, 0141, 0156, 0137, 0146, 0157, 0143, 
+  0165, 0163, 0042, 0076, 0106, 0141, 0154, 0163, 0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 
+  0162, 0164, 0171, 0076, 0074, 0057, 0157, 0142, 0152, 0145, 0143, 0164, 0076, 0074, 0160, 0141, 
+  0143, 0153, 0151, 0156, 0147, 0076, 0074, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 
+  0156, 0141, 0155, 0145, 0075, 0042, 0145, 0170, 0160, 0141, 0156, 0144, 0042, 0076, 0106, 0141, 
+  0154, 0163, 0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 0074, 0160, 
+  0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 0042, 0146, 0151, 
+  0154, 0154, 0042, 0076, 0106, 0141, 0154, 0163, 0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 
+  0162, 0164, 0171, 0076, 0074, 0057, 0160, 0141, 0143, 0153, 0151, 0156, 0147, 0076, 0074, 0057, 
+  0143, 0150, 0151, 0154, 0144, 0076, 0074, 0143, 0150, 0151, 0154, 0144, 0076, 0074, 0157, 0142, 
+  0152, 0145, 0143, 0164, 0040, 0143, 0154, 0141, 0163, 0163, 0075, 0042, 0107, 0164, 0153, 0114, 
+  0151, 0163, 0164, 0102, 0157, 0170, 0042, 0076, 0074, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 
+  0171, 0040, 0156, 0141, 0155, 0145, 0075, 0042, 0166, 0151, 0163, 0151, 0142, 0154, 0145, 0042, 
+  0076, 0124, 0162, 0165, 0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 
+  0074, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 0042, 
+  0163, 0145, 0154, 0145, 0143, 0164, 0151, 0157, 0156, 0055, 0155, 0157, 0144, 0145, 0042, 0076, 
+  0156, 0157, 0156, 0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 0074, 
+  0163, 0164, 0171, 0154, 0145, 0076, 0074, 0143, 0154, 0141, 0163, 0163, 0040, 0156, 0141, 0155, 
+  0145, 0075, 0042, 0146, 0162, 0141, 0155, 0145, 0042, 0057, 0076, 0074, 0057, 0163, 0164, 0171, 
+  0154, 0145, 0076, 0074, 0041, 0055, 0055, 0040, 0104, 0145, 0166, 0151, 0143, 0145, 0040, 0156, 
+  0141, 0155, 0145, 0040, 0055, 0055, 0076, 0074, 0143, 0150, 0151, 0154, 0144, 0076, 0074, 0157, 
+  0142, 0152, 0145, 0143, 0164, 0040, 0143, 0154, 0141, 0163, 0163, 0075, 0042, 0107, 0164, 0153, 
+  0114, 0151, 0163, 0164, 0102, 0157, 0170, 0122, 0157, 0167, 0042, 0040, 0151, 0144, 0075, 0042, 
+  0150, 0157, 0163, 0164, 0156, 0141, 0155, 0145, 0137, 0162, 0157, 0167, 0042, 0076, 0074, 0160, 
+  0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 0042, 0166, 0151, 
+  0163, 0151, 0142, 0154, 0145, 0042, 0076, 0124, 0162, 0165, 0145, 0074, 0057, 0160, 0162, 0157, 
+  0160, 0145, 0162, 0164, 0171, 0076, 0074, 0057, 0157, 0142, 0152, 0145, 0143, 0164, 0076, 0074, 
+  0057, 0143, 0150, 0151, 0154, 0144, 0076, 0074, 0057, 0157, 0142, 0152, 0145, 0143, 0164, 0076, 
+  0074, 0057, 0143, 0150, 0151, 0154, 0144, 0076, 0074, 0143, 0150, 0151, 0154, 0144, 0076, 0074, 
+  0157, 0142, 0152, 0145, 0143, 0164, 0040, 0143, 0154, 0141, 0163, 0163, 0075, 0042, 0107, 0164, 
+  0153, 0114, 0151, 0163, 0164, 0102, 0157, 0170, 0042, 0040, 0151, 0144, 0075, 0042, 0150, 0141, 
+  0162, 0144, 0167, 0141, 0162, 0145, 0137, 0142, 0157, 0170, 0042, 0076, 0074, 0160, 0162, 0157, 
+  0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 0042, 0166, 0151, 0163, 0151, 
+  0142, 0154, 0145, 0042, 0076, 0124, 0162, 0165, 0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 
+  0162, 0164, 0171, 0076, 0074, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 
+  0155, 0145, 0075, 0042, 0163, 0145, 0154, 0145, 0143, 0164, 0151, 0157, 0156, 0055, 0155, 0157, 
+  0144, 0145, 0042, 0076, 0156, 0157, 0156, 0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 
+  0164, 0171, 0076, 0074, 0163, 0164, 0171, 0154, 0145, 0076, 0074, 0143, 0154, 0141, 0163, 0163, 
+  0040, 0156, 0141, 0155, 0145, 0075, 0042, 0146, 0162, 0141, 0155, 0145, 0042, 0057, 0076, 0074, 
+  0057, 0163, 0164, 0171, 0154, 0145, 0076, 0074, 0041, 0055, 0055, 0040, 0110, 0141, 0162, 0144, 
+  0167, 0141, 0162, 0145, 0040, 0115, 0157, 0144, 0145, 0154, 0040, 0055, 0055, 0076, 0074, 0143, 
+  0150, 0151, 0154, 0144, 0076, 0074, 0157, 0142, 0152, 0145, 0143, 0164, 0040, 0143, 0154, 0141, 
+  0163, 0163, 0075, 0042, 0107, 0164, 0153, 0114, 0151, 0163, 0164, 0102, 0157, 0170, 0122, 0157, 
+  0167, 0042, 0040, 0151, 0144, 0075, 0042, 0150, 0141, 0162, 0144, 0167, 0141, 0162, 0145, 0137, 
+  0155, 0157, 0144, 0145, 0154, 0137, 0162, 0157, 0167, 0042, 0076, 0074, 0160, 0162, 0157, 0160, 
+  0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 0042, 0166, 0151, 0163, 0151, 0142, 
+  0154, 0145, 0042, 0076, 0106, 0141, 0154, 0163, 0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 
+  0162, 0164, 0171, 0076, 0074, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 
+  0155, 0145, 0075, 0042, 0141, 0143, 0164, 0151, 0166, 0141, 0164, 0141, 0142, 0154, 0145, 0042, 
+  0076, 0106, 0141, 0154, 0163, 0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 
+  0076, 0074, 0057, 0157, 0142, 0152, 0145, 0143, 0164, 0076, 0074, 0057, 0143, 0150, 0151, 0154, 
+  0144, 0076, 0074, 0041, 0055, 0055, 0040, 0115, 0145, 0155, 0157, 0162, 0171, 0040, 0055, 0055, 
+  0076, 0074, 0143, 0150, 0151, 0154, 0144, 0076, 0074, 0157, 0142, 0152, 0145, 0143, 0164, 0040, 
+  0143, 0154, 0141, 0163, 0163, 0075, 0042, 0107, 0164, 0153, 0114, 0151, 0163, 0164, 0102, 0157, 
+  0170, 0122, 0157, 0167, 0042, 0040, 0151, 0144, 0075, 0042, 0155, 0145, 0155, 0157, 0162, 0171, 
+  0137, 0162, 0157, 0167, 0042, 0076, 0074, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 
+  0156, 0141, 0155, 0145, 0075, 0042, 0166, 0151, 0163, 0151, 0142, 0154, 0145, 0042, 0076, 0124, 
+  0162, 0165, 0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 0074, 0160, 
+  0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 0042, 0141, 0143, 
+  0164, 0151, 0166, 0141, 0164, 0141, 0142, 0154, 0145, 0042, 0076, 0106, 0141, 0154, 0163, 0145, 
+  0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 0074, 0057, 0157, 0142, 0152, 
+  0145, 0143, 0164, 0076, 0074, 0057, 0143, 0150, 0151, 0154, 0144, 0076, 0074, 0041, 0055, 0055, 
+  0040, 0120, 0162, 0157, 0143, 0145, 0163, 0163, 0157, 0162, 0040, 0055, 0055, 0076, 0074, 0143, 
+  0150, 0151, 0154, 0144, 0076, 0074, 0157, 0142, 0152, 0145, 0143, 0164, 0040, 0143, 0154, 0141, 
+  0163, 0163, 0075, 0042, 0107, 0164, 0153, 0114, 0151, 0163, 0164, 0102, 0157, 0170, 0122, 0157, 
+  0167, 0042, 0040, 0151, 0144, 0075, 0042, 0160, 0162, 0157, 0143, 0145, 0163, 0163, 0157, 0162, 
+  0137, 0162, 0157, 0167, 0042, 0076, 0074, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 
+  0156, 0141, 0155, 0145, 0075, 0042, 0166, 0151, 0163, 0151, 0142, 0154, 0145, 0042, 0076, 0124, 
+  0162, 0165, 0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 0074, 0160, 
+  0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 0042, 0141, 0143, 
+  0164, 0151, 0166, 0141, 0164, 0141, 0142, 0154, 0145, 0042, 0076, 0106, 0141, 0154, 0163, 0145, 
+  0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 0074, 0057, 0157, 0142, 0152, 
+  0145, 0143, 0164, 0076, 0074, 0057, 0143, 0150, 0151, 0154, 0144, 0076, 0074, 0041, 0055, 0055, 
+  0040, 0107, 0162, 0141, 0160, 0150, 0151, 0143, 0163, 0040, 0055, 0055, 0076, 0074, 0143, 0150, 
+  0151, 0154, 0144, 0076, 0074, 0157, 0142, 0152, 0145, 0143, 0164, 0040, 0143, 0154, 0141, 0163, 
+  0163, 0075, 0042, 0107, 0164, 0153, 0114, 0151, 0163, 0164, 0102, 0157, 0170, 0122, 0157, 0167, 
+  0042, 0040, 0151, 0144, 0075, 0042, 0147, 0162, 0141, 0160, 0150, 0151, 0143, 0163, 0137, 0162, 
+  0157, 0167, 0042, 0076, 0074, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 
+  0155, 0145, 0075, 0042, 0166, 0151, 0163, 0151, 0142, 0154, 0145, 0042, 0076, 0124, 0162, 0165, 
+  0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 0074, 0160, 0162, 0157, 
+  0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 0042, 0141, 0143, 0164, 0151, 
+  0166, 0141, 0164, 0141, 0142, 0154, 0145, 0042, 0076, 0106, 0141, 0154, 0163, 0145, 0074, 0057, 
+  0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 0074, 0057, 0157, 0142, 0152, 0145, 0143, 
+  0164, 0076, 0074, 0057, 0143, 0150, 0151, 0154, 0144, 0076, 0074, 0041, 0055, 0055, 0040, 0104, 
+  0151, 0163, 0153, 0040, 0103, 0141, 0160, 0141, 0143, 0151, 0164, 0171, 0040, 0055, 0055, 0076, 
+  0074, 0143, 0150, 0151, 0154, 0144, 0076, 0074, 0157, 0142, 0152, 0145, 0143, 0164, 0040, 0143, 
+  0154, 0141, 0163, 0163, 0075, 0042, 0107, 0164, 0153, 0114, 0151, 0163, 0164, 0102, 0157, 0170, 
+  0122, 0157, 0167, 0042, 0040, 0151, 0144, 0075, 0042, 0144, 0151, 0163, 0153, 0137, 0162, 0157, 
+  0167, 0042, 0076, 0074, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 
+  0145, 0075, 0042, 0166, 0151, 0163, 0151, 0142, 0154, 0145, 0042, 0076, 0124, 0162, 0165, 0145, 
+  0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 0074, 0160, 0162, 0157, 0160, 
+  0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 0042, 0141, 0143, 0164, 0151, 0166, 
+  0141, 0164, 0141, 0142, 0154, 0145, 0042, 0076, 0106, 0141, 0154, 0163, 0145, 0074, 0057, 0160, 
+  0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 0074, 0057, 0157, 0142, 0152, 0145, 0143, 0164, 
+  0076, 0074, 0057, 0143, 0150, 0151, 0154, 0144, 0076, 0074, 0057, 0157, 0142, 0152, 0145, 0143, 
+  0164, 0076, 0074, 0057, 0143, 0150, 0151, 0154, 0144, 0076, 0074, 0143, 0150, 0151, 0154, 0144, 
+  0076, 0074, 0157, 0142, 0152, 0145, 0143, 0164, 0040, 0143, 0154, 0141, 0163, 0163, 0075, 0042, 
+  0107, 0164, 0153, 0114, 0151, 0163, 0164, 0102, 0157, 0170, 0042, 0040, 0151, 0144, 0075, 0042, 
+  0157, 0163, 0137, 0142, 0157, 0170, 0042, 0076, 0074, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 
+  0171, 0040, 0156, 0141, 0155, 0145, 0075, 0042, 0166, 0151, 0163, 0151, 0142, 0154, 0145, 0042, 
+  0076, 0124, 0162, 0165, 0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 
+  0074, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 0042, 
+  0163, 0145, 0154, 0145, 0143, 0164, 0151, 0157, 0156, 0055, 0155, 0157, 0144, 0145, 0042, 0076, 
+  0156, 0157, 0156, 0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 0074, 
+  0163, 0164, 0171, 0154, 0145, 0076, 0074, 0143, 0154, 0141, 0163, 0163, 0040, 0156, 0141, 0155, 
+  0145, 0075, 0042, 0146, 0162, 0141, 0155, 0145, 0042, 0057, 0076, 0074, 0057, 0163, 0164, 0171, 
+  0154, 0145, 0076, 0074, 0041, 0055, 0055, 0040, 0117, 0123, 0040, 0116, 0141, 0155, 0145, 0040, 
+  0055, 0055, 0076, 0074, 0143, 0150, 0151, 0154, 0144, 0076, 0074, 0157, 0142, 0152, 0145, 0143, 
+  0164, 0040, 0143, 0154, 0141, 0163, 0163, 0075, 0042, 0107, 0164, 0153, 0114, 0151, 0163, 0164, 
+  0102, 0157, 0170, 0122, 0157, 0167, 0042, 0040, 0151, 0144, 0075, 0042, 0157, 0163, 0137, 0156, 
+  0141, 0155, 0145, 0137, 0162, 0157, 0167, 0042, 0076, 0074, 0160, 0162, 0157, 0160, 0145, 0162, 
+  0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 0042, 0166, 0151, 0163, 0151, 0142, 0154, 0145, 
+  0042, 0076, 0124, 0162, 0165, 0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 
+  0076, 0074, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 
+  0042, 0141, 0143, 0164, 0151, 0166, 0141, 0164, 0141, 0142, 0154, 0145, 0042, 0076, 0106, 0141, 
+  0154, 0163, 0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 0074, 0057, 
+  0157, 0142, 0152, 0145, 0143, 0164, 0076, 0074, 0057, 0143, 0150, 0151, 0154, 0144, 0076, 0074, 
+  0041, 0055, 0055, 0040, 0117, 0123, 0040, 0124, 0171, 0160, 0145, 0040, 0055, 0055, 0076, 0074, 
+  0143, 0150, 0151, 0154, 0144, 0076, 0074, 0157, 0142, 0152, 0145, 0143, 0164, 0040, 0143, 0154, 
+  0141, 0163, 0163, 0075, 0042, 0107, 0164, 0153, 0114, 0151, 0163, 0164, 0102, 0157, 0170, 0122, 
+  0157, 0167, 0042, 0040, 0151, 0144, 0075, 0042, 0157, 0163, 0137, 0164, 0171, 0160, 0145, 0137, 
+  0162, 0157, 0167, 0042, 0076, 0074, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 
+  0141, 0155, 0145, 0075, 0042, 0166, 0151, 0163, 0151, 0142, 0154, 0145, 0042, 0076, 0124, 0162, 
+  0165, 0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 0074, 0160, 0162, 
+  0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 0042, 0141, 0143, 0164, 
+  0151, 0166, 0141, 0164, 0141, 0142, 0154, 0145, 0042, 0076, 0106, 0141, 0154, 0163, 0145, 0074, 
+  0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 0074, 0057, 0157, 0142, 0152, 0145, 
+  0143, 0164, 0076, 0074, 0057, 0143, 0150, 0151, 0154, 0144, 0076, 0074, 0041, 0055, 0055, 0040, 
+  0115, 0101, 0124, 0105, 0040, 0126, 0145, 0162, 0163, 0151, 0157, 0156, 0040, 0055, 0055, 0076, 
+  0074, 0143, 0150, 0151, 0154, 0144, 0076, 0074, 0157, 0142, 0152, 0145, 0143, 0164, 0040, 0143, 
+  0154, 0141, 0163, 0163, 0075, 0042, 0107, 0164, 0153, 0114, 0151, 0163, 0164, 0102, 0157, 0170, 
+  0122, 0157, 0167, 0042, 0040, 0151, 0144, 0075, 0042, 0155, 0141, 0164, 0145, 0137, 0166, 0145, 
+  0162, 0163, 0151, 0157, 0156, 0137, 0162, 0157, 0167, 0042, 0076, 0074, 0160, 0162, 0157, 0160, 
+  0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 0042, 0166, 0151, 0163, 0151, 0142, 
+  0154, 0145, 0042, 0076, 0124, 0162, 0165, 0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 
+  0164, 0171, 0076, 0074, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 
+  0145, 0075, 0042, 0141, 0143, 0164, 0151, 0166, 0141, 0164, 0141, 0142, 0154, 0145, 0042, 0076, 
+  0106, 0141, 0154, 0163, 0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 
+  0074, 0057, 0157, 0142, 0152, 0145, 0143, 0164, 0076, 0074, 0057, 0143, 0150, 0151, 0154, 0144, 
+  0076, 0074, 0041, 0055, 0055, 0040, 0127, 0151, 0156, 0144, 0157, 0167, 0151, 0156, 0147, 0040, 
+  0123, 0171, 0163, 0164, 0145, 0155, 0040, 0055, 0055, 0076, 0074, 0143, 0150, 0151, 0154, 0144, 
+  0076, 0074, 0157, 0142, 0152, 0145, 0143, 0164, 0040, 0143, 0154, 0141, 0163, 0163, 0075, 0042, 
+  0107, 0164, 0153, 0114, 0151, 0163, 0164, 0102, 0157, 0170, 0122, 0157, 0167, 0042, 0040, 0151, 
+  0144, 0075, 0042, 0167, 0151, 0156, 0144, 0157, 0167, 0151, 0156, 0147, 0137, 0163, 0171, 0163, 
+  0164, 0145, 0155, 0137, 0162, 0157, 0167, 0042, 0076, 0074, 0160, 0162, 0157, 0160, 0145, 0162, 
+  0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 0042, 0166, 0151, 0163, 0151, 0142, 0154, 0145, 
+  0042, 0076, 0124, 0162, 0165, 0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 
+  0076, 0074, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 
+  0042, 0141, 0143, 0164, 0151, 0166, 0141, 0164, 0141, 0142, 0154, 0145, 0042, 0076, 0106, 0141, 
+  0154, 0163, 0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 0074, 0057, 
+  0157, 0142, 0152, 0145, 0143, 0164, 0076, 0074, 0057, 0143, 0150, 0151, 0154, 0144, 0076, 0074, 
+  0041, 0055, 0055, 0040, 0126, 0151, 0162, 0164, 0165, 0141, 0154, 0151, 0172, 0141, 0164, 0151, 
+  0157, 0156, 0040, 0055, 0055, 0076, 0074, 0143, 0150, 0151, 0154, 0144, 0076, 0074, 0157, 0142, 
+  0152, 0145, 0143, 0164, 0040, 0143, 0154, 0141, 0163, 0163, 0075, 0042, 0107, 0164, 0153, 0114, 
+  0151, 0163, 0164, 0102, 0157, 0170, 0122, 0157, 0167, 0042, 0040, 0151, 0144, 0075, 0042, 0166, 
+  0151, 0162, 0164, 0165, 0141, 0154, 0151, 0172, 0141, 0164, 0151, 0157, 0156, 0137, 0162, 0157, 
+  0167, 0042, 0076, 0074, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 
+  0145, 0075, 0042, 0166, 0151, 0163, 0151, 0142, 0154, 0145, 0042, 0076, 0106, 0141, 0154, 0163, 
+  0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 0074, 0160, 0162, 0157, 
+  0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 0042, 0141, 0143, 0164, 0151, 
+  0166, 0141, 0164, 0141, 0142, 0154, 0145, 0042, 0076, 0106, 0141, 0154, 0163, 0145, 0074, 0057, 
+  0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0076, 0074, 0057, 0157, 0142, 0152, 0145, 0143, 
+  0164, 0076, 0074, 0057, 0143, 0150, 0151, 0154, 0144, 0076, 0074, 0041, 0055, 0055, 0040, 0113, 
+  0145, 0162, 0156, 0145, 0154, 0040, 0055, 0055, 0076, 0074, 0143, 0150, 0151, 0154, 0144, 0076, 
+  0074, 0157, 0142, 0152, 0145, 0143, 0164, 0040, 0143, 0154, 0141, 0163, 0163, 0075, 0042, 0107, 
+  0164, 0153, 0114, 0151, 0163, 0164, 0102, 0157, 0170, 0122, 0157, 0167, 0042, 0040, 0151, 0144, 
+  0075, 0042, 0153, 0145, 0162, 0156, 0145, 0154, 0137, 0162, 0157, 0167, 0042, 0076, 0074, 0160, 
+  0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 0156, 0141, 0155, 0145, 0075, 0042, 0166, 0151, 
+  0163, 0151, 0142, 0154, 0145, 0042, 0076, 0124, 0162, 0165, 0145, 0074, 0057, 0160, 0162, 0157, 
+  0160, 0145, 0162, 0164, 0171, 0076, 0074, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0171, 0040, 
+  0156, 0141, 0155, 0145, 0075, 0042, 0141, 0143, 0164, 0151, 0166, 0141, 0164, 0141, 0142, 0154, 
+  0145, 0042, 0076, 0106, 0141, 0154, 0163, 0145, 0074, 0057, 0160, 0162, 0157, 0160, 0145, 0162, 
+  0164, 0171, 0076, 0074, 0057, 0157, 0142, 0152, 0145, 0143, 0164, 0076, 0074, 0057, 0143, 0150, 
+  0151, 0154, 0144, 0076, 0074, 0057, 0157, 0142, 0152, 0145, 0143, 0164, 0076, 0074, 0057, 0143, 
+  0150, 0151, 0154, 0144, 0076, 0074, 0057, 0157, 0142, 0152, 0145, 0143, 0164, 0076, 0074, 0057, 
+  0143, 0150, 0151, 0154, 0144, 0076, 0074, 0057, 0164, 0145, 0155, 0160, 0154, 0141, 0164, 0145, 
+  0076, 0074, 0057, 0151, 0156, 0164, 0145, 0162, 0146, 0141, 0143, 0145, 0076, 0012, 0000, 0000, 
+  0050, 0165, 0165, 0141, 0171, 0051, 0155, 0141, 0164, 0145, 0057, 0000, 0005, 0000, 0000, 0000, 
+  0143, 0157, 0156, 0164, 0162, 0157, 0154, 0055, 0143, 0145, 0156, 0164, 0145, 0162, 0057, 0000, 
+  0000, 0000, 0000, 0000
+} };
+
+static GStaticResource static_resource = { mate_system_info_resource_data.data, sizeof (mate_system_info_resource_data.data) - 1 /* nul terminator */, NULL, NULL, NULL };
+
+G_MODULE_EXPORT
+GResource *mate_system_info_get_resource (void);
+GResource *mate_system_info_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(mate_system_inforesource_constructor)
+#endif
+G_DEFINE_CONSTRUCTOR(mate_system_inforesource_constructor)
+#ifdef G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA
+#pragma G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(mate_system_inforesource_destructor)
+#endif
+G_DEFINE_DESTRUCTOR(mate_system_inforesource_destructor)
+
+#else
+#warning "Constructor not supported on this compiler, linking in resources will not work"
+#endif
+
+static void mate_system_inforesource_constructor (void)
+{
+  g_static_resource_init (&static_resource);
+}
+
+static void mate_system_inforesource_destructor (void)
+{
+  g_static_resource_fini (&static_resource);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/82.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/82.html new file mode 100644 index 00000000..c9aa4a87 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/82.html @@ -0,0 +1,1787 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
+ *
+ * Copyright (C) 2023 MATE Developers
+ * Copyright (C) 2019 Purism SPC
+ * Copyright (C) 2017 Mohammed Sadiq <sadiq@sadiqpk.org>
+ * Copyright (C) 2010 Red Hat, Inc
+ * Copyright (C) 2008 William Jon McCann <jmccann@redhat.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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#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 <glibtop/fsusage.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glibtop/mountlist.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glibtop/mem.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glibtop/sysinfo.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <udisks/udisks.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/utsname.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#ifdef GDK_WINDOWING_WAYLAND
+#include <gdk/gdkwayland.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+#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 "info-cleanup.h"
+#include "mate-system-info.h"
+#include "mate-system-info-resources.h"
+
+struct _MateSystemInfo
+{
+    GtkDialog    parent_instance;
+    GtkWidget   *logo_image;
+    GtkWidget   *hostname_row;
+    GtkListBox  *hardware_box;
+    GtkWidget   *hardware_model_row;
+    GtkWidget   *memory_row;
+    GtkWidget   *processor_row;
+    GtkWidget   *graphics_row;
+    GtkWidget   *disk_row;
+    GtkListBox  *os_box;
+    GtkWidget   *kernel_row;
+    GtkWidget   *virtualization_row;
+    GtkWidget   *windowing_system_row;
+    GtkWidget   *mate_version_row;
+    GtkWidget   *os_name_row;
+    GtkWidget   *os_type_row;
+};
+
+G_DEFINE_TYPE (MateSystemInfo, mate_system_info, GTK_TYPE_DIALOG)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE is a macro then please configure it.
+
+static void
+set_lable_style (GtkWidget  *lable,
+                 const char *color,
+                 int         font_szie,
+                 const char *text,
+                 gboolean    blod)
+{
+    g_autofree gchar *lable_text = NULL;
+
+    if (color == NULL)
+    {
+        lable_text = g_strdup_printf ("<span weight=\'light\'font_desc=\'%d\'><b>%s</b></span>", font_szie, text);
+    }
+    else
+    {
+        if(blod)
+        {
+            lable_text = g_strdup_printf ("<span foreground=\'%s\'weight=\'light\'font_desc=\'%d\'><b>%s</b></span>",
+                             color,
+                             font_szie,
+                             text);
+        }
+        else
+        {
+            lable_text = g_strdup_printf ("<span foreground=\'%s\'weight=\'light\'font_desc=\'%d\'>%s</span>",
+                            color,
+                            font_szie,
+                            text);
+        }
+    }
+
+    gtk_label_set_markup (GTK_LABEL(lable), lable_text);
+}
+
+static void
+mate_system_info_row_fill (GtkWidget  *row,
+                           const char *labelname,
+                           gboolean    is_separator)
+{
+    GtkWidget  *vbox;
+    GtkWidget  *box;
+    GtkWidget  *label;
+    GtkWidget  *separator;
+
+    vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+    box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+    gtk_box_set_spacing (GTK_BOX (box), 12);
+    g_object_set (box, "margin", 12, NULL);
+    gtk_box_pack_start (GTK_BOX (vbox), box, FALSE, FALSE, 3);
+
+    label = gtk_label_new (NULL);
+    set_lable_style (label, NULL, 12, labelname, TRUE);
+    gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
+    gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 6);
+
+    label = gtk_label_new (NULL);
+    gtk_box_pack_end (GTK_BOX (box), label, FALSE, FALSE, 6);
+    g_object_set_data (G_OBJECT (row), "labelvalue", label);
+
+    separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
+    if (is_separator)
+        gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, FALSE, 0);
+
+    gtk_container_add (GTK_CONTAINER (row), vbox);
+}
+
+static void
+mate_system_info_set_row (MateSystemInfo *info)
+{
+    mate_system_info_row_fill (info->hostname_row, _("Device Name"), FALSE);
+# ifdef HAVE_SYSTEMD
+    mate_system_info_row_fill (info->hardware_model_row, _("Hardware Model"), TRUE);
+    mate_system_info_row_fill (info->virtualization_row, _("Virtualization"), TRUE);
+# endif
+    mate_system_info_row_fill (info->memory_row, _("Memory"), TRUE);
+    mate_system_info_row_fill (info->processor_row, _("Processor"), TRUE);
+    mate_system_info_row_fill (info->graphics_row, _("Graphics"), TRUE);
+    mate_system_info_row_fill (info->disk_row, _("Disk Capacity"), FALSE);
+    mate_system_info_row_fill (info->kernel_row, _("Kernel Version"), FALSE);
+    mate_system_info_row_fill (info->windowing_system_row, _("Windowing System"), TRUE);
+    mate_system_info_row_fill (info->mate_version_row, _("MATE Version"), TRUE);
+    mate_system_info_row_fill (info->os_name_row, _("OS Name"), TRUE);
+    mate_system_info_row_fill (info->os_type_row, _("OS Type"), TRUE);
+
+    gtk_widget_show (info->logo_image);
+    gtk_widget_show_all (info->hostname_row);
+    gtk_widget_show_all (info->memory_row);
+    gtk_widget_show_all (info->processor_row);
+    gtk_widget_show_all (info->graphics_row);
+    gtk_widget_show_all (info->disk_row);
+    gtk_widget_show_all (info->kernel_row);
+    gtk_widget_show_all (info->windowing_system_row);
+    gtk_widget_show_all (info->mate_version_row);
+    gtk_widget_show_all (info->os_type_row);
+    gtk_widget_show_all (info->os_name_row);
+}
+
+static char *
+get_system_hostname (void)
+{
+# ifdef HAVE_SYSTEMD
+    GDBusProxy         *hostnamed_proxy;
+    g_autoptr(GVariant) variant = NULL;
+    g_autoptr(GError)   error = NULL; 
+
+    hostnamed_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
+                                                     G_DBUS_PROXY_FLAGS_NONE,
+                                                     NULL,
+                                                     "org.freedesktop.hostname1",
+                                                     "/org/freedesktop/hostname1",
+                                                     "org.freedesktop.hostname1",
+                                                     NULL,
+                                                     &error);
+
+    if (!hostnamed_proxy)
+        return g_strdup ("");
+
+    variant = g_dbus_proxy_get_cached_property (hostnamed_proxy, "Hostname");
+    if (!variant)
+    {
+        g_autoptr(GError) error = NULL;
+        g_autoptr(GVariant) inner = NULL;
+
+      /* Work around systemd-hostname not sending us back
+       * the property value when changing values */
+        variant = g_dbus_proxy_call_sync (hostnamed_proxy,
+                                         "org.freedesktop.DBus.Properties.Get",
+                                          g_variant_new ("(ss)", "org.freedesktop.hostname1", "Hostname"),
+                                          G_DBUS_CALL_FLAGS_NONE,
+                                          -1,
+                                          NULL,
+                                          &error);
+        if (variant == NULL)
+        {
+            g_warning ("Failed to get property '%s': %s", "Hostname", error->message);
+            g_object_unref (hostnamed_proxy);
+            return NULL;
+        }
+
+        g_variant_get (variant, "(v)", &inner);
+        g_object_unref (hostnamed_proxy);
+        return g_variant_dup_string (inner, NULL);
+    }
+    else
+    {
+        g_object_unref (hostnamed_proxy);
+        return g_variant_dup_string (variant, NULL);
+    }
+# else
+    return g_strdup (g_get_host_name ());
+# endif
+}
+
+# ifdef HAVE_SYSTEMD
+static char *
+get_hardware_model (void)
+{
+    g_autoptr(GDBusProxy) hostnamed_proxy = NULL;
+    g_autoptr(GVariant) vendor_variant = NULL;
+    g_autoptr(GVariant) model_variant = NULL;
+    const char *vendor_string, *model_string;
+    g_autoptr(GError) error = NULL;
+
+    hostnamed_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
+                                                     G_DBUS_PROXY_FLAGS_NONE,
+                                                     NULL,
+                                                     "org.freedesktop.hostname1",
+                                                     "/org/freedesktop/hostname1",
+                                                     "org.freedesktop.hostname1",
+                                                     NULL,
+                                                     &error);
+    if (hostnamed_proxy == NULL)
+    {
+        g_debug ("Couldn't get hostnamed to start, bailing: %s", error->message);
+        return NULL;
+    }
+
+    vendor_variant = g_dbus_proxy_get_cached_property (hostnamed_proxy, "HardwareVendor");
+    if (!vendor_variant)
+    {
+        g_debug ("Unable to retrieve org.freedesktop.hostname1.HardwareVendor property");
+        return NULL;
+    }
+
+    model_variant = g_dbus_proxy_get_cached_property (hostnamed_proxy, "HardwareModel");
+    if (!model_variant)
+    {
+        g_debug ("Unable to retrieve org.freedesktop.hostname1.HardwareModel property");
+        return NULL;
+    }
+
+    vendor_string = g_variant_get_string (vendor_variant, NULL),
+    model_string = g_variant_get_string (model_variant, NULL);
+
+    if (vendor_string && g_strcmp0 (vendor_string, "") != 0)
+    {
+        gchar *vendor_model = NULL;
+
+        vendor_model = g_strdup_printf ("%s %s", vendor_string, model_string);
+        return vendor_model;
+    }
+
+    return NULL;
+}
+# endif
+
+static char *
+get_cpu_info (void)
+{
+    g_autoptr(GHashTable) counts = NULL;
+    const glibtop_sysinfo *info;
+    g_autoptr(GString) cpu = NULL;
+    GHashTableIter iter;
+    gpointer       key, value;
+    int            i;
+    int            j;
+
+    counts = g_hash_table_new (g_str_hash, g_str_equal);
+    info = glibtop_get_sysinfo ();
+
+    /* count duplicates */
+    for (i = 0; i != info->ncpu; ++i)
+    {
+        const char * const keys[] = { "model name", "cpu", "Processor" ,"Model Name"};
+        char *model;
+        int  *count; 
+        model = NULL;
+
+        for (j = 0; model == NULL && j != G_N_ELEMENTS (keys); ++j)
+        {
+             model = g_hash_table_lookup (info->cpuinfo[i].values,
+                                          keys[j]);
+        }
+
+        if (model == NULL)
+            continue;
+        count = g_hash_table_lookup (counts, model);
+        if (count == NULL)
+            g_hash_table_insert (counts, model, GINT_TO_POINTER (1));
+        else
+            g_hash_table_replace (counts, model, GINT_TO_POINTER (GPOINTER_TO_INT (count) + 1));
+    }
+
+    cpu = g_string_new (NULL);
+    g_hash_table_iter_init (&iter, counts);
+    while (g_hash_table_iter_next (&iter, &key, &value))
+    {
+        g_autofree char *cleanedup = NULL;
+        int count;
+
+        count = GPOINTER_TO_INT (value);
+        cleanedup = info_cleanup ((const char *) key);
+        if (count > 1)
+            g_string_append_printf (cpu, "%s \303\227 %d ", cleanedup, count);
+        else
+            g_string_append_printf (cpu, "%s ", cleanedup);
+    }
+
+    return g_strdup (cpu->str);
+}
+
+static char *
+get_renderer_from_session (void)
+{
+    g_autoptr(GDBusProxy) session_proxy = NULL;
+    g_autoptr(GVariant) renderer_variant = NULL;
+    char *renderer;
+    g_autoptr(GError) error = NULL;
+
+    session_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
+                                                   G_DBUS_PROXY_FLAGS_NONE,
+                                                   NULL,
+                                                   "org.gnome.SessionManager",
+                                                   "/org/gnome/SessionManager",
+                                                   "org.gnome.SessionManager",
+                                                   NULL, &error);
+    if (error != NULL)
+    {
+        g_warning ("Unable to connect to create a proxy for org.gnome.SessionManager: %s",
+                   error->message);
+        return NULL;
+    }
+
+    renderer_variant = g_dbus_proxy_get_cached_property (session_proxy, "Renderer");
+
+    if (!renderer_variant)
+    {
+        g_warning ("Unable to retrieve org.gnome.SessionManager.Renderer property");
+        return NULL;
+    }
+
+    renderer = info_cleanup (g_variant_get_string (renderer_variant, NULL));
+
+    return renderer;
+}
+
+static gchar *
+get_graphics_hardware_string (void)
+{
+    g_autofree char *discrete_renderer = NULL;
+    g_autofree char *renderer = NULL;
+
+    renderer = get_renderer_from_session ();
+    if (!renderer)
+        return g_strdup ("Unknown");
+
+    return g_strdup (renderer);
+}
+
+static char *
+get_primary_disk_size (void)
+{
+    g_autoptr(UDisksClient) client = NULL;
+    GDBusObjectManager *manager;
+    g_autolist(GDBusObject) objects = NULL;
+    GList *l;
+    gchar *size;
+    guint64 total_size;
+    g_autoptr(GError) error = NULL;
+
+    total_size = 0;
+
+    client = udisks_client_new_sync (NULL, &error);
+    if (client == NULL)
+    {
+        g_warning ("Unable to get UDisks client: %s. Disk information will not be available.",
+                   error->message);
+        return g_strdup ("Unknown");
+    }
+
+    manager = udisks_client_get_object_manager (client);
+    objects = g_dbus_object_manager_get_objects (manager);
+
+    for (l = objects; l != NULL; l = l->next)
+    {
+        UDisksDrive *drive;
+        drive = udisks_object_peek_drive (UDISKS_OBJECT (l->data));
+
+        /* Skip removable devices */
+        if (drive == NULL ||
+          udisks_drive_get_removable (drive) ||
+          udisks_drive_get_ejectable (drive))
+        {
+            continue;
+        }
+
+        total_size += udisks_drive_get_size (drive);
+    }
+    if (total_size > 0)
+    {
+        size = g_format_size (total_size);
+    }
+    else
+    {
+        size = g_strdup ("Unknown");
+    }
+
+    return size;
+}
+
+static char *
+get_os_name (void)
+{
+    g_autofree gchar *name = NULL;
+    g_autofree gchar *version_id = NULL;
+    g_autofree gchar *pretty_name = NULL;
+    g_autofree gchar *name_version = NULL;
+    gchar *result = NULL;
+
+    name = g_get_os_info (G_OS_INFO_KEY_NAME);
+    version_id = g_get_os_info (G_OS_INFO_KEY_VERSION_ID);
+    pretty_name = g_get_os_info (G_OS_INFO_KEY_PRETTY_NAME);
+
+    if (pretty_name)
+        name_version = g_strdup (pretty_name);
+    else if (name && version_id)
+        name_version = g_strdup_printf ("%s %s", name, version_id);
+    else
+        name_version = g_strdup (("Unknown"));
+
+    result = g_strdup (name_version);
+
+    return result;
+}
+
+static char *
+get_os_type (void)
+{
+    if (GLIB_SIZEOF_VOID_P == 8)
+        /* translators: This is the type of architecture for the OS */
+        return g_strdup_printf ("64-bit");
+    else
+        /* translators: This is the type of architecture for the OS */
+        return g_strdup_printf ("32-bit");
+}
+
+static char *
+get_windowing_system (void)
+{
+    GdkDisplay *display;
+
+    display = gdk_display_get_default ();
+
+#if defined(GDK_WINDOWING_X11)
+    if (GDK_IS_X11_DISPLAY (display))
+        return g_strdup ("X11");
+#endif /* GDK_WINDOWING_X11 */
+#if defined(GDK_WINDOWING_WAYLAND)
+    if (GDK_IS_WAYLAND_DISPLAY (display))
+        return g_strdup ("Wayland");
+#endif /* GDK_WINDOWING_WAYLAND */
+    return g_strdup (C_("Windowing system (Wayland, X11, or Unknown)", "Unknown"));
+}
+
+static char *
+get_kernel_vesrion (void)
+{
+    struct utsname un;
+
+    if (uname (&un) < 0)
+        return NULL;
+
+    return g_strdup_printf ("%s %s", un.sysname, un.release);
+}
+
+# ifdef HAVE_SYSTEMD
+static struct {
+    const char *id;
+    const char *display;
+}   const virt_tech[] = {
+    { "kvm", "KVM" },
+    { "qemu", "QEmu" },
+    { "vmware", "VMware" },
+    { "microsoft", "Microsoft" },
+    { "oracle", "Oracle" },
+    { "xen", "Xen" },
+    { "bochs", "Bochs" },
+    { "chroot", "chroot" },
+    { "openvz", "OpenVZ" },
+    { "lxc", "LXC" },
+    { "lxc-libvirt", "LXC (libvirt)" },
+    { "systemd-nspawn", "systemd (nspawn)" }
+};
+
+static char *
+get_virtualization_label (const char *virt)
+{
+    const char *display_name;
+    guint i;
+
+    if (virt == NULL || *virt == '\0')
+    {
+        return NULL;
+    }
+
+    display_name = NULL;
+    for (i = 0; i < G_N_ELEMENTS (virt_tech); i++)
+    {
+        if (g_str_equal (virt_tech[i].id, virt))
+        {
+            display_name = virt_tech[i].display;
+            break;
+        }
+    }
+
+    return display_name ? g_strdup (display_name) : g_strdup (virt);
+}
+
+static char *
+get_system_virt (void)
+{
+    g_autoptr(GError) error = NULL;
+    g_autoptr(GDBusProxy) systemd_proxy = NULL;
+    g_autoptr(GVariant) variant = NULL;
+    GVariant *inner;
+
+    systemd_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
+                                                   G_DBUS_PROXY_FLAGS_NONE,
+                                                   NULL,
+                                                   "org.freedesktop.systemd1",
+                                                   "/org/freedesktop/systemd1",
+                                                   "org.freedesktop.systemd1",
+                                                   NULL,
+                                                   &error);
+
+    if (systemd_proxy == NULL)
+    {
+        g_debug ("systemd not available, bailing: %s", error->message);
+        return NULL;
+    }
+
+    variant = g_dbus_proxy_call_sync (systemd_proxy,
+                                      "org.freedesktop.DBus.Properties.Get",
+                                      g_variant_new ("(ss)", "org.freedesktop.systemd1.Manager", "Virtualization"),
+                                      G_DBUS_CALL_FLAGS_NONE,
+                                      -1,
+                                      NULL,
+                                      &error);
+    if (variant == NULL)
+    {
+        g_debug ("Failed to get property '%s': %s", "Virtualization", error->message);
+        return NULL;
+    }
+
+    g_variant_get (variant, "(v)", &inner);
+
+    return get_virtualization_label (g_variant_get_string (inner, NULL));
+}
+# endif
+
+static char *
+get_mate_desktop_version ()
+{
+    int   status;
+    int   i = 0;
+    char *version = NULL;
+    char *argv[] = {"/usr/bin/mate-about", "-v", NULL};
+    g_autoptr(GError) error = NULL;
+
+    g_debug ("About to launch '%s'", argv[0]);
+
+    if (!g_spawn_sync (NULL, (char **) argv, NULL, 0, NULL, NULL, &version, NULL, &status, &error))
+    {
+        g_warning ("Failed to get GPU: %s", error->message);
+        return NULL;
+    }
+#if GLIB_CHECK_VERSION(2, 70, 0)
+    if (!g_spawn_check_wait_status (status, NULL))
+#else
+    if (!g_spawn_check_exit_status (status, NULL))
+#endif
+        return NULL;
+
+    while (version[i] != '\0')
+    {
+        if (version[i] == '\n')
+        {
+            version[i] = '\0';
+            break;
+        }
+        i++;
+    }
+
+    return version;
+}
+
+static char *
+get_logo_name (void)
+{
+    char *logo_name = NULL;
+
+    logo_name = g_get_os_info ("LOGO");
+
+    if (logo_name == NULL)
+        logo_name = g_strdup ("mate-desktop");
+
+    return logo_name;
+}
+
+void
+mate_system_info_setup (MateSystemInfo *info)
+{
+    g_autofree char *logo_name = NULL;
+    g_autofree char *hostname_text = NULL;
+# ifdef HAVE_SYSTEMD
+    g_autofree char *hw_model_text = NULL;
+    g_autofree char *virt_text = NULL;
+# endif
+    g_autofree char *memory_text = NULL;
+    g_autofree char *cpu_text = NULL;
+    g_autofree char *os_type_text = NULL;
+    g_autofree char *os_name_text = NULL;
+    g_autofree char *disk_text = NULL;
+    g_autofree char *kernel_text = NULL;
+    g_autofree char *windowing_system_text = NULL;
+    g_autofree char *de_text = NULL;
+    g_autofree char *graphics_hardware_string = NULL;
+
+    GtkWidget  *label;
+    glibtop_mem mem;
+
+    logo_name = get_logo_name ();
+    gtk_image_set_from_icon_name (GTK_IMAGE (info->logo_image), logo_name, GTK_ICON_SIZE_INVALID);
+    gtk_image_set_pixel_size (GTK_IMAGE (info->logo_image), 128);
+
+    hostname_text = get_system_hostname ();
+    label = g_object_get_data (G_OBJECT (info->hostname_row), "labelvalue");
+    set_lable_style (label, "gray", 12, hostname_text, FALSE);
+
+# if HAVE_SYSTEMD
+    hw_model_text = get_hardware_model ();
+    if (hw_model_text != NULL)
+    {
+        gtk_widget_show_all (info->hardware_model_row);
+        label = g_object_get_data (G_OBJECT (info->hardware_model_row), "labelvalue");
+        set_lable_style (label, "gray", 12, hw_model_text, FALSE);
+    }
+# endif
+    glibtop_get_mem (&mem);
+    memory_text = g_format_size_full (mem.total, G_FORMAT_SIZE_IEC_UNITS);
+    label = g_object_get_data (G_OBJECT (info->memory_row), "labelvalue");
+    set_lable_style (label, "gray", 12, memory_text, FALSE);
+
+    cpu_text = get_cpu_info ();
+    label = g_object_get_data (G_OBJECT (info->processor_row), "labelvalue");
+    set_lable_style (label, "gray", 12, cpu_text, FALSE);
+
+    graphics_hardware_string = get_graphics_hardware_string ();
+    label = g_object_get_data (G_OBJECT (info->graphics_row), "labelvalue");
+    set_lable_style (label, "gray", 12, graphics_hardware_string, FALSE);
+
+    disk_text = get_primary_disk_size ();
+    label = g_object_get_data (G_OBJECT (info->disk_row), "labelvalue");
+    set_lable_style (label, "gray", 12, disk_text, FALSE);
+
+    kernel_text = get_kernel_vesrion ();
+    label = g_object_get_data (G_OBJECT (info->kernel_row), "labelvalue");
+    set_lable_style (label, "gray", 12, kernel_text, FALSE);
+# ifdef HAVE_SYSTEMD
+    virt_text = get_system_virt ();
+    if (virt_text != NULL)
+    {
+        gtk_widget_show_all (info->virtualization_row);
+        label = g_object_get_data (G_OBJECT (info->virtualization_row), "labelvalue");
+        set_lable_style (label, "gray", 12, virt_text, FALSE);
+    }
+# endif
+    windowing_system_text = get_windowing_system ();
+    label = g_object_get_data (G_OBJECT (info->windowing_system_row), "labelvalue");
+    set_lable_style (label, "gray", 12, windowing_system_text, FALSE);
+
+    de_text = get_mate_desktop_version ();
+    label = g_object_get_data (G_OBJECT (info->mate_version_row), "labelvalue");
+    set_lable_style (label, "gray", 12, de_text, FALSE);
+
+    os_type_text = get_os_type ();
+    label = g_object_get_data (G_OBJECT (info->os_type_row), "labelvalue");
+    set_lable_style (label, "gray", 12, os_type_text, FALSE);
+
+    os_name_text = get_os_name ();
+    label = g_object_get_data (G_OBJECT (info->os_name_row), "labelvalue");
+    set_lable_style (label, "gray", 12, os_name_text, FALSE);
+}
+
+static void
+mate_system_info_destroy (GtkWidget *widget)
+{
+    GTK_WIDGET_CLASS (mate_system_info_parent_class)->destroy (widget);
+}
+
+static void
+mate_system_info_class_init (MateSystemInfoClass *klass)
+{
+    GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+    widget_class->destroy = mate_system_info_destroy;
+    gtk_widget_class_set_template_from_resource (widget_class, "/org/mate/control-center/system-info/mate-system-info.ui");
+
+    gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, hostname_row);
+# ifdef HAVE_SYSTEMD
+    gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, hardware_box);
+    gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, virtualization_row);
+# endif
+    gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, disk_row);
+    gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, mate_version_row);
+    gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, graphics_row);
+    gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, hardware_model_row);
+    gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, memory_row);
+    gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, os_box);
+    gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, logo_image);
+    gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, os_name_row);
+    gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, os_type_row);
+    gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, processor_row);
+    gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, kernel_row);
+    gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, windowing_system_row);
+}
+
+static void
+mate_system_info_init (MateSystemInfo *self)
+{
+    gtk_widget_init_template (GTK_WIDGET (self));
+    g_resources_register (mate_system_info_get_resource ());
+    mate_system_info_set_row (MATE_SYSTEM_INFO (self));
+}
+
+GtkWidget *
+mate_system_info_new (void)
+{
+    GtkWidget  *dialog;
+    gboolean    use_header;
+    GdkDisplay *display;
+
+    g_object_get (gtk_settings_get_default (),
+                 "gtk-dialogs-use-header", &use_header,
+                  NULL);
+
+    display = gdk_display_get_default ();
+#if defined(GDK_WINDOWING_WAYLAND)
+    if (GDK_IS_WAYLAND_DISPLAY (display))
+        use_header = FALSE;
+#endif /* GDK_WINDOWING_WAYLAND */
+
+    dialog = g_object_new (MATE_TYPE_SYSTEM_INFO,
+                           "use-header-bar", use_header,
+                           NULL);
+    gtk_window_set_title (GTK_WINDOW (dialog), _("Mate System Info"));
+    gtk_widget_set_size_request (GTK_WIDGET (dialog), 600, 500);
+    gtk_window_set_resizable  (GTK_WINDOW (dialog), FALSE);
+
+    return dialog;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/83.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/83.html new file mode 100644 index 00000000..aa833ae0 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/83.html @@ -0,0 +1,251 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
1
+2
+3
+4
+5
+6
+7
#ifndef __RESOURCE_mate_system_info_H__
+#define __RESOURCE_mate_system_info_H__
+
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+extern GResource *mate_system_info_get_resource (void);
+#endif
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/84.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/84.html new file mode 100644 index 00000000..4a8bf7c0 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/84.html @@ -0,0 +1,851 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*   mate-user-admin
+*   Copyright (C) 2018  zhuyaliang https://github.com/zhuyaliang/
+*
+*   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 3 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, see <https://www.gnu.org/licenses/>.
+*/
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <polkit/polkit.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+#include "time-tool.h"
+#include "time-zone.h"
+#include "time-map.h"
+
+#define  LOCKFILE               "/tmp/time-admin.pid"
+#define  TIME_ADMIN_PERMISSION  "org.freedesktop.timedate1.set-time"
+
+static char *translate(const char *value)
+{
+    g_autofree gchar *zone_translated = NULL;
+    char *name;
+
+    zone_translated = g_strdup (_(value));
+    name = g_strdup_printf (C_("timezone loc", "%s"),zone_translated);
+
+    return name;
+}
+
+static void
+QuitApp (TimeAdmin *ta)
+{
+    if (ta->UpdateTimeId > 0)
+        g_source_remove (ta->UpdateTimeId);
+
+    if (ta->ApplyId > 0)
+        g_source_remove (ta->ApplyId);
+
+    gtk_main_quit ();
+}
+
+static gboolean CheckClockHealth(gpointer data)
+{
+    TimeAdmin *ta = (TimeAdmin *)data;
+    Update_Clock_Start(ta);
+    ta->ApplyId = 0;
+
+    return FALSE;
+}
+
+static void update_apply_timeout(TimeAdmin *ta)
+{
+    Update_Clock_Stop(ta);
+    if (ta->ApplyId > 0)
+    {
+         g_source_remove (ta->ApplyId);
+         ta->ApplyId = 0;
+    }
+    ta->ApplyId = g_timeout_add (10000, (GSourceFunc)CheckClockHealth,ta);
+}
+
+static void ChangeTimeValue(GtkSpinButton *spin_button,
+                            gpointer       data)
+{
+    TimeAdmin *ta = (TimeAdmin *)data;
+    if(TimeoutFlag == 0)
+    {
+        update_apply_timeout(ta);
+    }
+}
+
+static gboolean on_window_quit (GtkWidget *widget,
+                                GdkEvent  *event,
+                                gpointer   user_data)
+{
+    TimeAdmin *ta = (TimeAdmin *)user_data;
+
+    QuitApp(ta);
+    return TRUE;
+}
+
+static void CloseWindow (GtkButton *button,gpointer data)
+{
+    TimeAdmin *ta = (TimeAdmin *)data;
+
+    QuitApp(ta);
+}
+
+static void UpdatePermission(TimeAdmin *ta)
+{
+    gboolean is_authorized;
+
+    is_authorized = g_permission_get_allowed (G_PERMISSION (ta->Permission));
+    gtk_widget_set_sensitive(ta->TimeZoneButton, is_authorized);
+    gtk_widget_set_sensitive(ta->NtpSyncSwitch,  is_authorized);
+    gtk_widget_set_sensitive(ta->SaveButton,     is_authorized && !ta->NtpState);
+}
+
+static void on_permission_changed (GPermission *permission,
+                                   GParamSpec  *pspec,
+                                   gpointer     data)
+{
+    TimeAdmin *ua = (TimeAdmin *)data;
+    UpdatePermission(ua);
+}
+
+static void InitMainWindow(TimeAdmin *ta)
+{
+    GError     *error = NULL;
+    GtkBuilder *builder;
+
+    builder = gtk_builder_new_from_resource ("/org/mate/mcc/ta/time-admin.ui");
+    gtk_builder_add_callback_symbols (builder,
+                                      "on_window_quit",       G_CALLBACK (on_window_quit),
+                                      "on_button1_clicked",   G_CALLBACK (RunTimeZoneDialog),
+                                      "on_button2_clicked",   G_CALLBACK (SaveModifyTime),
+                                      "on_button3_clicked",   G_CALLBACK (CloseWindow),
+                                      "on_spin1_changed",     G_CALLBACK (ChangeTimeValue),
+                                      "on_spin2_changed",     G_CALLBACK (ChangeTimeValue),
+                                      "on_spin3_changed",     G_CALLBACK (ChangeTimeValue),
+                                      "on_switch1_state_set", G_CALLBACK (ChangeNtpSync),
+                                      NULL);
+    gtk_builder_connect_signals (builder, ta);
+    ta->MainWindow = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
+    ta->HourSpin = GTK_WIDGET (gtk_builder_get_object (builder, "spin1"));
+    ta->MinuteSpin = GTK_WIDGET (gtk_builder_get_object (builder, "spin2"));
+    ta->SecondSpin = GTK_WIDGET (gtk_builder_get_object (builder, "spin3"));
+    ta->TimeZoneButton = GTK_WIDGET (gtk_builder_get_object (builder, "button1"));
+    ta->TimeZoneEntry = GTK_WIDGET (gtk_builder_get_object (builder, "entry1"));
+    ta->NtpSyncSwitch = GTK_WIDGET (gtk_builder_get_object (builder, "switch1"));
+    ta->Calendar = GTK_WIDGET (gtk_builder_get_object (builder, "calendar1"));
+    ta->SaveButton = GTK_WIDGET (gtk_builder_get_object (builder, "button2"));
+    ta->ButtonLock = GTK_WIDGET (gtk_builder_get_object (builder, "button4"));
+    g_object_unref (builder);
+
+    /* Make sure that every window gets an icon */
+    gtk_window_set_default_icon_name ("preferences-system-time");
+
+    ta->Permission = polkit_permission_new_sync (TIME_ADMIN_PERMISSION, NULL, NULL, &error);
+    if (ta->Permission == NULL)
+    {
+        g_warning ("Failed to acquire %s: %s", TIME_ADMIN_PERMISSION, error->message);
+        g_error_free (error);
+    }
+    gtk_lock_button_set_permission(GTK_LOCK_BUTTON (ta->ButtonLock),ta->Permission);
+    g_signal_connect(ta->Permission, "notify", G_CALLBACK (on_permission_changed), ta);
+
+    /* NTP sync switch */
+    ta->NtpState = GetNtpState(ta);
+    gtk_switch_set_state (GTK_SWITCH(ta->NtpSyncSwitch), ta->NtpState);
+
+    /* Time zone */
+    SetupTimezoneDialog(ta);
+    const char *TimeZone = GetTimeZone(ta);
+    char       *ZoneName = translate(TimeZone);
+    gtk_entry_set_text (GTK_ENTRY (ta->TimeZoneEntry), ZoneName);
+    g_free (ZoneName);
+
+    /* Local time & date */
+    /* time */
+    struct tm *LocalTime = GetCurrentTime();
+    ta->UpdateTimeId     = 0;
+    ta->ApplyId          = 0;
+    ta_refresh_time (ta, LocalTime);
+    /* date */
+    ta_refresh_date (ta, LocalTime);
+
+    Update_Clock_Start(ta);
+}
+
+static int RecordPid(void)
+{
+    int pid = 0;
+    int fd;
+    int Length = 0;
+    char WriteBuf[30] = { 0 };
+
+    fd = open(LOCKFILE,O_WRONLY|O_CREAT|O_TRUNC,0777);
+    if(fd < 0)
+    {
+         ErrorMessage (_("open file"), _("Create pid file failed"));
+         return -1;
+    }
+    chmod(LOCKFILE,0777);
+    pid = getpid();
+    sprintf(WriteBuf,"%d",pid);
+    Length = write(fd,WriteBuf,strlen(WriteBuf));
+    if(Length <= 0 )
+    {
+        ErrorMessage (_("write file"), _("write pid file failed"));
+        return -1;
+    }
+    close(fd);
+
+    return 0;
+}
+
+/******************************************************************************
+* Function:              ProcessRuning
+*
+* Explain: Check whether the process has been started,If the process is not started,
+*          record the current process ID =====>"/tmp/user-admin.pid"
+*
+* Input:
+*
+*
+* Output:  start        :TRUE
+*          not start    :FALSE
+*
+* Author:  zhuyaliang  31/07/2018
+******************************************************************************/
+static gboolean ProcessRuning(void)
+{
+    int fd;
+    int pid = 0;
+    gboolean Run = FALSE;
+    char ReadBuf[30] = { 0 };
+
+    if(access(LOCKFILE,F_OK) == 0)
+    {
+        fd = open(LOCKFILE,O_RDONLY);
+        if(fd < 0)
+        {
+             ErrorMessage (_("open file"), _("open pid file failed"));
+             return TRUE;
+        }
+        if(read(fd,ReadBuf,sizeof(ReadBuf)) <= 0)
+        {
+             ErrorMessage (_("read file"), _("read pid file failed"));
+             goto ERROREXIT;
+        }
+        pid = atoi(ReadBuf);
+        if(kill(pid,0) == 0)
+        {
+             goto ERROREXIT;
+        }
+    }
+
+    if(RecordPid() < 0)
+        Run = TRUE;
+
+    return Run;
+ERROREXIT:
+    close(fd);
+    return TRUE;
+}
+
+static gboolean InitDbusProxy(TimeAdmin *ta)
+{
+    GError *error = NULL;
+
+    ta->Connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
+    if(ta->Connection == NULL)
+    {
+        ErrorMessage ("g_bus_get_sync", error->message);
+        goto EXIT;
+    }
+    ta->proxy = g_dbus_proxy_new_sync (ta->Connection,
+                                       G_DBUS_PROXY_FLAGS_NONE,
+                                       NULL,
+                                      "org.freedesktop.timedate1",
+                                      "/org/freedesktop/timedate1",
+                                      "org.freedesktop.timedate1",
+                                       NULL,
+                                      &error);
+    if(ta->proxy == NULL)
+    {
+        ErrorMessage ("g_bus_proxy_new", error->message);
+        goto EXIT;
+    }
+
+    return TRUE;
+EXIT:
+    g_error_free(error);
+    return FALSE;
+}
+
+int main(int argc, char **argv)
+{
+    TimeAdmin ta;
+
+    capplet_init (NULL, &argc, &argv);
+
+    /* Check whether the process has been started */
+    if(ProcessRuning() == TRUE)
+        exit(0);
+    if(InitDbusProxy(&ta) == FALSE)
+        exit(0);
+
+    /* Create the main window */
+    InitMainWindow(&ta);
+
+    UpdatePermission(&ta);
+    gtk_widget_show_all(ta.MainWindow);
+    gtk_main();
+
+    return TRUE;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/85.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/85.html new file mode 100644 index 00000000..4e5682e0 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/85.html @@ -0,0 +1,375 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/*   time-admin
+*   Copyright (C) 2018  zhuyaliang https://github.com/zhuyaliang/
+*
+*   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 3 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, see <https://www.gnu.org/licenses/>.
+*/
+
+#ifndef __TIME_SHARE_H__
+#define __TIME_SHARE_H__
+
+#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 <sys/stat.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <fcntl.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 <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 <time.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/time.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.
+
+extern int TimeoutFlag;
+typedef struct
+{
+    GtkWidget        *MainWindow;
+    GtkWidget        *HourSpin;
+    GtkWidget        *MinuteSpin;
+    GtkWidget        *SecondSpin;
+    GtkWidget        *TimeZoneButton;
+    GtkWidget        *TimeZoneEntry;
+    GtkWidget        *NtpSyncSwitch;
+    GtkWidget        *Calendar;
+    GtkWidget        *SaveButton;
+    int               UpdateTimeId;
+    int               ApplyId;
+    gboolean          NtpState;
+    GDBusConnection  *Connection;
+    GDBusProxy       *proxy;
+    GtkWidget        *dialog;
+    GtkWidget        *TZconfire;
+    GtkWidget        *TZclose;
+    GtkWidget        *TimezoneEntry;
+    GtkWidget        *SearchBar;
+    GtkWidget        *map;
+    GtkListStore     *CityListStore;
+    GtkTreeModelSort *CityModelSort;
+    GtkWidget        *ButtonLock;
+    GPermission      *Permission;
+
+}TimeAdmin;
+
+int          ErrorMessage                (const char  *Title,
+                                          const char  *Msg);
+
+void         SetTooltip                  (GtkWidget   *box,
+                                          gboolean     mode);
+#endif
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/86.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/86.html new file mode 100644 index 00000000..f723ec2a --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/86.html @@ -0,0 +1,405 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/*
+ * Copyright (C) 2010 Intel, Inc
+ * Copyright (C) 2010-2018 The GNOME Project
+ * Copyright (C) 2018, 2019 zhuyaliang https://github.com/zhuyaliang/
+ * Copyright (C) 2019-2021 MATE Developers
+ *
+ * Portions from Ubiquity, Copyright (C) 2009 Canonical Ltd.
+ * Written by Evan Dandrea <evand@ubuntu.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 3 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, see <https://www.gnu.org/licenses/>.
+ *
+ * Author: Thomas Wood <thomas.wood@intel.com>
+ *
+ */
+
+#ifndef __TIME_ZONE_H__
+#define __TIME_ZONE_H__
+
+#include "time-share.h"
+
+#ifndef __sun
+#  define TZ_DATA_FILE "/usr/share/zoneinfo/zone.tab"
+#else
+#  define TZ_DATA_FILE "/usr/share/lib/zoneinfo/tab/zone_sun.tab"
+#endif
+
+typedef struct TzDB
+{
+    GPtrArray  *locations;
+    GHashTable *backward;
+}TzDB;
+
+typedef struct TzLocation
+{
+    gchar *country;
+    gdouble latitude;
+    gdouble longitude;
+    gchar *zone;
+    gchar *comment;
+
+    gdouble dist; /* distance to clicked point for comparison */
+}TzLocation;
+
+typedef struct TzInfo
+{
+    gchar *tzname_normal;
+    gchar *tzname_daylight;
+    glong utc_offset;
+    gint daylight;
+}TzInfo;
+TzDB      *tz_load_db                 (void);
+
+void       SetupTimezoneDialog        (TimeAdmin *ta);
+
+void       RunTimeZoneDialog          (GtkButton *button,
+                                       gpointer   data);
+
+void       TimeZoneDateBaseFree       (TzDB      *db);
+
+GPtrArray *tz_get_locations           (TzDB *db);
+
+TzInfo    *tz_info_from_location      (TzLocation *loc);
+
+glong      tz_location_get_utc_offset (TzLocation *loc);
+
+char      *tz_info_get_clean_name     (TzDB       *tz_db,
+                                       const char *tz);
+
+void       tz_info_free               (TzInfo     *tzinfo);
+
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (TzInfo, tz_info_free)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_AUTOPTR_CLEANUP_FUNC is a macro then please configure it.
+
+#endif
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/87.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/87.html new file mode 100644 index 00000000..07e2b429 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/87.html @@ -0,0 +1,969 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
#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.time_admin"), aligned (8)))
+#else
+# define SECTION
+#endif
+
+static const SECTION union { const guint8 data[2545]; const double alignment; void * const ptr;}  time_admin_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, 0310, 0000, 0000, 0000, 0000, 0000, 0000, 0050, 0006, 0000, 0000, 0000, 
+  0000, 0000, 0000, 0000, 0001, 0000, 0000, 0000, 0002, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 
+  0003, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 0030, 0246, 0324, 0173, 0005, 0000, 0000, 0000, 
+  0310, 0000, 0000, 0000, 0015, 0000, 0166, 0000, 0330, 0000, 0000, 0000, 0303, 0011, 0000, 0000, 
+  0113, 0120, 0220, 0013, 0002, 0000, 0000, 0000, 0303, 0011, 0000, 0000, 0004, 0000, 0114, 0000, 
+  0310, 0011, 0000, 0000, 0314, 0011, 0000, 0000, 0324, 0265, 0002, 0000, 0377, 0377, 0377, 0377, 
+  0314, 0011, 0000, 0000, 0001, 0000, 0114, 0000, 0320, 0011, 0000, 0000, 0324, 0011, 0000, 0000, 
+  0201, 0321, 0040, 0031, 0001, 0000, 0000, 0000, 0324, 0011, 0000, 0000, 0005, 0000, 0114, 0000, 
+  0334, 0011, 0000, 0000, 0340, 0011, 0000, 0000, 0143, 0041, 0175, 0170, 0003, 0000, 0000, 0000, 
+  0340, 0011, 0000, 0000, 0004, 0000, 0114, 0000, 0344, 0011, 0000, 0000, 0350, 0011, 0000, 0000, 
+  0247, 0304, 0255, 0025, 0004, 0000, 0000, 0000, 0350, 0011, 0000, 0000, 0003, 0000, 0114, 0000, 
+  0354, 0011, 0000, 0000, 0360, 0011, 0000, 0000, 0164, 0151, 0155, 0145, 0055, 0141, 0144, 0155, 
+  0151, 0156, 0056, 0165, 0151, 0000, 0000, 0000, 0105, 0116, 0000, 0000, 0001, 0000, 0000, 0000, 
+  0170, 0332, 0355, 0034, 0135, 0163, 0332, 0270, 0366, 0235, 0137, 0241, 0365, 0323, 0356, 0154, 
+  0034, 0300, 0154, 0073, 0275, 0267, 0011, 0073, 0044, 0233, 0164, 0063, 0223, 0246, 0231, 0100, 
+  0246, 0323, 0047, 0217, 0260, 0005, 0250, 0021, 0222, 0127, 0222, 0103, 0330, 0137, 0177, 0217, 
+  0154, 0047, 0100, 0020, 0370, 0003, 0222, 0222, 0136, 0236, 0260, 0261, 0316, 0321, 0371, 0326, 
+  0071, 0107, 0262, 0217, 0376, 0174, 0030, 0063, 0164, 0117, 0244, 0242, 0202, 0037, 0073, 0315, 
+  0303, 0206, 0203, 0010, 0017, 0104, 0110, 0371, 0360, 0330, 0271, 0355, 0235, 0273, 0037, 0234, 
+  0077, 0333, 0265, 0243, 0137, 0134, 0027, 0175, 0042, 0234, 0110, 0254, 0111, 0210, 0046, 0124, 
+  0217, 0320, 0220, 0341, 0220, 0240, 0326, 0241, 0347, 0035, 0066, 0152, 0065, 0115, 0307, 0304, 
+  0305, 0341, 0230, 0362, 0303, 0230, 0042, 0027, 0175, 0356, 0364, 0316, 0320, 0354, 0117, 0024, 
+  0122, 0314, 0304, 0260, 0166, 0052, 0242, 0251, 0244, 0303, 0221, 0106, 0277, 0236, 0376, 0226, 
+  0016, 0372, 0213, 0334, 0023, 0046, 0042, 0040, 0241, 0126, 0353, 0215, 0250, 0102, 0221, 0024, 
+  0103, 0211, 0307, 0010, 0056, 0007, 0222, 0020, 0244, 0304, 0100, 0117, 0260, 0044, 0037, 0321, 
+  0124, 0304, 0050, 0300, 0034, 0111, 0022, 0122, 0245, 0045, 0355, 0307, 0232, 0040, 0252, 0021, 
+  0346, 0141, 0135, 0310, 0332, 0030, 0310, 0036, 0114, 0315, 0037, 0061, 0017, 0211, 0104, 0172, 
+  0104, 0220, 0046, 0162, 0254, 0220, 0030, 0044, 0067, 0237, 0256, 0156, 0063, 0056, 0030, 0272, 
+  0216, 0373, 0214, 0006, 0350, 0222, 0006, 0204, 0053, 0122, 0303, 0060, 0257, 0371, 0107, 0215, 
+  0200, 0277, 0376, 0064, 0031, 0176, 0156, 0146, 0357, 0146, 0263, 0243, 0163, 0001, 0130, 0261, 
+  0006, 0071, 0175, 0104, 0004, 0004, 0000, 0023, 0144, 0162, 0103, 0136, 0055, 0233, 0040, 0303, 
+  0166, 0200, 0204, 0104, 0277, 0142, 0155, 0010, 0226, 0110, 0104, 0006, 0350, 0067, 0240, 0162, 
+  0212, 0030, 0310, 0357, 0011, 0356, 0160, 0231, 0341, 0031, 0137, 0041, 0002, 0251, 0031, 0234, 
+  0043, 0220, 0015, 0134, 0000, 0066, 0140, 0154, 0102, 0031, 0103, 0175, 0202, 0142, 0105, 0006, 
+  0061, 0073, 0250, 0301, 0110, 0364, 0365, 0242, 0367, 0367, 0227, 0333, 0036, 0352, 0134, 0175, 
+  0103, 0137, 0073, 0067, 0067, 0235, 0253, 0336, 0267, 0217, 0211, 0216, 0004, 0074, 0005, 0351, 
+  0246, 0170, 0350, 0070, 0142, 0324, 0050, 0017, 0113, 0211, 0271, 0236, 0202, 0120, 0152, 0237, 
+  0317, 0156, 0116, 0377, 0206, 0361, 0235, 0223, 0213, 0313, 0213, 0336, 0067, 0103, 0366, 0371, 
+  0105, 0357, 0352, 0254, 0333, 0105, 0347, 0137, 0156, 0120, 0007, 0135, 0167, 0156, 0172, 0027, 
+  0247, 0267, 0227, 0235, 0033, 0164, 0175, 0173, 0163, 0375, 0245, 0173, 0166, 0210, 0120, 0227, 
+  0030, 0202, 0110, 0155, 0265, 0070, 0321, 0000, 0060, 0215, 0005, 0110, 0055, 0044, 0032, 0123, 
+  0246, 0200, 0325, 0157, 0240, 0074, 0005, 0044, 0261, 0020, 0215, 0360, 0075, 0001, 0045, 0006, 
+  0204, 0336, 0003, 0101, 0030, 0005, 0140, 0025, 0105, 0164, 0304, 0004, 0037, 0246, 0306, 0247, 
+  0347, 0344, 0366, 0021, 0321, 0001, 0342, 0102, 0037, 0240, 0211, 0244, 0140, 0020, 0132, 0054, 
+  0153, 0257, 0066, 0323, 0336, 0001, 0272, 0340, 0301, 0341, 0001, 0172, 0327, 0204, 0041, 0230, 
+  0337, 0061, 0220, 0163, 0127, 0303, 0140, 0100, 0160, 0116, 0007, 0200, 0374, 0234, 0011, 0041, 
+  0017, 0320, 0211, 0120, 0332, 0014, 0377, 0334, 0101, 0250, 0341, 0065, 0233, 0015, 0267, 0331, 
+  0152, 0064, 0017, 0320, 0155, 0267, 0003, 0354, 0164, 0142, 0220, 0257, 0374, 0057, 0272, 0021, 
+  0175, 0042, 0065, 0072, 0211, 0277, 0327, 0152, 0256, 0013, 0256, 0102, 0071, 0250, 0170, 0200, 
+  0003, 0322, 0256, 0041, 0164, 0044, 0311, 0077, 0061, 0225, 0104, 0041, 0106, 0373, 0307, 0316, 
+  0120, 0337, 0375, 0356, 0314, 0334, 0315, 0070, 0217, 0123, 0117, 0306, 0031, 0007, 0173, 0202, 
+  0164, 0131, 0312, 0261, 0253, 0247, 0240, 0373, 0141, 0304, 0356, 0075, 0144, 0160, 0057, 0215, 
+  0343, 0170, 0114, 0320, 0063, 0327, 0263, 0215, 0013, 0211, 0012, 0044, 0115, 0354, 0160, 0205, 
+  0147, 0332, 0341, 0202, 0047, 0167, 0175, 0346, 0252, 0366, 0341, 0070, 0221, 0211, 0232, 0223, 
+  0311, 0343, 0070, 0321, 0377, 0116, 0002, 0215, 0002, 0206, 0225, 0072, 0166, 0076, 0351, 0273, 
+  0116, 0370, 0075, 0126, 0172, 0114, 0270, 0166, 0020, 0015, 0217, 0035, 0374, 0164, 0337, 0164, 
+  0014, 0004, 0300, 0200, 0172, 0141, 0052, 0060, 0124, 0303, 0345, 0261, 0023, 0107, 0160, 0347, 
+  0264, 0275, 0326, 0121, 0375, 0361, 0211, 0175, 0240, 0322, 0044, 0362, 0051, 0017, 0044, 0111, 
+  0320, 0267, 0233, 0171, 0000, 0021, 0036, 0222, 0005, 0200, 0306, 0042, 0304, 0121, 0075, 0045, 
+  0277, 0054, 0047, 0336, 0172, 0116, 0336, 0375, 0347, 0315, 0160, 0322, 0172, 0143, 0234, 0134, 
+  0214, 0001, 0074, 0145, 0102, 0101, 0254, 0361, 0041, 0114, 0202, 0053, 0373, 0164, 0074, 0134, 
+  0301, 0310, 0075, 0125, 0264, 0317, 0210, 0323, 0356, 0311, 0230, 0344, 0321, 0006, 0113, 0220, 
+  0077, 0020, 0101, 0254, 0234, 0366, 0071, 0146, 0052, 0167, 0074, 0015, 0140, 0156, 0163, 0351, 
+  0264, 0103, 0000, 0063, 0014, 0271, 0206, 0254, 0212, 0034, 0115, 0050, 0017, 0305, 0304, 0017, 
+  0230, 0120, 0073, 0304, 0131, 0112, 0225, 0233, 0120, 0125, 0312, 0350, 0042, 0130, 0226, 0202, 
+  0044, 0062, 0177, 0115, 0120, 0314, 0063, 0271, 0052, 0026, 0224, 0245, 0123, 0123, 0015, 0042, 
+  0100, 0032, 0342, 0275, 0202, 0045, 0030, 0203, 0100, 0216, 0235, 0051, 0001, 0360, 0036, 0004, 
+  0102, 0223, 0077, 0240, 0277, 0140, 0145, 0106, 0237, 0061, 0007, 0061, 0313, 0074, 0164, 0020, 
+  0317, 0351, 0277, 0070, 0221, 0152, 0241, 0351, 0063, 0215, 0105, 0102, 0121, 0303, 0247, 0323, 
+  0206, 0350, 0256, 0363, 0247, 0231, 0223, 0156, 0044, 0311, 0200, 0110, 0310, 0314, 0210, 0162, 
+  0325, 0024, 0274, 0151, 0354, 0232, 0020, 0276, 0204, 0101, 0321, 0041, 0207, 0205, 0063, 0205, 
+  0017, 0011, 0043, 0232, 0270, 0046, 0003, 0000, 0217, 0036, 0001, 0227, 0214, 0310, 0143, 0007, 
+  0220, 0146, 0004, 0301, 0322, 0004, 0017, 0324, 0004, 0203, 0033, 0203, 0314, 0271, 0110, 0027, 
+  0043, 0300, 0023, 0214, 0050, 0013, 0323, 0153, 0233, 0322, 0116, 0304, 0103, 0252, 0246, 0276, 
+  0170, 0170, 0324, 0121, 0151, 0343, 0253, 0242, 0130, 0033, 0214, 0220, 0024, 0030, 0304, 0251, 
+  0144, 0141, 0155, 0325, 0140, 0116, 0314, 0012, 0270, 0300, 0225, 0235, 0063, 0110, 0011, 0214, 
+  0274, 0347, 0306, 0124, 0340, 0252, 0052, 0147, 0066, 0270, 0061, 0226, 0103, 0312, 0175, 0245, 
+  0261, 0064, 0141, 0320, 0053, 0011, 0107, 0170, 0130, 0001, 0112, 0213, 0250, 0002, 0124, 0137, 
+  0100, 0054, 0032, 0073, 0355, 0367, 0105, 0341, 0030, 0356, 0023, 0346, 0077, 0140, 0006, 0126, 
+  0353, 0264, 0033, 0105, 0301, 0324, 0010, 0033, 0353, 0065, 0311, 0221, 0323, 0346, 0202, 0257, 
+  0226, 0345, 0222, 0302, 0355, 0112, 0357, 0030, 0002, 0322, 0165, 0346, 0331, 0330, 0212, 0312, 
+  0337, 0304, 0000, 0362, 0215, 0340, 0175, 0005, 0320, 0304, 0016, 0112, 0001, 0062, 0062, 0320, 
+  0176, 0204, 0103, 0123, 0012, 0256, 0063, 0206, 0325, 0202, 0266, 0013, 0373, 0223, 0244, 0241, 
+  0143, 0033, 0272, 0201, 0254, 0067, 0225, 0267, 0065, 0310, 0203, 0211, 0251, 0010, 0007, 0011, 
+  0373, 0357, 0113, 0317, 0056, 0130, 0074, 0346, 0063, 0004, 0353, 0345, 0267, 0136, 0206, 0166, 
+  0071, 0136, 0032, 0347, 0311, 0022, 0265, 0146, 0163, 0352, 0052, 0050, 0214, 0202, 0221, 0233, 
+  0370, 0224, 0263, 0012, 0315, 0206, 0062, 0336, 0206, 0234, 0155, 0070, 0106, 0131, 0010, 0000, 
+  0053, 0255, 0002, 0236, 0362, 0154, 0133, 0336, 0257, 0172, 0327, 0110, 0115, 0171, 0220, 0217, 
+  0165, 0076, 0113, 0261, 0317, 0211, 0203, 0073, 0120, 0145, 0011, 0252, 0214, 0003, 0141, 0255, 
+  0161, 0060, 0132, 0023, 0334, 0326, 0141, 0200, 0060, 0134, 0006, 0001, 0214, 0130, 0107, 0343, 
+  0121, 0175, 0215, 0205, 0225, 0265, 0276, 0156, 0142, 0155, 0131, 0212, 0235, 0134, 0067, 0177, 
+  0220, 0321, 0125, 0105, 0361, 0150, 0163, 0111, 0120, 0055, 0204, 0140, 0041, 0271, 0002, 0060, 
+  0310, 0255, 0024, 0171, 0226, 0131, 0145, 0262, 0360, 0223, 0307, 0176, 0362, 0330, 0222, 0137, 
+  0131, 0321, 0343, 0000, 0262, 0073, 0220, 0013, 0145, 0164, 0035, 0031, 0111, 0123, 0201, 0045, 
+  0351, 0016, 0062, 0113, 0140, 0146, 0376, 0214, 0204, 0156, 0177, 0012, 0116, 0000, 0361, 0236, 
+  0150, 0133, 0114, 0130, 0067, 0167, 0275, 0320, 0344, 0057, 0354, 0043, 0315, 0237, 0314, 0107, 
+  0056, 0367, 0241, 0370, 0171, 0245, 0365, 0357, 0232, 0154, 0355, 0355, 0304, 0342, 0346, 0156, 
+  0331, 0231, 0251, 0306, 0336, 0230, 0225, 0025, 0117, 0254, 0362, 0005, 0142, 0027, 0312, 0031, 
+  0327, 0162, 0232, 0256, 0117, 0304, 0134, 0256, 0133, 0236, 0266, 0042, 0046, 0053, 0233, 0204, 
+  0233, 0222, 0377, 0236, 0224, 0020, 0325, 0266, 0104, 0156, 0165, 0156, 0362, 0020, 0141, 0123, 
+  0011, 0154, 0302, 0024, 0011, 0251, 0136, 0323, 0374, 0050, 0212, 0146, 0214, 0037, 0374, 0011, 
+  0015, 0365, 0310, 0017, 0106, 0130, 0002, 0147, 0336, 0273, 0352, 0342, 0211, 0224, 0317, 0104, 
+  0160, 0347, 0117, 0260, 0344, 0211, 0135, 0225, 0040, 0055, 0057, 0332, 0024, 0213, 0070, 0126, 
+  0111, 0145, 0322, 0336, 0110, 0116, 0003, 0312, 0330, 0146, 0012, 0233, 0365, 0235, 0032, 0105, 
+  0045, 0222, 0037, 0140, 0353, 0071, 0076, 0131, 0305, 0147, 0117, 0222, 0146, 0146, 0326, 0131, 
+  0112, 0256, 0313, 0172, 0155, 0126, 0375, 0014, 0365, 0235, 0153, 0314, 0264, 0252, 0304, 0266, 
+  0342, 0374, 0025, 0162, 0124, 0173, 0263, 0061, 0331, 0047, 0123, 0176, 0110, 0006, 0070, 0146, 
+  0172, 0063, 0154, 0261, 0202, 0254, 0124, 0203, 0253, 0154, 0206, 0006, 0263, 0011, 0236, 0052, 
+  0137, 0215, 0240, 0110, 0246, 0111, 0153, 0272, 0034, 0272, 0205, 0124, 0072, 0140, 0064, 0270, 
+  0043, 0341, 0142, 0042, 0235, 0351, 0337, 0177, 0172, 0130, 0060, 0215, 0056, 0227, 0112, 0147, 
+  0243, 0223, 0144, 0072, 0375, 0361, 0347, 0150, 0262, 0346, 0061, 0247, 0346, 0111, 0262, 0303, 
+  0230, 0222, 0150, 0366, 0033, 0215, 0255, 0045, 0173, 0152, 0111, 0202, 0163, 0150, 0322, 0151, 
+  0203, 0053, 0167, 0346, 0042, 0211, 0174, 0266, 0172, 0345, 0261, 0134, 0057, 0136, 0076, 0374, 
+  0377, 0304, 0273, 0346, 0153, 0305, 0273, 0135, 0257, 0214, 0136, 0064, 0143, 0135, 0315, 0374, 
+  0012, 0040, 0073, 0200, 0165, 0160, 0272, 0214, 0314, 0373, 0207, 0223, 0337, 0317, 0135, 0125, 
+  0170, 0355, 0104, 0057, 0167, 0165, 0205, 0164, 0075, 0333, 0344, 0131, 0213, 0020, 0224, 0232, 
+  0236, 0021, 0121, 0126, 0155, 0074, 0075, 0176, 0334, 0175, 0042, 0146, 0007, 0337, 0101, 0367, 
+  0230, 0305, 0304, 0154, 0331, 0260, 0320, 0026, 0115, 0040, 0202, 0254, 0304, 0133, 0130, 0141, 
+  0266, 0201, 0166, 0333, 0257, 0024, 0073, 0312, 0307, 0212, 0322, 0271, 0220, 0305, 0015, 0226, 
+  0370, 0334, 0157, 0044, 0225, 0332, 0110, 0172, 0277, 0337, 0107, 0332, 0357, 0043, 0155, 0175, 
+  0037, 0151, 0165, 0327, 0143, 0247, 0266, 0221, 0012, 0071, 0302, 0246, 0016, 0221, 0333, 0146, 
+  0051, 0260, 0375, 0364, 0274, 0125, 0040, 0306, 0142, 0110, 0070, 0021, 0105, 0353, 0227, 0322, 
+  0073, 0010, 0021, 0345, 0363, 0005, 0237, 0202, 0373, 0127, 0335, 0103, 0230, 0065, 0147, 0120, 
+  0237, 0362, 0320, 0125, 0042, 0226, 0001, 0171, 0254, 0074, 0275, 0354, 0337, 0107, 0240, 0152, 
+  0315, 0234, 0027, 0330, 0267, 0060, 0175, 0023, 0106, 0370, 0120, 0103, 0132, 0347, 0125, 0243, 
+  0241, 0172, 0267, 0144, 0351, 0210, 0012, 0217, 0142, 0360, 0356, 0130, 0302, 0272, 0152, 0216, 
+  0067, 0321, 0041, 0325, 0252, 0012, 0242, 0331, 0131, 0063, 0247, 0075, 0167, 0026, 0260, 0374, 
+  0276, 0114, 0000, 0105, 0344, 0360, 0171, 0061, 0231, 0330, 0226, 0377, 0364, 0250, 0120, 0051, 
+  0271, 0375, 0224, 0276, 0164, 0171, 0264, 0131, 0151, 0264, 0121, 0033, 0350, 0125, 0367, 0022, 
+  0055, 0221, 0300, 0333, 0107, 0202, 0175, 0044, 0230, 0213, 0004, 0336, 0026, 0043, 0201, 0267, 
+  0217, 0004, 0045, 0032, 0044, 0077, 0072, 0022, 0264, 0366, 0221, 0340, 0155, 0105, 0202, 0344, 
+  0265, 0014, 0242, 0024, 0004, 0003, 0226, 0164, 0233, 0111, 0124, 0261, 0203, 0365, 0302, 0061, 
+  0245, 0265, 0305, 0230, 0322, 0332, 0307, 0224, 0307, 0230, 0342, 0355, 0173, 0215, 0273, 0337, 
+  0153, 0354, 0131, 0116, 0217, 0357, 0233, 0214, 0133, 0157, 0062, 0066, 0367, 0115, 0306, 0135, 
+  0153, 0062, 0356, 0233, 0205, 0073, 0334, 0054, 0054, 0334, 0055, 0173, 0255, 0056, 0343, 0051, 
+  0206, 0274, 0052, 0304, 0062, 0315, 0107, 0203, 0354, 0256, 0371, 0032, 0235, 0307, 0227, 0316, 
+  0105, 0067, 0314, 0103, 0237, 0203, 0117, 0011, 0066, 0257, 0147, 0066, 0274, 0106, 0351, 0056, 
+  0247, 0340, 0046, 0161, 0175, 0127, 0026, 0056, 0304, 0123, 0063, 0341, 0172, 0260, 0175, 0302, 
+  0260, 0235, 0204, 0301, 0274, 0037, 0267, 0117, 0030, 0136, 0074, 0141, 0360, 0136, 0066, 0141, 
+  0110, 0213, 0353, 0345, 0255, 0223, 0037, 0232, 0064, 0024, 0070, 0162, 0234, 0223, 0147, 0174, 
+  0250, 0224, 0147, 0174, 0250, 0364, 0126, 0334, 0207, 0212, 0273, 0231, 0305, 0001, 0013, 0354, 
+  0332, 0054, 0373, 0355, 0124, 0100, 0251, 0254, 0364, 0324, 0050, 0155, 0235, 0040, 0013, 0146, 
+  0047, 0227, 0042, 0260, 0034, 0307, 0373, 0343, 0225, 0342, 0126, 0131, 0320, 0242, 0346, 0260, 
+  0172, 0071, 0130, 0135, 0157, 0257, 0012, 0011, 0145, 0151, 0054, 0126, 0136, 0127, 0152, 0332, 
+  0257, 0050, 0247, 0327, 0254, 0131, 0371, 0006, 0260, 0254, 0174, 0133, 0113, 0076, 0377, 0244, 
+  0135, 0265, 0323, 0165, 0002, 0231, 0027, 0344, 0223, 0123, 0166, 0052, 0042, 0001, 0035, 0230, 
+  0057, 0227, 0204, 0346, 0025, 0155, 0363, 0256, 0266, 0071, 0151, 0267, 0346, 0220, 0135, 0356, 
+  0131, 0270, 0342, 0253, 0236, 0337, 0135, 0172, 0117, 0177, 0367, 0254, 0277, 0374, 0011, 0321, 
+  0245, 0106, 0133, 0172, 0204, 0363, 0331, 0267, 0022, 0312, 0140, 0060, 0347, 0112, 0223, 0257, 
+  0356, 0060, 0312, 0213, 0160, 0137, 0364, 0000, 0250, 0127, 0360, 0000, 0350, 0333, 0365, 0353, 
+  0346, 0217, 0366, 0353, 0226, 0263, 0221, 0207, 0234, 0056, 0177, 0361, 0341, 0047, 0166, 0221, 
+  0025, 0037, 0337, 0330, 0005, 0127, 0151, 0375, 0364, 0256, 0342, 0155, 0303, 0125, 0336, 0120, 
+  0061, 0320, 0252, 0132, 0014, 0054, 0362, 0270, 0360, 0160, 0241, 0146, 0115, 0276, 0213, 0322, 
+  0067, 0165, 0373, 0043, 0140, 0304, 0160, 0100, 0106, 0120, 0214, 0021, 0131, 0137, 0202, 0236, 
+  0241, 0075, 0252, 0317, 0175, 0346, 0352, 0177, 0314, 0140, 0035, 0134, 0000, 0050, 0165, 0165, 
+  0141, 0171, 0051, 0157, 0162, 0147, 0057, 0000, 0003, 0000, 0000, 0000, 0057, 0000, 0000, 0000, 
+  0001, 0000, 0000, 0000, 0155, 0141, 0164, 0145, 0057, 0000, 0000, 0000, 0004, 0000, 0000, 0000, 
+  0155, 0143, 0143, 0057, 0005, 0000, 0000, 0000, 0164, 0141, 0057, 0000, 0000, 0000, 0000, 0000
+} };
+
+static GStaticResource static_resource = { time_admin_resource_data.data, sizeof (time_admin_resource_data.data) - 1 /* nul terminator */, NULL, NULL, NULL };
+
+G_MODULE_EXPORT
+GResource *time_admin_get_resource (void);
+GResource *time_admin_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(time_adminresource_constructor)
+#endif
+G_DEFINE_CONSTRUCTOR(time_adminresource_constructor)
+#ifdef G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA
+#pragma G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(time_adminresource_destructor)
+#endif
+G_DEFINE_DESTRUCTOR(time_adminresource_destructor)
+
+#else
+#warning "Constructor not supported on this compiler, linking in resources will not work"
+#endif
+
+static void time_adminresource_constructor (void)
+{
+  g_static_resource_init (&static_resource);
+}
+
+static void time_adminresource_destructor (void)
+{
+  g_static_resource_fini (&static_resource);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/88.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/88.html new file mode 100644 index 00000000..aebd000d --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/88.html @@ -0,0 +1,1505 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * Copyright (C) 2010 Intel, Inc
+ * Copyright (C) 2010-2018 The GNOME Project
+ * Copyright (C) 2018, 2019 zhuyaliang https://github.com/zhuyaliang/
+ * Copyright (C) 2019-2021 MATE Developers
+ *
+ * Portions from Ubiquity, Copyright (C) 2009 Canonical Ltd.
+ * Written by Evan Dandrea <evand@ubuntu.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 3 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, see <https://www.gnu.org/licenses/>.
+ *
+ * Author: Thomas Wood <thomas.wood@intel.com>
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"<--- Include file: "config.h" not found.
+#endif
+#include "time-map.h"
+#include <math.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define PIN_HOT_POINT_X 8
+#define PIN_HOT_POINT_Y 15
+
+typedef struct
+{
+    gdouble offset;
+    guchar red;
+    guchar green;
+    guchar blue;
+    guchar alpha;
+}TimezoneMapOffset;
+enum
+{
+    LOCATION_CHANGED,
+    LAST_SIGNAL
+};
+
+G_DEFINE_TYPE (TimezoneMap, timezone_map, GTK_TYPE_WIDGET)
+static guint signals[LAST_SIGNAL];
+static TimezoneMapOffset color_codes[] =
+{
+    {-11.0, 43, 0, 0, 255 },
+    {-10.0, 85, 0, 0, 255 },
+    {-9.5, 102, 255, 0, 255 },
+    {-9.0, 128, 0, 0, 255 },
+    {-8.0, 170, 0, 0, 255 },
+    {-7.0, 212, 0, 0, 255 },
+    {-6.0, 255, 0, 1, 255 }, /* north */
+    {-6.0, 255, 0, 0, 255 }, /* south */
+    {-5.0, 255, 42, 42, 255 },
+    {-4.5, 192, 255, 0, 255 },
+    {-4.0, 255, 85, 85, 255 },
+    {-3.5, 0, 255, 0, 255 },
+    {-3.0, 255, 128, 128, 255 },
+    {-2.0, 255, 170, 170, 255 },
+    {-1.0, 255, 213, 213, 255 },
+    {0.0, 43, 17, 0, 255 },
+    {1.0, 85, 34, 0, 255 },
+    {2.0, 128, 51, 0, 255 },
+    {3.0, 170, 68, 0, 255 },
+    {3.5, 0, 255, 102, 255 },
+    {4.0, 212, 85, 0, 255 },
+    {4.5, 0, 204, 255, 255 },
+    {5.0, 255, 102, 0, 255 },
+    {5.5, 0, 102, 255, 255 },
+    {5.75, 0, 238, 207, 247 },
+    {6.0, 255, 127, 42, 255 },
+    {6.5, 204, 0, 254, 254 },
+    {7.0, 255, 153, 85, 255 },
+    {8.0, 255, 179, 128, 255 },
+    {9.0, 255, 204, 170, 255 },
+    {9.5, 170, 0, 68, 250 },
+    {10.0, 255, 230, 213, 255 },
+    {10.5, 212, 124, 21, 250 },
+    {11.0, 212, 170, 0, 255 },
+    {11.5, 249, 25, 87, 253 },
+    {12.0, 255, 204, 0, 255 },
+    {12.75, 254, 74, 100, 248 },
+    {13.0, 255, 85, 153, 250 },
+    {-100, 0, 0, 0, 0 }
+};
+static void
+cc_timezone_map_dispose (GObject *object)
+{
+    TimezoneMap *self = TIMEZONEMAP (object);
+
+    g_clear_object (&self->orig_background);
+    g_clear_object (&self->orig_background_dim);
+    g_clear_object (&self->orig_color_map);
+    g_clear_object (&self->background);
+    g_clear_object (&self->pin);
+    g_clear_pointer (&self->bubble_text, g_free);
+
+    if (self->color_map)
+    {
+        g_clear_object (&self->color_map);
+
+        self->visible_map_pixels = NULL;
+        self->visible_map_rowstride = 0;
+    }
+
+    G_OBJECT_CLASS (timezone_map_parent_class)->dispose (object);
+}
+static void
+timezone_map_finalize (GObject *object)
+{
+    TimezoneMap *self = TIMEZONEMAP (object);
+
+    g_clear_pointer (&self->tzdb, TimeZoneDateBaseFree);
+
+    G_OBJECT_CLASS (timezone_map_parent_class)->finalize (object);
+}
+static void
+cc_timezone_map_get_preferred_width (GtkWidget *widget,
+                                     gint      *minimum,
+                                     gint      *natural)
+{
+    TimezoneMap *map = TIMEZONEMAP (widget);
+    gint size;
+
+    size = gdk_pixbuf_get_width (map->orig_background);
+
+    if (minimum != NULL)
+        *minimum = size;
+    if (natural != NULL)
+        *natural = size;
+}
+
+static void
+cc_timezone_map_get_preferred_height (GtkWidget *widget,
+                                      gint      *minimum,
+                                      gint      *natural)
+{
+    TimezoneMap *map = TIMEZONEMAP (widget);
+    gint size;
+
+    size = gdk_pixbuf_get_height (map->orig_background);
+
+    if (minimum != NULL)
+        *minimum = size;
+    if (natural != NULL)
+        *natural = size;
+}
+static void
+cc_timezone_map_size_allocate (GtkWidget     *widget,
+                               GtkAllocation *allocation)
+{
+    TimezoneMap *map = TIMEZONEMAP (widget);
+    GdkPixbuf *pixbuf;
+
+    if (map->background)
+        g_object_unref (map->background);
+
+    if (!gtk_widget_is_sensitive (widget))
+        pixbuf = map->orig_background_dim;
+    else
+        pixbuf = map->orig_background;
+
+    map->background = gdk_pixbuf_scale_simple (pixbuf,
+                                               allocation->width,
+                                               allocation->height,
+                                               GDK_INTERP_BILINEAR);
+
+    if (map->color_map)
+        g_object_unref (map->color_map);
+
+    map->color_map = gdk_pixbuf_scale_simple (map->orig_color_map,
+                                              allocation->width,
+                                              allocation->height,
+                                              GDK_INTERP_BILINEAR);
+
+    map->visible_map_pixels = gdk_pixbuf_get_pixels (map->color_map);
+    map->visible_map_rowstride = gdk_pixbuf_get_rowstride (map->color_map);
+    GTK_WIDGET_CLASS (timezone_map_parent_class)->size_allocate (widget,
+                                                                 allocation);
+}
+
+static void
+cc_timezone_map_realize (GtkWidget *widget)
+{
+    GdkWindowAttr attr = { 0, };
+    GtkAllocation allocation;
+    GdkWindow *window;
+
+    gtk_widget_get_allocation (widget, &allocation);
+
+    gtk_widget_set_realized (widget, TRUE);
+
+    attr.window_type = GDK_WINDOW_CHILD;
+    attr.wclass = GDK_INPUT_OUTPUT;
+    attr.width = allocation.width;
+    attr.height = allocation.height;
+    attr.x = allocation.x;
+    attr.y = allocation.y;
+    attr.event_mask = gtk_widget_get_events (widget)
+                                 | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK;
+
+    window = gdk_window_new (gtk_widget_get_parent_window (widget), &attr,
+                             GDK_WA_X | GDK_WA_Y);
+
+    gdk_window_set_user_data (window, widget);
+    gtk_widget_set_window (widget, window);
+}
+static gdouble
+convert_longitude_to_x (gdouble longitude, gint map_width)
+{
+    const gdouble xdeg_offset = -6;
+    gdouble x;
+
+    x = (map_width * (180.0 + longitude) / 360.0)
+        + (map_width * xdeg_offset / 180.0);
+
+    return x;
+}
+
+static gdouble
+radians (gdouble degrees)
+{
+    return (degrees / 360.0) * G_PI * 2;
+}
+
+static gdouble
+convert_latitude_to_y (gdouble latitude, gdouble map_height)
+{
+    gdouble bottom_lat = -59;
+    gdouble top_lat = 81;
+    gdouble top_per, y, full_range, top_offset, map_range;
+
+    top_per = top_lat / 180.0;
+    y = 1.25 * log (tan (G_PI_4 + 0.4 * radians (latitude)));
+    full_range = 4.6068250867599998;
+    top_offset = full_range * top_per;
+    map_range = fabs (1.25 * log (tan (G_PI_4 + 0.4 * radians (bottom_lat))) - top_offset);
+    y = fabs (y - top_offset);
+    y = y / map_range;
+    y = y * map_height;
+    return y;
+}
+
+static void
+draw_text_bubble (cairo_t *cr,
+                  GtkWidget *widget,
+                  gdouble pointx,
+                  gdouble pointy)
+{
+    static const double corner_radius = 9.0;
+    static const double margin_top = 12.0;
+    static const double margin_bottom = 12.0;
+    static const double margin_left = 24.0;
+    static const double margin_right = 24.0;
+
+    TimezoneMap *map = TIMEZONEMAP (widget);
+    GtkAllocation alloc;
+    PangoLayout *layout;
+    PangoRectangle text_rect;
+    double x;
+    double y;
+    double width;
+    double height;
+
+    if (!map->bubble_text)
+        return;
+
+    gtk_widget_get_allocation (widget, &alloc);
+    layout = gtk_widget_create_pango_layout (widget, NULL);
+    /* Layout the text */
+    pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER);
+    pango_layout_set_spacing (layout, 3);
+    pango_layout_set_markup (layout, map->bubble_text, -1);
+
+    pango_layout_get_pixel_extents (layout, NULL, &text_rect);
+
+    /* Calculate the bubble size based on the text layout size */
+    width = text_rect.width + margin_left + margin_right;
+    height = text_rect.height + margin_top + margin_bottom;
+
+    if (pointx < alloc.width / 2)
+        x = pointx + 25;
+    else
+        x = pointx - width - 25;
+
+    y = pointy - height / 2;
+
+    /* Make sure it fits in the visible area */
+    x = CLAMP (x, 0, alloc.width - width);
+    y = CLAMP (y, 0, alloc.height - height);
+
+    cairo_save (cr);
+    cairo_translate (cr, x, y);
+
+    /* Draw the bubble */
+    cairo_new_sub_path (cr);
+    cairo_arc (cr, width - corner_radius, corner_radius, corner_radius, radians (-90), radians (0));
+    cairo_arc (cr, width - corner_radius, height - corner_radius, corner_radius, radians (0), radians (90));
+    cairo_arc (cr, corner_radius, height - corner_radius, corner_radius, radians (90), radians (180));
+    cairo_arc (cr, corner_radius, corner_radius, corner_radius, radians (180), radians (270));
+    cairo_close_path (cr);
+
+    cairo_set_source_rgba (cr, 0.2, 0.2, 0.2, 0.7);
+    cairo_fill (cr);
+
+    /* And finally draw the text */
+    cairo_set_source_rgb (cr, 1, 1, 1);
+    cairo_move_to (cr, margin_left, margin_top);
+    pango_cairo_show_layout (cr, layout);
+
+    g_object_unref (layout);
+    cairo_restore (cr);
+}
+
+static gboolean
+cc_timezone_map_draw (GtkWidget *widget,
+                      cairo_t   *cr)
+{
+    TimezoneMap *map = TIMEZONEMAP (widget);
+    g_autoptr(GdkPixbuf) orig_hilight = NULL;
+    GtkAllocation alloc;
+    g_autofree gchar *file = NULL;
+    g_autoptr(GError) err = NULL;
+    gdouble pointx, pointy;
+    char buf[16];
+
+    gtk_widget_get_allocation (widget, &alloc);
+
+    /* paint background */
+    gdk_cairo_set_source_pixbuf (cr, map->background, 0, 0);
+    cairo_paint (cr);
+
+    /* paint hilight */
+    if (gtk_widget_is_sensitive (widget))
+    {
+        file = g_strdup_printf (TIMPZONEDIR"timezone_%s.png",
+                                g_ascii_formatd (buf, sizeof (buf),
+                               "%g", map->selected_offset));
+    }
+    else
+    {
+        file = g_strdup_printf (TIMPZONEDIR"timezone_%s_dim.png",
+                                g_ascii_formatd (buf, sizeof (buf),
+                               "%g", map->selected_offset));
+    }
+
+    orig_hilight = gdk_pixbuf_new_from_file (file, &err);
+
+    if (!orig_hilight)
+    {
+        g_warning ("Could not load hilight: %s",
+                   (err) ? err->message : "Unknown Error");
+    }
+    else
+    {
+        g_autoptr(GdkPixbuf) hilight = NULL;
+
+        hilight = gdk_pixbuf_scale_simple (orig_hilight, alloc.width,
+                                           alloc.height, GDK_INTERP_BILINEAR);
+        gdk_cairo_set_source_pixbuf (cr, hilight, 0, 0);
+
+        cairo_paint (cr);
+    }
+
+    if (map->location)
+    {
+        pointx = convert_longitude_to_x (map->location->longitude, alloc.width);
+        pointy = convert_latitude_to_y (map->location->latitude, alloc.height);
+
+        pointx = CLAMP (floor (pointx), 0, alloc.width);
+        pointy = CLAMP (floor (pointy), 0, alloc.height);
+
+        draw_text_bubble (cr, widget, pointx, pointy);
+        if (map->pin)
+        {
+            gdk_cairo_set_source_pixbuf (cr, map->pin,
+                                         pointx - PIN_HOT_POINT_X,
+                                         pointy - PIN_HOT_POINT_Y);
+            cairo_paint (cr);
+        }
+    }
+
+    return TRUE;
+}
+static void
+update_cursor (GtkWidget *widget)
+{
+    GdkWindow *window;
+    g_autoptr(GdkCursor) cursor = NULL;
+
+    if (!gtk_widget_get_realized (widget))
+        return;
+
+    if (gtk_widget_is_sensitive (widget))
+    {
+        GdkDisplay *display;
+        display = gtk_widget_get_display (widget);
+        cursor = gdk_cursor_new_for_display (display, GDK_HAND2);
+    }
+
+    window = gtk_widget_get_window (widget);
+    gdk_window_set_cursor (window, cursor);
+}
+
+static void
+cc_timezone_map_state_flags_changed (GtkWidget     *widget,
+                                     GtkStateFlags  prev_state)
+{
+    update_cursor (widget);
+
+    if (GTK_WIDGET_CLASS (timezone_map_parent_class)->state_flags_changed)
+        GTK_WIDGET_CLASS (timezone_map_parent_class)->state_flags_changed (widget, prev_state);
+}
+static gint sort_locations (TzLocation *a,
+                            TzLocation *b)
+{
+    if (a->dist > b->dist)
+        return 1;
+
+    if (a->dist < b->dist)
+        return -1;
+
+    return 0;
+}
+
+static void
+set_location (TimezoneMap   *map,
+              TzLocation    *location)
+{
+    g_autoptr(TzInfo) info = NULL;
+
+    map->location = location;
+    info = tz_info_from_location (map->location);
+    map->selected_offset = tz_location_get_utc_offset (map->location)
+                                                      / (60.0*60.0) +
+                                                      ((info->daylight) ? -1.0 : 0.0);
+
+    g_signal_emit (map, signals[LOCATION_CHANGED], 0, map->location,NULL);
+}
+
+static gboolean
+button_press_event (TimezoneMap    *map,
+                    GdkEventButton *event)
+{
+    gint x, y;
+    guchar r, g, b, a;
+    guchar *pixels;
+    gint rowstride;
+    guint i;
+
+    const GPtrArray *array;
+    gint width, height;
+    GList *distances = NULL;
+    GtkAllocation alloc;
+
+    x = event->x;
+    y = event->y;
+
+    rowstride = map->visible_map_rowstride;
+    pixels = map->visible_map_pixels;
+
+    r = pixels[(rowstride * y + x * 4)];
+    g = pixels[(rowstride * y + x * 4) + 1];
+    b = pixels[(rowstride * y + x * 4) + 2];
+    a = pixels[(rowstride * y + x * 4) + 3];
+
+    for (i = 0; color_codes[i].offset != -100; i++)
+    {
+        if (color_codes[i].red == r && color_codes[i].green == g
+           && color_codes[i].blue == b && color_codes[i].alpha == a)
+        {
+            map->selected_offset = color_codes[i].offset;
+        }
+    }
+
+    gtk_widget_queue_draw (GTK_WIDGET (map));
+
+  /* work out the co-ordinates */
+
+    array = tz_get_locations (map->tzdb);
+
+    gtk_widget_get_allocation (GTK_WIDGET (map), &alloc);
+    width = alloc.width;
+    height = alloc.height;
+
+    for (i = 0; i < array->len; i++)
+    {
+        gdouble pointx, pointy, dx, dy;
+        TzLocation *loc = array->pdata[i];
+
+        pointx = convert_longitude_to_x (loc->longitude, width);
+        pointy = convert_latitude_to_y (loc->latitude, height);
+
+        dx = pointx - x;
+        dy = pointy - y;
+
+        loc->dist = dx * dx + dy * dy;
+        distances = g_list_prepend (distances, loc);
+
+    }
+    distances = g_list_sort (distances, (GCompareFunc) sort_locations);
+
+    set_location (map, (TzLocation*) distances->data);
+
+    g_list_free (distances);
+
+    return TRUE;
+}
+
+static void
+timezone_map_class_init (TimezoneMapClass *klass)
+{
+    GObjectClass *object_class = G_OBJECT_CLASS (klass);
+    GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+    object_class->dispose = cc_timezone_map_dispose;
+    object_class->finalize = timezone_map_finalize;
+
+    widget_class->get_preferred_width = cc_timezone_map_get_preferred_width;
+    widget_class->get_preferred_height = cc_timezone_map_get_preferred_height;
+    widget_class->size_allocate = cc_timezone_map_size_allocate;
+    widget_class->realize = cc_timezone_map_realize;
+    widget_class->draw = cc_timezone_map_draw;
+    widget_class->state_flags_changed = cc_timezone_map_state_flags_changed;
+
+    signals[LOCATION_CHANGED] = g_signal_new ("location-changed",
+                                               TYPE_TIMEZONE_MAP,
+                                               G_SIGNAL_RUN_FIRST,
+                                               0,
+                                               NULL,
+                                               NULL,
+                                               g_cclosure_marshal_VOID__POINTER,
+                                               G_TYPE_NONE, 1,
+                                               G_TYPE_POINTER);
+}
+
+static void
+timezone_map_init (TimezoneMap *map)
+{
+    GError *err = NULL;
+
+    map->orig_background = gdk_pixbuf_new_from_file (TIMPZONEDIR"bg.png",&err);
+    if (!map->orig_background)
+    {
+        g_warning ("Could not load background image: %s",
+                   (err) ? err->message : "Unknown error");
+        g_clear_error (&err);
+    }
+    map->orig_background_dim = gdk_pixbuf_new_from_file(TIMPZONEDIR"bg_dim.png",&err);
+    if (!map->orig_background_dim)
+    {
+        g_warning ("Could not load background image: %s",
+                 (err) ? err->message : "Unknown error");
+        g_clear_error (&err);
+    }
+
+    map->orig_color_map = gdk_pixbuf_new_from_file (TIMPZONEDIR"cc.png",&err);
+    if (!map->orig_color_map)
+    {
+        g_warning ("Could not load background image: %s",
+                  (err) ? err->message : "Unknown error");
+        g_clear_error (&err);
+    }
+
+    map->pin = gdk_pixbuf_new_from_file (TIMPZONEDIR"pin.png",&err);
+    if (!map->pin)
+    {
+        g_warning ("Could not load pin icon: %s",
+                  (err) ? err->message : "Unknown error");
+        g_clear_error (&err);
+    }
+
+    map->tzdb = tz_load_db ();
+
+    g_signal_connect_object (map,
+                            "button-press-event",
+                             G_CALLBACK (button_press_event),
+                             map,
+                             G_CONNECT_SWAPPED);
+}
+gboolean timezone_map_set_timezone (TimezoneMap *map,
+                                    const gchar *timezone)
+{
+    GPtrArray *locations;
+    guint i;
+    g_autofree gchar *real_tz = NULL;
+    gboolean ret;
+
+    real_tz = tz_info_get_clean_name (map->tzdb, timezone);
+
+    locations = tz_get_locations (map->tzdb);
+    ret = FALSE;
+
+    for (i = 0; i < locations->len; i++)
+    {
+        TzLocation *loc = locations->pdata[i];
+
+        if (!g_strcmp0 (loc->zone, real_tz ? real_tz : timezone))
+        {
+            set_location (map, loc);
+            ret = TRUE;
+            break;
+        }
+    }
+
+    if (ret)
+        gtk_widget_queue_draw (GTK_WIDGET (map));
+
+    return ret;
+}
+TzLocation *timezone_map_get_location (TimezoneMap *map)
+{
+    return map->location;
+}
+void timezone_map_set_bubble_text (TimezoneMap *map,
+                                   const gchar *text)
+{
+    g_free (map->bubble_text);
+    map->bubble_text = g_strdup (text);
+    gtk_widget_queue_draw (GTK_WIDGET (map));
+}
+
+TimezoneMap * timezone_map_new (void)
+{
+    return g_object_new (TYPE_TIMEZONE_MAP, NULL);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/89.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/89.html new file mode 100644 index 00000000..0685099a --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/89.html @@ -0,0 +1,339 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/*  time-admin
+*   Copyright (C) 2018  zhuyaliang https://github.com/zhuyaliang/
+*
+*   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 3 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, see <https://www.gnu.org/licenses/>.
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"<--- Include file: "config.h" not found.
+#endif
+#include "time-share.h"
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+int TimeoutFlag;
+
+int ErrorMessage (const char *Title,
+                  const char *Msg)
+{
+    int nRet;
+    GtkWidget *dialog;
+
+    dialog = gtk_message_dialog_new (NULL,
+                                     GTK_DIALOG_MODAL,
+                                     GTK_MESSAGE_ERROR,
+                                     GTK_BUTTONS_OK,
+                                     "%s", Title);
+
+    gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+                                              "%s", Msg);
+
+    nRet =  gtk_dialog_run (GTK_DIALOG (dialog));
+    gtk_widget_destroy (dialog);
+
+    return nRet;
+}
+
+void SetTooltip(GtkWidget *box, gboolean mode)
+{
+    gchar *text = mode ? NULL : _("Network time synchronization has been set up. Manual time/date setting is disabled.");
+    gtk_widget_set_tooltip_text (box, text);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/9.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/9.html new file mode 100644 index 00000000..12ba211f --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/9.html @@ -0,0 +1,801 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
#include <config.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 <gio/gdesktopappinfo.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "dm-util.h"
+
+#define GSM_SERVICE_DBUS   "org.gnome.SessionManager"
+#define GSM_PATH_DBUS      "/org/gnome/SessionManager"
+#define GSM_INTERFACE_DBUS "org.gnome.SessionManager"
+
+enum {
+        GSM_LOGOUT_MODE_NORMAL = 0,
+        GSM_LOGOUT_MODE_NO_CONFIRMATION,
+        GSM_LOGOUT_MODE_FORCE
+};
+
+#include "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+#include "activate-settings-daemon.h"<--- Include file: "activate-settings-daemon.h" not found.
+
+#define ACCESSIBILITY_KEY       "accessibility"
+#define ACCESSIBILITY_SCHEMA    "org.mate.interface"
+
+static gboolean initial_state;
+
+static GDesktopAppInfo *get_desktop_app_info_from_dm (void)
+{
+    DMType dm_type;
+    GDesktopAppInfo *app_info = NULL;
+
+    dm_type = dm_get_type();
+    if (dm_type == DM_TYPE_MDM) {
+        app_info = g_desktop_app_info_new ("mdmsetup.desktop");
+    } else if (dm_type == DM_TYPE_LIGHTDM) {
+        app_info = g_desktop_app_info_new ("lightdm-gtk-greeter-settings.desktop");
+    }
+    return app_info;
+}
+
+static GtkBuilder *
+create_builder (void)
+{
+    GtkBuilder *builder;
+    GObject *object;
+    GDesktopAppInfo *app_info = NULL;
+
+    builder = gtk_builder_new_from_resource ("/org/mate/mcc/accessibility/at/at-enable-dialog.ui");
+
+    object = gtk_builder_get_object (builder, "at_enable_image");
+    gtk_image_set_from_file (GTK_IMAGE (object),
+                             PIXMAPDIR "/at-startup.png");
+
+    object = gtk_builder_get_object (builder,
+                                     "at_applications_image");
+    gtk_image_set_from_file (GTK_IMAGE (object),
+                             PIXMAPDIR "/at-support.png");
+    app_info = get_desktop_app_info_from_dm ();
+    if (app_info == NULL) {
+        object = gtk_builder_get_object (builder, "login_button");
+        gtk_widget_hide (GTK_WIDGET (object));
+    } else {
+        g_object_unref (app_info);
+    }
+
+    return builder;
+}
+
+static void
+cb_at_preferences (GtkDialog *dialog, gint response_id)
+{
+	g_spawn_command_line_async ("mate-default-applications-properties --show-page=a11y", NULL);
+}
+
+static void
+cb_keyboard_preferences (GtkDialog *dialog, gint response_id)
+{
+	g_spawn_command_line_async ("mate-keyboard-properties --a11y", NULL);
+}
+
+static void
+cb_mouse_preferences (GtkDialog *dialog, gint response_id)
+{
+	g_spawn_command_line_async ("mate-mouse-properties --show-page=accessibility", NULL);
+}
+
+static void
+cb_login_preferences (GtkDialog *dialog, gint response_id)
+{
+    GDesktopAppInfo *app_info = NULL;
+
+    app_info = get_desktop_app_info_from_dm ();
+
+    if (app_info != NULL) {
+        g_app_info_launch (G_APP_INFO(app_info),  NULL, NULL, NULL);
+        g_object_unref (app_info);
+    }
+}
+
+static GDBusProxy *
+get_sm_proxy (void)
+{
+    GError            *error = NULL;
+    static GDBusProxy *proxy = NULL;
+
+    if (proxy == NULL) {
+        proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
+                                               G_DBUS_PROXY_FLAGS_NONE,
+                                               NULL,
+                                               GSM_SERVICE_DBUS,
+                                               GSM_PATH_DBUS,
+                                               GSM_INTERFACE_DBUS,
+                                               NULL,
+                                               &error);
+        if (proxy == NULL) {
+            g_warning ("Couldn't connect to session bus: %s", error->message);
+            g_error_free (error);
+        }
+    }
+    return proxy;
+}
+
+static gboolean
+do_logout (void)
+{
+    GDBusProxy *sm_proxy;
+    GError *error = NULL;
+    GVariant *ret;
+    gboolean res = FALSE;
+
+    sm_proxy = get_sm_proxy ();
+    if (sm_proxy == NULL)
+        return FALSE;
+
+    ret = g_dbus_proxy_call_sync (sm_proxy,
+                                  "Logout",
+                                  g_variant_new ("(u)", 0),    /* '0' means 'log out normally' */
+                                  G_DBUS_CALL_FLAGS_NONE,
+                                  -1,
+                                  NULL,
+                                  &error);
+    if (ret == NULL) {
+        g_warning ("Could not call Logout by dbus: %s\n", error->message);
+        g_error_free (error);
+    } else {
+        g_variant_unref (ret);
+        res = TRUE;
+    }
+
+    if (sm_proxy)
+        g_object_unref (sm_proxy);
+
+    return res;
+}
+
+static void
+cb_dialog_response (GtkDialog *dialog, gint response_id)
+{
+	if (response_id == GTK_RESPONSE_HELP)
+		capplet_help (GTK_WINDOW (dialog),
+			      "goscustaccess-11");
+	else if (response_id == GTK_RESPONSE_CLOSE || response_id == GTK_RESPONSE_DELETE_EVENT)
+		gtk_main_quit ();
+	else {
+	        g_message ("CLOSE AND LOGOUT!");
+
+		if (!do_logout ())
+                       gtk_main_quit ();
+	}
+}
+
+static void
+close_logout_update (GtkBuilder *builder)
+{
+	GSettings *settings = g_settings_new (ACCESSIBILITY_SCHEMA);
+	gboolean curr_state = g_settings_get_boolean (settings, ACCESSIBILITY_KEY);
+	GObject *btn = gtk_builder_get_object (builder,
+					       "at_close_logout_button");
+
+	gtk_widget_set_sensitive (GTK_WIDGET (btn), initial_state != curr_state);
+	g_object_unref (settings);
+}
+
+static void
+at_enable_toggled (GtkToggleButton *toggle_button,
+		   GtkBuilder      *builder)
+{
+	GSettings *settings = g_settings_new (ACCESSIBILITY_SCHEMA);
+	gboolean is_enabled = gtk_toggle_button_get_active (toggle_button);
+
+	g_settings_set_boolean (settings, ACCESSIBILITY_KEY, is_enabled);
+	g_object_unref (settings);
+}
+
+static void
+at_enable_update (GSettings *settings,
+		  GtkBuilder  *builder)
+{
+	gboolean is_enabled = g_settings_get_boolean (settings, ACCESSIBILITY_KEY);
+	GObject *btn = gtk_builder_get_object (builder, "at_enable_toggle");
+
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (btn),
+				      is_enabled);
+}
+
+static void
+at_enable_changed (GSettings *settings,
+		   gchar       *key,
+		   gpointer     user_data)
+{
+	at_enable_update (settings, user_data);
+	close_logout_update (user_data);
+}
+
+static void
+setup_dialog (GtkBuilder *builder, GSettings *settings)
+{
+	GtkWidget *widget;
+	GObject *object;
+
+	object = gtk_builder_get_object (builder, "at_enable_toggle");
+	g_signal_connect (object, "toggled",
+			  G_CALLBACK (at_enable_toggled),
+			  builder);
+
+	initial_state = g_settings_get_boolean (settings, ACCESSIBILITY_KEY);
+
+	at_enable_update (settings, builder);
+
+	g_signal_connect (settings, "changed::" ACCESSIBILITY_KEY, G_CALLBACK (at_enable_changed),
+				 builder);
+
+	object = gtk_builder_get_object (builder, "at_pref_button");
+	g_signal_connect (object, "clicked",
+			  G_CALLBACK (cb_at_preferences), NULL);
+
+	object = gtk_builder_get_object (builder, "keyboard_button");
+	g_signal_connect (object, "clicked",
+			  G_CALLBACK (cb_keyboard_preferences), NULL);
+
+	object = gtk_builder_get_object (builder, "mouse_button");
+	g_signal_connect (object, "clicked",
+			  G_CALLBACK (cb_mouse_preferences), NULL);
+
+	object = gtk_builder_get_object (builder, "login_button");
+	g_signal_connect (object, "clicked",
+			  G_CALLBACK (cb_login_preferences), NULL);
+
+	widget = GTK_WIDGET (gtk_builder_get_object (builder,
+						     "at_properties_dialog"));
+	capplet_set_icon (widget, "preferences-desktop-accessibility");
+
+	g_signal_connect (widget, "response",
+	                  G_CALLBACK (cb_dialog_response),
+	                  NULL);
+
+	gtk_widget_show (widget);
+}
+
+int
+main (int argc, char *argv[])
+{
+	GSettings  *settings;
+	GtkBuilder *builder;
+
+	capplet_init (NULL, &argc, &argv);
+
+	activate_settings_daemon ();
+
+	settings = g_settings_new (ACCESSIBILITY_SCHEMA);
+	builder = create_builder ();
+
+	if (builder) {
+
+		setup_dialog (builder, settings);
+
+		gtk_main ();
+
+		g_object_unref (builder);
+		g_object_unref (settings);
+	}
+
+	return 0;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/90.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/90.html new file mode 100644 index 00000000..03deecfb --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/90.html @@ -0,0 +1,827 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*  time-admin
+*   Copyright (C) 2018  zhuyaliang https://github.com/zhuyaliang/
+*
+*   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 3 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, see <https://www.gnu.org/licenses/>.
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"<--- Include file: "config.h" not found.
+#endif
+#include "time-tool.h"
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+struct tm *GetCurrentTime(void)
+{
+    time_t tt;
+    tzset();
+    tt=time(NULL);
+
+    return localtime(&tt);
+}
+
+void
+ta_refresh_time (TimeAdmin *ta, struct tm *LocalTime)
+{
+    gchar *str;
+
+    gtk_spin_button_set_value (GTK_SPIN_BUTTON (ta->HourSpin), LocalTime->tm_hour);
+    gtk_spin_button_set_value (GTK_SPIN_BUTTON (ta->MinuteSpin), LocalTime->tm_min);
+    str = g_strdup_printf ("%02d", LocalTime->tm_sec);
+    gtk_entry_set_text (GTK_ENTRY (ta->SecondSpin), str);
+    g_free (str);
+}
+
+void
+ta_refresh_date (TimeAdmin *ta, struct tm *LocalTime)
+{
+    gtk_calendar_select_month (GTK_CALENDAR (ta->Calendar),
+                               LocalTime->tm_mon,
+                               LocalTime->tm_year+1900);
+    gtk_calendar_select_day   (GTK_CALENDAR (ta->Calendar),
+                               LocalTime->tm_mday);
+    gtk_calendar_clear_marks  (GTK_CALENDAR (ta->Calendar));
+    gtk_calendar_mark_day     (GTK_CALENDAR (ta->Calendar),
+                               LocalTime->tm_mday);
+}
+
+static void
+UpdateDate (TimeAdmin *ta)
+{
+    if (ta->NtpState)
+    {
+        struct tm *LocalTime = GetCurrentTime();
+        ta_refresh_time (ta, LocalTime);
+        ta_refresh_date (ta, LocalTime);
+    }
+}
+
+static gboolean
+UpdateClock (gpointer data)
+{
+    TimeAdmin *ta = (TimeAdmin *)data;
+
+    TimeoutFlag = 1;
+    UpdateDate (ta);
+    TimeoutFlag = 0;
+
+    return TRUE;
+}
+
+void Update_Clock_Start(TimeAdmin *ta)
+{
+    if(ta->UpdateTimeId <= 0)
+    {
+        ta->UpdateTimeId = g_timeout_add(1000,(GSourceFunc)UpdateClock,ta);
+    }
+}
+
+void Update_Clock_Stop(TimeAdmin *ta)
+{
+    if(ta->UpdateTimeId > 0)
+    {
+        g_source_remove(ta->UpdateTimeId);
+        ta->UpdateTimeId = 0;
+    }
+}
+
+gboolean GetNtpState(TimeAdmin *ta)
+{
+    GDBusProxy *proxy = NULL;
+    GError     *error = NULL;
+    GVariant   *ret;
+    GVariant   *ntp;
+
+    proxy = g_dbus_proxy_new_sync (ta->Connection,
+                                   G_DBUS_PROXY_FLAGS_NONE,
+                                   NULL,
+                                  "org.freedesktop.timedate1",
+                                  "/org/freedesktop/timedate1",
+                                  "org.freedesktop.DBus.Properties",
+                                   NULL,
+                                   &error);
+    if(proxy == NULL)
+    {
+        goto EXIT;
+    }
+
+    ret = g_dbus_proxy_call_sync (proxy,
+                                 "Get",
+                                  g_variant_new ("(ss)",
+                                 "org.freedesktop.timedate1",
+                                 "NTP"),
+                                  G_DBUS_CALL_FLAGS_NONE,
+                                 -1,
+                                  NULL,
+                                  &error);
+    if(ret == NULL)
+    {
+        goto EXIT;
+    }
+    g_variant_get (ret, "(v)", &ntp);
+    return g_variant_get_boolean (ntp);
+
+EXIT:
+    ErrorMessage (_("GetNtpState"), error->message);
+    g_error_free(error);
+    return FALSE;
+
+}
+
+const gchar *GetTimeZone(TimeAdmin *ta)
+{
+    GDBusProxy *proxy = NULL;
+    GError     *error = NULL;
+    GVariant   *ret;
+    GVariant   *timezone;
+
+    proxy = g_dbus_proxy_new_sync (ta->Connection,
+                                   G_DBUS_PROXY_FLAGS_NONE,
+                                   NULL,
+                                  "org.freedesktop.timedate1",
+                                  "/org/freedesktop/timedate1",
+                                  "org.freedesktop.DBus.Properties",
+                                   NULL,
+                                   &error);
+    if(proxy == NULL)
+    {
+        goto EXIT;
+    }
+
+    ret = g_dbus_proxy_call_sync (proxy,
+                                 "Get",
+                                  g_variant_new ("(ss)",
+                                 "org.freedesktop.timedate1",
+                                 "Timezone"),
+                                  G_DBUS_CALL_FLAGS_NONE,
+                                 -1,
+                                  NULL,
+                                  &error);
+    if(ret == NULL)
+    {
+        goto EXIT;
+    }
+    g_variant_get (ret, "(v)", &timezone);
+    return g_variant_get_string (timezone,0);
+
+EXIT:
+    g_error_free(error);
+    return NULL;
+
+}
+
+void SetTimeZone(GDBusProxy *proxy,const char *zone)
+{
+    GError *error = NULL;
+    GVariant *ret;<--- Variable 'ret' can be declared as pointer to const
+
+    ret = g_dbus_proxy_call_sync (proxy,
+                                 "SetTimezone",
+                                  g_variant_new ("(sb)",zone,1),
+                                  G_DBUS_CALL_FLAGS_NONE,
+                                  -1,
+                                  NULL,
+                                  &error);
+
+    if(ret == NULL)
+    {
+        ErrorMessage (_("Set time zone"), error->message);
+        g_error_free (error);
+    }
+}
+
+static void
+ChangeSpinBttonState (TimeAdmin *ta)
+{
+    gtk_widget_set_sensitive (ta->SaveButton, !ta->NtpState);
+    SetTooltip (ta->SaveButton, !ta->NtpState);
+    SetTooltip (ta->HourSpin,   !ta->NtpState);
+    SetTooltip (ta->MinuteSpin, !ta->NtpState);
+    SetTooltip (ta->SecondSpin, !ta->NtpState);
+    SetTooltip (ta->Calendar,   !ta->NtpState);
+}
+
+gboolean ChangeNtpSync (GtkSwitch *widget, gboolean state, gpointer data)
+{
+    TimeAdmin *ta = (TimeAdmin *)data;
+    GError *error = NULL;
+    GVariant *ret;<--- Variable 'ret' can be declared as pointer to const
+
+    ret = g_dbus_proxy_call_sync (ta->proxy,
+                                 "SetNTP",
+                                  g_variant_new ("(bb)",state,state),
+                                  G_DBUS_CALL_FLAGS_NONE,
+                                  -1,
+                                  NULL,
+                                  &error);
+
+    if (ret == NULL)
+    {
+        ErrorMessage (_("Set Ntp sync"), error->message);
+        g_error_free(error);
+        return TRUE;
+    }
+    else
+    {
+        ta->NtpState = state;
+        ChangeSpinBttonState (ta);
+        Update_Clock_Start (ta);
+        UpdateDate (ta);
+    }
+    return FALSE;
+}
+
+static guint GetTimeStamp(TimeAdmin *ta)
+{
+    guint year,month,day,hour,min,sec;
+    GDateTime *dt;
+    char      *st;<--- Variable 'st' can be declared as pointer to const
+
+    gtk_calendar_get_date(GTK_CALENDAR(ta->Calendar),&year,&month,&day);
+    hour = gtk_spin_button_get_value(GTK_SPIN_BUTTON(ta->HourSpin));
+    min  = gtk_spin_button_get_value(GTK_SPIN_BUTTON(ta->MinuteSpin));
+    sec = atoi(gtk_entry_get_text(GTK_ENTRY(ta->SecondSpin)));
+
+    dt = g_date_time_new_local(year,month+1,day,hour,min,sec);
+    st = g_date_time_format(dt,"%s");
+    return atoi(st);
+
+}
+
+static gboolean
+SetTime (GDBusProxy *proxy, gint64 TimeSec)
+{
+    GError *error = NULL;
+    GVariant *ret;<--- Variable 'ret' can be declared as pointer to const
+
+    ret = g_dbus_proxy_call_sync (proxy,
+                                 "SetTime",
+                                  g_variant_new ("(xbb)",TimeSec * 1000 * 1000,0,0),
+                                  G_DBUS_CALL_FLAGS_NONE,
+                                  -1,
+                                  NULL,
+                                  &error);
+
+    if(ret == NULL)
+    {
+        ErrorMessage (_("Set Ntp sync"), error->message);
+        g_error_free(error);
+        return FALSE;
+    }
+
+    return TRUE;
+}
+
+void SaveModifyTime (GtkButton *button, gpointer data)
+{
+    TimeAdmin *ta = (TimeAdmin *)data;
+
+    if (SetTime (ta->proxy, GetTimeStamp(ta)))
+    {
+        struct tm *LocalTime = GetCurrentTime();
+        ta_refresh_time (ta, LocalTime);
+        ta_refresh_date (ta, LocalTime);
+    }
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/91.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/91.html new file mode 100644 index 00000000..2d5b34cb --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/91.html @@ -0,0 +1,1671 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/*
+ * Copyright (C) 2010 Intel, Inc
+ * Copyright (C) 2010-2018 The GNOME Project
+ * Copyright (C) 2018, 2019 zhuyaliang https://github.com/zhuyaliang/
+ * Copyright (C) 2019-2021 MATE Developers
+ *
+ * Portions from Ubiquity, Copyright (C) 2009 Canonical Ltd.
+ * Written by Evan Dandrea <evand@ubuntu.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 3 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, see <https://www.gnu.org/licenses/>.
+ *
+ * Author: Thomas Wood <thomas.wood@intel.com>
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"<--- Include file: "config.h" not found.
+#endif
+#include "time-zone.h"
+#include "time-map.h"
+#include "time-tool.h"
+#include  <math.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#define  MATE_DESKTOP_USE_UNSTABLE_API
+
+#include <string.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 <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <libmate-desktop/mate-languages.h> /* mate_get_country_from_code */<--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define DEFAULT_TZ "Europe/London"
+#define BACKFILE   TIMPZONEDIR "backward"
+
+static void LocationChanged(TimezoneMap  *map,
+                            TzLocation   *location,
+                            TimeAdmin    *ta);
+
+enum {
+  CITY_COL_CITY_HUMAN_READABLE,
+  CITY_COL_ZONE,
+  CITY_NUM_COLS
+};
+
+static gchar*
+tz_data_file_get (void)
+{
+    gchar *file;
+
+    file = g_strdup (TZ_DATA_FILE);
+
+    return file;
+}
+
+static float
+convert_pos (gchar *pos, int digits)
+{
+    gchar whole[10], *fraction;
+    gint i;
+    float t1, t2;
+
+    if (!pos || strlen(pos) < 4 || digits > 9)
+        return 0.0;
+
+    for (i = 0; i < digits + 1; i++)
+        whole[i] = pos[i];
+
+    whole[i] = '\0';
+    fraction = pos + digits + 1;
+
+    t1 = g_strtod (whole, NULL);
+    t2 = g_strtod (fraction, NULL);
+
+    if (t1 >= 0.0)
+        return t1 + t2/pow (10.0, strlen(fraction));
+    else
+        return t1 - t2/pow (10.0, strlen(fraction));
+}
+
+static int compare_country_names (const void *a, const void *b)
+{
+    const TzLocation *tza = * (TzLocation **) a;
+    const TzLocation *tzb = * (TzLocation **) b;
+
+    return strcmp (tza->zone, tzb->zone);
+}
+
+static void sort_locations_by_country (GPtrArray *locations)
+{
+    qsort (locations->pdata, locations->len, sizeof (gpointer),
+           compare_country_names);
+}
+static void load_backward_tz (TzDB *tz_db)
+{
+    FILE  *fp;
+    char buf[128] = { 0 };
+
+    tz_db->backward = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
+
+    fp = fopen(BACKFILE,"r");
+    if(fp == NULL)
+    {
+        g_error("%s does not exist\r\n",BACKFILE);
+
+    }
+    while(fgets(buf,128,fp))
+    {
+        g_auto(GStrv) items = NULL;
+        guint j;
+        char *real, *alias;
+
+        if (g_ascii_strncasecmp (buf, "Link\t", 5) != 0)
+            continue;
+
+        items = g_strsplit (buf, "\t", -1);
+        real = NULL;
+        alias = NULL;
+        for (j = 1; items[j] != NULL; j++)
+        {
+            if (items[j][0] == '\0')
+                continue;
+            if (real == NULL)
+            {
+                real = items[j];
+                continue;
+            }
+            alias = items[j];
+                break;
+        }
+        if (real == NULL || alias == NULL)
+            g_warning ("Could not parse line: %s", buf);
+
+        /* We don't need more than one name for it */
+        if (g_str_equal (real, "Etc/UTC") ||
+            g_str_equal (real, "Etc/UCT"))
+            real = "Etc/GMT";
+
+        g_hash_table_insert (tz_db->backward, g_strdup (alias), g_strdup (real));
+
+    }
+    fclose(fp);
+}
+
+TzDB *tz_load_db (void)
+{
+    g_autofree gchar *tz_data_file = NULL;
+    TzDB *tz_db;
+    FILE *tzfile;
+    char buf[4096];
+
+    tz_data_file = tz_data_file_get ();
+    if (!tz_data_file)
+    {
+        g_warning ("Could not get the TimeZone data file name");
+        return NULL;
+    }
+    tzfile = fopen (tz_data_file, "r");
+    if (!tzfile)
+    {
+        g_warning ("Could not open *%s*\n", tz_data_file);
+        return NULL;
+    }
+
+    tz_db = g_new0 (TzDB, 1);
+    tz_db->locations = g_ptr_array_new ();
+
+    while (fgets (buf, sizeof(buf), tzfile))
+    {
+        g_auto(GStrv) tmpstrarr = NULL;
+        g_autofree gchar *latstr = NULL;
+        g_autofree gchar *lngstr = NULL;
+        gchar *p;
+        TzLocation *loc;
+
+        if (*buf == '#')
+            continue;
+
+        g_strchomp(buf);
+        tmpstrarr = g_strsplit(buf,"\t", 6);
+
+        latstr = g_strdup (tmpstrarr[1]);
+        p = latstr + 1;
+        while (*p != '-' && *p != '+')
+            p++;
+        lngstr = g_strdup (p);
+        *p = '\0';
+
+        loc = g_new0 (TzLocation, 1);
+        loc->country = g_strdup (tmpstrarr[0]);
+        loc->zone = g_strdup (tmpstrarr[2]);
+        loc->latitude  = convert_pos (latstr, 2);
+        loc->longitude = convert_pos (lngstr, 3);
+
+#ifdef __sun
+        if (tmpstrarr[3] && *tmpstrarr[3] == '-' && tmpstrarr[4])
+            loc->comment = g_strdup (tmpstrarr[4]);
+
+        if (tmpstrarr[3] && *tmpstrarr[3] != '-' && !islower(loc->zone))
+        {
+            TzLocation *locgrp;
+            locgrp = g_new0 (TzLocation, 1);
+            locgrp->country = g_strdup (tmpstrarr[0]);
+            locgrp->zone = g_strdup (tmpstrarr[3]);
+            locgrp->latitude  = convert_pos (latstr, 2);
+            locgrp->longitude = convert_pos (lngstr, 3);
+            locgrp->comment = (tmpstrarr[4]) ? g_strdup (tmpstrarr[4]) : NULL;
+
+            g_ptr_array_add (tz_db->locations, (gpointer) locgrp);
+        }
+#else
+        loc->comment = (tmpstrarr[3]) ? g_strdup(tmpstrarr[3]) : NULL;
+#endif
+
+        g_ptr_array_add (tz_db->locations, (gpointer) loc);
+    }
+
+    fclose (tzfile);
+
+    /* now sort by country */
+    sort_locations_by_country (tz_db->locations);
+
+    /* Load up the hashtable of backward links */
+    load_backward_tz (tz_db);
+
+    return tz_db;
+}
+
+static GtkWidget*
+GetTimeZoneMap(TimeAdmin *ta)
+{
+    GtkWidget *map;
+    g_autoptr(GtkEntryCompletion) completion = NULL;
+
+    map = (GtkWidget *) timezone_map_new ();
+    g_signal_connect (map,
+                     "location-changed",
+                      G_CALLBACK (LocationChanged),
+                      ta);
+
+    completion = gtk_entry_completion_new ();
+    gtk_entry_set_completion (GTK_ENTRY (ta->TimezoneEntry), completion);
+    gtk_entry_completion_set_model (completion, GTK_TREE_MODEL (ta->CityListStore));
+    gtk_entry_completion_set_text_column (completion, CITY_COL_CITY_HUMAN_READABLE);
+
+    return map;
+}
+static char *
+translated_city_name (TzLocation *loc)
+{
+    g_autofree gchar *zone_translated = NULL;
+    g_auto(GStrv) split_translated = NULL;
+    g_autofree gchar *country = NULL;
+    gchar *name;
+    gint length;
+
+    zone_translated = g_strdup (_(loc->zone));
+    g_strdelimit (zone_translated, "_", ' ');
+    split_translated = g_regex_split_simple ("[\\x{2044}\\x{2215}\\x{29f8}\\x{ff0f}/]",
+                                              zone_translated,
+                                              0, 0);
+
+    length = g_strv_length (split_translated);
+
+    country = mate_get_country_from_code (loc->country, NULL);
+    name = g_strdup_printf (C_("timezone loc", "%s, %s"),
+                            split_translated[length-1],
+                            country);
+
+    return name;
+}
+
+static void
+update_timezone (TimezoneMap *map)
+{
+    g_autofree gchar *bubble_text = NULL;
+    g_autoptr(GDateTime) current_date = NULL;
+    g_autoptr(GTimeZone) timezone = NULL;
+    g_autofree gchar *city_country = NULL;
+    g_autofree gchar *utc_label = NULL;
+    g_autofree gchar *time_label = NULL;
+    g_autofree gchar *tz_desc = NULL;
+    TzLocation       *current_location;
+    GDateTime        *date;
+
+    current_location = timezone_map_get_location (TIMEZONEMAP (map));
+    city_country = translated_city_name (current_location);
+
+#if GLIB_CHECK_VERSION (2, 68, 0)
+    if ((timezone =  g_time_zone_new_identifier (current_location->zone)) == NULL) {
+        timezone_map_set_bubble_text (TIMEZONEMAP (map),
+                                      _("Error: timezone identifier cannot be parsed or loaded"));
+        return;
+    }
+#else
+    timezone = g_time_zone_new (current_location->zone);
+#endif
+
+    current_date = g_date_time_new_now_local ();
+    date = g_date_time_to_timezone (current_date, timezone);
+
+    utc_label = g_date_time_format (date, _("UTC%:::z"));
+
+    tz_desc = g_strdup_printf ( "%s (%s)",
+                                g_date_time_get_timezone_abbreviation (date),
+                                utc_label);
+    time_label = g_date_time_format (date, _("%R"));
+
+    bubble_text = g_strdup_printf ("<b>%s</b>\n"
+                                 "<small>%s</small>\n"
+                                 "<b>%s</b>",
+                                 tz_desc,
+                                 city_country,
+                                 time_label);
+    timezone_map_set_bubble_text (TIMEZONEMAP (map), bubble_text);
+    g_date_time_unref(date);
+}
+
+static void
+LocationChanged(TimezoneMap  *map,
+                TzLocation   *location,
+                TimeAdmin    *ta)
+{
+    update_timezone (map);
+}
+
+static void
+get_initial_timezone (TimeAdmin *ta)
+{
+    const gchar *timezone;
+
+    timezone = GetTimeZone(ta);
+
+    if (timezone == NULL ||
+       !timezone_map_set_timezone (TIMEZONEMAP (ta->map), timezone))
+    {
+        g_warning ("Timezone '%s' is unhandled,setting %s as default", timezone ? timezone : "(null)", DEFAULT_TZ);
+        timezone_map_set_timezone (TIMEZONEMAP (ta->map), DEFAULT_TZ);
+    }
+    update_timezone (TIMEZONEMAP(ta->map));
+}
+
+static void
+LoadCities (TzLocation   *loc,
+            GtkListStore *CityStore)
+{
+    g_autofree gchar *human_readable = NULL;
+
+    human_readable = translated_city_name (loc);
+    gtk_list_store_insert_with_values (CityStore,
+                                       NULL,
+                                       0,
+                                       CITY_COL_CITY_HUMAN_READABLE,
+                                       human_readable,
+                                       CITY_COL_ZONE,
+                                       loc->zone,
+                                       -1);
+}
+
+static void
+CreateCityList(TimeAdmin *ta)
+{
+    TzDB *db;
+
+    ta->CityListStore = gtk_list_store_new (CITY_NUM_COLS, G_TYPE_STRING, G_TYPE_STRING);
+    if ((db = tz_load_db ()) != NULL) {
+        g_ptr_array_foreach (db->locations, (GFunc) LoadCities, ta->CityListStore);
+        TimeZoneDateBaseFree (db);
+    }
+}
+
+static GtkWidget*
+CreateZoneFrame(TimeAdmin *ta)
+{
+    GtkWidget *TimeZoneFrame;
+
+    TimeZoneFrame = gtk_frame_new (_("Time Zone"));
+    gtk_widget_set_size_request(TimeZoneFrame,300,200);
+    gtk_frame_set_shadow_type(GTK_FRAME(TimeZoneFrame),GTK_SHADOW_NONE);
+
+    return TimeZoneFrame;
+}
+
+static GtkWidget*
+CreateZoneScrolled(TimeAdmin *ta)
+{
+    GtkWidget *Scrolled;
+
+    Scrolled = gtk_scrolled_window_new (NULL, NULL);
+
+    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (Scrolled),
+                                    GTK_POLICY_AUTOMATIC,
+                                    GTK_POLICY_AUTOMATIC);
+
+    gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (Scrolled),
+                                         GTK_SHADOW_IN);
+
+    return Scrolled;
+}
+
+static void
+CreateZoneEntry(TimeAdmin *ta)
+{
+    GtkWidget *hbox;
+
+    ta->TimezoneEntry = gtk_search_entry_new ();
+    hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
+    gtk_widget_set_halign (hbox, GTK_ALIGN_CENTER);
+    gtk_box_pack_start (GTK_BOX (hbox), ta->TimezoneEntry, FALSE, FALSE, 0);
+
+    ta->SearchBar = gtk_search_bar_new ();
+    gtk_search_bar_connect_entry (GTK_SEARCH_BAR (ta->SearchBar),
+                                  GTK_ENTRY (ta->TimezoneEntry));
+    gtk_search_bar_set_show_close_button (GTK_SEARCH_BAR (ta->SearchBar),FALSE);
+    gtk_container_add (GTK_CONTAINER (ta->SearchBar), hbox);
+    gtk_search_bar_set_search_mode(GTK_SEARCH_BAR(ta->SearchBar),TRUE);
+}
+
+static gboolean
+CityChanged(GtkEntryCompletion *completion,
+            GtkTreeModel       *model,
+            GtkTreeIter        *iter,
+            TimeAdmin          *self)
+{
+    GtkWidget *entry;
+    g_autofree gchar *zone = NULL;
+
+    gtk_tree_model_get (model,
+                        iter,
+                        CITY_COL_ZONE,
+                        &zone,
+                        -1);
+    timezone_map_set_timezone (TIMEZONEMAP (self->map), zone);
+
+    entry = gtk_entry_completion_get_entry (completion);
+    gtk_entry_set_text (GTK_ENTRY (entry), "");
+
+    return TRUE;
+}
+
+static void
+ChoooseTimezoneDone (GtkWidget *widget,
+                     TimeAdmin *ta)
+{
+    TimezoneMap *map;
+
+    map = TIMEZONEMAP(ta->map);
+    SetTimeZone(ta->proxy,map->location->zone);
+    gtk_entry_set_text (GTK_ENTRY (ta->TimeZoneEntry), _(map->location->zone));
+    gtk_widget_hide_on_delete(GTK_WIDGET(ta->dialog));
+}
+
+static void
+ChoooseTimezoneClose(GtkWidget  *widget,
+                     TimeAdmin  *ta)
+{
+    gtk_widget_hide_on_delete(GTK_WIDGET(ta->dialog));
+}
+
+void SetupTimezoneDialog(TimeAdmin *ta)
+{
+    GtkWidget *Vbox, *TimeZoneFrame, *Scrolled, *image;
+
+    ta->dialog = gtk_dialog_new_with_buttons (_("Time Zone Selection"),
+                                              NULL,
+                                              GTK_DIALOG_DESTROY_WITH_PARENT,
+                                              NULL,
+                                              NULL);
+    gtk_window_set_default_size (GTK_WINDOW (ta->dialog), 730, 520);
+
+    ta->TZclose = gtk_button_new_with_mnemonic (_("_Close"));
+    image = gtk_image_new_from_icon_name ("window-close", GTK_ICON_SIZE_BUTTON);
+    gtk_button_set_image (GTK_BUTTON (ta->TZclose), image);
+    gtk_button_set_use_underline (GTK_BUTTON (ta->TZclose), TRUE);
+    gtk_style_context_add_class (gtk_widget_get_style_context (ta->TZclose), "text-button");
+    gtk_widget_set_can_default (ta->TZclose, TRUE);
+    gtk_dialog_add_action_widget (GTK_DIALOG (ta->dialog), ta->TZclose, GTK_RESPONSE_CANCEL);
+
+    ta->TZconfire = gtk_button_new_with_mnemonic (_("Con_firm"));
+    image = gtk_image_new_from_icon_name ("emblem-default", GTK_ICON_SIZE_BUTTON);
+    gtk_button_set_image (GTK_BUTTON (ta->TZconfire), image);
+    gtk_button_set_use_underline (GTK_BUTTON (ta->TZconfire), TRUE);
+    gtk_style_context_add_class (gtk_widget_get_style_context (ta->TZconfire), "text-button");
+    gtk_widget_set_can_default (ta->TZconfire, TRUE);
+    gtk_dialog_add_action_widget (GTK_DIALOG (ta->dialog), ta->TZconfire, GTK_RESPONSE_OK);
+
+    g_signal_connect (ta->TZconfire,
+                     "clicked",
+                      G_CALLBACK (ChoooseTimezoneDone),
+                      ta);
+
+    g_signal_connect (ta->TZclose,
+                     "clicked",
+                      G_CALLBACK (ChoooseTimezoneClose),
+                      ta);
+
+    Vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+    gtk_style_context_add_class (gtk_widget_get_style_context (Vbox), "linked");
+
+    TimeZoneFrame = CreateZoneFrame(ta);
+    Scrolled = CreateZoneScrolled(ta);
+    gtk_container_add (GTK_CONTAINER (TimeZoneFrame), Scrolled);
+    CreateCityList(ta);
+    CreateZoneEntry(ta);
+    gtk_box_pack_start (GTK_BOX (Vbox), ta->SearchBar,FALSE,FALSE, 0);
+    ta->map = GetTimeZoneMap(ta);
+    gtk_widget_show (ta->map);
+    gtk_container_add (GTK_CONTAINER (Scrolled),ta->map);
+    gtk_box_pack_start(GTK_BOX(Vbox),TimeZoneFrame,TRUE,TRUE,10);
+    get_initial_timezone(ta);
+
+    g_signal_connect(gtk_entry_get_completion (GTK_ENTRY (ta->TimezoneEntry)),
+                    "match-selected",
+                     G_CALLBACK (CityChanged),
+                     ta);
+
+    gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (ta->dialog))),
+                        Vbox,
+                        TRUE,
+                        TRUE, 8);
+}
+
+void tz_info_free (TzInfo *tzinfo)
+{
+    g_return_if_fail (tzinfo != NULL);
+
+    if (tzinfo->tzname_normal) g_free (tzinfo->tzname_normal);
+    if (tzinfo->tzname_daylight) g_free (tzinfo->tzname_daylight);
+    g_free (tzinfo);
+}
+
+struct {
+    const char *orig;
+    const char *dest;
+} aliases[] = {
+    { "Asia/Istanbul",  "Europe/Istanbul" },    /* Istanbul is in both Europe and Asia */
+    { "Europe/Nicosia", "Asia/Nicosia" },       /* Ditto */
+    { "EET",            "Europe/Istanbul" },    /* Same tz as the 2 above */
+    { "HST",            "Pacific/Honolulu" },
+    { "WET",            "Europe/Brussels" },    /* Other name for the mainland Europe tz */
+    { "CET",            "Europe/Brussels" },    /* ditto */
+    { "MET",            "Europe/Brussels" },
+    { "Etc/Zulu",       "Etc/GMT" },
+    { "Etc/UTC",        "Etc/GMT" },
+    { "GMT",            "Etc/GMT" },
+    { "Greenwich",      "Etc/GMT" },
+    { "Etc/UCT",        "Etc/GMT" },
+    { "Etc/GMT0",       "Etc/GMT" },
+    { "Etc/GMT+0",      "Etc/GMT" },
+    { "Etc/GMT-0",      "Etc/GMT" },
+    { "Etc/Universal",  "Etc/GMT" },
+    { "PST8PDT",        "America/Los_Angeles" },    /* Other name for the Atlantic tz */
+    { "EST",            "America/New_York" },   /* Other name for the Eastern tz */
+    { "EST5EDT",        "America/New_York" },   /* ditto */
+    { "CST6CDT",        "America/Chicago" },    /* Other name for the Central tz */
+    { "MST",            "America/Denver" },     /* Other name for the mountain tz */
+    { "MST7MDT",        "America/Denver" },     /* ditto */
+};
+
+static gboolean
+compare_timezones (const char *a,
+                   const char *b)
+{
+    if (g_str_equal (a, b))
+        return TRUE;
+    if (strchr (b, '/') == NULL) {
+        g_autofree gchar *prefixed = NULL;
+
+        prefixed = g_strdup_printf ("/%s", b);
+        if (g_str_has_suffix (a, prefixed))
+            return TRUE;
+    }
+
+    return FALSE;
+}
+
+char *tz_info_get_clean_name (TzDB       *tz_db,
+                              const char *tz)
+{
+    char *ret;
+    const char *timezone;
+    guint i;
+    gboolean replaced;
+
+    /* Remove useless prefixes */
+    if (g_str_has_prefix (tz, "right/"))
+        tz = tz + strlen ("right/");
+    else if (g_str_has_prefix (tz, "posix/"))
+        tz = tz + strlen ("posix/");
+
+    /* Here start the crazies */
+    replaced = FALSE;
+
+    for (i = 0; i < G_N_ELEMENTS (aliases); i++) {
+        if (compare_timezones (tz, aliases[i].orig)) {
+            replaced = TRUE;
+            timezone = aliases[i].dest;
+            break;
+        }
+    }
+
+    /* Try again! */
+    if (!replaced) {
+        /* Ignore crazy solar times from the '80s */
+        if (g_str_has_prefix (tz, "Asia/Riyadh") ||
+            g_str_has_prefix (tz, "Mideast/Riyadh")) {
+            timezone = "Asia/Riyadh";
+            replaced = TRUE;
+        }
+    }
+
+    if (!replaced)
+        timezone = tz;
+
+    ret = g_hash_table_lookup (tz_db->backward, timezone);
+    if (ret == NULL)
+        return g_strdup (timezone);
+    return g_strdup (ret);
+}
+
+TzInfo *tz_info_from_location (TzLocation *loc)
+{
+    TzInfo *tzinfo;
+    time_t curtime;
+    struct tm *curzone;
+    g_autofree gchar *tz_env_value = NULL;
+
+    g_return_val_if_fail (loc != NULL, NULL);
+    g_return_val_if_fail (loc->zone != NULL, NULL);
+
+    tz_env_value = g_strdup (getenv ("TZ"));
+    setenv ("TZ", loc->zone, 1);
+
+#if 0
+    tzset ();
+#endif
+    tzinfo = g_new0 (TzInfo, 1);
+
+    curtime = time (NULL);
+    curzone = localtime (&curtime);
+
+#ifndef __sun
+    tzinfo->tzname_normal = g_strdup (curzone->tm_zone);
+    if (curzone->tm_isdst)
+        tzinfo->tzname_daylight =
+            g_strdup (&curzone->tm_zone[curzone->tm_isdst]);
+    else
+        tzinfo->tzname_daylight = NULL;
+
+    tzinfo->utc_offset = curzone->tm_gmtoff;
+#else
+    tzinfo->tzname_normal = NULL;
+    tzinfo->tzname_daylight = NULL;
+    tzinfo->utc_offset = 0;
+#endif
+
+    tzinfo->daylight = curzone->tm_isdst;
+
+    if (tz_env_value)
+        setenv ("TZ", tz_env_value, 1);
+    else
+        unsetenv ("TZ");
+
+    return tzinfo;
+}
+
+glong tz_location_get_utc_offset (TzLocation *loc)
+{
+    TzInfo *tz_info;
+    glong offset;
+
+    tz_info = tz_info_from_location (loc);
+    offset = tz_info->utc_offset;
+    tz_info_free (tz_info);
+
+    return offset;
+}
+
+void RunTimeZoneDialog  (GtkButton *button,
+                         gpointer   data)
+{
+    TimeAdmin *ta = (TimeAdmin *)data;
+
+    gtk_widget_show_all(GTK_WIDGET(ta->dialog));
+}
+
+static void
+tz_location_free (TzLocation *loc, gpointer data)
+{
+    g_free (loc->country);
+    g_free (loc->zone);
+    g_free (loc->comment);
+    g_free (loc);
+}
+
+void TimeZoneDateBaseFree (TzDB *db)
+{
+    g_ptr_array_foreach (db->locations, (GFunc) tz_location_free, NULL);
+    g_ptr_array_free (db->locations, TRUE);
+    g_hash_table_destroy (db->backward);
+    g_free (db);
+}
+
+GPtrArray *tz_get_locations (TzDB *db)
+{
+    return db->locations;
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/92.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/92.html new file mode 100644 index 00000000..22da9747 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/92.html @@ -0,0 +1,381 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/* mate-metacity-support.c
+ * Copyright (C) 2014 Stefano Karapetsas
+ * Copyright (C) 2019-2021 MATE Developers
+ *
+ * Written by: Stefano Karapetsas <stefano@karapetsas.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, 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 <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.
+
+#include "mate-metacity-support.h"
+
+#define METACITY_SCHEMA "org.gnome.metacity"
+#define COMPOSITING_KEY "compositing-manager"
+
+void
+mate_metacity_config_tool (void)
+{
+    GSettings *settings;
+    GtkDialog *dialog;
+    GtkWidget *vbox;
+    GtkWidget *widget;
+    gchar *str;
+
+    settings = g_settings_new (METACITY_SCHEMA);
+
+    dialog = GTK_DIALOG (gtk_dialog_new_with_buttons(_("Metacity Preferences"),
+                                                     NULL,
+                                                     GTK_DIALOG_MODAL,
+                                                     "gtk-close",
+                                                     GTK_RESPONSE_CLOSE,
+                                                     NULL));
+    gtk_window_set_icon_name (GTK_WINDOW (dialog), "preferences-system-windows");
+    gtk_window_set_default_size (GTK_WINDOW (dialog), 350, 150);
+
+    vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+
+    str = g_strdup_printf ("<b>%s</b>", _("Compositing Manager"));
+    widget = gtk_label_new (str);
+    g_free (str);
+    gtk_label_set_use_markup (GTK_LABEL (widget), TRUE);
+    gtk_label_set_xalign (GTK_LABEL (widget), 0.0);
+    gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 0);
+
+    widget = gtk_check_button_new_with_label (_("Enable software _compositing window manager"));
+    gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 0);
+    g_settings_bind (settings, COMPOSITING_KEY, widget, "active", G_SETTINGS_BIND_DEFAULT);
+
+    gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (dialog)), vbox, TRUE, TRUE, 0);
+
+    g_signal_connect (dialog, "response", G_CALLBACK (gtk_main_quit), dialog);
+    gtk_widget_show_all (GTK_WIDGET (dialog));
+    gtk_main ();
+
+    g_object_unref (settings);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/93.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/93.html new file mode 100644 index 00000000..5bae34f2 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/93.html @@ -0,0 +1,1061 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
#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.window_properties"), aligned (8)))
+#else
+# define SECTION
+#endif
+
+static const SECTION union { const guint8 data[3277]; const double alignment; void * const ptr;}  window_properties_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, 0310, 0000, 0000, 0000, 0000, 0000, 0000, 0050, 0006, 0000, 0000, 0000, 
+  0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 0004, 0000, 0000, 0000, 
+  0004, 0000, 0000, 0000, 0004, 0000, 0000, 0000, 0113, 0120, 0220, 0013, 0003, 0000, 0000, 0000, 
+  0310, 0000, 0000, 0000, 0004, 0000, 0114, 0000, 0314, 0000, 0000, 0000, 0320, 0000, 0000, 0000, 
+  0375, 0242, 0122, 0051, 0005, 0000, 0000, 0000, 0320, 0000, 0000, 0000, 0010, 0000, 0114, 0000, 
+  0330, 0000, 0000, 0000, 0334, 0000, 0000, 0000, 0133, 0054, 0202, 0022, 0001, 0000, 0000, 0000, 
+  0334, 0000, 0000, 0000, 0024, 0000, 0166, 0000, 0360, 0000, 0000, 0000, 0263, 0014, 0000, 0000, 
+  0324, 0265, 0002, 0000, 0377, 0377, 0377, 0377, 0263, 0014, 0000, 0000, 0001, 0000, 0114, 0000, 
+  0264, 0014, 0000, 0000, 0270, 0014, 0000, 0000, 0201, 0321, 0040, 0031, 0000, 0000, 0000, 0000, 
+  0270, 0014, 0000, 0000, 0005, 0000, 0114, 0000, 0300, 0014, 0000, 0000, 0304, 0014, 0000, 0000, 
+  0143, 0041, 0175, 0170, 0004, 0000, 0000, 0000, 0304, 0014, 0000, 0000, 0004, 0000, 0114, 0000, 
+  0310, 0014, 0000, 0000, 0314, 0014, 0000, 0000, 0157, 0162, 0147, 0057, 0004, 0000, 0000, 0000, 
+  0167, 0151, 0156, 0144, 0157, 0167, 0163, 0057, 0002, 0000, 0000, 0000, 0167, 0151, 0156, 0144, 
+  0157, 0167, 0055, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0151, 0145, 0163, 0056, 0165, 0151, 
+  0120, 0241, 0000, 0000, 0001, 0000, 0000, 0000, 0170, 0332, 0355, 0035, 0135, 0127, 0333, 0072, 
+  0362, 0075, 0277, 0102, 0353, 0247, 0366, 0054, 0006, 0302, 0275, 0273, 0333, 0323, 0102, 0356, 
+  0111, 0151, 0151, 0071, 0333, 0122, 0016, 0204, 0355, 0351, 0223, 0217, 0154, 0053, 0211, 0212, 
+  0054, 0371, 0132, 0062, 0041, 0375, 0365, 0073, 0262, 0235, 0157, 0307, 0161, 0022, 0233, 0046, 
+  0240, 0027, 0116, 0210, 0245, 0221, 0146, 0106, 0363, 0251, 0361, 0344, 0364, 0257, 0307, 0200, 
+  0241, 0007, 0022, 0111, 0052, 0370, 0231, 0325, 0074, 0074, 0266, 0020, 0341, 0236, 0360, 0051, 
+  0357, 0235, 0131, 0167, 0235, 0013, 0373, 0215, 0365, 0127, 0253, 0161, 0372, 0017, 0333, 0106, 
+  0237, 0010, 0047, 0021, 0126, 0304, 0107, 0003, 0252, 0372, 0250, 0307, 0260, 0117, 0320, 0037, 
+  0207, 0177, 0036, 0037, 0036, 0243, 0106, 0143, 0100, 0271, 0057, 0006, 0166, 0030, 0211, 0220, 
+  0104, 0212, 0022, 0171, 0030, 0123, 0144, 0243, 0257, 0355, 0316, 0107, 0224, 0076, 0103, 0223, 
+  0147, 0310, 0247, 0230, 0211, 0136, 0343, 0134, 0204, 0303, 0210, 0366, 0372, 0012, 0275, 0072, 
+  0177, 0235, 0216, 0375, 0100, 0036, 0010, 0323, 0343, 0144, 0243, 0321, 0351, 0123, 0251, 0147, 
+  0365, 0042, 0034, 0040, 0370, 0330, 0215, 0010, 0101, 0122, 0164, 0325, 0000, 0107, 0344, 0035, 
+  0032, 0212, 0030, 0171, 0230, 0243, 0210, 0370, 0124, 0252, 0210, 0272, 0261, 0042, 0210, 0052, 
+  0204, 0271, 0177, 0044, 0242, 0106, 0000, 0130, 0164, 0207, 0372, 0213, 0230, 0373, 0044, 0102, 
+  0252, 0117, 0220, 0042, 0121, 0040, 0221, 0350, 0046, 0377, 0174, 0272, 0272, 0313, 0220, 0142, 
+  0350, 0072, 0166, 0031, 0365, 0320, 0027, 0352, 0021, 0056, 0111, 0003, 0303, 0272, 0372, 0033, 
+  0331, 0007, 0164, 0335, 0141, 0062, 0374, 0102, 0257, 0176, 0233, 0255, 0216, 0056, 0004, 0100, 
+  0305, 0012, 0310, 0366, 0016, 0021, 0240, 0007, 0054, 0220, 0221, 0021, 0235, 0064, 0262, 0005, 
+  0062, 0150, 0007, 0110, 0104, 0350, 0025, 0126, 0172, 0303, 0021, 0022, 0241, 0236, 0364, 0032, 
+  0166, 0071, 0104, 0014, 0310, 0071, 0236, 0167, 0270, 0210, 0360, 0004, 0057, 0037, 0121, 0236, 
+  0300, 0354, 0003, 0155, 0340, 0003, 0100, 0003, 0304, 0006, 0224, 0061, 0344, 0022, 0024, 0113, 
+  0322, 0215, 0331, 0101, 0003, 0106, 0242, 0357, 0227, 0235, 0317, 0337, 0356, 0072, 0250, 0175, 
+  0365, 0003, 0175, 0157, 0337, 0334, 0264, 0257, 0072, 0077, 0336, 0045, 0054, 0023, 0360, 0024, 
+  0250, 0233, 0302, 0241, 0101, 0310, 0250, 0346, 0045, 0216, 0042, 0314, 0325, 0020, 0210, 0322, 
+  0370, 0372, 0361, 0346, 0374, 0063, 0214, 0157, 0277, 0277, 0374, 0162, 0331, 0371, 0241, 0267, 
+  0175, 0161, 0331, 0271, 0372, 0170, 0173, 0213, 0056, 0276, 0335, 0240, 0066, 0272, 0156, 0337, 
+  0164, 0056, 0317, 0357, 0276, 0264, 0157, 0320, 0365, 0335, 0315, 0365, 0267, 0333, 0217, 0207, 
+  0010, 0335, 0022, 0275, 0041, 0322, 0130, 0116, 0116, 0324, 0005, 0110, 0201, 0000, 0252, 0371, 
+  0104, 0141, 0312, 0044, 0240, 0372, 0003, 0230, 0047, 0141, 0113, 0314, 0107, 0175, 0374, 0100, 
+  0200, 0211, 0036, 0241, 0017, 0260, 0041, 0214, 0074, 0070, 0025, 0145, 0170, 0304, 0004, 0357, 
+  0245, 0147, 0121, 0115, 0321, 0355, 0035, 0242, 0135, 0304, 0205, 0072, 0100, 0203, 0210, 0302, 
+  0201, 0120, 0142, 0221, 0173, 0215, 0011, 0367, 0016, 0320, 0045, 0367, 0016, 0017, 0320, 0277, 
+  0232, 0060, 0004, 0363, 0173, 0006, 0164, 0276, 0125, 0060, 0030, 0000, 0134, 0320, 0056, 0000, 
+  0277, 0140, 0102, 0104, 0007, 0350, 0275, 0220, 0112, 0017, 0377, 0332, 0106, 0350, 0370, 0244, 
+  0331, 0074, 0266, 0233, 0177, 0034, 0067, 0017, 0320, 0335, 0155, 0033, 0320, 0151, 0307, 0100, 
+  0337, 0350, 0055, 0272, 0021, 0056, 0034, 0161, 0364, 0076, 0376, 0331, 0150, 0330, 0066, 0110, 
+  0016, 0345, 0300, 0342, 0056, 0366, 0110, 0253, 0201, 0320, 0151, 0104, 0376, 0216, 0151, 0004, 
+  0002, 0300, 0250, 0173, 0146, 0365, 0324, 0375, 0077, 0255, 0211, 0364, 0375, 0161, 0170, 0162, 
+  0142, 0035, 0045, 0343, 0264, 0274, 0215, 0147, 0332, 0054, 0305, 0330, 0126, 0103, 0340, 0175, 
+  0057, 0144, 0017, 0047, 0110, 0303, 0136, 0030, 0307, 0161, 0100, 0120, 0276, 0040, 0346, 0015, 
+  0367, 0211, 0364, 0042, 0232, 0034, 0307, 0142, 0071, 0315, 0237, 0356, 0215, 0205, 0167, 0116, 
+  0160, 0363, 0207, 0343, 0204, 0102, 0162, 0212, 0102, 0243, 0161, 0302, 0375, 0111, 0074, 0205, 
+  0074, 0206, 0245, 0074, 0263, 0076, 0251, 0373, 0266, 0377, 0063, 0226, 0052, 0040, 0134, 0131, 
+  0210, 0372, 0147, 0026, 0036, 0377, 0337, 0264, 0364, 0014, 0230, 0223, 0355, 0161, 0210, 0064, 
+  0316, 0147, 0126, 0034, 0302, 0177, 0126, 0253, 0171, 0174, 0172, 0064, 0172, 0222, 0077, 0360, 
+  0001, 0263, 0230, 0300, 0300, 0125, 0343, 0244, 0042, 0241, 0115, 0271, 0027, 0221, 0144, 0033, 
+  0255, 0343, 0303, 0325, 0260, 0103, 0334, 0043, 0323, 0163, 0346, 0147, 0234, 0036, 0245, 0230, 
+  0346, 0043, 0175, 0031, 0300, 0364, 0024, 0137, 0252, 0077, 0072, 0175, 0302, 0102, 0307, 0215, 
+  0304, 0100, 0152, 0324, 0362, 0261, 0241, 0222, 0272, 0014, 0360, 0351, 0104, 0061, 0131, 0265, 
+  0075, 0120, 0225, 0166, 0127, 0170, 0261, 0264, 0132, 0027, 0230, 0311, 0225, 0343, 0251, 0047, 
+  0170, 0162, 0244, 0254, 0226, 0336, 0212, 0235, 0155, 0145, 0053, 0234, 0322, 0023, 0346, 0170, 
+  0114, 0110, 0362, 0233, 0161, 0312, 0344, 0044, 0331, 0312, 0072, 0070, 0175, 0110, 0104, 0042, 
+  0105, 0052, 0025, 0017, 0215, 0225, 0125, 0315, 0376, 0024, 0125, 0200, 0072, 0122, 0240, 0211, 
+  0044, 0030, 0007, 0014, 0204, 0070, 0263, 0206, 0004, 0246, 0177, 0117, 0145, 0363, 0072, 0042, 
+  0135, 0022, 0201, 0211, 0046, 0162, 0025, 0054, 0120, 0063, 0364, 0027, 0116, 0110, 0131, 0152, 
+  0155, 0260, 0227, 0230, 0225, 0043, 0373, 0024, 0031, 0303, 0311, 0206, 0154, 0071, 0004, 0261, 
+  0011, 0354, 0224, 0262, 0053, 0367, 0247, 0265, 0231, 0335, 0247, 0132, 0122, 0270, 0210, 0002, 
+  0314, 0026, 0046, 0110, 0332, 0343, 0240, 0367, 0307, 0350, 0204, 0002, 0264, 0240, 0005, 0366, 
+  0202, 0373, 0214, 0104, 0147, 0226, 0340, 0316, 0204, 0003, 0316, 0144, 0200, 0034, 0140, 0320, 
+  0007, 0300, 0037, 0056, 0122, 0175, 0012, 0260, 0274, 0076, 0145, 0176, 0252, 0216, 0000, 0246, 
+  0235, 0374, 0013, 0207, 0315, 0025, 0217, 0031, 0353, 0362, 0170, 0375, 0036, 0236, 0046, 0214, 
+  0016, 0060, 0054, 0060, 0063, 0170, 0315, 0203, 0273, 0311, 0341, 0310, 0233, 0043, 0042, 0012, 
+  0272, 0045, 0261, 0134, 0126, 0353, 0101, 0153, 0151, 0157, 0221, 0160, 0005, 0010, 0143, 0117, 
+  0117, 0165, 0300, 0006, 0342, 0051, 0124, 0162, 0161, 0217, 0025, 0330, 0273, 0367, 0063, 0050, 
+  0157, 0204, 0366, 0246, 0250, 0347, 0315, 0143, 0030, 0174, 0050, 0145, 0113, 0065, 0324, 0053, 
+  0022, 0356, 0057, 0235, 0230, 0340, 0073, 0373, 0335, 0162, 0054, 0123, 0046, 0273, 0311, 0347, 
+  0074, 0275, 0133, 0274, 0045, 0227, 0260, 0134, 0221, 0165, 0076, 0003, 0244, 0145, 0033, 0334, 
+  0230, 0224, 0053, 0310, 0271, 0356, 0324, 0314, 0357, 0222, 0340, 0015, 0164, 0161, 0314, 0324, 
+  0372, 0020, 0022, 0315, 0156, 0265, 0026, 0215, 0326, 0072, 0100, 0300, 0203, 0265, 0023, 0067, 
+  0035, 0374, 0257, 0015, 0010, 0200, 0331, 0000, 0017, 0101, 0001, 0365, 0101, 0243, 0147, 0373, 
+  0051, 0006, 0061, 0255, 0343, 0147, 0001, 0143, 0357, 0036, 0202, 0237, 0325, 0113, 0222, 0307, 
+  0020, 0364, 0320, 0212, 0363, 0233, 0067, 0261, 0013, 0116, 0373, 0006, 0323, 0102, 0041, 0151, 
+  0052, 0366, 0307, 0105, 0150, 0345, 0356, 0377, 0364, 0050, 0107, 0034, 0266, 0020, 0221, 0034, 
+  0063, 0276, 0241, 0210, 0234, 0057, 0232, 0337, 0147, 0057, 0043, 0323, 0324, 0063, 0062, 0122, 
+  0217, 0214, 0064, 0253, 0220, 0221, 0074, 0002, 0344, 0043, 0277, 0021, 0342, 0033, 0040, 0275, 
+  0030, 0162, 0170, 0367, 0111, 0130, 0130, 0154, 0014, 0327, 0125, 0045, 0071, 0044, 0132, 0040, 
+  0317, 0242, 0372, 0130, 0124, 0035, 0127, 0102, 0021, 0127, 0210, 0373, 0124, 0171, 0160, 0267, 
+  0146, 0127, 0142, 0235, 0151, 0256, 0210, 0100, 0222, 0300, 0127, 0365, 0125, 0337, 0152, 0375, 
+  0173, 0153, 0077, 0142, 0344, 0051, 0272, 0244, 0217, 0037, 0250, 0210, 0243, 0171, 0167, 0261, 
+  0116, 0205, 0266, 0266, 0240, 0314, 0142, 0337, 0074, 0131, 0147, 0156, 0151, 0027, 0164, 0031, 
+  0000, 0011, 0207, 0013, 0316, 0026, 0254, 0373, 0246, 0160, 0132, 0056, 0351, 0363, 0311, 0177, 
+  0021, 0351, 0140, 0044, 0141, 0100, 0246, 0135, 0045, 0141, 0044, 0365, 0165, 0023, 0337, 0275, 
+  0233, 0014, 0310, 0003, 0266, 0005, 0107, 0266, 0345, 0312, 0122, 0133, 0151, 0077, 0142, 0006, 
+  0261, 0117, 0241, 0251, 0137, 0102, 0333, 0076, 0326, 0121, 0155, 0252, 0022, 0270, 0340, 0253, 
+  0327, 0137, 0112, 0345, 0025, 0007, 0175, 0201, 0316, 0113, 0316, 0173, 0045, 0124, 0256, 0202, 
+  0322, 0271, 0061, 0057, 0216, 0172, 0224, 0103, 0074, 0201, 0043, 0125, 0240, 0005, 0052, 0025, 
+  0207, 0225, 0142, 0121, 0156, 0033, 0205, 0174, 0313, 0347, 0335, 0171, 0237, 0170, 0063, 0356, 
+  0134, 0102, 0076, 0007, 0002, 0177, 0342, 0170, 0372, 0131, 0352, 0336, 0131, 0105, 0120, 0327, 
+  0362, 0356, 0156, 0223, 0303, 0221, 0345, 0025, 0045, 0032, 0364, 0263, 0344, 0163, 0040, 0300, 
+  0227, 0201, 0277, 0340, 0123, 0041, 0370, 0223, 0344, 0346, 0203, 0062, 0130, 0127, 0162, 0220, 
+  0266, 0364, 0016, 0327, 0363, 0024, 0113, 0037, 0315, 0012, 0074, 0276, 0042, 0120, 0176, 0204, 
+  0301, 0355, 0343, 0076, 0234, 0116, 0045, 0242, 0065, 0141, 0315, 0044, 0142, 0224, 0350, 0365, 
+  0030, 0361, 0147, 0363, 0060, 0371, 0047, 0311, 0031, 0217, 0315, 0111, 0311, 0054, 0131, 0153, 
+  0211, 0323, 0131, 0316, 0001, 0255, 0304, 0031, 0135, 0355, 0243, 0155, 0303, 0210, 0122, 0161, 
+  0134, 0011, 0177, 0165, 0145, 0174, 0127, 0247, 0266, 0110, 0004, 0270, 0026, 0235, 0161, 0347, 
+  0160, 0131, 0250, 0065, 0030, 0301, 0132, 0155, 0030, 0215, 0121, 0302, 0240, 0025, 0073, 0166, 
+  0317, 0116, 0363, 0054, 0234, 0112, 0243, 0177, 0066, 0214, 0221, 0167, 0101, 0377, 0214, 0075, 
+  0115, 0034, 0303, 0271, 0301, 0024, 0130, 0353, 0023, 0206, 0207, 0116, 0277, 0330, 0321, 0174, 
+  0012, 0211, 0337, 0011, 0031, 0135, 0317, 0141, 0054, 0307, 0206, 0222, 0246, 0140, 0302, 0222, 
+  0362, 0066, 0140, 0115, 0337, 0361, 0106, 0203, 0107, 0251, 0055, 0110, 0152, 0116, 0122, 0153, 
+  0200, 0273, 0252, 0070, 0263, 0134, 0313, 0121, 0250, 0320, 0000, 0324, 0140, 0004, 0052, 0126, 
+  0340, 0125, 0053, 0361, 0162, 0112, 0265, 0274, 0142, 0255, 0114, 0271, 0156, 0221, 0171, 0254, 
+  0334, 0313, 0053, 0251, 0151, 0113, 0151, 0333, 0155, 0104, 0375, 0066, 0244, 0074, 0137, 0322, 
+  0123, 0345, 0053, 0341, 0371, 0306, 0342, 0276, 0213, 0262, 0107, 0171, 0030, 0053, 0073, 0214, 
+  0243, 0060, 0271, 0314, 0340, 0161, 0340, 0156, 0247, 0140, 0046, 0325, 0052, 0126, 0153, 0252, 
+  0162, 0145, 0053, 0164, 0031, 0015, 0134, 0133, 0027, 0337, 0345, 0127, 0242, 0254, 0045, 0311, 
+  0264, 0107, 0225, 0054, 0155, 0375, 0227, 0230, 0036, 0216, 0103, 0133, 0011, 0133, 0121, 0357, 
+  0276, 0002, 0036, 0000, 0321, 0111, 0104, 0275, 0355, 0001, 0055, 0053, 0357, 0051, 0357, 0143, 
+  0046, 0020, 0154, 0017, 0074, 0314, 0336, 0274, 0247, 0271, 0134, 0024, 0234, 0144, 0226, 0063, 
+  0236, 0125, 0332, 0333, 0174, 0351, 0312, 0261, 0271, 0137, 0312, 0361, 0113, 0352, 0256, 0150, 
+  0275, 0050, 0211, 0047, 0270, 0057, 0235, 0324, 0203, 0331, 0015, 0125, 0270, 0065, 0143, 0226, 
+  0273, 0143, 0031, 0272, 0317, 0330, 0344, 0157, 0313, 0207, 0311, 0241, 0076, 0371, 0035, 0207, 
+  0372, 0005, 0305, 0255, 0047, 0117, 0025, 0267, 0026, 0323, 0264, 0160, 0162, 0126, 0176, 0245, 
+  0357, 0141, 0106, 0142, 0125, 0376, 0216, 0145, 0112, 0315, 0054, 0334, 0262, 0254, 0322, 0067, 
+  0073, 0171, 0315, 0322, 0317, 0256, 0263, 0222, 0220, 0167, 0023, 0000, 0313, 0025, 0123, 0126, 
+  0027, 0171, 0073, 0042, 0120, 0051, 0350, 0130, 0145, 0145, 0365, 0262, 0360, 0000, 0215, 0207, 
+  0145, 0273, 0030, 0020, 0135, 0356, 0154, 0241, 0304, 0332, 0353, 0113, 0124, 0346, 0027, 0231, 
+  0367, 0323, 0243, 0325, 0353, 0154, 0174, 0304, 0212, 0046, 0026, 0313, 0371, 0126, 0362, 0275, 
+  0271, 0134, 0157, 0034, 0041, 0025, 0310, 0361, 0122, 0372, 0154, 0170, 0167, 0234, 0224, 0337, 
+  0272, 0070, 0162, 0260, 0271, 0072, 0256, 0361, 0352, 0170, 0236, 0314, 0346, 0346, 0170, 0327, 
+  0157, 0216, 0307, 0254, 0363, 0105, 0014, 0244, 0167, 0040, 0040, 0365, 0356, 0235, 0171, 0076, 
+  0356, 0173, 0142, 0366, 0351, 0022, 0252, 0123, 0026, 0076, 0237, 0242, 0057, 0044, 0254, 0160, 
+  0076, 0044, 0330, 0333, 0011, 0366, 0150, 0204, 0075, 0112, 0317, 0323, 0333, 0035, 0312, 0177, 
+  0006, 0234, 0004, 0202, 0123, 0117, 0227, 0114, 0365, 0010, 0110, 0174, 0076, 0333, 0322, 0227, 
+  0373, 0002, 0302, 0143, 0023, 0051, 0075, 0277, 0334, 0350, 0271, 0010, 0134, 0001, 0252, 0260, 
+  0103, 0036, 0125, 0221, 0360, 0116, 0116, 0301, 0336, 0112, 0060, 0125, 0044, 0220, 0253, 0307, 
+  0145, 0043, 0363, 0104, 0373, 0106, 0060, 0206, 0342, 0360, 0364, 0110, 0017, 0330, 0012, 0322, 
+  0127, 0374, 0110, 0003, 0372, 0213, 0124, 0010, 0012, 0175, 0006, 0343, 0373, 0113, 0200, 0365, 
+  0145, 0154, 0130, 0045, 0334, 0377, 0145, 0146, 0274, 0032, 0250, 0224, 0127, 0205, 0370, 0125, 
+  0342, 0317, 0225, 0003, 0223, 0216, 0223, 0353, 0146, 0116, 0163, 0163, 0246, 0253, 0004, 0344, 
+  0245, 0344, 0114, 0253, 0323, 0231, 0115, 0223, 0135, 0252, 0065, 0273, 0364, 0346, 0005, 0145, 
+  0227, 0346, 0035, 0170, 0223, 0134, 0232, 0325, 0232, 0235, 0221, 0103, 0332, 0066, 0271, 0245, 
+  0375, 0314, 0055, 0065, 0167, 0046, 0267, 0204, 0231, 0162, 0340, 0154, 0231, 0234, 0122, 0075, 
+  0071, 0245, 0021, 0171, 0115, 0056, 0151, 0315, 0134, 0122, 0025, 0225, 0301, 0236, 0010, 0122, 
+  0221, 0343, 0075, 0247, 0213, 0245, 0162, 0106, 0334, 0250, 0243, 0102, 0370, 0266, 0057, 0006, 
+  0310, 0121, 0375, 0070, 0160, 0271, 0156, 0046, 0243, 0073, 0343, 0264, 0231, 0262, 0073, 0330, 
+  0065, 0005, 0301, 0273, 0131, 0310, 0153, 0212, 0372, 0253, 0167, 0037, 0053, 0022, 0135, 0375, 
+  0072, 0160, 0042, 0252, 0351, 0053, 0201, 0365, 0111, 0154, 0326, 0134, 0050, 0133, 0307, 0010, 
+  0255, 0021, 0332, 0027, 0130, 0011, 0277, 0003, 0061, 0337, 0310, 0064, 0233, 0130, 0157, 0126, 
+  0111, 0255, 0241, 0215, 0114, 0214, 0267, 0123, 0061, 0336, 0311, 0316, 0304, 0170, 0372, 0215, 
+  0126, 0135, 0354, 0353, 0334, 0223, 0241, 0011, 0364, 0352, 0011, 0364, 0146, 0150, 0154, 0242, 
+  0275, 0135, 0257, 0034, 0230, 0262, 0074, 0143, 0316, 0115, 0065, 0236, 0054, 0165, 0321, 0275, 
+  0323, 0105, 0003, 0005, 0331, 0103, 0221, 0274, 0342, 0216, 0160, 0346, 0373, 0036, 0240, 0060, 
+  0042, 0122, 0332, 0240, 0055, 0355, 0276, 0320, 0266, 0134, 0267, 0055, 0205, 0143, 0254, 0137, 
+  0146, 0345, 0250, 0027, 0141, 0067, 0171, 0317, 0065, 0035, 0375, 0326, 0170, 0151, 0373, 0025, 
+  0132, 0315, 0244, 0242, 0322, 0013, 0257, 0207, 0075, 0057, 0210, 0331, 0130, 0317, 0074, 0151, 
+  0165, 0115, 0310, 0260, 0107, 0264, 0100, 0221, 0350, 0310, 0334, 0164, 0231, 0250, 0247, 0320, 
+  0366, 0150, 0257, 0301, 0204, 0076, 0163, 0165, 0006, 0031, 0161, 0320, 0177, 0311, 0320, 0304, 
+  0077, 0173, 0027, 0377, 0374, 0131, 0165, 0374, 0223, 0117, 0233, 0202, 0046, 0222, 0231, 0174, 
+  0302, 0231, 0262, 0126, 0267, 0112, 0233, 0222, 0312, 0111, 0263, 0264, 0145, 0042, 0271, 0023, 
+  0335, 0322, 0226, 0113, 0316, 0373, 0021, 0002, 0165, 0166, 0121, 0054, 0251, 0261, 0027, 0372, 
+  0053, 0143, 0327, 0056, 0365, 0302, 0136, 0055, 0115, 0103, 0107, 0316, 0120, 0142, 0234, 0023, 
+  0315, 0153, 0372, 0341, 0255, 0162, 0214, 0152, 0351, 0207, 0307, 0311, 0040, 0353, 0070, 0052, 
+  0115, 0112, 0242, 0236, 0224, 0204, 0107, 0164, 0227, 0155, 0147, 0232, 0322, 0046, 0061, 0261, 
+  0167, 0315, 0360, 0162, 0270, 0130, 0307, 0145, 0330, 0071, 0054, 0023, 0021, 0244, 0327, 0101, 
+  0113, 0072, 0345, 0233, 0033, 0060, 0163, 0003, 0366, 0134, 0163, 0053, 0073, 0020, 0013, 0116, 
+  0113, 0270, 0011, 0005, 0347, 0352, 0304, 0101, 0053, 0175, 0057, 0257, 0225, 0114, 0044, 0150, 
+  0336, 0244, 0055, 0354, 0302, 0314, 0161, 0030, 0352, 0252, 0060, 0343, 0171, 0326, 0332, 0204, 
+  0171, 0104, 0146, 0343, 0166, 0356, 0235, 0333, 0111, 0270, 0126, 0277, 0216, 0242, 0114, 0063, 
+  0260, 0016, 0217, 0363, 0143, 0262, 0302, 0270, 0000, 0053, 0135, 0311, 0370, 0234, 0306, 0347, 
+  0064, 0367, 0171, 0153, 0111, 0052, 0146, 0114, 0327, 0112, 0212, 0260, 0116, 0141, 0155, 0353, 
+  0105, 0220, 0162, 0104, 0210, 0214, 0240, 0226, 0262, 0030, 0173, 0336, 0344, 0330, 0134, 0070, 
+  0076, 0313, 0040, 0163, 0336, 0063, 0063, 0201, 0146, 0176, 0337, 0246, 0214, 0076, 0046, 0330, 
+  0064, 0257, 0326, 0155, 0337, 0266, 0051, 0265, 0305, 0346, 0236, 0243, 0356, 0276, 0115, 0043, 
+  0072, 0233, 0160, 0163, 0157, 0032, 0067, 0215, 0344, 0326, 0021, 0135, 0147, 0201, 0217, 0246, 
+  0161, 0323, 0006, 0026, 0276, 0220, 0242, 0057, 0245, 0177, 0323, 0165, 0106, 0004, 0044, 0272, 
+  0223, 0366, 0115, 0031, 0021, 0166, 0272, 0177, 0323, 0124, 0247, 0055, 0375, 0223, 0302, 0246, 
+  0163, 0123, 0055, 0261, 0173, 0111, 0167, 0276, 0144, 0155, 0146, 0225, 0235, 0233, 0226, 0363, 
+  0377, 0045, 0367, 0154, 0322, 0216, 0062, 0172, 0065, 0240, 0252, 0217, 0064, 0051, 0136, 0127, 
+  0320, 0171, 0350, 0013, 0351, 0126, 0015, 0062, 0331, 0146, 0105, 0133, 0373, 0035, 0115, 0221, 
+  0226, 0237, 0075, 0323, 0016, 0251, 0246, 0234, 0102, 0265, 0212, 0310, 0044, 0151, 0237, 0145, 
+  0316, 0146, 0155, 0057, 0356, 0305, 0366, 0103, 0112, 0323, 0342, 0246, 0104, 0000, 0231, 0227, 
+  0145, 0237, 0250, 0276, 0171, 0375, 0042, 0345, 0115, 0213, 0322, 0047, 0025, 0313, 0173, 0132, 
+  0224, 0176, 0075, 0102, 0300, 0024, 0245, 0057, 0053, 0330, 0235, 0352, 0127, 0024, 0140, 0216, 
+  0173, 0304, 0374, 0134, 0373, 0352, 0344, 0112, 0055, 0345, 0351, 0122, 0164, 0325, 0000, 0107, 
+  0304, 0231, 0345, 0211, 0311, 0337, 0326, 0220, 0277, 0315, 0245, 0265, 0311, 0341, 0356, 0137, 
+  0245, 0372, 0024, 0373, 0152, 0054, 0030, 0162, 0106, 0347, 0005, 0115, 0055, 0070, 0052, 0043, 
+  0312, 0324, 0246, 0251, 0116, 0060, 0125, 0005, 0346, 0347, 0240, 0236, 0054, 0102, 0315, 0325, 
+  0340, 0046, 0112, 0235, 0153, 0067, 0067, 0122, 0133, 0347, 0023, 0042, 0231, 0110, 0325, 0024, 
+  0263, 0127, 0031, 0364, 0234, 0354, 0102, 0244, 0232, 0027, 0306, 0354, 0151, 0314, 0072, 0045, 
+  0252, 0350, 0353, 0052, 0327, 0342, 0211, 0030, 0371, 0044, 0321, 0153, 0036, 0056, 0371, 0170, 
+  0154, 0044, 0240, 0353, 0013, 0346, 0332, 0201, 0176, 0016, 0256, 0163, 0170, 0316, 0342, 0070, 
+  0363, 0360, 0064, 0355, 0074, 0237, 0135, 0313, 0216, 0365, 0341, 0354, 0327, 0050, 0042, 0062, 
+  0024, 0134, 0302, 0156, 0354, 0146, 0323, 0152, 0145, 0077, 0272, 0333, 0047, 0054, 0164, 0334, 
+  0110, 0014, 0244, 0076, 0054, 0063, 0063, 0126, 0303, 0371, 0317, 0030, 0114, 0126, 0251, 0347, 
+  0061, 0241, 0311, 0230, 0003, 0146, 0356, 0313, 0144, 0223, 0023, 0224, 0116, 0217, 0250, 0176, 
+  0157, 0264, 0213, 0075, 0322, 0152, 0374, 0037, 0343, 0343, 0034, 0244, 0000, 0050, 0165, 0165, 
+  0141, 0171, 0051, 0057, 0000, 0000, 0000, 0000, 0155, 0141, 0164, 0145, 0057, 0000, 0000, 0000, 
+  0005, 0000, 0000, 0000, 0155, 0143, 0143, 0057, 0001, 0000, 0000, 0000
+} };
+
+static GStaticResource static_resource = { window_properties_resource_data.data, sizeof (window_properties_resource_data.data) - 1 /* nul terminator */, NULL, NULL, NULL };
+
+G_MODULE_EXPORT
+GResource *window_properties_get_resource (void);
+GResource *window_properties_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(window_propertiesresource_constructor)
+#endif
+G_DEFINE_CONSTRUCTOR(window_propertiesresource_constructor)
+#ifdef G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA
+#pragma G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(window_propertiesresource_destructor)
+#endif
+G_DEFINE_DESTRUCTOR(window_propertiesresource_destructor)
+
+#else
+#warning "Constructor not supported on this compiler, linking in resources will not work"
+#endif
+
+static void window_propertiesresource_constructor (void)
+{
+  g_static_resource_init (&static_resource);
+}
+
+static void window_propertiesresource_destructor (void)
+{
+  g_static_resource_fini (&static_resource);
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/94.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/94.html new file mode 100644 index 00000000..83d47ece --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/94.html @@ -0,0 +1,1621 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
+/* mate-window-properties.c
+ * Copyright (C) 2002 Seth Nickell
+ * Copyright (C) 2002 Red Hat, Inc.
+ *
+ * Written by: Seth Nickell <snickell@stanford.edu>
+ *             Havoc Pennington <hp@redhat.com>
+ *             Stefano Karapetsas <stefano@karapetsas.com>
+ *             Friedrich Herbst <frimam@web.de>
+ *
+ * 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.
+ */
+
+#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 <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.
+
+#include <gdk/gdkx.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "mate-metacity-support.h"
+#include "wm-common.h"<--- Include file: "wm-common.h" not found.
+#include "capplet-util.h"<--- Include file: "capplet-util.h" not found.
+
+#define MARCO_SCHEMA "org.mate.Marco.general"
+#define INTERFACE_SCHEMA "org.mate.interface"
+
+#define GTK_BUTTON_LAYOUT_KEY "gtk-decoration-layout"
+
+#define MARCO_CENTER_NEW_WINDOWS_KEY "center-new-windows"
+#define MARCO_ALLOW_TILING_KEY "allow-tiling"
+#define MARCO_ALLOW_TOP_TILING_KEY "allow-top-tiling"
+#define MARCO_SHOW_TAB_BORDER_KEY "show-tab-border"
+#define MARCO_BUTTON_LAYOUT_KEY "button-layout"
+#define MARCO_DOUBLE_CLICK_TITLEBAR_KEY "action-double-click-titlebar"
+#define MARCO_FOCUS_KEY "focus-mode"
+#define MARCO_AUTORAISE_KEY "auto-raise"
+#define MARCO_AUTORAISE_DELAY_KEY "auto-raise-delay"
+#define MARCO_MOUSE_MODIFIER_KEY "mouse-button-modifier"
+
+#define MARCO_COMPOSITING_MANAGER_KEY "compositing-manager"
+#define MARCO_COMPOSITING_FAST_ALT_TAB_KEY "compositing-fast-alt-tab"
+
+enum
+{
+    MARCO_BUTTON_LAYOUT_RIGHT_WITH_MENU = 0,
+    MARCO_BUTTON_LAYOUT_LEFT_WITH_MENU,
+    MARCO_BUTTON_LAYOUT_RIGHT,
+    MARCO_BUTTON_LAYOUT_LEFT,
+    MARCO_BUTTON_LAYOUT_COUNT
+};
+
+static const char *button_layout [MARCO_BUTTON_LAYOUT_COUNT] = {
+   [MARCO_BUTTON_LAYOUT_RIGHT_WITH_MENU] = "menu:minimize,maximize,close",
+   [MARCO_BUTTON_LAYOUT_LEFT_WITH_MENU]  = "close,minimize,maximize:menu",
+   [MARCO_BUTTON_LAYOUT_RIGHT]           = ":minimize,maximize,close",
+   [MARCO_BUTTON_LAYOUT_LEFT]            = "close,minimize,maximize:"
+};
+
+/* keep following enums in sync with marco */
+enum
+{
+    ACTION_TITLEBAR_TOGGLE_SHADE,
+    ACTION_TITLEBAR_TOGGLE_MAXIMIZE,
+    ACTION_TITLEBAR_TOGGLE_MAXIMIZE_HORIZONTALLY,
+    ACTION_TITLEBAR_TOGGLE_MAXIMIZE_VERTICALLY,
+    ACTION_TITLEBAR_MINIMIZE,
+    ACTION_TITLEBAR_NONE,
+    ACTION_TITLEBAR_LOWER,
+    ACTION_TITLEBAR_MENU
+};
+
+enum
+{
+    FOCUS_MODE_CLICK,
+    FOCUS_MODE_SLOPPY,
+    FOCUS_MODE_MOUSE
+};
+
+typedef struct
+{
+    int number;
+    char *name;
+    const char *value; /* machine-readable name for storing config */
+    GtkWidget *radio;
+} MouseClickModifier;
+
+static GtkWidget *dialog_win;
+
+/* Behaviour */
+static GtkWidget *show_tab_border_checkbutton;
+static GtkWidget *compositing_fast_alt_tab_checkbutton;
+static GtkWidget *double_click_titlebar_optionmenu;
+static GtkWidget *focus_mode_checkbutton;
+static GtkWidget *focus_mode_mouse_checkbutton;
+static GtkWidget *autoraise_checkbutton;
+static GtkWidget *autoraise_delay_spinbutton;
+static GtkWidget *autoraise_delay_hbox;
+static GtkWidget *movement_description_label;
+static GtkWidget *alt_click_vbox;
+
+/* Placement */
+static GtkWidget *center_new_windows_checkbutton;
+static GtkWidget *enable_tiling_checkbutton;
+static GtkWidget *allow_top_tiling_checkbutton;
+static GtkWidget *titlebar_layout_optionmenu;
+
+/* Compositing Manager */
+static GtkWidget *compositing_checkbutton;
+
+static GSettings *marco_settings;
+static GSettings *interface_settings;
+
+static MouseClickModifier *mouse_modifiers = NULL;
+static int n_mouse_modifiers = 0;
+
+static void reload_mouse_modifiers (void);
+
+static void
+update_sensitivity (void)
+{
+    gtk_widget_set_sensitive (compositing_fast_alt_tab_checkbutton,
+                              g_settings_get_boolean (marco_settings, MARCO_COMPOSITING_MANAGER_KEY));
+    gtk_widget_set_sensitive (allow_top_tiling_checkbutton,
+                              g_settings_get_boolean (marco_settings, MARCO_ALLOW_TILING_KEY));
+    gtk_widget_set_sensitive (focus_mode_mouse_checkbutton,
+                              g_settings_get_enum (marco_settings, MARCO_FOCUS_KEY) != FOCUS_MODE_CLICK);
+    gtk_widget_set_sensitive (autoraise_delay_hbox,
+                              g_settings_get_enum (marco_settings, MARCO_FOCUS_KEY) != FOCUS_MODE_CLICK);
+    gtk_widget_set_sensitive (autoraise_delay_spinbutton,
+                              g_settings_get_enum (marco_settings, MARCO_FOCUS_KEY) != FOCUS_MODE_CLICK &&
+                              g_settings_get_boolean (marco_settings, MARCO_AUTORAISE_KEY));
+}
+
+static void
+marco_settings_changed_callback (GSettings *settings,
+                                 const gchar *key,
+                                 gpointer user_data)
+{
+    update_sensitivity ();
+}
+
+static void
+mouse_focus_toggled_callback (GtkWidget *button,
+                              void      *data)
+{
+    if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (focus_mode_checkbutton))) {
+        g_settings_set_enum (marco_settings,
+                             MARCO_FOCUS_KEY,
+                             gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (focus_mode_mouse_checkbutton)) ?
+                             FOCUS_MODE_MOUSE : FOCUS_MODE_SLOPPY);
+    }
+    else {
+        g_settings_set_enum (marco_settings, MARCO_FOCUS_KEY, FOCUS_MODE_CLICK);
+    }
+}
+
+static void
+mouse_focus_changed_callback (GSettings *settings,
+                              const gchar *key,
+                              gpointer user_data)
+{
+    if (g_settings_get_enum (settings, key) == FOCUS_MODE_MOUSE) {
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (focus_mode_checkbutton), TRUE);
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (focus_mode_mouse_checkbutton), TRUE);
+    }
+    else if (g_settings_get_enum (settings, key) == FOCUS_MODE_SLOPPY) {
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (focus_mode_checkbutton), TRUE);
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (focus_mode_mouse_checkbutton), FALSE);
+    }
+    else {
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (focus_mode_checkbutton), FALSE);
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (focus_mode_mouse_checkbutton), FALSE);
+    }
+}
+
+static void
+autoraise_delay_spinbutton_value_callback (GtkWidget *spinbutton,
+                                           void      *data)
+{
+    g_settings_set_int (marco_settings,
+                        MARCO_AUTORAISE_DELAY_KEY,
+                        gtk_spin_button_get_value (GTK_SPIN_BUTTON (spinbutton)) * 1000);
+}
+
+static void
+double_click_titlebar_changed_callback (GtkWidget *optionmenu,
+                                        void      *data)
+{
+    g_settings_set_enum (marco_settings, MARCO_DOUBLE_CLICK_TITLEBAR_KEY,
+                         gtk_combo_box_get_active (GTK_COMBO_BOX (optionmenu)));
+}
+
+static gchar *custom_titlebar_button_layout = NULL;
+
+static void
+titlebar_layout_changed_callback (GtkWidget *optionmenu)
+{
+    gint value = gtk_combo_box_get_active (GTK_COMBO_BOX (optionmenu));
+
+    if (value < MARCO_BUTTON_LAYOUT_COUNT) {
+        g_settings_set_string (marco_settings, MARCO_BUTTON_LAYOUT_KEY, button_layout[value]);
+        g_settings_set_string (interface_settings, GTK_BUTTON_LAYOUT_KEY, button_layout[value]);
+    }
+    /* Custom Layout */
+    else if ((value == MARCO_BUTTON_LAYOUT_COUNT) && custom_titlebar_button_layout) {
+        g_settings_set_string (marco_settings, MARCO_BUTTON_LAYOUT_KEY, custom_titlebar_button_layout);
+        g_settings_set_string (interface_settings, GTK_BUTTON_LAYOUT_KEY, custom_titlebar_button_layout);
+    }
+}
+
+static void
+set_titlebar_button_layout(void)
+{
+    gchar    *str;
+    gboolean  found = FALSE;
+
+    str = g_settings_get_string (marco_settings, MARCO_BUTTON_LAYOUT_KEY);
+    for (gint i = 0; i < MARCO_BUTTON_LAYOUT_COUNT; i++) {
+        if (g_strcmp0 (str, button_layout[i]) == 0) {
+            gtk_combo_box_set_active (GTK_COMBO_BOX (titlebar_layout_optionmenu), i);
+            found = TRUE;
+            break;
+        }
+    }
+    /* A custom value is found in MARCO_BUTTON_LAYOUT_KEY
+     * (maybe the user changed the value in dconf-editor) */
+    if (!found) {
+        g_free (custom_titlebar_button_layout);
+        custom_titlebar_button_layout = g_strdup(str);
+        gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (titlebar_layout_optionmenu), _("Custom"));
+        gtk_combo_box_set_active (GTK_COMBO_BOX (titlebar_layout_optionmenu), 4);
+    }
+
+    g_free(str);
+}
+
+static void
+alt_click_radio_toggled_callback (GtkWidget *radio,
+                                  void      *data)
+{
+    MouseClickModifier *modifier = data;
+    gboolean active;
+    gchar *value;
+
+    active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio));
+
+    if (active) {
+        value = g_strdup_printf ("<%s>", modifier->value);
+        g_settings_set_string (marco_settings, MARCO_MOUSE_MODIFIER_KEY, value);
+        g_free (value);
+    }
+}
+
+static void
+set_alt_click_value (void)
+{
+    gboolean match_found = FALSE;
+    gchar *mouse_move_modifier;
+    gchar *value;
+    int i;
+
+    mouse_move_modifier = g_settings_get_string (marco_settings, MARCO_MOUSE_MODIFIER_KEY);
+
+    /* We look for a matching modifier and set it. */
+    if (mouse_move_modifier != NULL) {
+        for (i = 0; i < n_mouse_modifiers; i ++) {
+            value = g_strdup_printf ("<%s>", mouse_modifiers[i].value);
+            if (strcmp (value, mouse_move_modifier) == 0) {
+                gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (mouse_modifiers[i].radio), TRUE);
+                match_found = TRUE;
+                break;
+            }
+            g_free (value);
+        }
+        g_free (mouse_move_modifier);
+    }
+
+    /* No matching modifier was found; we set all the toggle buttons to be
+     * insensitive. */
+    for (i = 0; i < n_mouse_modifiers; i++) {
+        gtk_toggle_button_set_inconsistent (GTK_TOGGLE_BUTTON (mouse_modifiers[i].radio), ! match_found);
+    }
+}
+
+static void
+wm_unsupported (void)
+{
+    GtkWidget *no_tool_dialog;
+
+    no_tool_dialog = gtk_message_dialog_new (NULL,
+                                             GTK_DIALOG_DESTROY_WITH_PARENT,
+                                             GTK_MESSAGE_ERROR,
+                                             GTK_BUTTONS_CLOSE,
+                                             " ");
+    gtk_window_set_title (GTK_WINDOW (no_tool_dialog), "");
+    gtk_window_set_resizable (GTK_WINDOW (no_tool_dialog), FALSE);
+
+    gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (no_tool_dialog), _("The current window manager is unsupported"));
+
+    gtk_dialog_run (GTK_DIALOG (no_tool_dialog));
+
+    gtk_widget_destroy (no_tool_dialog);
+}
+
+static void
+wm_changed_callback (GdkScreen *screen,
+                     void      *data)
+{
+    const char *current_wm;
+
+    current_wm = gdk_x11_screen_get_window_manager_name (screen);
+
+    gtk_widget_set_sensitive (dialog_win, g_strcmp0 (current_wm, WM_COMMON_MARCO) == 0);
+}
+
+static void
+response_cb (GtkWidget *dialog_win,
+             int    response_id,
+             void      *data)
+{
+
+    if (response_id == GTK_RESPONSE_HELP) {
+        capplet_help (GTK_WINDOW (dialog_win), "goscustdesk-58");
+    } else {
+        gtk_widget_destroy (dialog_win);
+    }
+}
+
+int
+main (int argc, char **argv)
+{
+    GtkBuilder *builder;
+    GdkScreen  *screen;
+    GtkWidget  *nb;
+    const char *current_wm;
+    int i;
+
+    capplet_init (NULL, &argc, &argv);
+
+    screen = gdk_display_get_default_screen (gdk_display_get_default ());
+    current_wm = gdk_x11_screen_get_window_manager_name (screen);
+
+    if (g_strcmp0 (current_wm, WM_COMMON_METACITY) == 0) {
+        mate_metacity_config_tool ();
+        return 0;
+    }
+
+    if (g_strcmp0 (current_wm, WM_COMMON_MARCO) != 0) {
+        wm_unsupported ();
+        return 1;
+    }
+
+    builder = gtk_builder_new_from_resource ("/org/mate/mcc/windows/window-properties.ui");
+
+    gtk_builder_add_callback_symbols (builder,
+                                      "on_dialog_win_response",                        G_CALLBACK (response_cb),
+                                      "on_double_click_titlebar_optionmenu_changed",   G_CALLBACK (double_click_titlebar_changed_callback),
+                                      "on_autoraise_delay_spinbutton_value_changed",   G_CALLBACK (autoraise_delay_spinbutton_value_callback),
+                                      "on_titlebar_layout_optionmenu_changed",         G_CALLBACK (titlebar_layout_changed_callback),
+                                      "on_focus_mode_checkbutton_toggled",             G_CALLBACK (mouse_focus_toggled_callback),
+                                      "on_focus_mode_mouse_checkbutton_toggled",       G_CALLBACK (mouse_focus_toggled_callback),
+                                      NULL);
+
+    gtk_builder_connect_signals (builder, NULL);
+
+    #define GET_WIDGET(x) GTK_WIDGET(gtk_builder_get_object(builder, x))
+
+    /* Window */
+    dialog_win = GET_WIDGET ("dialog_win");
+
+    /* Notebook */
+    nb = GET_WIDGET ("nb");
+    gtk_widget_add_events (nb, GDK_SCROLL_MASK);
+    g_signal_connect (nb,
+                      "scroll-event",
+                      G_CALLBACK (capplet_notebook_scroll_event_cb),
+                      NULL);
+
+    /* Behaviour */
+    show_tab_border_checkbutton = GET_WIDGET ("show_tab_border_checkbutton");
+    compositing_fast_alt_tab_checkbutton = GET_WIDGET ("compositing_fast_alt_tab_checkbutton");
+    double_click_titlebar_optionmenu = GET_WIDGET ("double_click_titlebar_optionmenu");
+    focus_mode_checkbutton = GET_WIDGET ("focus_mode_checkbutton");
+    focus_mode_mouse_checkbutton = GET_WIDGET ("focus_mode_mouse_checkbutton");
+    autoraise_delay_hbox = GET_WIDGET ("autoraise_delay_hbox");
+    autoraise_checkbutton = GET_WIDGET ("autoraise_checkbutton");
+    autoraise_delay_spinbutton = GET_WIDGET ("autoraise_delay_spinbutton");
+    movement_description_label = GET_WIDGET ("movement_description_label");
+    alt_click_vbox = GET_WIDGET ("alt_click_vbox");
+
+    /* Placement */
+    center_new_windows_checkbutton = GET_WIDGET ("center_new_windows_checkbutton");
+    enable_tiling_checkbutton = GET_WIDGET ("enable_tiling_checkbutton");
+    allow_top_tiling_checkbutton = GET_WIDGET ("allow_top_tiling_checkbutton");
+    titlebar_layout_optionmenu = GET_WIDGET ("titlebar_layout_optionmenu");
+
+    /* Compositing Manager */
+    compositing_checkbutton = GET_WIDGET ("compositing_checkbutton");
+
+    g_object_unref (builder);
+
+    #undef GET_WIDGET
+
+    /* Load settings */
+    marco_settings = g_settings_new (MARCO_SCHEMA);
+    interface_settings = g_settings_new (INTERFACE_SCHEMA);
+
+    reload_mouse_modifiers ();
+
+    gtk_combo_box_set_active (GTK_COMBO_BOX (double_click_titlebar_optionmenu),
+                              g_settings_get_enum (marco_settings, MARCO_DOUBLE_CLICK_TITLEBAR_KEY));
+
+    set_titlebar_button_layout ();
+
+    set_alt_click_value ();
+
+    gtk_combo_box_set_active (GTK_COMBO_BOX (double_click_titlebar_optionmenu),
+                              g_settings_get_enum (marco_settings, MARCO_DOUBLE_CLICK_TITLEBAR_KEY));
+
+    /* Behaviour */
+    g_settings_bind (marco_settings,
+                     MARCO_SHOW_TAB_BORDER_KEY,
+                     show_tab_border_checkbutton,
+                     "active",
+                     G_SETTINGS_BIND_DEFAULT);
+
+    g_settings_bind (marco_settings,
+                     MARCO_COMPOSITING_FAST_ALT_TAB_KEY,
+                     compositing_fast_alt_tab_checkbutton,
+                     "active",
+                     G_SETTINGS_BIND_DEFAULT | G_SETTINGS_BIND_INVERT_BOOLEAN);
+
+    /* Placement */
+    g_settings_bind (marco_settings,
+                     MARCO_CENTER_NEW_WINDOWS_KEY,
+                     center_new_windows_checkbutton,
+                     "active",
+                     G_SETTINGS_BIND_DEFAULT);
+
+    g_settings_bind (marco_settings,
+                     MARCO_ALLOW_TILING_KEY,
+                     enable_tiling_checkbutton,
+                     "active",
+                     G_SETTINGS_BIND_DEFAULT);
+
+    g_settings_bind (marco_settings,
+                     MARCO_ALLOW_TOP_TILING_KEY,
+                     allow_top_tiling_checkbutton,
+                     "active",
+                     G_SETTINGS_BIND_DEFAULT);
+
+    /* Compositing Manager */
+    g_settings_bind (marco_settings,
+                     MARCO_COMPOSITING_MANAGER_KEY,
+                     compositing_checkbutton,
+                     "active",
+                     G_SETTINGS_BIND_DEFAULT);
+
+    /* Initialize the checkbox state appropriately */
+    mouse_focus_changed_callback(marco_settings, MARCO_FOCUS_KEY, NULL);
+
+    g_settings_bind (marco_settings,
+                     MARCO_AUTORAISE_KEY,
+                     autoraise_checkbutton,
+                     "active",
+                     G_SETTINGS_BIND_DEFAULT);
+
+    g_signal_connect (dialog_win, "destroy",
+                      G_CALLBACK (gtk_main_quit), NULL);
+
+    g_signal_connect (marco_settings, "changed",
+                      G_CALLBACK (marco_settings_changed_callback), NULL);
+
+    g_signal_connect (marco_settings, "changed::" MARCO_FOCUS_KEY,
+                      G_CALLBACK (mouse_focus_changed_callback), NULL);
+
+    g_signal_connect (screen, "window_manager_changed",
+                      G_CALLBACK (wm_changed_callback), NULL);
+
+    i = 0;
+    while (i < n_mouse_modifiers) {
+        g_signal_connect (mouse_modifiers[i].radio, "toggled",
+                          G_CALLBACK (alt_click_radio_toggled_callback),
+                          &mouse_modifiers[i]);
+        ++i;
+    }
+
+    /* update sensitivity */
+    update_sensitivity ();
+
+    gtk_widget_show_all (dialog_win);
+
+    gtk_main ();
+
+    g_object_unref (marco_settings);
+    g_object_unref (interface_settings);
+
+    g_free (custom_titlebar_button_layout);
+
+    return 0;
+}
+
+#include <X11/Xlib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <X11/keysym.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.
+
+static void
+fill_radio (GtkRadioButton     *group,
+        MouseClickModifier *modifier)
+{
+    modifier->radio = gtk_radio_button_new_with_mnemonic_from_widget (group, modifier->name);
+    gtk_box_pack_start (GTK_BOX (alt_click_vbox), modifier->radio, FALSE, FALSE, 0);
+
+    gtk_widget_show (modifier->radio);
+}
+
+static void
+reload_mouse_modifiers (void)
+{
+    XModifierKeymap *modmap;
+    KeySym *keymap;
+    int keysyms_per_keycode;
+    int map_size;
+    int i;
+    gboolean have_meta;
+    gboolean have_hyper;
+    gboolean have_super;
+    int min_keycode, max_keycode;
+    int mod_meta, mod_super, mod_hyper;
+    AtkObject *label_accessible;
+
+    XDisplayKeycodes (gdk_x11_display_get_xdisplay(gdk_display_get_default()),
+                      &min_keycode,
+                      &max_keycode);
+
+    keymap = XGetKeyboardMapping (gdk_x11_display_get_xdisplay(gdk_display_get_default()),
+                                  min_keycode,
+                                  max_keycode - min_keycode,
+                                  &keysyms_per_keycode);
+
+    modmap = XGetModifierMapping (gdk_x11_display_get_xdisplay(gdk_display_get_default()));
+
+    have_super = FALSE;
+    have_meta = FALSE;
+    have_hyper = FALSE;
+
+    /* there are 8 modifiers, and the first 3 are shift, shift lock,
+     * and control
+     */
+    map_size = 8 * modmap->max_keypermod;
+    i = 3 * modmap->max_keypermod;
+    mod_meta = mod_super = mod_hyper = 0;
+    while (i < map_size) {
+        /* get the key code at this point in the map,
+         * see if its keysym is one we're interested in
+         */
+        int keycode = modmap->modifiermap[i];
+
+        if (keycode >= min_keycode &&
+            keycode <= max_keycode) {
+            int j = 0;
+            KeySym *syms = keymap + (keycode - min_keycode) * keysyms_per_keycode;<--- Variable 'syms' can be declared as pointer to const
+
+            while (j < keysyms_per_keycode) {
+                if (syms[j] == XK_Super_L || syms[j] == XK_Super_R)
+                    mod_super = i / modmap->max_keypermod;
+                else if (syms[j] == XK_Hyper_L || syms[j] == XK_Hyper_R)
+                    mod_hyper = i / modmap->max_keypermod;
+                else if ((syms[j] == XK_Meta_L || syms[j] == XK_Meta_R))
+                    mod_meta = i / modmap->max_keypermod;
+                ++j;
+            }
+        }
+
+        ++i;
+    }
+
+    if ((1 << mod_meta) != Mod1Mask)
+        have_meta = TRUE;
+    if (mod_super != 0 && mod_super != mod_meta)
+        have_super = TRUE;
+    if (mod_hyper != 0 && mod_hyper != mod_meta && mod_hyper != mod_super)
+        have_hyper = TRUE;
+
+    XFreeModifiermap (modmap);
+    XFree (keymap);
+
+    i = 0;
+    while (i < n_mouse_modifiers) {
+        g_free (mouse_modifiers[i].name);
+        if (mouse_modifiers[i].radio)
+            gtk_widget_destroy (mouse_modifiers[i].radio);
+        ++i;
+    }
+    g_free (mouse_modifiers);
+    mouse_modifiers = NULL;
+
+    n_mouse_modifiers = 1; /* alt */
+    if (have_super)
+        ++n_mouse_modifiers;
+    if (have_hyper)
+        ++n_mouse_modifiers;
+    if (have_meta)
+        ++n_mouse_modifiers;
+
+    mouse_modifiers = g_new0 (MouseClickModifier, n_mouse_modifiers);
+
+    i = 0;
+
+    mouse_modifiers[i].number = i;
+    mouse_modifiers[i].name = g_strdup (_("_Alt"));
+    mouse_modifiers[i].value = "Alt";
+    ++i;
+
+    if (have_hyper) {
+        mouse_modifiers[i].number = i;
+        mouse_modifiers[i].name = g_strdup (_("H_yper"));
+        mouse_modifiers[i].value = "Hyper";
+        ++i;
+    }
+
+    if (have_super) {
+        mouse_modifiers[i].number = i;
+        mouse_modifiers[i].name = g_strdup (_("S_uper (or \"Windows logo\")"));
+        mouse_modifiers[i].value = "Super";
+        ++i;
+    }
+
+    if (have_meta) {
+        mouse_modifiers[i].number = i;
+        mouse_modifiers[i].name = g_strdup (_("_Meta"));
+        mouse_modifiers[i].value = "Meta";
+        ++i;
+    }
+
+    g_assert (i == n_mouse_modifiers);
+
+    i = 0;
+    while (i < n_mouse_modifiers) {
+        fill_radio (i == 0 ? NULL : GTK_RADIO_BUTTON (mouse_modifiers[i-1].radio), &mouse_modifiers[i]);
+        ++i;
+    }
+
+    /* set up accessibility relationships between the main label and each
+     * radio button, because GTK doesn't do it for us (usually, it expects the
+     * label of the radio button to be enough, but our case is better served
+     * with associating the main label as well). */
+    label_accessible = gtk_widget_get_accessible (movement_description_label);
+    if (ATK_IS_OBJECT (label_accessible)) {
+        for (i = 0; i < n_mouse_modifiers; i++) {
+            AtkObject *radio_accessible = gtk_widget_get_accessible (mouse_modifiers[i].radio);
+            if (ATK_IS_OBJECT (radio_accessible)) {
+                atk_object_add_relationship (label_accessible,
+                                             ATK_RELATION_LABEL_FOR,
+                                             radio_accessible);
+                atk_object_add_relationship (radio_accessible,
+                                             ATK_RELATION_LABELLED_BY,
+                                             label_accessible);
+            }
+        }
+    }
+}
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/95.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/95.html new file mode 100644 index 00000000..5242e264 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/95.html @@ -0,0 +1,1561 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- mode: C; c-basic-offset: 4 -*-
+ * mate-font-view:
+ *
+ * Copyright (C) 2012 Cosimo Cecchi <cosimoc@gnome.org>
+ * Copyright (C) 2013-2021 MATE Developers
+ *
+ * based on code from
+ *
+ * fontilus - a collection of font utilities for MATE
+ * Copyright (C) 2002-2003  James Henstridge <james@daa.com.au>
+ *
+ *
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <errno.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/stat.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/types.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 <ft2build.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include FT_FREETYPE_H
+#include <fontconfig/fontconfig.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define MATE_DESKTOP_USE_UNSTABLE_API
+#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 "font-model.h"
+#include "font-utils.h"
+#include "sushi-font-loader.h"
+
+struct _FontViewModelPrivate {
+    /* list of fonts in fontconfig database */
+    FcFontSet *font_list;
+    GMutex font_list_mutex;
+
+    FT_Library library;
+
+    GList *monitors;
+    GdkPixbuf *fallback_icon;
+    GCancellable *cancellable;
+};
+
+enum {
+    CONFIG_CHANGED,
+    NUM_SIGNALS
+};
+
+static guint signals[NUM_SIGNALS] = { 0, };
+
+G_DEFINE_TYPE_WITH_PRIVATE (FontViewModel, font_view_model, GTK_TYPE_LIST_STORE);
+
+#define ATTRIBUTES_FOR_CREATING_THUMBNAIL \
+    G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE"," \
+    G_FILE_ATTRIBUTE_TIME_MODIFIED
+#define ATTRIBUTES_FOR_EXISTING_THUMBNAIL \
+    G_FILE_ATTRIBUTE_THUMBNAIL_PATH"," \
+    G_FILE_ATTRIBUTE_THUMBNAILING_FAILED
+
+typedef struct {
+    const gchar *file;<--- struct member 'IterForFaceData::file' is never used.
+    FT_Face face;
+    GtkTreeIter iter;
+    gboolean found;
+} IterForFaceData;
+
+static gboolean
+iter_for_face_foreach (GtkTreeModel *model,
+                       GtkTreePath *path,
+                       GtkTreeIter *iter,
+                       gpointer user_data)
+{
+    IterForFaceData *data = user_data;
+    gchar *font_name, *match_name;
+    gboolean retval;
+
+    gtk_tree_model_get (GTK_TREE_MODEL (model), iter,
+                        COLUMN_NAME, &font_name,
+                        -1);
+
+    match_name = font_utils_get_font_name (data->face);
+    retval = (g_strcmp0 (font_name, match_name) == 0);
+
+    g_free (match_name);
+    g_free (font_name);
+
+    if (retval) {
+        data->iter = *iter;
+        data->found = TRUE;
+    }
+
+    return retval;
+}
+
+gboolean
+font_view_model_get_iter_for_face (FontViewModel *self,
+                                   FT_Face face,
+                                   GtkTreeIter *iter)
+{
+    IterForFaceData *data = g_slice_new0 (IterForFaceData);
+    gboolean found;
+
+    data->face = face;
+    data->found = FALSE;
+
+    gtk_tree_model_foreach (GTK_TREE_MODEL (self),
+                            iter_for_face_foreach,
+                            data);
+
+    found = data->found;
+    if (found && iter)
+        *iter = data->iter;
+
+    g_slice_free (IterForFaceData, data);
+
+    return found;
+}
+
+typedef struct {
+    FontViewModel *self;
+    GFile *font_file;
+    gchar *font_path;
+    gint face_index;
+    gchar *uri;
+    GdkPixbuf *pixbuf;
+    GtkTreeIter iter;
+} ThumbInfoData;
+
+static void
+thumb_info_data_free (gpointer user_data)
+{
+    ThumbInfoData *thumb_info = user_data;
+
+    g_object_unref (thumb_info->self);
+    g_object_unref (thumb_info->font_file);
+    g_clear_object (&thumb_info->pixbuf);
+    g_free (thumb_info->font_path);
+    g_free (thumb_info->uri);
+
+    g_slice_free (ThumbInfoData, thumb_info);
+}
+
+static gboolean
+one_thumbnail_done (gpointer user_data)
+{
+    ThumbInfoData *thumb_info = user_data;
+
+    if (thumb_info->pixbuf != NULL)
+        gtk_list_store_set (GTK_LIST_STORE (thumb_info->self), &(thumb_info->iter),
+                            COLUMN_ICON, thumb_info->pixbuf,
+                            -1);
+
+    thumb_info_data_free (thumb_info);
+
+    return FALSE;
+}
+
+static GdkPixbuf *
+create_thumbnail (ThumbInfoData *thumb_info)
+{
+    GFile *file = thumb_info->font_file;
+    MateDesktopThumbnailFactory *factory;
+    guint64 mtime;
+
+    GdkPixbuf *pixbuf = NULL;
+    GFileInfo *info = NULL;
+
+    info = g_file_query_info (file, ATTRIBUTES_FOR_CREATING_THUMBNAIL,
+                              G_FILE_QUERY_INFO_NONE,
+                              NULL, NULL);
+
+    /* we don't care about reporting errors here, just fail the
+     * thumbnail.
+     */
+    if (info == NULL)
+        goto out;
+
+    mtime = g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED);
+
+    factory = mate_desktop_thumbnail_factory_new (MATE_DESKTOP_THUMBNAIL_SIZE_NORMAL);
+    pixbuf = mate_desktop_thumbnail_factory_generate_thumbnail
+        (factory,
+         thumb_info->uri, g_file_info_get_content_type (info));
+
+    if (pixbuf != NULL)
+        mate_desktop_thumbnail_factory_save_thumbnail (factory, pixbuf,
+                                                       thumb_info->uri, (time_t) mtime);
+    else
+        mate_desktop_thumbnail_factory_create_failed_thumbnail (factory,
+                                                                thumb_info->uri, (time_t) mtime);
+
+  g_object_unref (factory);
+
+ out:
+  g_clear_object (&info);
+
+  return pixbuf;
+}
+
+static void
+ensure_thumbnails_job (GTask *task,
+                       gpointer source_object,
+                       gpointer user_data,
+                       GCancellable *cancellable)
+{
+    GList *thumb_infos = user_data, *l;
+
+    for (l = thumb_infos; l != NULL; l = l->next) {
+        gboolean thumb_failed;
+        gchar *thumb_path = NULL;
+        ThumbInfoData *thumb_info = l->data;
+
+        GError *error = NULL;
+        GFile *thumb_file = NULL;
+        GFileInputStream *is = NULL;
+        GFileInfo *info = NULL;
+
+        if (thumb_info->face_index == 0) {
+            thumb_info->uri = g_file_get_uri (thumb_info->font_file);
+            info = g_file_query_info (thumb_info->font_file,
+                                      ATTRIBUTES_FOR_EXISTING_THUMBNAIL,
+                                      G_FILE_QUERY_INFO_NONE,
+                                      NULL, &error);
+
+            if (error != NULL) {
+                gchar *font_path;
+
+                font_path = g_file_get_path (thumb_info->font_file);
+                g_debug ("Can't query info for file %s: %s\n", font_path, error->message);
+                g_free (font_path);
+
+                goto next;
+            }
+
+            thumb_failed = g_file_info_get_attribute_boolean (info, G_FILE_ATTRIBUTE_THUMBNAILING_FAILED);
+            if (thumb_failed)
+                goto next;
+
+            thumb_path = g_strdup (g_file_info_get_attribute_byte_string (info, G_FILE_ATTRIBUTE_THUMBNAIL_PATH));
+        } else {
+            gchar *file_uri;
+            gchar *checksum;
+            gchar *filename;
+
+            file_uri = g_file_get_uri (thumb_info->font_file);
+            thumb_info->uri = g_strdup_printf ("%s#0x%08X", file_uri, thumb_info->face_index);
+            g_free (file_uri);
+
+            checksum = g_compute_checksum_for_data (G_CHECKSUM_MD5,
+                                                    (const guchar *) thumb_info->uri,
+                                                    strlen (thumb_info->uri));
+            filename = g_strdup_printf ("%s.png", checksum);
+            g_free (checksum);
+
+            thumb_path = g_build_filename (g_get_user_cache_dir (),
+                                           "thumbnails",
+                                           "large",
+                                           filename,
+                                           NULL);
+            g_free (filename);
+
+            if (!g_file_test (thumb_path, G_FILE_TEST_IS_REGULAR)) {
+                g_clear_pointer (&thumb_path, g_free);
+            }
+        }
+
+        if (thumb_path != NULL) {
+            thumb_file = g_file_new_for_path (thumb_path);
+            is = g_file_read (thumb_file, NULL, &error);
+
+            if (error != NULL) {
+                g_debug ("Can't read file %s: %s\n", thumb_path, error->message);
+                goto next;
+            }
+
+            thumb_info->pixbuf = gdk_pixbuf_new_from_stream_at_scale (G_INPUT_STREAM (is),
+                                                                      128, 128, TRUE,
+                                                                      NULL, &error);
+
+            if (error != NULL) {
+                g_debug ("Can't read thumbnail pixbuf %s: %s\n", thumb_path, error->message);
+                goto next;
+            }
+        } else {
+            thumb_info->pixbuf = create_thumbnail (thumb_info);
+        }
+
+    next:
+        g_clear_error (&error);
+        g_clear_object (&is);
+        g_clear_object (&thumb_file);
+        g_clear_object (&info);
+        g_clear_pointer (&thumb_path, g_free);
+
+        g_main_context_invoke (NULL, one_thumbnail_done,
+                               thumb_info);
+    }
+
+    g_list_free (thumb_infos);
+}
+
+typedef struct {
+    gchar *font_path;
+    gint face_index;
+    gchar *font_name;
+} FontInfoData;
+
+static void
+font_info_data_free (gpointer user_data)
+{
+    FontInfoData *font_info = user_data;
+
+    g_free (font_info->font_path);
+    g_free (font_info->font_name);
+    g_slice_free (FontInfoData, font_info);
+}
+
+static void
+font_infos_loaded (GObject *source_object,
+                   GAsyncResult *result,
+                   gpointer user_data)
+{
+    FontViewModel *self = FONT_VIEW_MODEL (source_object);
+    GTask *task = NULL;
+    GList *l, *thumb_infos = NULL;
+    GList *font_infos = g_task_propagate_pointer (G_TASK (result), NULL);
+
+    for (l = font_infos; l != NULL; l = l->next) {
+        FontInfoData *font_info = l->data;
+        gchar *collation_key;
+        GtkTreeIter iter;
+        ThumbInfoData *thumb_info;
+
+        collation_key = g_utf8_collate_key (font_info->font_name, -1);
+        gtk_list_store_insert_with_values (GTK_LIST_STORE (self), &iter, -1,
+                                           COLUMN_NAME, font_info->font_name,
+                                           COLUMN_PATH, font_info->font_path,
+                                           COLUMN_FACE_INDEX, font_info->face_index,
+                                           COLUMN_ICON, self->priv->fallback_icon,
+                                           COLUMN_COLLATION_KEY, collation_key,
+                                           -1);
+        g_free (collation_key);
+
+        thumb_info = g_slice_new0 (ThumbInfoData);
+        thumb_info->font_file = g_file_new_for_path (font_info->font_path);
+        thumb_info->face_index = font_info->face_index;
+        thumb_info->iter = iter;
+        thumb_info->self = g_object_ref (self);
+
+        font_info_data_free (font_info);
+        thumb_infos = g_list_prepend (thumb_infos, thumb_info);
+    }
+
+    g_signal_emit (self, signals[CONFIG_CHANGED], 0);
+    g_list_free (font_infos);
+
+    task = g_task_new (NULL, NULL, NULL, NULL);
+    g_task_set_task_data (task, thumb_infos, NULL);
+    g_task_run_in_thread (task, ensure_thumbnails_job);
+    g_object_unref (task);
+}
+
+static void
+load_font_infos (GTask *task,
+                 gpointer source_object,
+                 gpointer user_data,
+                 GCancellable *cancellable)
+{
+    FontViewModel *self = FONT_VIEW_MODEL (source_object);
+    gint i, n_fonts;
+    GList *font_infos = NULL;
+
+    n_fonts = self->priv->font_list->nfont;
+
+    for (i = 0; i < n_fonts; i++) {
+        FontInfoData *font_info;
+        FcChar8 *file;
+        int index;
+        gchar *font_name;
+
+        if (g_cancellable_is_cancelled (cancellable))
+            break;
+
+        g_mutex_lock (&self->priv->font_list_mutex);
+        FcPatternGetString (self->priv->font_list->fonts[i], FC_FILE, 0, &file);
+        FcPatternGetInteger (self->priv->font_list->fonts[i], FC_INDEX, 0, &index);
+        g_mutex_unlock (&self->priv->font_list_mutex);
+
+        font_name = font_utils_get_font_name_for_file (self->priv->library,
+                                                       (const gchar *) file,
+                                                       index);
+
+        if (!font_name)
+            continue;
+
+        font_info = g_slice_new0 (FontInfoData);
+        font_info->font_name = font_name;
+        font_info->font_path = g_strdup ((const gchar *) file);
+        font_info->face_index = index;
+
+        font_infos = g_list_prepend (font_infos, font_info);
+    }
+
+    g_task_return_pointer (task, font_infos, NULL);
+}
+
+/* make sure the font list is valid */
+static void
+ensure_font_list (FontViewModel *self)
+{
+    FcPattern *pat;
+    FcObjectSet *os;
+    GTask *task;
+
+    /* always reinitialize the font database */
+    if (!FcInitReinitialize())
+        return;
+
+    if (self->priv->cancellable) {
+        g_cancellable_cancel (self->priv->cancellable);
+        g_clear_object (&self->priv->cancellable);
+    }
+
+    gtk_list_store_clear (GTK_LIST_STORE (self));
+
+    pat = FcPatternCreate ();
+    os = FcObjectSetBuild (FC_FILE, FC_INDEX, FC_FAMILY, FC_WEIGHT, FC_SLANT, NULL);
+
+    g_mutex_lock (&self->priv->font_list_mutex);
+
+    if (self->priv->font_list) {
+        FcFontSetDestroy (self->priv->font_list);
+        self->priv->font_list = NULL;
+    }
+
+    self->priv->font_list = FcFontList (NULL, pat, os);
+
+    g_mutex_unlock (&self->priv->font_list_mutex);
+
+    FcPatternDestroy (pat);
+    FcObjectSetDestroy (os);
+
+    if (!self->priv->font_list)
+        return;
+
+    self->priv->cancellable = g_cancellable_new ();
+
+    task = g_task_new (self, self->priv->cancellable, font_infos_loaded, NULL);
+    g_task_set_return_on_cancel (task, TRUE);
+    g_task_run_in_thread (task, load_font_infos);
+}
+
+static gboolean
+ensure_font_list_idle (gpointer user_data)
+{
+    FontViewModel *self = user_data;
+    ensure_font_list (self);
+
+    return FALSE;
+}
+
+static int
+font_view_model_sort_func (GtkTreeModel *model,
+                           GtkTreeIter *a,
+                           GtkTreeIter *b,
+                           gpointer user_data)
+{
+    gchar *key_a = NULL, *key_b = NULL;
+    int retval;
+
+    gtk_tree_model_get (model, a,
+                        COLUMN_COLLATION_KEY, &key_a,
+                        -1);
+    gtk_tree_model_get (model, b,
+                        COLUMN_COLLATION_KEY, &key_b,
+                        -1);
+
+    retval = g_strcmp0 (key_a, key_b);
+
+    g_free (key_a);
+    g_free (key_b);
+
+    return retval;
+}
+
+static void
+file_monitor_changed_cb (GFileMonitor *monitor,
+                         GFile *file,
+                         GFile *other_file,
+                         GFileMonitorEvent event,
+                         gpointer user_data)
+{
+    FontViewModel *self = user_data;
+
+    if (event == G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT ||
+        event == G_FILE_MONITOR_EVENT_DELETED ||
+        event == G_FILE_MONITOR_EVENT_CREATED)
+        ensure_font_list (self);
+}
+
+static void
+create_file_monitors (FontViewModel *self)
+{
+    FcConfig *config;
+    FcStrList *str_list;
+    FcChar8 *path;
+    GFile *file;
+    GFileMonitor *monitor;
+
+    config = FcConfigGetCurrent ();
+    str_list = FcConfigGetFontDirs (config);
+
+    while ((path = FcStrListNext (str_list)) != NULL) {
+        file = g_file_new_for_path ((const gchar *) path);
+        monitor = g_file_monitor (file, G_FILE_MONITOR_NONE,
+                                  NULL, NULL);
+
+        if (monitor != NULL) {
+            self->priv->monitors = g_list_prepend (self->priv->monitors, monitor);
+            g_signal_connect (monitor, "changed",
+                              G_CALLBACK (file_monitor_changed_cb), self);
+        }
+
+        g_object_unref (file);
+    }
+
+    FcStrListDone (str_list);
+}
+
+static GdkPixbuf *
+get_fallback_icon (void)
+{
+    GtkIconTheme *icon_theme;
+    GtkIconInfo *icon_info;
+    GdkPixbuf *pix;
+    GIcon *icon = NULL;
+
+    icon_theme = gtk_icon_theme_get_default ();
+    icon = g_content_type_get_icon ("application/x-font-ttf");
+    icon_info = gtk_icon_theme_lookup_by_gicon (icon_theme, icon,
+                                                128, 0);
+    g_object_unref (icon);
+
+    if (!icon_info)
+        return NULL;
+
+    pix = gtk_icon_info_load_icon (icon_info, NULL);
+    g_object_unref (icon_info);
+
+    return pix;
+}
+
+static void
+font_view_model_init (FontViewModel *self)
+{
+    GType types[NUM_COLUMNS] =
+        { G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, GDK_TYPE_PIXBUF, G_TYPE_STRING };
+
+    self->priv = font_view_model_get_instance_private (self);
+
+    if (FT_Init_FreeType (&self->priv->library) != FT_Err_Ok)
+        g_critical ("Can't initialize FreeType library");
+
+    g_mutex_init (&self->priv->font_list_mutex);
+
+    gtk_list_store_set_column_types (GTK_LIST_STORE (self),
+                                     NUM_COLUMNS, types);
+
+    gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (self),
+                                          COLUMN_NAME,
+                                          GTK_SORT_ASCENDING);
+    gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (self),
+                                     COLUMN_NAME,
+                                     font_view_model_sort_func,
+                                     NULL, NULL);
+
+    self->priv->fallback_icon = get_fallback_icon ();
+
+    g_idle_add (ensure_font_list_idle, self);
+    create_file_monitors (self);
+}
+
+static void
+font_view_model_finalize (GObject *obj)
+{
+    FontViewModel *self = FONT_VIEW_MODEL (obj);
+
+    if (self->priv->cancellable) {
+        g_cancellable_cancel (self->priv->cancellable);
+        g_clear_object (&self->priv->cancellable);
+    }
+
+    if (self->priv->font_list) {
+        FcFontSetDestroy (self->priv->font_list);
+        self->priv->font_list = NULL;
+    }
+
+    if (self->priv->library != NULL) {
+        FT_Done_FreeType (self->priv->library);
+        self->priv->library = NULL;
+    }
+
+    g_mutex_clear (&self->priv->font_list_mutex);
+    g_clear_object (&self->priv->fallback_icon);
+    g_list_free_full (self->priv->monitors, (GDestroyNotify) g_object_unref);
+
+    G_OBJECT_CLASS (font_view_model_parent_class)->finalize (obj);
+}
+
+static void
+font_view_model_class_init (FontViewModelClass *klass)
+{
+    GObjectClass *oclass = G_OBJECT_CLASS (klass);
+    oclass->finalize = font_view_model_finalize;
+
+    signals[CONFIG_CHANGED] =
+        g_signal_new ("config-changed",
+                      FONT_VIEW_TYPE_MODEL,
+                      G_SIGNAL_RUN_FIRST,
+                      0, NULL, NULL, NULL,
+                      G_TYPE_NONE, 0);
+
+}
+
+GtkTreeModel *
+font_view_model_new (void)
+{
+    return g_object_new (FONT_VIEW_TYPE_MODEL, NULL);
+}
+
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/96.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/96.html new file mode 100644 index 00000000..63c2805f --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/96.html @@ -0,0 +1,375 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/* -*- mode: C; c-basic-offset: 4 -*-
+ * mate-font-viewer
+ *
+ * Copyright (C) 2012 Cosimo Cecchi <cosimoc@gnome.org>
+ * Copyright (C) 2013-2021 MATE Developers
+ *
+ * based on font-method.c code from
+ *
+ * fontilus - a collection of font utilities for MATE
+ * Copyright (C) 2002-2003  James Henstridge <james@daa.com.au>
+ *
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+#ifndef __FONT_VIEW_MODEL_H__
+#define __FONT_VIEW_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
+
+typedef enum {
+  COLUMN_NAME,
+  COLUMN_PATH,
+  COLUMN_FACE_INDEX,
+  COLUMN_ICON,
+  COLUMN_COLLATION_KEY,
+  NUM_COLUMNS
+} FontViewModelColumns;
+
+typedef struct _FontViewModelPrivate FontViewModelPrivate;
+
+#define FONT_VIEW_TYPE_MODEL font_view_model_get_type()
+#define FONT_VIEW_MODEL(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_VIEW_TYPE_MODEL, FontViewModel))
+
+typedef struct {
+  GtkListStore parent;
+
+  FontViewModelPrivate *priv;
+} FontViewModel;
+
+typedef struct {
+  GtkListStoreClass parent_class;
+} FontViewModelClass;
+
+GType font_view_model_get_type (void);
+GtkTreeModel * font_view_model_new (void);
+
+gboolean font_view_model_get_iter_for_face (FontViewModel *self,
+                                            FT_Face face,
+                                            GtkTreeIter *iter);
+
+G_END_DECLS
+
+#endif /* __FONT_VIEW_MODEL_H__ */
+
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/97.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/97.html new file mode 100644 index 00000000..dd3e90f7 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/97.html @@ -0,0 +1,307 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/* -*- mode: C; c-basic-offset: 4 -*-
+ * mate-font-viewer:
+ *
+ * Copyright (C) 2012 Cosimo Cecchi <cosimoc@gnome.org>
+ * Copyright (C) 2013-2021 MATE Developers
+ *
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __FONT_UTILS_H__
+#define __FONT_UTILS_H__
+
+#include <ft2build.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include FT_FREETYPE_H
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+gchar * font_utils_get_font_name (FT_Face face);
+gchar * font_utils_get_font_name_for_file (FT_Library library,
+                                           const gchar *path,
+                                           gint face_index);
+
+#endif /* __FONT_UTILS_H__ */
+
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/98.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/98.html new file mode 100644 index 00000000..f23aaa00 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/98.html @@ -0,0 +1,341 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
 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
/*
+ * Copyright (C) 2011 Red Hat, 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., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * The Sushi project hereby grant permission for non-gpl compatible GStreamer
+ * plugins to be used and distributed together with GStreamer and Sushi. This
+ * permission is above and beyond the permissions granted by the GPL license
+ * Sushi is covered by.
+ *
+ * Authors: Cosimo Cecchi <cosimoc@redhat.com>
+ *
+ */
+
+#ifndef __SUSHI_FONT_LOADER_H__
+#define __SUSHI_FONT_LOADER_H__
+
+#include <ft2build.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include FT_FREETYPE_H
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+FT_Face sushi_new_ft_face_from_uri (FT_Library library,
+                                    const gchar *uri,
+                                    gint face_index,
+                                    gchar **contents,
+                                    GError **error);
+
+void sushi_new_ft_face_from_uri_async (FT_Library library,
+                                       const gchar *uri,
+                                       gint face_index,
+                                       GAsyncReadyCallback callback,
+                                       gpointer user_data);
+
+FT_Face sushi_new_ft_face_from_uri_finish (GAsyncResult *result,
+                                           gchar **contents,
+                                           GError **error);
+
+#endif /* __SUSHI_FONT_LOADER_H__ */
+
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/99.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/99.html new file mode 100644 index 00000000..e6400b41 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/99.html @@ -0,0 +1,925 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+
  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
/* -*- mode: C; c-basic-offset: 4 -*- */
+/*
+ * font-thumbnailer: a thumbnailer for font files, using FreeType
+ *
+ * Copyright (C) 2002-2003  James Henstridge <james@daa.com.au>
+ * Copyright (C) 2012 Cosimo Cecchi <cosimoc@gnome.org>
+ * Copyright (C) 2013-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 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.
+#ifdef ENABLE_NLS
+#include <locale.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif /* ENABLE_NLS */
+#include <ft2build.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 FT_FREETYPE_H
+
+#include <gdk/gdk.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 <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.
+
+#include <cairo/cairo-ft.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "sushi-font-loader.h"
+#include "totem-resources.h"
+
+static const gchar *
+get_ft_error (FT_Error error)
+{
+#undef __FTERRORS_H__
+#define FT_ERRORDEF(e,v,s) case e: return s;
+#define FT_ERROR_START_LIST
+#define FT_ERROR_END_LIST
+    switch (error) {
+#include FT_ERRORS_H
+    default:
+	return "unknown";
+    }
+}
+
+#define THUMB_SIZE 128
+#define PADDING_VERTICAL 2
+#define PADDING_HORIZONTAL 4
+
+static gboolean
+check_font_contain_text (FT_Face face,
+                         const gchar *text)
+{
+  gunichar *string;
+  glong len, idx, map;
+  FT_CharMap charmap;
+  gboolean retval;
+
+  string = g_utf8_to_ucs4_fast (text, -1, &len);
+
+  for (map = 0; map < face->num_charmaps; map++) {<--- Assuming condition is false
+    charmap = face->charmaps[map];
+    FT_Set_Charmap (face, charmap);
+
+    retval = TRUE;
+
+    for (idx = 0; idx < len; idx++) {
+      gunichar c = string[idx];
+
+      if (!FT_Get_Char_Index (face, c)) {
+        retval = FALSE;
+        break;
+      }
+    }
+
+    if (retval)
+      break;
+  }
+
+  g_free (string);
+
+  return retval;<--- Uninitialized variable: retval
+}
+
+static gchar *
+check_for_ascii_glyph_numbers (FT_Face face,
+                               gboolean *found_ascii)
+{
+    GString *ascii_string, *string;
+    gulong c;
+    guint glyph, found = 0;
+
+    string = g_string_new (NULL);
+    ascii_string = g_string_new (NULL);
+    *found_ascii = FALSE;
+
+    c = FT_Get_First_Char (face, &glyph);
+
+    do {
+        if (glyph == 65 || glyph == 97) {
+            g_string_append_unichar (ascii_string, (gunichar) c);
+            found++;
+        }
+
+        if (found == 2)
+            break;
+
+        g_string_append_unichar (string, (gunichar) c);
+        c = FT_Get_Next_Char (face, c, &glyph);
+    } while (glyph != 0);
+
+    if (found == 2) {
+        *found_ascii = TRUE;
+        g_string_free (string, TRUE);
+        return g_string_free (ascii_string, FALSE);
+    } else {
+        g_string_free (ascii_string, TRUE);
+        return g_string_free (string, FALSE);
+    }
+}
+
+static gchar *
+build_fallback_thumbstr (FT_Face face)
+{
+    gchar *chars;
+    gint idx, total_chars;
+    GString *retval;
+    gchar *ptr, *end;<--- Variable 'end' can be declared as pointer to const
+    gboolean found_ascii;
+
+    chars = check_for_ascii_glyph_numbers (face, &found_ascii);
+
+    if (found_ascii)
+        return chars;
+
+    idx = 0;
+    retval = g_string_new (NULL);
+    total_chars = g_utf8_strlen (chars, -1);
+
+    while (idx < 2) {
+        total_chars = total_chars / 2;
+        ptr = g_utf8_offset_to_pointer (chars, total_chars);
+        end = g_utf8_find_next_char (ptr, NULL);
+
+        g_string_append_len (retval, ptr, end - ptr);
+        idx++;
+    }
+
+  return g_string_free (retval, FALSE);
+}
+
+int
+main (int argc,
+      char **argv)
+{
+    FT_Error error;
+    FT_Library library;
+    FT_Face face;
+    GFile *file;
+    gint font_size, thumb_size = THUMB_SIZE;
+    gchar *thumbstr_utf8 = NULL, *help, *uri;
+    gchar **arguments = NULL;
+    GOptionContext *context;
+    GError *gerror = NULL;
+    gchar *contents = NULL;
+    gboolean retval, default_thumbstr = TRUE;
+    gint rv = 1;
+    GdkRGBA black = { 0.0, 0.0, 0.0, 1.0 };
+    cairo_surface_t *surface;
+    cairo_t *cr;
+    cairo_text_extents_t text_extents;
+    cairo_font_face_t *font;
+    gchar *str = NULL;
+    gdouble scale, scale_x, scale_y;
+    gint face_index = 0;
+    gchar *fragment;<--- Variable 'fragment' can be declared as pointer to const
+
+    const GOptionEntry options[] = {
+	    { "text", 't', 0, G_OPTION_ARG_STRING, &thumbstr_utf8,
+	      N_("Text to thumbnail (default: Aa)"), N_("TEXT") },
+	    { "size", 's', 0, G_OPTION_ARG_INT, &thumb_size,
+	      N_("Thumbnail size (default: 128)"), N_("SIZE") },
+	    { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &arguments,
+	      NULL, N_("FONT-FILE OUTPUT-FILE") },
+	    { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
+    };
+
+#ifdef ENABLE_NLS
+    setlocale (LC_ALL, "");
+    bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
+    bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+    textdomain (GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
+
+    context = g_option_context_new (NULL);
+    g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE);
+
+    retval = g_option_context_parse (context, &argc, &argv, &gerror);
+    if (!retval) {
+	g_printerr ("Error parsing arguments: %s\n", gerror->message);
+
+	g_option_context_free  (context);
+	g_error_free (gerror);
+        return 1;
+    }
+
+    if (!arguments || g_strv_length (arguments) != 2) {
+	help = g_option_context_get_help (context, TRUE, NULL);
+	g_printerr ("%s", help);
+
+	g_option_context_free (context);
+	goto out;
+    }
+
+    g_option_context_free (context);
+
+    if (thumbstr_utf8 != NULL)
+	default_thumbstr = FALSE;
+
+    error = FT_Init_FreeType (&library);
+    if (error) {
+	g_printerr("Could not initialise freetype: %s\n", get_ft_error (error));
+	goto out;
+    }
+
+    totem_resources_monitor_start (arguments[0], 30 * G_USEC_PER_SEC);
+
+    fragment = strrchr (arguments[0], '#');
+    if (fragment)
+	face_index = strtol (fragment + 1, NULL, 0);
+
+    file = g_file_new_for_commandline_arg (arguments[0]);
+    uri = g_file_get_uri (file);
+    g_object_unref (file);
+
+    face = sushi_new_ft_face_from_uri (library, uri, face_index, &contents, &gerror);
+    if (gerror) {
+	g_printerr ("Could not load face '%s': %s\n", uri,
+		    gerror->message);
+        g_free (uri);
+        g_error_free (gerror);
+	goto out;
+    }
+
+    g_free (uri);
+
+    if (default_thumbstr) {
+        if (check_font_contain_text (face, "Aa"))
+            str = g_strdup ("Aa");
+        else
+            str = build_fallback_thumbstr (face);
+    } else {
+        str = thumbstr_utf8;
+    }
+
+    surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
+                                          thumb_size, thumb_size);
+    cr = cairo_create (surface);
+
+    font = cairo_ft_font_face_create_for_ft_face (face, 0);
+    cairo_set_font_face (cr, font);
+    cairo_font_face_destroy (font);
+
+    font_size = thumb_size - 2 * PADDING_VERTICAL;
+    cairo_set_font_size (cr, font_size);
+    cairo_text_extents (cr, str, &text_extents);
+
+    if ((text_extents.width) > (thumb_size - 2 * PADDING_HORIZONTAL)) {
+        scale_x = (gdouble) (thumb_size - 2 * PADDING_HORIZONTAL) / (text_extents.width);
+    } else {
+        scale_x = 1.0;
+    }
+
+    if ((text_extents.height) > (thumb_size - 2 * PADDING_VERTICAL)) {
+        scale_y = (gdouble) (thumb_size - 2 * PADDING_VERTICAL) / (text_extents.height);
+    } else {
+        scale_y = 1.0;
+    }
+
+    scale = MIN (scale_x, scale_y);
+    cairo_scale (cr, scale, scale);
+    cairo_translate (cr,
+                     PADDING_HORIZONTAL - text_extents.x_bearing + (thumb_size - scale * text_extents.width) / 2.0,
+                     PADDING_VERTICAL - text_extents.y_bearing + (thumb_size - scale * text_extents.height) / 2.0);
+
+    gdk_cairo_set_source_rgba (cr, &black);
+    cairo_show_text (cr, str);
+    cairo_destroy (cr);
+
+    cairo_surface_write_to_png (surface, arguments[1]);
+    cairo_surface_destroy (surface);
+
+    totem_resources_monitor_stop ();
+
+    error = FT_Done_Face (face);
+    if (error) {
+	g_printerr("Could not unload face: %s\n", get_ft_error (error));
+	goto out;
+    }
+
+    error = FT_Done_FreeType (library);
+    if (error) {
+	g_printerr ("Could not finalize freetype library: %s\n",
+		   get_ft_error (error));
+	goto out;
+    }
+
+    rv = 0; /* success */
+
+  out:
+
+    g_strfreev (arguments);
+    g_free (str);
+    g_free (contents);
+
+    return rv;
+}
+
+
+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/index.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/index.html new file mode 100644 index 00000000..77aa6d44 --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/index.html @@ -0,0 +1,1327 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineIdCWESeverityMessage
checkersReportinformationActive checkers: There was critical errors (use --checkers-report=<filename> to see details)
capplets/about-me/e-image-chooser.c
21missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
23missingIncludeSysteminformationInclude file: <string.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: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <gio/gio.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.
246variableScope398styleThe scope of the variable 'scaled' can be reduced.
344constVariablePointer398styleVariable 'target_type' can be declared as pointer to const
354constVariablePointer398styleVariable 'nl' can be declared as pointer to const
365shadowArgument398styleLocal variable 'info' shadows outer argument
466constParameterPointer398styleParameter 'data' can be declared as pointer to const
capplets/about-me/e-image-chooser.h
24missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/about-me/mate-about-me-fingerprint.c
20missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
21missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeinformationInclude file: "capplet-util.h" not found.
393constVariablePointer398styleVariable 'dialog' can be declared as pointer to const
393unreadVariable563styleVariable 'dialog' is assigned a value that is never used.
capplets/about-me/mate-about-me-fingerprint.h
23missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/about-me/mate-about-me-password.c
27missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <gdk/gdkkeysyms.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <pwd.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <unistd.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: <sys/wait.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: <signal.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
44missingIncludeinformationInclude file: "capplet-util.h" not found.
473varFuncNullUB475portabilityPassing NULL after the last typed argument to a variadic function leads to undefined behaviour.
505varFuncNullUB475portabilityPassing NULL after the last typed argument to a variadic function leads to undefined behaviour.
510varFuncNullUB475portabilityPassing NULL after the last typed argument to a variadic function leads to undefined behaviour.
537varFuncNullUB475portabilityPassing NULL after the last typed argument to a variadic function leads to undefined behaviour.
620varFuncNullUB475portabilityPassing NULL after the last typed argument to a variadic function leads to undefined behaviour.
625varFuncNullUB475portabilityPassing NULL after the last typed argument to a variadic function leads to undefined behaviour.
707constVariablePointer398styleVariable 'dialog' can be declared as pointer to const
712unreadVariable563styleVariable 'dialog' is assigned a value that is never used.
784constVariablePointer398styleVariable 'dialog' can be declared as pointer to const
786unreadVariable563styleVariable 'dialog' is assigned a value that is never used.
852variableScope398styleThe scope of the variable 'details' can be reduced.
944constVariablePointer398styleVariable 'dialog' can be declared as pointer to const
948unreadVariable563styleVariable 'dialog' is assigned a value that is never used.
capplets/about-me/mate-about-me-password.h
4missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/about-me/mate-about-me-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.
capplets/about-me/mate-about-me.c
23missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <glib/gstdio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <unistd.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <act/act.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <libmate-desktop/mate-desktop-thumbnail.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
41missingIncludeinformationInclude file: "capplet-util.h" not found.
95variableScope398styleThe scope of the variable 'act_file' can be reduced.
104knownConditionTrueFalse571styleCondition 'file==NULL' is always true
137unreadVariable563styleVariable 'scalex' is assigned a value that is never used.
137unreadVariable563styleVariable 'scaley' is assigned a value that is never used.
capplets/accessibility/at-properties/dm-util.c
22missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/accessibility/at-properties/main.c
1missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
2missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
3missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
4missingIncludeSysteminformationInclude file: <gio/gdesktopappinfo.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
17missingIncludeinformationInclude file: "capplet-util.h" not found.
18missingIncludeinformationInclude file: "activate-settings-daemon.h" not found.
capplets/accessibility/at-properties/mate-at-properties-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.
capplets/appearance/appearance-desktop.c
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: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <libmate-desktop/mate-desktop-thumbnail.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <libmate-desktop/mate-bg.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
99constVariablePointer398styleVariable 'bg' can be declared as pointer to const
100constVariablePointer398styleVariable 'item' can be declared as pointer to const
263constVariablePointer398styleVariable 'filename' can be declared as pointer to const
401variableScope398styleThe scope of the variable 'path' can be reduced.
424constVariablePointer398styleVariable 'selected' can be declared as pointer to const
1160variableScope398styleThe scope of the variable 'cr' can be reduced.
1183variableScope398styleThe scope of the variable 'item' can be reduced.
capplets/appearance/appearance-font.c
24missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <stdarg.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <math.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <glib/gi18n.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.
30missingIncludeSysteminformationInclude file: <gdk/gdkx.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <glib/gstdio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeinformationInclude file: "capplet-util.h" not found.
688varFuncNullUB475portabilityPassing NULL after the last typed argument to a variadic function leads to undefined behaviour.
701varFuncNullUB475portabilityPassing NULL after the last typed argument to a variadic function leads to undefined behaviour.
718varFuncNullUB475portabilityPassing NULL after the last typed argument to a variadic function leads to undefined behaviour.
capplets/appearance/appearance-main.c
21missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
22missingIncludeSysteminformationInclude file: <libmate-desktop/mate-gsettings.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeinformationInclude file: "theme-thumbnail.h" not found.
32missingIncludeinformationInclude file: "activate-settings-daemon.h" not found.
33missingIncludeinformationInclude file: "capplet-util.h" not found.
capplets/appearance/appearance-style.c
23missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <pango/pango.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.
26missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeinformationInclude file: "gtkrc-utils.h" not found.
30missingIncludeinformationInclude file: "theme-thumbnail.h" not found.
31missingIncludeinformationInclude file: "capplet-util.h" not found.
264variableScope398styleThe scope of the variable 'widget' can be reduced.
342variableScope398styleThe scope of the variable 'widget' can be reduced.
345variableScope398styleThe scope of the variable 'colstr' can be reduced.
727constParameterCallback398styleParameter 'theme_name' can be declared as pointer to const. However it seems that 'gtk_theme_thumbnail_cb' is a callback function, if 'theme_name' is declared with const you might also need to cast function pointer(s).
735constParameterCallback398styleParameter 'theme_name' can be declared as pointer to const. However it seems that 'marco_theme_thumbnail_cb' is a callback function, if 'theme_name' is declared with const you might also need to cast function pointer(s).
743constParameterCallback398styleParameter 'theme_name' can be declared as pointer to const. However it seems that 'icon_theme_thumbnail_cb' is a callback function, if 'theme_name' is declared with const you might also need to cast function pointer(s).
750constParameterPointer398styleParameter 'default_thumb' can be declared as pointer to const
capplets/appearance/appearance-support.c
23missingIncludeinformationInclude file: "wm-common.h" not found.
26missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/appearance/appearance-themes.c
23missingIncludeinformationInclude file: "theme-thumbnail.h" not found.
24missingIncludeinformationInclude file: "mate-theme-apply.h" not found.
28missingIncludeinformationInclude file: "gtkrc-utils.h" not found.
31missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <libmate-desktop/mate-desktop-thumbnail.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <libmate-desktop/mate-gsettings.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
567variableScope398styleThe scope of the variable 'font' can be reduced.
749unreadVariable563styleVariable 'is_custom' is assigned a value that is never used.
865constVariablePointer398styleVariable 'info' can be declared as pointer to const
900constParameterCallback398styleParameter 'a' can be declared as pointer to const. However it seems that 'theme_list_sort_func' is a callback function, if 'a' is declared with const you might also need to cast function pointer(s).
901constParameterCallback398styleParameter 'b' can be declared as pointer to const. However it seems that 'theme_list_sort_func' is a callback function, if 'b' is declared with const you might also need to cast function pointer(s).
capplets/appearance/appearance-ui.c
25missingIncludeSysteminformationInclude file: <stdio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/appearance/appearance.h
24missingIncludeinformationInclude file: "config.h" not found.
26missingIncludeSysteminformationInclude file: <glib.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: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <libmate-desktop/mate-desktop-thumbnail.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <libmate-desktop/mate-image-menu-item.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeinformationInclude file: "mate-theme-info.h" not found.
capplets/appearance/mate-appearance-properties-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.
capplets/appearance/mate-wp-info.c
21missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
22missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
23missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_FILE_ATTRIBUTE_STANDARD_SIZE is a macro then please configure it.
capplets/appearance/mate-wp-info.h
24missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <libmate-desktop/mate-desktop-thumbnail.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/appearance/mate-wp-item.c
21missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
23missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/appearance/mate-wp-item.h
24missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <gdk-pixbuf/gdk-pixbuf.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: <libmate-desktop/mate-desktop-thumbnail.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <libmate-desktop/mate-bg.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/appearance/mate-wp-xml.c
24missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <libxml/parser.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <errno.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
124constVariablePointer398styleVariable 'root' can be declared as pointer to const
125constVariablePointer398styleVariable 'list' can be declared as pointer to const
479variableScope398styleThe scope of the variable 'wallpaper' can be reduced.
capplets/appearance/theme-installer.c
25missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <glib/gstdio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <unistd.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeinformationInclude file: "capplet-util.h" not found.
33missingIncludeinformationInclude file: "file-transfer-dialog.h" not found.
570variableScope398styleThe scope of the variable 'dialog' can be reduced.
capplets/appearance/theme-save.c
24missingIncludeSysteminformationInclude file: <glib/gstdio.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.
26missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeinformationInclude file: "capplet-util.h" not found.
185variableScope398styleThe scope of the variable 'current_background' can be reduced.
187variableScope398styleThe scope of the variable 'settings' can be reduced.
capplets/appearance/theme-util.c
24missingIncludeSysteminformationInclude file: <string.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.
27missingIncludeinformationInclude file: "capplet-util.h" not found.
capplets/common/activate-settings-daemon.c
2missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
5missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
6missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
7missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/common/activate-settings-daemon.h
4missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/common/capplet-util.c
25missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <ctype.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <sys/types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <sys/stat.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <unistd.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: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/common/capplet-util.h
27missingIncludeSysteminformationInclude file: <gio/gio.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.
capplets/common/dconf-util.c
28missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <dconf.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/common/dconf-util.h
30missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/common/file-transfer-dialog.c
24missingIncludeinformationInclude file: "config.h" not found.
27missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <glib/gi18n.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.
31missingIncludeSysteminformationInclude file: <limits.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
86unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
capplets/common/file-transfer-dialog.h
27missingIncludeSysteminformationInclude file: <glib.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.
capplets/common/gtkrc-utils.c
23missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <unistd.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/gstdio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <fcntl.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.
46unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DIR_SEPARATOR_S is a macro then please configure it.
capplets/common/mate-theme-apply.c
21missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <libmate-desktop/mate-gsettings.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/common/mate-theme-info.c
26missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
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: <gmodule.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: <gdk/gdkx.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
36missingIncludeSysteminformationInclude file: <libmate-desktop/mate-desktop-item.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
40missingIncludeSysteminformationInclude file: <X11/Xcursor/Xcursor.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
647constVariablePointer398styleVariable 'change_str' can be declared as pointer to const
678unreadVariable563styleVariable 'change_str' is assigned a value that is never used.
680unreadVariable563styleVariable 'change_str' is assigned a value that is never used.
682unreadVariable563styleVariable 'change_str' is assigned a value that is never used.
1491constParameterPointer398styleParameter 'a' can be declared as pointer to const
1492constParameterPointer398styleParameter 'b' can be declared as pointer to const
1548constParameterPointer398styleParameter 'a' can be declared as pointer to const
1549constParameterPointer398styleParameter 'b' can be declared as pointer to const
1599constVariablePointer398styleVariable 'theme' can be declared as pointer to const
1650constParameterPointer398styleParameter 'a' can be declared as pointer to const
1651constParameterPointer398styleParameter 'b' can be declared as pointer to const
1725variableScope398styleThe scope of the variable 'color_scheme_pair' can be reduced.
capplets/common/mate-theme-info.h
26missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <gio/gio.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: <gdk-pixbuf/gdk-pixbuf.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <gdk/gdk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/common/mate-theme-test.c
1missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
2missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
3missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/common/theme-thumbnail.c
1missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
2missingIncludeSysteminformationInclude file: <unistd.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
3missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
4missingIncludeSysteminformationInclude file: <marco-private/util.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
5missingIncludeSysteminformationInclude file: <marco-private/theme.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
6missingIncludeSysteminformationInclude file: <marco-private/theme-parser.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
7missingIncludeSysteminformationInclude file: <marco-private/preview-widget.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
8missingIncludeSysteminformationInclude file: <signal.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
9missingIncludeSysteminformationInclude file: <errno.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
10missingIncludeSysteminformationInclude file: <math.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
16missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
928unreachableCode561styleStatements following 'return' will never be executed.
capplets/common/theme-thumbnail.h
5missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/common/wm-common.c
1missingIncludeSysteminformationInclude file: <X11/Xatom.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
2missingIncludeSysteminformationInclude file: <gdk/gdkx.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
3missingIncludeSysteminformationInclude file: <gdk/gdk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
4missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
5missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
6missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
150constVariablePointer398styleVariable 'xevent' can be declared as pointer to const
capplets/default-applications/mate-da-capplet.c
24missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <stdlib.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: <gio/gdesktopappinfo.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <cairo-gobject.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeinformationInclude file: "capplet-util.h" not found.
69variableScope398styleThe scope of the variable 'item' can be reduced.
307variableScope398styleThe scope of the variable 'surface' can be reduced.
390variableScope398styleThe scope of the variable 'surface' can be reduced.
capplets/default-applications/mate-da-capplet.h
25missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/default-applications/mate-default-applications-properties-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.
capplets/display/foo-marshal.c
5missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/display/foo-marshal.h
2missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/display/mate-display-properties-install-systemwide.c
26missingIncludeinformationInclude file: "config.h" not found.
28missingIncludeSysteminformationInclude file: <errno.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <locale.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.
33missingIncludeSysteminformationInclude file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <fcntl.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <sys/types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
36missingIncludeSysteminformationInclude file: <sys/stat.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
37missingIncludeSysteminformationInclude file: <unistd.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: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
78variableScope398styleThe scope of the variable 'num_read' can be reduced.
212invalidScanfArgType_int686warning%d in format string (no. 1) requires 'int *' but the argument type is 'unsigned int *'.
capplets/display/mate-display-properties-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.
capplets/display/scrollarea.c
19missingIncludeSysteminformationInclude file: <gdk/gdkprivate.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
60unusedStructMember563stylestruct member 'AutoScrollInfo::begin_x' is never used.
61unusedStructMember563stylestruct member 'AutoScrollInfo::begin_y' is never used.
355unusedStructMember563stylestruct member 'Box::x1' is never used.
355unusedStructMember563stylestruct member 'Box::y1' is never used.
355unusedStructMember563stylestruct member 'Box::x2' is never used.
355unusedStructMember563stylestruct member 'Box::y2' is never used.
879constParameterPointer398styleParameter 'event' can be declared as pointer to const
1445constParameterPointer398styleParameter 'event' can be declared as pointer to const
capplets/display/scrollarea.h
22missingIncludeSysteminformationInclude file: <cairo.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
23missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/display/xrandr-capplet.c
22missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
23missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <sys/wait.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.
30missingIncludeSysteminformationInclude file: <libmate-desktop/mate-desktop-utils.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <libmate-desktop/mate-rr.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <libmate-desktop/mate-rr-config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <libmate-desktop/mate-rr-labeler.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <gdk/gdkx.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <X11/Xlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
36missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
37missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
39missingIncludeinformationInclude file: "capplet-util.h" not found.
59unusedStructMember563stylestruct member 'App::resolution_store' is never used.
163constParameterCallback398styleParameter 'new_viewport' can be declared as pointer to const. However it seems that 'on_viewport_changed' is a callback function, if 'new_viewport' is declared with const you might also need to cast function pointer(s).
280variableScope398styleThe scope of the variable 'output' can be reduced.
630variableScope398styleThe scope of the variable 'tmp' can be reduced.
1270constParameterPointer398styleParameter 'snapper' can be declared as pointer to const
1270constParameterPointer398styleParameter 'snappee' can be declared as pointer to const
1279constParameterPointer398styleParameter 'snapper' can be declared as pointer to const
1279constParameterPointer398styleParameter 'snappee' can be declared as pointer to const
1344constParameterPointer398styleParameter 'output' can be declared as pointer to const
1373constParameterPointer398styleParameter 'e' can be declared as pointer to const
1397constParameterPointer398styleParameter 'output' can be declared as pointer to const
1572constParameterCallback398styleParameter 'event' can be declared as pointer to const. However it seems that 'on_output_event' is a callback function, if 'event' is declared with const you might also need to cast function pointer(s).
1587variableScope398styleThe scope of the variable 'info' can be reduced.
1643constVariablePointer398styleVariable 'snap' can be declared as pointer to const
1644shadowVariable398styleLocal variable 'new_edges' shadows outer variable
2109constVariablePointer398styleVariable 'variant' can be declared as pointer to const
capplets/keybindings/eggaccelerators.c
23missingIncludeSysteminformationInclude file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <gdk/gdkx.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <gdk/gdkkeysyms.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.
369duplicateExpression398styleSame expression on both sides of '-='.
capplets/keybindings/eggaccelerators.h
24missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <gtk/gtk.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.
capplets/keybindings/eggcellrendererkeys.c
1missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
2missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
3missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
4missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
5missingIncludeSysteminformationInclude file: <gdk/gdkx.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
6missingIncludeSysteminformationInclude file: <gdk/gdkkeysyms.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
673variableScope398styleThe scope of the variable 'text' can be reduced.
capplets/keybindings/eggcellrendererkeys.h
23missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/keybindings/mate-keybinding-properties-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.
capplets/keybindings/mate-keybinding-properties.c
5missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
7missingIncludeSysteminformationInclude file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
8missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
9missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
10missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
11missingIncludeSysteminformationInclude file: <gdk/gdkx.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
12missingIncludeSysteminformationInclude file: <X11/Xatom.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
13missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
14missingIncludeSysteminformationInclude file: <gdk/gdkkeysyms.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
16missingIncludeinformationInclude file: "wm-common.h" not found.
17missingIncludeinformationInclude file: "capplet-util.h" not found.
19missingIncludeinformationInclude file: "activate-settings-daemon.h" not found.
20missingIncludeinformationInclude file: "dconf-util.h" not found.
233constVariablePointer398styleVariable 'key_value' can be declared as pointer to const
876constParameterPointer398styleParameter 'str' can be declared as pointer to const
1005shadowVariable398styleLocal variable 'i' shadows outer variable
1104nullPointerRedundantCheck476warningEither the condition 'new_key' is redundant or there is possible null pointer dereference: new_key.
1592variableScope398styleThe scope of the variable 'path' can be reduced.
1668constParameterCallback398styleParameter 'column' can be declared as pointer to const. However it seems that 'start_editing_kb_cb' is a callback function, if 'column' is declared with const you might also need to cast function pointer(s).
1730variableScope398styleThe scope of the variable 'idle_data' can be reduced.
capplets/keyboard/mate-keyboard-properties-a11y.c
24missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeinformationInclude file: "capplet-util.h" not found.
capplets/keyboard/mate-keyboard-properties-a11y.h
27missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/keyboard/mate-keyboard-properties-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.
capplets/keyboard/mate-keyboard-properties-xkb.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.
30missingIncludeSysteminformationInclude file: <gio/gio.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.
33missingIncludeinformationInclude file: "capplet-util.h" not found.
37missingIncludeSysteminformationInclude file: <libmatekbd/matekbd-desktop-config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/keyboard/mate-keyboard-properties-xkb.h
27missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeinformationInclude file: "libmatekbd/matekbd-keyboard-config.h" not found.
capplets/keyboard/mate-keyboard-properties-xkblt.c
25missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <gdk/gdkx.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.
30missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <libmatekbd/matekbd-desktop-config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <libmatekbd/matekbd-keyboard-drawing.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeinformationInclude file: "capplet-util.h" not found.
70constVariablePointer398styleVariable 'indices' can be declared as pointer to const
209constVariablePointer398styleVariable 'indices' can be declared as pointer to const
capplets/keyboard/mate-keyboard-properties-xkbltadd.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.
30missingIncludeSysteminformationInclude file: <libmatekbd/matekbd-keyboard-drawing.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <libmatekbd/matekbd-util.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeinformationInclude file: "capplet-util.h" not found.
441constVariablePointer398styleVariable 'kbdraw' can be declared as pointer to const
441unreadVariable563styleVariable 'kbdraw' is assigned a value that is never used.
capplets/keyboard/mate-keyboard-properties-xkbmc.c
25missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <gdk/gdkx.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.
30missingIncludeSysteminformationInclude file: <glib/gi18n.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.
34missingIncludeinformationInclude file: "capplet-util.h" not found.
188variableScope398styleThe scope of the variable 'path' can be reduced.
251variableScope398styleThe scope of the variable 'path' can be reduced.
capplets/keyboard/mate-keyboard-properties-xkbot.c
26missingIncludeSysteminformationInclude file: <config.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.
31missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeinformationInclude file: "capplet-util.h" not found.
130constVariablePointer398styleVariable 'option' can be declared as pointer to const
145constParameterPointer398styleParameter 'optionname' can be declared as pointer to const
169constParameterPointer398styleParameter 'optionname' can be declared as pointer to const
173constVariablePointer398styleVariable 'option' can be declared as pointer to const
307variableScope398styleThe scope of the variable 'option_check' can be reduced.
390variableScope398styleThe scope of the variable 'expander' can be reduced.
capplets/keyboard/mate-keyboard-properties-xkbpv.c
25missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <libmatekbd/matekbd-keyboard-drawing.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeinformationInclude file: "capplet-util.h" not found.
34missingIncludeinformationInclude file: "X11/XKBlib.h" not found.
88variableScope398styleThe scope of the variable 'p' can be reduced.
96unreadVariable563styleVariable 'p' is assigned a value that is never used.
109knownConditionTrueFalse570styleCondition 'variant==NULL' is always false
capplets/keyboard/mate-keyboard-properties.c
28missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeinformationInclude file: "capplet-util.h" not found.
35missingIncludeinformationInclude file: "activate-settings-daemon.h" not found.
capplets/mouse/mate-mouse-properties-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.
capplets/mouse/mate-mouse-properties.c
26missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <glib/gi18n.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: <gio/gio.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.
32missingIncludeSysteminformationInclude file: <math.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeinformationInclude file: "capplet-util.h" not found.
35missingIncludeinformationInclude file: "activate-settings-daemon.h" not found.
38missingIncludeSysteminformationInclude file: <X11/Xatom.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
39missingIncludeSysteminformationInclude file: <X11/extensions/XInput.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
95constParameterCallback398styleParameter 'event' can be declared as pointer to const. However it seems that 'event_box_button_press_event' is a callback function, if 'event' is declared with const you might also need to cast function pointer(s).
404variableScope398styleThe scope of the variable 'w' can be reduced.
capplets/mouse/msd-input-helper.c
21missingIncludeinformationInclude file: "config.h" not found.
23missingIncludeSysteminformationInclude file: <gdk/gdk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <gdk/gdkx.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <sys/types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <X11/Xatom.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
113constVariablePointer398styleVariable 'device' can be declared as pointer to const
121knownConditionTrueFalse571styleCondition 'device_info!=NULL' is always true
capplets/mouse/msd-input-helper.h
25missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <X11/extensions/XInput.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <X11/extensions/XIproto.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/network/mate-network-properties-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.
capplets/network/mate-network-properties.c
27missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeinformationInclude file: "capplet-util.h" not found.
capplets/system-info/info-cleanup.c
21missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/system-info/info-cleanup.h
21missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/system-info/main.c
19missingIncludeinformationInclude file: "capplet-util.h" not found.
capplets/system-info/mate-system-info-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.
capplets/system-info/mate-system-info-resources.h
4missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/system-info/mate-system-info.c
23missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <glibtop/fsusage.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <glibtop/mountlist.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <glibtop/mem.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <glibtop/sysinfo.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <udisks/udisks.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <sys/utsname.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <gdk/gdkwayland.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
36missingIncludeSysteminformationInclude file: <gdk/gdkx.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
63unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE is a macro then please configure it.
capplets/system-info/mate-system-info.h
20missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
21missingIncludeSysteminformationInclude file: <fcntl.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
22missingIncludeSysteminformationInclude file: <sys/types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
23missingIncludeSysteminformationInclude file: <libintl.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <locale.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.
capplets/time-admin/src/main.c
17missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
18missingIncludeSysteminformationInclude file: <polkit/polkit.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
20missingIncludeinformationInclude file: "capplet-util.h" not found.
capplets/time-admin/src/mate-time-admin-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.
capplets/time-admin/src/time-map.c
28missingIncludeinformationInclude file: "config.h" not found.
31missingIncludeSysteminformationInclude file: <math.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/time-admin/src/time-share.c
19missingIncludeinformationInclude file: "config.h" not found.
22missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/time-admin/src/time-share.h
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: <sys/stat.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <fcntl.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <stdio.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: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <time.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <sys/time.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/time-admin/src/time-tool.c
19missingIncludeinformationInclude file: "config.h" not found.
22missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
186constVariablePointer398styleVariable 'ret' can be declared as pointer to const
218constVariablePointer398styleVariable 'ret' can be declared as pointer to const
248constVariablePointer398styleVariable 'st' can be declared as pointer to const
265constVariablePointer398styleVariable 'ret' can be declared as pointer to const
capplets/time-admin/src/time-zone.c
28missingIncludeinformationInclude file: "config.h" not found.
33missingIncludeSysteminformationInclude file: <math.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: <stdio.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: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
41missingIncludeSysteminformationInclude file: <libmate-desktop/mate-languages.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/time-admin/src/time-zone.h
82unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_AUTOPTR_CLEANUP_FUNC is a macro then please configure it.
capplets/windows/mate-metacity-support.c
23missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
capplets/windows/mate-window-properties-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.
capplets/windows/mate-window-properties.c
29missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <glib/gi18n.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.
36missingIncludeSysteminformationInclude file: <gdk/gdkx.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
39missingIncludeinformationInclude file: "wm-common.h" not found.
40missingIncludeinformationInclude file: "capplet-util.h" not found.
261variableScope398styleThe scope of the variable 'value' can be reduced.
277variableScope398styleThe scope of the variable 'value' can be reduced.
521missingIncludeSysteminformationInclude file: <X11/Xlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
522missingIncludeSysteminformationInclude file: <X11/keysym.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
523missingIncludeSysteminformationInclude file: <gdk/gdkx.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
580constVariablePointer398styleVariable 'syms' can be declared as pointer to const
font-viewer/font-model.c
28missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <errno.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <sys/stat.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <sys/types.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.
35missingIncludeSysteminformationInclude file: <ft2build.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
37missingIncludeSysteminformationInclude file: <fontconfig/fontconfig.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
40missingIncludeSysteminformationInclude file: <libmate-desktop/mate-desktop-thumbnail.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
75unusedStructMember563stylestruct member 'IterForFaceData::file' is never used.
507variableScope398styleThe scope of the variable 'self' can be reduced.
521variableScope398styleThe scope of the variable 'file' can be reduced.
522variableScope398styleThe scope of the variable 'monitor' can be reduced.
font-viewer/font-model.h
30missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
font-viewer/font-thumbnailer.c
25missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <stdio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <locale.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <ft2build.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.
36missingIncludeSysteminformationInclude file: <gdk/gdk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
37missingIncludeSysteminformationInclude file: <gdk-pixbuf/gdk-pixbuf.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: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
41missingIncludeSysteminformationInclude file: <cairo/cairo-ft.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
96uninitvar457warningUninitialized variable: retval
142variableScope398styleThe scope of the variable 'ptr' can be reduced.
142variableScope398styleThe scope of the variable 'end' can be reduced.
142constVariablePointer398styleVariable 'end' can be declared as pointer to const
190constVariablePointer398styleVariable 'fragment' can be declared as pointer to const
font-viewer/font-utils.h
25missingIncludeSysteminformationInclude file: <ft2build.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
font-viewer/font-view.c
25missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <ft2build.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <cairo/cairo-ft.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <fontconfig/fontconfig.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <gio/gio.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.
55unusedStructMember563stylestruct member 'FontViewApplication::title_label' is never used.
56unusedStructMember563stylestruct member 'FontViewApplication::side_grid' is never used.
110variableScope398styleThe scope of the variable 'str' can be reduced.
112variableScope398styleThe scope of the variable 'len' can be reduced.
198variableScope398styleThe scope of the variable 's' can be reduced.
284constParameterPointer398styleParameter 'error' can be declared as pointer to const
309variableScope398styleThe scope of the variable 'self' can be reduced.
665variableScope398styleThe scope of the variable 'file' can be reduced.
font-viewer/gd-main-toolbar.c
25missingIncludeSysteminformationInclude file: <math.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
64unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
font-viewer/gd-main-toolbar.h
26missingIncludeSysteminformationInclude 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.
font-viewer/sushi-font-loader.c
30missingIncludeSysteminformationInclude file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <ft2build.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
font-viewer/sushi-font-loader.h
31missingIncludeSysteminformationInclude file: <ft2build.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.
font-viewer/sushi-font-widget.c
31missingIncludeSysteminformationInclude file: <math.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
182variableScope398styleThe scope of the variable 'ptr' can be reduced.
182variableScope398styleThe scope of the variable 'end' can be reduced.
182constVariablePointer398styleVariable 'end' can be declared as pointer to const
331constVariablePointer398styleVariable 'priv' can be declared as pointer to const
471constVariablePointer398styleVariable 'priv' can be declared as pointer to const
font-viewer/sushi-font-widget.h
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: <cairo/cairo-ft.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
font-viewer/totem-resources.c
28missingIncludeSysteminformationInclude file: <config.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: <glib/gstdio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <unistd.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.
35missingIncludeSysteminformationInclude file: <sys/types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
36missingIncludeSysteminformationInclude file: <sys/stat.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
37missingIncludeSysteminformationInclude file: <sys/resource.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
font-viewer/totem-resources.h
31missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
shell/app-resizer.c
21missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
71constParameterPointer398styleParameter 'widget' can be declared as pointer to const
98variableScope398styleThe scope of the variable 'table' can be reduced.
99variableScope398styleThe scope of the variable 'launcher_list' can be reduced.
shell/app-resizer.h
24missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
shell/app-shell.c
22missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <libmate-desktop/mate-desktop-item.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <gio/gio.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: <gdk/gdkkeysyms.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <sys/types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <sys/stat.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
192constParameterCallback398styleParameter 'event' can be declared as pointer to const. However it seems that 'main_keypress_callback' is a callback function, if 'event' is declared with const you might also need to cast function pointer(s).
194variableScope398styleThe scope of the variable 'app' can be reduced.
232variableScope398styleThe scope of the variable 'app' can be reduced.
327variableScope398styleThe scope of the variable 'data' can be reduced.
403variableScope398styleThe scope of the variable 'launcher' can be reduced.
406variableScope398styleThe scope of the variable 'action' can be reduced.
407variableScope398styleThe scope of the variable 'a11y_cat' can be reduced.
444constParameterPointer398styleParameter 'app_data' can be declared as pointer to const
620variableScope398styleThe scope of the variable 'temp1' can be reduced.
620variableScope398styleThe scope of the variable 'temp2' can be reduced.
699variableScope398styleThe scope of the variable 'a11y_cat' can be reduced.
994variableScope398styleThe scope of the variable 'COMMAND_LINE_LOCKDOWN_SCHEMA' can be reduced.
995variableScope398styleThe scope of the variable 'COMMAND_LINE_LOCKDOWN_KEY' can be reduced.
996variableScope398styleThe scope of the variable 'COMMAND_LINE_LOCKDOWN_DESKTOP_CATEGORY' can be reduced.
1121shadowVariable398styleLocal variable 'categories' shadows outer variable
1121shadowVariable398styleLocal variable 'launchers' shadows outer variable
1227constVariablePointer398styleVariable 'temp_data' can be declared as pointer to const
1368constParameterCallback398styleParameter 'event' can be declared as pointer to const. However it seems that 'tile_activated_cb' is a callback function, if 'event' is declared with const you might also need to cast function pointer(s).
1385variableScope398styleThe scope of the variable 'app' can be reduced.
1403constParameterCallback398styleParameter 'action' can be declared as pointer to const. However it seems that 'handle_menu_action_performed' is a callback function, if 'action' is declared with const you might also need to cast function pointer(s).
1403constParameterCallback398styleParameter 'launcher' can be declared as pointer to const. However it seems that 'handle_menu_action_performed' is a callback function, if 'launcher' is declared with const you might also need to cast function pointer(s).
1406variableScope398styleThe scope of the variable 'app' can be reduced.
shell/app-shell.h
24missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <matemenu-tree.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <libmate-desktop/mate-desktop-item.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
shell/application-tile.c
22missingIncludeinformationInclude file: "config.h" not found.
24missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <glib/gstdio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <unistd.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_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
shell/application-tile.h
26missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <libmate-desktop/mate-desktop-item.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
shell/bookmark-agent.c
24missingIncludeSysteminformationInclude file: <config.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.
31missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <glib/gstdio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
308constVariablePointer398styleVariable 'priv' can be declared as pointer to const
668unreadVariable563styleVariable 'rank' is assigned a value that is never used.
669unreadVariable563styleVariable 'rank_corr' is assigned a value that is never used.
672constVariablePointer398styleVariable 'old_title' can be declared as pointer to const
887variableScope398styleThe scope of the variable 'groups' can be reduced.
1201redundantAssignment563styleVariable 'tag_close_ptr[0]' is reassigned a value before the old one has been used.
shell/bookmark-agent.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.
shell/control-center.c
21missingIncludeinformationInclude file: "config.h" not found.
23missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
42variableScope398styleThe scope of the variable 'action' can be reduced.
91constParameterCallback398styleParameter 'event' can be declared as pointer to const. However it seems that 'handle_static_action_clicked' is a callback function, if 'event' is declared with const you might also need to cast function pointer(s).
96variableScope398styleThe scope of the variable 'app' can be reduced.
shell/double-click-detector.c
23missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
shell/double-click-detector.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.
shell/libslab-utils.c
4missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
7missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
8missingIncludeSysteminformationInclude file: <stdio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
9missingIncludeSysteminformationInclude file: <unistd.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
10missingIncludeSysteminformationInclude file: <time.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
11missingIncludeSysteminformationInclude file: <sys/stat.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
12missingIncludeSysteminformationInclude file: <sys/resource.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
13missingIncludeSysteminformationInclude file: <sys/time.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
14missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
shell/libslab-utils.h
4missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
5missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
6missingIncludeSysteminformationInclude file: <libmate-desktop/mate-desktop-item.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
shell/mate-utils.c
3missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
13variableScope398styleThe scope of the variable 'icon_theme' can be reduced.
shell/mate-utils.h
24missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
shell/nameplate-tile.c
46unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
shell/nameplate-tile.h
26missingIncludeSysteminformationInclude file: <glib.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.
shell/nld-marshal.c
3missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
shell/nld-marshal.h
5missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
shell/search-bar.c
22missingIncludeinformationInclude file: "config.h" not found.
26missingIncludeSysteminformationInclude file: <glib/gi18n-lib.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.
shell/search-bar.h
24missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
shell/shell-window.c
23missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <gdk/gdkx.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
shell/shell-window.h
24missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
shell/slab-mate-util.c
24missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
106variableScope398styleThe scope of the variable 'help_uri' can be reduced.
shell/slab-mate-util.h
24missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <libmate-desktop/mate-desktop-item.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
shell/slab-section.h
24missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
shell/themed-icon.c
44unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
shell/themed-icon.h
24missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
shell/tile-action.c
98constParameterPointer398styleParameter 'this' can be declared as pointer to const
shell/tile.c
23missingIncludeSysteminformationInclude file: <gdk/gdkkeysyms.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
shell/tile.h
24missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
typing-break/drw-break-window.c
23missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <math.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <glib/gi18n.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: <gdk/gdkx.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <gdk/gdkkeysyms.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.
33missingIncludeSysteminformationInclude file: <canberra-gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
80unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
typing-break/drw-break-window.h
25missingIncludeSysteminformationInclude file: <glib.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.
typing-break/drw-monitor.c
22missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
23missingIncludeSysteminformationInclude file: <gdk/gdk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <gdk/gdkx.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <math.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <unistd.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <sys/ioctl.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <fcntl.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <stdio.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.
32missingIncludeSysteminformationInclude file: <sys/types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <sys/stat.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <X11/Xlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <X11/extensions/scrnsaver.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
144variableScope398styleThe scope of the variable 'now' can be reduced.
typing-break/drw-monitor.h
25missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
typing-break/drw-selection.c
24missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <gdk/gdkx.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
154variableScope398styleThe scope of the variable 'drw_selection' can be reduced.
155constVariablePointer398styleVariable 'xev' can be declared as pointer to const
190constParameterPointer398styleParameter 'drw_selection' can be declared as pointer to const
typing-break/drw-timer.c
21missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
41constParameterPointer398styleParameter 'timer' can be declared as pointer to const
typing-break/drw-utils.c
21missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
22missingIncludeSysteminformationInclude file: <gdk/gdk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
23missingIncludeSysteminformationInclude file: <gdk/gdkx.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32constParameterPointer398styleParameter 'bg_color' can be declared as pointer to const
typing-break/drw-utils.h
24missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
typing-break/drwright.c
23missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <math.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <gdk/gdk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <gdk/gdkx.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <gdk/gdkkeysyms.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.
34missingIncludeSysteminformationInclude file: <libappindicator/app-indicator.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
36missingIncludeSysteminformationInclude file: <libayatana-appindicator/app-indicator.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
40missingIncludeSysteminformationInclude file: <libmate-desktop/mate-desktop-utils.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
87unusedStructMember563stylestruct member '_DrWright::warn_dialog' is never used.
532variableScope398styleThe scope of the variable 'window' can be reduced.
typing-break/main.c
22missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
23missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <stdlib.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.
26missingIncludeSysteminformationInclude file: <gdk/gdkx.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.
+
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/stats.html b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/stats.html new file mode 100644 index 00000000..2277ae1f --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/stats.html @@ -0,0 +1,209 @@ + + + + + + Cppcheck - HTML report - mate-control-center + + + + + +
+ + + +
+

Top 10 files for error severity, total findings: 12
+   1  typing-break/drw-break-window.c
+   1  shell/tile.c
+   1  shell/themed-icon.c
+   1  shell/search-bar.c
+   1  shell/nameplate-tile.c
+   1  shell/application-tile.c
+   1  font-viewer/gd-main-toolbar.c
+   1  capplets/time-admin/src/time-zone.h
+   1  capplets/system-info/mate-system-info.c
+   1  capplets/common/gtkrc-utils.c
+

+

Top 10 files for warning severity, total findings: 3
+   1  font-viewer/font-thumbnailer.c
+   1  capplets/keybindings/mate-keybinding-properties.c
+   1  capplets/display/mate-display-properties-install-systemwide.c
+

+

Top 10 files for portability severity, total findings: 9
+   6  capplets/about-me/mate-about-me-password.c
+   3  capplets/appearance/appearance-font.c
+

+

Top 10 files for style severity, total findings: 209
+   22  shell/app-shell.c
+   16  capplets/display/xrandr-capplet.c
+   12  capplets/common/mate-theme-info.c
+   8   font-viewer/font-view.c
+   8   capplets/display/scrollarea.c
+   7   capplets/appearance/appearance-style.c
+   7   capplets/appearance/appearance-desktop.c
+   7   capplets/about-me/mate-about-me-password.c
+   6   shell/bookmark-agent.c
+   6   capplets/keyboard/mate-keyboard-properties-xkbot.c
+

+

Top 10 files for information severity, total findings: 584
+   14  typing-break/drw-monitor.c
+   14  capplets/display/xrandr-capplet.c
+   13  capplets/keybindings/mate-keybinding-properties.c
+   12  typing-break/drwright.c
+   11  capplets/display/mate-display-properties-install-systemwide.c
+   11  capplets/common/theme-thumbnail.c
+   11  capplets/about-me/mate-about-me-password.c
+   10  shell/app-shell.c
+   10  font-viewer/font-thumbnailer.c
+   10  capplets/windows/mate-window-properties.c
+

+ +
+ +
+ + diff --git a/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/style.css b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_master/style.css new file mode 100644 index 00000000..3897bfaf --- /dev/null +++ b/2024-04-01-013612-3018-cppcheck@9c2e88747e09_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