2
* Copyright (c) 2009 Tias Guns
3
* Copyright (c) 2009 Soren Hauberg
5
* Permission is hereby granted, free of charge, to any person obtaining a copy
6
* of this software and associated documentation files (the "Software"), to deal
7
* in the Software without restriction, including without limitation the rights
8
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
* copies of the Software, and to permit persons to whom the Software is
10
* furnished to do so, subject to the following conditions:
12
* The above copyright notice and this permission notice shall be included in
13
* all copies or substantial portions of the Software.
15
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
31
* Number of blocks. We partition the screen into 'num_blocks' x 'num_blocks'
32
* rectangles of equal size. We then ask the user to press points that are
33
* located at the corner closes to the center of the four blocks in the corners
34
* of the screen. The following ascii art illustrates the situation. We partition
35
* the screen into 8 blocks in each direction. We then let the user press the
36
* points marked with 'O'.
38
* +--+--+--+--+--+--+--+--+
40
* +--O--+--+--+--+--+--O--+
42
* +--+--+--+--+--+--+--+--+
44
* +--+--+--+--+--+--+--+--+
46
* +--+--+--+--+--+--+--+--+
48
* +--+--+--+--+--+--+--+--+
50
* +--+--+--+--+--+--+--+--+
52
* +--O--+--+--+--+--+--O--+
54
* +--+--+--+--+--+--+--+--+
58
/* Names of the points */
61
UL = 0, /* Upper-left */
62
UR = 1, /* Upper-right */
63
LL = 2, /* Lower-left */
64
LR = 3 /* Lower-right */
69
/* original axis values */
72
/* Geometry of the calibration window */
73
GdkRectangle geometry;
75
/* nr of clicks registered */
78
/* click coordinates */
79
int clicked_x[4], clicked_y[4];
81
/* Threshold to keep the same point from being clicked twice.
82
* Set to zero if you don't want this check
84
int threshold_doubleclick;
86
/* Threshold to detect mis-clicks (clicks not along axes)
87
* A lower value forces more precise calibration
88
* Set to zero if you don't want this check
90
int threshold_misclick;
93
void reset (struct Calib *c);
94
gboolean add_click (struct Calib *c,
97
gboolean finish (struct Calib *c,
101
#endif /* _calibrator_h */