This file is indexed.

/usr/share/gnome/help/gtk-doc-manual/sv/gtk-doc-manual.xml is in gtk-doc-tools 1.18-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   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
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<?xml-stylesheet type="text/xml" href="params.xsl"?>
<!-- vim: set ai tw=80 ts=3 sw=3: -->
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "
              http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY FDL SYSTEM "fdl-appendix.xml">
<!ENTITY FDLlink "<link linkend='fdl'>included</link>">
]>
<!-- =============Document Header ============================= -->
<book id="index" lang="sv">
  <bookinfo>
    <title>Handbok för GTK-Doc</title>
    <edition>1.18</edition>
    <abstract role="description"><para>Användarhandbok för utvecklare med användningsinstruktioner för GTK-Doc.</para></abstract>
    <authorgroup>
      <author>
        <firstname>Chris</firstname>
        <surname>Lyttle</surname>
        <affiliation>
          <address>
            <email>chris@wilddev.net</email>
          </address>
        </affiliation>
      </author>
      <author>
        <firstname>Dan</firstname>
        <surname>Mueth</surname>
        <affiliation>
          <address>
            <email>d-mueth@uchicago.edu</email>
          </address>
        </affiliation>
      </author>
      <author>
        <firstname>Stefan</firstname>
        <surname>Kost</surname>
        <affiliation>
          <address>
            <email>ensonic@users.sf.net</email>
          </address>
        </affiliation>
      </author>
    </authorgroup>
    <publisher role="maintainer">
      <publishername>GTK-Doc-projektet</publishername>
      <address><email>gtk-doc-list@gnome.org</email></address>
    </publisher>
    <copyright>
      <year>2000, 2005</year>
      <holder>Dan Mueth and Chris Lyttle</holder>
    </copyright>
    <copyright>
      <year>2007-2011</year>
      <holder>Stefan Sauer (Kost)</holder>
    </copyright><copyright><year>2009</year><holder>Daniel Nylander (po@danielnylander.se)</holder></copyright><copyright><year>2004</year><holder>Marcus Rejås och Alexander Nordström (info@se.linux.org)</holder></copyright>

    <!-- translators: uncomment this:
    <copyright>
      <year>2000</year>
      <holder>ME-THE-TRANSLATOR (Latin translation)</holder>
    </copyright>
    -->

    <legalnotice>
      <para>Tillstånd att kopiera, distribuera och/eller modifiera detta dokument ges under villkoren i <citetitle>GNU Free Documentation License</citetitle>, version 1.1 eller senare, utgivet av Free Software Foundation utan standardavsnitt och omslagstexter.  En kopia av licensen finns <link linkend="fdl">inkluderad</link>.</para>
      <para>Flera namn på produkter och tjänster är registrerade varumärken. I de fall dessa namn förekommer i GNOME-dokumentation - och medlemmarna i GNOME-dokumentationsprojektet är medvetna om dessa varumärken - är de skrivna med versaler eller med inledande versal.</para>
    </legalnotice>

    <revhistory>
      <!--revision>
        <revnumber>1.18.1</revnumber>
        <date>15 Sep 2011</date>
        <authorinitials>sk</authorinitials>
        <revremark>development version, markdown support</revremark>
      </revision-->
      <revision>
        <revnumber>1.18</revnumber>
        <date>14 sep 2011</date>
        <authorinitials>sk</authorinitials>
        <revremark>bug fixes, speedups, markdown support</revremark>
      </revision>
      <revision>
        <revnumber>1.17</revnumber>
        <date>26 Feb 2011</date>
        <authorinitials>sk</authorinitials>
        <revremark>urgent bug fix update</revremark>
      </revision>
      <revision>
        <revnumber>1.16</revnumber>
        <date>14 Jan 2011</date>
        <authorinitials>sk</authorinitials>
        <revremark>bugfixes, layout improvements</revremark>
      </revision>
      <revision>
        <revnumber>1.15</revnumber>
        <date>21 May 2010</date>
        <authorinitials>sk</authorinitials>
        <revremark>bug and regression fixes</revremark>
      </revision>
      <revision>
        <revnumber>1.14</revnumber>
        <date>28 March 2010</date>
        <authorinitials>sk</authorinitials>
        <revremark>bugfixes and performance improvements</revremark>
      </revision>
      <revision>
        <revnumber>1.13</revnumber>
        <date>18 December 2009</date>
        <authorinitials>sk</authorinitials>
        <revremark>broken tarball update</revremark>
      </revision>
      <revision>
        <revnumber>1.12</revnumber>
        <date>18 December 2009</date>
        <authorinitials>sk</authorinitials>
        <revremark>new tool features and bugfixes</revremark>
      </revision>
      <revision>
        <revnumber>1.11</revnumber>
        <date>16 Novemebr 2008</date>
        <authorinitials>mal</authorinitials>
        <revremark>GNOME doc-utils migration</revremark>
      </revision>
    </revhistory>

  </bookinfo>

  <!-- ======== Chapter 1: Introduction ======================== -->

  <chapter id="introduction">
    <title>Introduktion</title>

    <para>
      This chapter introduces GTK-Doc and gives an overview of what it is and
      how it is used.
    </para>

    <sect1 id="whatisgtkdoc">
      <title>Vad är GTK-Doc?</title>

      <para>
        GTK-Doc is used to document C code. It is typically used to document the public
        API of libraries, such as the GTK+ and GNOME libraries. But it can also be
        used to document application code.
      </para>
    </sect1>

    <sect1 id="howdoesgtkdocwork">
      <title>Hur fungerar GTK-Doc?</title>

      <para>
        GTK-Doc works by using documentation of functions placed inside the source files in
        specially-formatted comment blocks, or documentation added to the template files
        which GTK-Doc uses (though note that GTK-Doc will only document functions that
        are declared in header files; it won't produce output for static functions).
      </para>

      <para>
        GTK-Doc consists of a number of perl scripts, each performing a different step
        in the process.
      </para>

      <para>
        There are 5 main steps in the process:
      </para>

      <orderedlist>

        <listitem>
          <para>
            <guilabel>Writing the documentation.</guilabel>

            The author fills in the source files with the documentation for each
            function, macro, union etc. (In the past information was entered in
            generated template files, which is not recommended anymore).
          </para>
        </listitem>

        <listitem>
          <para>
            <guilabel>Gathering information about the code.</guilabel>

            <application>gtkdoc-scan</application> scans the header files of the
            code looking for declarations of functions, macros, enums, structs, and unions.
            It creates the file <filename>&lt;module&gt;-decl-list.txt</filename> containg a list of the
            declarations, placing them into sections according to which header file they
            are in. On the first run this file is copied to <filename>&lt;module&gt;-sections.txt</filename>.
            The author can rearrange the sections, and the order of the
            declarations within them, to produce the final desired order.
            The second file it generates is <filename>&lt;module&gt;-decl.txt</filename>.
            This file contains the full declarations found by the scanner. If for
            some reason one would like some symbols to show up in the docs, where
            the full declaration cannot be found by the scanner or the declaration
            should appear differently, one can place enties similar to the ones in
            <filename>&lt;module&gt;-decl.txt</filename> into <filename>&lt;module&gt;-overrides.txt</filename>.

            <application>gtkdoc-scanobj</application> can also be used to dynamically query a library about
            any GtkObject subclasses it exports. It saves information about each
            object's position in the class hierarchy and about any GTK Args and Signals it
            provides.
          </para>
        </listitem>

        <listitem>
          <para>
            <guilabel>Generating the "template" files.</guilabel>

            <application>gtkdoc-mktmpl</application> creates a number of files in
            the <filename class="directory">tmpl/</filename> subdirectory, using the
            information gathered in the first step. (Note that this can be run
            repeatedly. It will try to ensure that no documentation is ever lost.)
          </para>
          <note>
            <para>
              Since GTK-Doc 1.9 the templates can be avoided. We encourage people to keep
              documentation in the code. <application>gtkdocize</application> supports now
              a <option>--flavour no-tmpl</option> option that chooses a makefile that
              skips tmpl usage totally.
              If you have never changed file in tmpl by hand, please remove the dir
              (e.g. from version control system).
            </para>
          </note>
        </listitem>

        <listitem>
          <para>
            <guilabel>Generating the SGML/XML and HTML/PDF.</guilabel>

            <application>gtkdoc-mkdb</application> turns the template files into
            SGML or XML files in the <filename class="directory">sgml/</filename>
            or <filename class="directory">xml/</filename> subdirectory.
            If the source code contains documentation on functions, using the
            special comment blocks, it gets merged in here. If there are no tmpl files used
            it only reads docs from sources and introspection data. We recommend
            to use Docbook XML.
          </para>
          <para>
            <application>gtkdoc-mkhtml</application> turns the SGML/XML files into HTML
            files in the <filename class="directory">html/</filename> subdirectory.
            Likewise <application>gtkdoc-mkpdf</application> turns the SGML/XML files into a PDF
            document called <filename>&lt;package&gt;.pdf</filename>.
          </para>
          <para>
            Files in <filename class="directory">sgml/</filename> or
            <filename class="directory">xml/</filename> and <filename class="directory">html/</filename>
            directories are always overwritten. One should never edit them directly.
          </para>
        </listitem>

        <listitem>
          <para>
            <guilabel>Fixing up cross-references between documents.</guilabel>

            After installing the HTML files, <application>gtkdoc-fixxref</application> can be run to fix up any
            cross-references between separate documents. For example, the GTK+
            documentation contains many cross-references to types documented in the GLib manual.

            When creating the source tarball for distribution, <application>gtkdoc-rebase</application>
            turns all external links into web-links. When installing distributed (pregenerated) docs
            the same application will try to turn links back to local links
            (where those docs are installed).
          </para>
        </listitem>
      </orderedlist>

    </sect1>

    <sect1 id="gettinggtkdoc">
      <title>Hämta GTK-Doc</title>

      <sect2 id="requirements">
        <title>Krav</title>
        <para>
          <guilabel>Perl v5</guilabel> - the main scripts are in Perl.
        </para>
        <para>
          <guilabel>DocBook DTD v3.0</guilabel> - This is the DocBook SGML DTD.
          <ulink url="http://www.ora.com/davenport" type="http">http://www.ora.com/davenport</ulink>
        </para>
        <para>
          <guilabel>Jade v1.1</guilabel> - This is a DSSSL processor for converting SGML to various formats.
          <ulink url="http://www.jclark.com/jade" type="http">http://www.jclark.com/jade</ulink>
        </para>
        <para>
          <guilabel>Modular DocBook Stylesheets</guilabel>
          This is the DSSSL code to convert DocBook to HTML (and a few other
          formats). It's used together with jade.
          I've customized the DSSSL code slightly, in gtk-doc.dsl, to colour
          the program code listings/declarations, and to support global
          cross-reference indices in the generated HTML.
          <ulink url="http://nwalsh.com/docbook/dsssl" type="http">http://nwalsh.com/docbook/dsssl</ulink>
        </para>
        <para>
          <guilabel>docbook-to-man</guilabel> - if you want to create man pages from the DocBook.
          I've customized the 'translation spec' slightly, to capitalise section
          headings and add the 'GTK Library' title at the top of the pages and the
          revision date at the bottom.
          There is a link to this on <ulink url="http://www.ora.com/davenport" type="http">http://www.ora.com/davenport</ulink>
          NOTE: This does not work yet.
        </para>
      </sect2>

      <sect2 id="installation">
        <title>Installation</title>
        <para>
          There is no standard place where the DocBook Modular Stylesheets are installed.
        </para>
        <para>
          GTK-Doc's configure script searches these 3 directories automatically:
        </para>
        <para>
          <filename> /usr/lib/sgml/stylesheets/nwalsh-modular   </filename>     (used by RedHat)
        </para>
        <para>
          <filename>  /usr/lib/dsssl/stylesheets/docbook         </filename>     (used by Debian)
        </para>
        <para>
          <filename>  /usr/share/sgml/docbkdsl                   </filename>     (used by SuSE)
        </para>
        <para>
          If you have the stylesheets installed somewhere else, you need to configure
          GTK-Doc using the option:
          <command> --with-dsssl-dir=&lt;PATH_TO_TOPLEVEL_STYLESHEETS_DIR&gt; </command>
        </para>
      </sect2>

    </sect1>

    <!-- not realy worth a section
    <sect1 id="whentousegtkdoc">
      <title>When to Use GTK-Doc</title>

      <para>
        (What things GTK-Doc should, and shouldn't, be used for.)
        (- ???)
        (- non C-based projects)
        (+ Tutorials)
      </para>

    </sect1>
    -->

    <sect1 id="aboutgtkdoc">
      <title>Om GTK-Doc</title>

      <para>
        (FIXME)
      </para>

      <para>
        (History, authors, web pages, license, future plans,
        comparison with other similar systems.)
      </para>

    </sect1>

    <sect1 id="aboutthismanual">
      <title>Om denna handbok</title>

      <para>
        (FIXME)
      </para>

      <para>
        (who it is meant for, where you can get it, license)
      </para>

    </sect1>

  </chapter>

  <chapter id="settingup">
    <title>Setting up your project</title>

    <para>
      The next sections describe what steps to perform to integrate GTK-Doc into
      your project. Theses sections assume we work on a project called 'meep'.
      This project contains a library called 'libmeep' and
      an end-user app called 'meeper'. We also assume you will be using autoconf
      and automake. In addition section <link linkend="plain_makefiles">plain
      makefiles or other build systems</link> will describe the basics needed to
      work in a different build setup.
    </para>

    <sect1 id="settingup_docfiles">
      <title>Setting up a skeleton documentation</title>

      <para>
        Under your top-level project directory create folders called docs/reference
        (this way you can also have docs/help for end-user documentation).
        It is recommended to create another subdirectory with the name of the doc-package.
        For packages with just one library this step is not necessary.
      </para>

      <para>
        This can then look as shown below:
        <example><title>Example directory structure</title>
          <programlisting>
<![CDATA[
meep/
  docs/
    reference/
      libmeep/
      meeper/
  src/
    libmeep/
    meeper/
]]>
          </programlisting>
        </example>
      </para>
    </sect1>

    <sect1 id="settingup_autoconf">
      <title>Integration with autoconf</title>

      <para>
        Very easy! Just add one line to your <filename>configure.ac</filename> script.
      </para>

      <para>
        <example><title>Integration with autoconf</title>
          <programlisting>
<![CDATA[
# check for gtk-doc
GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
]]>
          </programlisting>
        </example>
      </para>

      <para>
        This will require all developers to have gtk-doc installed. If it is
        okay for your project to have optional api-doc build setup, you can
        solve this as below. Keep it as is, as gtkdocize is looking for
        <function>GTK_DOC_CHECK</function>  at the start of a line.
        <example><title>Keep gtk-doc optional</title>
          <programlisting>
<![CDATA[
# check for gtk-doc
m4_ifdef([GTK_DOC_CHECK], [
GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
],[
AM_CONDITIONAL([ENABLE_GTK_DOC], false)
])
]]>
          </programlisting>
        </example>
      </para>

      <para>
        The first argument is used to check for the gtkdocversion at configure time.
        The 2nd, optional argument is used by <application>gtkdocize</application>.
        The <symbol>GTK_DOC_CHECK</symbol> macro also adds several configure switches:
      </para>
      <orderedlist>
        <listitem><para>--with-html-dir=PATH : path to installed docs</para></listitem>
        <listitem><para>--enable-gtk-doc : use gtk-doc to build documentation [default=no]</para></listitem>
        <listitem><para>--enable-gtk-doc-html : build documentation in html format [default=yes]</para></listitem>
        <listitem><para>--enable-gtk-doc-pdf : build documentation in pdf format [default=no]</para></listitem>
      </orderedlist>

      <important>
      	<para>
          GTK-Doc is disabled by default! Remember to pass the option
          <option>'--enable-gtk-doc'</option> to the next
          <filename>configure</filename> run. Otherwise pregenerated documentation is installed
          (which makes sense for users but not for developers).
        </para>
      </important>

      <para>
        Furthermore it is recommended that you have the following line inside
        you <filename>configure.ac</filename> script.
        This allows <application>gtkdocize</application> to automatically copy the
        macro definition for <function>GTK_DOC_CHECK</function> to your project.
      </para>

      <para>
        <example><title>Förberedelse för gtkdocize</title>
          <programlisting>
<![CDATA[
AC_CONFIG_MACRO_DIR(m4)
]]>
          </programlisting>
        </example>
      </para>
    </sect1>

    <sect1 id="settingup_automake">
      <title>Integration med automake</title>

      <para>
        First copy the <filename>Makefile.am</filename> from the examples subdirectory of the gtkdoc-sources
        to your project's API documentation directory (
        <filename class="directory">./docs/reference/&lt;package&gt;</filename>).
        If you have multiple doc-packages repeat this for each one.
      </para>

      <para>
        The next step is to edit the settings inside the <filename>Makefile.am</filename>.
        All the settings have a comment above that describes their purpose.
        Most settings are extra flags passed to the respective tools. Every tool
        has a variable of the form <option>&lt;TOOLNAME&gt;_OPTIONS</option>.
        All the tools support <option>--help</option> to list the supported
        parameters.
      </para>

      <!-- FIXME: explain options ? -->

      <para>
        You may also want to enable GTK-Doc for the distcheck make target. Just
        add the one line shown in the next example to your top-level
        <filename>Makefile.am</filename>:
      </para>

      <para>
        <example><title>Enable GTK-Doc during make distcheck</title>
          <programlisting>
<![CDATA[
DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
]]>
          </programlisting>
        </example>
      </para>

    </sect1>

    <sect1 id="settingup_autogen">
      <title>Integration with autogen</title>

      <para>
        Most projects will have an <filename>autogen.sh</filename> script to
        setup the build infrastructure after a checkout from version control
        system (such as cvs/svn/git). GTK-Doc comes with a tool called
        <application>gtkdocize</application> which can be used in such a script.
        It should be run before autoheader, automake or autoconf.
      </para>

      <para>
        <example><title>Running gtkdocize from autogen.sh</title>
          <programlisting>
<![CDATA[
gtkdocize || exit 1
]]>
          </programlisting>
        </example>
      </para>

      <para>
        When running <application>gtkdocize</application> it copies
        <filename>gtk-doc.make</filename> to your project root (or any directory
        specified by the <option>--docdir</option> option).
        It also checks you configure script for the <function>GTK_DOC_CHECK</function>
        invocation. This macro can be used to pass extra parameters to
        <application>gtkdocize</application>.
      </para>

      <para>
        Historically GTK-Doc was generating template files where developers entered the docs.
        This turned out to be not so good (e.g. the need for having generated
        files under version control).
        Since GTK-Doc 1.9 the tools can get all the information from source comments
        and thus the templates can be avoided. We encourage people to keep
        documentation in the code. <application>gtkdocize</application> supports now
        a <option>--flavour no-tmpl</option> option that chooses a makefile that skips
        tmpl usage totally. Besides adding the option directly to the command
        invocation, they can be added also to an environment variable called <symbol>GTKDOCIZE_FLAGS</symbol>
        or set as a 2nd parameter in <symbol>GTK_DOC_CHECK</symbol> macro in the configure script.
        If you have never changed file in tmpl by hand and migrating from older gtkdoc versions,
        please remove the dir (e.g. from version control system).
      </para>
    </sect1>

    <sect1 id="settingup_firstrun">
      <title>Running the doc build</title>

      <para>
        After the previous steps it's time to run the build. First we need to
	rerun <filename>autogen.sh</filename>. If this script runs configure for
	you, then give it the <option>--enable-gtk-doc</option> option.
	Otherwise manually run <filename>configure</filename> with this option
	afterwards.
      </para>
      <para>
        The first make run generates several additional files in the doc-dirs.
        The important ones are:
        <filename>&lt;package&gt;.types</filename>,
        <filename>&lt;package&gt;-docs.xml</filename> (in the past .sgml),
        <filename>&lt;package&gt;-sections.txt</filename>.
      </para>
      <para>
        <example><title>Running the doc build</title>
          <programlisting>
<![CDATA[
./autogen.sh --enable-gtk-doc
make
]]>
          </programlisting>
        </example>
      </para>
      <para>
        Now you can point your browser to <filename>docs/reference/&lt;package&gt;/index.html</filename>.
        Yes, it's a bit disappointing still. But hang-on, during the next chapter we
        tell you how to fill the pages with life.
      </para>
    </sect1>

    <sect1 id="settingup_vcs">
      <title>Integration with version control systems</title>

      <para>
        As a rule of the thumb, it's those files you edit, that should go under
        version control. For typical projects it's these files:
        <filename>&lt;package&gt;.types</filename>,
        <filename>&lt;package&gt;-docs..xml</filename> (in the past .sgml),
        <filename>&lt;package&gt;-sections.txt</filename>,
        <filename>Makefile.am</filename>
      </para>
    </sect1>

    <sect1 id="plain_makefiles">
      <title>Integration with plain makefiles or other build systems</title>

      <para>
        In the case one does not want to use automake and therfore
        <filename>gtk-doc.mak</filename> one will need to call the gtkdoc tools
        in the right order in own makefiles (or other build tools).
      </para>

      <para>
        <example><title>Documentation build steps</title>
          <programlisting>
<![CDATA[
DOC_MODULE=meep
// sources have changed
gtkdoc-scan --module=$(DOC_MODULE) --source-dir=...
gtkdoc-scangobj --module=$(DOC_MODULE)
gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml
// xml files have changed
mkdir html
cd html && gtkdoc-mkhtml $(DOC_MODULE) ../meep-docs.xml
gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html
]]>
          </programlisting>
        </example>
      </para>

      <para>
        One will need to look at the <filename>Makefile.am</filename> and
        <filename>gtk-doc.mak</filename> to pick the extra options needed.
      </para>
    </sect1>

  </chapter>

  <chapter id="documenting">
    <title>Documenting the code</title>

    <para>
      GTK-Doc uses source code comment with a special syntax for code documentation.
      Further it retrieves information about your project structure from other
      sources. During the next section you will find all information about the
      syntax of the comments.
    </para>

    <note>
      <title>Documentation placement</title>
      <para>
        In the past most documentation had to be filled into files residing
	inside the <filename>tmpl</filename> directory. This has the
	disadvantages that the information is often not updated and also that
	the file tend to cause conflicts with version control systems.
      </para>
      <para>
        The avoid the aforementioned problems we suggest putting the
	documentation inside the sources. This manual will only describe this
	way of documenting code.
      </para>
    </note>

    <para>
      The scanner can handle the majority of c headers fine. In the case of
      receiving warnings from the scanner that look like a special case, one can
      hint GTK-Doc to skip over them.
      <example><title>GTK-Doc comment block</title>
        <programlisting>
<![CDATA[
#ifndef __GTK_DOC_IGNORE__
/* unparseable code here */
#endif
]]>
        </programlisting>
      </example>
    </para>

    <!--  -->

    <sect1 id="documenting_syntax">
      <title>Documentation comments</title>

      <para>
        A multiline comment that starts with an additional '*' marks a
        documentation block that will be processed by the GTK-Doc tools.
        <example><title>GTK-Doc comment block</title>
          <programlisting>
<![CDATA[
/**
 * identifier:
 * documentation ...
 */
]]>
          </programlisting>
        </example>
      </para>

      <para>
        The 'identifier' is one line with the name of the item the comment is
        related to. The	syntax differs a little depending on the item.
        (TODO add table showing identifiers)
      </para>

      <para>
        The 'documentation' block is also different for each symbol type. Symbol
        types that get parameters such as functions or macros have the parameter
        description first followed by a blank line (just a '*').
        Afterwards follows the detailed description. All lines (outside program-
        listings and CDATA sections) just containing a ' *' (blank-asterisk) are
        converted to paragraph breaks.
        If you don't want a paragraph break, change that into ' *  '
        (blank-asterisk-blank-blank).
      </para>

      <tip>
        <para>
          When documenting code, describe two apsects:
          <itemizedlist>
             <listitem>
               <para>
                 What it is: The name for a class or function can sometimes
                 be misleading for people coming from a different background.
                </para>
             </listitem>
             <listitem>
               <para>
                 What it does: Tell about common uses. Put it in releation
                 with the other API.
               </para>
             </listitem>
           </itemizedlist>
        </para>
      </tip>

      <para>
        One advantage of hyper-text over plain-text is the ability to have links
        in the document. Writing the correct markup for a link can be tedious
        though. GTK-Doc comes to help by providing several useful abbreviations.
        <itemizedlist>
          <listitem>
            <para>
              Use function() to refer to functions or macros which take arguments.
            </para>
          </listitem>
          <listitem>
            <para>
              Use @param to refer to parameters. Also use this when referring to
              parameters of other functions, related to the one being described.
            </para>
          </listitem>
          <listitem>
            <para>
              Use %constant to refer to a constant, e.g. %G_TRAVERSE_LEAFS.
            </para>
          </listitem>
          <listitem>
            <para>
              Use #symbol to refer to other types of symbol, e.g. structs and
              enums and macros which don't take arguments.
            </para>
          </listitem>
          <listitem>
            <para>
              Use #Object::signal to refer to a GObject signal
            </para>
          </listitem>
          <listitem>
            <para>
              Use #Object:property to refer to a GObject property
            </para>
          </listitem>
          <listitem>
            <para>
              Use #Struct.field to refer to a field inside a structure.
            </para>
          </listitem>
        </itemizedlist>
      </para>

      <tip>
	     <para>
          If you need to use the special characters '&lt;', '&gt;', '()', '@',
          '%', or '#' in your documentation without GTK-Doc changing them you
          can use the XML entities "&amp;lt;", "&amp;gt;", "&amp;lpar;",
          "&amp;rpar;", "&amp;commat;", "&amp;percnt;" and "&amp;num;"
          respectively or escape them with a backslash '\'.
	     </para>
      </tip>

      <para>
        DocBook can do more than just links. One can also have lists, tables and
        examples. To enable the usage of docbook SGML/XML tags inside
        doc-comments you need to have <option>--xml-mode</option> or
        <option>--sgml-mode</option> in the variable
        <symbol>MKDB_OPTIONS</symbol> inside <filename>Makefile.am</filename>.
      </para>

      <para>
        Since GTK-Doc-1.18 the tool supports a subset or the
        <ulink url="http://daringfireball.net/projects/markdown/">markdown language</ulink>.
        One can use it for sub-headings and simple itemized lists. On older
        GTK-Doc versions the content will be rendered as it (the list items will
        appear in one line separated by dashes).
        <example><title>GTK-Doc comment block using markdown</title>
          <programlisting>
<![CDATA[
/**
 * identifier:
 *
 * documentation ...
 *
 * # Sub heading #
 *
 * more documentation:
 * - list item 1
 * - list item 2
 *
 * Even more docs.
 */
]]>
          </programlisting>
        </example>
      </para>

      <tip>
	<para>
	  As already mentioned earlier GTK-Doc is for documenting public API. Thus
	  one cannot write documentation for static symbols. Nevertheless it is good
	  to comment those symbols too. This helps other to understand you code.
	  Therefore we recommend to comment these using normal comments (without the
	  2nd '*' in the first line).
	  If later the function needs to be made public, all one needs to do is to
	  add another '*' in the comment block and insert the symbol name at the
	  right place inside the sections file.
	</para>
      </tip>
    </sect1>

    <sect1 id="documenting_sections">
      <title>Documenting sections</title>

      <para>
        Each section of the documentation contains information about one class
        or module. To introduce the component one can write a section block.
        The short description is also used inside the table of contents.
        All the @fields are optional.
      </para>

      <para>
        <example><title>Section comment block</title>
          <programlisting>
<![CDATA[
/**
 * SECTION:meepapp
 * @short_description: the application class
 * @title: Meep application
 * @section_id:
 * @see_also: #MeepSettings
 * @stability: Stable
 * @include: meep/app.h
 * @image: application.png
 *
 * The application class handles ...
 */
]]>
          </programlisting>
        </example>
      </para>

      <variablelist>
        <varlistentry>
          <term>SECTION:&lt;name&gt;</term>
          <listitem>
            <para>
              The name links the section documentation to the respective part in
              the <filename>&lt;package&gt;-sections.txt</filename> file. The
              name give here should match the &lt;FILE&gt; tag in the
              <filename>&lt;package&gt;-sections.txt</filename> file.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>@short_description</term>
          <listitem>
            <para>
              A one line description of the section, that later will appear after
              the links in the TOC and at the top of the section page.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>@title</term>
          <listitem>
            <para>
              The section title defaults to &lt;name&gt; from the SECTION
              declaration. It can be overridden with the @title field.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>@section_id</term>
          <listitem>
            <para>
              Overrides the use of title as a section identifier. For GObjects
              the &lt;title&gt; is used as a section_id and for other sections
              it is &lt;MODULE&gt;-&lt;title&gt;.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>@see_also</term>
          <listitem>
            <para>
              A list of symbols that are related to this section.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>@stability</term>
          <listitem>
            <para>
              A informal description of the stability level this API has.
              We recommend the use of one of these terms:
              <itemizedlist>
                <listitem>
                  <para>
                    Stable
                    - The intention of a Stable interface is to enable arbitrary
                    third parties to develop applications to these interfaces,
                    release them, and have confidence that they will run on all
                    minor releases of the product (after the one in which the
                    interface was introduced, and within the same major release).
                    Even at a major release, incompatible changes are expected
                    to be rare, and to have strong justifications.
                  </para>
                </listitem>
                <listitem>
                  <para>
                    Unstable
                    - Unstable interfaces are experimental or transitional.
                    They are typically used to give outside developers early
                    access to new or rapidly changing technology, or to provide
                    an interim solution to a problem where a more general
                    solution is anticipated.
                    No claims are made about either source or binary
                    compatibility from one minor release to the next.
                  </para>
                </listitem>
                <listitem>
                  <para>
                    Private
                    - An interface that can be used within the GNOME stack
                    itself, but that is not documented for end-users. Such
                    functions should only be used in specified and documented
                    ways.
                  </para>
                </listitem>
                <listitem>
                  <para>
                    Internal
                    - An interface that is internal to a module and does not
                    require end-user documentation. Functions that are
                    undocumented are assumed to be Internal.
                  </para>
                </listitem>
              </itemizedlist>
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>@include</term>
          <listitem>
            <para>
              The <literal>#include</literal> files to show in the section
              synopsis (a comma separated list), overriding the global
              value from the <link linkend="metafiles_sections">section
              file</link> or command line.  This item is optional.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>@image</term>
          <listitem>
            <para>
              The image to display at the top of the reference page for this
              section.  This will often be some sort of a diagram to illustrate
              the visual appearance of a class or a diagram of its relationship
              to other classes.  This item is optional.
            </para>
          </listitem>
        </varlistentry>
      </variablelist>

      <tip>
        <para>
          To avoid unnecessary recompilation after doc-changes put the section
          docs into the c-source where possible.
        </para>
      </tip>

    </sect1>

    <sect1 id="documenting_symbols">
      <title>Documenting symbols</title>

      <para>
        Each symbol (function, macro, struct, enum, signal and property) is
        documented in a separate block. The block is best placed close to the
        definition of the symbols so that it is easy to keep them in sync.
        Thus functions are usually documented in the c-source and macros,
        structs and enums in the header file.
      </para>

      <sect2><title>General tags</title>

        <para>
          You can add versioning information to all documentation elements to tell
          when an api was introduced, or when it was deprecated.
        </para>

        <variablelist><title>Versioning Tags</title>
          <varlistentry><term>Since:</term>
            <listitem>
              <para>
                Description since which version of the code the API is available.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry><term>Deprecated:</term>
            <listitem>
              <para>
                Paragraph denoting that this function should no be used anymore.
                The description should point the reader to the new API.
              </para>
            </listitem>
          </varlistentry>
        </variablelist>

          <para>
            (FIXME : Stability information)
          </para>

        <example><title>General tags</title>
          <programlisting>
<![CDATA[
/**
 * foo_get_bar:
 * @foo: some foo
 *
 * Retrieves @foo's bar.
 *
 * Returns: @foo's bar
 *
 * Since: 2.6
 * Deprecated: 2.12: Use foo_baz_get_bar() instead.
 **/
Bar *
foo_get_bar(Foo *foo)
{
...
]]>
          </programlisting>
        </example>
      </sect2>

      <sect2><title>Function comment block</title>

        <para>
          Please remember to:
          <itemizedlist>
            <listitem>
              <para>
                Document whether returned objects, lists, strings, etc, should be
                freed/unrefed/released.
              </para>
            </listitem>
            <listitem>
              <para>
                Document whether parameters can be NULL, and what happens if they are.
              </para>
            </listitem>
            <listitem>
              <para>
                Mention interesting pre-conditions and post-conditions where appropriate.
              </para>
            </listitem>
          </itemizedlist>
        </para>

        <para>
          Gtk-doc assumes all symbols (macros, functions) starting with '_' are
          private. They are treated like static functions.
        </para>

        <para>
          
          Also, take a look at gobject introspection annotation tags:
          http://live.gnome.org/GObjectIntrospection/Annotations
        </para>

        <example><title>Function comment block</title>
          <programlisting>
<![CDATA[
/**
 * function_name:
 * @par1:  description of parameter 1. These can extend over more than
 * one line.
 * @par2:  description of parameter 2
 * @...: a %NULL-terminated list of bars
 *
 * The function description goes here. You can use @par1 to refer to parameters
 * so that they are highlighted in the output. You can also use %constant
 * for constants, function_name2() for functions and #GtkWidget for links to
 * other declarations (which may be documented elsewhere).
 *
 * Returns: an integer.
 *
 * Since: 2.2
 * Deprecated: 2.18: Use other_function() instead.
 */
]]>
          </programlisting>
        </example>

        <variablelist><title>Function tags</title>
          <varlistentry><term>Returns:</term>
            <listitem>
              <para>
                Paragraph describing the returned result.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry><term>@...:</term>
            <listitem>
              <para>
                In case the function has variadic arguments, you should use this
                tag (@Varargs: does also work for historic reasons).
              </para>
            </listitem>
          </varlistentry>
        </variablelist>

      </sect2>

      <sect2><title>Property comment block</title>

        <example><title>Property comment block</title>
          <programlisting>
<![CDATA[
/**
 * SomeWidget:some-property:
 *
 * Here you can document a property.
 */
g_object_class_install_property (object_class, PROP_SOME_PROPERTY, ...);
]]>
          </programlisting>
        </example>

      </sect2>

      <sect2><title>Signal comment block</title>

        <para>
          Please remember to:
          <itemizedlist>
            <listitem>
              <para>
                Document when the signal is emitted and whether it is emitted before
                or after other signals.
              </para>
            </listitem>
            <listitem>
              <para>
                Document what an application might do in the signal handler.
              </para>
            </listitem>
          </itemizedlist>
        </para>

        <example><title>Signal comment block</title>
          <programlisting>
<![CDATA[
/**
 * FooWidget::foobarized:
 * @widget: the widget that received the signal
 * @foo: some foo
 * @bar: some bar
 *
 * The ::foobarized signal is emitted each time someone tries to foobarize @widget.
 */
foo_signals[FOOBARIZE] =
  g_signal_new ("foobarize",
                ...
]]>
          </programlisting>
        </example>

      </sect2>

      <sect2><title>Struct comment block</title>
        <example><title>Struct comment block</title>
          <programlisting>
<![CDATA[
/**
 * FooWidget:
 * @bar: some #gboolean
 *
 * This is the best widget, ever.
 */
typedef struct _FooWidget {
  /*< private >*/
  GtkWidget parent;

  /*< public >*/
  gboolean bar;
} FooWidget;
]]>
          </programlisting>
        </example>

        <para>
          Use <code>/*&lt; private &gt;*/</code> before the private struct fields
          you want to hide. Use <code>/*&lt; public &gt;*/</code> for the reverse
          behaviour.
        </para>

        <para>
          Struct comment blocks can also be used for GObjects and GObjectClasses.
          It is usualy a good idea to add a comment blco for a class, if it has
          vmethods (as this is how they can be documented). For the GObject
          itself one can use the related section docs, having a separate block
          for the instance struct would be useful if the instance has public
          fields. One disadvantage here is that this creates two index entries
          of the same name (the structure and the section).
        </para>

      </sect2>

      <sect2><title>Enum comment block</title>
        <example><title>Enum comment block</title>
          <programlisting>
<![CDATA[
/**
 * Something:
 * @SOMETHING_FOO: something foo
 * @SOMETHING_BAR: something bar
 *
 * Enum values used for the thing, to specify the thing.
 *
 **/
typedef enum {
  SOMETHING_FOO,
  SOMETHING_BAR,
  /*< private >*/
  SOMETHING_COUNT
} Something;
]]>
          </programlisting>
        </example>

        <para>
          Use <code>/*&lt; private &gt;*/</code> before the private enum values
          you want to hide. Use <code>/*&lt; public &gt;*/</code> for the reverse
          behaviour.
        </para>

      </sect2>
    </sect1>

    <sect1 id="documenting_docbook">
      <title>Useful DocBook tags</title>

      <para>
        Here are some DocBook tags which are most useful when documenting the
        code.
      </para>

      <para>
        To link to another section in the GTK docs:

        <informalexample>
          <programlisting>
<![CDATA[
<link linkend="glib-Hash-Tables">Hash Tables</link>
]]>
          </programlisting>
        </informalexample>
        The linkend is the SGML/XML id on the top item of the page you want to link to.
        For most pages this is currently the part ("gtk", "gdk", "glib") and then
        the page title ("Hash Tables"). For widgets it is just the class name.
        Spaces and underscores are converted to '-' to conform to SGML/XML.
      </para>

      <para>
        To refer to an external function, e.g. a standard C function:
        <informalexample>
          <programlisting>
<![CDATA[
<function>...</function>
]]>
          </programlisting>
        </informalexample>
      </para>

      <para>
        To include example code:
        <informalexample>
          <programlisting>
<![CDATA[
<example>
  <title>Using a GHashTable.</title>
  <programlisting>
      ...
  </programlisting>
</example>
]]>
          </programlisting>
        </informalexample>
        or possibly this, for very short code fragments which don't need a title:
        <informalexample>
          <programlisting>
<![CDATA[
<informalexample>
  <programlisting>
  ...
  </programlisting>
</informalexample>
]]>
          </programlisting>
        </informalexample>
        For the latter GTK-Doc also supports an abbreviation:
<![CDATA[
|[
  ...
]|
]]>
      </para>

      <para>
        To include bulleted lists:
        <informalexample>
          <programlisting>
<![CDATA[
<itemizedlist>
  <listitem>
    <para>
      ...
    </para>
  </listitem>
  <listitem>
    <para>
      ...
    </para>
  </listitem>
</itemizedlist>
]]>
          </programlisting>
        </informalexample>
      </para>

      <para>
        To include a note which stands out from the text:
        <informalexample>
          <programlisting>
<![CDATA[
<note>
  <para>
    Make sure you free the data after use.
  </para>
</note>
]]>
          </programlisting>
        </informalexample>
      </para>

      <para>
        To refer to a type:
        <informalexample>
          <programlisting>
<![CDATA[
<type>unsigned char</type>
]]>
          </programlisting>
        </informalexample>
      </para>

      <para>
        To refer to an external structure (not one described in the GTK docs):
        <informalexample>
          <programlisting>
<![CDATA[
<structname>XFontStruct</structname>
]]>
          </programlisting>
        </informalexample>
      </para>

      <para>
        To refer to a field of a structure:
        <informalexample>
          <programlisting>
<![CDATA[
<structfield>len</structfield>
]]>
          </programlisting>
        </informalexample>
      </para>

      <para>
        To refer to a class name, we could possibly use:
        <informalexample>
          <programlisting>
<![CDATA[
<classname>GtkWidget</classname>
]]>
          </programlisting>
        </informalexample>
        but you'll probably be using #GtkWidget instead (to automatically create
        a link to the GtkWidget page - see <link linkend="documenting_syntax">the abbreviations</link>).
      </para>

      <para>
        To emphasize text:
        <informalexample>
          <programlisting>
<![CDATA[
<emphasis>This is important</emphasis>
]]>
          </programlisting>
        </informalexample>
      </para>

      <para>
        For filenames use:
        <informalexample>
          <programlisting>
<![CDATA[
<filename>/home/user/documents</filename>
]]>
          </programlisting>
        </informalexample>
      </para>

      <para>
        To refer to keys use:
        <informalexample>
          <programlisting>
<![CDATA[
<keycombo><keycap>Control</keycap><keycap>L</keycap></keycombo>
]]>
          </programlisting>
        </informalexample>
      </para>

    </sect1>
  </chapter>

  <chapter id="metafiles">
    <title>Filling the extra files</title>

    <para>
      There are a couple of extra files, that need to be maintained along with
      the inline source code comments:
      <filename>&lt;package&gt;.types</filename>,
      <filename>&lt;package&gt;-docs.xml</filename> (in the past .sgml),
      <filename>&lt;package&gt;-sections.txt</filename>.
    </para>

    <sect1 id="metafiles_types">
      <title>Editing the types file</title>

      <para>
        If your library or application includes GtkObjects/GObjects, you want
        their signals, arguments/parameters and position in the hierarchy to be
        shown in the documentation. All you need to do, is to list the
        <function>xxx_get_type</function> functions together with their include
        inside the <filename>&lt;package&gt;.types</filename> file.
      </para>

      <para>
        <example><title>Example types file snippet</title>
          <programlisting>
<![CDATA[
#include <gtk/gtk.h>

gtk_accel_label_get_type
gtk_adjustment_get_type
gtk_alignment_get_type
gtk_arrow_get_type
]]>
          </programlisting>
        </example>
      </para>

      <para>
        Since GTK-Doc 1.8 <application>gtkdoc-scan</application> can generate this list for you.
        Just add "--rebuild-types" to SCAN_OPTIONS in <filename>Makefile.am</filename>. If you
        use this approach you should not dist the types file nor have it under version control.
      </para>

    </sect1>

    <sect1 id="metafiles_master">
      <title>Editing the master document</title>

      <para>
        GTK-Doc produces documentation in DocBook SGML/XML. When processing the
        inline source comments, the GTK-Doc tools generate one documentation
        page per class or module as a separate file. The master document
        includes them and place them in an order.
      </para>

      <para>
        While GTK-Doc creates a template master document for you, later run will
        not touch it again. This means that one can freely structure the
        documentation. That includes grouping pages and adding extra pages.
        GTK-Doc has now a test suite, where also the master-document is recreated from scratch.
        Its a good idea to look at this from time to time to see if there are some new goodies
        introduced there.
      </para>

      <tip>
        <para>
          Do not create tutorials as extra documents. Just write extra chapters.
          The benefit of directly embedding the tutorial for your library into
          the API documentation is that it is easy to link for the tutorial to
          symbol documentation. Apart chances are higher that the tutorial gets
          updates along with the library.
        </para>
      </tip>

      <para>
        So what are the things to change inside the master document? For a start
        is only a little. There are some placeholders (text in square brackets)
        there which you should take care of.
      </para>

      <para>
        <example><title>Master document header</title>
          <programlisting>
<![CDATA[
<bookinfo>
  <title>MODULENAME Reference Manual</title>
  <releaseinfo>
    for MODULENAME [VERSION]
    The latest version of this documentation can be found on-line at
    <ulink role="online-location" url="http://[SERVER]/MODULENAME/index.html">http://[SERVER]/MODULENAME/</ulink>.
  </releaseinfo>
</bookinfo>

<chapter>
  <title>[Insert title here]</title>
]]>
          </programlisting>
        </example>
      </para>

    </sect1>

    <sect1 id="metafiles_sections">
      <title>Editing the section file</title>

      <para>
        The section file is used to organise the documentation output by
        GTK-Doc. Here one specifies which symbol belongs to which module or
        class and control the visibility (public or private).
      </para>

      <para>
        The section file is a plain test file with xml like syntax (using tags).
        Blank lines are ignored and lines starting with a '#' are treated as
        comment lines.
      </para>

      <para>
        The &lt;FILE&gt; ... &lt;/FILE&gt; tag is used to specify the file name,
        without any suffix. For example, using '&lt;FILE&gt;gnome-config&lt;/FILE&gt;'
        will result in the section declarations being output in the template
        file <filename>tmpl/gnome-config.sgml</filename>, which will be
        converted into the DocBook SGML/XML file <filename>sgml/gnome-config.sgml</filename>
        or .DocBook XML file <filename>xml/gnome-config.xml</filename>.
        (The name of the html file is based on the module name and the section
        title, or for gobjects it is based on the gobjects class name converted
        to lower case).
      </para>

      <para>
        The &lt;TITLE&gt; ... &lt;/TITLE&gt; tag is used to specify the title of
        the section. It is only useful before the templates (if used) are
        initially created, since the title set in the template file overrides
        this. Also if one uses SECTION comment in the sources, this is obsolete.
      </para>

      <para>
        You can group items in the section by using the &lt;SUBSECTION&gt; tag.
        Currently it outputs a blank line between subsections in the synopsis
        section.
        You can also use &lt;SUBSECTION Standard&gt; for standard GObject
        declarations (e.g. the functions like g_object_get_type and macros like
        G_OBJECT(), G_IS_OBJECT() etc.).
        Currently these are left out of the documentation.
        You can also use &lt;SUBSECTION Private&gt; for private declarations
        which will not be output (It is a handy way to avoid warning messages
        about unused declarations.).
        If your library contains private types which you don't want to appear in
        the object hierarchy and the list of implemented or required interfaces,
        add them to a Private subsection.
        Wheter you would place GObject and GObjectClass like structs in public
        or Standard section depends if they have public entries (variables,
        vmethods).
      </para>

      <para>
        You can also use &lt;INCLUDE&gt; ... &lt;/INCLUDE&gt; to specify the
        #include files which are shown in the synopsis sections.
        It contains a comma-separate list of #include files, without the angle
        brackets. If you set it outside of any sections, it acts for all
        sections until the end of the file. If you set it within a section, it
        only applies to that section.
      </para>

    </sect1>

  </chapter>

  <chapter id="reports">
    <title>Controlling the result</title>

    <para>
      A GTK-Doc run generates report files inside the documentation directory.
      The generated files are named:
      <filename>&lt;package&gt;-undocumented.txt</filename>,
      <filename>&lt;package&gt;-undeclared.txt</filename> and
      <filename>&lt;package&gt;-unused.txt</filename>.
      All those are plain text files that can be viewed and postprocessed easily.
    </para>

    <para>
      The <filename>&lt;package&gt;-undocumented.txt</filename> file starts with
      the documentation coverage summary. Below are two sections divided by
      blank lines. The first section lists undocumented or incomplete symbols.
      The second section does the same for section docs. Incomplete entries are
      those, which have documentation, but where e.g. a new parameter has been
      added.
    </para>

    <para>
      The <filename>&lt;package&gt;-undeclared.txt</filename> file lists symbols
      given in the <filename>&lt;package&gt;-sections.txt</filename> but not
      found in the sources. Check if they have been removed or if they are
      misspelled.
    </para>

    <para>
      The <filename>&lt;package&gt;-unused.txt</filename> file lists symbol
      names, where the GTK-Doc scanner has found documentation, but does not
      know where to put it. This means that the symbol has not yet been added to
      the <filename>&lt;package&gt;-sections.txt</filename> file.
    </para>

    <tip>
      <para>
        Enable or add the <option>TESTS=$(GTKDOC_CHECK)</option> line in Makefile.am.
        If at least GTK-Doc 1.9 is installed, this will run sanity checks during
        <command>make check</command> run.
      </para>
    </tip>

    <para>
      One can also look at the files produced by the source code scanner:
      <filename>&lt;package&gt;-decl-list.txt</filename> and
      <filename>&lt;package&gt;-decl.txt</filename>. The first one can be
      compared with the section file if that is manualy maintained. The second
      lists all declarations fromt he headers If a symbol is missing one could
      check if this file contains it.
    </para>

    <para>
      If the project is GObject based, one can also look into the files produced
      by the object scanner:
      <filename>&lt;package&gt;.args.txt</filename>,
      <filename>&lt;package&gt;.hierarchy.txt</filename>,
      <filename>&lt;package&gt;.interfaces.txt</filename>,
      <filename>&lt;package&gt;.prerequisites.txt</filename> and
      <filename>&lt;package&gt;.signals.txt</filename>. If there are missing
      symbols in any of those, one can ask gtkdoc to keep the intermedia scanner
      file for further analysis, but running it as
      <command>GTK_DOC_KEEP_INTERMEDIATE=1 make</command>.
    </para>
  </chapter>

  <chapter id="documenting-others">
    <title>Documenting other interfaces</title>

    <para>
      So far we have been using GTK-Doc to document the API of code. The next
      sections contain suggestions how the tools can be used to document other
      interfaces too.
    </para>

    <sect1 id="commandline-interfaces">
      <title>Commandline options and man pages</title>

      <para>
        As one can generate man pages for a docbook refentry as well, it sounds
        like a good idea to use it for that purpose. This way the interface is
        part of the reference and one gets the man-page for free.
      </para>

      <sect2 id="commandline-interfaces-file">
        <title>Document the tool</title>

        <para>
          Create one refentry file per tool. Following
          <link linkend="settingup_docfiles">our example</link> we would call it
          <filename>meep/docs/reference/meeper/meep.xml</filename>. For the xml
          tags that should be used and can look at generated file in the xml
          subdirectory as well as examples e.g. in glib.
        </para>
      </sect2>

      <sect2 id="commandline-interfaces-configure">
        <title>Adding the extra configure check</title>

        <para>
          <example><title>Extra configure checks</title>
            <programlisting>
<![CDATA[
AC_ARG_ENABLE(man,
              [AC_HELP_STRING([--enable-man],
                              [regenerate man pages from Docbook [default=no]])],enable_man=yes,
              enable_man=no)

AC_PATH_PROG([XSLTPROC], [xsltproc])
AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno)
]]>
            </programlisting>
          </example>
        </para>
      </sect2>

      <sect2 id="commandline-interfaces-make">
        <title>Adding the extra makefile rules</title>

        <para>
          <example><title>Extra configure checks</title>
            <programlisting>
<![CDATA[
man_MANS = \
       meeper.1

if ENABLE_GTK_DOC
if ENABLE_MAN

%.1 : %.xml
        @XSLTPROC@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<

endif
endif

BUILT_EXTRA_DIST = $(man_MANS)
EXTRA_DIST += meep.xml
]]>
            </programlisting>
          </example>
        </para>
      </sect2>
    </sect1>

    <sect1 id="dbus-interfaces">
      <title>DBus interfaces</title>

      <para>
        (FIXME: http://hal.freedesktop.org/docs/DeviceKit/DeviceKit.html,
http://cgit.freedesktop.org/DeviceKit/DeviceKit/tree/doc/dbus)
      </para>
    </sect1>

  </chapter>

  <chapter id="faq">
    <title>Frequently asked questions</title>

    <segmentedlist>
      <?dbhtml list-presentation="list"?>
      <segtitle>Fråga</segtitle>
      <segtitle>Svar</segtitle>
      <seglistitem>
        <seg>No class hierarchy.</seg>
        <seg>
          The objects <function>xxx_get_type()</function> function has not been
          entered into the <filename>&lt;package&gt;.types</filename> file.
        </seg>
      </seglistitem>
      <seglistitem>
        <seg>Still no class hierarchy.</seg>
        <seg>
          Missing or wrong naming in <filename>&lt;package&gt;-sections.txt</filename>
          file (see <ulink url="http://mail.gnome.org/archives/gtk-doc-list/2003-October/msg00006.html">förklaring</ulink>).
        </seg>
      </seglistitem>
      <seglistitem>
        <seg>Damn, I have still no class hierarchy.</seg>
        <seg>
          Is the object name (name of the instance struct, e.g. <type>GtkWidget</type>)
          part of the normal section (don't put this into Standard or Private
          subsections).
        </seg>
      </seglistitem>
      <seglistitem>
        <seg>No symbol index.</seg>
        <seg>
          Does the <filename>&lt;package&gt;-docs.{xml,sgml}</filename> contain a
          index that xi:includes the generated index?
        </seg>
      </seglistitem>
      <seglistitem>
        <seg>Symbols are not linked to their doc-section.</seg>
        <seg>
          Is the doc-comment using the correct markup (added #,% or ())?
          Check if the gtkdoc-fixxref warns about unresolvable xrefs.
        </seg>
      </seglistitem>
      <seglistitem>
        <seg>A new class does not appear in the docs.</seg>
        <seg>
          Is the new page xi:included from
          <filename>&lt;package&gt;-docs.{xml,sgml}</filename>.
        </seg>
      </seglistitem>
      <seglistitem>
        <seg>A new symbol does not appear in the docs.</seg>
        <seg>
          Is the doc-comment properly formatted. Check for spelling mistakes in
          the begin of the comment. Check if the gtkdoc-fixxref warns about
          unresolvable xrefs. Check if the symbol is correctly listed in the
          <filename>&lt;package&gt;-sections.txt</filename> in a public subsection.
        </seg>
      </seglistitem>
      <seglistitem>
        <seg>A type is missing from the class hierarchy.</seg>
        <seg>
          If the type is listed in <filename>&lt;package&gt;.hierarchy</filename>
          but not in <filename>xml/tree_index.sgml</filename> then double check
          that the type is correctly placed in the <filename>&lt;package&gt;-sections.txt</filename>.
          If the type instance (e.g. <type>GtkWidget</type>) is not listed or
          incidentialy makred private it will not be shown.
        </seg>
      </seglistitem>
      <seglistitem>
        <seg>I get foldoc links for all gobject annotations.</seg>
        <seg>
          Check that <filename>xml/annotation-glossary.xml</filename> is
          xi:included from <filename>&lt;package&gt;-docs.{xml,sgml}</filename>.
        </seg>
      </seglistitem>

      <!-- gtk-doc warnings: -->
      <seglistitem>
        <seg>Parameter described in source code comment block but does not exist</seg>
        <seg>Check if the prototype in the header has different parameter names as in the source.</seg>
      </seglistitem>

      <!-- docbook warnings: -->
      <seglistitem>
        <seg>multiple "IDs" for constraint linkend: XYZ</seg>
        <seg>Symbol XYZ appears twice in <filename>&lt;package&gt;-sections.txt</filename> file.</seg>
      </seglistitem>
      <seglistitem>
        <seg>Element typename in namespace '' encountered in para, but no template matches.</seg>
        <seg/>
      </seglistitem>
    </segmentedlist>
  </chapter>

  <chapter id="contrib">
    <title>Tools related to gtk-doc</title>

    <para>
      GtkDocPlugin - a <ulink url="http://trac-hacks.org/wiki/GtkDocPlugin">Trac GTK-Doc</ulink>
      integration plugin, that adds api docs to a trac site and integrates with
      the trac search.
    </para>
    <para>
      Gtkdoc-depscan - a tool (part of gtk-doc) to check used API against since
      tags in the api to determine the minimum required version.
    </para>

  </chapter>

  <!-- ======== Appendix: FDL ================================== -->
  <!--  
     The GNU Free Documentation License 1.1 in DocBook
     Markup by Eric Baudais <baudais@okstate.edu>
     Maintained by the GNOME Documentation Project
     http://developer.gnome.org/projects/gdp
     Version: 1.0.1
     Last Modified: Nov 16, 2000
-->

<appendix id="fdl">
  <appendixinfo>
    <releaseinfo>Version 1.1, mars 2000</releaseinfo>
    <copyright>
      <year>2000</year><holder>Free Software Foundation, Inc.</holder>
    </copyright>
    <legalnotice id="fdl-legalnotice">
      <para><address>Free Software Foundation, Inc. <street>51 Franklin Street, Suite 330</street>, <city>Boston</city>, <state>MA</state><postcode>02110-1301</postcode><country>USA</country></address>. Var och en äger kopiera och sprida ordagranna kopior av detta licensavtal [originalet och denna översättning], men att ändra det är inte tillåtet.</para>
    </legalnotice>
  </appendixinfo>
  <title>GNU Free Documentation License</title>

  <sect1 id="fdl-preamble">
    <title>0. BAKGRUND</title>
    <para>Syftet med denna licens är att göra en handbok, bok, eller annat praktiskt och användbart dokument <quote>fritt</quote> som i frihet: att försäkra var och en den faktiska friheten att kopiera och sprida det vidare, med eller utan förändringar, antingen kommersiellt eller ideellt. Sekundärt bevarar denna licens ett sätt för författaren och förläggaren att få ära för deras arbete utan att de anses vara ansvariga för förändringar gjorda av andra.</para>
    
    <para>Denna Licens är en sorts <quote>copyleft</quote>, vilket betyder att derivativa verk av detta dokument själva måste vara fria på samma sätt. Den kompletterar GNU General Public License, som är en copyleft-licens utformad för fri programvara.</para>
    
    <para>Vi har utformat denna licens för att den skall användas för handböcker till fri programvara, eftersom fri programvara behöver fri dokumentation: ett fritt program bör ha en handbok som erbjuder samma friheter som programmet gör. Men denna licens är inte begränsad till programvaruhandböcker; den kan användas för vilket textverk som helst oavsett ämne eller huruvida det är en utgiven, tryckt bok. Vi rekommenderar denna licens huvudsakligen för alla verk vars syfte är instruktion eller referens.</para>
  </sect1>
  <sect1 id="fdl-section1">
    <title>TILLÄMPNINGSOMRÅDE OCH DEFINITIONER</title>
    <para id="fdl-document">Denna licens [det engelska originalet] gäller för varje handbok eller annat verk, oavsett uttrycksform, som innehåller ett meddelande där upphovsrättsinnehavaren stadgat att verket kan spridas enligt villkoren i GNU Free Documentation License. Ett sådant meddelande ger en internationell frihet utan krav på ersättning och utan tidsbegränsning att använda verket under villkoren i denna licens [det engelska originalet]. <quote>Dokument</quote> nedan syftar på godtycklig handbok eller verk. Var och en är licenstagare och benämns som <quote>du</quote>.</para>
    
    <para id="fdl-modified">En <quote>förändrad version</quote> av dokumentet avser varje verk som innehåller dokumentet eller en del av det, antingen ordagranna kopior, eller med ändringar och/eller översatt till ett annat språk.</para>
	
    <para id="fdl-secondary">Ett <quote>sekundärt avsnitt</quote> är en märkt bilaga eller förord till <link linkend="fdl-document">dokumentet</link> som exklusivt behandlar förhållandet mellan dokumentets förläggare eller författare och dokumentets huvudsakliga ämne (eller till relaterade ämnen) och som inte innehåller något som direkt faller under det huvudsakliga ämnet. (Således, om dokumentet delvis är en lärobok i matematik så får ett sekundärt avsnitt inte förklara någon matematik.) Förhållandet kan vara en historisk koppling till ämnet eller något relaterat, eller en juridisk, kommersiell, filosofisk, etisk eller politisk ställning till det.</para>

    <para id="fdl-invariant">De <quote>oföränderliga avsnitten</quote> är <link linkend="fdl-secondary">sekundära avsnitt</link> vars titlar är angivna som oföränderliga avsnitt i meddelandet som stadgar att <link linkend="fdl-document">dokumentet</link> är utgivet under denna licens [det engelska originalet].</para>
    
    <para id="fdl-cover-texts"><quote>Omslagstexterna</quote> är speciella korta ordföljder som är listade som framsidestexter eller baksidestexter i meddelandet som stadgar att <link linkend="fdl-document">dokumentet</link> är utgivet under denna licens [det engelska originalet].</para>
	
    <para id="fdl-transparent">En <quote>transparent</quote> kopia av <link linkend="fdl-document">dokumentet</link> är en maskinläsbar kopia, representerad i ett format vars specifikation finns tillgänglig för allmänheten, som lämpar sig för att revidera dokumentet på ett enkelt sätt med generella textredigeringsprogram eller (för pixelbaserade bilder) generella grafikprogram eller (för ritningar) något väl tillgängligt ritprogram, och som är passande som indata till textfomaterare eller för automatisk konvertering till en mängd format som passar som indata till textformaterare. En kopia i ett för övrigt transparent filformat vars markeringar, eller avsaknad av markeringar, har ordnats för att hindra eller motverka att vidare förändring vidtas av läsare är inte transparent. Ett bildformat är inte transparent om det används för någon betydande del text. En kopia som inte är <quote>transparent</quote> kallas <quote>opak</quote>.</para>
    
    <para>Exempel på passande format för transparenta kopior innefattar ren ASCII utan markeringar, Texinfo indataformat, LaTeX indataformat, SGML eller XML som använder en publikt tillgänglig DTD, och standardenlig HTML, PostScript eller PDF utformat för mänsklig förändring. Exempel på transparenta bildformat innefattar PNG, XCF och JPG. Opaka format innefattar leverantörsspecifika format som bara kan läsas och editeras med leverantörsspecifika ordbehandlare, SGML eller XML för vilket DTD och/eller verktyg för behandling inte finns allmänt tillgängliga, och den maskingenererade HTML, PostScript eller PDF som produceras av vissa ordbehandlare enbart avsett som utdata.</para>
    
    <para id="fdl-title-page"><quote>Titelsidan</quote> innebär, för en tryckt bok, titelsidan själv, och sådana därpå följande sidor som krävs för att göra det material som enligt denna licens skall synas på titelsidan läsbart. För verk i sådana format som inte har någon egentlig titelsida, avses med <quote>titelsida</quote> den text som är närmast den mest framstående förekomsten av verkets titel, föregående den huvudsakliga textmassan.</para>
  </sect1>
    
  <sect1 id="fdl-section2">
    <title>2. ORDAGRANN KOPIERING</title>
    <para>Du äger kopiera och sprida <link linkend="fdl-document">dokumentet</link> på valfritt medium, antingen kommersiellt eller ideellt, förutsatt att denna licens [det engelska originalet], upphovsrättsklausul, och meddelandet som stadgar att GNU Free Documentation License gäller för dokumentet finns med på alla kopior, och att du inte lägger till några som helst andra villkor än de som ingår i denna licens. Du äger inte vidta tekniska åtgärder för att begränsa eller kontrollera läsande eller vidare kopiering av de kopior du skapar eller sprider. Dock äger du ta emot kompensation i utbyte mot kopior. Om du sprider tillräckligt många kopior måste du också följa villkoren i <link linkend="fdl-section3">paragraf 3</link>.</para>
    
    <para>Du äger också låna ut kopior, under samma villkor som ovan, och du äger visa kopior offentligt.</para>
    </sect1>
    
  <sect1 id="fdl-section3">
    <title>3. OMFATTANDE KOPIERING</title>
    <para>Om du publicerar tryckta kopior (eller kopior i medier som normalt har tryckta omslag) av <link linkend="fdl-document">dokumentet</link>, i en upplaga överstigande 100 exemplar, och dokumentets licensmeddelande kräver <link linkend="fdl-cover-texts">omslagstexter</link>, så måste du förse kopiorna med omslag som, klart och tydligt, visar alla omslagstexter: framsidestexter på framsidan och baksidestexter på baksidan. Båda omslagen måste klart och tydligt identifiera dig som utgivare av dessa kopior. Framsidan måste presentera dokumentets hela titel, med alla ord i titeln lika framträdande och synliga. Du äger lägga till ytterligare stoff på omslagen. Kopiering med förändringar gjorda bara på omslaget, så länge som de bevarar <link linkend="fdl-document">dokumentets</link> titel och i övrigt uppfyller dessa krav kan anses vara ordagrann kopiering i andra avseenden.</para>
    
    <para>Om de obligatoriska texterna för något omslag är för omfattande för att rymmas i läsbart skick skall du placera de första (så många som får plats) på det egentliga omslaget, och fortsätta med resten på de direkt intilliggande sidorna.</para>
    
    <para>Om du publicerar <link linkend="fdl-transparent">opaka</link> kopior av <link linkend="fdl-document">dokumentet</link> i upplagor om mer än 100, måste du antingen bifoga en maskinläsbar <link linkend="fdl-transparent">transparent</link> kopia med varje opak kopia, eller ange i eller med varje opak kopia en nätverksadress som är tillgänglig för den allmänna nätverksanvändande massan där man, med öppet standardiserade protokoll, kan ladda ner en komplett transparent kopia av dokumentet, utan extra material. Om du väljer det senare alternativet, måste du vidta skäliga åtgärder, när du börjar sprida opaka kopior i kvantitet, för att denna transparenta kopia skall förbli tillgänglig på angivna platsen till åtminstone ett år efter den sista gången du spred en opak kopia (direkt eller via ombud eller återförsäljare) av den utgåvan till allmänheten.</para>
    
    <para>Det är önskvärt, men inte ett krav, att du kontaktar författarna till <link linkend="fdl-document">dokumentet</link> i god tid innan du sprider något större antal kopior, för att ge dem en chans att förse dig med en uppdaterad version av dokumentet.</para>
    </sect1>
    
  <sect1 id="fdl-section4">
    <title>4. FÖRÄNDRINGAR</title>
    <para>Du äger kopiera och sprida en <link linkend="fdl-modified">förändrad version</link> av <link linkend="fdl-document">dokumentet</link> under de villkor som beskrivs i paragraf <link linkend="fdl-section2">2</link> och <link linkend="fdl-section3">3</link> av GNU Free Documentation License, förutsatt att du släpper den förändrade versionen under exakt denna licens, och att den förändrade versionen antar dokumentets roll, och således medger spridning och förändring av den förändrade versionen till envar som erhåller en kopia av den. Utöver detta måste du göra följande med den ändrade versionen:</para>
    
    <itemizedlist mark="opencircle">
      <listitem>
	<formalpara>
	  <title>A</title>
	  <para><link linkend="fdl-title-page">titelsidan</link> (och omslagen om det finns några) använda en titel skild från den som [original]<link linkend="fdl-document">dokumentet</link> har, och skild från tidigare versioners titel (som skall, om det finns några, finnas listade i historikavsnittet i dokumentet). Du äger använda samma titel som det föregående dokumentet om den ursprungliga utgivaren ger sitt tillstånd.</para>
	</formalpara>
      </listitem>
      
      <listitem>
	<formalpara>
	  <title>B</title>
	  <para>Lista på <link linkend="fdl-title-page">titelsidan</link>, som författare, en eller flera personer eller juridiska personer som ansvarat för förändringarna i den <link linkend="fdl-modified">förändrade versionen</link>, tillsammans med minst fem av de huvudsakliga författarna av <link linkend="fdl-document">dokumentet</link> (alla dess huvudsakliga författare, om det har mindre än fem).</para>
	</formalpara>
      </listitem>
      
      <listitem>
	<formalpara>
	  <title>C</title>
	  <para>Ange namnet på utgivaren av den <link linkend="fdl-modified">förändrade versionen</link>, som utgivare, på <link linkend="fdl-title-page">titelsidan</link>.</para>
	</formalpara>
      </listitem>
      
      <listitem>
	<formalpara>
	  <title>D</title>
	  <para>Bibehålla <link linkend="fdl-document">dokumentets</link> alla upphovsrättsklausuler.</para>
	</formalpara>
      </listitem>
      
      <listitem>
	<formalpara>
	  <title>E</title>
	  <para>Lägga till en upphovsrättsklausul för dina förändringar angränsande till de andra upphovsrättsklausulerna.</para>
	</formalpara>
      </listitem>
      
      <listitem>
	<formalpara>
	  <title>F</title>
	  <para>Direkt efter upphovsrättsklausulerna innefatta ett meddelande som ger allmänheten tillstånd att använda den <link linkend="fdl-modified">förändrade versionen</link> under villkoren i denna licens [det engelska originalet] i den form som visas i Tillägg nedan.</para>
	</formalpara>
      </listitem>
      
      <listitem>
	<formalpara>
	  <title>G</title>
	  <para>I meddelandet om licensen bevara den fullständiga listan över <link linkend="fdl-invariant">oföränderliga avsnitt</link> och obligatoriska <link linkend="fdl-cover-texts">omslagstexter</link> som finns i <link linkend="fdl-document">dokumentets</link> meddelande om licensen.</para>
	</formalpara>
      </listitem>
      
      <listitem>
	<formalpara>
	  <title>H</title>
	  <para>Inkludera en oförändrad kopia av denna licens [Det är den engelska originalversionen som avses].</para>
	</formalpara>
      </listitem>
      
      <listitem>
	<formalpara>
	  <title>I</title>
	  <para>Bevara avsnittet med titeln <quote>historik</quote> (History), bevara dess titel och lägg i avsnittet till en post med åtminstone titeln, året, nya författare och utgivaren av den <link linkend="fdl-modified">förändrade versionen</link> så som angivet på <link linkend="fdl-title-page">titelsidan</link>. Om det inte finns något avsnitt med titeln <quote>historik</quote> (History) i <link linkend="fdl-document">dokumentet</link> så skapa en med titeln, året, författare och utgivaren av dokumentet så som det står på [original]dokumentets titelsida. Lägg sedan till en post som beskriver den förändrade versionen så som beskrivits ovan.</para>
	</formalpara>
      </listitem>
      
      <listitem>
	<formalpara>
	  <title>J</title>
	  <para>Bevara den nätverksadress, om det finns någon, angiven i <link linkend="fdl-document">dokumentet</link> till den allmänt tillgängliga <link linkend="fdl-transparent">transparenta</link> kopian av dokumentet, och likaså nätverksadresserna till de föregående versioner som dokumentet baseras på. Dessa får placeras i avsnittet <quote>historik</quote> (History). Du äger utelämna en nätverksadress för ett verk som är publicerat mer än fyra år före dokumentet självt, eller om den ursprunglige utgivaren vars verk nätverksadressen hänvisar till ger sitt tillstånd.</para>
	</formalpara>
      </listitem>
      
      <listitem>
	<formalpara>
	  <title>K</title>
	  <para>För alla avsnitt med titlarna <quote>tillkännagivanden</quote> (Acknowledgements) eller <quote>dedikationer</quote> (Dedications), bevara titeln på avsnittet, och bevara allt innehåll och prägel på alla tillkännagivanden och/eller dedikationer gjorda av varje bidragare.</para>
	</formalpara>
      </listitem>
      
      <listitem>
	<formalpara>
	  <title>L</title>
	  <para>Bevara alla <link linkend="fdl-invariant">oföränderliga avsnitt</link> i <link linkend="fdl-document">dokumentet</link> oförändrade till text och titel. Avsnittsnummer eller motsvarande anses inte tillhöra avsnittets titel.</para>
	</formalpara>
      </listitem>
      
      <listitem>
	<formalpara>
	  <title>M</title>
	  <para>Radera varje avsnitt med titeln <quote>endossering</quote> (Endorsements). Ett sådant avsnitt får inte inkluderas i en <link linkend="fdl-modified">förändrad version</link>.</para>
	</formalpara>
      </listitem>
      
      <listitem>
	<formalpara>
	  <title>N</title>
	  <para>Inte byta titel på något existerande avsnitt så att det blir <quote>endossering</quote> (Endorsements) eller så att titeln kan förväxlas med något <link linkend="fdl-invariant">oföränderligt avsnitt</link>.</para>
	</formalpara>
      </listitem>
    </itemizedlist>
    
    <para>Om den <link linkend="fdl-modified">förändrade versionen</link> innehåller nya framsidestexter eller bilagor som är att anses som <link linkend="fdl-secondary">sekundära avsnitt</link> och inte innehåller något material kopierat från dokumentet, så äger du, om du vill, benämna några eller samtliga av dessa som oföränderliga. För att göra detta, lägg deras titlar till listan över <link linkend="fdl-invariant">oföränderliga avsnitt</link> i den förändrade versionens licensmeddelande. Dessa titlar måste vara skilda från alla andra avsnitts titlar.</para>
    
    <para>Du äger lägga till ett avsnitt med titeln <quote>endossering</quote> (Endorsements), förutsatt att det inte innehåller något annat än endosseringar för din <link linkend="fdl-modified">förändrade version</link> från olika aktörer -- till exempel, meddelanden om utförd korrekturläsning eller att texten har godkänts av en organisation som en officiell definition av en standard.</para>
    
    <para>Du äger lägga till ett textavsnitt på upp till fem ord som <link linkend="fdl-cover-texts">framsidestext</link>, och ett textavsnitt på upp till 25 ord som baksidestext i listan över <link linkend="fdl-cover-texts">omslagstexter</link> i den <link linkend="fdl-modified">förändrade versionen</link>. Bara ett textavsnitt med framsidestexter och ett med baksidestexter får läggas till av (eller genom försorg av) en enda juridisk person. Om <link linkend="fdl-document">dokumentet</link> redan innehåller en omlagstext för något av omslagen, tidigare tillagd av dig eller genom försorg av samma juridiska person som du företräder, äger du inte lägga till en till, men du äger ändra den gamla med tillstånd från den tidigare utgivaren som lade till den förra.</para>
    
    <para>Författaren (författarna) och utgivaren (utgivarna) av <link linkend="fdl-document">dokumentet</link> ger inte via denna licens sitt tillstånd att använda sina namn för publicitet eller för att lägga till eller antyda endossering av någon <link linkend="fdl-modified">förändrad version</link>.</para>
  </sect1>
    
  <sect1 id="fdl-section5">
    <title>5. KOMBINERA DOKUMENT</title>
    <para>Du äger kombinera <link linkend="fdl-document">dokumentet</link> med andra dokument som är utgivna under denna licens, under de villkor som definieras i <link linkend="fdl-section4">paragraf 4</link> av GNU Free Documentation License för förändrade versioner, förutsatt att du, i det kombinerade dokumentet, innefattar alla <link linkend="fdl-invariant">oföränderliga avsnitt</link> från originaldokumenten, omodifierade, och listar dem som oföränderliga avsnitt i ditt kombinerade verk i dess licensklausul, och att du bevarar alla deras garantiavsägelseklausuler.</para>
    
    <para>Det kombinerade verket behöver bara innehålla en enstaka kopia av denna licens [engelska originalversionen], och flera identiska <link linkend="fdl-invariant">oföränderliga stycken</link> kan ersättas med en kopia. Om det finns flera oföränderliga stycken med samma namn men olika innehåll, se till att titeln på varje sådant avsnitt är unik genom att i slutet på den, inom parentes, lägga till namnet på den ursprunglige författaren eller utgivaren av det avsnittet om dessa är kända, annars ett unikt nummer. Gör samma justeringar av titlarna i listan över oföränderliga avsnitt i licensklausulen i det kombinerade verket.</para>
    
    <para>I det kombinerade verket måste du kombinera alla avsnitt med titlarna <quote>historik</quote> (History) i de ursprungliga dokumenten, till ett avsnitt med titeln <quote>historik</quote> (History); på samma sätt skall alla avsnitt med titlarna <quote>tillkännagivanden</quote> (Acknowledgements), alla avsnitt med titlarna <quote>dedikationer</quote> (Dedications) kombineras. Du måste ta bort alla avsnitt med titlarna <quote>endossering</quote> (Endorsements).</para>
    </sect1>
    
  <sect1 id="fdl-section6">
    <title>6. SAMLINGAR AV DOKUMENT</title>
    <para>Du äger skapa en samling bestående av <link linkend="fdl-document">dokumentet</link> och andra dokument som är släppta under GNU Free Documentation License, och ersätta individuella kopior i dokumenten av denna licens med en enda kopia [av den engelska originalversionen] som inkluderas i samlingen, förutsatt att du följer villkoren för ordagrann kopiering i denna licens för varje inkluderat dokument i alla andra avseenden.</para>
    
    <para>Du äger lyfta ut ett dokument från en sådan samling, och sprida det enskilt under GNU Free Documentation License, förutsatt att du lägger till en kopia av denna licens [den engelska originalversionen] i det utlyfta dokumentet, och följer villkoren för ordagrann kopiering i denna licens för det utlyfta dokumentet i alla andra avseenden.</para>
    </sect1>
    
  <sect1 id="fdl-section7">
    <title>7. SAMMANSLAGNING MED OBEROENDE VERK</title>
    <para>En samling av <link linkend="fdl-document">dokumentet</link> eller av dess derivat med andra separata och oberoende dokument eller verk, på eller i en lagringsvolym eller ett spridningsmedium, kallas för en <quote>sammanslagning</quote> om den sammanslagna upphovsrätten inte används för att begränsa samlingens användares rättigheter som de enskilda dokumenten medger. När dokumentet ingår i en sådan sammanslagning, gäller inte denna licens de andra verken i samlingen som inte själva är deriverat av dokumentet. Om kravet på <link linkend="fdl-cover-texts">omslagstexter</link> enligt <link linkend="fdl-section3">paragraf 3</link> är tillämpligt på dessa kopior av dokumentet, så kan dokumentets omslagstexter, om dokumentet utgör mindre än hälften av hela samlingen, placeras på det omslag som omger dokumentet inuti samlingen, eller den elektroniska motsvarigheten till omslag om dokumentet är i elektronisk form. Annars måste de synas på det omslag som omger hela samlingen.</para>
    </sect1>
    
  <sect1 id="fdl-section8">
    <title>8. ÖVERSÄTTNING</title>
    <para>Översättning anses vara en sorts förändring, så du äger sprida översättningar av <link linkend="fdl-document">dokumentet</link> enligt de villkor som sätts i <link linkend="fdl-section4">paragraf 4</link>. <link linkend="fdl-invariant">Oföränderliga avsnitt</link> som ersätts med översättningar kräver tillstånd från deras upphovsrättsinnehavare, men du äger inkludera översättningar av alla eller vissa av dessa oföränderliga avsnitt tillsammans med originalversionerna av dessa oföränderliga avsnitt. Du äger inkludera en översättning av denna licens, och alla licensklausuler i dokumentet, och alla garantiavsägelser, förutsatt att du också innefattar den engelska originalversionen av denna licens och originalversionerna av dessa klausuler. Skulle det finnas skillnader mellan översättningen och originalversionen av denna licens eller någon klausul så gäller originalversionen.</para>
    </sect1>
    
  <sect1 id="fdl-section9">
    <title>9. UPPHÖRANDE</title>
    <para>Du äger inte kopiera, förändra, omlicensiera eller sprida <link linkend="fdl-document">dokumentet</link> annat än enligt villkoren i GNU Free Documentation License. Alla övriga försök att kopiera, modifiera, omlicensiera, eller sprida dokumentet är ogiltiga och kommer automatiskt medföra att du förlorar dina rättigheter enligt denna licens. Tredje man som har mottagit kopior eller rättigheter från dig enligt dessa licensvillkor kommer dock inte att förlora sina rättigheter så länge de följer licensvillkoren.</para>
    </sect1>
    
  <sect1 id="fdl-section10">
    <title>10. FRAMTIDA VERSIONER AV DENNA LICENS</title>
    <para><ulink type="http" url="http://www.gnu.org/fsf/fsf.html">Free Software Foundation</ulink> kan publicera nya, reviderade versioner av GNU Free Documentation License då och då. Sådana nya versioner kommer att vara likadana i andemening som den nuvarande versionen, men kan skilja i detalj för att behandla nya problem eller angelägenheter. Se <ulink type="http" url="http://www.gnu.org/copyleft">http://www.gnu.org/copyleft/</ulink>.</para>
    
    <para>Varje version av licensen ges ett unikt versionsnummer. Om <link linkend="fdl-document">dokumentet</link> stadgar att en specifik numrerad version av denna licens <quote>eller valfri senare version</quote> gäller för det, så äger du rätten att följa villkoren enligt antingen den angivna versionen eller vilken senare version som helst som publicerats (inte som utkast) av Free Software Foundation. Om dokumentet inte anger en version av denna licens, äger du välja vilken version som helst som publicerats (inte som utkast) av Free Software Foundation.</para>
  </sect1>

  <sect1 id="fdl-using">
    <title>TILLÄGG</title>
    <para>För att använda GNU Free Documentation License för ett dokument du har skrivit, inkludera en kopia av licensen [det engelska originalet] i dokumentet och placera följande copyrightklausul omedelbart efter titelsidan:</para>
    
    <blockquote>
      <para>Copyright (c) ÅRTAL DITT NAMN.</para>
      <para>Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the <link linkend="fdl-invariant">Invariant Sections</link> being LIST THEIR TITLES, with the <link linkend="fdl-cover-texts">Front-Cover Texts</link> being LIST, and with the <link linkend="fdl-cover-texts">Back-Cover Texts</link> being LIST. A copy of the license is included in the section entitled <quote>GNU Free Documentation License</quote>.</para>
    </blockquote>
      
    <para>Om du inte har några <link linkend="fdl-invariant">oföränderliga avsnitt</link>, skriv <quote>utan oföränderliga avsnitt</quote> istället för att ange vilka som är oföränderliga. Om du inte har några <link linkend="fdl-cover-texts">framsidestexter</link>, skriv <quote>utan framsidestexter</quote> istället för <quote>framsidestexter som LISTAS</quote>; såväl som för <link linkend="fdl-cover-texts">baksidestexter</link>.</para>
    
    <para>Om ditt dokument innehåller icke-triviala exempel med programkod, så rekommenderar vi att du släpper dessa exempel parallellt under en, av dig vald, fri programvarulicens, som till exempel <ulink type="http" url="http://www.gnu.org/copyleft/gpl.html">GNU General Public License</ulink>, för att möjliggöra deras användning i fri programvara.</para>
  </sect1>
</appendix>  








</book>