This file is indexed.

/usr/include/geis/geis.h is in libgeis-dev 2.2.17-1.1+b1.

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
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
/**
 * @file geis/geis.h
 * This is the public interface for the GEIS gesture API.
 *
 * Copyright 2010-2013 Canonical Ltd.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of version 3 of the GNU Lesser General Public License as published
 * by the Free Software Foundation.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.	 See the GNU Lesser General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 51
 * Franklin St, Fifth Floor, Boston, MA  02110-1301 US
 */
#ifndef GEIS_GEIS_H_
#define GEIS_GEIS_H_

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @defgroup geis_common Common Types and Definitions
 *
 * These types and values are common to both the simplified and advanced GEIS
 * interfaces.
 */

/**
  * @defgroup geis_v1 The Simplified GEIS Interface
  *
  * The simplified GEIS interface is the original (GEIS v1) API.  It provides a
  * way to specify a list of gesture names and input devices for which gestures
  * will be recognized on a given window.
  *
  * See @ref using_geis_v1.
  */

/**
 * @defgroup geis_v2 The Advanced GEIS Interface
 *
 * The advanced GEIS interface (GEIS v2) was developed to give a more nuanced
 * control over the types of gestures and input devices for which gestures will
 * be recognized.
  *
  * See @ref using_geis_v2.
 */

/**
  * GEIS version macros
  *
  * These macros can be tested at compile time to query for support of various
  * features.
  */
#define GEIS_VERSION_1_0  1
#define GEIS_VERSION_2_0  20101122

#include <geis/geisimpl.h>

/**
 * Errors returned from calls.
 * @ingroup geis_common
 *
 * Most GEIS API calls return a status code indicating success or, in the event
 * of a lack of success, the reson for failure.
 */
typedef enum GeisStatus
{
  GEIS_STATUS_SUCCESS       = 0,    /**< normal successful completion */
  GEIS_STATUS_CONTINUE      = 20,   /**< normal successful completion
                                         with data still remaining */
  GEIS_STATUS_EMPTY         = 21,   /**< normal successful completion
                                         with no data retrieved */
  GEIS_STATUS_NOT_SUPPORTED = 10,   /**< a requested feature is not supported */
  GEIS_BAD_ARGUMENT         = 1000, /**< a bad argument value was passed */
  GEIS_UNKNOWN_ERROR        = 9999, /**< any other error condition */
  GEIS_STATUS_BAD_ARGUMENT  = -100, /**< a bad argument value was passed */
  GEIS_STATUS_UNKNOWN_ERROR = -999  /**< any other error condition */
} GeisStatus;

/**
 * Attribute data types.
 * @ingroup geis_common
 */
typedef enum GeisAttrType
{
  GEIS_ATTR_TYPE_UNKNOWN,    /**< Attr is an unknown type. */
  GEIS_ATTR_TYPE_BOOLEAN,    /**< Attr is truth-valued . */
  GEIS_ATTR_TYPE_FLOAT,      /**< Attr is real-valued. */
  GEIS_ATTR_TYPE_INTEGER,    /**< Attr is a counting number. */
  GEIS_ATTR_TYPE_POINTER,    /**< Attr is a pointer to a data structure. */
  GEIS_ATTR_TYPE_STRING      /**< Attr is a null-terminated UTF-8 string. */

} GeisAttrType;

#define GEIS_FALSE 0
#define GEIS_TRUE  1

/* Standard fundamental gestures */
#define GEIS_GESTURE_DRAG    "Drag"
#define GEIS_GESTURE_PINCH   "Pinch"
#define GEIS_GESTURE_ROTATE  "Rotate"
#define GEIS_GESTURE_TAP     "Tap"
#define GEIS_GESTURE_TOUCH   "Touch"

/* Extra higher-level gestures. */
#define GEIS_GESTURE_FLICK   "Flick"

/**
 * @defgroup geis_v1_gesture_types Gesture Types
 * @ingroup geis_v1
 *
 * The names of gesture types.  These names can be passed to 
 * geis_subscribe() in a NULL-terminated list to specify only a subset of
 * available gestures.
 */

/**
 * @defgroup geis_v1_gesture_primitives Gesture Primitives 
 * @ingroup geis_v1_gesture_types
 *
 * These are the prime gesture primitive that describes the general action of
 * the touchpoints at an instant in time.
 *
 * These are the values passed as the @p gesture_type parameter to the 
 * GeisGestureCallback.
 *
 * @{
 *
 * @def GEIS_GESTURE_PRIMITIVE_DRAG
 * A translate gesture:  dragging, swiping, flicking, moving in a generally
 * linear fashion.
 *
 * @def GEIS_GESTURE_PRIMITIVE_PINCH
 * A pinch or expand gesture:  two or more touch points generally moving toward
 * or away from a common point.
 *
 * @def GEIS_GESTURE_PRIMITIVE_ROTATE
 * A rotation gesture.  Two or more points moving relatively along an arc with a
 * commonish centre.
 *
 * @def GEIS_GESTURE_PRIMITIVE_TAP
 * A tap.  Touch down, touch up, one or more touches.
 *
 * @def GEIS_GESTURE_PRIMITIVE_TOUCH
 * A parenthetical gesture event.  Touch down (start) and up (finish).
 */
#define GEIS_GESTURE_PRIMITIVE_DRAG    0
#define GEIS_GESTURE_PRIMITIVE_PINCH   1
#define GEIS_GESTURE_PRIMITIVE_ROTATE  2
#define GEIS_GESTURE_PRIMITIVE_TAP    15 
#define GEIS_GESTURE_PRIMITIVE_TOUCH  32

/* @} */

#define GEIS_GESTURE_ID_FLICK 128

/**
 * @defgroup geis_v1_standar_gesture_types Standard Gesture Types
 * @ingroup geis_v1_gesture_types
 *
 * These gesture types should be available on all GEIS implementations.
 *
 * @{
 */

/* Gesture names for the Simplified Interface */
#define GEIS_GESTURE_TYPE_DRAG1   "Drag,touch=1"
#define GEIS_GESTURE_TYPE_DRAG2   "Drag,touch=2"
#define GEIS_GESTURE_TYPE_DRAG3   "Drag,touch=3"
#define GEIS_GESTURE_TYPE_DRAG4   "Drag,touch=4"
#define GEIS_GESTURE_TYPE_DRAG5   "Drag,touch=5"
#define GEIS_GESTURE_TYPE_PINCH1  "Pinch,touch=1"
#define GEIS_GESTURE_TYPE_PINCH2  "Pinch,touch=2"
#define GEIS_GESTURE_TYPE_PINCH3  "Pinch,touch=3"
#define GEIS_GESTURE_TYPE_PINCH4  "Pinch,touch=4"
#define GEIS_GESTURE_TYPE_PINCH5  "Pinch,touch=5"
#define GEIS_GESTURE_TYPE_ROTATE1 "Rotate,touch=1"
#define GEIS_GESTURE_TYPE_ROTATE2 "Rotate,touch=2"
#define GEIS_GESTURE_TYPE_ROTATE3 "Rotate,touch=3"
#define GEIS_GESTURE_TYPE_ROTATE4 "Rotate,touch=4"
#define GEIS_GESTURE_TYPE_ROTATE5 "Rotate,touch=5"
#define GEIS_GESTURE_TYPE_TAP1    "Tap,touch=1"
#define GEIS_GESTURE_TYPE_TAP2    "Tap,touch=2"
#define GEIS_GESTURE_TYPE_TAP3    "Tap,touch=3"
#define GEIS_GESTURE_TYPE_TAP4    "Tap,touch=4"
#define GEIS_GESTURE_TYPE_TAP5    "Tap,touch=5"
#define GEIS_GESTURE_TYPE_TOUCH1  "Touch,touch=1"
#define GEIS_GESTURE_TYPE_TOUCH2  "Touch,touch=2"
#define GEIS_GESTURE_TYPE_TOUCH3  "Touch,touch=3"
#define GEIS_GESTURE_TYPE_TOUCH4  "Touch,touch=4"
#define GEIS_GESTURE_TYPE_TOUCH5  "Touch,touch=5"

/* @} */

/**
 * @defgroup geis_v1_vendor_extensions Vendor Extension Gesture Types
 * @ingroup geis_v1_gesture_types
 *
 * Vendor-specific extensions to the GEIS v1 API.
 *
 * @{
 */

/**
 * A special gesture type than enabled system-wide gesture priority.
 */
#define GEIS_GESTURE_TYPE_SYSTEM  "Sysflags"

#define GEIS_GESTURE_TYPE_FLICK1  "Flick,touch=1"
#define GEIS_GESTURE_TYPE_FLICK2  "Flick,touch=2"
#define GEIS_GESTURE_TYPE_FLICK3  "Flick,touch=3"
#define GEIS_GESTURE_TYPE_FLICK4  "Flick,touch=4"
#define GEIS_GESTURE_TYPE_FLICK5  "Flick,touch=5"

/* @} */

/**
 * @name Standard fundamental gesture attributes
 *
 * @{
 *
 * @def GEIS_GESTURE_ATTRIBUTE_ANGLE
 * Angle covered by a gesture since it has started, in radians, counterclockwise.
 * Its value ranges from -pi to pi.
 *
 * @def GEIS_GESTURE_ATTRIBUTE_ANGLE_DELTA
 * Angle covered by a gesture since its last update, in radians,
 * counterclockwise.
 *
 * @def GEIS_GESTURE_ATTRIBUTE_CENTROID_X
 * This attribute provides the X coordinate of the centroid of the
 * non-self-intersecting closed polygon defined by the touch points of the
 * gesture, in device coordinates.
 *
 * @def GEIS_GESTURE_ATTRIBUTE_CENTROID_Y
 * This attribute provides the Y coordinate of the centroid of the
 * non-self-intersecting closed polygon defined by the touch points of the
 * gesture, in device coordinates.
 *
 * @def GEIS_GESTURE_ATTRIBUTE_FOCUS_X
 * This attribute provides the X coordinate of the focus point of a gesture,
 * in screen coordinates.
 * For direct devices (GEIS_DEVICE_ATTRIBUTE_DIRECT_TOUCH is GEIS_TRUE) it's
 * the centroid point. For indirect devices it's the pointer/cursor position.
 *
 * @def GEIS_GESTURE_ATTRIBUTE_FOCUS_Y
 * This attribute provides the Y coordinate of the focus point of a gesture,
 * in screen coordinates.
 * For direct devices (GEIS_DEVICE_ATTRIBUTE_DIRECT_TOUCH is GEIS_TRUE) it's
 * the centroid point. For indirect devices it's the pointer/cursor position.
 *
 * @def GEIS_GESTURE_ATTRIBUTE_GESTURE_NAME
 * Name of the gesture.
 * This attribute is filled only when using GEIS v1 API (the simplified
 * interface). On GEIS v2 this attribute has been replaced by the concept of
 * gesture classes. Use geis_frame_is_class() instead.
 *
 * @def GEIS_GESTURE_ATTRIBUTE_POSITION_X
 * This attribute provides the X coordinate of the position of a gesture, in
 * device coordinates. It's the same as the centroid of a gesture. See
 * GEIS_GESTURE_ATTRIBUTE_CENTROID_X.
 *
 * @def GEIS_GESTURE_ATTRIBUTE_POSITION_Y
 * This attribute provides the Y coordinate of the position of a gesture, in
 * device coordinates. It's the same as the centroid of a gesture. See
 * GEIS_GESTURE_ATTRIBUTE_CENTROID_Y.
 *
 * @def GEIS_GESTURE_ATTRIBUTE_TOUCH_0_ID
 * This attribute provides the ID of the touch at index0.
 * Only used by GEIS v1 API.
 *
 * @def GEIS_GESTURE_ATTRIBUTE_TOUCH_0_X
 * This attribute provides the X coordinate of the touch at index0.
 * Only used by GEIS v1 API.
 *
 * @def GEIS_GESTURE_ATTRIBUTE_TOUCH_0_Y
 * This attribute provides the Y coordinate of the touch at index0.
 * Only used by GEIS v1 API.
 *
 * @def GEIS_GESTURE_ATTRIBUTE_TOUCH_1_ID
 * This attribute provides the ID of the touch at index1.
 * Only used by GEIS v1 API.
 *
 * @def GEIS_GESTURE_ATTRIBUTE_TOUCH_1_X
 * This attribute provides the X coordinate of the touch at index1.
 * Only used by GEIS v1 API.
 *
 * @def GEIS_GESTURE_ATTRIBUTE_TOUCH_1_Y
 * This attribute provides the Y coordinate of the touch at index1.
 * Only used by GEIS v1 API.
 *
 * @def GEIS_GESTURE_ATTRIBUTE_TOUCH_2_ID
 * This attribute provides the ID of the touch at index2.
 * Only used by GEIS v1 API.
 *
 * @def GEIS_GESTURE_ATTRIBUTE_TOUCH_2_X
 * This attribute provides the X coordinate of the touch at index2.
 * Only used by GEIS v1 API.
 *
 * @def GEIS_GESTURE_ATTRIBUTE_TOUCH_2_Y
 * This attribute provides the Y coordinate of the touch at index2.
 * Only used by GEIS v1 API.
 *
 * @def GEIS_GESTURE_ATTRIBUTE_TOUCH_3_ID
 * This attribute provides the ID of the touch at index3.
 * Only used by GEIS v1 API.
 *
 * @def GEIS_GESTURE_ATTRIBUTE_TOUCH_3_X
 * This attribute provides the X coordinate of the touch at index3.
 * Only used by GEIS v1 API.
 *
 * @def GEIS_GESTURE_ATTRIBUTE_TOUCH_3_Y
 * This attribute provides the Y coordinate of the touch at index3.
 * Only used by GEIS v1 API.
 *
 * @def GEIS_GESTURE_ATTRIBUTE_TOUCH_4_ID
 * This attribute provides the ID of the touch at index4.
 * Only used by GEIS v1 API.
 *
 * @def GEIS_GESTURE_ATTRIBUTE_TOUCH_4_X
 * This attribute provides the X coordinate of the touch at index4.
 * Only used by GEIS v1 API.
 *
 * @def GEIS_GESTURE_ATTRIBUTE_TOUCH_4_Y
 * This attribute provides the Y coordinate of the touch at index4.
 * Only used by GEIS v1 API.
 */
#define GEIS_GESTURE_ATTRIBUTE_ANGLE            "angle"
#define GEIS_GESTURE_ATTRIBUTE_ANGLE_DELTA      "angle delta"
#define GEIS_GESTURE_ATTRIBUTE_ANGULAR_VELOCITY "angular velocity"
#define GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_X1   "boundingbox x1"
#define GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_Y1   "boundingbox y1"
#define GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_X2   "boundingbox x2"
#define GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_Y2   "boundingbox y2"
#define GEIS_GESTURE_ATTRIBUTE_CHILD_WINDOW_ID  "child window id"
#define GEIS_GESTURE_ATTRIBUTE_CENTROID_X       "centroid x"
#define GEIS_GESTURE_ATTRIBUTE_CENTROID_Y       "centroid y"
#define GEIS_GESTURE_ATTRIBUTE_DELTA_X          "delta x"
#define GEIS_GESTURE_ATTRIBUTE_DELTA_Y          "delta y"
#define GEIS_GESTURE_ATTRIBUTE_DEVICE_ID        "device id"
#define GEIS_GESTURE_ATTRIBUTE_EVENT_WINDOW_ID  "event window id"
#define GEIS_GESTURE_ATTRIBUTE_FOCUS_X          "focus x"
#define GEIS_GESTURE_ATTRIBUTE_FOCUS_Y          "focus y"
#define GEIS_GESTURE_ATTRIBUTE_GESTURE_NAME     "gesture name"
#define GEIS_GESTURE_ATTRIBUTE_POSITION_X       "position x"
#define GEIS_GESTURE_ATTRIBUTE_POSITION_Y       "position y"
#define GEIS_GESTURE_ATTRIBUTE_RADIAL_VELOCITY  "radial velocity"
#define GEIS_GESTURE_ATTRIBUTE_RADIUS_DELTA     "radius delta"
#define GEIS_GESTURE_ATTRIBUTE_RADIUS           "radius"
#define GEIS_GESTURE_ATTRIBUTE_ROOT_WINDOW_ID   "root window id"
#define GEIS_GESTURE_ATTRIBUTE_TAP_TIME         "tap time"
#define GEIS_GESTURE_ATTRIBUTE_TIMESTAMP        "timestamp"
#define GEIS_GESTURE_ATTRIBUTE_TOUCHES          "touches"
#define GEIS_GESTURE_ATTRIBUTE_VELOCITY_X       "velocity x"
#define GEIS_GESTURE_ATTRIBUTE_VELOCITY_Y       "velocity y"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_0_ID       "touch 0 id"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_0_X        "touch 0 x"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_0_Y        "touch 0 y"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_1_ID       "touch 1 id"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_1_X        "touch 1 x"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_1_Y        "touch 1 y"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_2_ID       "touch 2 id"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_2_X        "touch 2 x"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_2_Y        "touch 2 y"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_3_ID       "touch 3 id"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_3_X        "touch 3 x"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_3_Y        "touch 3 y"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_4_ID       "touch 4 id"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_4_X        "touch 4 x"
#define GEIS_GESTURE_ATTRIBUTE_TOUCH_4_Y        "touch 4 y"
/* @} */

/**
 * @defgroup geis_meta Initialization and Cleanup
 * @ingroup geis_v1
 *
 * Each instance of a gesture subscription must be created using the geis_init()
 * call and destroyed using the geis_finish() call.
 *
 * A particular subscription instance is associated with a display region.  The
 * nature of the display region depends on the underlying display technology.
 * For example, an X11 window or even a subregion of an X11 window could be an
 * associated display region when geis is layered over X11 technology.
 *
 * The nature of the display desciption information depends on the actual
 * underlyinggeis implementation and is documented separately.  The
 * implementation-specific description must be passed to geis_init using a 
 * GeisWinInfo structure.
 *
 * @{
 */

/**
 * @class GeisInstance
 * A geis gesture subscription instance.
 */
/** @cond typedef */
typedef struct _GeisInstance *GeisInstance;
/** @endcond */

/**
 * @class GeisWinInfo
 * Generic display region description block
 */
typedef struct GeisWinInfo
{
  uint32_t win_type;    /**< Selects the implementation-specific window type. */
  void    *win_info;    /**< Additional info dependent on the window type. */
} GeisWinInfo;

/**
 * Initializes a geis subscription instance for a display region.
 * @memberof GeisInstance
 *
 * @param[in]  win_info         a display region description block
 *                              -- see geis implementtaion documentation
 * @param[out] geis_instance    an opaque pointer to a geis gesture subscription
 *                              instance
 *
 * @retval GEIS_BAD_ARGUMENT    an invalid GeisWinInfo was passed
 * @retval GEIS_STATUS_SUCCESS  normal successful completion
 */
GEIS_API GeisStatus geis_init(GeisWinInfo *win_info, GeisInstance *geis_instance);

/**
 * Cleans up a geis subscription instance for a display region.
 * @memberof GeisInstance
 *
 * @param[in] geis_instance     an opaque pointer to a geis gesture subscription
 *                              instance
 *
 * @retval GEIS_BAD_ARGUMENT    an invalid GeisInstance was passed
 * @retval GEIS_STATUS_SUCCESS  normal successful completion
 */
GEIS_API GeisStatus geis_finish(GeisInstance  geis_instance);

/* @} */

/**
 * @defgroup geis_v1_config Configuration and Control
 * @ingroup geis_v1
 * @{
 */

/**
 * Gets the Unix file descriptor for GEIS events.
 *
 * Applications or toolkits can use this file descriptor to intgerate geis event
 * handling into their main event dispatch loop.  When a GEIS event is available
 * for processing, the fd will have a read-available state indicated in
 * select(), poll(), epoll(), etc.
 */
#define GEIS_CONFIG_UNIX_FD 10001

/**
 * Indicates if a particular feaure is supported.
 *
 * @param[in] geis_instance      An opaque pointer to a geis gesture subscription
 *                               instance.
 * @param[in] configuration_item Indicates which configuration item will be
 *                               checked for support.
 *
 * @retval GEIS_BAD_ARGUMENT    an invalid argument value was passed
 * @retval GEIS_STATUS_SUCCESS  normal successful completion
 */
GEIS_API GeisStatus geis_configuration_supported(GeisInstance geis_instance,
                                                 int          configuration_item);

/**
 * Gets a feature configuration value.
 *
 * @param[in] geis_instance      An opaque pointer to a geis gesture subscription
 *                               instance.
 * @param[in] configuration_item Indicates which configuration item will be
 *                               get.
 * @param[in] value              A pointer to where the retrieved value will be
 *                               stored.
 *
 * @retval GEIS_BAD_ARGUMENT    an invalid argument value was passed
 * @retval GEIS_STATUS_SUCCESS  normal successful completion
 */
GEIS_API GeisStatus geis_configuration_get_value(GeisInstance geis_instance, 
                                                 int          configuration_item,
                                                 void         *value);

/**
 * Sets a feature configuration value.
 *
 * @param[in] geis_instance      An opaque pointer to a geis gesture subscription
 *                               instance.
 * @param[in] configuration_item Indicates which configuration item will be
 *                               set.
 * @param[in] value              A pointer to where the value to be set will be
 *                               read.
 *
 * @retval GEIS_BAD_ARGUMENT    an invalid argument value was passed
 * @retval GEIS_STATUS_SUCCESS  normal successful completion
 */
GEIS_API GeisStatus geis_configuration_set_value(GeisInstance geis_instance,
                                                 int          configuration_item, 
                                                 void         *value);

/**
 * Dispatches geis events until there are no further events available.
 *
 * @param[in] geis_instance     an opaque pointer to a geis gesture subscription
 *                              instance
 *
 * This function is used to integrate geis even dispatch into the main event
 * loop of an application or toolkit.
 *
 * @retval GEIS_BAD_ARGUMENT    an invalid GeisInstance was passed
 * @retval GEIS_STATUS_SUCCESS  normal successful completion
 */
GEIS_API GeisStatus geis_event_dispatch(GeisInstance geis_instance);

/* @} */

/**
 * @defgroup geis_v2_geis The Geis API Object
 * @ingroup geis_v2
 *
 * @{
 */

/**
 * @class Geis
 * Represents an instance of the gesture recognition engine
 */
/** @cond typedef */
typedef struct _Geis *Geis;
/** @endcond */

/**
 * @name Standard Initialization Arguments
 *
 * @par
 * These initialization arguments are defined by the GEIS v2 specification.
 *
 * @{
 *
 * @def GEIS_INIT_SERVICE_PROVIDER
 * Enables GEIS to provide a networked service.
 * This initialization argument takes no parameters.
 *
 * @def GEIS_INIT_TRACK_DEVICES
 * Tells GEIS to send input device events.
 * This initialization argument takes no parameters.
 *
 * @def GEIS_INIT_TRACK_GESTURE_CLASSES
 * Tells GEIS to send gesture class events.
 * This initialization argument takes no parameters.
 *
 * @def GEIS_INIT_SYNCHRONOUS_START
 * Performs all setup synchronously: geis_new() will block until all setup has
 * completed successfully or unsuccessfully.
 */

#define GEIS_INIT_SERVICE_PROVIDER     "org.libgeis.init.server"
#define GEIS_INIT_TRACK_DEVICES        "org.libgeis.init.track-devices"
#define GEIS_INIT_TRACK_GESTURE_CLASSES  "org.libgeis.init.track-gesture-classes"
#define GEIS_INIT_SYNCHRONOUS_START      "org.libgeis.init.synchronous-start"

/* @} */

/**
 * @name Vendor-defined Initialization Arguments
 *
 * @par
 * These initialization arguments are not a part of the GEIS specification and
 * may change.
 *
 * @{
 *
 * @def GEIS_INIT_DBUS_BACKEND
 * Uses the DBus back end (default).
 *
 * @def GEIS_INIT_GRAIL_BACKEND
 * Uses the native grail back end (fallback).
 *
 * @def GEIS_INIT_XCB_BACKEND
 * Uses the grail-embedded-in-X11 back end.
 *
 * @def GEIS_INIT_NO_ATOMIC_GESTURES
 * Disables the use of (GEIS v1-style) atomic gestures:  only a single gesture
 * is recognized at a time.
 *
 * @def GEIS_INIT_SEND_TENTATIVE_EVENTS
 * Causes tentative events to be sent.  Tentative events indicate gestures may
 * possibly be detected soon and allow early rejection if the events occur
 * outside any area of interest.
 *
 * @def GEIS_INIT_SEND_SYNCHRONOS_EVENTS
 * Causes all gesture events to be sent, even if there is zero apparent time
 * difference between the events.  Normally all but the first consecutive event
 * are discarded, since velocity values can not be calculated and multiple
 * events between frame redraws are unlikely do have any value beyong consuming
 * CPU.  Setting this init value will give the events to you if you really want
 * them.
 */

#define GEIS_INIT_DBUS_BACKEND           "com.canonical.oif.backend.dbus"
#define GEIS_INIT_GRAIL_BACKEND          "com.canonical.oif.backend.grail"
#define GEIS_INIT_XCB_BACKEND            "com.canonical.oif.backend.xcb"
#define GEIS_INIT_NO_ATOMIC_GESTURES     "com.canonical.oif.no-atomic.gestures"
#define GEIS_INIT_SEND_TENTATIVE_EVENTS  "com.canonical.oif.events.tentative"
#define GEIS_INIT_SEND_SYNCHRONOS_EVENTS "com.canonical.oif.events.synchronous"
/* @} */


/**
 * Initializes an instance of the GEIS v2.0 API.
 * @ingroup geis_v2_geis
 * @memberof Geis
 *
 * @param[in]  init_arg_name  The name of an initializaer argument.
 * @param[in]  ...            The remaining initializaer arguments.
 *
 * A NULL-terminated list of zero or more initialization arguments is passed to
 * this function to create and initialize a connection to a gesture recognition
 * engine.
 *
 * If no initialization arguments are passed, the parameter list consists of a
 * single NULL argument.
 */
GEIS_API GEIS_VARARG Geis geis_new(GeisString init_arg_name, ...);

/**
 * Cleans up an instance of the GEIS v2.0 API.
 * @ingroup geis_v2_geis
 * @memberof Geis
 *
 * @param[in] geis  An instance of the GEIS v2.0 API.
 *
 * Tears down the instance of the API and releases any resources associated with
 * that instance.
 */
GEIS_API GeisStatus geis_delete(Geis geis);

/* @} */

/**
 * @defgroup geis_v2_error Error Reporting
 * @ingroup geis_v2
 * @{
 */

/**
 * Gets the number of status codes in the error stack.
 *
 * @param[in] geis A GEIS API instance or NULL for the global stack
 *
 * This function is used primarily to determine the failure details of a GEIS
 * function that does not explicitly return a GeisStatus value.  This is
 * required for _new() fucntions that return NULL to indicate failure.  If the
 * call to geis_new() itself fails and returns a NULL, the global error stack
 * must be used, otherwise the API instance error stack must be used.
 *
 * The error stack is reset on each GEIS API call, so failure reasons should be
 * determined immmediately after a GEIS API call.
 */
GEIS_API GeisSize geis_error_count(Geis geis);

/**
 * Gets the indicated status code from the error stack.
 *
 * @param[in] geis  A GEIS API instance or NULL for the global stack
 * @param[in] index Indicates the status value to retrieve.  Valid status values
 *                  are between 0 and less than the value returned from
 *                  geis_error_count() otherwise GEIS_STATUS_BAD_ARGUMENT will
 *                  be returned.
 */
GEIS_API GeisStatus geis_error_code(Geis geis, GeisSize index);

/**
 * Gets the localized error message, if any, associated with the indicated
 * error.
 *
 * @param[in] geis  A GEIS API instance or NULL for the global stack
 * @param[in] index Indicates the status value to retrieve.  Valid status values
 *                  are between 0 and less than the value returned from
 *                  geis_error_count() otherwise GEIS_STATUS_BAD_ARGUMENT will
 *                  be returned.
 */
GEIS_API GeisString geis_error_message(Geis geis, GeisSize index);

/* @} */

/**
 * @defgroup geis_v2_config Configuration
 * @ingroup geis_v2
 * @{
 */

/**
 * @name Required Configuration Items
 *
 * @par
 * These configuration items are defined by the GEIS specification.
 *
 * @{
 *
 * @def GEIS_CONFIGURATION_FD
 * Gets a Unix file descriptor that will signal the availablility of GEIS events
 * for processing.
 */

#define GEIS_CONFIGURATION_FD "org.libgeis.configuration.fd"

/* @} */

/**
 * @name Vendor-defined Configuration Items
 *
 * @par
 * These configuration items are not a part of the GEIS specification and may
 * change.
 *
 * @{
 *
 * @def GEIS_CONFIG_MAX_EVENTS
 */

#define GEIS_CONFIG_MAX_EVENTS  "com.canonical.oif.max_events"

/**
 * @def GEIS_CONFIG_ATOMIC_GESTURES
 * Indicates if atomic gestures are in use.  Value type GeisBoolean.
 */
#define GEIS_CONFIG_ATOMIC_GESTURES "com.canonical.use.atomic.gestures"

/**
 * @def GEIS_CONFIG_SEND_TENTATIVE_EVENTS
 * See GEIS_INIT_SEND_TENTATIVE_EVENTS
 */
#define GEIS_CONFIG_SEND_TENTATIVE_EVENTS  "com.canonical.oif.events.tentative"

/**
 * @def GEIS_CONFIG_SEND_SYNCHRONOS_EVENTS
 * See GEIS_INIT_SEND_SYNCHRONOS_EVENTS
 */
#define GEIS_CONFIG_SEND_SYNCHRONOS_EVENTS "com.canonical.oif.events.synchronous"

/**
 * @def GEIS_CONFIG_DRAG_THRESHOLD
 * Movement threshold for recognizing a DRAG gesture (in meters).  Value type
 * GeisFloat.
 */
#define GEIS_CONFIG_DRAG_THRESHOLD "com.canonical.oif.drag.threshold"

/**
 * @def GEIS_CONFIG_DRAG_TIMEOUT
 * Timeout for recognizing a DRAG gesture (in milliseconds).  Value type
 * GeisInteger.
 */
#define GEIS_CONFIG_DRAG_TIMEOUT "com.canonical.oif.drag.timeout"

/**
 * @def GEIS_CONFIG_PINCH_THRESHOLD
 * Movement threshold for recognizing a PINCH gesture (in meters).  Value type
 * GeisFloat.
 */
#define GEIS_CONFIG_PINCH_THRESHOLD "com.canonical.oif.pinch.threshold"

/**
 * @def GEIS_CONFIG_PINCH_TIMEOUT
 * Timeout for recognizing a PINCH gesture (in milliseconds).  Value type
 * GeisInteger.
 */
#define GEIS_CONFIG_PINCH_TIMEOUT "com.canonical.oif.pinch.timeout"

/**
 * @def GEIS_CONFIG_ROTATE_THRESHOLD
 * Movement threshold for recognizing a ROTATE gesture (in meters).  Value type
 * GeisFloat.
 */
#define GEIS_CONFIG_ROTATE_THRESHOLD "com.canonical.oif.rotate.threshold"

/**
 * @def GEIS_CONFIG_ROTATE_TIMEOUT
 * Timeout for recognizing a ROTATE gesture (in milliseconds).  Value type
 * GeisInteger.
 */
#define GEIS_CONFIG_ROTATE_TIMEOUT "com.canonical.oif.rotate.timeout"

/**
 * @def GEIS_CONFIG_TAP_THRESHOLD
 * Movement threshold for recognizing a TAP gesture (in meters).  Value type
 * GeisFloat.
 */
#define GEIS_CONFIG_TAP_THRESHOLD "com.canonical.oif.tap.threshold"

/**
 * @def GEIS_CONFIG_TAP_TIMEOUT
 * Timeout for recognizing a TAP gesture (in milliseconds).  Value type
 * GeisInteger.
 */
#define GEIS_CONFIG_TAP_TIMEOUT "com.canonical.oif.tap.timeout"

/**
 * @def GEIS_CONFIG_NUM_ACTIVE_SUBSCRIPTIONS
 * The number of subscriptions currently active in the back end.
 * This config is query-only and intended for unit test validations.
 */
#define GEIS_CONFIG_NUM_ACTIVE_SUBSCRIPTIONS "com.canonical.oif.debug.active_subs"

/* @} */

/**
 * Gets a feature configuration value.
 *
 * @param[in]  geis                     An opaque GEIS API object.
 * @param[in]  configuration_item_name  Selects the configuration value to return.
 * @param[out] configuration_item_value Points to a buffer to contain the output
 *                                      value.  The actual type of this buffer
 *                                      depends on the
 *                                      @p configuration_value_name.
 *
 * @retval GEIS_STATUS_BAD_ARGUMENT   an invalid argument value was passed
 * @retval GEIS_STATUS_NOT_SUPPORTED  the configuration value is not supported
 * @retval GEIS_STATUS_SUCCESS        normal successful completion
 */
GEIS_API GeisStatus geis_get_configuration(Geis        geis, 
                                           GeisString  configuration_item_name,
                                           void       *configuration_item_value);

/**
 * Sets a feature configuration value.
 *
 * @param[in] geis                     An opaque GEIS API object.
 * @param[in] configuration_item_name  Selects the configuration value to return.
 * @param[in] configuration_item_value Points to a buffer to contain the output
 *                                     configuration value.  The actual type of
 *                                     this buffer depends on the
 *                                     @p configuration_value_name.
 *
 * @retval GEIS_STATUS_BAD_ARGUMENT   an invalid argument value was passed
 * @retval GEIS_STATUS_NOT_SUPPORTED  the configuration value is not supported
 * @retval GEIS_STATUS_SUCCESS        normal successful completion
 */
GEIS_API GeisStatus geis_set_configuration(Geis        geis,
                                           GeisString  configuration_item_name, 
                                           void       *configuration_item_value);

/* @} */

/**
 * @defgroup geis_v1_input Input Devices
 * @ingroup geis_v1
 * @{
 */

typedef unsigned int GeisInputDeviceId;

#define GEIS_ALL_INPUT_DEVICES ((GeisInputDeviceId*)0)

/**
 * Prototype for input device callback functions.
 */
typedef void (*GeisInputCallback)(void             *cookie,
                                  GeisInputDeviceId device_id,
                                  void             *attrs);

/**
 * Callback functions used to handle changes in the available input devices.
 */
typedef struct GeisInputFuncs
{
  GeisInputCallback  added;   /**< Receives new input device notices */
  GeisInputCallback  changed; /**< Receives modified input device notices */
  GeisInputCallback  removed; /**< Receives removes input device notices */

} GeisInputFuncs;


/**
 * Registers a callback to receive information on input devices.
 *
 * @param[in] geis_instance   points to a geis gesture subscription
 *                            instance
 * @param[in] func            points to a GeisInputFuncs table
 * @param[in] cookie          an application specific value to be passed to
 *                            the callback
 *
 * The callback is called for each gesture-capable input device available for
 * the display region associated with the geis subscription instance.  Over
 * time, as gesture-capable input devices appear and disappear or change their
 * abilities or configuration, the callback may be called again.
 *
 * @retval GEIS_BAD_ARGUMENT    an invalid argument value was passed
 * @retval GEIS_STATUS_SUCCESS  normal successful completion
 */
GEIS_API GeisStatus geis_input_devices(GeisInstance    geis_instance,
                                       GeisInputFuncs *func,
                                       void           *cookie);

/* @} */

/**
 * @defgroup geis_v1_subscription Gesture Subscription
 * @ingroup geis_v1
 * @{
 */
typedef unsigned int GeisGestureType;
typedef unsigned int GeisGestureId;

/** Selects ALL input devices. */
#define GEIS_ALL_GESTURES ((GeisGestureType)0)

#define GEIS_NO_GESTURE_ID ((GeisGestureId)0)

/**
 * An individual gesture attribute.
 *
 * Gesture events are associated with a list of attributes, each of which is a
 * (name, type, value) tuple.  These attribute reveal a little piece of
 * information about a gesture.
 */
typedef struct GeisGestureAttr
{
  /** The name of the gesture attribute. */
  GeisString name;
  /** The data type of the gesture attribute. */
  GeisAttrType type;
  /** The value of the attributes. */
  __extension__ union
  {
    GeisBoolean boolean_val;
    GeisFloat   float_val;
    GeisInteger integer_val;
    GeisString  string_val;
  };
} GeisGestureAttr;

/**
 * A callback used for different gesture events.
 *
 * @param[in] cookie         an application-specific value to be passed to the
 *                           callback.
 * @param[in] gesture_type   a gesture type
 * @param[in] gesture_id     a unique gesture identifier
 * @param[in] attrs          parameters
 */
typedef void (*GeisGestureCallback)(void             *cookie,
                                    GeisGestureType   gesture_type,
                                    GeisGestureId     gesture_id,
                                    GeisSize          attr_count,
                                    GeisGestureAttr  *attrs);

/**
 * The set of callback functions invoked for various gesture-related events.
 *
 * An application must define callback functions to handle the various gesture
 * events.  These callbacks are provided in a table passed to geis_subscribe for
 * each window on which gesture events may occur.
 */
typedef struct GeisGestureFuncs
{
  /** Invoked when a new gesture type has been defined. */
  GeisGestureCallback  added;
  /** Invoked when a defined gesture type is no longer available. */
  GeisGestureCallback  removed;
  /** Invoked when a new gesture starts. */
  GeisGestureCallback  start;
  /** Invoked when a gesture has changed values. */
  GeisGestureCallback  update;
  /** Invoked when a gesture finishes. */
  GeisGestureCallback  finish;
} GeisGestureFuncs;


/**
 * Registers a callback to receive gesture events.
 *
 * @param[in] geis_instance     an opaque pointer to a geis gesture subscription
 *                              instance
 * @param[in] input_list        a null-terminated list of input device IDs
 * @param[in] gesture_list      a null-terminated list of C-style strings naming
 *                              gestures for subscription
 * @param[in] funcs             a pointer to a GeisGestureFuncs structure
 * @param[in] cookie            an application specific value to be passed to
 *                              the callback
 *
 * @retval GEIS_BAD_ARGUMENT    an invalid argument value was passed
 * @retval GEIS_STATUS_SUCCESS  normal successful completion
 */
GEIS_API GeisStatus geis_subscribe(GeisInstance         geis_instance,
                                   GeisInputDeviceId   *input_list,
                                   const char*         *gesture_list,
                                   GeisGestureFuncs    *funcs,
                                   void                *cookie);

/**
 * Unsubscribes to one or more gestures.
 *
 * @param[in] geis_instance     an opaque pointer to a geis gesture subscription
 *                              instance
 * @param[in] gesture_list      a null-terminated list of gesture types
 */
GEIS_API GeisStatus geis_unsubscribe(GeisInstance     geis_instance,
                                     GeisGestureType *gesture_list);

/* @} */

/**
 * @defgroup geis_v2_attrs Attributes
 * @ingroup geis_v2
 *
 * Attributes are named values associated with various GEIS entities, including
 * input devices, gesture types, and gesture events.
 *
 * @{
 */

/**
 * An opaque type that encapsulates a GEIS attribute.
 *
 * GeisAttr objects may not be created or destroyed by the application, they may
 * only have their data examined or extracted.
 */
/** @cond typedef */
typedef struct _GeisAttr *GeisAttr;
/** @endcond */

/**
 * Gets the name of an attribute.
 *
 * @param[in] attr  Identifies the attribute.
 */
GEIS_API GeisString geis_attr_name(GeisAttr attr);

/**
 * Gets the type of an attribute value.
 *
 * @param[in] attr  Identifies the attribute.
 */
GEIS_API GeisAttrType geis_attr_type(GeisAttr attr);

/**
 * Gets the value of an attribute as a GeisBoolean.
 *
 * @param[in] attr  Identifies the attribute.
 */
GEIS_API GeisBoolean geis_attr_value_to_boolean(GeisAttr attr);

/**
 * Gets the value of an attribute as a GeisFloat.
 *
 * @param[in] attr  Identifies the attribute.
 */
GEIS_API GeisFloat geis_attr_value_to_float(GeisAttr attr);

/**
 * Gets the value of an attribute as a GeisInteger.
 *
 * @param[in] attr  Identifies the attribute.
 */
GEIS_API GeisInteger geis_attr_value_to_integer(GeisAttr attr);

/**
 * Gets the value of an attribute as a GeisPointer.
 *
 * @param[in] attr  Identifies the attribute.
 */
GEIS_API GeisPointer geis_attr_value_to_pointer(GeisAttr attr);

/**
 * Gets the value of an attribute as a GeisString.
 *
 * @param[in] attr  Identifies the attribute.
 */
GEIS_API GeisString geis_attr_value_to_string(GeisAttr attr);

/* @} */

/**
 * @defgroup geis_v2_event_control Event Control
 * @ingroup geis_v2
 *
 * These functions are used to dispatch events generated from the various other
 * GEIS components.
 *
 * Applications must invoke geis_dispatch_events() from time to time to generate
 * input device, gesture type, and gesture events.  The GEIS events are then
 * retrieved either from the internal event queue using the geis_next_event()
 * call or through an application-supplied callback set through the
 * geis_register_event_callback() call.
 *
 * @{
 */

typedef enum _GeisEventType
{ 
  GEIS_EVENT_DEVICE_AVAILABLE         = 1000,
  GEIS_EVENT_DEVICE_UNAVAILABLE       = 1010,
  GEIS_EVENT_CLASS_AVAILABLE          = 2000,
  GEIS_EVENT_CLASS_CHANGED            = 2005,
  GEIS_EVENT_CLASS_UNAVAILABLE        = 2010,
  GEIS_EVENT_GESTURE_BEGIN            = 3000,
  GEIS_EVENT_GESTURE_UPDATE           = 3010,
  GEIS_EVENT_GESTURE_END              = 3020,
  GEIS_EVENT_TENTATIVE_BEGIN          = 3500,
  GEIS_EVENT_TENTATIVE_UPDATE         = 3510,
  GEIS_EVENT_TENTATIVE_END            = 3520,
  GEIS_EVENT_INIT_COMPLETE            = 4000,
  GEIS_EVENT_USER_DEFINED             = 6000,
  GEIS_EVENT_ERROR                    = 7000
} GeisEventType;

/**
 * @class GeisEvent
 * A generic GEIS event.
 *
 * Applications must determine the type of the actual event and convert the
 * opaque pointer to a concrete event pointer, if required.
 *
 * Events are created by the GEIS API but must be destroyed by the application.
 */
/** @cond typedef */
typedef struct _GeisEvent *GeisEvent;
/** @endcond */

/**
 * Destroys a GeisEvent.
 * @memberof GeisEvent
 *
 * @param[in] event The GeisEvent to destroy.
 */
GEIS_API void geis_event_delete(GeisEvent event);

/**
 * Gets the type of the event.
 * @memberof GeisEvent
 *
 * @param[in] event The GeisEvent to destroy.
 */
GEIS_API GeisEventType geis_event_type(GeisEvent event);

/**
 * Gets the number of attributes in the event.
 * @memberof GeisEvent
 *
 * @param[in] event The GeisEvent.
 */
GEIS_API GeisSize geis_event_attr_count(GeisEvent event);

/**
 * Gets an indicated attribute from the event.
 * @memberof GeisEvent
 *
 * @param[in] event  The GeisEvent.
 * @param[in] index  Indicates the attribute to retrieve.
 */
GEIS_API GeisAttr geis_event_attr(GeisEvent event, GeisSize index);

/**
 * Gets a named attribute from the event.
 * @memberof GeisEvent
 *
 * @param[in] event     The GeisEvent.
 * @param[in] attr_name The name of the attribute to retrieve.
 */
GEIS_API GeisAttr geis_event_attr_by_name(GeisEvent event, GeisString attr_name);

/**
 * The application callback type for the event dispatcher.
 *
 * @param[in] geis    the GEIS API instance
 * @param[in] event   the opaque event pointer
 * @param[in] context the application-supplied context value
 */
typedef void (*GeisEventCallback)(Geis geis, GeisEvent event, void *context);

/**
 * A special constant indicating the use of the default event callback.
 */
#define GEIS_DEFAULT_EVENT_CALLBACK ((GeisEventCallback)0)

/**
 * Registers an event-handler callback.
 *
 * @param[in] geis           the GEIS API instance
 * @param[in] event_callback the callback to register
 * @param[in] context        the caller context
 *
 * This function registers the callback to be executed whenever a new GeisEvent
 * is generated.  The default function pushes the GeisEvent onto an internal
 * queue to be picked up by a call to geis_next_event().
 *
 * Calling geis_register_event_callback() with a callback of
 * GEIS_DEFAULT_EVENT_CALLBACK replaces any registered function wit hthe default
 * function.
 *
 * The callback is executed in the same thread context as the one
 * geis_dispatch_events() is called from.
 */
GEIS_API void geis_register_event_callback(Geis               geis,
                                           GeisEventCallback  event_callback,
                                           void              *context);

/**
 * Pumps the GEIS event loop.
 *
 * @param[in]  geis  The GEIS API instance.
 *
 * Processes input events until there are no more input events to process and
 * generates zero or more gesture events, reporting them via the user-supplied
 * callback or pushing them on the internal event queue for retrieval via the
 * geis_next_event() call.
 *
 * @retval GEIS_STATUS_SUCCESS       The event loop was successfully pumped and
 *                                   no further events remain to be processed at
 *                                   this time.
 *
 * @retval GEIS_STATUS_CONTINUE      The event loop was successfully pumped but
 *                                   the system detected there are events
 *                                   still remaining to be processed.
 *
 * @retval GEIS_STATUS_UNKNOWN_ERROR Some error occurred
 */
GEIS_API GeisStatus geis_dispatch_events(Geis geis);

/**
 * Retrieves the next queued GEIS event.
 *
 * @param[in]  geis  The GEIS API instance.
 * @param[out] event The GeisEvent retrieved, if any.
 *
 * Pulls the next available GeisEvent from the internal event queue, if any, and
 * indicates whether there are more events left.
 *
 * @retval GEIS_STATUS_SUCCESS       An event was successfully pulled from the
 *                                   queue and the queue is now empty.
 *
 * @retval GEIS_STATUS_CONTINUE      An event was successfully pulled from the
 *                                   queue and one or more events remain in the
 *                                   queue.
 *
 * @retval GEIS_STATUS_EMPTY         No event was pulled from the queue because
 *                                   it is empty.  The value of *event remains
 *                                   unchanged.
 *
 * @retval GEIS_STATUS_UNKNOWN_ERROR Some error occurred
 */
GEIS_API GeisStatus geis_next_event(Geis geis, GeisEvent *event);

/* @} */

/**
 * @defgroup geis_v2_device Input Devices
 * @ingroup geis_v2
 * @{
 */

/**
 * @name Device Event Attributes
 * @{
 *
 * @def GEIS_EVENT_ATTRIBUTE_DEVICE
 * The event attribute containing a pointer to a GeisDevice.
 *
 * The GEIS_EVENT_DEVICE_AVAILABLE and GEIS_EVENT_DEVICE_UNAVAILABLE events
 * should have a GEIS_ATTR_TYPE_POINTER attribute with this name.  It
 * should contain a pointer to a GeisDevice describing the device made available
 * or unavailable.
 */
#define GEIS_EVENT_ATTRIBUTE_DEVICE             "device"

/* @} */

/**
 * @name Device Attributes
 * @{
 *
 * @def GEIS_DEVICE_ATTRIBUTE_NAME
 * The name of the input device.  Not guaranteed unique.
 *
 * The attribute value is of type GeisString.
 *
 * @def GEIS_DEVICE_ATTRIBUTE_ID
 * The unique integer ID of the device.  Guaranteed unique within a Geis
 * instance.
 *
 * The attribute values is of type GeisInteger.
 *
 * @def GEIS_DEVICE_ATTRIBUTE_TOUCHES
 * The maximum number of touches a device is capable of reporting.
 * This integer is the number if simultaneous touches the device claims to be
 * able to detect if it is a multi-touch device.  A value of zero indicates the
 * maximum number of touches can not be determined.
 *
 * The attribute value is of type GeisInteger.
 *
 * @def GEIS_DEVICE_ATTRIBUTE_DIRECT_TOUCH
 * Indicates the device is a direct touch device.
 * The present of this boolean attribute with a value of GEIS_TRUE indicates the
 * device is a direct touch multi-touch device (for example, a touchscreen),
 * otherwise it is an indirect touch device (such as a touchpad) or not a touch
 * device at all.
 *
 * The attribute value is of type GeisBoolean.
 *
 * @def GEIS_DEVICE_ATTRIBUTE_INDEPENDENT_TOUCH
 * Indicates the device is an independent touch device.
 * The presence of this boolean attribute with a value of GEIS_TRUE indicates
 * the device is an independent touch device (for example, an Apple MagicMouse).
 * Other multi-touch devices should report GEIS_FALSE.
 *
 * The attribute value is of type GeisBoolean.
 *
 * @def GEIS_DEVICE_ATTRIBUTE_MIN_X
 * The lower bound of the X-axis (nominally horizontal) coordinate values
 * reported by the device.
 *
 * The attribute values is of type GeisFloat.
 *
 * @def GEIS_DEVICE_ATTRIBUTE_MAX_X
 * The upper bound of the X-axis (nominally horizontal) coordinate values
 * reported by the device.
 *
 * The attribute values is of type GeisFloat.
 *
 * @def GEIS_DEVICE_ATTRIBUTE_RES_X
 * The resolution of the X-axis (nominally horizontal) coordinate values
 * reported by the device.
 *
 * The attribute values is of type GeisFloat.
 *
 * @def GEIS_DEVICE_ATTRIBUTE_MIN_Y
 * The lower bound of the Y-axis (nominally vertical) coordinate values
 * reported by the device.
 *
 * The attribute values is of type GeisFloat.
 *
 * @def GEIS_DEVICE_ATTRIBUTE_MAX_Y
 * The upper bound of the Y-axis (nominally vertical) coordinate values
 * reported by the device.
 *
 * The attribute values is of type GeisFloat.
 *
 * @def GEIS_DEVICE_ATTRIBUTE_RES_Y
 * The resolution of the Y-axis (nominally vertical) coordinate values
 * reported by the device.
 *
 * The attribute values is of type GeisFloat.
 */
#define GEIS_DEVICE_ATTRIBUTE_NAME              "device name"
#define GEIS_DEVICE_ATTRIBUTE_ID                "device id"
#define GEIS_DEVICE_ATTRIBUTE_TOUCHES           "device touches"
#define GEIS_DEVICE_ATTRIBUTE_DIRECT_TOUCH      "direct touch"
#define GEIS_DEVICE_ATTRIBUTE_INDEPENDENT_TOUCH "independent touch"
#define GEIS_DEVICE_ATTRIBUTE_MIN_X             "device X minimum"
#define GEIS_DEVICE_ATTRIBUTE_MAX_X             "device X maximum"
#define GEIS_DEVICE_ATTRIBUTE_RES_X             "device X resolution"
#define GEIS_DEVICE_ATTRIBUTE_MIN_Y             "device Y minimum"
#define GEIS_DEVICE_ATTRIBUTE_MAX_Y             "device Y maximum"
#define GEIS_DEVICE_ATTRIBUTE_RES_Y             "device Y resolution"

/* @} */

/**
 * @class GeisDevice
 * A gesture-capable input device.
 *
 * GeisDevice objects are created by the GEIS API and are reference counted.
 */
/** @cond typedef */
typedef struct _GeisDevice *GeisDevice;
/** @endcond */

GEIS_API void geis_register_device_callback(Geis               geis,
                                            GeisEventCallback  event_callback,
                                            void              *context);

/**
 * Gets a cached device description for an identified device.
 *
 * @param[in]  geis      The GEIS API instance.
 * @param[in]  device_id Identifies the device.
 *
 * The GEIS instance caches a list of gesture-capable input devices that have
 * been reported.  The GeisDevice description for an identified device may be
 * retrieved from that cache with this call.
 *
 * @returns a valid GeisDevice for the identified device, or NULL if no such
 * device is in the cache.
 */
GEIS_API GeisDevice geis_get_device(Geis geis, GeisInteger device_id);

/**
 * Adds a reference count to a device.
 * @memberof GeisDevice
 *
 * @param[in] device The device.
 *
 * An application that wishes to guarantee the device object remains valid
 * should add a reference using this call, and unref when the object is no
 * longer needed.
 *
 * @returns @p device for syntactic convenience.
 */
GEIS_API GeisDevice geis_device_ref(GeisDevice device);

/**
 * Removes a reference count from a device.
 * @memberof GeisDevice
 *
 * @param[in] device The device.
 *
 * This function decrements the number of references to the device and, if the
 * number of references hits zero, deletes the device.
 */
GEIS_API void geis_device_unref(GeisDevice device);

/**
 * Gets the name of the input device.
 * @memberof GeisDevice
 *
 * @param[in] device The device.
 */
GEIS_API GeisString geis_device_name(GeisDevice device);

/**
 * Gets the system identifier of the iput device.
 * @memberof GeisDevice
 *
 * @param[in] device The device.
 *
 * The system-defined device identifier is system- and possibly
 * device-dependent.
 */
GEIS_API GeisInteger geis_device_id(GeisDevice device);

/**
 * Gets the number of attributes of the device.
 * @memberof GeisDevice
 *
 * @param[in] device The device.
 */
GEIS_API GeisSize geis_device_attr_count(GeisDevice device);

/**
 * Gets the indicated attribute of the device.
 * @memberof GeisDevice
 *
 * @param[in] device The device.
 * @param[in] index  Indicates which attr to retrieve.
 */
GEIS_API GeisAttr geis_device_attr(GeisDevice device, GeisSize index);

/**
 * Gets a named attribute from the device.
 * @memberof GeisDevice
 *
 * @param[in] device    The device.
 * @param[in] attr_name The name of the attribute to retrieve.
 */
GEIS_API GeisAttr geis_device_attr_by_name(GeisDevice device, GeisString attr_name);

/* @} */

/**
 * @defgroup geis_v2_class Gesture Classes
 * @ingroup geis_v2
 * @{
 */

/**
 * @class GeisGestureClass
 * A defined gesture classifier.
 *
 * GeisGestureClass objects are created by the GEIS API and are reference
 * counted.  An application needs to increment and decrement the reference
 * count of a gesture class object to control its persistence.
 */
/** @cond typedef */
typedef struct _GeisGestureClass *GeisGestureClass;
/** @endcond */

/**
 * @name Gesture Class Event Attributes
 * @{
 *
 * @def GEIS_EVENT_ATTRIBUTE_CLASS
 * The event attribute containing a pointer to a GeisGestureClass. 
 *
 * The GEIS_EVENT_CLASS_AVAILABLE and GEIS_EVENT_CLASS_UNAVAILABLE events
 * should have a GEIS_ATTR_TYPE_POINTER attribute with this name.  It
 * should contain a pointer to a GeisGestureClass describing the gesture class
 * made available or unavailable.
 */
#define GEIS_EVENT_ATTRIBUTE_CLASS  "gesture class"

/* @} */

/**
 * @name Gesture Class Attributes
 * @{
 *
 * @def GEIS_CLASS_ATTRIBUTE_NAME
 * The name of the gesture class. 
 *
 * @def GEIS_CLASS_ATTRIBUTE_ID
 * The unique integer ID of the gesture class.
 */
#define GEIS_CLASS_ATTRIBUTE_NAME   "class name"
#define GEIS_CLASS_ATTRIBUTE_ID     "class id"

/* @} */

/**
 * Registers a callback to receive gesture class change notifications.
 *
 * @param[in] geis            The API instance.
 * @param[in] event_callback  The callback function.
 * @param[in] context         Contextual data to be passed through to the
 *                            callback.
 *
 * This function is used to register a function to be executed when a change to
 * the available gesture class definitions has occurred.  If no function is
 * registered, the default action is to deliver gesture class events through the
 * main event mechanism.
 *
 * Passing a value of GEIS_DEFAULT_EVENT_CALLBACK as the @p event-callback will
 * reset the callback function to the default action.
 *
 * The @p event_callback function will be executed in the same thread context as
 * geis_dispatch_events().
 */
GEIS_API void geis_register_class_callback(Geis               geis,
                                           GeisEventCallback  event_callback,
                                           void              *context);

/**
 * Increments the reference count of a gesture class object.
 * @memberof GeisGestureClass
 *
 * @param[in] gesture_class  The gesture class object.
 */
GEIS_API void geis_gesture_class_ref(GeisGestureClass gesture_class);

/**
 * Decrements the reference count of a gesture class object.
 * @memberof GeisGestureClass
 *
 * @param[in] gesture_class  The gesture class object.
 *
 * The reference count of the object is decremented and, if it reaches zero, the
 * object is destroyed.
 */
GEIS_API void geis_gesture_class_unref(GeisGestureClass gesture_class);

/**
 * Gets the name of the gesture class.
 * @memberof GeisGestureClass
 *
 * @param[in] gesture_class  The gesture class object.
 */
GEIS_API GeisString geis_gesture_class_name(GeisGestureClass gesture_class);

/**
 * Gets the numeric identifier of the gesture class.
 * @memberof GeisGestureClass
 *
 * @param[in] gesture_class  The gesture class object.
 */
GEIS_API GeisInteger geis_gesture_class_id(GeisGestureClass gesture_class);

/**
 * Gets the number of attributes of the gesture class.
 * @memberof GeisGestureClass
 *
 * @param[in] gesture_class  The gesture class object.
 */
GEIS_API GeisSize geis_gesture_class_attr_count(GeisGestureClass gesture_class);

/**
 * Gets the indicated attribute of the gesture class.
 * @memberof GeisGestureClass
 *
 * @param[in] gesture_class  The gesture class object.
 * @param[in] index          The index of the attribute to retrieve.
 */
GEIS_API GeisAttr geis_gesture_class_attr(GeisGestureClass gesture_class,
                                          int              index);

/* @} */

/**
 * @defgroup geis_v2_region Gesture Regions
 * @ingroup geis_v2
 * @{
 */

/**
 * @class GeisRegion
 * Defines a region over which gestures may take place.
 */
/** @cond typedef */
typedef struct _GeisRegion *GeisRegion;
/** @endcond */

/**
 * @name Region Attributes
 *
 * @par
 * These attributes can be used to construct filter terms to restrict a
 * gesture subscription to a particular region.
 *
 * @{
 *
 * @def GEIS_REGION_ATTRIBUTE_WINDOWID
 * The X11 windowid in which a gesture occurred. Used for filter matching.
 */
#define GEIS_REGION_ATTRIBUTE_WINDOWID          "windowid"

/* @} */

/**
 * @name Region Initialization Arguments
 *
 * @par
 * Gesture regions are created to describe a particular display/feedback region.
 * The type of the region can not be changed after creation (just create a new
 * region for that).  The types of regions are platform specific and each type
 * may require addition arguments.
 *
 * @par
 * The following region initialization argument names are required by the
 * GEIS v2.0 specification.
 *
 * @{
 *
 * @def GEIS_REGION_X11_ROOT
 * Selects the X11 root window as a region.
 *
 * @def GEIS_REGION_X11_WINDOWID
 * Selects an X11 window as a region.
 * Requires the window_id as an argument.
 */
#define GEIS_REGION_X11_ROOT       "org.libgeis.region.x11.root"

#define GEIS_REGION_X11_WINDOWID   "org.libgeis.region.x11.windowid"

/* @} */

/**
 * Creates a new GEIS v2.0 region.
 * @memberof GeisRegion
 *
 * @param[in] geis           The GEIS API instance.
 * @param[in] name           A name.  Used for diagnostics.
 * @param[in] init_arg_name  The name of the first initialization argument.
 *
 * The initialization argument list must be terminated by a NULL.
 *
 * @returns a newly created region, or NULL on failure.
 */
GEIS_API GEIS_VARARG GeisRegion geis_region_new(Geis       geis,
                                                GeisString name,
                                                GeisString init_arg_name, ...);

/**
 * Destroys a GEIS v2.0 region.
 * @memberof GeisRegion
 *
 * @param[in] region  The region.
 */
GEIS_API GeisStatus geis_region_delete(GeisRegion region);

/**
 * Gets the name of a GEIS v2.0 region.
 * @memberof GeisRegion
 *
 * @param[in] region  The region.
 *
 * Returns the @p name value used when creating the region.
 */
GEIS_API GeisString geis_region_name(GeisRegion region);

/* @} */

/**
 * @defgroup geis_v2_filter Gesture Filter
 * @ingroup geis_v2
 * @{
 */

/**
 * @class GeisFilter
 * Selects a subset of possible gestures in a subscription.
 *
 * A GeisFilter is a collection of filter terms, each of which defines a
 * criterion for selection of gestures returned on a subscription.
 *
 * All filter terms are effectively ANDed together in a filter.
 **/
/** @cond typedef */
typedef struct _GeisFilter *GeisFilter;
/** @endcond */

/**
 * Indicates the type of filter.
 */
typedef enum _GeisFilterFacility
{
  GEIS_FILTER_DEVICE   = 1000,  /**< Filters on device attributes. */
  GEIS_FILTER_CLASS    = 2000,  /**< Filters on gesture class and gesture attributes. */
  GEIS_FILTER_REGION   = 3000,  /**< Filters on region attributes. */
  GEIS_FILTER_SPECIAL  = 5000   /**< Filters on special attributes. */
} GeisFilterFacility;

/**
 * Indicates the type of filter operation.
 */
typedef enum _GeisFilterOperation
{
  GEIS_FILTER_OP_EQ,      /**< Compares for equality. */
  GEIS_FILTER_OP_NE,      /**< Compares for inequality */
  GEIS_FILTER_OP_GT,      /**< Compares for greater-than. */
  GEIS_FILTER_OP_GE,      /**< Compares for greater-than-or-equal. */
  GEIS_FILTER_OP_LT,      /**< Compares for less-than. */
  GEIS_FILTER_OP_LE       /**< Compares for less-tha-or-equal. */
} GeisFilterOperation;


/**
 * Creates a new, empty filter.
 * @memberof GeisFilter
 *
 * @param[in] geis  The GEIS API instance.
 * @param[in] name  A name.
 *
 * @returns a GeisFilter object or NULL on failure.
 */
GEIS_API GeisFilter geis_filter_new(Geis geis, GeisString name);

/**
 * Creates a new filter by copying an existing filter.
 * @memberof GeisFilter
 *
 * @param[in] original  An existing geisFilter instance.
 * @param[in] name      A name.
 *
 * The original filter remains unchanged.
 *
 * @returns a GeisFilter object or NULL on failure.
 */
GEIS_API GeisFilter geis_filter_clone(GeisFilter original, GeisString name);

/**
 * Destroys a GeisFilter.
 * @memberof GeisFilter
 *
 * @param[in] filter  The filter.
 */
GEIS_API GeisStatus geis_filter_delete(GeisFilter filter);

/**
 * Gets the name given to the filter when it was created.
 * @memberof GeisFilter
 *
 * @param[in] filter  The filter.
 */
GEIS_API GeisString geis_filter_name(GeisFilter filter);

/**
 * Adds a term to a filter.
 * @memberof GeisFilter
 *
 * @param[in] filter   The filter.
 * @param[in] facility The term facility.
 * @param[in] ...      A list of zero or more term descriptions.
 *
 * A term description is generally a (attr-name, filter-op, value) triple in
 * which the meaning of the filter-op and value depend on the type of the attr.
 *
 * The term description list must be terminated by a NULL.
 *
 * In the following example we add terms to filter drag gestures made with three
 * touch points:
 * @code
 * geis_filter_add_term(filter,
 *   GEIS_FILTER_CLASS,
 *   GEIS_CLASS_ATTRIBUTE_NAME, GEIS_FILTER_OP_EQ, GEIS_GESTURE_DRAG,
 *   GEIS_GESTURE_ATTRIBUTE_TOUCHES, GEIS_FILTER_OP_EQ, 3,
 *   NULL);
 * @endcode
 *
 * Term descriptions are usually ANDed together, so that specifying a class name
 * and a number of touches will filter only for gestures that have both
 * characteristics. But if you specify several class names (e.g. drag and pinch),
 * those classes are ORed together instead. So you can receive events from a
 * gesture that belongs to either drag, drag&pinch or only pinch classes.
 * 
 */
GEIS_API GEIS_VARARG GeisStatus geis_filter_add_term(GeisFilter         filter,
                                                     GeisFilterFacility facility,
                                                     ...);

/* @} */

/**
 * @defgroup geis_v2_subscription Gesture Subscription
 * @ingroup geis_v2
 * @{
 */

/**
 * @class GeisSubscription
 * A gesture recognition subscription.
 */
/** @cond typedef */
typedef struct _GeisSubscription *GeisSubscription;
/** @endcond */

/**
 * @enum GeisSubscriptionFlags
 *
 * These flags are used when creating a new subscription and affect the nature
 * of the gestures recognized by the subscription.  They may ORed together.
 *
 * @var GeisSubscriptionFlags::GEIS_SUBSCRIPTION_NONE
 * No special subscription processing:  this is the default.
 *
 * @var GeisSubscriptionFlags::GEIS_SUBSCRIPTION_GRAB
 * The subscription will "grab" all filtered gestures from subwindows.
 *
 * @var GeisSubscriptionFlags::GEIS_SUBSCRIPTION_CONT
 * The gesture engine will return <em>gesture continuations</em>, in which the
 * class of a recognized gestire may change over the lifetime of the gesture.
 * If this flag is not set, a new gesture will be identified for each change in
 * gesture class.
 */
enum
{
  GEIS_SUBSCRIPTION_NONE = 0x0000,
  GEIS_SUBSCRIPTION_GRAB = 0x0001,
  GEIS_SUBSCRIPTION_CONT = 0x0002
};
typedef int GeisSubscriptionFlags;

/**
 * Creates a new subscription.
 * @memberof GeisSubscription
 *
 * @param[in] geis  The GEIS API instance.
 * @param[in] name  A name.
 * @param[in] flags Some flags.
 *
 * @returns a GeisSubscription object or NULL on failure.
 *
 * A gesture subscription is required for any gesture events to be delivered
 * from the GEIS API.
 */
GEIS_API GeisSubscription geis_subscription_new(Geis                  geis,
                                                GeisString            name,
                                                GeisSubscriptionFlags flags);

/**
 * Destroys a GEIS v2.0 subscription object.
 * @memberof GeisSubscription
 *
 * @param[in] subscription  The subscription.
 */
GEIS_API GeisStatus geis_subscription_delete(GeisSubscription subscription);

/**
 * Activates a subscription.
 * @memberof GeisSubscription
 *
 * @param[in] subscription  The subscription.
 *
 * Puts the subscription into the active state.  Gesture events will be
 * delivered for this subscription.
 */
GEIS_API GeisStatus geis_subscription_activate(GeisSubscription subscription);

/**
 * Deactivates a subscription.
 * @memberof GeisSubscription
 *
 * @param[in] subscription  The subscription.
 *
 * Puts the subscription into the inactive state.  Gesture events will not be
 * delivered for this subscription.
 */
GEIS_API GeisStatus geis_subscription_deactivate(GeisSubscription subscription);

/**
 * Gets the name given to a subscription when it was created.
 * @memberof GeisSubscription
 *
 * @param[in] subscription  The subscription.
 */
GEIS_API GeisString geis_subscription_name(GeisSubscription subscription);

/**
 * Gets the ID assigned to a subscription when it was created.
 * @memberof GeisSubscription
 *
 * @param[in] subscription  The subscription.
 */
GEIS_API GeisInteger geis_subscription_id(GeisSubscription subscription);

/**
 * Adds a filter to a subscription.
 * @memberof GeisSubscription
 *
 * @param[in] subscription  The subscription.
 * @param[in] filter        The filter to be added to the subscription.
 *
 * The effect of filters are ORed together so that, for example, a
 * subscription that has a filter for 3-finger drag gestures and another for
 * 2-finger pinch gestures will produce events for both 3-finger drag gestures
 * and 2-finger pinch gestures.
 *
 * The default is no filters:  that is, all possible gesture events will be
 * reported.
 *
 * The subscription will take ownership of the filter.
 */
GEIS_API GeisStatus geis_subscription_add_filter(GeisSubscription subscription,
                                                 GeisFilter       filter);

/**
 * Gets an named filter from a subscription.
 * @memberof GeisSubscription
 *
 * @param[in] sub  The subscription.
 * @param[in] name Names the filter to retrieve.
 *
 * Returns the first filter with the given name or NULL if no such named filter
 * is found.
 */
GEIS_API GeisFilter geis_subscription_filter_by_name(GeisSubscription sub,
                                                     GeisString       name);

/**
 * Removes a filter from a subscription.
 * @memberof GeisSubscription
 *
 * @param[in] subscription  The subscription.
 * @param[in] filter        The filter to be removed from the subscription.
 *
 * Ownership of the filter is passed to the caller.
 */
GEIS_API GeisStatus geis_subscription_remove_filter(GeisSubscription subscription,
                                                    GeisFilter       filter);


/**
 * Gets a subscription-level configuration item.
 *
 * @param[in]  subscription      The subscription from which the configuration
 *                               item will be retrieved.
 * @param[in]  config_item_name  The name of the configuration item.
 * @param[out] config_item_value A pointer to an appropriate variable to hold
 *                               the retrieved config item value.
 *
 * Not all back ends support all configuration items.
 *
 * @retval GEIS_STATUS_BAD_ARGUMENT   an invalid argument value was passed
 * @retval GEIS_STATUS_NOT_SUPPORTED  the configuration value is not supported
 * @retval GEIS_STATUS_SUCCESS        normal successful completion
 */
GEIS_API GeisStatus geis_subscription_get_configuration(GeisSubscription subscription,
                                                        GeisString       config_item_name,
                                                        GeisPointer      config_item_value);

/**
 * Sets a subscription-level configuration item.
 *
 * @param[in] subscription      The subscription from which the configuration
 *                              item will be retrieved.
 * @param[in] config_item_name  The name of the configuration item.
 * @param[in] config_item_value A pointer to an appropriate variable holding
 *                              the config item value.
 *
 * Not all back ends support all configuration items.
 *
 * @retval GEIS_STATUS_BAD_ARGUMENT   an invalid argument value was passed
 * @retval GEIS_STATUS_NOT_SUPPORTED  the configuration value is not supported
 * @retval GEIS_STATUS_SUCCESS        normal successful completion
 */
GEIS_API GeisStatus geis_subscription_set_configuration(GeisSubscription subscription,
                                                        GeisString       config_item_name,
                                                        GeisPointer      config_item_value);

/* @} */

/**
 * @defgroup geis_v2_gesture Gesture Frames
 * @ingroup geis_v2
 * Gesture state information.
 *
 * Gesture frames, and their associated groups and touches, convey information
 * about the current state of recognized gestures.
 *
 * @{
 */

/**
 * @class GeisGroup
 * A collection of gesture frames.
 *
 * @class GeisGroupSet
 * A collection of GeisGroups.
 *
 * @class GeisTouch
 * An instance of a touch.
 *
 * @class GeisTouchId
 * Relates a touch in a frame to a touch object in a set.
 *
 * @class GeisTouchSet
 * A collection of GeisTouch
 *
 * @class GeisFrame
 * A collection of information describing the state of a gesture.
 */
/** @cond typedef */
typedef struct _GeisGroup    *GeisGroup;
typedef struct _GeisGroupSet *GeisGroupSet;
typedef GeisSize              GeisTouchId;
typedef struct _GeisTouch    *GeisTouch;
typedef struct _GeisTouchSet *GeisTouchSet;
typedef struct _GeisFrame    *GeisFrame;
/** @endcond */

/**
 * @name Gesture Frame Event Attributes
 *
 * @par
 * A gesture event (GEIS_EVENT_GESTURE_BEGIN, GEIS_EVENT_GESTURE_UPDATE,
 * GEIS_EVENT_GESTURE_END) should have two GEIS_ATTR_TYPE_POINTER attributes,
 * one containing a GeisGroupSet and one containing a GeisTouchSet.
 *
 * For example: If four fingers are being simultaneously moved over a touchpad
 * or touchscreen surface, Geis could start generating gesture events
 * containing two groups: One group having a single frame from a four-fingers
 * gesture of some class and a second group having two frames, each from a
 * different two-fingers gesture (like one from a Rotate and the other from a
 * Pinch gesture).
 * This means that geis could interpret the movements of those four touch points as
 * both a single four-fingers gesture and as two separate two-fingers gestures.
 *
 * There can be only a single frame per gesture in a gesture event. I.e. no two
 * frames will return the same GeisGestureId in the same gesture event.
 *
 * @{
 *
 * @def GEIS_EVENT_ATTRIBUTE_GROUPSET
 * The event attribute containing a pointer to a GeisGroupSet.
 *
 * @def GEIS_EVENT_ATTRIBUTE_TOUCHSET
 * The event attribute containing a pointer to a GeisTouchSet.
 *
 * @def GEIS_EVENT_ATTRIBUTE_CONSTRUCTION_FINISHED
 * Event attribute containing a boolean.
 * This property allows the client to determine if all the possible gestures
 * from the set of touches in this event have already been presented. When
 * this value is true, the client will have received all the information needed
 * to make a gesture accept and reject decision based on potentially
 * overlapping gestures. An example is when both one and two touch gestures are
 * subscribed on the same window with the same gesture classes and thresholds.
 * When this property is true for one touch gesture events, the client can be
 * sure there are no other touches unless a two touch gesture event has already
 * been sent.
 * Another example is when you subscribe for three touches Touch and four
 * touches Drag. As soon as a third finger is detected a three touches Touch
 * gesture will begin, but you cannot be sure a fourth finger isn't coming
 * right after (that can eventually cause a four touches Drag) until this
 * property is true.
 */
#define GEIS_EVENT_ATTRIBUTE_GROUPSET  "group set"
#define GEIS_EVENT_ATTRIBUTE_TOUCHSET  "touch set"
#define GEIS_EVENT_ATTRIBUTE_CONSTRUCTION_FINISHED  "construction finished"

/* @} */

/**
 * @name Touch Attributes
 *
 * @par
 * Each touch has zero or more attributes associated with it. Differing hardware
 * is capable of reporting differing sets of touch attributes, so there is no
 * guarantee that any or all of the defined touch attributes will bre present.
 *
 * If the touch comes from a direct device (see
 * GEIS_DEVICE_ATTRIBUTE_DIRECT_TOUCH) its position (x and y attributes) will
 * be in window coordinates, otherwise it will be in the input device's own
 * coordinate system.
 *
 * @{
 *
 * @def GEIS_TOUCH_ATTRIBUTE_ID
 * Identifies the touch. 
 *
 * @def GEIS_TOUCH_ATTRIBUTE_X
 * The X coordinate of the touch.
 *
 * @def GEIS_TOUCH_ATTRIBUTE_Y
 * The Y coordinate of the touch.
 */
#define GEIS_TOUCH_ATTRIBUTE_ID                 "touch id"
#define GEIS_TOUCH_ATTRIBUTE_X                  "touch x"
#define GEIS_TOUCH_ATTRIBUTE_Y                  "touch y"

/* @} */

/**
 * Gets the number of gesture groups in a groupset.
 * @memberof GeisGroupSet
 *
 * @param[in] groupset The groupset.
 */
GEIS_API GeisSize geis_groupset_group_count(GeisGroupSet groupset);

/**
 * Gets an indicated gesture group from a groupset.
 * @memberof GeisGroupSet
 *
 * @param[in] groupset The groupset.
 * @param[in] index    Indicates which gesture group to retrieve.
 */
GEIS_API GeisGroup geis_groupset_group(GeisGroupSet groupset, GeisSize index);

/**
 * Gets the identifier of a gesture group.
 * @memberof GeisGroup
 *
 * @param[in] group The gesture group.
 */
GEIS_API GeisInteger geis_group_id(GeisGroup group);

/**
 * Gets the number of gesture frames in a gesture group.
 * @memberof GeisGroup
 *
 * @param[in] group The gesture group.
 */
GEIS_API GeisSize geis_group_frame_count(GeisGroup group);

/**
 * Gets an indicated gesture frame from a gesture group.
 * @memberof GeisGroup
 *
 * @param[in] group The gesture group.
 * @param[in] index Indicates which gesture frame to retrieve.
 */
GEIS_API GeisFrame geis_group_frame(GeisGroup group, GeisSize index);

/**
 * Marks a gesture group as rejected.
 * @memberof GeisGroup
 *
 * @param[in] group The gesture group to reject.
 */
GEIS_API void geis_group_reject(GeisGroup group);

/**
 * Gets the number of touches in a touchset.
 * @memberof GeisTouchSet
 *
 * @param[in] touchset  The touchset,
 */
GEIS_API GeisSize geis_touchset_touch_count(GeisTouchSet touchset);

/**
 * Gets an indicated touch from a touchset.
 * @memberof GeisTouchSet
 *
 * @param[in] touchset  The touchset.
 * @param[in] index     Indicates which touch to retrieve.
 */
GEIS_API GeisTouch geis_touchset_touch(GeisTouchSet touchset, GeisSize index);

/**
 * Gets an identified touch from a touchset.
 * @memberof GeisTouchSet
 *
 * @param[in] touchset  The touchset.
 * @param[in] touchid   Identifies a touch.
 *
 * Returns the identified touch, or NULL if the touchid is not in the touchset.
 */
GEIS_API GeisTouch geis_touchset_touch_by_id(GeisTouchSet touchset,
                                             GeisTouchId  touchid);

/**
 * Gets the identifier of a touch.
 * @memberof GeisTouch
 *
 * @param[in] touch  The touch.
 */
GEIS_API GeisTouchId geis_touch_id(GeisTouch touch);

/**
 * Gets the number of attrs associated with a touch.
 * @memberof GeisTouch
 *
 * @param[in] touch  The touch.
 */
GEIS_API GeisSize geis_touch_attr_count(GeisTouch touch);

/**
 * Gets an indicated attr from a touch.
 * @memberof GeisTouch
 *
 * @param[in] touch  The touch.
 * @param[in] index  Indicates which attr to retrieve.
 */
GEIS_API GeisAttr geis_touch_attr(GeisTouch touch, GeisSize index);

/**
 * Gets a named attr from a touch.
 * @memberof GeisTouch
 *
 * @param[in] touch  The touch.
 * @param[in] name   Names the attr to retrieve.
 *
 * @returns the named attr if it is present, NULL otherwise.
 */
GEIS_API GeisAttr geis_touch_attr_by_name(GeisTouch touch, GeisString name);

/**
 * Gets the identifier of a gesture frame.
 * @memberof GeisFrame
 *
 * @param[in] frame  the gesture frame.
 *
 * @returns the identifier of the gesture to which the given frame belongs.
 */
GEIS_API GeisGestureId geis_frame_id(GeisFrame frame);

/**
 * Indicates if a gesture frame belongs to a gesture class.
 * @memberof GeisFrame
 *
 * @param[in] frame         The gesture frame.
 * @param[in] gesture_class The gesture class.
 *
 * @returns true if the gesture can currently be classified by the @p
 * gesture_class, false otherwise.
 */
GEIS_API GeisBoolean geis_frame_is_class(GeisFrame        frame,
                                         GeisGestureClass gesture_class);

/**
 * Gets the number of attrs associated with a gesture frame.
 * @memberof GeisFrame
 *
 * @param[in] frame  The gesture frame.
 */
GEIS_API GeisSize geis_frame_attr_count(GeisFrame frame);

/**
 * Gets an indicated attr from a gesture frame.
 * @memberof GeisFrame
 *
 * @param[in] frame  The gesture frame.
 * @param[in] index  Indicates which attr to retrieve.
 */
GEIS_API GeisAttr geis_frame_attr(GeisFrame frame, GeisSize index);

/**
 * Gets a named attr from a gesture frame.
 * @memberof GeisFrame
 *
 * @param[in] frame  The gesture frame.
 * @param[in] name   Names the attr to retrieve, such as one of the
 *                   GEIS_GESTURE_ATTRIBUTE_* constants.
 * @returns the named attr if it is present, NULL otherwise.
 *
 * Usage example:
 * @code
 * GeisAttr angle = geis_frame_attr_by_name(frame, GEIS_GESTURE_ATTRIBUTE_ANGLE);
 * @endcode
 */
GEIS_API GeisAttr geis_frame_attr_by_name(GeisFrame frame, GeisString name);

/**
 * Gets the current transform matrix of a gesture.
 * @memberof GeisFrame
 *
 * @param[in] frame  The gesture frame.
 */
GEIS_API GeisFloat *geis_frame_matrix(GeisFrame frame);

/**
 * Gets the number of touches making up a gesture for the frame.
 * @memberof GeisFrame
 *
 * @param[in] frame  The gesture frame.
 */
GEIS_API GeisSize geis_frame_touchid_count(GeisFrame frame);

/**
 * Gets the ID of the indicated touch within the gesture frame.
 * @memberof GeisFrame
 *
 * @param[in] frame  The gesture frame.
 * @param[in] index  Indicates which touch ID to retrieve.
 */
GEIS_API GeisTouchId geis_frame_touchid(GeisFrame frame, GeisSize index);

/**
 * Marks a gesture as accepted.
 *
 * @param[in] geis        The GEIS instance.
 * @param[in] group       The gesture group containing the accepted gesture.
 * @param[in] gesture_id  Identifies the gesture.
 *
 * @sa geis_frame_id
 */
GEIS_API GeisStatus geis_gesture_accept(Geis          geis,
                                        GeisGroup     group,
                                        GeisGestureId gesture_id);

/**
 * Marks a gesture as rejected.
 *
 * @param[in] geis        The GEIS instance.
 * @param[in] group       The gesture group containing the rejected gesture.
 * @param[in] gesture_id  Identifies the gesture.
 *
 * After you reject a gesture you no longer get its frames.
 *
 * @sa geis_frame_id
 */
GEIS_API GeisStatus geis_gesture_reject(Geis          geis,
                                        GeisGroup     group,
                                        GeisGestureId gesture_id);

/* @} */

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /* GEIS_GEIS_H_ */